Author: brett
Date: Thu Mar 23 19:42:28 2006
New Revision: 388351

URL: http://svn.apache.org/viewcvs?rev=388351&view=rev
Log:
[MNG-32] add tests for JAR mojo
Submitted by: Jesse McConnell

Added:
    
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
   (with props)
    maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/
    maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/
    
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
   (with props)
    
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/
    
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/
    
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/
    
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
   (with props)
Modified:
    maven/plugins/trunk/maven-jar-plugin/pom.xml

Modified: maven/plugins/trunk/maven-jar-plugin/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/pom.xml?rev=388351&r1=388350&r2=388351&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jar-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-jar-plugin/pom.xml Thu Mar 23 19:42:28 2006
@@ -43,5 +43,11 @@
       <artifactId>commons-lang</artifactId>
       <version>2.1</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-testing-harness</artifactId>
+      <version>1.0-SNAPSHOT</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

Added: 
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java?rev=388351&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
 (added)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
 Thu Mar 23 19:42:28 2006
@@ -0,0 +1,37 @@
+package org.apache.maven.plugin.jar;
+
+import org.apache.maven.plugins.testing.AbstractMojoTestCase;
+
+import java.io.File;
+
+/**
+ * 
+ */
+public class JarMojoTest extends AbstractMojoTestCase
+{
+    private File testPom = new File ( getBasedir(), 
"src/test/resources/unit/jar-basic-test/pom.xml" );
+
+    protected void setUp() throws Exception {
+
+        // required for mojo lookups to work
+        super.setUp();
+
+    }
+
+    /**
+     * tests the proper discovery and configuration of the mojo
+     *
+     * @throws Exception
+     */
+    public void testJarTestEnvironment() throws Exception {
+
+        //File pom = new File( getBasedir(), 
"src/test/resources/unit/clean/pom.xml" );
+
+        JarMojo mojo = (JarMojo) lookupMojo ("jar", testPom );
+
+        assertNotNull( mojo );
+
+        assertEquals( "foo", mojo.getProject().getGroupId() );
+    }
+
+}

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/java/org/apache/maven/plugin/jar/JarMojoTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml?rev=388351&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
 Thu Mar 23 19:42:28 2006
@@ -0,0 +1,15 @@
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+           <project 
implementation="org.apache.maven.plugins.testing.stubs.StubMavenProject">
+             <groupId implementation="java.lang.String">foo</groupId>
+             <artifactId implementation="java.lang.String">bar</artifactId>
+           </project>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
URL: 
http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java?rev=388351&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
 (added)
+++ 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
 Thu Mar 23 19:42:28 2006
@@ -0,0 +1,12 @@
+
+
+public class TestCompile1
+{
+
+    public TestCompile1()
+    {
+
+        System.out.println("Woo Hoo!");
+    }
+
+}
\ No newline at end of file

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-jar-plugin/src/test/resources/unit/jar-basic-test/src/main/java/TestCompile1.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"


Reply via email to