continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r191590 [1/2] - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-core-it/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/bui...
Date Mon, 20 Jun 2005 23:43:42 GMT
Author: trygvis
Date: Mon Jun 20 16:43:40 2005
New Revision: 191590

URL: http://svn.apache.org/viewcvs?rev=191590&view=rev
Log:
o Overall cleanup of the core. Removing the state field from ContinuumProject.
  This should effectively resolve CONTINUUM-170: "project can get stuck in the
  updating state" as there is no state to get stuck in. Still probably need
  better error handling so I'm leaving it open.
o Adding a simple test for the XmlRpc interface to make easier to test it.
o Fixing CONTINUUM-168: "Store should only deal in terms of model entities".

Added:
    maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java   (with props)
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core-it/continuum.py
    maven/continuum/trunk/continuum-core-it/continuum_cli.py
    maven/continuum/trunk/continuum-core-it/it-2.py
    maven/continuum/trunk/continuum-core-it/it.py
    maven/continuum/trunk/continuum-core-it/it_utils.py
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    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/core/action/ExecuteBuilderContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
    maven/continuum/trunk/continuum-notifiers/   (props changed)
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/   (props changed)
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/   (props changed)
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/   (props changed)
    maven/continuum/trunk/continuum-plexus-application/pom.xml
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/ContinuumViewContextValve.java
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
    maven/continuum/trunk/continuum-xmlrpc/pom.xml
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultXmlRpcHelper.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java Mon Jun 20 16:43:40 2005
@@ -43,8 +43,9 @@
     void removeProject( String projectId )
         throws ContinuumStoreException;
 
-    void setWorkingDirectory( String projectId, String workingDirectory )
-        throws ContinuumStoreException;
+//    /** @deprecated Use updateProject */
+//    void setWorkingDirectory( String projectId, String workingDirectory )
+//        throws ContinuumStoreException;
 
     void updateProject( ContinuumProject project )
         throws ContinuumStoreException;
@@ -80,22 +81,28 @@
     // Build
     // ----------------------------------------------------------------------
 
-    /**
-     * @deprecated
-     */
-    String createBuild( String projectId, boolean forced )
+//    /**
+//     * @deprecated use store build
+//     */
+//    String createBuild( String projectId, boolean forced )
+//        throws ContinuumStoreException;
+
+    String addBuild( String projectId, ContinuumBuild build )
         throws ContinuumStoreException;
 
-    /**
-     * @deprecated
-     */
-    void setBuildResult( String buildId,
-                         int state,
-                         ContinuumBuildExecutionResult result,
-                         UpdateScmResult scmResult,
-                         Throwable error )
+    void updateBuild( ContinuumBuild build )
         throws ContinuumStoreException;
 
+//    /**
+//     * @deprecated use update build
+//     */
+//    void setBuildResult( String buildId,
+//                         int state,
+//                         ContinuumBuildExecutionResult result,
+//                         UpdateScmResult scmResult,
+//                         Throwable error )
+//        throws ContinuumStoreException;
+
     ContinuumBuild getBuild( String buildId )
         throws ContinuumStoreException;
 
@@ -115,37 +122,37 @@
     // Project Transitions
     // ----------------------------------------------------------------------
 
-    void setCheckoutDone( String projectId,
-                          CheckOutScmResult scmResult,
-                          String errorMessage,
-                          Throwable exception )
-        throws ContinuumStoreException;
+//    void setCheckoutDone( String projectId,
+//                          CheckOutScmResult scmResult,
+//                          String errorMessage,
+//                          Throwable exception )
+//        throws ContinuumStoreException;
 
-    void setIsUpdating( String projectId )
-        throws ContinuumStoreException;
+//    void setIsUpdating( String projectId )
+//        throws ContinuumStoreException;
 
-    void setUpdateDone( String projectId )
-        throws ContinuumStoreException;
+//    void setUpdateDone( String projectId )
+//        throws ContinuumStoreException;
 
     // ----------------------------------------------------------------------
     // Build Transitions
     // ----------------------------------------------------------------------
 
-    String buildingProject( String projectId,
-                            boolean forced,
-                            UpdateScmResult scmResult )
-        throws ContinuumStoreException;
+//    String buildingProject( String projectId,
+//                            boolean forced,
+//                            UpdateScmResult scmResult )
+//        throws ContinuumStoreException;
 
-    void setBuildNotExecuted( String projectId )
-        throws ContinuumStoreException;
+//    void setBuildNotExecuted( String projectId )
+//        throws ContinuumStoreException;
 
-    void setBuildComplete( String buildId,
-                           UpdateScmResult scmResult,
-                           ContinuumBuildExecutionResult result )
-        throws ContinuumStoreException;
+//    void setBuildComplete( String buildId,
+//                           UpdateScmResult scmResult,
+//                           ContinuumBuildExecutionResult result )
+//        throws ContinuumStoreException;
 
-    void setBuildError( String buildId,
-                        UpdateScmResult scmResult,
-                        Throwable throwable )
-        throws ContinuumStoreException;
+//    void setBuildError( String buildId,
+//                        UpdateScmResult scmResult,
+//                        Throwable throwable )
+//        throws ContinuumStoreException;
 }

Modified: maven/continuum/trunk/continuum-core-it/continuum.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum.py?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/continuum.py (original)
+++ maven/continuum/trunk/continuum-core-it/continuum.py Mon Jun 20 16:43:40 2005
@@ -228,7 +228,7 @@
         self.scmUrl = map[ "scmUrl" ]
         self.version = map[ "version" ]
         self.workingDirectory = map[ "workingDirectory" ]
-        self.state = int( map[ "state" ] )
+#        self.state = int( map[ "state" ] )
         self.executorId = map[ "executorId" ]
 
         if ( map.has_key( "commandLineArguments" ) ):
@@ -261,10 +261,10 @@
             for f in map[ "notifiers" ]:
                 self.notifiers.append( ContinuumNotifier( f ) )
 
+# "state: " + decodeState( self.state ) + os.linesep +\
     def __str__( self ):
         s = "id: " + self.id + os.linesep +\
             "name: " + self.name + os.linesep +\
-            "state: " + decodeState( self.state ) + os.linesep +\
             "version: " + self.version + os.linesep +\
             "executor id: " + self.executorId + os.linesep
 

Modified: maven/continuum/trunk/continuum-core-it/continuum_cli.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum_cli.py?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/continuum_cli.py (original)
+++ maven/continuum/trunk/continuum-core-it/continuum_cli.py Mon Jun 20 16:43:40 2005
@@ -71,7 +71,7 @@
         print "Name:               " + project.name
         print "Version:            " + project.version
         print "Working directory:  " + project.workingDirectory
-        print "State:              " + continuum.decodeState( project.state )
+#        print "State:              " + continuum.decodeState( project.state )
         print "Executor type:      " + project.executorId
         print "SCM URL:            " + project.scmUrl
 
@@ -110,8 +110,9 @@
         print "Projects:"
         print "  Id |    State     | Executor | Name"
         for project in projects:
-            project.state = continuum.decodeState( project.state )
-            print "%(id)4s | %(state)12s | %(executorId)s | %(name)s" % project.map
+#            project.state = continuum.decodeState( project.state ) 
+# | %(state)12s
+            print "%(id)4s  | %(executorId)s | %(name)s" % project.map
 
     def do_removeProject(self,args):
         """Removes a project."""

