continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ken...@apache.org
Subject svn commit: r448221 - in /maven/continuum/trunk/continuum-release: pom.xml src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Date Wed, 20 Sep 2006 15:02:04 GMT
Author: kenney
Date: Wed Sep 20 08:02:04 2006
New Revision: 448221

URL: http://svn.apache.org/viewvc?view=rev&rev=448221
Log:
Reapply commits r446646 and r446639 - they were undone by evenisse's merge.

Modified:
    maven/continuum/trunk/continuum-release/pom.xml
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
    maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java

Modified: maven/continuum/trunk/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/pom.xml?view=diff&rev=448221&r1=448220&r2=448221
==============================================================================
--- maven/continuum/trunk/continuum-release/pom.xml (original)
+++ maven/continuum/trunk/continuum-release/pom.xml Wed Sep 20 08:02:04 2006
@@ -35,7 +35,7 @@
     <testResources>
       <testResource>
         <directory>src/test/scm</directory>
-        <targetPath>scm-src</targetPath>
+        <targetPath>../scm-src</targetPath>
       </testResource>
     </testResources>
   </build>

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java?view=diff&rev=448221&r1=448220&r2=448221
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
Wed Sep 20 08:02:04 2006
@@ -32,6 +32,8 @@
 
     private ReleaseManagerListener listener;
 
+    private long maxExecutionTime;
+
     public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor,
                                        ReleaseManagerListener listener )
     {
@@ -72,7 +74,11 @@
 
     public long getMaxExecutionTime()
     {
-        //TODO: modifify this value
-        return -1;
+         return maxExecutionTime;
+    }
+
+    public void setMaxExecutionTime( long maxTime )
+    {
+        this.maxExecutionTime = maxTime;
     }
 }

Modified: maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java?view=diff&rev=448221&r1=448220&r2=448221
==============================================================================
--- maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
(original)
+++ maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Wed Sep 20 08:02:04 2006
@@ -18,9 +18,7 @@
 
 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;
@@ -30,7 +28,6 @@
 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;
 
@@ -40,8 +37,6 @@
 public class ReleaseTaskExecutorTest
     extends PlexusTestCase
 {
-    private ContinuumReleaseManager releaseManager;
-
     private ScmManager scmManager;
 
     private TaskExecutor prepareExec;
@@ -67,17 +62,12 @@
         {
             performExec = (TaskExecutor) lookup( TaskExecutor.class.getName(), "perform-release"
);
         }
-
-        if ( releaseManager == null )
-        {
-            releaseManager = (ContinuumReleaseManager) lookup( ContinuumReleaseManager.ROLE
);
-        }
     }
 
     public void testReleaseSimpleProject()
         throws Exception
     {
-        String scmPath = new File( getBasedir(), "target/test-classes/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
+        String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
         FileUtils.deleteDirectory( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
@@ -95,7 +85,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
 
-        doPrepareWithNoError( descriptor );
+        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
@@ -111,7 +101,7 @@
     public void testReleaseSimpleProjectWithNextVersion()
         throws Exception
     {
-        String scmPath = new File( getBasedir(), "target/test-classes/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
+        String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
         FileUtils.deleteDirectory( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
@@ -131,7 +121,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
-        doPrepareWithNoError( descriptor );
+        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>2.1-SNAPSHOT</version>"
) > 0 );
@@ -143,26 +133,7 @@
         pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
         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: " + 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()
);
-        }
+        performExec.executeTask( getPerformTask( "testRelease", descriptor, new File( getBasedir(),
"target/test-classes/build-dir" ) ) );
     }
 
     private Task getPrepareTask( String releaseId, ReleaseDescriptor descriptor )



Mime
View raw message