Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.junit.platform.engine.support.hierarchical;

import static org.apiguardian.api.API.Status.EXPERIMENTAL;
import static org.apiguardian.api.API.Status.STABLE;

import java.util.List;
Expand All @@ -18,6 +19,7 @@
import org.apiguardian.api.API;
import org.jspecify.annotations.Nullable;
import org.junit.platform.engine.ExecutionRequest;
import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.support.hierarchical.Node.ExecutionMode;

/**
Expand Down Expand Up @@ -95,6 +97,17 @@ interface TestTask {
*/
ResourceLock getResourceLock();

/**
* Get the {@linkplain TestDescriptor test descriptor} of this task.
*
* @throws UnsupportedOperationException if not supported for this TestTask implementation
* @since 6.0
*/
@API(status = EXPERIMENTAL, since = "6.0")
default TestDescriptor getTestDescriptor() {
throw new UnsupportedOperationException();
}

/**
* Execute this task.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ public ExecutionMode getExecutionMode() {
.orElseGet(node::getExecutionMode);
}

@Override
public TestDescriptor getTestDescriptor() {
return testDescriptor;
}

@Override
public String toString() {
return "NodeTestTask [" + testDescriptor + "]";
Expand Down