Search in sources :

Example 1 with DefaultTestSuiteDescriptor

use of org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor in project gradle by gradle.

the class TestNGTestResultProcessorAdapter method onStart.

@Override
public void onStart(ISuite suite) {
    TestDescriptorInternal testInternal;
    synchronized (lock) {
        if (suiteId.containsKey(suite)) {
            // Can get duplicate start events
            return;
        }
        Object id = idGenerator.generateId();
        testInternal = new DefaultTestSuiteDescriptor(id, suite.getName());
        suiteId.put(suite, testInternal.getId());
    }
    resultProcessor.started(testInternal, new TestStartEvent(clock.getCurrentTime()));
}
Also used : TestDescriptorInternal(org.gradle.api.internal.tasks.testing.TestDescriptorInternal) TestStartEvent(org.gradle.api.internal.tasks.testing.TestStartEvent) DefaultTestSuiteDescriptor(org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor)

Example 2 with DefaultTestSuiteDescriptor

use of org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor in project gradle by gradle.

the class TestNGTestResultProcessorAdapter method onStart.

@Override
public void onStart(ITestContext iTestContext) {
    TestDescriptorInternal testInternal;
    Object parentId;
    synchronized (lock) {
        Object id = idGenerator.generateId();
        testInternal = new DefaultTestSuiteDescriptor(id, iTestContext.getName());
        parentId = suiteId.get(iTestContext.getSuite());
        xmlTestIds.put(iTestContext.getCurrentXmlTest(), id);
        testId.put(iTestContext, testInternal.getId());
        for (ITestNGMethod method : iTestContext.getAllTestMethods()) {
            testMethodParentId.put(method, testInternal.getId());
        }
    }
    resultProcessor.started(testInternal, new TestStartEvent(iTestContext.getStartDate().getTime(), parentId));
}
Also used : TestDescriptorInternal(org.gradle.api.internal.tasks.testing.TestDescriptorInternal) ITestNGMethod(org.testng.ITestNGMethod) TestStartEvent(org.gradle.api.internal.tasks.testing.TestStartEvent) DefaultTestSuiteDescriptor(org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor)

Aggregations

DefaultTestSuiteDescriptor (org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor)2 TestDescriptorInternal (org.gradle.api.internal.tasks.testing.TestDescriptorInternal)2 TestStartEvent (org.gradle.api.internal.tasks.testing.TestStartEvent)2 ITestNGMethod (org.testng.ITestNGMethod)1