Search in sources :

Example 1 with WasRun

use of junit.tests.WasRun in project junit4 by junit-team.

the class ExtensionTest method testSetupErrorDontTearDown.

public void testSetupErrorDontTearDown() {
    WasRun test = new WasRun();
    TornDown wrapper = new TornDown(test) {

        @SuppressWarnings("deprecation")
        @Override
        public void setUp() {
            fail();
        }
    };
    TestResult result = new TestResult();
    wrapper.run(result);
    assertTrue(!wrapper.fTornDown);
}
Also used : WasRun(junit.tests.WasRun) TestResult(junit.framework.TestResult)

Example 2 with WasRun

use of junit.tests.WasRun in project junit4 by junit-team.

the class TestCaseTest method testWasRun.

public void testWasRun() {
    WasRun test = new WasRun();
    test.run();
    assertTrue(test.fWasRun);
}
Also used : WasRun(junit.tests.WasRun)

Example 3 with WasRun

use of junit.tests.WasRun in project junit4 by junit-team.

the class ExtensionTest method testSetupErrorInTestSetup.

public void testSetupErrorInTestSetup() {
    WasRun test = new WasRun();
    TestSetup wrapper = new TestSetup(test) {

        @SuppressWarnings("deprecation")
        @Override
        public void setUp() {
            fail();
        }
    };
    TestResult result = new TestResult();
    wrapper.run(result);
    assertTrue(!test.fWasRun);
    assertTrue(!result.wasSuccessful());
}
Also used : WasRun(junit.tests.WasRun) TestSetup(junit.extensions.TestSetup) TestResult(junit.framework.TestResult)

Aggregations

WasRun (junit.tests.WasRun)3 TestResult (junit.framework.TestResult)2 TestSetup (junit.extensions.TestSetup)1