private void checkFinished() { if (finished) { throw new IllegalStateException("Test suite " + testSuite.getName() + " is already finished"); } }
private JUnitTestcase findTest(TestSuite suite, String methodName){ JUnitTestcase ret = null; for(Testcase tcase: suite.getTestcases()){ if (tcase.getName().equals(methodName)){ ret = (JUnitTestcase)tcase; break; } } return ret; }
if ((reportFile != null) && isValidReportFile(reportFile)) { JUnitTestSuite reportSuite = parseReportFile(reportFile); if ((reportSuite != null) && (reportSuite.getName().equals(currentSuite.getName()))) { lastSuiteTime = reportSuite.getElapsedTime(); for(Testcase tc: currentSuite.getTestcases()){ if (!tc.getOutput().isEmpty()){ List<String> output = new ArrayList(); currentSuite.getTestcases().clear(); currentSuite.getTestcases().addAll(reportSuite.getTestcases());
@NbBundle.Messages({ "# {0} - provider name", "# {1} - suite name", "TestSessionImpl.suite.name=[{0}] {1}", }) @Override public TestSuite addTestSuite(String name, FileObject location) { Parameters.notWhitespace("name", name); // NOI18N checkFrozen(); String suiteName = Bundle.TestSessionImpl_suite_name(testingProvider.getDisplayName(), name); org.netbeans.modules.gsf.testrunner.api.TestSuite testSuite = new org.netbeans.modules.gsf.testrunner.api.TestSuite(suiteName); manager.displaySuiteRunning(testSession, suiteName); testSession.addSuite(testSuite); return new TestSuiteImpl(this, testSuite, location); }
private File findReportFile() { File file = new File(resultsDir, "TEST-" + testSession.getCurrentSuite().getName() + ".xml"); //NOI18N return (file.isFile() ? file : null); }
private void suiteFinished(int total, int failures, int errors ,long time) { int addFail = failures; int addError = errors; int addPass = total - failures - errors; for(Testcase tc: testSession.getCurrentSuite().getTestcases()){ switch(tc.getStatus()){ case ERROR: addError--;break; case FAILED: addFail--;break; default: addPass--; } } for(int i=0; i<addPass; i++){ JUnitTestcase tc = new JUnitTestcase("Unknown", "Unknown", testSession); //NOI18N tc.setStatus(Status.PASSED); testSession.addTestCase(tc); } for(int i=0; i<addFail; i++){ JUnitTestcase tc = new JUnitTestcase("Unknown", "Unknown", testSession); //NOI18N tc.setStatus(Status.FAILED); testSession.addTestCase(tc); } for(int i=0; i<addError; i++){ JUnitTestcase tc = new JUnitTestcase("Unknown", "Unknown", testSession); //NOI18N tc.setStatus(Status.ERROR); testSession.addTestCase(tc); } lastSuiteTime = time; state = State.SUITE_FINISHED; }
private String getClassName() { String className = testCase.getClassName(); if (className != null) { return className; } className = testSuite.getTestSuite().getName(); assert className != null; return className; }
/** * Displays a node with a message about a test suite running. * * @param suite running test suite, * or {@code ANONYMOUS_TEST_SUITE} for anonymous suites * @see ResultDisplayHandler#ANONYMOUS_TEST_SUITE */ void displaySuiteRunning(final TestSuite suite) { /* * Called from the EventDispatch thread. */ assert EventQueue.isDispatchThread(); runningSuiteName = suite.getName(); maybeInitializeNewSuiteNode(suite); refresh(false); }
/** * * @param suite name of the running suite */ public void displaySuiteRunning(TestSuite suite) { synchronized (this) { assert runningSuite == null; suite = (suite != null) ? suite : TestSuite.ANONYMOUS_TEST_SUITE; if (treePanel == null) { runningSuite = suite.getName(); return; } } displayInDispatchThread(prepareMethod("displaySuiteRunning", TestSuite.class), suite); //NOI18N }
public void openTestsuite(TestsuiteNode node) { TestSuite suite = node.getSuite(); if ((suite != null) && (suite instanceof TestSuite)) { final FileObject fo = ((TestNGTestSuite) suite).getSuiteFO(); if (fo != null) { int[] location = XmlSuiteHandler.getSuiteLocation(fo, suite.getName()); UIJavaUtils.openFile(fo, location[0], location[1]); } } }