abstract class AbstractExtensionContext<T extends TestDescriptor> extends java.lang.Object implements ExtensionContext
ExtensionContext.Namespace, ExtensionContext.Store| Modifier and Type | Field and Description |
|---|---|
private EngineExecutionListener |
engineExecutionListener |
private ExtensionContext |
parent |
private T |
testDescriptor |
private ExtensionValuesStore |
valuesStore |
| Constructor and Description |
|---|
AbstractExtensionContext(ExtensionContext parent,
EngineExecutionListener engineExecutionListener,
T testDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
private ExtensionValuesStore |
createStore(ExtensionContext parent) |
java.lang.String |
getDisplayName()
Get the display name for the current test or container.
|
java.util.Optional<ExtensionContext> |
getParent()
Get the parent extension context, if available.
|
ExtensionContext |
getRoot()
Get the root
ExtensionContext. |
ExtensionContext.Store |
getStore(ExtensionContext.Namespace namespace)
Get the
ExtensionContext.Store for the supplied ExtensionContext.Namespace. |
java.util.Set<java.lang.String> |
getTags()
Get the set of all tags for the current test or container.
|
protected T |
getTestDescriptor() |
java.lang.String |
getUniqueId()
Get the unique ID of the current test or container.
|
void |
publishReportEntry(java.util.Map<java.lang.String,java.lang.String> values)
Publish a map of key-value pairs to be consumed by an
org.junit.platform.engine.EngineExecutionListener. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetElement, getExecutionException, getRequiredTestClass, getRequiredTestInstance, getRequiredTestMethod, getTestClass, getTestInstance, getTestMethod, publishReportEntryprivate final ExtensionContext parent
private final EngineExecutionListener engineExecutionListener
private final T extends TestDescriptor testDescriptor
private final ExtensionValuesStore valuesStore
AbstractExtensionContext(ExtensionContext parent, EngineExecutionListener engineExecutionListener, T testDescriptor)
private ExtensionValuesStore createStore(ExtensionContext parent)
public java.lang.String getUniqueId()
ExtensionContextgetUniqueId in interface ExtensionContextnull or blankpublic java.lang.String getDisplayName()
ExtensionContextThe display name is either a default name or a custom name configured
via @DisplayName.
For details on default display names consult the Javadoc for
TestInfo.getDisplayName().
Note that display names are typically used for test reporting in IDEs and build tools and may contain spaces, special characters, and even emoji.
getDisplayName in interface ExtensionContextnull or blankpublic void publishReportEntry(java.util.Map<java.lang.String,java.lang.String> values)
ExtensionContextorg.junit.platform.engine.EngineExecutionListener.publishReportEntry in interface ExtensionContextvalues - the key-value pairs to be published; never null;
keys and values within entries in the map also must not be
null or blankpublic java.util.Optional<ExtensionContext> getParent()
ExtensionContextgetParent in interface ExtensionContextOptional containing the parent; never null but
potentially emptyExtensionContext.getRoot()public ExtensionContext getRoot()
ExtensionContextExtensionContext.getRoot in interface ExtensionContextnull but potentially
this ExtensionContextExtensionContext.getParent()protected T getTestDescriptor()
public ExtensionContext.Store getStore(ExtensionContext.Namespace namespace)
ExtensionContextExtensionContext.Store for the supplied ExtensionContext.Namespace.
Use getStore(Namespace.GLOBAL) to get the default, global ExtensionContext.Namespace.
getStore in interface ExtensionContextnamespace - the Namespace to get the store for; never nullnullExtensionContext.Namespace.GLOBALpublic java.util.Set<java.lang.String> getTags()
ExtensionContextTags may be declared directly on the test element or inherited from an outer context.
getTags in interface ExtensionContextnull but
potentially empty