本文整理汇总了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);
}
示例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();
}