You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/09/15 04:16:04 UTC

svn commit: r446463 [2/2] - in /maven/plugins/trunk/maven-release-plugin: ./ src/main/java/org/apache/maven/plugins/release/ src/main/java/org/apache/maven/plugins/release/exec/ src/main/java/org/apache/maven/plugins/release/phase/ src/main/mdo/ src/ma...

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutorTest.java?view=diff&rev=446463&r1=446462&r2=446463
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutorTest.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/exec/ForkedMavenExecutorTest.java Thu Sep 14 19:16:03 2006
@@ -25,6 +25,7 @@
 import org.jmock.core.matcher.InvokeOnceMatcher;
 import org.jmock.core.stub.ReturnStub;
 import org.jmock.core.stub.ThrowStub;
+import org.apache.maven.plugins.release.ReleaseResult;
 
 import java.io.File;
 
@@ -63,7 +64,7 @@
 
         executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );
 
-        executor.executeGoals( workingDirectory, "clean integration-test", false, null );
+        executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
 
         assertTrue( true );
     }
@@ -89,7 +90,7 @@
 
         executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );
 
-        executor.executeGoals( workingDirectory, "clean integration-test", false, null, "my-pom.xml" );
+        executor.executeGoals( workingDirectory, "clean integration-test", false, null, "my-pom.xml", new ReleaseResult() );
 
         assertTrue( true );
     }
@@ -140,7 +141,7 @@
 
         try
         {
-            executor.executeGoals( workingDirectory, "clean integration-test", false, null );
+            executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
 
             fail( "Should have thrown an exception" );
         }
@@ -174,7 +175,7 @@
 
         try
         {
-            executor.executeGoals( workingDirectory, "clean integration-test", false, null );
+            executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
 
             fail( "Should have thrown an exception" );
         }

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java?view=diff&rev=446463&r1=446462&r2=446463
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/ReleasePhaseStub.java Thu Sep 14 19:16:03 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.settings.Settings;
 
 import java.util.List;
@@ -44,19 +45,37 @@
      */
     private boolean cleaned;
 
-    public void execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         executed = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
+    public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, Settings settings, List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         simulated = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
-    public void clean( List reactorProjects )
+    public ReleaseResult clean( List reactorProjects )
     {
+        ReleaseResult result = new ReleaseResult();
+
         cleaned = true;
+
+        result.setResultCode( ReleaseResult.SUCCESS );
+
+        return result;
     }
 
     public boolean isExecuted()

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RunGoalsPhaseTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RunGoalsPhaseTest.java?view=diff&rev=446463&r1=446462&r2=446463
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RunGoalsPhaseTest.java (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RunGoalsPhaseTest.java Thu Sep 14 19:16:03 2006
@@ -24,9 +24,11 @@
 import org.jmock.Mock;
 import org.jmock.core.constraint.IsEqual;
 import org.jmock.core.constraint.IsNull;
+import org.jmock.core.constraint.IsAnything;
 import org.jmock.core.matcher.InvokeOnceMatcher;
 import org.jmock.core.matcher.TestFailureMatcher;
 import org.jmock.core.stub.ThrowStub;
+import org.jmock.core.Constraint;
 
 import java.io.File;
 
@@ -58,10 +60,13 @@
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
-        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( new IsEqual( testFile ),
-                                                                               new IsEqual( "clean integration-test" ),
-                                                                               new IsEqual( Boolean.TRUE ),
-                                                                               new IsNull() );
+        Constraint[] constraints = new Constraint[]{ new IsEqual( testFile ),
+                                                     new IsEqual( "clean integration-test" ),
+                                                     new IsEqual( Boolean.TRUE ),
+                                                     new IsNull(),
+                                                     new IsAnything() };
+
+        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
 
         phase.setMavenExecutor( (MavenExecutor) mock.proxy() );
 
@@ -81,10 +86,12 @@
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
-        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( new IsEqual( testFile ),
-                                                                               new IsEqual( "clean integration-test" ),
-                                                                               new IsEqual( Boolean.TRUE ),
-                                                                               new IsNull() );
+        Constraint[] constraints = new Constraint[]{new IsEqual( testFile ),
+                                                    new IsEqual( "clean integration-test" ),
+                                                    new IsEqual( Boolean.TRUE ),
+                                                    new IsNull(),
+                                                    new IsAnything() };
+        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints );
 
         phase.setMavenExecutor( (MavenExecutor) mock.proxy() );
 
@@ -103,10 +110,12 @@
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
-        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( new IsEqual( testFile ),
-                                                                               new IsEqual( "clean integration-test" ),
-                                                                               new IsEqual( Boolean.TRUE ),
-                                                                               new IsNull() ).will(
+        Constraint[] constraints = new Constraint[]{ new IsEqual( testFile ),
+                                                       new IsEqual( "clean integration-test" ),
+                                                       new IsEqual( Boolean.TRUE ),
+                                                       new IsNull(),
+                                                       new IsAnything() };
+        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints ).will(
             new ThrowStub( new MavenExecutorException( "...", new Exception() ) ) );
 
         phase.setMavenExecutor( (MavenExecutor) mock.proxy() );
@@ -132,10 +141,12 @@
         config.setWorkingDirectory( testFile.getAbsolutePath() );
 
         Mock mock = new Mock( MavenExecutor.class );
-        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( new IsEqual( testFile ),
-                                                                               new IsEqual( "clean integration-test" ),
-                                                                               new IsEqual( Boolean.TRUE ),
-                                                                               new IsNull() ).will(
+        Constraint[] constraints = new Constraint[]{ new IsEqual( testFile ),
+                                                     new IsEqual( "clean integration-test" ),
+                                                     new IsEqual( Boolean.TRUE ),
+                                                     new IsNull(),
+                                                     new IsAnything() };
+        mock.expects( new InvokeOnceMatcher() ).method( "executeGoals" ).with( constraints ).will(
             new ThrowStub( new MavenExecutorException( "...", new Exception() ) ) );
 
         phase.setMavenExecutor( (MavenExecutor) mock.proxy() );

Modified: maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml?view=diff&rev=446463&r1=446462&r2=446463
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml (original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/resources/org/apache/maven/plugins/release/DefaultReleaseManagerTest.xml Thu Sep 14 19:16:03 2006
@@ -38,11 +38,11 @@
         </requirement>
       </requirements>
       <configuration>
-        <phases>
+        <preparePhases>
           <phase>step1</phase>
           <phase>step2</phase>
           <phase>step3</phase>
-        </phases>
+        </preparePhases>
       </configuration>
     </component>
     <component>
@@ -61,9 +61,9 @@
         </requirement>
       </requirements>
       <configuration>
-        <phases>
+        <preparePhases>
           <phase>foo</phase>
-        </phases>
+        </preparePhases>
       </configuration>
     </component>
     <component>