@Test public void testRetrieveTestCaseForBuild() { try { this.loadXMLRPCMockData("tl.getTestPlanByName.xml"); TestPlan plan = this.api.getTestPlanByName("Sample plan", "Sample project"); this.loadXMLRPCMockData("tl.getLatestBuildForTestPlan.xml"); Build build = this.api.getLatestBuildForTestPlan(plan.getId()); Assert.assertNotNull(build); this.loadXMLRPCMockData("tl.getTestCasesForTestPlan.xml"); TestCase[] tcs = this.api.getTestCasesForTestPlan( plan.getId(), null, null, null, null, Boolean.TRUE, null, null, null, null, null); for (TestCase tc : tcs) { Assert.assertNotNull(tc.getExecutionStatus()); if (tc.getExecutionStatus() != ExecutionStatus.NOT_RUN) { this.loadXMLRPCMockData("tl.getLastExecutionResult.xml"); Execution execution = this.api.getLastExecutionResult(plan.getId(), tc.getId(), null); Assert.assertNotNull(execution); } } } catch (TestLinkAPIException e) { Assert.fail("" + e.getMessage(), e); } }
protected void setUp() { testCase = new TestCase(); testCase.setId(100); build = new Build(); build.setId(100); testPlan = new TestPlan(); testPlan.setId(100); testResult = new TestCaseWrapper(testCase); CustomField cf = new CustomField(); cf.setName("nz"); testResult.getCustomFields().add(cf); cf = new CustomField(); cf.setName("au"); testResult.getCustomFields().add(cf); }