continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r898352 [1/2] - in /continuum/trunk: ./ continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-api/src/main/java/org/apache/maven/continuum/ continuum-buildagent/continuum...
Date Tue, 12 Jan 2010 15:03:25 GMT
Author: brett
Date: Tue Jan 12 15:03:24 2010
New Revision: 898352

URL: http://svn.apache.org/viewvc?rev=898352&view=rev
Log:
[CONTINUUM-2284] Improve performance by reducing the number of requests and by reducing the number of results in requests
Remove some unused methods
Add some TODO in DefaultContinuum
Merged from: r790386

Modified:
    continuum/trunk/   (props changed)
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java   (props changed)
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java   (props changed)
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java   (props changed)
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildAgentBuildExecutorManager.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/BuildAgentMavenBuilderHelper.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java   (props changed)
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java   (props changed)
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java   (props changed)
    continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java   (props changed)
    continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
    continuum/trunk/continuum-data-management/data-management-cli/   (props changed)
    continuum/trunk/continuum-docs/   (props changed)
    continuum/trunk/continuum-docs/src/   (props changed)
    continuum/trunk/continuum-docs/src/site/xdoc/   (props changed)
    continuum/trunk/continuum-jetty/   (props changed)
    continuum/trunk/continuum-model/src/main/resources/package-default.orm   (props changed)
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/DaoUtilsImpl.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/InstallationDaoImpl.java
    continuum/trunk/continuum-webapp/   (props changed)
    continuum/trunk/continuum-webapp-test/src/test/selenium-ide/   (props changed)
    continuum/trunk/continuum-webapp/src/main/java/org/apache/continuum/web/action/admin/BuildAgentAction.java   (props changed)
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmDeleteBuildAgent.jsp   (props changed)
    continuum/trunk/src/site/   (props changed)

Propchange: continuum/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,4 +1,4 @@
 /continuum/branches/continuum-1.2.x:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462
-/continuum/branches/continuum-1.3.x:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds:713270-734307
 /continuum/tags/continuum-1.2.3:733253

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/dao/BuildResultDao.java Tue Jan 12 15:03:24 2010
@@ -19,13 +19,13 @@
  * under the License.
  */
 
+import java.util.List;
+import java.util.Map;
+
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
-import java.util.List;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -45,30 +45,52 @@
 
     BuildResult getLatestBuildResultForProject( int projectId );
 
+    BuildResult getLatestBuildResultForProjectWithDetails( int projectId );
+
     BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId );
 
-    List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate );
+    BuildResult getLatestBuildResultInSuccess( int projectId );
+
+    BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+        throws ContinuumStoreException;
 
     long getNbBuildResultsForProject( int projectId );
 
+    /**
+     * Returns the list of build results between the fromdate and the buildResult defined by its toBuildResultId
+     *
+     * @param projectId       The project id
+     * @param fromDate        the from date
+     * @param tobuildResultId the build result id
+     * @return the list of build results
+     */
+    List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId );
+
+    /**
+     * Returns the number of build results in success since fromDate
+     *
+     * @param projectId The project id
+     * @param fromDate  The from date
+     * @return the number of build results
+     */
+    long getNbBuildResultsInSuccessForProject( int projectId, long fromDate );
+
     List<BuildResult> getBuildResultsForProject( int projectId );
 
     List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex );
 
     /**
-     * @since 1.2
      * @param projectId
-     * @param startIndex
+     * @param startId
      * @return the returned list will contains all BuildResult for this project after the startId
+     * @since 1.2
      */
     List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
-        throws ContinuumStoreException;   
-    
-    List<BuildResult> getBuildResultsForProject( int projectId, long fromDate );
+        throws ContinuumStoreException;
 
     Map<Integer, BuildResult> getLatestBuildResultsByProjectGroupId( int projectGroupId );
 
-    Map<Integer, BuildResult> getLatestBuildResults();
+    Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
 
     List<BuildResult> getBuildResultByBuildNumber( int projectId, int buildNumber );
 
@@ -77,9 +99,5 @@
     List<BuildResult> getBuildResultsByBuildDefinition( int projectId, int buildDefinitionId, long startIndex,
                                                         long endIndex );
 
-    Map<Integer, BuildResult> getBuildResultsInSuccess();
-
-    Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId );
-
     List<BuildResult> getAllBuildsForAProjectByDate( int projectId );
 }

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java:713270-724659

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTask.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTask.java:713270-724659

Propchange: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,2 +1,2 @@
 /continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTask.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339
-/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Tue Jan 12 15:03:24 2010
@@ -66,13 +66,6 @@
     public ProjectGroup getProjectGroup( int projectGroupId )
         throws ContinuumException;
 
-    /**
-     * Get all {@link ProjectGroup}s and their {@link Project}s
-     *
-     * @return {@link Collection} &lt;{@link ProjectGroup}>
-     */
-    public Collection<ProjectGroup> getAllProjectGroupsWithProjects();
-
     public List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
 
     public List<ProjectGroup> getAllProjectGroups();
