You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2007/03/09 04:30:40 UTC

svn commit: r516278 - in /maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src: main/mdo/maven-lifecycle.mdo test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java

Author: jdcasey
Date: Thu Mar  8 19:30:39 2007
New Revision: 516278

URL: http://svn.apache.org/viewvc?view=rev&rev=516278
Log:
some more unit tests.

Modified:
    maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo
    maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java

Modified: maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo
URL: http://svn.apache.org/viewvc/maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo?view=diff&rev=516278&r1=516277&r2=516278
==============================================================================
--- maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo (original)
+++ maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo Thu Mar  8 19:30:39 2007
@@ -49,7 +49,7 @@
         <field xml.tagName="clean">
           <version>1.0.0</version>
           <name>cleanBinding</name>
-          <required>false</required>
+          <defaultValue>new CleanBinding()</defaultValue>
           <description>The binding for the clean lifecycle</description>
           <association>
             <type>CleanBinding</type>
@@ -58,7 +58,7 @@
         <field xml.tagName="build">
           <version>1.0.0</version>
           <name>buildBinding</name>
-          <required>true</required>
+          <defaultValue>new BuildBinding()</defaultValue>
           <description>The binding for the main build (default) lifecycle</description>
           <association>
             <type>BuildBinding</type>
@@ -67,7 +67,7 @@
         <field xml.tagName="site">
           <version>1.0.0</version>
           <name>siteBinding</name>
-          <required>false</required>
+          <defaultValue>new SiteBinding()</defaultValue>
           <description>The binding for the site lifecycle</description>
           <association>
             <type>SiteBinding</type>
@@ -137,6 +137,7 @@
         <field xml.tagName="pre-clean">
           <name>preClean</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -144,6 +145,7 @@
         <field xml.tagName="clean">
           <name>clean</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -151,6 +153,7 @@
         <field xml.tagName="post-clean">
           <name>postClean</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -198,6 +201,7 @@
         <field>
           <name>validate</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -205,6 +209,7 @@
         <field>
           <name>initialize</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -212,6 +217,7 @@
         <field xml.tagName="generate-sources">
           <name>generateSources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -219,6 +225,7 @@
         <field xml.tagName="process-sources">
           <name>processSources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -226,6 +233,7 @@
         <field xml.tagName="generate-resources">
           <name>generateResources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -233,6 +241,7 @@
         <field xml.tagName="process-resources">
           <name>processResources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -240,6 +249,7 @@
         <field>
           <name>compile</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -247,6 +257,7 @@
         <field xml.tagName="process-classes">
           <name>processClasses</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -254,6 +265,7 @@
         <field xml.tagName="generate-test-sources">
           <name>generateTestSources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -261,6 +273,7 @@
         <field xml.tagName="process-test-sources">
           <name>processTestSources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -268,6 +281,7 @@
         <field xml.tagName="generate-test-resources">
           <name>generateTestResources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -275,6 +289,7 @@
         <field xml.tagName="process-test-resources">
           <name>processTestResources</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -282,6 +297,7 @@
         <field xml.tagName="test-compile">
           <name>testCompile</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -289,6 +305,7 @@
         <field xml.tagName="process-test-classes">
           <name>processTestClasses</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -296,6 +313,7 @@
         <field xml.tagName="test">
           <name>test</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -303,6 +321,7 @@
         <field xml.tagName="prepare-package">
           <name>preparePackage</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -310,6 +329,7 @@
         <field xml.tagName="package">
           <name>createPackage</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -317,6 +337,7 @@
         <field xml.tagName="pre-integration-test">
           <name>preIntegrationTest</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -324,6 +345,7 @@
         <field xml.tagName="integration-test">
           <name>integrationTest</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -331,6 +353,7 @@
         <field xml.tagName="post-integration-test">
           <name>postIntegrationTest</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -338,6 +361,7 @@
         <field>
           <name>verify</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -345,6 +369,7 @@
         <field>
           <name>install</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -352,6 +377,7 @@
         <field>
           <name>deploy</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -439,6 +465,7 @@
         <field xml.tagName="pre-site">
           <name>preSite</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -446,6 +473,7 @@
         <field xml.tagName="site">
           <name>site</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -453,6 +481,7 @@
         <field xml.tagName="post-site">
           <name>postSite</name>
           <version>1.0.0</version>
+          <defaultValue>new Phase()</defaultValue>
           <association>
             <type>Phase</type>
           </association>
@@ -499,7 +528,7 @@
       <fields>
         <field>
           <name>bindings</name>
-      <version>1.0.0</version>
+          <version>1.0.0</version>
           <description>Collection of mojo bindings for a phase.</description>
           <association>
             <type>MojoBinding</type>

Modified: maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java?view=diff&rev=516278&r1=516277&r2=516278
==============================================================================
--- maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java (original)
+++ maven/components/branches/2.1-lifecycle-refactor/maven-lifecycle/src/test/java/org/apache/maven/lifecycle/LifecycleUtilsTest.java Thu Mar  8 19:30:39 2007
@@ -214,13 +214,13 @@
         Phase result = cleanBinding.getClean();
         assertEquals( 0, result.getBindings().size() );
     }
-    
+
     public void testCloneMojoBinding_NullVersionIsPropagated()
     {
         MojoBinding binding = newMojoBinding( "group", "artifact", "goal" );
-        
+
         MojoBinding binding2 = LifecycleUtils.cloneMojoBinding( binding );
-        
+
         assertNotNull( binding2 );
         assertEquals( "goal", binding2.getGoal() );
         assertEquals( "group", binding2.getGroupId() );
@@ -233,9 +233,9 @@
     {
         MojoBinding binding = newMojoBinding( "group", "artifact", "goal" );
         binding.setExecutionId( "exec" );
-        
+
         MojoBinding binding2 = LifecycleUtils.cloneMojoBinding( binding );
-        
+
         assertNotNull( binding2 );
         assertEquals( "goal", binding2.getGoal() );
         assertEquals( "group", binding2.getGroupId() );
@@ -247,9 +247,9 @@
     {
         MojoBinding binding = newMojoBinding( "group", "artifact", "goal" );
         binding.setVersion( "version" );
-        
+
         MojoBinding binding2 = LifecycleUtils.cloneMojoBinding( binding );
-        
+
         assertNotNull( binding2 );
         assertEquals( "goal", binding2.getGoal() );
         assertEquals( "group", binding2.getGroupId() );
@@ -257,7 +257,20 @@
         assertEquals( "version", binding2.getVersion() );
         assertEquals( "default", binding2.getExecutionId() );
     }
-    
+
+    public void testAddMojoBinding_AddOneMojoBindingToEmptyLifecycleBinding()
+        throws NoSuchPhaseException
+    {
+        CleanBinding cleanBinding = new CleanBinding();
+
+        MojoBinding binding = newMojoBinding( "group", "artifact", "goal" );
+
+        LifecycleUtils.addMojoBinding( "clean", binding, cleanBinding );
+        
+        Phase clean = cleanBinding.getClean();
+        assertEquals( 1, clean.getBindings().size() );
+    }
+
     private MojoBinding newMojoBinding( String groupId, String artifactId, String goal )
     {
         MojoBinding binding = new MojoBinding();