Adding new IT to try to test MCHECKSTYLE-10.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@367788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2006-01-10 20:42:42 +00:00
parent 0bb2300dde
commit 636d54c0a8
9 changed files with 154 additions and 4 deletions

View File

@ -234,12 +234,16 @@ it0085: Verify that system-scoped dependencies get resolved with system scope
dependency. Inherited scope should not apply in the case of
system-scoped dependencies, no matter where they are.
it0086: Verify that a class in a plugin's dependencies can be loaded by both
<plugin>.getClass().getClassLoader() and Thread.currentThread().getContextClassLoader().
it0086: Verify that a plugin dependency class can be loaded from both the plugin classloader and the
context classloader available to the plugin.
it0087: Verify that a class in the project-level dependencies for a plugin can be loaded by both
<plugin>.getClass().getClassLoader() and Thread.currentThread().getContextClassLoader().
it0087: Verify that a project-level plugin dependency class can be loaded from both the plugin classloader
and the context classloader available to the plugin.
it0088: Test path translation
it0089: Test that Checkstyle PackageNamesLoader.loadModuleFactory(..) method will complete as-is with
the context classloader available to the plugin.
-------------------------------------------------------------------------------
- generated sources

View File

@ -1,4 +1,7 @@
it0089
it0088
it0087
it0086
it0085
it0084
it0083

View File

@ -0,0 +1 @@
project/target/output.txt

View File

@ -0,0 +1 @@
install

View File

@ -0,0 +1,26 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it</groupId>
<version>1.0</version>
<artifactId>it0089-root</artifactId>
</parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-it0089-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<dependencies>
<dependency>
<groupId>checkstyle</groupId>
<artifactId>checkstyle</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,71 @@
package org.apache.maven.plugins.it0089;
import com.puppycrawl.tools.checkstyle.PackageNamesLoader;
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
/**
* @goal test
*/
public class Mojo
extends AbstractMojo
{
/**
* @parameter default-value="${basedir}/target"
* @required
* @readonly
*/
private File outDir;
public void execute() throws MojoExecutionException, MojoFailureException
{
try
{
PackageNamesLoader.loadModuleFactory(Thread.currentThread().getContextClassLoader());
getLog().info( "Loaded checkstyle module factory.");
outDir.mkdirs();
File output = new File( outDir, "output.txt" );
Writer writer = null;
try
{
writer = new FileWriter( output );
writer.write( "Success." );
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to write output file.", e );
}
finally
{
if ( writer != null )
{
try
{
writer.close();
}
catch ( IOException e )
{
}
}
}
}
catch ( CheckstyleException e )
{
throw new MojoExecutionException( "Error loading checkstyle module factory.", e );
}
}
}

View File

@ -0,0 +1,13 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.it</groupId>
<artifactId>it0089-root</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>plugin</module>
<module>project</module>
</modules>
</project>

View File

@ -0,0 +1 @@
rm ${artifact:org.apache.maven.plugins:maven-core-it-plugin:1.0-SNAPSHOT:maven-plugin}

View File

@ -0,0 +1,30 @@
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.it</groupId>
<version>1.0</version>
<artifactId>it0089-root</artifactId>
</parent>
<artifactId>it0089</artifactId>
<name>Plugin Transitive Dependency Classloading Test</name>
<build>
<plugins>
<plugin>
<artifactId>maven-it0089-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>