@@ -158,9 +151,6 @@
     void buildProjects( String username )
         throws ContinuumException;
 
-    void buildProjectsWithBuildDefinition( int buildDefinitionId )
-        throws ContinuumException;
-
     void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
         throws ContinuumException;
 

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildAgentBuildExecutorManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildExecutorManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildAgentBuildExecutorManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildAgentBuildExecutorManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/BuildExecutorManager.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildExecutorManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildAgentBuildExecutorManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/manager/DefaultBuildExecutorManager.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:713270-734307
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m1:724671-733412

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/BuildAgentMavenBuilderHelper.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenBuilderHelper.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/BuildAgentMavenBuilderHelper.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/BuildAgentMavenBuilderHelper.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/MavenBuilderHelper.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultMavenBuilderHelper.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultBuildAgentMavenBuilderHelper.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/build/execution/maven/m2/DefaultMavenBuilderHelper.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumConfiguration.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumConfiguration.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumConfigurationException.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationException.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumConfigurationException.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ConfigurationService.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/BuildAgentConfigurationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ConfigurationService.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultContinuumConfiguration.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultContinuumConfiguration.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultBuildAgentConfigurationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumBuildAgentConfiguration.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/GeneralBuildAgentConfiguration.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/configuration/ContinuumBuildAgentConfiguration.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/InstallationService.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/BuildAgentInstallationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/InstallationService.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultInstallationService.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultBuildAgentInstallationService.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/installation/DefaultInstallationService.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/Continuum.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/BuildAgentManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/Continuum.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/DefaultContinuum.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/manager/DefaultBuildAgentManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/DefaultContinuum.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/TaskQueueManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/TaskQueueManager.java:713270-724659

Propchange: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultTaskQueueManager.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-distributed-build/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultTaskQueueManager.java:713270-724659

Propchange: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskExecutor.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskExecutor.java:713270-724659

Propchange: continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskQueueExecutor.java:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024
-/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/ThreadedDistributedBuildTaskQueueExecutor.java:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/trunk/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildTaskQueueExecutor.java:713270-724659

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java Tue Jan 12 15:03:24 2010
@@ -38,7 +38,7 @@
     public BuildResult convertMapToBuildResult( Map<String, Object> context )
     {
         BuildResult buildResult = new BuildResult();
-    
+
         buildResult.setStartTime( ContinuumBuildConstant.getStartTime( context ) );
         buildResult.setEndTime( ContinuumBuildConstant.getEndTime( context ) );
         buildResult.setError( ContinuumBuildConstant.getBuildError( context ) );
@@ -47,7 +47,7 @@
         buildResult.setTrigger( ContinuumBuildConstant.getTrigger( context ) );
         buildResult.setUsername( ContinuumBuildConstant.getUsername( context ) );
         buildResult.setBuildUrl( ContinuumBuildConstant.getBuildAgentUrl( context ) );
-    
+
         return buildResult;
     }
 
@@ -58,40 +58,39 @@
         {
             return null;
         }
-    
+
         try
         {
             Project project = projectDao.getProjectWithAllDetails( ContinuumBuildConstant.getProjectId( context ) );
             List<ProjectDependency> dependencies = project.getDependencies();
-    
+
             if ( dependencies == null )
             {
                 dependencies = new ArrayList<ProjectDependency>();
             }
-    
+
             if ( project.getParent() != null )
             {
                 dependencies.add( project.getParent() );
             }
-    
+
             if ( dependencies.isEmpty() )
             {
                 return null;
             }
-    
+
             List<ProjectDependency> modifiedDependencies = new ArrayList<ProjectDependency>();
-    
+
             for ( ProjectDependency dep : dependencies )
             {
                 Project dependencyProject =
                     projectDao.getProject( dep.getGroupId(), dep.getArtifactId(), dep.getVersion() );
-    
+
                 if ( dependencyProject != null )
                 {
-                    List<BuildResult> buildResults =
-                        buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
-                                                                           oldBuildResult.getEndTime() );
-                    if ( buildResults != null && !buildResults.isEmpty() )
+                    long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+                                                                                        oldBuildResult.getEndTime() );
+                    if ( nbBuild > 0 )
                     {
                         log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
                             dep.getVersion() );
@@ -109,21 +108,21 @@
                         dep.getVersion() );
                 }
             }
-    
+
             return modifiedDependencies;
         }
         catch ( ContinuumStoreException e )
         {
             log.warn( "Can't get the project dependencies", e );
         }
