本文整理汇总了Java中org.jboss.arquillian.test.spi.TestResult.getStatus方法的典型用法代码示例。如果您正苦于以下问题:Java TestResult.getStatus方法的具体用法?Java TestResult.getStatus怎么用?Java TestResult.getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.arquillian.test.spi.TestResult
的用法示例。
在下文中一共展示了TestResult.getStatus方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isTakingAction
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
@Override
public boolean isTakingAction(Event event, TestResult result) {
if (event instanceof AfterTestLifecycleEvent && !(event instanceof After)) {
Screenshot screenshotAnnotation = ScreenshotAnnotationScanner.getScreenshotAnnotation(((AfterTestLifecycleEvent) event).getTestMethod());
if (screenshotAnnotation != null) {
if (screenshotAnnotation.takeAfterTest()) {
return true;
}
if (result.getStatus() == Status.FAILED && screenshotAnnotation.takeWhenTestFailed()) {
return true;
}
}
}
return false;
}
示例2: onStopRecording
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
public void onStopRecording(@Observes StopRecordVideo event) throws IOException {
Video video = recorder.get().stopRecording();
TestResult testResult = event.getVideoMetaData().getTestResult();
if (testResult != null) {
Status status = testResult.getStatus();
appendStatus(video, status);
resourceRegister.get().addReported(video);
if ((status.equals(Status.PASSED) && !configuration.get().getTakeOnlyOnFail())
|| (status.equals(Status.FAILED) && configuration.get().getTakeOnlyOnFail())) {
propertyReportEvent.fire(new PropertyReportEvent(getVideoEntry(video)));
}
} else {
resourceRegister.get().addTaken(video);
}
}
示例3: setResult
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
public TestMethodReportBuilderImpl setResult(TestResult result) {
if (result.getStatus() == TestResult.Status.FAILED && result.getThrowable() != null) {
String stackTrace = getHumanReadableStackTrace(result.getThrowable());
FailureReport failureReport = new FailureReport(METHOD_FAILURE_REPORT);
Reporter.createReport(failureReport).addKeyValueEntry(METHOD_FAILURE_REPORT_STACKTRACE, stackTrace);
getReport().setFailureReport(failureReport);
}
getReport().setStatus(result.getStatus());
return this;
}
示例4: isTakingAction
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
@Override
public boolean isTakingAction(Event event, TestResult result) {
if (event instanceof AfterTestLifecycleEvent && !(event instanceof After)) {
if (configuration.getTakeAfterTest()) {
return true;
}
if (result.getStatus() == Status.FAILED && configuration.getTakeWhenTestFailed()) {
return true;
}
}
return false;
}
示例5: afterTest
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
public void afterTest(@Observes(precedence = 50) AfterTestLifecycleEvent event, TestResult result) {
if (new TakingScreenshotDecider(recorderStrategyRegister.get()).decide(event, result)) {
ScreenshotMetaData metaData = getMetaData(event);
metaData.setTestResult(result);
metaData.setResourceType(getScreenshotType());
When when = result.getStatus() == TestResult.Status.FAILED ? When.FAILED : When.AFTER;
DefaultFileNameBuilder nameBuilder = new DefaultFileNameBuilder();
String screenshotName = nameBuilder
.withMetaData(metaData)
.withStage(when)
.build();
beforeScreenshotTaken.fire(new BeforeScreenshotTaken(metaData));
TakeScreenshot takeScreenshooter = new TakeScreenshot(screenshotName, metaData, when, null);
takeScreenshot.fire(takeScreenshooter);
metaData.setBlurLevel(resolveBlurLevel(event));
org.arquillian.extension.recorder.screenshooter.Screenshot screenshot = takeScreenshooter.getScreenshot();
if(screenshot != null) {
metaData.setFilename(screenshot.getResource());
}
afterScreenshotTaken.fire(new AfterScreenshotTaken(metaData));
}
}
示例6: isTakingAction
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
@Override
public boolean isTakingAction(Event event, TestResult result) {
if (event instanceof AfterTestLifecycleEvent && !(event instanceof After)) {
switch (result.getStatus()) {
case FAILED:
return configuration.getTakeOnlyOnFail();
case PASSED:
return configuration.getStartBeforeTest() || configuration.getTakeOnlyOnFail();
case SKIPPED:
default:
return false;
}
}
return false;
}
示例7: stop
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
public void stop(@Observes(precedence = Integer.MIN_VALUE) After event, TestResult result) {
Session session = this.session.get();
NamespaceService namespaceService = this.namespaceService.get();
String pkg = getPackage(event);
String className = getClassName(event);
String methodName = getMethodName(event);
session.setCurrentMethodName(null);
Map<String, String> annotations = new HashMap<>();
String testCase = trimName(pkg, className, methodName);
annotations.put(String.format(TEST_CASE_STATUS_FORMAT, testCase), result.getStatus().name());
try {
namespaceService.annotate(session.getNamespace(), annotations);
} catch (Throwable t) {
session.getLogger().warn("Could not annotate namespace:["
+ session.getNamespace()
+
"] with test: ["
+ className
+ "] method: ["
+ methodName
+ "] result:["
+ result.getStatus().name()
+ "]");
}
switch (result.getStatus()) {
case PASSED:
session.getPassed().incrementAndGet();
break;
case FAILED:
session.getFailed().incrementAndGet();
break;
case SKIPPED:
session.getSkipped().incrementAndGet();
}
}
示例8: observeAfterTest
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
public void observeAfterTest(@Observes(precedence = Integer.MIN_VALUE) AfterTestLifecycleEvent event, TestResult result) {
int count = lifecycleCountRegister.get(event.getTestMethod());
lifecycleCountRegister.put(event.getTestMethod(), --count);
if (lifecycleCountRegister.get(event.getTestMethod()) == 0) {
TestMethodReport testMethodReport = reporter.get().getLastTestMethodReport();
testMethodReport.setStatus(result.getStatus());
testMethodReport.setDuration(result.getEnd() - result.getStart());
testMethodReport.setReportMessage(ReportMessageParser.parseTestReportMessage(event.getTestMethod()));
if (result.getStatus() == Status.FAILED && result.getThrowable() != null) {
testMethodReport.setException(getStackTrace(result.getThrowable()));
}
inTestResourceReportEvent.fire(new InTestResourceReport());
reporter.get().setReporterCursor(new ReporterCursor(reporter.get().getLastTestClassReport()));
report(event, descriptor.get());
lifecycleCountRegister.remove(event.getTestMethod());
}
}
示例9: shouldRecordOnlyOnFailure
import org.jboss.arquillian.test.spi.TestResult; //导入方法依赖的package包/类
private boolean shouldRecordOnlyOnFailure(TestResult testResult, CubeDroneConfiguration cubeDroneConfiguration) {
return cubeDroneConfiguration.isRecordOnFailure() && testResult.getStatus() == TestResult.Status.FAILED;
}