Search in sources :

Example 1 with MeasuredTestContext

use of com.sequenceiq.it.cloudbreak.context.MeasuredTestContext in project cloudbreak by hortonworks.

the class AbstractMinimalTest method testContextWithMock.

@DataProvider(name = TEST_CONTEXT_WITH_MOCK)
public Object[][] testContextWithMock() {
    MockedTestContext testContext = getBean(MockedTestContext.class);
    MeasuredTestContext tc = createMeasuredTestContext(testContext);
    return new Object[][] { { tc } };
}
Also used : MockedTestContext(com.sequenceiq.it.cloudbreak.context.MockedTestContext) MeasuredTestContext.createMeasuredTestContext(com.sequenceiq.it.cloudbreak.context.MeasuredTestContext.createMeasuredTestContext) MeasuredTestContext(com.sequenceiq.it.cloudbreak.context.MeasuredTestContext) DataProvider(org.testng.annotations.DataProvider)

Example 2 with MeasuredTestContext

use of com.sequenceiq.it.cloudbreak.context.MeasuredTestContext in project cloudbreak by hortonworks.

the class ReportListener method logMeasurements.

private void logMeasurements(ITestResult tr) {
    Object[] parameters = tr.getParameters();
    MeasuredTestContext measuredTestContext;
    if (parameters == null || parameters.length == 0) {
        return;
    } else if (parameters[0] instanceof MeasuredTestContext) {
        measuredTestContext = (MeasuredTestContext) parameters[0];
    } else {
        return;
    }
    tr.setAttribute(tr.getName() + MEASUREMENTS, measuredTestContext.getMeasure());
}
Also used : MeasuredTestContext(com.sequenceiq.it.cloudbreak.context.MeasuredTestContext)

Aggregations

MeasuredTestContext (com.sequenceiq.it.cloudbreak.context.MeasuredTestContext)2 MeasuredTestContext.createMeasuredTestContext (com.sequenceiq.it.cloudbreak.context.MeasuredTestContext.createMeasuredTestContext)1 MockedTestContext (com.sequenceiq.it.cloudbreak.context.MockedTestContext)1 DataProvider (org.testng.annotations.DataProvider)1