continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r179818 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/core/ main/java/org/apache/maven/continuum/core/action/ main/java/org/apache/maven/continuum/execution/maven/m1/ test/java/org/apache/maven/continuum/core/
Date Fri, 03 Jun 2005 15:39:27 GMT
Author: trygvis
Date: Fri Jun  3 08:39:25 2005
New Revision: 179818

URL: http://svn.apache.org/viewcvs?rev=179818&view=rev
Log:
o Fixing CONTINUUM-165: goal null after editing a project.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/ContinuumCoreTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java?rev=179818&r1=179817&r2=179818&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Fri Jun  3 08:39:25 2005
@@ -74,7 +74,7 @@
 
     // TODO: look up these requiremetns in start() to have better control of the
     //       application initialization sequence. The application should make sure
-    //       that the database is properly initialized before starting the store.   
+    //       that the database is properly initialized before starting the store.
 
     /**
      * @requirement
@@ -311,6 +311,8 @@
     {
         try
         {
+            commandLineArguments = StringUtils.clean( commandLineArguments );
+
             store.updateProject( projectId,
                                  name,
                                  scmUrl,

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java?rev=179818&r1=179817&r2=179818&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
Fri Jun  3 08:39:25 2005
@@ -48,3 +48,4 @@
         context.put( KEY_CHECKOUT_SCM_RESULT, result );
     }
 }
+    
\ No newline at end of file

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=179818&r1=179817&r2=179818&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Fri Jun  3 08:39:25 2005
@@ -61,13 +61,15 @@
 
         String goals = getConfiguration( configuration, CONFIGURATION_GOALS );
 
+        String commandLine = project.getCommandLineArguments() + " " + goals;
+
         ExecutionResult executionResult;
 
         try
         {
             executionResult = shellCommandHelper.executeShellCommand( workingDirectory,
                                                                       mavenCommand,
-                                                                      project.getCommandLineArguments()
+ " " + goals );
+                                                                      commandLine );
         }
         catch ( Exception e )
         {

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/ContinuumCoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/ContinuumCoreTest.java?rev=179818&r1=179817&r2=179818&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/ContinuumCoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core/ContinuumCoreTest.java
Fri Jun  3 08:39:25 2005
@@ -16,15 +16,15 @@
  * limitations under the License.
  */
 
+import java.io.File;
+
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
 import org.apache.maven.continuum.store.ContinuumStore;
 
 import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.taskqueue.TaskQueue;
-import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
-import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.FileUtils;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -33,6 +33,47 @@
 public class ContinuumCoreTest
     extends PlexusTestCase
 {
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        File plexusHome = new File( (String) getContainer().getContext().get( "plexus.home"
) );
+
+        if ( plexusHome.exists() )
+        {
+            FileUtils.cleanDirectory( plexusHome );
+        }
+    }
+
+    public void testUpdateProject()
+        throws Exception
+    {
+        ContinuumCore core = (ContinuumCore) lookup( ContinuumCore.ROLE );
+
+        ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
+
+        // ----------------------------------------------------------------------
+        // Test projects with duplicate names
+        // ----------------------------------------------------------------------
+
+        String projectId = (String) core.addProjectsFromUrl( getTestFile( "src/test-projects/project1/pom.xml"
).toURL(),
+                                                             MavenTwoContinuumProjectBuilder.ID
).iterator().next();
+
+        ContinuumProject project = store.getProject( projectId );
+
+        core.updateProject( projectId,
+                            project.getName() + "2",
+                            project.getScmUrl(),
+                            project.getNagEmailAddress(),
+                            project.getVersion(),
+                            null );
+
+        project = store.getProject( projectId );
+
+        assertNotNull( "The command line arguments are null.", project.getCommandLineArguments()
);
+    }
+
     public void testAddDuplicateProject()
         throws Exception
     {



Mime
View raw message