From 043080e92c6c13683987987cf35ed9edff2456ba Mon Sep 17 00:00:00 2001 From: Brian E Fox Date: Mon, 26 Mar 2007 02:47:55 +0000 Subject: [PATCH] MNG-2749: added good it0014 test to check for extensions that provide resources to a plugin. git-svn-id: https://svn.apache.org/repos/asf/maven/core-integration-testing/trunk@522404 13f79535-47bb-0310-9956-ffa450edef68 --- .../IntegrationTestSuite.java | 1 + .../checkstyle-config/pom.xml | 21 ---- .../extension/it0114_rule_set.xml | 112 ++++++++++++++++++ .../extension/pom.xml | 31 +++++ .../extension/src/assembly/assembly.xml | 16 +++ .../pom.xml | 13 ++ .../readme.txt | 3 - .../test-plugin/pom.xml | 26 ++++ .../org/apache/maven/plugin/It0014Mojo.java | 31 +++++ .../test-project/pom.xml | 36 +++--- .../src/main/java/test/MyClass.java | 11 -- 11 files changed, 250 insertions(+), 51 deletions(-) delete mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/checkstyle-config/pom.xml create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/it0114_rule_set.xml create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/pom.xml create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/src/assembly/assembly.xml create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/pom.xml delete mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/readme.txt create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/pom.xml create mode 100644 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/src/main/java/org/apache/maven/plugin/It0014Mojo.java delete mode 100755 its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/src/main/java/test/MyClass.java diff --git a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java index 850cf67a07..a3c8174352 100644 --- a/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java +++ b/its/core-integration-tests/src/test/java/org/apache/maven/integrationtests/IntegrationTestSuite.java @@ -133,6 +133,7 @@ public class IntegrationTestSuite suite.addTestSuite( MavenIT0111PluginsThatRequireAResourceFromAnExtensionTest.class ); suite.addTestSuite( MavenIT0112ExtensionsThatDragDependencies.class ); suite.addTestSuite( MavenIT0113ServerAuthzAvailableToWagonMgrInPlugin.class ); + suite.addTestSuite( MavenIT0114ExtensionThatProvidesResources.class ); suite.addTestSuite( MavenIT0118AttachedArtifactsInReactor.class ); return suite; } diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/checkstyle-config/pom.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/checkstyle-config/pom.xml deleted file mode 100644 index 34c2747a6b..0000000000 --- a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/checkstyle-config/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - 4.0.0 - test - checkstyle-configs - 1.0.4-SNAPSHOT - jar - My checkstyle config - - \ No newline at end of file diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/it0114_rule_set.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/it0114_rule_set.xml new file mode 100644 index 0000000000..fda8b54278 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/it0114_rule_set.xml @@ -0,0 +1,112 @@ + + + + + This ruleset checks EPHS code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/pom.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/pom.xml new file mode 100644 index 0000000000..aba1d2aa39 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + org.apache.maven.its.it0114 + it0114-extension + pom + 1.0 + it0114 - extension + + + + maven-assembly-plugin + 2.1 + + + process-resources + + attached + + + + src/assembly/assembly.xml + + target + + + + + + + + diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/src/assembly/assembly.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/src/assembly/assembly.xml new file mode 100644 index 0000000000..6de530cd75 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/extension/src/assembly/assembly.xml @@ -0,0 +1,16 @@ + + + + jar + + false + + + . + / + + it0114_rule_set.xml + + + + diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/pom.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/pom.xml new file mode 100644 index 0000000000..cf9bd73266 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + org.apache.maven.its.it0114 + parent + 1.0 + pom + it0114 - parent + + extension + test-plugin + + diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/readme.txt b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/readme.txt deleted file mode 100644 index 94fdacd880..0000000000 --- a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -This is a placeholder and does provide a good test but we shouldn't use the -checkstyle plugin itself just to see if a resource can be loaded from an -extension. diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/pom.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/pom.xml new file mode 100644 index 0000000000..4736b1e00b --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + org.apache.maven.its.it0114 + it0114-plugin + maven-plugin + 1.0 + it0114 - plugin + + + org.apache.maven + maven-project + 2.0 + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven + maven-artifact + 2.0 + + + + diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/src/main/java/org/apache/maven/plugin/It0014Mojo.java b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/src/main/java/org/apache/maven/plugin/It0014Mojo.java new file mode 100644 index 0000000000..c4ef41e272 --- /dev/null +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-plugin/src/main/java/org/apache/maven/plugin/It0014Mojo.java @@ -0,0 +1,31 @@ +package org.apache.maven.plugin; + +import java.net.URL; + +/** + * @author Brian Fox + * @goal test + * @phase verify + */ +public class It0014Mojo + extends AbstractMojo +{ + + public void execute() + throws MojoExecutionException, MojoFailureException + { + ClassLoader cl = this.getClass().getClassLoader(); + URL url = cl.getResource( "it0114_rule_set.xml" ); + + if (url != null) + { + this.getLog().info( "Found Url: "+ url.getFile() ); + } + else + { + throw new MojoExecutionException("Can't find it0114_rule_set.xml on classpath!!"); + } + + } + +} diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/pom.xml b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/pom.xml index 4cc03ea21d..a89d5c3f89 100644 --- a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/pom.xml +++ b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/pom.xml @@ -3,29 +3,33 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - test - test-project - 1.0.0-SNAPSHOT - My test project + org.apache.maven.its.it0114 + it0114-plugin-runner + 1.0 + pom + it0114 - plugin runner - test - checkstyle-configs - 1.0.4-SNAPSHOT + org.apache.maven.its.it0114 + it0114-extension + 1.0 - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.1 - - MyConventions.xml - + org.apache.maven.its.it0114 + it0114-plugin + 1.0 + + + + test + + + + - + \ No newline at end of file diff --git a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/src/main/java/test/MyClass.java b/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/src/main/java/test/MyClass.java deleted file mode 100755 index d77b884017..0000000000 --- a/its/core-integration-tests/src/test/resources/it0114-extensionThatProvidesResources/test-project/src/main/java/test/MyClass.java +++ /dev/null @@ -1,11 +0,0 @@ -package test; - -public class MyClass -{ - - public static void main( String[] args ) - { - - } - -}