Tabnine Logo
AbstractMojoTestCase.getContainer
Code IndexAdd Tabnine to your IDE (free)

How to use
getContainer
method
in
org.apache.maven.plugin.testing.AbstractMojoTestCase

Best Java code snippets using org.apache.maven.plugin.testing.AbstractMojoTestCase.getContainer (Showing top 15 results out of 315)

origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

public PlexusContainer getContainer()
{
  return testCase.getContainer();
}    

origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

  /**
   * We should make sure this is called in each method that makes use of the container,
   * otherwise we throw ugly NPE's
   *
   * crops up when the subclassing code defines the setUp method but doesn't call super.setUp()
   *
   * @throws Exception
   */
  private void validateContainerStatus()
    throws Exception
  {
    if ( getContainer() != null )
    {
      return;
    }

    throw new Exception( "container is null, make sure super.setUp() is called" );
  }    
}
origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

/**
 * Configure the mojo with the given plexus configuration
 *
 * @param mojo
 * @param pluginConfiguration
 * @return a Mojo instance
 * @throws Exception
 */
protected Mojo configureMojo( Mojo mojo, PlexusConfiguration pluginConfiguration )
  throws Exception
{
  validateContainerStatus();
  ExpressionEvaluator evaluator = new ResolverExpressionEvaluatorStub();
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
  return mojo;
}
origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

LoggerManager loggerManager = (LoggerManager) getContainer().lookup( LoggerManager.class );
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

/**
 * Configure the mojo
 *
 * @param mojo
 * @param artifactId
 * @param pom
 * @return a Mojo instance
 * @throws Exception
 */
protected Mojo configureMojo( Mojo mojo, String artifactId, File pom )
  throws Exception
{
  validateContainerStatus();
  PlexusConfiguration pluginConfiguration = extractPluginConfiguration( artifactId, pom );
  ExpressionEvaluator evaluator = new ResolverExpressionEvaluatorStub();
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
  return mojo;
}
origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

protected void setUp()
  throws Exception
{
  assertTrue( "Maven 3.2.4 or better is required",
        MAVEN_VERSION == null || new DefaultArtifactVersion( "3.2.3" ).compareTo( MAVEN_VERSION ) < 0 );
  configurator = getContainer().lookup( ComponentConfigurator.class, "basic" );
  InputStream is = getClass().getResourceAsStream( "/" + getPluginDescriptorLocation() );
  XmlStreamReader reader = new XmlStreamReader( is );
  InterpolationFilterReader interpolationFilterReader =
    new InterpolationFilterReader( new BufferedReader( reader ), container.getContext().getContextData() );
  PluginDescriptor pluginDescriptor = new PluginDescriptorBuilder().build( interpolationFilterReader );
  Artifact artifact =
    lookup( RepositorySystem.class ).createArtifact( pluginDescriptor.getGroupId(),
                             pluginDescriptor.getArtifactId(),
                             pluginDescriptor.getVersion(), ".jar" );
  artifact.setFile( getPluginArtifactFile() );
  pluginDescriptor.setPluginArtifact( artifact );
  pluginDescriptor.setArtifacts( Arrays.asList( artifact ) );
  for ( ComponentDescriptor<?> desc : pluginDescriptor.getComponents() )
  {
    getContainer().addComponentDescriptor( desc );
  }
  mojoDescriptors = new HashMap<String, MojoDescriptor>();
  for ( MojoDescriptor mojoDescriptor : pluginDescriptor.getMojos() )
  {
    mojoDescriptors.put( mojoDescriptor.getGoal(), mojoDescriptor );
  }
}
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

public PlexusContainer getContainer()
{
  return testCase.getContainer();
}    

origin: org.apache.maven.plugin-testing/maven-plugin-testing-harness

  configurator = getContainer().lookup( ComponentConfigurator.class, mojoDescriptor.getComponentConfigurator() );
configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

  /**
   * We should make sure this is called in each method that makes use of the container,
   * otherwise we throw ugly NPE's
   *
   * crops up when the subclassing code defines the setUp method but doesn't call super.setUp()
   *
   * @throws Exception
   */
  private void validateContainerStatus()
    throws Exception
  {
    if ( getContainer() != null )
    {
      return;
    }

    throw new Exception( "container is null, make sure super.setUp() is called" );
  }
}
origin: org.nuiton/maven-helper-plugin

  @Override
  public PlexusContainer getContainer() {
    return super.getContainer();
  }
}
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

/**
 * Configure the mojo with the given plexus configuration
 *
 * @param mojo
 * @param pluginConfiguration
 * @return a Mojo instance
 * @throws Exception
 */
protected Mojo configureMojo( Mojo mojo, PlexusConfiguration pluginConfiguration )
  throws Exception
{
  validateContainerStatus();
  ExpressionEvaluator evaluator = new ResolverExpressionEvaluatorStub();
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
  return mojo;
}
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

protected void setUp()
  throws Exception
{
  configurator = getContainer().lookup( ComponentConfigurator.class, "basic" );
  InputStream is = getClass().getResourceAsStream( "/" + getPluginDescriptorLocation() );
  XmlStreamReader reader = new XmlStreamReader( is );
  InterpolationFilterReader interpolationFilterReader =
    new InterpolationFilterReader( new BufferedReader( reader ), container.getContext().getContextData() );
  PluginDescriptor pluginDescriptor = new PluginDescriptorBuilder().build( interpolationFilterReader );
  Artifact artifact =
    lookup( RepositorySystem.class ).createArtifact( pluginDescriptor.getGroupId(),
                             pluginDescriptor.getArtifactId(),
                             pluginDescriptor.getVersion(), ".jar" );
  artifact.setFile( new File( getBasedir() ).getCanonicalFile() );
  pluginDescriptor.setPluginArtifact( artifact );
  pluginDescriptor.setArtifacts( Arrays.asList( artifact ) );
  for ( ComponentDescriptor<?> desc : pluginDescriptor.getComponents() )
  {
    getContainer().addComponentDescriptor( desc );
  }
  mojoDescriptors = new HashMap<String, MojoDescriptor>();
  for ( MojoDescriptor mojoDescriptor : pluginDescriptor.getMojos() )
  {
    mojoDescriptors.put( mojoDescriptor.getGoal(), mojoDescriptor );
  }
}
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

LoggerManager loggerManager = (LoggerManager) getContainer().lookup( LoggerManager.class );
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

/**
 * Configure the mojo
 *
 * @param mojo
 * @param artifactId
 * @param pom
 * @return a Mojo instance
 * @throws Exception
 */
protected Mojo configureMojo( Mojo mojo, String artifactId, File pom )
  throws Exception
{
  validateContainerStatus();
  PlexusConfiguration pluginConfiguration = extractPluginConfiguration( artifactId, pom );
  ExpressionEvaluator evaluator = new ResolverExpressionEvaluatorStub();
  configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
  return mojo;
}
origin: com.simpligility.org.apache.maven.plugin-testing/maven-plugin-testing-harness

configurator.configureComponent( mojo, pluginConfiguration, evaluator, getContainer().getContainerRealm() );
org.apache.maven.plugin.testingAbstractMojoTestCasegetContainer

Popular methods of AbstractMojoTestCase

  • setUp
  • tearDown
  • lookupMojo
    lookup the mojo while we have all of the relavent information
  • assertNotNull
  • configureMojo
    Configure the mojo with the given plexus configuration
  • extractPluginConfiguration
  • fail
  • finalizeMojoConfiguration
  • getBasedir
  • getPluginDescriptorLocation
  • getPluginDescriptorPath
  • getPublicDescriptorStream
  • getPluginDescriptorPath,
  • getPublicDescriptorStream,
  • getVariableValueFromObject,
  • getVariablesAndValuesFromObject,
  • lookup,
  • lookupConfiguredMojo,
  • lookupEmptyMojo,
  • newMavenSession,
  • newMojoExecution

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • setContentView (Activity)
  • startActivity (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now