continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r171299 [2/2] - /maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution /maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core-it /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/manager /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/network /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/state /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/test-projects/project1 /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/core /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/maven/m1 /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven /maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core /maven/continuum/trunk/continuum-model/src/main/resources /maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc
Date Sun, 22 May 2005 10:42:46 GMT
Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=171299&r1=171298&r2=171299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Sun May 22 03:42:43 2005
@@ -168,20 +168,36 @@
         String scmUrl = "scm:local:src/test/repo";
         String nagEmailAddress = "foo@bar.com";
         String version = "1.0";
+        String commandLineArguments = "a b";
         String builderId = "maven2";
         String workingDirectory = "/tmp";
         Properties configuration = new Properties();
 
         configuration.setProperty( "foo", "bar" );
 
-        String projectId = store.addProject( name, scmUrl, nagEmailAddress, version, builderId,
workingDirectory, configuration );
+        String projectId = store.addProject( name,
+                                             scmUrl,
+                                             nagEmailAddress,
+                                             version,
+                                             commandLineArguments,
+                                             builderId,
+                                             workingDirectory,
+                                             configuration );
 
         assertNotNull( "The project id is null.", projectId );
 
         ContinuumProject project = store.getProject( projectId );
 
-        assertProjectEquals( projectId, name, scmUrl, nagEmailAddress, version, builderId,
workingDirectory,
-                             configuration, project );
+        assertProjectEquals( projectId,
+                             name,
+                             scmUrl,
+                             nagEmailAddress,
+                             version,
+                             commandLineArguments,
+                             builderId,
+                             workingDirectory,
+                             configuration,
+                             project );
     }
 
     public void testGetNonExistingProject()
@@ -210,6 +226,7 @@
         String scmUrl = "scm:local:jalla";
         String nagEmailAddress = "foo@bar.com";
         String version = "1.0";
+        String commandLineArguments = "";
         String builderId = "maven2";
         String workingDirectory = "/tmp";
         Properties properties = new Properties();
@@ -218,6 +235,7 @@
                                              scmUrl,
                                              nagEmailAddress,
                                              version,
+                                             commandLineArguments,
                                              builderId,
                                              workingDirectory,
                                              properties );
@@ -256,14 +274,28 @@
         String scmUrl2 = "scm url 2";
         String nagEmailAddress2 = "2@bar";
         String version2 = "v2";
+        String commandLineArguments2 = "";
         Properties properties2 = new Properties();
 
-        store.updateProject( projectId, name2, scmUrl2, nagEmailAddress2, version2  );
+        store.updateProject( projectId,
+                             name2,
+                             scmUrl2,
+                             nagEmailAddress2,
+                             version2,
+                             commandLineArguments2 );
 
         project = store.getProject( projectId );
 
-        assertProjectEquals( projectId, name2, scmUrl2, nagEmailAddress2, version2, builderId,
workingDirectory,
-                             properties2, project );
+        assertProjectEquals( projectId,
+                             name2,
+                             scmUrl2,
+                             nagEmailAddress2,
+                             version2,
+                             commandLineArguments2,
+                             builderId,
+                             workingDirectory,
+                             properties2,
+                             project );
 
         // ----------------------------------------------------------------------
         //
@@ -296,6 +328,7 @@
         String scmUrl1 = "scm:local:src/test/repo/foo";
         String nagEmailAddress1 = "foo@bar.com";
         String version1 = "1.0";
+        String commandLineArguments1 = "";
         String builderId1 = "maven2";
         String workingDirectory1 = "/tmp";
         Properties configuration1 = new Properties();
@@ -304,6 +337,7 @@
                                        scmUrl1,
                                        nagEmailAddress1,
                                        version1,
+                                       commandLineArguments1,
                                        builderId1,
                                        workingDirectory1,
                                        configuration1 );
@@ -312,11 +346,19 @@
         String scmUrl2 = "scm:local:src/test/repo/bar";
         String nagEmailAddress2 = "foo@bar.com";
         String version2 = "1.0";
