public void testCaseEnded(TestCase test) { String status = "ended"; //$NON-NLS-1$ String error = null; if (test.getStatus().isError()) { status = "had an error"; //$NON-NLS-1$ error = test.getStatus().getMessage(); } if (test.getStatus().isFailure()) { status = "failed"; //$NON-NLS-1$ error = test.getStatus().getMessage(); } if (test.getStatus().isAborted()) { status = "was aborted"; //$NON-NLS-1$ } if (test.getStatus().isPassed()) { status = "passed"; //$NON-NLS-1$ } screen.println("Test Case " + status + ": " + test.getName() + "." //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ((error != null) ? error : "")); //$NON-NLS-1$ }
public void abortTest() { if (isRunning()) { fAbortedByUser = true; if (fCurrentTestCase != null) { fCurrentTestCase.abortTest(); } } }
public Context createVelocityContext() throws DataSourceException { return fTestCase.createVelocityContext(); }
@Override public String toString() { return getName(); }
/** * Creates a new Velocity context that extends the VelocityContext of the * test suite with information about this test case. To keep test cases * isolated, the context does not wrap the test suite context, but clones * and extends it. To reduce overhead, the test suite context is cached so * it is only produced the first time. * * @return VelocityContext with information about the test suite and test * case. * @throws DataSourceException * */ public Context createVelocityContext() throws DataSourceException { if (fTestSuiteVelocityContext == null) { fTestSuiteVelocityContext = getSuite().createVelocityContext(); } Context ctx = CLONER.deepClone(fTestSuiteVelocityContext); ctx.put("testCaseName", getRawName()); if (fDataSource != null) { DataSourceUtil.initializeContext(ctx, fDataSource, fRowIndex); } if (fSetUpVelocityScript != null) { StringWriter sW = new StringWriter(); Velocity.evaluate(ctx, sW, "setUpTestCase", fSetUpVelocityScript); } return ctx; }
private void readHumanPartner(Map<String, HumanPartner> suiteHumanPartners, String testDirectory, TestCase test, XMLHumanPartnerTrack xmlHumanPartnerTrack) throws SpecificationException { String xmlPartnerTrackName = xmlHumanPartnerTrack.getName(); HumanPartner realPartner = suiteHumanPartners.get(xmlPartnerTrackName); PartnerTrack pTrack = new PartnerTrack(test, realPartner); readActivities(pTrack, xmlHumanPartnerTrack, testDirectory); pTrack.setNamespaceContext(getNamespaceMap(xmlHumanPartnerTrack .newCursor())); test.addPartnerTrack(pTrack); }
public List<ITestArtefact> getChildren() { List<ITestArtefact> children= new ArrayList<ITestArtefact>(); for (PartnerTrack track : getPartnerTracks()) { children.add(track); } return children; }
private void readMetaData(XMLTestCase xmlTestCase, TestCase test) { for (XMLProperty data : xmlTestCase.getPropertyList()) { String xmlPropertyName = data.getName(); String xmlPropertyData = data.getStringValue(); test.addProperty(xmlPropertyName, xmlPropertyData); } }
private TestCase createTestCase(Map<String, Partner> suitePartners, Map<String, HumanPartner> suiteHumanPartners, Partner suiteClient, TestSuite suite, XMLTestCase xmlTestCase, String xmlTestCaseName, int round, String testDirectory) throws SpecificationException { TestCase test = new TestCase(suite, xmlTestCaseName); readMetaData(xmlTestCase, test); readTestCaseSetUpBlock(test, xmlTestCase); readClientTrack(suiteClient, xmlTestCase, round, testDirectory, test); // Partners Partner Track readPartners(suitePartners, xmlTestCase, round, testDirectory, test); readHumanPartners(suiteHumanPartners, xmlTestCase, testDirectory, test); return test; }
public void addTestCase(TestCase test) { fTestCaseMap.put(test.getName().toLowerCase(), test); }
private void readClientTrack(Partner suiteClient, XMLTestCase xmlTestCase, int round, String testDirectory, TestCase test) throws SpecificationException { XMLTrack xmlClientTrack = xmlTestCase.getClientTrack(); PartnerTrack track = new PartnerTrack(test, suiteClient); readActivities(track, xmlTestCase, xmlClientTrack, round, testDirectory); track.setNamespaceContext(getNamespaceMap(xmlClientTrack.newCursor())); test.addPartnerTrack(track); }
private void initializePartnerTracks(TestCase caseToRun) { List<PartnerTrack> partnerTracks = caseToRun.getPartnerTracks(); for (PartnerTrack partnerTrack : partnerTracks) { partnerTrack.initialize(this); } fPartnerTracks = new HashMap<PartnerTrack, PartnerTrackResult>(); for (PartnerTrack head : partnerTracks) { fPartnerTracks.put(head, PartnerTrackResult.RUNNING); } }
public List<String> getTestCases() { List<String> testCases = new ArrayList<String>(); for (Iterator<TestCase> iter = fTestCaseMap.values().iterator(); iter .hasNext();) { testCases.add(iter.next().getName()); } return testCases; }
private void readPartner(Map<String, Partner> suitePartners, XMLTestCase xmlTestCase, int round, String testDirectory, TestCase test, XMLPartnerTrack xmlPartnerTrack) throws SpecificationException { String xmlPartnerTrackName = xmlPartnerTrack.getName(); Partner realPartner = suitePartners.get(xmlPartnerTrackName); PartnerTrack pTrack = new PartnerTrack(test, realPartner); readActivities(pTrack, xmlTestCase, xmlPartnerTrack, round, testDirectory); pTrack.setNamespaceContext(getNamespaceMap(xmlPartnerTrack.newCursor())); if (xmlPartnerTrack.isSetAssume()) { pTrack.setAssumption(xmlPartnerTrack.getAssume()); } test.addPartnerTrack(pTrack); }
transferState(testCase, xmlTestCase); List<PartnerTrack> partnerTracks= testCase.getPartnerTracks(); for (PartnerTrack track : partnerTracks) { XMLPartnerTrack xmlPartnerTrack= xmlTestCase.addNewPartnerTrack();
public void testCaseStarted(TestCase test) { if (verbose) { screen.println(Messages.getString("BPELUnitCommandLineRunner.MSG_PROGRESS_TESTCASE_STARTED") + test.getName() + ".\n"); //$NON-NLS-1$ //$NON-NLS-2$ } }