当前位置: 首页>>代码示例>>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;未经允许,请勿转载。