Search in sources :

Example 1 with ItemStatus

use of com.epam.reportportal.listeners.ItemStatus in project agent-java-testNG by reportportal.

the class TestNGService method finishTestMethod.

@Override
@Deprecated
public void finishTestMethod(String statusStr, ITestResult testResult) {
    ItemStatus status = ItemStatus.valueOf(statusStr);
    finishTestMethod(status, testResult);
}
Also used : ItemStatus(com.epam.reportportal.listeners.ItemStatus)

Example 2 with ItemStatus

use of com.epam.reportportal.listeners.ItemStatus in project agent-java-testNG by reportportal.

the class TestNGService method getSuiteStatus.

/**
 * Extension point to customize test suite status being sent to ReportPortal
 *
 * @param suite TestNG's suite
 * @return Status PASSED/FAILED/etc
 */
protected String getSuiteStatus(ISuite suite) {
    Collection<ISuiteResult> suiteResults = suite.getResults().values();
    ItemStatus suiteStatus = ItemStatus.PASSED;
    for (ISuiteResult suiteResult : suiteResults) {
        if (!(isTestPassed(suiteResult.getTestContext()))) {
            suiteStatus = ItemStatus.FAILED;
            break;
        }
    }
    // if at least one suite failed launch should be failed
    isLaunchFailed.compareAndSet(false, suiteStatus == ItemStatus.FAILED);
    return suiteStatus.name();
}
Also used : ItemStatus(com.epam.reportportal.listeners.ItemStatus)

Aggregations

ItemStatus (com.epam.reportportal.listeners.ItemStatus)2