Package org.apache.maven.api.di.testing
Class MavenDIExtension
java.lang.Object
org.apache.maven.api.di.testing.MavenDIExtension
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
- Direct Known Subclasses:
MojoExtension
public class MavenDIExtension
extends Object
implements org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
This is a slightly modified version of the original plexus class
available at https://raw.githubusercontent.com/codehaus-plexus/plexus-containers/master/plexus-container-default/
src/main/java/org/codehaus/plexus/PlexusTestCase.java
in order to migrate the tests to JUnit 4.
- Author:
- Jason van Zyl, Trygve Laugstøl, Michal Maczka, Guillaume Nodet
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterEach
(org.junit.jupiter.api.extension.ExtensionContext context) void
beforeEach
(org.junit.jupiter.api.extension.ExtensionContext context) static String
org.apache.maven.di.Injector
static File
getTestFile
(String path) static File
getTestFile
(String basedir, String path) static String
getTestPath
(String path) static String
getTestPath
(String basedir, String path) protected <T> T
protected <T> T
protected <T> T
protected void
protected void
setContext
(org.junit.jupiter.api.extension.ExtensionContext context) protected void
-
Field Details
-
context
protected static org.junit.jupiter.api.extension.ExtensionContext context -
injector
protected org.apache.maven.di.Injector injector -
basedir
-
-
Constructor Details
-
MavenDIExtension
public MavenDIExtension()
-
-
Method Details
-
beforeEach
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
Exception
-
setContext
protected void setContext(org.junit.jupiter.api.extension.ExtensionContext context) -
setupContainer
protected void setupContainer() -
afterEach
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
Exception
-
getInjector
public org.apache.maven.di.Injector getInjector() -
lookup
- Throws:
org.apache.maven.di.impl.DIException
-
lookup
protected <T> T lookup(Class<T> componentClass, String roleHint) throws org.apache.maven.di.impl.DIException - Throws:
org.apache.maven.di.impl.DIException
-
lookup
protected <T> T lookup(Class<T> componentClass, Object qualifier) throws org.apache.maven.di.impl.DIException - Throws:
org.apache.maven.di.impl.DIException
-
release
- Throws:
org.apache.maven.di.impl.DIException
-
getTestFile
-
getTestFile
-
getTestPath
-
getTestPath
-
getBasedir
-