Search in sources :

Example 26 with PrintableResult

use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.

the class VerifierRuleTest method usedErrorCollectorCheckThrowsMatchingClassShouldPass.

@Test
public void usedErrorCollectorCheckThrowsMatchingClassShouldPass() {
    PrintableResult testResult = testResult(UsesErrorCollectorCheckThrowsMatchingClass.class);
    assertThat(testResult, isSuccessful());
}
Also used : PrintableResult(org.junit.experimental.results.PrintableResult) Test(org.junit.Test)

Example 27 with PrintableResult

use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.

the class VerifierRuleTest method usedErrorCollectorCheckSucceedsShouldFail.

@Test
public void usedErrorCollectorCheckSucceedsShouldFail() {
    PrintableResult testResult = testResult(UsesErrorCollectorCheckSucceeds.class);
    assertThat(testResult, hasFailureContaining("first!"));
    assertThat(testResult, hasFailureContaining("second!"));
}
Also used : PrintableResult(org.junit.experimental.results.PrintableResult) Test(org.junit.Test)

Example 28 with PrintableResult

use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariablesAbound.

@Test
public void whereTypeVariablesAbound() {
    PrintableResult result = testResult(TypeVariablesAbound.class);
    assertThat(result, failureCountIs(1));
    assertThat(result, hasFailureContaining("unresolved type variable A"));
    assertThat(result, hasFailureContaining("unresolved type variable B"));
    assertThat(result, hasFailureContaining("unresolved type variable C"));
    assertThat(result, hasFailureContaining("unresolved type variable D"));
    assertThat(result, hasFailureContaining("unresolved type variable E"));
    assertThat(result, hasFailureContaining("unresolved type variable F"));
    assertThat(result, hasFailureContaining("unresolved type variable G"));
}
Also used : PrintableResult(org.junit.experimental.results.PrintableResult) Test(org.junit.Test)

Example 29 with PrintableResult

use of org.junit.experimental.results.PrintableResult in project junit4 by junit-team.

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariableIsOnParameterizedTheoryParm.

@Test
public void whereTypeVariableIsOnParameterizedTheoryParm() {
    PrintableResult result = testResult(TypeVariableOnParameterizedTheoryParm.class);
    assertThat(result, hasSingleFailureContaining("unresolved type variable T"));
}
Also used : PrintableResult(org.junit.experimental.results.PrintableResult) Test(org.junit.Test)

Aggregations

PrintableResult (org.junit.experimental.results.PrintableResult)29 Test (org.junit.Test)27 Failure (org.junit.runner.notification.Failure)4 Theory (org.junit.experimental.theories.Theory)2