Java Code Examples for ru.yandex.qatools.allure.model.TestCaseResult#setStatus()

The following examples show how to use ru.yandex.qatools.allure.model.TestCaseResult#setStatus() . 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: AllureShutdownHook.java    From allure1 with Apache License 2.0 5 votes vote down vote up
/**
 * If test not finished yet (in our case if stop time is zero) mark it as interrupted.
 * Set message, stop time and status.
 */
public void markTestcaseAsInterruptedIfNotFinishedYet(TestCaseResult testCase) {
    if (testCase.getStop() == 0L) {
        testCase.setStop(System.currentTimeMillis());
        testCase.setStatus(Status.BROKEN);
        testCase.setFailure(new Failure().withMessage("Test was interrupted"));
    }
}
 
Example 2
Source File: TestCaseStartedEvent.java    From allure1 with Apache License 2.0 5 votes vote down vote up
/**
 * Sets to testCase start time, default status, name, title, description and labels
 *
 * @param testCase to change
 */
@Override
public void process(TestCaseResult testCase) {
    testCase.setStart(System.currentTimeMillis());
    testCase.setStatus(Status.PASSED);
    testCase.setName(getName());
    testCase.setTitle(getTitle());
    testCase.setDescription(getDescription());
    testCase.setLabels(getLabels());
}
 
Example 3
Source File: TestCaseStatusChangeEvent.java    From allure1 with Apache License 2.0 2 votes vote down vote up
/**
 * Change status in specified testCase. If throwable not specified uses
 * {@link #getDefaultFailure()} and {@link #getFailure()} otherwise
 *
 * @param testCase to change
 */
@Override
public void process(TestCaseResult testCase) {
    testCase.setStatus(getStatus());
    testCase.setFailure(throwable == null ? getDefaultFailure() : getFailure());
}