continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r1049071 - in /continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src: main/java/org/apache/maven/continuum/xmlrpc/server/ test/java/org/apache/continuum/xmlrpc/server/
Date Tue, 14 Dec 2010 12:53:02 GMT
Author: jzurbano
Date: Tue Dec 14 12:53:01 2010
New Revision: 1049071

URL: http://svn.apache.org/viewvc?rev=1049071&view=rev
Log:
CONTINUUM-2584 Unable to save the Description of Build Definition when creating build defintion
using xmlrpc
* applied patch - set the build definition description

Patch Submitted by: Gwen Harold Autencio

additional modification
* added unit test


Modified:
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplStub.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=1049071&r1=1049070&r2=1049071&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Tue Dec 14 12:53:01 2010
@@ -1899,7 +1899,7 @@ public class ContinuumServiceImpl
         return (BuildDefinition) mapper.map( buildDef, BuildDefinition.class );
     }
 
-    private org.apache.maven.continuum.model.project.BuildDefinition populateBuildDefinition(
BuildDefinition buildDef,
+    protected org.apache.maven.continuum.model.project.BuildDefinition populateBuildDefinition(
BuildDefinition buildDef,
                                                                                         
     org.apache.maven.continuum.model.project.BuildDefinition bd )
         throws ProfileException, ContinuumException
     {
@@ -1934,6 +1934,11 @@ public class ContinuumServiceImpl
         {
             bd.setSchedule( null );
         }
+        
+        if( StringUtils.isNotEmpty( buildDef.getDescription() ) )
+        {
+            bd.setDescription( buildDef.getDescription() );
+        }
 
         return bd;
     }

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplStub.java?rev=1049071&r1=1049070&r2=1049071&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplStub.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplStub.java
Tue Dec 14 12:53:01 2010
@@ -1,14 +1,23 @@
 package org.apache.continuum.xmlrpc.server;
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.profile.ProfileException;
+import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.server.ContinuumServiceImpl;
 
 public class ContinuumServiceImplStub
     extends ContinuumServiceImpl
-{
+{   
     protected void checkBuildProjectInGroupAuthorization( String resource )
         throws ContinuumException
     {
         // do nothing
     }
+    
+    public org.apache.maven.continuum.model.project.BuildDefinition getBuildDefinition( BuildDefinition
buildDef,
+                                                                                        org.apache.maven.continuum.model.project.BuildDefinition
buildDefinition )
+        throws ProfileException, ContinuumException
+    {
+        return populateBuildDefinition( buildDef, buildDefinition );
+    }
 }

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java?rev=1049071&r1=1049070&r2=1049071&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/test/java/org/apache/continuum/xmlrpc/server/ContinuumServiceImplTest.java
Tue Dec 14 12:53:01 2010
@@ -10,6 +10,7 @@ import org.apache.maven.continuum.config
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
+import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.ReleaseListenerSummary;
 import org.apache.maven.continuum.xmlrpc.server.ContinuumServiceImpl;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
@@ -135,6 +136,41 @@ public class ContinuumServiceImplTest
         assertEquals( "incomplete-phase", summary.getPhases().get( 0 ) );
         assertEquals( "completed-phase", summary.getCompletedPhases().get( 0 ) );
     }
+    
+    public void testPopulateBuildDefinition()
+        throws Exception
+    {
+        ContinuumServiceImplStub continuumServiceStub = new ContinuumServiceImplStub();
+        
+        BuildDefinition buildDef = createBuildDefinition();
+        org.apache.maven.continuum.model.project.BuildDefinition buildDefinition = new org.apache.maven.continuum.model.project.BuildDefinition();
+        
+        buildDefinition = continuumServiceStub.getBuildDefinition( buildDef, buildDefinition
);
+        
+        assertEquals( buildDef.getArguments(), buildDefinition.getArguments() );
+        assertEquals( buildDef.getBuildFile(), buildDefinition.getBuildFile() );
+        assertEquals( buildDef.getDescription(), buildDefinition.getDescription() );
+        assertEquals( buildDef.getGoals(), buildDefinition.getGoals() );
+        assertEquals( buildDef.getType(), buildDefinition.getType() );
+        assertEquals( buildDef.isAlwaysBuild(), buildDefinition.isAlwaysBuild() );
+        assertEquals( buildDef.isBuildFresh(), buildDefinition.isBuildFresh() );
+        assertEquals( buildDef.isDefaultForProject(), buildDefinition.isDefaultForProject()
);
+    }
+    
+    private BuildDefinition createBuildDefinition()
+    {
+        BuildDefinition buildDef = new BuildDefinition();
+        buildDef.setArguments( "--batch-mode" );
+        buildDef.setBuildFile( "pom.xml" );
+        buildDef.setType( "maven2" );
+        buildDef.setBuildFresh( false );
+        buildDef.setAlwaysBuild( true );
+        buildDef.setDefaultForProject( true );
+        buildDef.setGoals( "clean install" );
+        buildDef.setDescription( "Test Build Definition" );
+        
+        return buildDef;
+    }
 
     private Map<String, Object> getListenerMap()
     {



Mime
View raw message