ru.yandex.qatools.allure.events.TestCaseFailureEvent Java Examples

The following examples show how to use ru.yandex.qatools.allure.events.TestCaseFailureEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AllureTestListener.java    From allure1 with Apache License 2.0 6 votes vote down vote up
@Override
public void onConfigurationFailure(ITestResult iTestResult) {
    if (isSuppressConfigEvent(iTestResult)) {
        return;
    }
    String suiteUid = getSuiteUid(iTestResult.getTestContext());
    if (isAfterSuiteConfigMethod(iTestResult)) {
        String suiteTitle = getCurrentSuiteTitle(iTestResult.getTestContext());
        getLifecycle().fire(new TestSuiteStartedEvent(suiteUid, suiteTitle).withTitle(suiteTitle));
    }
    Throwable throwable = iTestResult.getThrowable();
    createConfigEvent(iTestResult);
    getLifecycle().fire(new TestCaseFailureEvent().withThrowable(throwable));
    fireFinishTest();
    if (isAfterSuiteConfigMethod(iTestResult)) {
        getLifecycle().fire(new TestSuiteFinishedEvent(suiteUid));
    }
}
 
Example #2
Source File: AllureMarathonRunListener.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public void fireTestCaseFailure(Throwable throwable) {
    if (throwable instanceof AssumptionViolatedException) {
        getLifecycle().fire(new TestCaseCanceledEvent().withThrowable(throwable));
    } else {
        getLifecycle().fire(new TestCaseFailureEvent().withThrowable(throwable));
    }
}
 
Example #3
Source File: AllureRunListener.java    From allure-cucumberjvm with Apache License 2.0 5 votes vote down vote up
public void fireTestCaseFailure(Throwable throwable) {
    if (throwable instanceof AssumptionViolatedException) {
        getLifecycle().fire(new TestCaseCanceledEvent().withThrowable(throwable));
    } else {
        getLifecycle().fire(new TestCaseFailureEvent().withThrowable(throwable));
    }
}
 
Example #4
Source File: AllureRunListener.java    From allure1 with Apache License 2.0 5 votes vote down vote up
public void fireTestCaseFailure(Throwable throwable) {
    if (throwable instanceof AssumptionViolatedException) {
        getLifecycle().fire(new TestCaseCanceledEvent().withThrowable(throwable));
    } else {
        getLifecycle().fire(new TestCaseFailureEvent().withThrowable(throwable));
    }
}
 
Example #5
Source File: AllureRunListenerTest.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Test
public void testFailureTest() throws Exception {
    Description description = mock(Description.class);
    when(description.isTest()).thenReturn(true);
    Throwable exception = mock(Throwable.class);

    Failure failure = mockFailureWith(exception, description);

    runListener.testFailure(failure);

    verify(allure).fire(eq(new TestCaseFailureEvent().withThrowable(exception)));
}
 
Example #6
Source File: AllureTestListener.java    From allure1 with Apache License 2.0 5 votes vote down vote up
@Override
public void onTestFailure(ITestResult iTestResult) {
    getLifecycle().fire(new TestCaseFailureEvent()
            .withThrowable(iTestResult.getThrowable())
    );
    fireFinishTest();
}