directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r481840 - /directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt
Date Sun, 03 Dec 2006 17:47:55 GMT
Author: oersoy
Date: Sun Dec  3 09:47:55 2006
New Revision: 481840

URL: http://svn.apache.org/viewvc?view=rev&rev=481840
Log: (empty)

Added:
    directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt

Added: directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt?view=auto&rev=481840
==============================================================================
--- directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt (added)
+++ directory/sandbox/oersoy/maven-testing/eclipse-maven-testing.apt Sun Dec  3 09:47:55 2006
@@ -0,0 +1,220 @@
+                              ------------------------------------------
+
+                                         Eclipse Maven Testing
+                              ------------------------------------------
+Challenge
+
+     See whether we can make a project
+     with packaging set to pom and 
+     import it into eclipse.
+     
+Solution
+
+     Run the following script
+
+----------------------------------------------------------------     
+mvn archetype:create -DartifactId=L0Project -DgroupId=test
+cd L0Project
+sed -e 's/jar/pom/' pom.xml | sed -e '10,18d' > pom.xml.tmp
+cat << END >> pom.xml.tmp
+<dependencyManagement>
+     <dependencies>
+          <dependency>
+             <artifactId>commons-collections</artifactId>
+             <groupId>commons-collections</groupId>
+             <version>2.11</version>
+             <scope>test</scope>
+          </dependency>
+     </dependencies>
+</dependencyManagement>
+</project>
+END
+mv pom.xml.tmp pom.xml
+cd L0Project
+mvn eclipse:eclipse
+----------------------------------------------------------------     
+
+Result
+
+     The script runs fine, but 
+     the eclipse plugin does
+     did not create an eclipse
+     importable project, and it
+     tells us that it does not
+     like this:
+     
+     Not running eclipse plugin goal for pom project.
+          
+Follow Up
+
+     Hopefully there is a way
+     to switch this so that it 
+     does.  It would have been
+     really nice for editing
+     the dependencyManagement
+     section of a parent pom.
+     
+     I'll check on Maven Users
+     to see whether anyone knows
+     how.
+
+          
+     
+
+     
+     
+     
+Challenge
+
+     See whether we can set
+     a dependency version in
+     the dependency management
+     section of a pom and then 
+     override it on a child pom. 
+     
+Solution
+
+     Run the following script
+
+---------------------------------------------------------------- 
+mvn archetype:create -DartifactId=L0Project -DgroupId=test
+cd L0Project
+sed -e 's/jar/pom/' pom.xml | sed -e '10,18d' > pom.xml.tmp
+cat << END >> pom.xml.tmp
+<dependencyManagement>
+     <dependencies>
+          <dependency>
+             <artifactId>commons-collections</artifactId>
+             <groupId>commons-collections</groupId>
+             <version>2.11</version>
+             <scope>test</scope>
+          </dependency>
+     </dependencies>
+</dependencyManagement>
+</project>
+END
+mv pom.xml.tmp pom.xml
+
+mvn archetype:create -DartifactId=L1Project -DgroupId=test
+
+pushd L1Project
+sed -e '20,21d' pom.xml > pom.xml.tmp
+
+cat << END >> pom.xml.tmp
+      <dependency>
+         <artifactId>commons-collections</artifactId>
+         <groupId>commons-collections</groupId>
+         <version>3.2</version>
+         <scope>test</scope>
+    </dependency>
+</dependencies>
+</project>
+END
+
+mv pom.xml.tmp pom.xml
+
+pushd src/test/java/test
+
+cat << END > AppTest.java
+package test;
+
+import org.apache.commons.collections.bag.AbstractBagDecorator;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest 
+    extends TestCase
+{
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest( String testName )
+    {
+        super( testName );
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite()
+    {
+        return new TestSuite( AppTest.class );
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp()
+    {
+    	AbstractBagDecorator emannuelsBagDecorator;
+        assertTrue( true );
+    }
+}
+END
+
+
+popd
+popd
+mvn eclipse:eclipse
+mvn test
+----------------------------------------------------------------     
+
+Result
+
+     The test runs fine. 
+
+
+
+
+
+
+
+
+
+
+
+Challenge
+
+     See whether we can import the 
+     L1Project into eclipse and have
+     the AbstractBagDecorator that the 
+     AppTest needs loaded successfully. 
+     
+Solution
+
+     Import the L1Project into 
+     eclipse.
+     
+Result
+
+     The AbstractBagDecorator
+     does not load.
+
+Follow Up
+
+     Check with Maven Dev to see 
+     whether this is a know bug.
+
+
+
+
+
+
+
+
+     
+
+
+
+
+                   
+
+                  
\ No newline at end of file



Mime
View raw message