use of org.gradle.api.internal.tasks.testing.DefaultTestDescriptor in project gradle by gradle.
the class JUnitPlatformTestExecutionListener method createDescriptor.
private TestDescriptorInternal createDescriptor(TestIdentifier test, String name, String displayName) {
TestIdentifier classIdentifier = findClassSource(test);
String className = className(classIdentifier);
String classDisplayName = classDisplayName(classIdentifier);
return new DefaultTestDescriptor(idGenerator.generateId(), className, name, classDisplayName, displayName);
}
use of org.gradle.api.internal.tasks.testing.DefaultTestDescriptor in project gradle by gradle.
the class TestClassExecutionEventGenerator method testClassFinished.
@Override
public void testClassFinished(Throwable failure) {
long now = clock.getCurrentTime();
try {
if (failure != null) {
if (currentTests.isEmpty()) {
String testName = testsStarted ? "executionError" : "initializationError";
DefaultTestDescriptor initializationError = new DefaultTestDescriptor(idGenerator.generateId(), currentTestClass.getClassName(), testName);
resultProcessor.started(initializationError, new TestStartEvent(now));
resultProcessor.failure(initializationError.getId(), failure);
resultProcessor.completed(initializationError.getId(), new TestCompleteEvent(now));
} else {
for (Object test : currentTests) {
resultProcessor.failure(test, failure);
resultProcessor.completed(test, new TestCompleteEvent(now));
}
}
}
resultProcessor.completed(currentTestClass.getId(), new TestCompleteEvent(now));
} finally {
testsStarted = false;
currentTests.clear();
currentTestClass = null;
}
}
Aggregations