use of org.gradle.api.internal.tasks.testing.TestCompleteEvent in project gradle by gradle.
the class GenericJUnitTestEventAdapter method testIgnored.
public void testIgnored(TestDescriptorInternal descriptor) {
resultProcessor.started(descriptor, startEvent());
resultProcessor.completed(descriptor.getId(), new TestCompleteEvent(clock.getCurrentTime(), TestResult.ResultType.SKIPPED));
}
use of org.gradle.api.internal.tasks.testing.TestCompleteEvent in project gradle by gradle.
the class TestNGTestResultProcessorAdapter method onConfigurationFailure.
@Override
public void onConfigurationFailure(ITestResult testResult) {
synchronized (lock) {
if (!failedConfigurations.add(testResult)) {
// workaround for bug in TestNG 6.2 (apparently fixed in some 6.3.x): listener is notified twice per event
return;
}
}
// Synthesise a test for the broken configuration method
TestDescriptorInternal test = new DefaultTestMethodDescriptor(idGenerator.generateId(), testResult.getMethod().getTestClass().getName(), testResult.getMethod().getMethodName());
resultProcessor.started(test, new TestStartEvent(testResult.getStartMillis()));
resultProcessor.failure(test.getId(), testResult.getThrowable());
resultProcessor.completed(test.getId(), new TestCompleteEvent(testResult.getEndMillis(), TestResult.ResultType.FAILURE));
}
use of org.gradle.api.internal.tasks.testing.TestCompleteEvent in project gradle by gradle.
the class TestMainAction method run.
@Override
public void run() {
RootTestSuiteDescriptor suite = new RootTestSuiteDescriptor(rootTestSuiteId, displayName, testTaskOperationId);
resultProcessor.started(suite, new TestStartEvent(clock.getCurrentTime()));
try {
processor.startProcessing(resultProcessor);
try {
detector.run();
} finally {
processor.stop();
}
} finally {
resultProcessor.completed(suite.getId(), new TestCompleteEvent(clock.getCurrentTime()));
}
}
use of org.gradle.api.internal.tasks.testing.TestCompleteEvent in project gradle by gradle.
the class GenericJUnitTestEventAdapter method testFailure.
public void testFailure(T identifier, TestDescriptorInternal descriptor, Throwable exception) {
TestDescriptorInternal testInternal;
synchronized (lock) {
testInternal = executing.get(identifier);
}
boolean needEndEvent = false;
if (testInternal == null) {
// This can happen when, for example, a @BeforeClass or @AfterClass method fails
needEndEvent = true;
testInternal = descriptor;
resultProcessor.started(testInternal, startEvent());
}
resultProcessor.failure(testInternal.getId(), exception);
if (needEndEvent) {
resultProcessor.completed(testInternal.getId(), new TestCompleteEvent(clock.getCurrentTime()));
}
}
use of org.gradle.api.internal.tasks.testing.TestCompleteEvent in project gradle by gradle.
the class GenericJUnitTestEventAdapter method testFinished.
public void testFinished(T identifier) {
long endTime = clock.getCurrentTime();
TestDescriptorInternal testInternal;
TestResult.ResultType resultType;
synchronized (lock) {
testInternal = executing.remove(identifier);
if (testInternal == null && executing.size() == 1) {
// Assume that test has renamed itself (this can actually happen)
testInternal = executing.values().iterator().next();
executing.clear();
}
assert testInternal != null : String.format("Unexpected end event for %s", identifier);
resultType = assumptionFailed.remove(identifier) ? TestResult.ResultType.SKIPPED : null;
}
resultProcessor.completed(testInternal.getId(), new TestCompleteEvent(endTime, resultType));
}
Aggregations