+        String commandLineArguments2 = "";
         String builderId2 = "maven2";
         String workingDirectory2 = "/tmp";
         Properties configuration2 = new Properties();
 
-        String id2 = store.addProject( name2, scmUrl2, nagEmailAddress2, version2, builderId2,
workingDirectory2, configuration2 );
+        String id2 = store.addProject( name2,
+                                       scmUrl2,
+                                       nagEmailAddress2,
+                                       version2,
+                                       commandLineArguments2,
+                                       builderId2,
+                                       workingDirectory2,
+                                       configuration2 );
 
         Map projects = new HashMap();
 
@@ -333,13 +375,29 @@
 
         ContinuumProject project1 = (ContinuumProject) projects.get( name1 );
 
-        assertProjectEquals( id1, name1, scmUrl1, nagEmailAddress1, version1, builderId1,
workingDirectory1,
-                             configuration1, project1 );
+        assertProjectEquals( id1,
+                             name1,
+                             scmUrl1,
+                             nagEmailAddress1,
+                             version1,
+                             commandLineArguments1,
+                             builderId1,
+                             workingDirectory1,
+                             configuration1,
+                             project1 );
 
         ContinuumProject project2 = (ContinuumProject) projects.get( name2 );
 
-        assertProjectEquals( id2, name2, scmUrl2, nagEmailAddress2, version2, builderId2,
workingDirectory2,
-                             configuration2, project2 );
+        assertProjectEquals( id2,
+                             name2,
+                             scmUrl2,
+                             nagEmailAddress2,
+                             version2,
+                             commandLineArguments2,
+                             builderId2,
+                             workingDirectory2,
+                             configuration2,
+                             project2 );
     }
 
     public void testUpdateProjectConfiguration()
@@ -402,50 +460,6 @@
         store.removeProject( projectId );
     }
 
-    public void xtestAddDuplicateProject()
-        throws Exception
-    {
-        ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.ROLE );
-
-        // ----------------------------------------------------------------------
-        // Test projects with duplicate names
-        // ----------------------------------------------------------------------
-
-        String projectId = addProject( "trygve", "trygve-foo" );
-
-        assertEquals( projectId, store.getProjectByName( "trygve" ).getId() );
-
-        try
-        {
-            addProject( "trygve", "trygve-bar" );
-
-            fail( "Expected a exception" );
-        }
-        catch( ContinuumStoreException e )
-        {
-            assertTrue( e.getMessage().indexOf( "project with the name" ) != -1 );
-        }
-
-        ContinuumProject project = makeStubProject( "brett", "brett-bar" );
-
-        addProject( project );
-
-        assertNotNull( store.getProjectByScmUrl( "brett-bar" ) );
-
-        try
-        {
-            project.setName( "jason" );
-
-            addProject( project );
-
-            fail( "Expected a exception" );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            assertTrue( e.getMessage().indexOf( "project with the scm url" ) != -1 );
-        }
-    }
-
     // ----------------------------------------------------------------------
     // Build
     // ----------------------------------------------------------------------
@@ -716,6 +730,7 @@
                            project.getScmUrl(),
                            project.getNagEmailAddress(),
                            project.getVersion(),
+                           project.getCommandLineArguments(),
                            project.getExecutorId(),
                            project.getWorkingDirectory(),
                            project.getConfiguration() );
@@ -738,6 +753,7 @@
                                      String scmUrl,
                                      String nagEmailAddress,
                                      String version,
+                                     String commandLineArguments,
                                      String executorId,
                                      String workingDirectory,
                                      Properties configuration )
@@ -747,6 +763,7 @@
                                              scmUrl,
                                              nagEmailAddress,
                                              version,
+                                             commandLineArguments,
                                              executorId,
                                              workingDirectory,
                                              configuration );
@@ -785,7 +802,16 @@
         assertNull( state );
     }
 
