當前位置: 首頁>>代碼示例>>Java>>正文


Java PrintableResult類代碼示例

本文整理匯總了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)));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:18,代碼來源:PrintableResultTest.java

示例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")));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:11,代碼來源:UnsuccessfulWithDataPointFields.java

示例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")));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:11,代碼來源:UnsuccessfulWithDataPointFields.java

示例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")));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:14,代碼來源:UnsuccessfulWithDataPointFields.java

示例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")));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:14,代碼來源:UnsuccessfulWithDataPointFields.java

示例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"));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:8,代碼來源:TestWatcherTest.java

示例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"));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:8,代碼來源:TestWatcherTest.java

示例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"));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:8,代碼來源:TestWatcherTest.java

示例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"));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:9,代碼來源:TestWatcherTest.java

示例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>"));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:11,代碼來源:VerifierRuleTest.java

示例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));
}
 
開發者ID:DIVERSIFY-project,項目名稱:sosiefier,代碼行數:10,代碼來源:PrintableResultTest.java

示例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")));
}
 
開發者ID:MattiasBuelens,項目名稱:junit,代碼行數:11,代碼來源:UnsuccessfulWithDataPointFields.java

示例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


注:本文中的org.junit.experimental.results.PrintableResult類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。