Search in sources :

Example 26 with JUnit4TestAdapter

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

the class SanityChecker method run.

public 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)

Example 27 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.

the class SuiteTest method forwardCompatibilityWorksWithGetTests.

@Test
public void forwardCompatibilityWorksWithGetTests() {
    JUnit4TestAdapter adapter = new JUnit4TestAdapter(All.class);
    List<? extends junit.framework.Test> tests = adapter.getTests();
    assertEquals(2, tests.size());
}
Also used : JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) Test(org.junit.Test)

Example 28 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.

the class SuiteTest method forwardCompatibilityWorksWithTestCount.

@Test
public void forwardCompatibilityWorksWithTestCount() {
    JUnit4TestAdapter adapter = new JUnit4TestAdapter(All.class);
    assertEquals(2, adapter.countTestCases());
}
Also used : JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) Test(org.junit.Test)

Example 29 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.

the class SuiteTest method ensureSuitesWorkWithForwardCompatibility.

@Test
public void ensureSuitesWorkWithForwardCompatibility() {
    junit.framework.Test test = new JUnit4TestAdapter(All.class);
    TestResult result = new TestResult();
    test.run(result);
    assertEquals(2, result.runCount());
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter) Test(org.junit.Test)

Example 30 with JUnit4TestAdapter

use of junit.framework.JUnit4TestAdapter in project junit4 by junit-team.

the class ForwardCompatibilityTest method testNoException.

public void testNoException() {
    TestResult result = new TestResult();
    junit.framework.Test adapter = new JUnit4TestAdapter(NoExceptionTest.class);
    adapter.run(result);
    assertFalse(result.wasSuccessful());
}
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