-    
+
         return null;
     }
 
     public ScmResult getScmResult( Map<String, Object> context )
     {
         Map<String, Object> map = ContinuumBuildConstant.getScmResult( context );
-    
+
         if ( !map.isEmpty() )
         {
             ScmResult scmResult = new ScmResult();
@@ -133,10 +132,10 @@
             scmResult.setProviderMessage( ContinuumBuildConstant.getScmProviderMessage( map ) );
             scmResult.setSuccess( ContinuumBuildConstant.isScmSuccess( map ) );
             scmResult.setChanges( getScmChanges( map ) );
-    
+
             return scmResult;
         }
-    
+
         return null;
     }
 
@@ -144,7 +143,7 @@
     {
         List<ChangeSet> changes = new ArrayList<ChangeSet>();
         List<Map<String, Object>> scmChanges = ContinuumBuildConstant.getScmChanges( context );
-    
+
         if ( scmChanges != null )
         {
             for ( Map<String, Object> map : scmChanges )
@@ -157,14 +156,14 @@
                 changes.add( changeSet );
             }
         }
-    
+
         return changes;
     }
 
     private void setChangeFiles( ChangeSet changeSet, Map<String, Object> context )
     {
         List<Map<String, Object>> changeFiles = ContinuumBuildConstant.getChangeSetFiles( context );
-    
+
         if ( changeFiles != null )
         {
             for ( Map<String, Object> map : changeFiles )
@@ -173,7 +172,7 @@
                 changeFile.setName( ContinuumBuildConstant.getChangeFileName( map ) );
                 changeFile.setRevision( ContinuumBuildConstant.getChangeFileRevision( map ) );
                 changeFile.setStatus( ContinuumBuildConstant.getChangeFileStatus( map ) );
-    
+
                 changeSet.addFile( changeFile );
             }
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Tue Jan 12 15:03:24 2010
@@ -274,14 +274,7 @@
             @Override
             public void run()
             {
-                try
-                {
-                    stopContinuum();
-                }
-                catch ( StoppingException e )
-                {
-                    e.printStackTrace();
-                }
+                stopContinuum();
             }
         } );
     }
@@ -291,16 +284,6 @@
         return releaseManager;
     }
 
