package testlink; import br.eti.kinoshita.testlinkjavaapi.TestLinkAPI; import br.eti.kinoshita.testlinkjavaapi.TestLinkAPIException; import br.eti.kinoshita.testlinkjavaapi.model.TestCase; import br.eti.kinoshita.testlinkjavaapi.model.TestSuite; import br.eti.kinoshita.testlinkjavaapi.util.Util; import java.net.MalformedURLException; import java.net.URL; /** * Hello world! * http://testlinkjavaapi.sourceforge.net/sample1.html */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); String url = "http://xx/testlink/lib/api/xmlrpc.php"; String devKey = "xx"; TestLinkAPI api = null; URL testlinkURL = null; try { testlinkURL = new URL(url); } catch ( MalformedURLException mue ) { mue.printStackTrace( System.err ); System.exit(-1); } try { api = new TestLinkAPI(testlinkURL, devKey); } catch( TestLinkAPIException te) { te.printStackTrace( System.err ); System.exit(-1); } System.out.println(api.sayHello()); System.out.println(api.getTestProjectByName("xx")); TestSuite suite = api.getFirstLevelTestSuitesForTestProject(new Integer(1))[0]; TestCase[] testcases = api.getTestCasesForTestSuite(suite.getId(), true, null); for(int c = 0;c
The exported xml output from TestLink for the suite is
But the program output is
Hello! TestProject [id=1, name=Touchpoint, prefix=TP, notes=, enableRequirements=true, enableTestPriority=true, enableAutomation=true, enableInventory=true, isActive=true, isPublic=true] Install TestCase [id=3, name=Import Indexes, testSuiteId=null, testProjectId=null, authorLogin=null, summary=null, steps=[], preconditions=null, testImportance=null, executionType=null, order=100, internalId=null, checkDuplicatedName=null, actionOnDuplicatedName=null, versionId=2, version=null, parentId=2, customFields=[], executionStatus=n] n [] TestCase [id=5, name=Import Models, testSuiteId=null, testProjectId=null, authorLogin=null, summary=null, steps=[], preconditions=null, testImportance=null, executionType=null, order=101, internalId=null, checkDuplicatedName=null, actionOnDuplicatedName=null, versionId=2, version=null, parentId=2, customFields=[], executionStatus=n] nThere are no Custom Fields listed.
No comments:
Post a Comment