-    private void assertProjectEquals( String projectId, String name, String scmUrl, String
nagEmailAddress, String version, String builderId, String workingDirectory, Properties configuration,
ContinuumProject project )
+    private void assertProjectEquals( String projectId,
+                                      String name,
+                                      String scmUrl,
+                                      String nagEmailAddress,
+                                      String version,
+                                      String commandLineArguments,
+                                      String builderId,
+                                      String workingDirectory,
+                                      Properties configuration,
+                                      ContinuumProject project )
     {
         assertEquals( "project.id", projectId, project.getId() );
 
@@ -796,6 +822,8 @@
         assertEquals( "project.nagEmailAddress", nagEmailAddress, project.getNagEmailAddress()
);
 
         assertEquals( "project.version", version, project.getVersion() );
+
+        assertEquals( "project.commandLineArguments", commandLineArguments, project.getCommandLineArguments()
);
 
         assertEquals( "project.executorId", builderId, project.getExecutorId() );
 

Added: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml?rev=171299&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml
(added)
+++ maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml
Sun May 22 03:42:43 2005
@@ -0,0 +1,44 @@
+<plexus>
+  <components>
+    <component>
+      <role>org.codehaus.plexus.jdo.JdoFactory</role>
+      <implementation>org.codehaus.plexus.jdo.DefaultJdoFactory</implementation>
+      <configuration>
+        <properties>
+          <property>
+            <name>javax.jdo.PersistenceManagerFactoryClass</name>
+            <value>org.jpox.PersistenceManagerFactoryImpl</value>
+          </property>
+          <property>
+            <name>javax.jdo.option.ConnectionDriverName</name>
+            <value>org.hsqldb.jdbcDriver</value>
+          </property>
+          <property>
+            <name>javax.jdo.option.ConnectionURL</name>
+            <value>jdbc:hsqldb:.</value>
+          </property>
+          <property>
+            <name>javax.jdo.option.ConnectionUserName</name>
+            <value>sa</value>
+          </property>
+          <property>
+            <name>javax.jdo.option.ConnectionPassword</name>
+            <value></value>
+          </property>
+          <property>
+            <name>org.jpox.autoCreateSchema</name>
+            <value>true</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanism</name>
+            <value>SchemaTable</value>
+          </property>
+          <property>
+            <name>org.jpox.autoStartMechanismMode</name>
+            <value>Quiet</value>
+          </property>
+        </properties>
+      </configuration>
+    </component>
+  </components>
+</plexus>

Propchange: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/core/ContinuumCoreTest.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo?rev=171299&r1=171298&r2=171299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Sun May 22 03:42:43
2005
@@ -104,6 +104,13 @@
           <version>1.0.0</version>
           <type>String</type>
         </field>
+        <!-- TODO: Move to the executor configuration. -->
+        <!-- TODO: Uh, oh, and rename FooProject to FooExecutorConfiguration -->
+        <field>
+          <name>commandLineArguments</name>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
       </fields>
     </class>
 
@@ -158,11 +165,6 @@
       <fields>
         <field>
           <name>executable</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>arguments</name>
           <version>1.0.0</version>
           <type>String</type>
         </field>

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java?rev=171299&r1=171298&r2=171299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
Sun May 22 03:42:43 2005
@@ -20,7 +20,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: ContinuumXmlRpc.java,v 1.3 2005/04/07 23:16:27 trygvis Exp $
+ * @version $Id$
  */
 public interface ContinuumXmlRpc
 {
@@ -32,9 +32,15 @@
 
     Hashtable getProject( String projectId );
 
-    Hashtable updateProjectFromScm( String projectId );
+    Hashtable updateProject( String projectId,
+                             String name,
+                             String scmUrl,
+                             String nagEmailAddress,
+                             String version,
+                             String commandLineArguments );
 
-    Hashtable updateProjectConfiguration( String projectId, Hashtable configuration );
+    Hashtable updateProjectConfiguration( String projectId,
+                                          Hashtable configuration );
 
     Hashtable getAllProjects();
 
@@ -44,9 +50,12 @@
     // Build handling
     // ----------------------------------------------------------------------
 
-    Hashtable buildProject( String projectId, boolean force );
+    Hashtable buildProject( String projectId,
+                            boolean force );
 
-    Hashtable getBuildsForProject( String projectId, int start, int end );
+    Hashtable getBuildsForProject( String projectId,
+                                   int start,
+                                   int end );
 
     Hashtable getBuild( String buildId );
 
@@ -73,6 +82,7 @@
                              String projectName,
                              String nagEmailAddress,
                              String version,
+                             String commandLineArguments,
                              Hashtable configuration );
 
     // ----------------------------------------------------------------------
@@ -83,5 +93,6 @@
                                String projectName,
                                String nagEmailAddress,
                                String version,
+                               String commandLineArguments,
                                Hashtable configuration );
 }

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=171299&r1=171298&r2=171299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
Sun May 22 03:42:43 2005
@@ -28,22 +28,30 @@
 import java.util.Vector;
 
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.core.ContinuumCore;
 import org.apache.maven.continuum.execution.ant.AntBuildExecutor;
 import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
