continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r448554 - /maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Date Thu, 21 Sep 2006 14:04:05 GMT
Author: epunzalan
Date: Thu Sep 21 07:04:04 2006
New Revision: 448554

URL: http://svn.apache.org/viewvc?view=rev&rev=448554
Log:
re-apply upgrade of taskexecutor tests

Modified:
    maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java?view=diff&rev=448554&r1=448553&r2=448554
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Thu Sep 21 07:04:04 2006
@@ -18,7 +18,9 @@
 
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
+import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.manager.ScmManager;
 import org.apache.maven.scm.repository.ScmRepository;
@@ -28,6 +30,7 @@
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
 import java.io.File;
 
@@ -43,6 +46,8 @@
 
     private TaskExecutor performExec;
 
+    private ContinuumReleaseManager releaseManager;
+
     protected void setUp()
         throws Exception
     {
@@ -62,6 +67,11 @@
         {
             performExec = (TaskExecutor) lookup( TaskExecutor.class.getName(), "perform-release"
);
         }
+
+        if ( releaseManager == null )
+        {
+            releaseManager = (ContinuumReleaseManager) lookup( ContinuumReleaseManager.ROLE
);
+        }
     }
 
     public void testReleaseSimpleProject()
@@ -85,7 +95,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
 
-        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+        doPrepareWithNoError( descriptor );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
@@ -121,7 +131,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
-        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+        doPrepareWithNoError( descriptor );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>2.1-SNAPSHOT</version>"
) > 0 );
@@ -134,6 +144,24 @@
         assertTrue( "Test released version", pom.indexOf( "<version>2.0</version>"
) > 0 );
 
         performExec.executeTask( getPerformTask( "testRelease", descriptor, new File( getBasedir(),
"target/test-classes/build-dir" ) ) );
+
+        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease"
);
+        if ( result.getResultCode() != ReleaseResult.SUCCESS )
+        {
+            fail( "Error in release:perform. Release output follows:\n" + result.getOutput()
);
+        }
+    }
+
+    private void doPrepareWithNoError( ReleaseDescriptor descriptor )
+        throws TaskExecutionException
+    {
+        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+
+        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease"
);
+        if ( result.getResultCode() != ReleaseResult.SUCCESS )
+        {
+            fail( "Error in release:prepare. Release output follows:\n" + result.getOutput()
);
+        }
     }
 
     private Task getPrepareTask( String releaseId, ReleaseDescriptor descriptor )



Mime
View raw message