Modified: maven/continuum/trunk/continuum-core-it/it-2.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it-2.py?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it-2.py (original)
+++ maven/continuum/trunk/continuum-core-it/it-2.py Mon Jun 20 16:43:40 2005
@@ -79,7 +79,7 @@
 
     project = waitForCheckOut( continuum, projectIds[ 0 ] )
 
-    assertEquals( "The project state should be error.", continuum.STATE_ERROR, project.state )
+#    assertEquals( "The project state should be error.", continuum.STATE_ERROR, project.state )
     assertEquals( "The error message wasn't as expected.", "No such provider: 'crap'.", project.checkOutErrorMessage )
 
 #####################################################################

Modified: maven/continuum/trunk/continuum-core-it/it.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it.py?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it.py (original)
+++ maven/continuum/trunk/continuum-core-it/it.py Mon Jun 20 16:43:40 2005
@@ -45,7 +45,7 @@
     maven1Id = getProjectId( c.addMavenOneProject( "file:" + maven1Project + "/project.xml" ) )
     waitForSuccessfulCheckOut( c, maven1Id );
     maven1 = c.getProject( maven1Id )
-    assertProject( maven1Id, "Maven 1 Project", email, c.STATE_NEW, "1.0", "", "maven-1", maven1 )
+    assertProject( maven1Id, "Maven 1 Project", email, "1.0", "", "maven-1", maven1 )
     assertCheckedOutFiles( maven1, [ "/project.xml", "/src/main/java/Foo.java" ] )
 
     progress( "Building Maven 1 project" )
@@ -82,7 +82,7 @@
     maven2Id = getProjectId( c.addMavenTwoProject( "file:" + maven2Project + "/pom.xml" ) )
     waitForSuccessfulCheckOut( c, maven2Id );
     maven2 = c.getProject( maven2Id )
-    assertProject( maven2Id, "Maven 2 Project", email, c.STATE_NEW, "2.0-SNAPSHOT", "-N", "maven2", maven2 )
+    assertProject( maven2Id, "Maven 2 Project", email, "2.0-SNAPSHOT", "-N", "maven2", maven2 )
 
     progress( "Building Maven 2 project" )
     buildId = buildProject( c, maven2.id ).id
@@ -120,7 +120,7 @@
     antSvnId = getProjectId( c.addAntProject( p ) )
     waitForSuccessfulCheckOut( c, antSvnId );
     antSvn = c.getProject( antSvnId )
-    assertProject( antSvnId, "Ant SVN Project", None, c.STATE_NEW, "3.0", "-v", "ant", antSvn )
+    assertProject( antSvnId, "Ant SVN Project", None, "3.0", "-v", "ant", antSvn )
     progress( "Building SVN Ant project" )
     buildId = buildProject( c, antSvn.id ).id
     assertSuccessfulAntBuild( c, buildId )
@@ -144,7 +144,7 @@
     waitForSuccessfulCheckOut( c, antCvsId );
 
     antCvs = c.getProject( antCvsId )
-    assertProject( antCvsId, "Ant CVS Project", None, c.STATE_NEW, "3.0", "-d", "ant", antCvs )
+    assertProject( antCvsId, "Ant CVS Project", None, "3.0", "-d", "ant", antCvs )
     progress( "Building CVS Ant project" )
     buildId = buildProject( c, antCvs.id ).id
     assertSuccessfulAntBuild( c, buildId )
@@ -166,7 +166,7 @@
     shellId = getProjectId( c.addShellProject( p ) )
     waitForSuccessfulCheckOut( c, shellId );
     shell = c.getProject( shellId )
-    assertProject( shellId, "Shell Project", None, c.STATE_NEW, "3.0", "", "shell", shell )
+    assertProject( shellId, "Shell Project", None, "3.0", "", "shell", shell )
 
     progress( "Building Shell project" )
     buildId = buildProject( c, shell.id ).id
@@ -192,6 +192,8 @@
     shell = c.getProject( shell.id )
     shell.commandLineArguments = "a b";
     c.updateShellProject( shell )
