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 Details

    • context

      protected static org.junit.jupiter.api.extension.ExtensionContext context
    • injector

      protected org.apache.maven.di.Injector injector
    • basedir

      protected static String basedir
  • Constructor Details

    • MavenDIExtension

      public MavenDIExtension()
  • Method Details

    • beforeEach

      public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
      Throws:
      Exception
    • setContext

      protected void setContext(org.junit.jupiter.api.extension.ExtensionContext context)
    • setupContainer

      protected void setupContainer()
    • afterEach

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
      Throws:
      Exception
    • getInjector

      public org.apache.maven.di.Injector getInjector()
    • lookup

      protected <T> T lookup(Class<T> componentClass) throws org.apache.maven.di.impl.DIException
      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

      protected void release(Object component) throws org.apache.maven.di.impl.DIException
      Throws:
      org.apache.maven.di.impl.DIException
    • getTestFile

      public static File getTestFile(String path)
    • getTestFile

      public static File getTestFile(String basedir, String path)
    • getTestPath

      public static String getTestPath(String path)
    • getTestPath

      public static String getTestPath(String basedir, String path)
    • getBasedir

      public static String getBasedir()