maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject svn commit: r721011 - in /maven/release/trunk/maven-release-manager/src: main/java/org/apache/maven/shared/release/DefaultReleaseManager.java test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
Date Wed, 26 Nov 2008 22:39:30 GMT
Author: aheritier
Date: Wed Nov 26 14:39:30 2008
New Revision: 721011

URL: http://svn.apache.org/viewvc?rev=721011&view=rev
Log:
MRELEASE-379: return results after performing a release 
http://jira.codehaus.org/browse/MRELEASE-379

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
    maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java?rev=721011&r1=721010&r2=721011&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
Wed Nov 26 14:39:30 2008
@@ -318,6 +318,8 @@
         updateListener( listener, "perform", GOAL_START );
 
         releaseDescriptor = loadReleaseDescriptor( releaseDescriptor, listener );
+        
+        ReleaseResult phaseResult = null;
 
         for ( Iterator phases = performPhases.iterator(); phases.hasNext(); )
         {
@@ -331,7 +333,8 @@
             }
 
             updateListener( listener, name, PHASE_START );
-            phase.execute( releaseDescriptor, releaseEnvironment, reactorProjects );
+            phaseResult = phase.execute( releaseDescriptor, releaseEnvironment, reactorProjects
);
+            result.getOutputBuffer().append( phaseResult.getOutput() );
             updateListener( listener, name, PHASE_END );
         }
 

Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java?rev=721011&r1=721010&r2=721011&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
Wed Nov 26 14:39:30 2008
@@ -60,6 +60,7 @@
 import java.io.IOException;
 import java.util.Collections;
 import java.util.Map;
+import java.util.ArrayList;
 
 /**
  * Test the default release manager.
@@ -417,6 +418,23 @@
 
         assertTrue( true );
     }
+    
+    public void testReleasePerformWithResult() 
+        throws Exception
+    {
+        DefaultReleaseManager releaseManager = (DefaultReleaseManager) lookup( ReleaseManager.ROLE,
"test" );
+        
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setScmSourceUrl( "scm-url" );
+        File checkoutDirectory = getTestFile( "target/checkout-directory" );
+        releaseDescriptor.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );
+        
+        ReleaseResult result = new ReleaseResult();
+        
+        result = releaseManager.performWithResult( releaseDescriptor, new DefaultReleaseEnvironment(),
+                                                   new ArrayList(), null );
+        assert( result.getOutput().length() > 0 );
+    }  
 
     public void testReleasePerformNoReleaseProfile()
         throws Exception



Mime
View raw message