Search in sources :

Example 21 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project bnd by bndtools.

the class JUnitEclipseReport method report.

private void report(List<Test> flattened) {
    for (int i = 0; i < flattened.size(); i++) {
        StringBuffer sb = new StringBuffer();
        sb.append(i + 1);
        sb.append(",");
        Test test = flattened.get(i);
        if (test instanceof TestSuite || test instanceof JUnit4TestAdapter) {
            sb.append(test);
            sb.append(",");
            sb.append(true);
        } else {
            sb.append(test);
            sb.append(",");
            sb.append(false);
        }
        sb.append(",");
        sb.append(test.countTestCases());
        message("%TSTTREE", sb.toString());
    }
}
Also used : TestSuite(junit.framework.TestSuite) Test(junit.framework.Test) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 22 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project java-common-lib by sosy-lab.

the class NaiveOrderStatisticSetTest method suite.

public static junit.framework.Test suite() {
    TestSortedSetGenerator<String> testSetGenerator = new OrderStatisticsSetProxyFactory();
    TestSuite suite = NavigableSetTestSuiteBuilder.using(testSetGenerator).named("NaiveOrderStatisticSet").withFeatures(CollectionSize.ANY, SetFeature.GENERAL_PURPOSE, CollectionFeature.KNOWN_ORDER, CollectionFeature.SERIALIZABLE_INCLUDING_VIEWS).createTestSuite();
    suite.addTest(new JUnit4TestAdapter(NaiveOrderStatisticSetTest.class));
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 23 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project java-common-lib by sosy-lab.

the class PersistentLinkedListTest method suite.

public static junit.framework.Test suite() throws NoSuchMethodException {
    TestSuite suite = new TestSuite();
    suite.addTest(new JUnit4TestAdapter(PersistentLinkedListTest.class));
    suite.addTest(ListTestSuiteBuilder.using(listGenerator).named("PersistentLinkedList").withFeatures(CollectionFeature.KNOWN_ORDER, CollectionSize.ANY).suppressing(// These tests all rely on a fully implemented ListIterator.
    ListLastIndexOfTester.class.getMethod("testFind_wrongType"), ListLastIndexOfTester.class.getMethod("testFind_no"), ListLastIndexOfTester.class.getMethod("testFind_yes"), ListLastIndexOfTester.class.getMethod("testFind_nullNotContainedAndUnsupported"), ListLastIndexOfTester.class.getMethod("testLastIndexOf_duplicate"), ListListIteratorTester.class.getMethod("testListIterator_tooLow"), ListListIteratorTester.class.getMethod("testListIterator_unmodifiable"), ListSubListTester.class.getMethod("testSubList_lastIndexOf")).createTestSuite());
    return suite;
}
Also used : ListSubListTester(com.google.common.collect.testing.testers.ListSubListTester) TestSuite(junit.framework.TestSuite) ListListIteratorTester(com.google.common.collect.testing.testers.ListListIteratorTester) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) ListLastIndexOfTester(com.google.common.collect.testing.testers.ListLastIndexOfTester)

Example 24 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project eclipse.platform.releng by eclipse.

the class AllRelengTests method suite.

public static TestSuite suite() {
    TestSuite suite = new TestSuite();
    suite.addTest(new JUnit4TestAdapter(BuildTests.class));
    if (isJGitAvailable())
        suite.addTest(new JUnit4TestAdapter(GitCopyrightAdapterTest.class));
    return suite;
}
Also used : TestSuite(junit.framework.TestSuite) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 25 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project cucumber-jvm by cucumber.

the class SanityChecker method run.

static void run(Class<?> testClass, boolean debug) {
    JUnit4TestAdapter testAdapter = new JUnit4TestAdapter(testClass);
    TestResult result = new TestResult();
    SanityChecker listener = new SanityChecker();
    result.addListener(listener);
    testAdapter.run(result);
    String output = listener.getOutput();
    if (output.contains(INSANITY)) {
        throw new RuntimeException("Something went wrong\n" + output);
    }
    if (debug) {
        System.out.println("===== " + testClass.getName());
        System.out.println(output);
        System.out.println("=====");
    }
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Aggregations

JUnit4TestAdapter (junit.framework.JUnit4TestAdapter)74 TestSuite (junit.framework.TestSuite)50 TestResult (junit.framework.TestResult)17 Test (org.junit.Test)6 Test (junit.framework.Test)2 Result (org.junit.runner.Result)2 I18nManagerTest (com.agiletec.aps.system.services.i18n.I18nManagerTest)1 I18nManagerCacheWrapperTest (com.agiletec.aps.system.services.i18n.cache.I18nManagerCacheWrapperTest)1 KeyGeneratorManagerTest (com.agiletec.aps.system.services.keygenerator.KeyGeneratorManagerTest)1 LangManagerTest (com.agiletec.aps.system.services.lang.LangManagerTest)1 ContentManagerTest (com.agiletec.plugins.jacms.aps.system.services.content.ContentManagerTest)1 ContentModelManagerTest (com.agiletec.plugins.jacms.aps.system.services.contentmodel.ContentModelManagerTest)1 ContentPageMapperManagerTest (com.agiletec.plugins.jacms.aps.system.services.contentpagemapper.ContentPageMapperManagerTest)1 ContentMapperCacheWrapperTest (com.agiletec.plugins.jacms.aps.system.services.contentpagemapper.cache.ContentMapperCacheWrapperTest)1 ResourceManagerTest (com.agiletec.plugins.jacms.aps.system.services.resource.ResourceManagerTest)1 ListLastIndexOfTester (com.google.common.collect.testing.testers.ListLastIndexOfTester)1 ListListIteratorTester (com.google.common.collect.testing.testers.ListListIteratorTester)1 ListSubListTester (com.google.common.collect.testing.testers.ListSubListTester)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1