use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.
the class TestWatcherTest method testWatcherSkippedThrowsException.
@Test
public void testWatcherSkippedThrowsException() {
PrintableResult result = testResult(TestWatcherSkippedThrowsExceptionTest.class);
assertThat(result, failureCountIs(2));
assertThat(result, hasFailureContaining("test failure"));
assertThat(result, hasFailureContaining("watcher failure"));
}
use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.
the class TestWatcherTest method testWatcherFailedAndFinishedThrowsException.
@Test
public void testWatcherFailedAndFinishedThrowsException() {
PrintableResult result = testResult(TestWatcherFailedAndFinishedThrowsExceptionTest.class);
assertThat(result, failureCountIs(3));
assertThat(result, hasFailureContaining("test failure"));
assertThat(result, hasFailureContaining("watcher failed failure"));
assertThat(result, hasFailureContaining("watcher finished failure"));
}
use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.
the class VerifierRuleTest method usedErrorCollectorCheckThrowsNothingThrownShouldFail.
@Test
public void usedErrorCollectorCheckThrowsNothingThrownShouldFail() {
PrintableResult testResult = testResult(UsesErrorCollectorCheckThrowsNothingThrown.class);
assertThat(testResult, hasFailureContaining("but nothing was thrown"));
}
use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.
the class VerifierRuleTest method usedErrorCollectorCheckSucceedsWithAssumptionViolatedExceptionShouldFail.
@Test
public void usedErrorCollectorCheckSucceedsWithAssumptionViolatedExceptionShouldFail() {
PrintableResult testResult = testResult(UsesErrorCollectorCheckSucceedsWithAssumptionViolatedException.class);
assertThat(testResult, hasSingleFailureMatching(CoreMatchers.<Throwable>instanceOf(AssertionError.class)));
assertThat(testResult, hasFailureContaining("Callable threw AssumptionViolatedException"));
}
use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.
the class VerifierRuleTest method usedErrorCollectorCheckSucceedsShouldPass.
@Test
public void usedErrorCollectorCheckSucceedsShouldPass() {
PrintableResult testResult = testResult(UsesErrorCollectorCheckSucceedsPasses.class);
assertThat(testResult, isSuccessful());
}
Aggregations