Package junit.framework

Examples of junit.framework.TestSuite.testCount()


      return suite;
    }
   
    addTestMethod(suite, constructor, testMethodName);

    if (suite.testCount() == 0) {
      suite.addTest(warning("No tests found in " + testClass.getName()));
    }
   
    return suite;
  }
View Full Code Here


                    onlyRunSlowTests = true;
                }
            }
            System.out.println("Running all tests in '" + jarFile + "'");
            TestSuite suite = (TestSuite) suite();
            System.out.println("Found '" + suite.testCount() + "' test classes in jar file.");
            TestResult res = junit.textui.TestRunner.run(suite);
            System.exit(res.wasSuccessful() ? 0 : 1);
        } else {
            usage();
        }
View Full Code Here

    suite.run(fResult);
    assertEquals(1, fResult.runCount());
  }
  public void testCreateSuiteFromArray() {
    TestSuite suite = new TestSuite(OneTestCase.class, DoublePrecisionAssertTest.class);
    assertEquals(2, suite.testCount());
    assertEquals("junit.tests.framework.DoublePrecisionAssertTest" , ((TestSuite)suite.testAt(1)).getName());
    assertEquals("junit.tests.framework.OneTestCase" , ((TestSuite)suite.testAt(0)).getName());
  }
}
View Full Code Here

    }

    @Test
    public void testGetTest() throws Exception {
        TestSuite suite = (TestSuite) testCreator.getTest("subdir.AllTests");
        assertEquals("Test count in suite", 2, suite.testCount());
    }

    @Test
    public void testGetTestMultiple() throws Exception {
        List<String> testCaseList = new ArrayList<String>();
View Full Code Here

     * Gets the number of tests.
     */
    public int getChildCount(Object parent) {
        TestSuite suite = isTestSuite(parent);
        if (suite != null)
            return suite.testCount();
        return 0;
    }

    /**
     * Gets the index of a test in a test suite
View Full Code Here

    private void addSelectedSuitesToSuite() {
        Test selectedTest = testSuitesPanel.getSelectedTest();
        if (selectedTest != null)
            if (selectedTest instanceof TestSuite) {
                TestSuite suite = (TestSuite) selectedTest;
                for (int i = 0; i < suite.testCount(); i++) {
                    Test suiteAt = suite.testAt(i);
                    if (((TestSuite) suiteAt).getName().equals(dataMap.get("filename"))) {
                        JOptionPane.showMessageDialog(null, "A suite cannot be added to self.");
                        continue;
                    }
View Full Code Here

      return Description.createTestDescription(tc.getClass(), tc.getName());
    } else if (test instanceof TestSuite) {
      TestSuite ts= (TestSuite) test;
      String name= ts.getName() == null ? "" : ts.getName();
      Description description= Description.createSuiteDescription(name);
      int n= ts.testCount();
      for (int i= 0; i < n; i++)
        description.addChild(makeDescription(ts.testAt(i)));
      return description;
    } else if (test instanceof Describable) {
      Describable adapter= (Describable) test;
View Full Code Here

        this.client.createCollection(INSTANCE_NAME, TEST_COLLECTION_NAME);

        // now we set all tests with the client
        // we have an TestSuite of TestSuite of AbstractXmlDbClientTest :-)
        TestSuite suite = (TestSuite) fTest;
        for (int ii = 0; ii < suite.testCount(); ii++) {
            TestSuite subSuite = (TestSuite) suite.testAt(ii);
            for (int jj = 0; jj < subSuite.testCount(); jj++) {
                Object obj = subSuite.testAt(jj);
                if (obj instanceof AbstractXmlDbClientTest) {
                    AbstractXmlDbClientTest test = (AbstractXmlDbClientTest) obj;
View Full Code Here

        // now we set all tests with the client
        // we have an TestSuite of TestSuite of AbstractXmlDbClientTest :-)
        TestSuite suite = (TestSuite) fTest;
        for (int ii = 0; ii < suite.testCount(); ii++) {
            TestSuite subSuite = (TestSuite) suite.testAt(ii);
            for (int jj = 0; jj < subSuite.testCount(); jj++) {
                Object obj = subSuite.testAt(jj);
                if (obj instanceof AbstractXmlDbClientTest) {
                    AbstractXmlDbClientTest test = (AbstractXmlDbClientTest) obj;
                    test.setXmlDbClient(this.client);
                }
View Full Code Here

      return Description.createTestDescription(tc.getClass(), tc.getName());
    } else if (test instanceof TestSuite) {
      TestSuite ts= (TestSuite) test;
      String name= ts.getName() == null ? "" : ts.getName();
      Description description= Description.createSuiteDescription(name);
      int n= ts.testCount();
      for (int i= 0; i < n; i++)
        description.addChild(makeDescription(ts.testAt(i)));
      return description;
    } else if (test instanceof JUnit4TestAdapter) {
      JUnit4TestAdapter adapter= (JUnit4TestAdapter) test;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.