+import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
+import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.MavenOneProject;
+import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.project.AntProject;
+import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.UpdateScmResult;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.StringUtils;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: DefaultContinuumXmlRpc.java,v 1.3 2005/04/04 15:25:13 trygvis Exp $
+ * @version $Id$
  */
 public class DefaultContinuumXmlRpc
     extends AbstractLogEnabled
@@ -72,7 +80,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.addMavenOneProject(): url: '" + url
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.addMavenOneProject()",
+                                    "URL: '" + url + "'.", e );
         }
     }
 
@@ -90,7 +99,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.addMavenTwoProject(): url: '" + url
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.addMavenTwoProject()",
+                                    "URL: '" + url + "'.", e );
         }
     }
 
@@ -102,9 +112,16 @@
                                     String projectName,
                                     String nagEmailAddress,
                                     String version,
+                                    String commandLineArguments,
                                     Hashtable configuration )
     {
-        return addProjectFromScm( scmUrl, AntBuildExecutor.ID, projectName, nagEmailAddress,
version, configuration );
+        return addProjectFromScm( scmUrl,
+                                  AntBuildExecutor.ID,
+                                  projectName,
+                                  nagEmailAddress,
+                                  version,
+                                  commandLineArguments,
+                                  configuration );
     }
 
     // ----------------------------------------------------------------------
@@ -115,9 +132,16 @@
                                       String projectName,
                                       String nagEmailAddress,
                                       String version,
+                                      String commandLineArguments,
                                       Hashtable configuration )
     {
-        return addProjectFromScm( scmUrl, ShellBuildExecutor.ID, projectName, nagEmailAddress,
version, configuration );
+        return addProjectFromScm( scmUrl,
+                                  ShellBuildExecutor.ID,
+                                  projectName,
+                                  nagEmailAddress,
+                                  version,
+                                  commandLineArguments,
+                                  configuration );
     }
 
     // ----------------------------------------------------------------------
@@ -129,6 +153,7 @@
                                          String projectName,
                                          String nagEmailAddress,
                                          String version,
+                                         String commandLineArguments,
                                          Hashtable configuration )
     {
         try
@@ -147,13 +172,14 @@
                                                        projectName,
                                                        nagEmailAddress,
                                                        version,
+                                                       commandLineArguments,
                                                        configurationProperties );
 
             return makeHashtable( "projectId", projectId );
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.addProjectFromScm().", e );
+            return handleException( "ContinuumXmlRpc.addProjectFromScm()", null, e );
         }
     }
 
