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 Link icon

    • context Link icon

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

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

      protected static String basedir
  • Constructor Details Link icon

    • MavenDIExtension Link icon

      public MavenDIExtension()
  • Method Details Link icon

    • beforeEach Link icon

      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 Link icon

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

      protected void setupContainer()
    • afterEach Link icon

      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 Link icon

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

      protected <T> T lookup(Class<T> componentClass) throws org.apache.maven.di.impl.DIException
      Throws:
      org.apache.maven.di.impl.DIException
    • lookup Link icon

      protected <T> T lookup(Class<T> componentClass, String roleHint) throws org.apache.maven.di.impl.DIException
      Throws:
      org.apache.maven.di.impl.DIException
    • lookup Link icon

      protected <T> T lookup(Class<T> componentClass, Object qualifier) throws org.apache.maven.di.impl.DIException
      Throws:
      org.apache.maven.di.impl.DIException
    • release Link icon

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

      public static File getTestFile(String path)
    • getTestFile Link icon

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

      public static String getTestPath(String path)
    • getTestPath Link icon

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

      public static String getBasedir()