continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r220230 [2/2] - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core-it/src/test/java/org/apache/maven/continuum/it/ continuum-core/s...
Date Fri, 22 Jul 2005 02:49:23 GMT
Modified: maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=220230&r1=220229&r2=220230&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
(original)
+++ maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
Thu Jul 21 19:49:22 2005
@@ -195,11 +195,13 @@
     // Public utility methods
     // ----------------------------------------------------------------------
 
-    public static String addMavenTwoProject( ContinuumStore store,
-                                             ContinuumProject project )
-        throws Exception
+    public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
+                                                      MavenTwoProject project )
+    throws Exception
     {
-        String projectId = store.addProject( project );
+        ContinuumProject addedProject = store.addProject( project );
+
+        assertNotNull( addedProject );
 
         ScmResult scmResult = new ScmResult();
 
@@ -215,56 +217,51 @@
 
         scmResult.addFile( scmFile );
 
-        setCheckoutDone( store, projectId, scmResult, null, null );
-
-        project = store.getProject( projectId );
+        addedProject = setCheckoutDone( store, addedProject, scmResult, null, null );
 
-        assertNotNull( project );
-
-        return projectId;
+        return (MavenTwoProject) addedProject;
     }
 
-    public static String addMavenTwoProject( ContinuumStore store,
-                                             String name,
-                                             String scmUrl )
-        throws Exception
+    public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
+                                                      String name,
+                                                      String scmUrl )
+    throws Exception
     {
         return addMavenTwoProject( store, makeStubMavenTwoProject( name, scmUrl ) );
     }
 
-    public static String addMavenTwoProject( ContinuumStore store,
-                                             String name,
-                                             String scmUrl,
-                                             String nagEmailAddress,
-                                             String version,
-                                             String commandLineArguments,
-                                             String workingDirectory )
-        throws Exception
-    {
-        String projectId = store.addProject( makeMavenTwoProject( name,
-                                                                  scmUrl,
-                                                                  nagEmailAddress,
-                                                                  version,
-                                                                  commandLineArguments,
-                                                                  workingDirectory ) );
+    public static MavenTwoProject addMavenTwoProject( ContinuumStore store,
+                                                      String name,
+                                                      String scmUrl,
+                                                      String nagEmailAddress,
+                                                      String version,
+                                                      String commandLineArguments,
+                                                      String workingDirectory )
+    throws Exception
+    {
+        ContinuumProject project = store.addProject(
+            makeMavenTwoProject( name,
+                                 scmUrl,
+                                 nagEmailAddress,
+                                 version,
+                                 commandLineArguments,
+                                 workingDirectory ) );
 
         ScmResult scmResult = new ScmResult();
 
         scmResult.setSuccess( true );
 
-        setCheckoutDone( store, projectId, scmResult, null, null );
-
-        ContinuumProject project = store.getProject( projectId );
+        project = setCheckoutDone( store, project, scmResult, null, null );
 
         assertNotNull( project );
 
-        return projectId;
+        return (MavenTwoProject) project;
     }
 
-    public static String createBuild( ContinuumStore store,
-                                      String projectId,
-                                      boolean forced )
-        throws ContinuumStoreException
+    public static ContinuumBuild createBuild( ContinuumStore store,
+                                              String projectId,
+                                              boolean forced )
+    throws ContinuumStoreException
     {
         ContinuumBuild build = new ContinuumBuild();
 
@@ -277,34 +274,30 @@
         return store.addBuild( projectId, build );
     }
 
-    public static void setCheckoutDone( ContinuumStore store,
-                                        String projectId,
-                                        ScmResult scmResult,
-                                        String errorMessage,
-                                        Throwable exception )
-        throws ContinuumStoreException
+    public static ContinuumProject setCheckoutDone( ContinuumStore store,
+                                                    ContinuumProject project,
+                                                    ScmResult scmResult,
+                                                    String errorMessage,
+                                                    Throwable exception )
+    throws ContinuumStoreException
     {
-        ContinuumProject project = store.getProject( projectId );
-
         project.setScmResult( scmResult );
 
         project.setCheckOutErrorMessage( errorMessage );
 
         project.setCheckOutErrorException( ContinuumUtils.throwableToString( exception )
);
 
-        store.updateProject( project );
+        return store.updateProject( project );
     }
 
     public static void setBuildResult( ContinuumStore store,
-                                       String buildId,
+                                       ContinuumBuild build,
                                        int state,
                                        ContinuumBuildExecutionResult result,
                                        ScmResult scmResult,
                                        Throwable error )
         throws ContinuumStoreException
     {
-        ContinuumBuild build = store.getBuild( buildId );
-
         build.setState( state );
 
         build.setEndTime( new Date().getTime() );
@@ -328,12 +321,10 @@
     // Assertions
     // ----------------------------------------------------------------------
 
-    public void assertProjectEquals( String projectId,
-                                     ContinuumProject expected,
+    public void assertProjectEquals( ContinuumProject expected,
                                      ContinuumProject actual )
     {
-        assertProjectEquals( projectId,
-                             expected.getName(),
+        assertProjectEquals( expected.getName(),
                              expected.getScmUrl(),
                              expected.getNotifiers(),
                              expected.getVersion(),
@@ -343,8 +334,7 @@
                              actual );
     }
 
-    public void assertProjectEquals( String projectId,
-                                     String name,
+    public void assertProjectEquals( String name,
                                      String scmUrl,
                                      String emailAddress,
                                      String version,
@@ -353,8 +343,7 @@
                                      String workingDirectory,
                                      ContinuumProject actual )
     {
-        assertProjectEquals( projectId,
-                             name,
+        assertProjectEquals( name,
                              scmUrl,
                              createMailNotifierList( emailAddress ),
                              version,
@@ -364,8 +353,7 @@
                              actual );
     }
 
-    public void assertProjectEquals( String projectId,
-                                     String name,
+    public void assertProjectEquals( String name,
                                      String scmUrl,
                                      List notifiers,
                                      String version,
@@ -374,8 +362,6 @@
                                      String workingDirectory,
                                      ContinuumProject actual )
     {
-        assertEquals( "project.id", projectId, actual.getId() );
-
         assertEquals( "project.name", name, actual.getName() );
 
         assertEquals( "project.scmUrl", scmUrl, actual.getScmUrl() );

Modified: maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java?rev=220230&r1=220229&r2=220230&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
Thu Jul 21 19:49:22 2005
@@ -52,15 +52,13 @@
 
         MavenTwoProject project = makeStubMavenTwoProject( "My Project", "scm:foo" );
 
-        String projectId = store.addProject( project );
-
-        project = (MavenTwoProject) store.getProject( projectId );
+        project = (MavenTwoProject) store.addProject( project );
 
         // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------
 
-        Hashtable hashtable = xmlRpc.getProject( projectId );
+        Hashtable hashtable = xmlRpc.getProject( project.getId() );
 
 //        dumpValue( 0, "result", hashtable );
     }
@@ -159,11 +157,11 @@
 
     private void dumpVector( int indent, String key, Vector vector )
     {
+        System.err.println( makeIndent( indent ) + key + " = [" );
+
         Iterator it;
 
         int i;
-
-        System.err.println( makeIndent( indent ) + key + " = [");
 
         for ( it = vector.iterator(), i = 0; it.hasNext(); i++ )
         {



Mime
View raw message