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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEach(org.junit.jupiter.api.extension.ExtensionContext context) voidbeforeEach(org.junit.jupiter.api.extension.ExtensionContext context) static Stringorg.apache.maven.di.Injectorstatic FilegetTestFile(String path) static FilegetTestFile(String basedir, String path) static StringgetTestPath(String path) static StringgetTestPath(String basedir, String path) protected <T> Tprotected <T> Tprotected <T> Tprotected voidprotected voidsetContext(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:
beforeEachin 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:
afterEachin 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
-