+    shell = c.getProject( shell.id )
+    assertEquals( "Updated command line arguments doesn't match", "a b", shell.commandLineArguments );
 
     buildId = buildProject( c, shell.id ).id
     assertSuccessfulShellBuild( c, buildId, """a

Modified: maven/continuum/trunk/continuum-core-it/it_utils.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it_utils.py?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it_utils.py (original)
+++ maven/continuum/trunk/continuum-core-it/it_utils.py Mon Jun 20 16:43:40 2005
@@ -25,12 +25,10 @@
 
 def assertEquals( message, expected, actual ):
     if ( expected == None and actual != None ):
-        print "Expected None but the actual value was: '" + str( actual ) + "'."
-        sys.exit( -1 )
+        assertionFailed( message, "None", actual )
 
     if ( expected != None and actual == None ):
-        print "Expected '" + str( expected ) + "' but the actual value None."
-        sys.exit( -1 )
+        assertionFailed( message, expected, "None" )
 
     if( expected == actual ):
         return
@@ -66,10 +64,10 @@
 
     assertionFailed( message, "Not None", condition )
 
-def assertProject( projectId, name, nagEmailAddress, state, version, commandLineArguments, executorId, project ):
+def assertProject( projectId, name, nagEmailAddress, version, commandLineArguments, executorId, project ):
     assertNotNull( "project.id", projectId )
     assertEquals( "project.name", name, project.name )
-    assertEquals( "project.state", state, project.state )
+#    assertEquals( "project.state", state, project.state )
     assertEquals( "project.version", version, project.version )
     assertEquals( "project.commandLineArguments", commandLineArguments, project.commandLineArguments )
     assertEquals( "project.executorId", executorId, project.executorId )
@@ -79,6 +77,7 @@
     else:
         assertEquals( "project.notifiers.size", 1, len( project.notifiers ) )
         assertEquals( "project.notifiers[0].type", "mail", project.notifiers[0].type )
+        print str( project.notifiers[0].configuration )
         assertTrue( "project.notifiers[0].configuration.has_key('address')", project.notifiers[0].configuration.has_key('address') )
         assertEquals( "project.notifiers[0].configuration['address']", nagEmailAddress, project.notifiers[0].configuration['address'] )
 
@@ -214,7 +213,10 @@
 def waitForSuccessfulCheckOut( continuum, projectId ):
     project = waitForCheckOut( continuum, projectId )
 
-    assertEquals( "The check out was not successful for project #" + project.id, continuum.STATE_NEW, project.state )
+#    assertEquals( "The check out was not successful for project #" + project.id, continuum.STATE_NEW, project.state )
+    assertEquals( "The check out was not successful for project #" + project.id, None, project.checkOutErrorMessage )
+    assertEquals( "The check out was not successful for project #" + project.id, "", project.checkOutErrorException )
+    assertTrue( "The check out was not successful for project #" + project.id, project.checkOutScmResult.success )
 
     return project
 
@@ -224,7 +226,9 @@
 
     project = continuum.getProject( projectId )
 
-    while( project.state == continuum.STATE_CHECKING_OUT ):
+    while( project.checkOutScmResult == None and
+           project.checkOutErrorMessage == None and
+           project.checkOutErrorException == None ):
         project = continuum.getProject( projectId )
         time.sleep( sleepInterval )
         timeout -= sleepInterval

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Mon Jun 20 16:43:40 2005
@@ -84,10 +84,11 @@
         {
             ContinuumProject p = (ContinuumProject) i.next();
 
-            if ( p.getState() == ContinuumProjectState.FAILED )
-            {
-                list.add( p );
-            }
+// TODO: FIX
+//            if ( p.getState() == ContinuumProjectState.FAILED )
+//            {
+//                list.add( p );
+//            }
         }
 
         return list;
@@ -102,10 +103,11 @@
         {
             ContinuumProject p = (ContinuumProject) i.next();
 
-            if ( p.getState() == ContinuumProjectState.ERROR )
-            {
-                list.add( p );
-            }
+// TODO: FIX
+//            if ( p.getState() == ContinuumProjectState.ERROR )
+//            {
+//                list.add( p );
+//            }
         }
 
         return list;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Mon Jun 20 16:43:40 2005
@@ -17,6 +17,9 @@
  */
 
 import java.util.Collection;
+import java.util.Date;
+import java.io.StringWriter;
+import java.io.PrintWriter;
 
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
@@ -43,19 +46,19 @@
     extends AbstractLogEnabled
     implements BuildController
 {
-    /** @requirement */
+    /** @plexus.requirement */
     private BuildExecutorManager buildExecutorManager;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumStore store;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumNotificationDispatcher notifier;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private Continuum continuum;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumScm scm;
 
     // ----------------------------------------------------------------------
@@ -165,7 +168,8 @@
             {
                 getLogger().info( "No files updated, not building. Project id '" + context.project.getId() + "'." );
 
-                store.setBuildNotExecuted( projectId );
+//                Nothing to do, the project doesn't contain any state anymore
+//                store.setBuildNotExecuted( projectId );
 
                 return;
             }
@@ -198,13 +202,15 @@
     {
         try
         {
-            store.setIsUpdating( context.project.getId() );
+// No state in the project
+//            store.setIsUpdating( context.project.getId() );
 
             notifier.checkoutStarted( context.project );
 
             context.scmResult = scm.updateProject( context.project );
 
-            store.setUpdateDone( context.project.getId() );
+// No state in the project
+//            store.setUpdateDone( context.project.getId() );
 
             return true;
         }
@@ -265,7 +271,11 @@
                 context.state = ContinuumProjectState.FAILED;
             }
 
-            setBuildResult( context.build.getId(), context.state, context.result, context.scmResult, null );
+            setBuildResult( context.build.getId(),
+                            context.state,
+                            context.result,
+                            context.scmResult,
+                            null );
         }
         catch ( Throwable ex )
         {
@@ -303,18 +313,50 @@
                                  int state,
                                  ContinuumBuildExecutionResult result,
                                  UpdateScmResult scmResult,
-                                 Throwable e )
+                                 Throwable error )
         throws ContinuumStoreException
     {
         getLogger().info( "Setting the build id '" + buildId + "' state to " + state );
 
-        store.setBuildResult( buildId, state, result, scmResult, e );
+//        store.setBuildResult( buildId, state, result, scmResult, e );
+
+        ContinuumBuild build = store.getBuild( buildId );
+
+        build.setState( state );
+
+        build.setEndTime( new Date().getTime() );
+
+        build.setError( throwableToString( error ) );
+
+        build.setUpdateScmResult( scmResult );
+
+        // ----------------------------------------------------------------------
+        // Copy over the build result
+        // ----------------------------------------------------------------------
+
+        build.setSuccess( result.isSuccess() );
+
+        build.setStandardOutput( result.getStandardOutput() );
+
+        build.setStandardError( result.getStandardError() );
+
+        build.setExitCode( result.getExitCode() );
+
+        store.updateBuild( build );
     }
 
     private void makeBuild( BuildContext context )
         throws ContinuumStoreException
     {
-        String buildId = store.createBuild( context.project.getId(), context.forced );
+//        String buildId = store.createBuild( context.project.getId(), context.forced );
+
+        ContinuumBuild build = new ContinuumBuild();
+
+        build.setStartTime( System.currentTimeMillis() );
+        build.setState( ContinuumProjectState.BUILDING );
+        build.setForced( context.forced );
+
+        String buildId = store.addBuild( context.project.getId(), build );
 
         getLogger().info( "Build id: '" + buildId + "'." );
 
@@ -330,5 +372,23 @@
         Collection builds = store.getBuildsForProject( project.getId(), 0, 0 );
 
         return builds.size() == 0;
+    }
+
+    public static String throwableToString( Throwable error )
+    {
+        if ( error == null )
+        {
+            return "";
+        }
+
+        StringWriter writer = new StringWriter();
+
+        PrintWriter printer = new PrintWriter( writer );
+
+        error.printStackTrace( printer );
+
+        printer.flush();
+
+        return writer.getBuffer().toString();
     }
 }

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=191590&r1=191589&r2=191590&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 Mon Jun 20 16:43:40 2005
@@ -533,6 +533,8 @@
             // Set the working directory
             // ----------------------------------------------------------------------
 
+            project = store.getProject( projectId );
+
             projectWorkingDirectory = new File( workingDirectory, projectId );
 
             if ( !projectWorkingDirectory.exists() && !projectWorkingDirectory.mkdirs() )
@@ -547,7 +549,8 @@
             // Check out the project
             // ----------------------------------------------------------------------
 
-            store.setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath() );
+            store.updateProject( project );
+//            store.setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath() );
         }
         catch ( ContinuumStoreException ex )
         {
@@ -702,37 +705,37 @@
         // them to ensure that they're always checked out.
         // ----------------------------------------------------------------------
 
-        getLogger().info( "Checking for projects that has to be checked out." );
-
-        try
-        {
-            for ( Iterator it = store.getAllProjects().iterator(); it.hasNext(); )
-            {
-                ContinuumProject project = (ContinuumProject) it.next();
-
-                if ( project.getState() != ContinuumProjectState.CHECKING_OUT )
-                {
-                    continue;
-                }
-
-                getLogger().info( "Adding '" + project.getName() + "' to the check out queue." );
-
-                CheckOutTask checkOutTask = new CheckOutTask( project.getId(),
-                                                              new File( project.getWorkingDirectory() ) );
-
-                checkOutQueue.put( checkOutTask );
-            }
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new StartingException( "Error while enqueuing all projects in the 'checking out' state to " +
-                                         "the check out queue.", e );
-        }
-        catch ( TaskQueueException e )
-        {
-            throw new StartingException( "Error while enqueuing all projects in the 'checking out' state to " +
-                                         "the check out queue.", e );
-        }
+//        getLogger().info( "Checking for projects that has to be checked out." );
+//
+//        try
+//        {
+//            for ( Iterator it = store.getAllProjects().iterator(); it.hasNext(); )
+//            {
+//                ContinuumProject project = (ContinuumProject) it.next();
+//
+//                if ( project.getState() != ContinuumProjectState.CHECKING_OUT )
+//                {
+//                    continue;
+//                }
+//
+//                getLogger().info( "Adding '" + project.getName() + "' to the check out queue." );
+//
+//                CheckOutTask checkOutTask = new CheckOutTask( project.getId(),
+//                                                              new File( project.getWorkingDirectory() ) );
+//
+//                checkOutQueue.put( checkOutTask );
+//            }
+//        }
+//        catch ( ContinuumStoreException e )
+//        {
+//            throw new StartingException( "Error while enqueuing all projects in the 'checking out' state to " +
+//                                         "the check out queue.", e );
+//        }
+//        catch ( TaskQueueException e )
+//        {
+//            throw new StartingException( "Error while enqueuing all projects in the 'checking out' state to " +
+//                                         "the check out queue.", e );
+//        }
 
         // ----------------------------------------------------------------------
         //

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=191590&r1=191589&r2=191590&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 Mon Jun 20 16:43:40 2005
@@ -43,9 +43,8 @@
 
         result = getScm().checkOut( project, workingDirectory );
 
-        getStore().setCheckoutDone( projectId, result, null, null );
+//        getStore().setCheckoutDone( projectId, result, null, null );
 
         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/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java Mon Jun 20 16:43:40 2005
@@ -17,14 +17,18 @@
  */
 
 import java.util.Collection;
+import java.util.Date;
 import java.util.Map;
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.UpdateScmResult;
+import org.apache.maven.continuum.store.AbstractContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -58,7 +62,8 @@
         {
             getLogger().info( "No files updated, not building. Project id '" + project.getId() + "'." );
 
-            getStore().setBuildNotExecuted( getProjectId( context ) );
+// No state in the project
+//            getStore().setBuildNotExecuted( getProjectId( context ) );
 
             return;
         }
@@ -67,9 +72,11 @@
         // Make the build result
         // ----------------------------------------------------------------------
 
-        String buildId = getStore().buildingProject( getProjectId( context ),
-                                                     forced,
-                                                     updateScmResult );
+//        String buildId = getStore().buildingProject( getProjectId( context ),
+//                                                     forced,
+//                                                     updateScmResult );
+
+        String buildId = createBuild( project, forced, updateScmResult );
 
         context.put( KEY_BUILD_ID, buildId );
 
@@ -84,11 +91,55 @@
         int state = result.isSuccess() ?
                     ContinuumProjectState.OK : ContinuumProjectState.FAILED;
 
-        getStore().setBuildResult( buildId,
-                                   state,
-                                   result,
-                                   updateScmResult,
-                                   null );
+//        getStore().setBuildResult( buildId,
+//                                   state,
+//                                   result,
+//                                   updateScmResult,
+//                                   null );
+
+        ContinuumBuild build = getStore().getBuild( buildId );
+
+        build.setState( state );
+
+        build.setEndTime( new Date().getTime() );
+
+        build.setError( AbstractContinuumStore.throwableToString( null ) );
+
+        build.setUpdateScmResult( updateScmResult );
+
+        // ----------------------------------------------------------------------
+        // Copy over the build result
+        // ----------------------------------------------------------------------
+
+        build.setSuccess( result.isSuccess() );
+
+        build.setStandardOutput( result.getStandardOutput() );
+
+        build.setStandardError( result.getStandardError() );
+
+        build.setExitCode( result.getExitCode() );
+
+        getStore().updateBuild( build );
+    }
+
+    private String createBuild( ContinuumProject project,
+                                boolean forced,
+                                UpdateScmResult scmResult )
+        throws ContinuumStoreException
+    {
+        ContinuumBuild build = new ContinuumBuild();
+
+        build.setStartTime( new Date().getTime() );
+
+        build.setState( ContinuumProjectState.BUILDING );
+
+//        project.setState( ContinuumProjectState.BUILDING );
+
+        build.setForced( forced );
+
+        build.setUpdateScmResult( scmResult );
+
+        return getStore().addBuild( project.getId(), build );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java Mon Jun 20 16:43:40 2005
@@ -29,16 +29,7 @@
 
         String projectId = getStore().addProject( project );
 
-        /*
-        String projectId = getStore().addProject( project.getName(),
-                                                  project.getScmUrl(),
-                                                  project.getNagEmailAddress(),
-                                                  project.getVersion(),
-                                                  project.getCommandLineArguments(),
-                                                  project.getExecutorId(),
-                                                  null,
-                                                  project.getConfiguration() );
-        */
+        project = getStore().getProject( projectId );
 
         context.put( KEY_PROJECT_ID, projectId );
 
@@ -59,6 +50,8 @@
 
         project.setWorkingDirectory( projectWorkingDirectory.getAbsolutePath() );
 
-        getStore().setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath() );
+        getStore().updateProject( project );
+
+//        getStore().setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath() );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java Mon Jun 20 16:43:40 2005
@@ -39,7 +39,7 @@
         //
         // ----------------------------------------------------------------------
 
-        getStore().setIsUpdating( projectId );
+//        getStore().setIsUpdating( projectId );
 
         getNotifier().checkoutStarted( project );
 
@@ -47,6 +47,6 @@
 
         context.put( KEY_UPDATE_SCM_RESULT, updateScmResult );
 
-        getStore().setUpdateDone( projectId );
+//        getStore().setUpdateDone( projectId );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Mon Jun 20 16:43:40 2005
@@ -57,26 +57,26 @@
     // Requirements
     // ----------------------------------------------------------------------
 
-    /** @requirement */
+    /** @plexus.requirement */
     private VelocityComponent velocity;
 
-    /** @configuration */
+    /** @plexus.configuration */
     private ContinuumStore store;
 
-    /** @configuration */
+    /** @plexus.configuration */
     private MailSender mailSender;
 
     // ----------------------------------------------------------------------
     // Configuration
     // ----------------------------------------------------------------------
 
-    /** @configuration */
+    /** @plexus.configuration */
     private String fromMailbox;
 
-    /** @configuration */
+    /** @plexus.configuration */
     private String fromName;
 
-    /** @configuration */
+    /** @plexus.configuration */
     private String timestampFormat;
 
     // ----------------------------------------------------------------------
@@ -258,7 +258,7 @@
         // Send the mail
         // ----------------------------------------------------------------------
 
-        String subject = generateSubject( project );
+        String subject = generateSubject( project, build );
 
         sendMessage( project, recipients, subject, content );
     }
@@ -267,9 +267,9 @@
     //
     // ----------------------------------------------------------------------
 
-    private String generateSubject( ContinuumProject project )
+    private String generateSubject( ContinuumProject project, ContinuumBuild build )
     {
-        int state = project.getState();
+        int state = build.getState();
 
         if ( state == ContinuumProjectState.OK )
         {
@@ -285,9 +285,9 @@
         }
         else
         {
-            getLogger().warn( "Unknown build state " + project.getState() );
+            getLogger().warn( "Unknown build state " + build.getState() );
 
-            return "[continuum] ERROR: Unknown build state " + project.getState();
+            return "[continuum] ERROR: Unknown build state " + build.getState();
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java Mon Jun 20 16:43:40 2005
@@ -38,7 +38,7 @@
 {
     public static final String ID = "maven-one-builder";
 
-    /** @requirement */
+    /** @plexus.requirement */
     private MavenOneMetadataHelper metadataHelper;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java Mon Jun 20 16:43:40 2005
@@ -24,6 +24,7 @@
 import org.apache.maven.continuum.scm.ContinuumScmException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.store.AbstractContinuumStore;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -39,10 +40,10 @@
     extends AbstractLogEnabled
     implements TaskExecutor
 {
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumScm scm;
 
-    /** @requirement */
+    /** @plexus.requirement */
     private ContinuumStore store;
 
     // ----------------------------------------------------------------------
@@ -102,7 +103,16 @@
 
         try
         {
-            store.setCheckoutDone( projectId, result, errorMessage, exception );
+//            store.setCheckoutDone( projectId, result, errorMessage, exception );
+            project = store.getProject( projectId );
+
+            project.setCheckOutScmResult( result );
+
+            project.setCheckOutErrorMessage( errorMessage );
+
+            project.setCheckOutErrorException( AbstractContinuumStore.throwableToString( exception ) );
+
+            store.updateProject( project );
         }
         catch ( ContinuumStoreException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java Mon Jun 20 16:43:40 2005
@@ -82,7 +82,7 @@
     {
         try
         {
-            project.setState( ContinuumProjectState.CHECKING_OUT );
+//            project.setState( ContinuumProjectState.CHECKING_OUT );
 
             Object id = store.addContinuumProject( project );
 
@@ -149,26 +149,26 @@
         }
     }
 
-    public void setWorkingDirectory( String projectId, String workingDirectory )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            project.setWorkingDirectory( workingDirectory );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting the working directory.", e );
-        }
-    }
+//    public void setWorkingDirectory( String projectId, String workingDirectory )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            project.setWorkingDirectory( workingDirectory );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting the working directory.", e );
+//        }
+//    }
 
     public void updateProject( ContinuumProject project )
         throws ContinuumStoreException
@@ -179,6 +179,8 @@
 
             store.storeContinuumProject( project );
 
+            project = store.getContinuumProject( project.getId(), true );
+
 //            pm.attachCopyAll( project.getDevelopers(), true );
 //
 //            Collection notifiers = project.getNotifiers();
@@ -352,7 +354,42 @@
     // Build
     // ----------------------------------------------------------------------
 
-    public String createBuild( String projectId, boolean forced )
+//    public String createBuild( String projectId, boolean forced )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            ContinuumBuild build = new ContinuumBuild();
+//
+//            build.setStartTime( System.currentTimeMillis() );
+//
+//            build.setState( ContinuumProjectState.BUILDING );
+//
+//            build.setProject( project );
+//
+//            build.setForced( forced );
+//
+//            Object id = store.addContinuumBuild( build );
+//
+//            store.commit();
+//
+//            build = store.getContinuumBuildByJdoId( id, true );
+//
+//            return build.getId();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while creating continuum build for project: '" + projectId + "'.", e );
+//        }
+//    }
+
+    public String addBuild( String projectId, ContinuumBuild build )
         throws ContinuumStoreException
     {
         try
@@ -361,15 +398,11 @@
 
             ContinuumProject project = store.getContinuumProject( projectId, false );
 
-            ContinuumBuild build = new ContinuumBuild();
-
-            build.setStartTime( System.currentTimeMillis() );
-
-            build.setState( ContinuumProjectState.BUILDING );
-
             build.setProject( project );
 
-            build.setForced( forced );
+//            build.setStartTime( System.currentTimeMillis() );
+//            build.setState( ContinuumProjectState.BUILDING );
+//            build.setForced( forced );
 
             Object id = store.addContinuumBuild( build );
 
@@ -387,55 +420,68 @@
         }
     }
 
-    public void setBuildResult( String buildId,
-                                int state,
-                                ContinuumBuildExecutionResult result,
-                                UpdateScmResult scmResult,
-                                Throwable error )
+    public void updateBuild( ContinuumBuild build )
         throws ContinuumStoreException
     {
         try
         {
-            store.begin();
-
-            ContinuumBuild build = store.getContinuumBuild( buildId, false );
-
-            // TODO: as build.getProject() should be removed replace this with
-            //       a search for the project
-            ContinuumProject project = build.getProject();
-
-            project.setState( state );
-
-            build.setState( state );
-
-            build.setEndTime( new Date().getTime() );
-
-            build.setError( throwableToString( error ) );
-
-            build.setUpdateScmResult( scmResult );
-
-            // ----------------------------------------------------------------------
-            // Copy over the build result
-            // ----------------------------------------------------------------------
-
-            build.setSuccess( result.isSuccess() );
-
-            build.setStandardOutput( result.getStandardOutput() );
-
-            build.setStandardError( result.getStandardError() );
-
-            build.setExitCode( result.getExitCode() );
-
-            store.commit();
+            store.storeContinuumBuild( build );
         }
         catch ( Exception e )
         {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
+            throw new ContinuumStoreException( "Error while updating continuum build: '" + build.getId() + "'.", e );
         }
     }
 
+//    public void setBuildResult( String buildId,
+//                                int state,
+//                                ContinuumBuildExecutionResult result,
+//                                UpdateScmResult scmResult,
+//                                Throwable error )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumBuild build = store.getContinuumBuild( buildId, false );
+//
+//            // TODO: as build.getProject() should be removed replace this with
+//            //       a search for the project
+//            ContinuumProject project = build.getProject();
+//
+//            project.setState( state );
+//
+//            build.setState( state );
+//
+//            build.setEndTime( new Date().getTime() );
+//
+//            build.setError( throwableToString( error ) );
+//
+//            build.setUpdateScmResult( scmResult );
+//
+//            // ----------------------------------------------------------------------
+//            // Copy over the build result
+//            // ----------------------------------------------------------------------
+//
+//            build.setSuccess( result.isSuccess() );
+//
+//            build.setStandardOutput( result.getStandardOutput() );
+//
+//            build.setStandardError( result.getStandardError() );
+//
+//            build.setExitCode( result.getExitCode() );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
+//        }
+//    }
+
     public ContinuumBuild getBuild( String buildId )
         throws ContinuumStoreException
     {
@@ -583,240 +629,239 @@
     //
     // ----------------------------------------------------------------------
 
-    public void setCheckoutDone( String projectId,
-                                 CheckOutScmResult scmResult,
-                                 String errorMessage,
-                                 Throwable exception )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            int state;
-
-            if ( scmResult != null &&
-                 scmResult.isSuccess() &&
-                 StringUtils.isEmpty( errorMessage ) &&
-                 exception == null )
-            {
-                state = ContinuumProjectState.NEW;
-            }
-            else
-            {
-                state = ContinuumProjectState.ERROR;
-            }
-
-            project.setState( state );
-
-            project.setCheckOutScmResult( scmResult );
-
-            project.setCheckOutErrorMessage( errorMessage );
-
-            project.setCheckOutErrorException( throwableToString( exception ) );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting check out scm result.", e );
-        }
-    }
-
-    public void setIsUpdating( String projectId )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            project.setState( ContinuumProjectState.UPDATING );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting build state.", e );
-        }
-    }
-
-    public void setUpdateDone( String projectId )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            project.setState( ContinuumProjectState.BUILDING );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting update scm result.", e );
-        }
-    }
-
-    public void setBuildNotExecuted( String projectId )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            int state;
-
-            ContinuumBuild latestBuild = getLatestBuildForProject( projectId );
-
-            if ( latestBuild == null )
-            {
-                state = ContinuumProjectState.NEW;
-            }
-            else
-            {
-                state = latestBuild.getState();
-            }
-
-            project.setState( state );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting update scm result.", e );
-        }
-    }
-
-    public String buildingProject( String projectId,
-                                   boolean forced,
-                                   UpdateScmResult scmResult )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            ContinuumProject project = store.getContinuumProject( projectId, false );
-
-            ContinuumBuild build = new ContinuumBuild();
-
-            build.setStartTime( new Date().getTime() );
-
-            build.setState( ContinuumProjectState.BUILDING );
-
-            project.setState( ContinuumProjectState.BUILDING );
-
-            build.setProject( project );
-
-            build.setForced( forced );
-
-            build.setUpdateScmResult( scmResult );
-
-            Object id = store.addContinuumBuild( build );
-
-            build = store.getContinuumBuildByJdoId( id, false );
-
-            store.commit();
-
-            return build.getId();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while creating continuum build for project: '" + projectId + "'.", e );
-        }
-
-    }
-
-    public void setBuildComplete( String buildId,
-                                  UpdateScmResult scmResult,
-                                  ContinuumBuildExecutionResult result )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            int state = result.isSuccess() ?
-                        ContinuumProjectState.OK : ContinuumProjectState.FAILED;
-
-            ContinuumBuild build = store.getContinuumBuild( buildId, false );
-
-            build.setState( state );
-
-            ContinuumProject project = build.getProject();
-
-            project.setState( state );
-
-            // ----------------------------------------------------------------------
-            // Copy over the build result
-            // ----------------------------------------------------------------------
-
-            build.setSuccess( result.isSuccess() );
-
-            build.setStandardOutput( result.getStandardOutput() );
-
-            build.setStandardError( result.getStandardError() );
-
-            build.setExitCode( result.getExitCode() );
-
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
-
-            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
-        }
-    }
-
-    public void setBuildError( String buildId,
-                               UpdateScmResult scmResult,
-                               Throwable throwable )
-        throws ContinuumStoreException
-    {
-        try
-        {
-            store.begin();
-
-            int state = ContinuumProjectState.ERROR;
-
-            ContinuumBuild build = store.getContinuumBuild( buildId, false );
+//    public void setCheckoutDone( String projectId,
+//                                 CheckOutScmResult scmResult,
+//                                 String errorMessage,
+//                                 Throwable exception )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            int state;
+//
+//            if ( scmResult != null &&
+//                 scmResult.isSuccess() &&
+//                 StringUtils.isEmpty( errorMessage ) &&
+//                 exception == null )
+//            {
+//                state = ContinuumProjectState.NEW;
+//            }
+//            else
+//            {
+//                state = ContinuumProjectState.ERROR;
+//            }
+//
+//            project.setState( state );
+//
+//            project.setCheckOutScmResult( scmResult );
+//
+//            project.setCheckOutErrorMessage( errorMessage );
+//
+//            project.setCheckOutErrorException( throwableToString( exception ) );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting check out scm result.", e );
+//        }
+//    }
 
-            build.setState( state );
+//    public void setIsUpdating( String projectId )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            project.setState( ContinuumProjectState.UPDATING );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting build state.", e );
+//        }
+//    }
 
-            ContinuumProject project = build.getProject();
+//    public void setUpdateDone( String projectId )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            project.setState( ContinuumProjectState.BUILDING );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting update scm result.", e );
+//        }
+//    }
 
-            project.setState( state );
+//    public void setBuildNotExecuted( String projectId )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            int state;
+//
+//            ContinuumBuild latestBuild = getLatestBuildForProject( projectId );
+//
+//            if ( latestBuild == null )
+//            {
+//                state = ContinuumProjectState.NEW;
+//            }
+//            else
+//            {
+//                state = latestBuild.getState();
+//            }
+//
+//            project.setState( state );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting update scm result.", e );
+//        }
+//    }
 
-            build.setError( throwableToString( throwable ) );
+//    public String buildingProject( String projectId,
+//                                   boolean forced,
+//                                   UpdateScmResult scmResult )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            ContinuumProject project = store.getContinuumProject( projectId, false );
+//
+//            ContinuumBuild build = new ContinuumBuild();
+//
+//            build.setStartTime( new Date().getTime() );
+//
+//            build.setState( ContinuumProjectState.BUILDING );
+//
+//            project.setState( ContinuumProjectState.BUILDING );
+//
+//            build.setProject( project );
+//
+//            build.setForced( forced );
+//
+//            build.setUpdateScmResult( scmResult );
+//
+//            Object id = store.addContinuumBuild( build );
+//
+//            build = store.getContinuumBuildByJdoId( id, false );
+//
+//            store.commit();
+//
+//            return build.getId();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while creating continuum build for project: '" + projectId + "'.", e );
+//        }
+//    }
 
-            store.commit();
-        }
-        catch ( Exception e )
-        {
-            rollback( store );
+//    public void setBuildComplete( String buildId,
+//                                  UpdateScmResult scmResult,
+//                                  ContinuumBuildExecutionResult result )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            int state = result.isSuccess() ?
+//                        ContinuumProjectState.OK : ContinuumProjectState.FAILED;
+//
+//            ContinuumBuild build = store.getContinuumBuild( buildId, false );
+//
+//            build.setState( state );
+//
+//            ContinuumProject project = build.getProject();
+//
+//            project.setState( state );
+//
+//            // ----------------------------------------------------------------------
+//            // Copy over the build result
+//            // ----------------------------------------------------------------------
+//
+//            build.setSuccess( result.isSuccess() );
+//
+//            build.setStandardOutput( result.getStandardOutput() );
+//
+//            build.setStandardError( result.getStandardError() );
+//
+//            build.setExitCode( result.getExitCode() );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
+//        }
+//    }
 
-            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
-        }
-    }
+//    public void setBuildError( String buildId,
+//                               UpdateScmResult scmResult,
+//                               Throwable throwable )
+//        throws ContinuumStoreException
+//    {
+//        try
+//        {
+//            store.begin();
+//
+//            int state = ContinuumProjectState.ERROR;
+//
+//            ContinuumBuild build = store.getContinuumBuild( buildId, false );
+//
+//            build.setState( state );
+//
+//            ContinuumProject project = build.getProject();
+//
+//            project.setState( state );
+//
+//            build.setError( throwableToString( throwable ) );
+//
+//            store.commit();
+//        }
+//        catch ( Exception e )
+//        {
+//            rollback( store );
+//
+//            throw new ContinuumStoreException( "Error while setting build result for build: '" + buildId + "'.", e );
+//        }
+//    }
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java (original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java Mon Jun 20 16:43:40 2005
@@ -18,6 +18,8 @@
 
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ModelloJPoxContinuumStoreTest;
+import org.apache.maven.continuum.project.ContinuumBuild;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 
 import org.codehaus.plexus.PlexusTestCase;
 
@@ -40,11 +42,16 @@
                                                                      "Notification Dispatcher Test Project",
                                                                      "scm:notification/dispatcher" );
 
-        store.setIsUpdating( projectId );
+//        store.setIsUpdating( projectId );
 
-        store.setUpdateDone( projectId );
+//        store.setUpdateDone( projectId );
 
-        String buildId = store.createBuild( projectId, false );
+//        String buildId = store.createBuild( projectId, false );
+        ContinuumBuild build = new ContinuumBuild();
+        build.setStartTime( System.currentTimeMillis() );
+        build.setState( ContinuumProjectState.BUILDING );
+        build.setForced( false );
+        String buildId = store.addBuild( projectId, build );
 
         notificationDispatcher.buildComplete( store.getProject( projectId ), store.getBuild( buildId ) );
     }

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=191590&r1=191589&r2=191590&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 Mon Jun 20 16:43:40 2005
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Date;
 
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -239,7 +240,7 @@
 
         assertNotNull( project );
 
-        assertEquals( ContinuumProjectState.CHECKING_OUT, project.getState() );
+//        assertEquals( ContinuumProjectState.CHECKING_OUT, project.getState() );
 
         // ----------------------------------------------------------------------
         //
@@ -249,13 +250,14 @@
 
         checkOutScmResult.setSuccess( true );
 
-        store.setCheckoutDone( projectId, checkOutScmResult, null, null );
+//        store.setCheckoutDone( projectId, checkOutScmResult, null, null );
+        setCheckoutDone( store, projectId, checkOutScmResult, null, null );
 
         project = store.getProject( projectId );
 
         assertNotNull( project );
 
-        assertEquals( ContinuumProjectState.NEW, project.getState() );
+//        assertEquals( ContinuumProjectState.NEW, project.getState() );
 
         // ----------------------------------------------------------------------
         //
@@ -411,11 +413,11 @@
 
         String projectId = addMavenTwoProject( "Remove Test Project", "scm:remove-project" );
 
-        store.setIsUpdating( projectId );
+//        store.setIsUpdating( projectId );
 
-        store.setUpdateDone( projectId );
+//        store.setUpdateDone( projectId );
 
-        String buildId = store.createBuild( projectId, false );
+        String buildId = createBuild( store, projectId, false );
 
         UpdateScmResult scmResult = new UpdateScmResult();
 
@@ -425,11 +427,12 @@
 
         scmResult.addUpdatedFile( file );
 
-        store.setBuildResult( buildId,
-                              ContinuumProjectState.OK,
-                              makeContinuumBuildExecutionResult( true, "", "", 0 ),
-                              scmResult,
-                              null );
+        setBuildResult( store,
+                        buildId,
+                        ContinuumProjectState.OK,
+                        makeContinuumBuildExecutionResult( true, "", "", 0 ),
+                        scmResult,
+                        null );
 
         store.removeProject( projectId );
     }
@@ -519,15 +522,15 @@
 
         String projectId = addMavenTwoProject( "Build Test Project", "scm:build" );
 
-        store.setIsUpdating( projectId );
+//        store.setIsUpdating( projectId );
 
-        store.setUpdateDone( projectId );
+//        store.setUpdateDone( projectId );
 
         // ----------------------------------------------------------------------
         // Construct a build object
         // ----------------------------------------------------------------------
 
-        String buildId = store.createBuild( projectId, false );
+        String buildId = createBuild( store, projectId, false );
 
         UpdateScmResult updateScmResult = new UpdateScmResult();
 
@@ -543,9 +546,10 @@
 
         updateScmResult.getUpdatedFiles().add( scmFile );
 
-        store.setBuildComplete( buildId,
-                                updateScmResult,
-                                makeContinuumBuildExecutionResult( true, "stdout", "stderr", 10 ) );
+        setBuildComplete( store,
+                          buildId,
+                          updateScmResult,
+                          makeContinuumBuildExecutionResult( true, "stdout", "stderr", 10 ) );
 
         // ----------------------------------------------------------------------
         // Store and check the build object
@@ -564,6 +568,27 @@
         assertEquals( "build.id", buildId, build.getId() );
     }
 
+    private void setBuildComplete( ContinuumStore store,
+                                   String buildId,
+                                   UpdateScmResult updateScmResult,
+                                   ContinuumBuildExecutionResult result )
+        throws ContinuumStoreException
+    {
+        ContinuumBuild build = store.getBuild( buildId );
+
+        build.setUpdateScmResult( updateScmResult );
+
+        build.setSuccess( result.isSuccess() );
+
+        build.setStandardOutput( result.getStandardOutput() );
+
+        build.setStandardError( result.getStandardError() );
+
+        build.setExitCode( result.getExitCode() );
+
+        store.updateBuild( build );
+    }
+
     public void testTheAssociationBetweenTheProjectAndItsBuilds()
         throws Exception
     {
@@ -577,21 +602,21 @@
 
         String projectId = addMavenTwoProject( "Association Test Project", "scm:association" );
 
-        store.setIsUpdating( projectId );
-
-        store.setUpdateDone( projectId );
+//        store.setIsUpdating( projectId );
+//
+//        store.setUpdateDone( projectId );
 
         String projectIdFoo = addMavenTwoProject( "Foo Project", "scm:association-foo" );
 
-        store.setIsUpdating( projectIdFoo );
-
-        store.setUpdateDone( projectIdFoo );
+//        store.setIsUpdating( projectIdFoo );
+//
+//        store.setUpdateDone( projectIdFoo );
 
         String projectIdBar = addMavenTwoProject( "Bar Project", "scm:association-bar" );
 
-        store.setIsUpdating( projectIdBar );
-
-        store.setUpdateDone( projectIdBar );
+//        store.setIsUpdating( projectIdBar );
+//
+//        store.setUpdateDone( projectIdBar );
 
         // ----------------------------------------------------------------------
         //
@@ -601,13 +626,13 @@
 
         for ( int i = 0; i < 10; i++ )
         {
-            expectedBuilds.add( 0, store.createBuild( projectId, false ) );
+            expectedBuilds.add( 0, createBuild( store, projectId, false ) );
 
-            store.createBuild( projectIdFoo, false );
+            createBuild( store, projectIdFoo, false );
 
-            store.createBuild( projectIdBar, false );
+            createBuild( store, projectIdBar, false );
 
-            store.createBuild( projectIdFoo, false );
+            createBuild( store, projectIdFoo, false );
         }
 
         // ----------------------------------------------------------------------
@@ -643,15 +668,15 @@
     {
         String projectId = addMavenTwoProject( "Association Test Project", "scm:association" );
 
-        store.setIsUpdating( projectId );
-
-        store.setUpdateDone( projectId );
+//        store.setIsUpdating( projectId );
+//
+//        store.setUpdateDone( projectId );
 
         List expectedBuilds = new ArrayList();
 
         for ( int i = 0; i < 10; i++ )
         {
-            expectedBuilds.add( 0, store.createBuild( projectId, false ) );
+            expectedBuilds.add( 0, createBuild( store, projectId, false ) );
         }
 
         // ----------------------------------------------------------------------
@@ -682,19 +707,19 @@
 
         String projectId = addMavenTwoProject( "Build Result Project", "scm:build/result" );
 
-        store.setIsUpdating( projectId );
-
-        assertInState( projectId, ContinuumProjectState.UPDATING );
-
-        store.setUpdateDone( projectId );
-
-        assertInState( projectId, ContinuumProjectState.BUILDING );
+//        store.setIsUpdating( projectId );
+//
+//        assertInState( projectId, ContinuumProjectState.UPDATING );
+//
+//        store.setUpdateDone( projectId );
+//
+//        assertInState( projectId, ContinuumProjectState.BUILDING );
 
         long now = System.currentTimeMillis();
 
-        String buildId = store.createBuild( projectId, false );
+        String buildId = createBuild( store, projectId, false );
 
-        assertInState( projectId, ContinuumProjectState.BUILDING );
+//        assertInState( projectId, ContinuumProjectState.BUILDING );
 
         assertIsCommitted( store );
 
@@ -704,11 +729,11 @@
         // Check that the project's state has been updated
         // ----------------------------------------------------------------------
 
-        ContinuumProject project = store.getProject( projectId );
+//        ContinuumProject project = store.getProject( projectId );
 
         assertIsCommitted( store );
 
-        assertEquals( ContinuumProjectState.BUILDING, project.getState() );
+//        assertEquals( ContinuumProjectState.BUILDING, project.getState() );
 
         // ----------------------------------------------------------------------
         // Check the build
@@ -740,11 +765,12 @@
 
         UpdateScmResult scmResult = new UpdateScmResult();
 
-        store.setBuildResult( buildId,
-                              ContinuumProjectState.OK,
-                              makeContinuumBuildExecutionResult( true, "output", "error", 1 ),
-                              scmResult,
-                              null );
+        setBuildResult( store,
+                        buildId,
+                        ContinuumProjectState.OK,
+                        makeContinuumBuildExecutionResult( true, "output", "error", 1 ),
+                        scmResult,
+                        null );
 
         assertIsCommitted( store );
 
@@ -852,13 +878,13 @@
 
         checkOutScmResult.addCheckedOutFile( scmFile );
 
-        store.setCheckoutDone( projectId, checkOutScmResult, null, null );
+        setCheckoutDone( store, projectId, checkOutScmResult, null, null );
 
         project = store.getProject( projectId );
 
         assertNotNull( project );
 
-        assertEquals( ContinuumProjectState.NEW, project.getState() );
+//        assertEquals( ContinuumProjectState.NEW, project.getState() );
 
         return projectId;
     }
@@ -893,28 +919,99 @@
 
         checkOutScmResult.setSuccess( true );
 
-        store.setCheckoutDone( projectId, checkOutScmResult, null, null );
+        setCheckoutDone( store, projectId, checkOutScmResult, null, null );
 
         ContinuumProject project = store.getProject( projectId );
 
         assertNotNull( project );
 
-        assertEquals( ContinuumProjectState.NEW, project.getState() );
+//        assertEquals( ContinuumProjectState.NEW, project.getState() );
 
         return projectId;
     }
 
-    // ----------------------------------------------------------------------
-    // Assertions
-    // ----------------------------------------------------------------------
+    public static String createBuild( ContinuumStore store, String projectId, boolean forced )
+        throws ContinuumStoreException
+    {
+        ContinuumBuild build = new ContinuumBuild();
+
+        build.setStartTime( System.currentTimeMillis() );
 
-    private void assertInState( String projectId, int state )
+        build.setState( ContinuumProjectState.BUILDING );
+
+        build.setForced( forced );
+
+        return store.addBuild( projectId, build );
+    }
+
+    private static void setCheckoutDone( ContinuumStore store,
+                                  String projectId,
+                                  CheckOutScmResult checkOutScmResult,
+                                  String errorMessage,
+                                  Throwable exception  )
         throws ContinuumStoreException
     {
         ContinuumProject project = store.getProject( projectId );
 
-        assertEquals( state, project.getState() );
+        project.setCheckOutScmResult( checkOutScmResult );
+
+        project.setCheckOutErrorMessage( errorMessage );
+
+        project.setCheckOutErrorException( AbstractContinuumStore.throwableToString( exception ) );
+
+        store.updateProject( project );
     }
+
+    public static void setBuildResult( ContinuumStore store,
+                                       String buildId,
+                                       int state,
+                                       ContinuumBuildExecutionResult result,
+                                       UpdateScmResult scmResult,
+                                       Throwable error )
+        throws ContinuumStoreException
+    {
+        ContinuumBuild build = store.getBuild( buildId );
+
+        build.setState( state );
+
+        build.setEndTime( new Date().getTime() );
+
+        build.setError( AbstractContinuumStore.throwableToString( error ) );
+
+        build.setUpdateScmResult( scmResult );
+
+        // ----------------------------------------------------------------------
+        // Copy over the build result
+        // ----------------------------------------------------------------------
+
+        build.setSuccess( result.isSuccess() );
+
+        build.setStandardOutput( result.getStandardOutput() );
+
+        build.setStandardError( result.getStandardError() );
+
+        build.setExitCode( result.getExitCode() );
+
+        store.updateBuild( build );
+//
+//        ContinuumProject project = store.getProject( build.getProject().getId() );
+//
+//        project.setState( state );
+//
+//        store.updateProject( project );
+    }
+
+    // ----------------------------------------------------------------------
+    // Assertions
+    // ----------------------------------------------------------------------
+
+//    private void assertInState( String projectId, int state )
+//        throws ContinuumStoreException
+//    {
+//        ContinuumProject project = store.getProject( projectId );
+//
+//        assertEquals( state, project.getState() );
+//    }
 
     private void assertIsCommitted( ContinuumStore store )
     {

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=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Mon Jun 20 16:43:40 2005
@@ -45,16 +45,20 @@
           <version>1.0.0</version>
           <type>String</type>
         </field>
+<!--
         <field>
           <name>state</name>
           <version>1.0.0</version>
           <type>int</type>
+-->
           <!--
           <association>
             <type>ContinuumProjectState</type>
           </association>
           -->
+<!--
         </field>
+-->
         <field>
           <name>executorId</name>
           <version>1.0.0</version>

Propchange: maven/continuum/trunk/continuum-notifiers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Jun 20 16:43:40 2005
@@ -0,0 +1,8 @@
+target
+*~
+*.log
+.classpath
+.project
+*.ipr
+*.iws
+*.iml

Propchange: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 20 16:43:40 2005
@@ -1,3 +1,8 @@
-.project
 target
+*~
+*.log
 .classpath
+.project
+*.ipr
+*.iws
+*.iml

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java (original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java Mon Jun 20 16:43:40 2005
@@ -95,7 +95,10 @@
         }
     }
 
-    private void buildComplete( ContinuumProject project, ContinuumBuild build, String source, Set recipients )
+    private void buildComplete( ContinuumProject project,
+                                ContinuumBuild build,
+                                String source,
+                                Set recipients )
         throws ContinuumException
     {
         // ----------------------------------------------------------------------
@@ -117,16 +120,16 @@
 
         ircClient.logon();
 
-        ircClient.sendNotice( (String) configuration.get( "channel" ), generateMessage( project ) );
+        ircClient.sendNotice( (String) configuration.get( "channel" ), generateMessage( project, build ) );
 
         ircClient.logoff();
 
         ircClient.disconnect();
     }
 
-    private String generateMessage( ContinuumProject project )
+    private String generateMessage( ContinuumProject project, ContinuumBuild build )
     {
-        int state = project.getState();
+        int state = build.getState();
 
         if ( state == ContinuumProjectState.OK )
         {
@@ -142,9 +145,9 @@
         }
         else
         {
-            getLogger().warn( "Unknown build state " + project.getState() );
+            getLogger().warn( "Unknown build state " + build.getState() );
 
-            return "ERROR: Unknown build state " + project.getState();
+            return "ERROR: Unknown build state " + build.getState();
         }
     }
 

Propchange: maven/continuum/trunk/continuum-notifiers/continuum-notifier-jabber/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 20 16:43:40 2005
@@ -1,3 +1,8 @@
 target
+*~
+*.log
 .classpath
 .project
+*.ipr
+*.iws
+*.iml

Propchange: maven/continuum/trunk/continuum-notifiers/continuum-notifier-msn/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jun 20 16:43:40 2005
@@ -1,3 +1,8 @@
 target
+*~
+*.log
 .classpath
 .project
+*.ipr
+*.iws
+*.iml

Modified: maven/continuum/trunk/continuum-plexus-application/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/pom.xml?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/pom.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/pom.xml Mon Jun 20 16:43:40 2005
@@ -79,11 +79,13 @@
       <groupId>plexus</groupId>
       <artifactId>plexus-service-jetty</artifactId>
       <version>1.0-alpha-1</version>
+      <type>plexus-service</type>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-service-xmlrpc</artifactId>
       <version>1.0-alpha-2</version>
+      <type>plexus-service</type>
     </dependency>
 
     <!--

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/ContinuumViewContextValve.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/ContinuumViewContextValve.java?rev=191590&r1=191589&r2=191590&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/ContinuumViewContextValve.java (original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/ContinuumViewContextValve.java Mon Jun 20 16:43:40 2005
@@ -29,8 +29,6 @@
     extends CreateViewContextValve
 {
     protected void populateViewContext( RunData data, ViewContext context )
-        throws ValveInvocationException
-    
     {
         context.put( "data", data );
     }



Mime
View raw message