-    public void setActionManager( ActionManager actionManager )
-    {
-        this.actionManager = actionManager;
-    }
-
-    public ActionManager getActionManager()
-    {
-        return actionManager;
-    }
-
     public ContinuumPurgeManager getPurgeManager()
     {
         return purgeManager;
@@ -545,14 +528,18 @@
     // Projects
     // ----------------------------------------------------------------------
 
-    // TODO: Remove this method
+    /**
+     * TODO: Remove this method
+     */
     public Collection<Project> getProjects()
         throws ContinuumException
     {
         return projectDao.getAllProjectsByName();
     }
 
-    // TODO: Remove this method
+    /**
+     * TODO: Remove this method
+     */
     public Collection<Project> getProjectsWithDependencies()
         throws ContinuumException
     {
@@ -795,6 +782,7 @@
 
     /**
      * fire of the builds of all projects across all project groups using their default build definitions
+     * TODO:Remove this method
      *
      * @param buildTrigger
      * @throws ContinuumException
@@ -929,6 +917,8 @@
                 return;
             }
 
+            //TODO: As all projects are built in the same queue for a project group, it would be better to get them by
+            // project group and add them in queues in parallel to save few seconds
             projectsList = getProjectsInBuildOrder();
         }
         catch ( ContinuumStoreException e )
@@ -1120,7 +1110,6 @@
 
 
     private void removeBuildResult( BuildResult buildResult )
-        throws ContinuumException
     {
         buildResultDao.removeBuildResult( buildResult );
 
@@ -1138,7 +1127,7 @@
                 getConfiguration().getBuildOutputFile( buildResult.getId(), buildResult.getProject().getId() );
             if ( buildOutputFile.exists() )
             {
-                buildOutputFile.delete();
+                FileUtils.forceDelete( buildOutputFile );
             }
         }
         catch ( ConfigurationException e )
@@ -1165,12 +1154,24 @@
         }
     }
 
-    //TODO: Must be done by build definition
+    /**
+     * TODO: Must be done by build definition
+     */
     public List<ChangeSet> getChangesSinceLastSuccess( int projectId, int buildResultId )
         throws ContinuumException
     {
-        ArrayList<BuildResult> buildResults =
-            new ArrayList<BuildResult>( buildResultDao.getBuildResultsForProject( projectId, 0 ) );
+        BuildResult previousBuildResult = null;
+        try
+        {
+            previousBuildResult = buildResultDao.getPreviousBuildResultInSuccess( projectId, buildResultId );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            //No previous build in success, Nothing to do
+        }
+        long startTime = previousBuildResult == null ? 0 : previousBuildResult.getStartTime();
+        ArrayList<BuildResult> buildResults = new ArrayList<BuildResult>(
+            buildResultDao.getBuildResultsForProjectWithDetails( projectId, startTime, buildResultId ) );
 
         Collections.reverse( buildResults );
 
@@ -1178,6 +1179,7 @@
 
         boolean stop = false;
 
+        //TODO: Shouldn't be used now with the previous call of buildResultDao.getBuildResultsForProjectWithDetails
         while ( !stop )
         {
             if ( buildResultsIterator.hasNext() )
@@ -1238,7 +1240,9 @@
     //
     // ----------------------------------------------------------------------
 
-    //TODO: Remove this method when it won't be used
+    /**
+     * TODO: Remove this method when it won't be used
+     */
     private List<Project> getProjectsInBuildOrder()
         throws ContinuumException
     {
@@ -1805,13 +1809,13 @@
         return result;
     }
 
-    protected ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
-                                                                                     String projectBuilderId,
-                                                                                     int projectGroupId,
-                                                                                     boolean checkProtocol,
-                                                                                     boolean useCredentialsCache,
-                                                                                     boolean loadRecursiveProjects,
-                                                                                     int buildDefinitionTemplateId )
+    private ContinuumProjectBuildingResult executeAddProjectsFromMetadataActivity( String metadataUrl,
+                                                                                   String projectBuilderId,
+                                                                                   int projectGroupId,
+                                                                                   boolean checkProtocol,
+                                                                                   boolean useCredentialsCache,
+                                                                                   boolean loadRecursiveProjects,
+                                                                                   int buildDefinitionTemplateId )
         throws ContinuumException
     {
         return executeAddProjectsFromMetadataActivity( metadataUrl, projectBuilderId, projectGroupId, checkProtocol,
@@ -2140,7 +2144,7 @@
         AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "add-build-definition-to-project", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2151,7 +2155,6 @@
     {
         HashMap<String, Object> context = new HashMap<String, Object>();
         BuildDefinition buildDefinition = getBuildDefinition( buildDefinitionId );
-        Schedule schedule = buildDefinition.getSchedule();
 
         AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
         AbstractContinuumAction.setProjectId( context, projectId );
@@ -2169,7 +2172,7 @@
         AbstractContinuumAction.setProjectId( context, projectId );
 
         executeAction( "update-build-definition-from-project", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2185,7 +2188,7 @@
         AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "add-build-definition-to-project-group", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2212,7 +2215,7 @@
         AbstractContinuumAction.setProjectGroupId( context, projectGroupId );
 
         executeAction( "update-build-definition-from-project-group", context );
-        
+
         activeBuildDefinitionSchedule( schedule );
 
         return AbstractContinuumAction.getBuildDefinition( context );
@@ -2233,19 +2236,6 @@
         }
     }
 
-    public void removeBuildDefinition( BuildDefinition buildDefinition )
-        throws ContinuumException
-    {
-        try
-        {
-            buildDefinitionDao.removeBuildDefinition( buildDefinition );
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while removing build definition.", ex );
-        }
-    }
-
     // ----------------------------------------------------------------------
     // Schedule
     // ----------------------------------------------------------------------
@@ -2315,9 +2305,9 @@
     private void updateSchedule( Schedule schedule, boolean updateScheduler )
         throws ContinuumException
     {
-        
+
         Schedule old = getSchedule( schedule.getId() );
-        
+
         storeSchedule( schedule );
 
         if ( updateScheduler )
@@ -2396,7 +2386,7 @@
         }
     }
 
-    public Schedule storeSchedule( Schedule schedule )
+    private Schedule storeSchedule( Schedule schedule )
         throws ContinuumException
     {
         try
@@ -2408,7 +2398,7 @@
             throw logAndCreateException( "Error while storing schedule.", ex );
         }
     }
-    
+
     public void activePurgeSchedule( Schedule schedule )
     {
         try
@@ -2420,7 +2410,7 @@
             log.error( "Can't activate schedule for purgeConfiguration" );
         }
     }
-    
+
     public void activeBuildDefinitionSchedule( Schedule schedule )
     {
         try
@@ -2723,9 +2713,9 @@
         }
     }
 
-    public void stopContinuum()
-        throws StoppingException
+    private void stopContinuum()
     {
+        //TODO: Remove all projects from queues, stop scheduler and wait the end of current builds so build results will be ok
         if ( stopped )
         {
             return;
@@ -2890,20 +2880,7 @@
         }
     }
 
-    public void removeNotifier( ProjectNotifier notifier )
-        throws ContinuumException
-    {
-        try
-        {
-            notifierDao.removeNotifier( notifier );
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while removing notifier.", ex );
-        }
-    }
-
-    public ProjectNotifier storeNotifier( ProjectNotifier notifier )
+    private ProjectNotifier storeNotifier( ProjectNotifier notifier )
         throws ContinuumException
     {
         try
@@ -2916,7 +2893,7 @@
         }
     }
 
-    public String getWorkingDirectory()
+    private String getWorkingDirectory()
     {
         return configurationService.getWorkingDirectory().getAbsolutePath();
     }
@@ -2989,12 +2966,6 @@
         }
     }
 
