本文整理匯總了Java中org.junit.experimental.results.PrintableResult類的典型用法代碼示例。如果您正苦於以下問題:Java PrintableResult類的具體用法?Java PrintableResult怎麽用?Java PrintableResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
PrintableResult類屬於org.junit.experimental.results包,在下文中一共展示了PrintableResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: backTraceHasGoodToString
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Theory(nullsAccepted = false)
public void backTraceHasGoodToString(String descriptionName,
final String stackTraceClassName) {
Failure failure = new Failure(Description
.createSuiteDescription(descriptionName), new Throwable() {
private static final long serialVersionUID = 1L;
@Override
public StackTraceElement[] getStackTrace() {
return new StackTraceElement[]{new StackTraceElement(
stackTraceClassName, "methodName", "fileName", 1)};
}
});
assertThat(new PrintableResult(asList(failure)).toString(), allOf(
containsString(descriptionName), containsString(stackTraceClassName)));
}
示例2: whereTypeVariablesAbound
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void whereTypeVariablesAbound() {
PrintableResult result = testResult(TypeVariablesAbound.class);
assertThat(result, failureCountIs(7));
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"));
}
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:13,代碼來源:WithUnresolvedGenericTypeVariablesOnTheoryParms.java
示例3: dataPointFieldsMustBeStatic
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void dataPointFieldsMustBeStatic() {
assertThat(
testResult(DataPointFieldsMustBeStatic.class),
CoreMatchers.<PrintableResult>both(failureCountIs(2))
.and(
hasFailureContaining("DataPoint field THREE must be static"))
.and(
hasFailureContaining("DataPoint field FOURS must be static")));
}
示例4: dataPointMethodsMustBeStatic
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void dataPointMethodsMustBeStatic() {
assertThat(
testResult(DataPointMethodsMustBeStatic.class),
CoreMatchers.<PrintableResult>both(failureCountIs(2))
.and(
hasFailureContaining("DataPoint method singleDataPointMethod must be static"))
.and(
hasFailureContaining("DataPoint method dataPointArrayMethod must be static")));
}
示例5: dataPointFieldsMustBePublic
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void dataPointFieldsMustBePublic() {
PrintableResult result = testResult(DataPointFieldsMustBePublic.class);
assertEquals(6, result.failureCount());
assertThat(result,
allOf(hasFailureContaining("DataPoint field THREE must be public"),
hasFailureContaining("DataPoint field THREES must be public"),
hasFailureContaining("DataPoint field FOUR must be public"),
hasFailureContaining("DataPoint field FOURS must be public"),
hasFailureContaining("DataPoint field FIVE must be public"),
hasFailureContaining("DataPoint field FIVES must be public")));
}
示例6: dataPointMethodsMustBePublic
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void dataPointMethodsMustBePublic() {
PrintableResult result = testResult(DataPointMethodsMustBePublic.class);
assertEquals(6, result.failureCount());
assertThat(result,
allOf(hasFailureContaining("DataPoint method three must be public"),
hasFailureContaining("DataPoint method threes must be public"),
hasFailureContaining("DataPoint method four must be public"),
hasFailureContaining("DataPoint method fours must be public"),
hasFailureContaining("DataPoint method five must be public"),
hasFailureContaining("DataPoint method fives must be public")));
}
示例7: testWatcherSkippedThrowsException
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void testWatcherSkippedThrowsException() {
PrintableResult result = testResult(TestWatcherSkippedThrowsExceptionTest.class);
assertThat(result, failureCountIs(2));
assertThat(result, hasFailureContaining("test failure"));
assertThat(result, hasFailureContaining("watcher failure"));
}
示例8: testWatcherFailedThrowsException
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void testWatcherFailedThrowsException() {
PrintableResult result = testResult(TestWatcherFailedThrowsExceptionTest.class);
assertThat(result, failureCountIs(2));
assertThat(result, hasFailureContaining("test failure"));
assertThat(result, hasFailureContaining("watcher failure"));
}
示例9: testWatcherStartingThrowsException
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void testWatcherStartingThrowsException() {
PrintableResult result = testResult(TestWatcherStartingThrowsExceptionTest.class);
assertThat(result, failureCountIs(2));
assertThat(result, hasFailureContaining("test failure"));
assertThat(result, hasFailureContaining("watcher failure"));
}
示例10: testWatcherFailedAndFinishedThrowsException
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@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"));
}
示例11: usedErrorCollectorCheckThatShouldFail
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void usedErrorCollectorCheckThatShouldFail() {
PrintableResult testResult = testResult(UsesErrorCollectorCheckThat.class);
assertThat(testResult, hasFailureContaining("was <3>"));
assertThat(testResult, hasFailureContaining("was <5>"));
assertThat(testResult, hasFailureContaining("reason 1"));
assertThat(testResult, hasFailureContaining("was <7>"));
assertThat(testResult, hasFailureContaining("reason 2"));
assertThat(testResult, hasFailureContaining("was <9>"));
}
示例12: includeMultipleFailures
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Theory
public void includeMultipleFailures(String secondExceptionName) {
PrintableResult backtrace = new PrintableResult(Arrays.asList(
new Failure(Description.createSuiteDescription("firstName"),
new RuntimeException("firstException")), new Failure(
Description.createSuiteDescription("secondName"),
new RuntimeException(secondExceptionName))));
assertThat(backtrace.toString(), containsString(secondExceptionName));
}
示例13: dataPointsMustBeStatic
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void dataPointsMustBeStatic() {
assertThat(
testResult(DataPointsMustBeStatic.class),
CoreMatchers.<PrintableResult>both(failureCountIs(2))
.and(
hasFailureContaining("DataPoint field THREE must be static"))
.and(
hasFailureContaining("DataPoint field FOUR must be static")));
}
示例14: whereTypeVariableIsOnTheTheory
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void whereTypeVariableIsOnTheTheory() {
PrintableResult result = testResult(TypeVariableOnTheoryOnly.class);
assertThat(result, isSuccessful());
}
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:6,代碼來源:WithUnresolvedGenericTypeVariablesOnTheoryParms.java
示例15: whereTypeVariableIsOnTheoryParm
import org.junit.experimental.results.PrintableResult; //導入依賴的package包/類
@Test
public void whereTypeVariableIsOnTheoryParm() {
PrintableResult result = testResult(TypeVariableOnTheoryParm.class);
assertThat(result, hasSingleFailureContaining("unresolved type variable T"));
}
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:6,代碼來源:WithUnresolvedGenericTypeVariablesOnTheoryParms.java