Search in sources :

Example 31 with JUnit4TestAdapter

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

the class ForwardCompatibilityTest method testExceptionInBefore.

public void testExceptionInBefore() {
    TestResult result = new TestResult();
    junit.framework.Test adapter = new JUnit4TestAdapter(ExceptionInBeforeTest.class);
    adapter.run(result);
    assertEquals(1, result.errorCount());
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 32 with JUnit4TestAdapter

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

the class ForwardCompatibilityTest method testException.

public void testException() {
    TestResult result = new TestResult();
    junit.framework.Test adapter = new JUnit4TestAdapter(ErrorTest.class);
    adapter.run(result);
    assertEquals(exception, result.errors().nextElement().thrownException());
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 33 with JUnit4TestAdapter

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

the class ForwardCompatibilityTest method testBeforeAndAfterClass.

public void testBeforeAndAfterClass() {
    log = "";
    TestResult result = new TestResult();
    junit.framework.Test adapter = new JUnit4TestAdapter(BeforeClassTest.class);
    adapter.run(result);
    assertEquals("before class before test after before test after after class ", log);
}
Also used : TestResult(junit.framework.TestResult) JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 34 with JUnit4TestAdapter

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

the class ForwardCompatibilityTest method testToString.

public void testToString() {
    JUnit4TestAdapter adapter = new JUnit4TestAdapter(NewTest.class);
    junit.framework.Test test = adapter.getTests().get(0);
    assertEquals(String.format("test(%s)", NewTest.class.getName()), test.toString());
}
Also used : JUnit4TestAdapter(junit.framework.JUnit4TestAdapter)

Example 35 with JUnit4TestAdapter

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

the class ForwardCompatibilityTest method testRunWithClass.

public void testRunWithClass() {
    wasRun = false;
    TestResult result = new TestResult();
    junit.framework.Test adapter = new JUnit4TestAdapter(NoTests.class);
    adapter.run(result);
    assertTrue(wasRun);
}
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