-    public Collection<ProjectGroup> getAllProjectGroupsWithProjects()
-    {
-        //TODO: check why this interface isn't throwing exceptions on this guy
-        return projectGroupDao.getAllProjectGroupsWithProjects();
-    }
-
     public List<ProjectGroup> getAllProjectGroupsWithBuildDetails()
     {
         return projectGroupDao.getAllProjectGroupsWithBuildDetails();
@@ -3157,7 +3128,14 @@
 
             if ( releaseFile.exists() )
             {
-                releaseFile.delete();
+                try
+                {
+                    FileUtils.forceDelete( releaseFile );
+                }
+                catch ( IOException e )
+                {
+                    throw new ContinuumException( "Can't delete " + releaseFile.getAbsolutePath(), e );
+                }
             }
         }
         catch ( ConfigurationException e )
@@ -3737,8 +3715,6 @@
     private void checkForDuplicateProjectInGroup( ProjectGroup projectGroup, Project projectToCheck,
                                                   ContinuumProjectBuildingResult result )
     {
-        String duplicateProjects = "";
-
         List<Project> projectsInGroup = projectGroup.getProjects();
 
         if ( projectsInGroup == null )
@@ -3753,7 +3729,7 @@
                 project.getArtifactId().equals( projectToCheck.getArtifactId() ) &&
                 project.getVersion().equals( projectToCheck.getVersion() ) )
             {
-                result.addError( result.ERROR_DUPLICATE_PROJECTS );
+                result.addError( ContinuumProjectBuildingResult.ERROR_DUPLICATE_PROJECTS );
                 return;
             }
         }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Tue Jan 12 15:03:24 2010
@@ -27,7 +27,6 @@
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.dao.ProjectGroupDao;
 import org.apache.continuum.dao.ProjectScmRootDao;
 import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.utils.ContinuumUtils;
