当前位置: 首页>>代码示例>>Java>>正文


Java TestResult.failed方法代码示例

本文整理汇总了Java中org.jboss.arquillian.test.spi.TestResult.failed方法的典型用法代码示例。如果您正苦于以下问题:Java TestResult.failed方法的具体用法?Java TestResult.failed怎么用?Java TestResult.failed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.arquillian.test.spi.TestResult的用法示例。


在下文中一共展示了TestResult.failed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: should_verify_failed_result_for_test_method_report

import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
@Test
public void should_verify_failed_result_for_test_method_report() throws ParseException {
    ExceptionHandlingTestCase.TestException exception = new ExceptionHandlingTestCase.TestException("cause");
    TestResult result = TestResult.failed(exception);

    TestMethodReport report = Reporter
            .createReport(new TestMethodReport("Report name"))
            .addEntries("entry")
            .setResult(result)
            .build();

    verifyBasicContent(report);

     FailureReport failureReport = Reporter.createReport(new FailureReport(METHOD_FAILURE_REPORT))
        .addKeyValueEntry(METHOD_FAILURE_REPORT_STACKTRACE, getHumanReadableStackTrace(result.getThrowable()))
        .build();

    // TODO: verify failure Report Generation - failure report not a sub report
    TestMethodReportAssert
        .assertThatTestMethodReport(report)
        .hasFailureReportsContainingExactly(failureReport)
        .hasStatus(TestResult.Status.FAILED);
}
 
开发者ID:arquillian,项目名称:arquillian-reporter,代码行数:24,代码来源:BuilderTest.java

示例2: should_move_recording_if_configured_in_only_failing_and_failed_test

import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
@Test
public void should_move_recording_if_configured_in_only_failing_and_failed_test()
    throws IOException, NoSuchMethodException {

    final File destination = temporaryFolder.newFolder("destination");
    final File video = temporaryFolder.newFile("file.flv");

    when(seleniumContainers.getVideoRecordingFile()).thenReturn(video.toPath());
    when(after.getTestClass()).thenReturn(new TestClass(VncRecorderLifecycleManagerTest.class));
    when(after.getTestMethod()).thenReturn(VncRecorderLifecycleManagerTest.class.getMethod(
        "should_move_recording_if_configured_in_only_failing_and_failed_test"));

    Map<String, String> conf = new HashMap<>();
    conf.put("videoOutput", destination.getAbsolutePath());
    conf.put("recordingMode", "ONLY_FAILING");

    TestResult testResult = TestResult.failed(new Throwable());

    VncRecorderLifecycleManager vncRecorderLifecycleManager = new VncRecorderLifecycleManager();
    vncRecorderLifecycleManager.vnc = cube;
    vncRecorderLifecycleManager.afterVideoRecordedEvent = event;
    vncRecorderLifecycleManager.stopRecording(after,
        testResult,
        CubeDroneConfiguration.fromMap(conf),
        seleniumContainers
    );

    assertThat(new File(destination,
        "org_arquillian_cube_docker_drone_VncRecorderLifecycleManagerTest_should_move_recording_if_configured_in_only_failing_and_failed_test.flv"))
        .exists();
}
 
开发者ID:arquillian,项目名称:arquillian-cube,代码行数:32,代码来源:VncRecorderLifecycleManagerTest.java


注:本文中的org.jboss.arquillian.test.spi.TestResult.failed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。