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());
}
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());
}
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);
}
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());
}
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);
}
Aggregations