use of junit.framework.TestCase in project junit4 by junit-team.
the class TestCaseTest method testTearDownFails.
public void testTearDownFails() {
TestCase fails = new TestCase("success") {
@Override
protected void tearDown() {
throw new Error();
}
@Override
protected void runTest() {
}
};
verifyError(fails);
}
use of junit.framework.TestCase in project junit4 by junit-team.
the class TestCaseTest method testErrorTearingDownDoesntMaskErrorRunning.
public void testErrorTearingDownDoesntMaskErrorRunning() {
final Exception running = new Exception("Running");
TestCase t = new TestCase() {
@Override
protected void runTest() throws Throwable {
throw running;
}
@Override
protected void tearDown() throws Exception {
throw new Error("Tearing down");
}
};
try {
t.runBare();
} catch (Throwable thrown) {
assertSame(running, thrown);
}
}
use of junit.framework.TestCase in project junit4 by junit-team.
the class TestCaseTest method testError.
public void testError() {
TestCase error = new TestCase("error") {
@Override
protected void runTest() {
throw new Error();
}
};
verifyError(error);
}
use of junit.framework.TestCase in project junit4 by junit-team.
the class TestCaseTest method testFailure.
public void testFailure() {
TestCase failure = new TestCase("failure") {
@Override
protected void runTest() {
fail();
}
};
verifyFailure(failure);
}
use of junit.framework.TestCase in project junit4 by junit-team.
the class TestCaseTest method testSuccess.
public void testSuccess() {
TestCase success = new TestCase("success") {
@Override
protected void runTest() {
}
};
verifySuccess(success);
}
Aggregations