@@ -639,10 +638,9 @@
 
                 if ( dependencyProject != null )
                 {
-                    List<BuildResult> buildResults =
-                        buildResultDao.getBuildResultsInSuccessForProject( dependencyProject.getId(),
-                                                                           context.getOldBuildResult().getEndTime() );
-                    if ( buildResults != null && !buildResults.isEmpty() )
+                    long nbBuild = buildResultDao.getNbBuildResultsInSuccessForProject( dependencyProject.getId(),
+                                                                                        context.getOldBuildResult().getEndTime() );
+                    if ( nbBuild > 0 )
                     {
                         log.debug( "Dependency changed: " + dep.getGroupId() + ":" + dep.getArtifactId() + ":" +
                             dep.getVersion() );

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java (original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java Tue Jan 12 15:03:24 2010
@@ -251,6 +251,8 @@
         Project project = context.getProject();
         List<ProjectNotifier> notifiers = context.getNotifiers();
         BuildResult build = context.getBuildResult();
+        log.error( "br state="+build.getState() );
+        log.error( "project state="+project.getState() );
         BuildDefinition buildDefinition = context.getBuildDefinition();
         ProjectScmRoot projectScmRoot = context.getProjectScmRoot();
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java Tue Jan 12 15:03:24 2010
@@ -294,7 +294,7 @@
     {
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
-        Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        Collection projectGroupList = continuum.getAllProjectGroups();
 
         int projectGroupsBefore = projectGroupList.size();
 
@@ -312,7 +312,7 @@
 
         assertEquals( "plexus", projectGroup.getGroupId() );
 
-        projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        projectGroupList = continuum.getAllProjectGroups();
 
         assertEquals( "Project group missing, should have " + ( projectGroupsBefore + 1 ) + " project groups",
                       projectGroupsBefore + 1, projectGroupList.size() );
@@ -323,7 +323,7 @@
 
         BuildsManager buildsManager = continuum.getBuildsManager();
 
-        List<Project> projects = projectGroup.getProjects();
+        List<Project> projects = continuum.getProjectGroupWithProjects( projectGroup.getId() ).getProjects();
         int[] projectIds = new int[projects.size()];
 
         int idx = 0;
@@ -339,7 +339,7 @@
 
         continuum.removeProjectGroup( projectGroup.getId() );
 
-        projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        projectGroupList = continuum.getAllProjectGroups();
 
         assertEquals( "Remove project group failed", projectGroupsBefore, projectGroupList.size() );
     }
@@ -352,7 +352,7 @@
     {
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
-        Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+        Collection projectGroupList = continuum.getAllProjectGroups();
 
         int projectGroupsBefore = projectGroupList.size();
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.java Tue Jan 12 15:03:24 2010
@@ -29,6 +29,8 @@
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMessage.RecipientType;
 
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.notification.mail.MockJavaMailSender;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -62,18 +64,39 @@
 
         ProjectGroup group = createStubProjectGroup( "foo.bar", "" );
 
+        BuildResultDao brDao = (BuildResultDao) lookup( BuildResultDao.class );
         Project project = addProject( "Test Project", group );
+        BuildResult br = makeBuild( ContinuumProjectState.FAILED );
+        brDao.addBuildResult( project, br );
+
+        br = makeBuild( ContinuumProjectState.OK );
+        brDao.addBuildResult( project, br );
+
+        br = makeBuild( ContinuumProjectState.FAILED );
+        brDao.addBuildResult( project, br );
 
         BuildResult build = makeBuild( ContinuumProjectState.OK );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
+
+        project.setState( build.getState() );
+        getProjectDao().updateProject( project );
 
         BuildDefinition buildDef = new BuildDefinition();
         buildDef.setType( "maven2" );
         buildDef.setBuildFile( "pom.xml" );
         buildDef.setGoals( "clean install" );
         buildDef.setArguments( "" );
+        BuildDefinitionDao buildDefDao = (BuildDefinitionDao) lookup( BuildDefinitionDao.class );
+        buildDef = buildDefDao.addBuildDefinition( buildDef );
         build.setBuildDefinition( buildDef );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots out build output", toOverride );
+        brDao.addBuildResult( project, build );
+        build = brDao.getLatestBuildResultForProjectWithDetails( project.getId() );
+        assertEquals( ContinuumProjectState.OK, build.getState() );
+
+        MimeMessage mailMessage =
+            sendNotificationAndGetMessage( project, build, buildDef, "lots out build output", toOverride );
 
         assertEquals( "[continuum] BUILD SUCCESSFUL: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -92,7 +115,7 @@
 
         BuildResult build = makeBuild( ContinuumProjectState.FAILED );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "output", null );
+        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "output", null );
 
         assertEquals( "[continuum] BUILD FAILURE: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -110,7 +133,7 @@
 
         build.setError( "Big long error message" );
 
-        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, "lots of stack traces", null );
+        MimeMessage mailMessage = sendNotificationAndGetMessage( project, build, null, "lots of stack traces", null );
 
         assertEquals( "[continuum] BUILD ERROR: foo.bar Test Project", mailMessage.getSubject() );
 
@@ -151,8 +174,8 @@
     //
     // ----------------------------------------------------------------------
 
-    private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, String buildOutput,
-                                                       String toOverride )
+    private MimeMessage sendNotificationAndGetMessage( Project project, BuildResult build, BuildDefinition buildDef,
+                                                       String buildOutput, String toOverride )
         throws Exception
     {
         MessageContext context = new MessageContext();
@@ -161,6 +184,8 @@
 
         context.setBuildResult( build );
 
+        context.setBuildDefinition( buildDef );
+
         ProjectNotifier projectNotifier = new ProjectNotifier();
         projectNotifier.setType( "mail" );
         Map<String, String> config = new HashMap<String, String>();
@@ -217,8 +242,6 @@
     {
         BuildResult build = new BuildResult();
 
-        build.setId( 17 );
-
         build.setStartTime( System.currentTimeMillis() );
 
         build.setEndTime( System.currentTimeMillis() + 1234567 );

Propchange: continuum/trunk/continuum-data-management/data-management-cli/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,3 +1,3 @@
 /continuum/branches/continuum-1.2.x/continuum-data-management/data-management-cli:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462,734910
-/continuum/branches/continuum-1.3.x/continuum-data-management/data-management-cli:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-data-management/data-management-cli:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-data-management/data-management-cli:713270-734307

Propchange: continuum/trunk/continuum-docs/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,4 +1,4 @@
 /continuum/branches/continuum-1.2.x/continuum-docs:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462
-/continuum/branches/continuum-1.3.x/continuum-docs:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,777098-777099,777149,777174-777176,777180,777469,779166,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-docs:766106,766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,777098-777099,777149,777174-777176,777180,777469,779166,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-docs:713270-734307
 /continuum/tags/continuum-1.2.3/continuum-docs:733253

Propchange: continuum/trunk/continuum-docs/src/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,4 +1,4 @@
 /continuum/branches/continuum-1.2.x/continuum-docs/src:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462
-/continuum/branches/continuum-1.3.x/continuum-docs/src:766106,766120-766121,766641,766645,766669,766977,767363,767397,767792,767796,768222,777098-777099,777149,777174-777176,777180,777469,779166,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-docs/src:766106,766120-766121,766641,766645,766669,766977,767363,767397,767792,767796,768222,777098-777099,777149,777174-777176,777180,777469,779166,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-docs/src:713270-734307
 /continuum/tags/continuum-1.2.3/continuum-docs/src:733253

Propchange: continuum/trunk/continuum-docs/src/site/xdoc/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,5 +1,5 @@
 /continuum/branches/continuum-1.2.x/continuum-docs/src/site/xdoc:698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462
-/continuum/branches/continuum-1.3.x/continuum-docs/src/site/xdoc:766106,766120-766121,766641,766645,766669,766977,767363,767397,767792,767796,768222,777149,777174-777176,777180,777469,779166,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-docs/src/site/xdoc:766106,766120-766121,766641,766645,766669,766977,767363,767397,767792,767796,768222,777149,777174-777176,777180,777469,779166,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-docs/src/site/xdoc:713270-734307
 /continuum/tags/continuum-1.2.3/continuum-docs/src/site/xdoc:733253
 /continuum/trunk/continuum-docs/src/site/xdoc:690494-690520

Propchange: continuum/trunk/continuum-jetty/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1,4 +1,4 @@
 /continuum/branches/continuum-1.2.x/continuum-jetty:690684,690689-690799,698449-698533,698817-698819,699529,700250,700273,700936,705894,705910,708339,722279,722624,723119,723487,724016,724024,725845,726103,726239,726462
-/continuum/branches/continuum-1.3.x/continuum-jetty:766106,766120-766121,766641,766645,766669,766986,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-jetty:766106,766120-766121,766641,766645,766669,766986,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535
 /continuum/branches/continuum-distributed-builds/continuum-jetty:713270-734307
 /continuum/tags/continuum-1.2.3/continuum-jetty:733253

Propchange: continuum/trunk/continuum-model/src/main/resources/package-default.orm
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 12 15:03:24 2010
@@ -1 +1 @@
-/continuum/branches/continuum-1.3.x/continuum-model/src/main/resources/package-default.orm:766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,794908,794914,794925,794930,820535
+/continuum/branches/continuum-1.3.x/continuum-model/src/main/resources/package-default.orm:766120-766121,766641,766645,766669,766977,767397,767792,767796,768222,786863,790386,794908,794914,794925,794930,820535

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java?rev=898352&r1=898351&r2=898352&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java (original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java Tue Jan 12 15:03:24 2010
@@ -19,21 +19,21 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.springframework.stereotype.Repository;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import javax.jdo.Extent;
 import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManager;
 import javax.jdo.Query;
 import javax.jdo.Transaction;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.springframework.stereotype.Repository;
 
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
@@ -153,6 +153,44 @@
         return null;
     }
 
+    public BuildResult getLatestBuildResultForProjectWithDetails( int projectId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId" );
+
+            query.setFilter( "this.project.id == projectId && this.project.latestBuildId == this.id" );
+
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
+
+            result = (List<BuildResult>) pm.detachCopyAll( result );
+
+            tx.commit();
+
+            if ( result != null && !result.isEmpty() )
+            {
+                return result.get( 0 );
+            }
+        }
+        finally
+        {
+            rollback( tx );
+        }
+        return null;
+    }
+
     public BuildResult getLatestBuildResultForBuildDefinition( int projectId, int buildDefinitionId )
     {
         PersistenceManager pm = getPersistenceManager();
@@ -184,7 +222,7 @@
 
             if ( result != null && !result.isEmpty() )
             {
-                return (BuildResult) result.get( 0 );
+                return result.get( 0 );
             }
         }
         finally
@@ -252,11 +290,6 @@
         return null;
     }
 
-    public Map<Integer, BuildResult> getLatestBuildResults()
-    {
-        return getLatestBuildResultsByProjectGroupId( -1 );
-    }
-
     public void removeBuildResult( BuildResult buildResult )
     {
         removeObject( buildResult );
@@ -279,9 +312,9 @@
 
             query.declareParameters( "Integer projectId" );
 
-            List result = (List) query.execute( projectId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -317,9 +350,9 @@
 
             query.setFilter( "this.project.id == projectId && this.buildNumber == buildNumber" );
 
-            List result = (List) query.execute( projectId, buildNumber );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId, buildNumber );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -404,9 +437,93 @@
         }
     }
 
+    public long getNbBuildResultsInSuccessForProject( int projectId, long fromDate )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId, long fromDate, int state" );
+
+            query.setFilter( "this.project.id == projectId && this.startTime > fromDate && this.state == state" );
+
+            query.setResult( "count(this)" );
+
+            long result = (Long) query.execute( projectId, fromDate, ContinuumProjectState.OK );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
+    public List<BuildResult> getBuildResultsForProjectWithDetails( int projectId, long fromDate, int tobuildResultId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+            pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
+
+            Query query = pm.newQuery( extent );
+
+            String parameters = "int projectId, long fromDate";
+            String filter = "this.project.id == projectId && this.startTime > fromDate";
+
+            if ( tobuildResultId > 0 )
+            {
+                parameters += ", int buildResultId";
+                filter += " && this.id < buildResultId";
+            }
+            query.declareParameters( parameters );
+
+            query.setFilter( filter );
+
+            query.setOrdering( "this.id descending" );
+
+            List<BuildResult> result;
+
+            if ( tobuildResultId > 0 )
+            {
+                result = (List<BuildResult>) query.execute( projectId, fromDate, tobuildResultId );
+            }
+            else
+            {
+                result = (List<BuildResult>) query.execute( projectId, fromDate );
+            }
+
+            result = (List<BuildResult>) pm.detachCopyAll( result );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
     public List<BuildResult> getBuildResultsForProject( int projectId )
     {
-        return getBuildResultsForProject( projectId, -1, -1 );
+        return getBuildResultsForProjectWithDetails( projectId, -1, -1 );
     }
 
     public List<BuildResult> getBuildResultsForProject( int projectId, long startIndex, long endIndex )
@@ -414,7 +531,7 @@
         PersistenceManager pm = getPersistenceManager();
 
         Transaction tx = pm.currentTransaction();
-        
+
         try
         {
             tx.begin();
@@ -434,9 +551,9 @@
                 query.setRange( startIndex, endIndex );
             }
 
-            List result = (List) query.execute( projectId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -447,7 +564,7 @@
             rollback( tx );
         }
     }
-    
+
     public List<BuildResult> getBuildResultsForProjectFromId( int projectId, long startId )
         throws ContinuumStoreException
     {
@@ -456,7 +573,7 @@
         Transaction tx = pm.currentTransaction();
 
         pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-        
+
         try
         {
             tx.begin();
@@ -466,14 +583,14 @@
             Query query = pm.newQuery( extent );
 
             query.declareParameters( "int projectId, int buildNumber" );
-           
+
             query.setFilter( "this.project.id == projectId && this.buildNumber >= buildNumber" );
-            
+
             query.setOrdering( "this.startTime descending" );
 
-            List result = (List) query.execute( projectId, startId );
+            List<BuildResult> result = (List<BuildResult>) query.execute( projectId, startId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (List<BuildResult>) pm.detachCopyAll( result );
 
             tx.commit();
 
@@ -489,14 +606,12 @@
         }
     }
 
-    public List<BuildResult> getBuildResultsForProject( int projectId, long fromDate )
+    public BuildResult getLatestBuildResultInSuccess( int projectId )
     {
         PersistenceManager pm = getPersistenceManager();
 
         Transaction tx = pm.currentTransaction();
 
-        pm.getFetchPlan().addGroup( BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
-
         try
         {
             tx.begin();
@@ -505,13 +620,17 @@
 
             Query query = pm.newQuery( extent );
 
-            query.declareParameters( "int projectId, long fromDate" );
+            query.declareParameters( "int projectId" );
+
+            String filter = "this.project.buildNumber == this.buildNumber && this.project.id == projectId";
+
+            query.setFilter( filter );
 
-            query.setFilter( "this.project.id == projectId && this.startTime > fromDate" );
+            query.setUnique( true );
 
-            List result = (List) query.execute( projectId, fromDate );
+            BuildResult result = (BuildResult) query.execute( projectId );
 
-            result = (List) pm.detachCopyAll( result );
+            result = (BuildResult) pm.detachCopy( result );
 
             tx.commit();
 
@@ -523,23 +642,52 @@
         }
     }
 
-    public List<BuildResult> getBuildResultsInSuccessForProject( int projectId, long fromDate )
+    private int getPreviousBuildResultIdInSuccess( int projectId, int buildResultId )
     {
-        List<BuildResult> buildResults = getBuildResultsForProject( projectId, fromDate );
+        PersistenceManager pm = getPersistenceManager();
 
-        List<BuildResult> results = new ArrayList<BuildResult>();
+        Transaction tx = pm.currentTransaction();
 
-        if ( buildResults != null )
+        try
         {
-            for ( BuildResult res : buildResults )
-            {
-                if ( res.getState() == ContinuumProjectState.OK )
-                {
-                    results.add( res );
-                }
-            }
+            tx.begin();
+
+            Extent extent = pm.getExtent( BuildResult.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int projectId, int buildResultId" );
+
+            String filter = "this.id < buildResultId && this.state == " + ContinuumProjectState.OK +
+                "  && this.project.id == projectId";
+
+            query.setFilter( filter );
+
+            query.setResult( "max(this.id)" );
+
+            int result = (Integer) query.execute( projectId, buildResultId );
+
+            tx.commit();
+
+            return result;
+        }
+        finally
+        {
+            rollback( tx );
+        }
+    }
+
+    public BuildResult getPreviousBuildResultInSuccess( int projectId, int buildResultId )
+        throws ContinuumStoreException
+    {
+        try
+        {
+            return getBuildResult( getPreviousBuildResultIdInSuccess( projectId, buildResultId ) );
+        }
+        catch ( NullPointerException e )
+        {
+            return null;
         }
-        return results;
     }
 
     public Map<Integer, BuildResult> getBuildResultsInSuccessByProjectGroupId( int projectGroupId )
@@ -600,10 +748,4 @@
 
         return null;
     }
-
-    public Map<Integer, BuildResult> getBuildResultsInSuccess()
-    {
-        return getBuildResultsInSuccessByProjectGroupId( -1 );
-    }
-
 }



Mime
View raw message