@@ -193,7 +219,81 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.getProject(): project id: '" + projectId
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.getProject()",
+                                    "Project id: '" + projectId + "'.", e );
+        }
+    }
+
+    public Hashtable updateProject( String projectId,
+                                    String name,
+                                    String scmUrl,
+                                    String nagEmailAddress,
+                                    String version,
+                                    String commandLineArguments )
+    {
+        try
+        {
+            ContinuumProject project = continuum.getProject( projectId );
+
+            if ( project.getExecutorId().equals( MavenOneBuildExecutor.ID ) )
+            {
+                project = continuum.getMavenOneProject( projectId );
+            }
+            else if ( project.getExecutorId().equals( MavenTwoBuildExecutor.ID ) )
+            {
+                project = continuum.getMavenTwoProject( projectId );
+            }
+            else if ( project.getExecutorId().equals( AntBuildExecutor.ID ) )
+            {
+                project = continuum.getAntProject( projectId );
+            }
+            else if ( project.getExecutorId().equals( ShellBuildExecutor.ID ) )
+            {
+                project = continuum.getShellProject( projectId );
+            }
+
+            project.setName( name );
+
+            project.setScmUrl( scmUrl );
+
+            project.setNagEmailAddress( nagEmailAddress );
+
+            project.setVersion( version );
+
+            project.setCommandLineArguments( commandLineArguments );
+
+            // ----------------------------------------------------------------------
+            //
+            // ----------------------------------------------------------------------
+
+            if ( project instanceof MavenOneProject )
+            {
+                continuum.updateMavenOneProject( (MavenOneProject) project );
+            }
+            else if ( project instanceof MavenTwoProject )
+            {
+                continuum.updateMavenTwoProject( (MavenTwoProject) project );
+            }
+            else if ( project instanceof AntProject )
+            {
+                continuum.updateAntProject( (AntProject) project );
+            }
+            else if ( project instanceof ShellProject )
+            {
+                continuum.updateShellProject( (ShellProject) project );
+            }
+            else
+            {
+                return handleException( "ContinuumXmlRpc.updateProject()",
+                                        "Project id: '" + projectId + "'.", new ContinuumException(
"Unknown project type: " + project.getClass().getName() ) );
+            }
+
+            return makeHashtable();
+        }
+        catch ( Throwable e )
+        {
+            return handleException( "ContinuumXmlRpc.updateProject()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
@@ -207,11 +307,13 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.updateProjectFromScm(): Project id:
'" + projectId + "'.", e );
+            return handleException( "ContinuumXmlRpc.updateProjectFromScm()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
-    public Hashtable updateProjectConfiguration( String projectId, Hashtable configuration
)
+    public Hashtable updateProjectConfiguration( String projectId,
+                                                 Hashtable configuration )
     {
         try
         {
@@ -230,7 +332,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.updateProjectConfiguration(): Project
id: '" + projectId + "'.", e );
+            return handleException( "ContinuumXmlRpc.updateProjectConfiguration()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
@@ -251,7 +354,7 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.getAllProjects().", e );
+            return handleException( "ContinuumXmlRpc.getAllProjects()", null, e );
         }
     }
 
@@ -265,7 +368,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.removeProject(). Project id: '" + projectId
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.removeProject()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
@@ -283,7 +387,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.buildProject(): project id: '" + projectId
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.buildProject()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
@@ -320,7 +425,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.getBuildsForProject(): id: '" + projectId
+ "'.", e );
+            return handleException( "ContinuumXmlRpc.getBuildsForProject()",
+                                    "Project id: '" + projectId + "'.", e );
         }
     }
 
@@ -348,7 +454,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.getBuild(): id: '" + buildId + "'.",
e );
+            return handleException( "ContinuumXmlRpc.getBuild()",
+                                    "Build id: '" + buildId + "'.", e );
         }
     }
 
@@ -366,7 +473,8 @@
         }
         catch ( Throwable e )
         {
-            return handleException( "ContinuumXmlRpc.getBuildResult(): id: '" + buildId +
"'.", e );
+            return handleException( "ContinuumXmlRpc.getBuildResult()",
+                                    "Build id: '" + buildId + "'.", e );
         }
     }
 
@@ -392,7 +500,7 @@
         return hashtable;
     }
 
-    private Hashtable handleException( String method, Throwable throwable )
+    private Hashtable handleException( String method, String message, Throwable throwable
)
     {
         Hashtable hashtable = new Hashtable();
 
@@ -407,7 +515,14 @@
             hashtable.put( "message", "" );
         }
 
-        hashtable.put( "method", method );
+        if ( StringUtils.isEmpty( message ) )
+        {
+            hashtable.put( "method", method );
+        }
+        else
+        {
+            hashtable.put( "method", method + ": " + message );
+        }
 
         hashtable.put( "stackTrace", getExceptionStackTrace( throwable ) );
 



Mime
View raw message