Search in sources :

Example 1 with PrintableResult

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

the class ResultMatchersTest method hasFailureContaining_givenResultWithNoFailures.

@Test
public void hasFailureContaining_givenResultWithNoFailures() {
    PrintableResult resultWithNoFailures = new PrintableResult(new ArrayList<Failure>());
    assertThat(ResultMatchers.hasFailureContaining("").matches(resultWithNoFailures), is(false));
}
Also used : PrintableResult(org.junit.experimental.results.PrintableResult) Failure(org.junit.runner.notification.Failure) Test(org.junit.Test)

Example 2 with PrintableResult

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

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariableIsOnArrayTypeOnTheoryParm.

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

Example 3 with PrintableResult

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

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariableIsOnTheoryParm.

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

Example 4 with PrintableResult

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

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariableIsOnWildcardUpperBoundOnTheoryParm.

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

Example 5 with PrintableResult

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

the class WithUnresolvedGenericTypeVariablesOnTheoryParms method whereTypeVariableIsOnTheoryClass.

@Test
public void whereTypeVariableIsOnTheoryClass() {
    PrintableResult result = testResult(TypeVariableOnTheoryClass.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