continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r233299 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core-it/src/test/java/org/apache/maven/continuum/it/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/jav...
Date Thu, 18 Aug 2005 08:20:47 GMT
Author: brett
Date: Thu Aug 18 01:20:24 2005
New Revision: 233299

URL: http://svn.apache.org/viewcvs?rev=233299&view=rev
Log:
switch to trigger instead of forced flag

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AbstractIntegrationTest.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AntIntegrationTest.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenOneIntegrationTest.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
    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/BuildController.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.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/buildqueue/BuildProjectTask.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Thu Aug 18 01:20:24 2005
@@ -74,13 +74,13 @@
     void buildProjects()
         throws ContinuumException;
 
-    void buildProjects( boolean force )
+    void buildProjects( int trigger )
         throws ContinuumException;
 
     void buildProject( int projectId )
         throws ContinuumException;
 
-    void buildProject( int projectId, boolean force )
+    void buildProject( int projectId, int trigger )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AbstractIntegrationTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AbstractIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AbstractIntegrationTest.java
Thu Aug 18 01:20:24 2005
@@ -406,14 +406,14 @@
     /**
      * @todo use a notify mechanism rather than polling. That's what queues are for. Really,
buildProject should create the build result with a WAITING state, return the ID, and let the
queue take it from there
      */
-    public BuildResult buildProject( int projectId, boolean force )
+    public BuildResult buildProject( int projectId, int trigger )
         throws Exception
     {
         int timeout = 60 * 1000;
 
         BuildResult previousBuild = getContinuum().getLatestBuildResultForProject( projectId
);
 
-        getContinuum().buildProject( projectId, force );
+        getContinuum().buildProject( projectId, trigger );
 
         long start = System.currentTimeMillis();
 

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AntIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AntIntegrationTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AntIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/AntIntegrationTest.java
Thu Aug 18 01:20:24 2005
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.util.FileUtils;
 
 import java.io.File;
@@ -74,7 +75,7 @@
 
         progress( "Building SVN Ant project" );
 
-        int buildId = buildProject( project.getId(), false ).getId();
+        int buildId = buildProject( project.getId(), ContinuumProjectState.TRIGGER_UNKNOWN
).getId();
 
         assertSuccessfulAntBuild( buildId, project.getId() );
 
@@ -117,7 +118,7 @@
 
         progress( "Building CVS Ant project" );
 
-        int buildId = buildProject( projectId, false ).getId();
+        int buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN ).getId();
 
         assertSuccessfulAntBuild( buildId, projectId );
 

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenOneIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenOneIntegrationTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenOneIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenOneIntegrationTest.java
Thu Aug 18 01:20:24 2005
@@ -19,6 +19,7 @@
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 
@@ -65,7 +66,7 @@
 
         progress( "Building Maven 1 project" );
 
-        int buildId = buildProject( projectId, false ).getId();
+        int buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN ).getId();
 
         assertSuccessfulMaven1Build( buildId, projectId );
 

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/MavenTwoIntegrationTest.java
Thu Aug 18 01:20:24 2005
@@ -77,7 +77,7 @@
         project = continuum.getProjectWithBuilds( projectId );
         int originalSize = project.getBuildResults().size();
 
-        int buildId = buildProject( projectId, false ).getId();
+        int buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN ).getId();
 
         assertSuccessfulMaven2Build( buildId, projectId );
 
@@ -88,7 +88,7 @@
 
         assertEquals( "build list was not updated", originalSize + 1, expectedSize );
 
-        continuum.buildProject( projectId, false );
+        continuum.buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
 
         Thread.sleep( 3000 );
 
@@ -99,7 +99,7 @@
 
         progress( "Test that a forced build without any files changed executes the executor"
);
 
-        buildId = buildProject( projectId, true ).getId();
+        buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED ).getId();
 
         BuildResult build = assertSuccessfulMaven2Build( buildId, projectId );
 

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
Thu Aug 18 01:20:24 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 
@@ -69,7 +70,7 @@
         Project project = continuum.getProject( projectId );
         assertProject( projectId, "Shell Project", "3.0", "", "shell", project );
         progress( "Building Shell project" );
-        int buildId = buildProject( projectId, false ).getId();
+        int buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN ).getId();
         assertSuccessfulShellBuild( buildId, projectId, "" );
 
         // Test project reconfiguration
@@ -95,7 +96,7 @@
         bd = (BuildDefinition) shellProject.getBuildDefinitions().iterator().next();
         assertEquals( "Updated command line arguments doesn't match", "a b", bd.getArguments()
);
 
-        buildId = buildProject( projectId, false ).getId();
+        buildId = buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN ).getId();
         assertSuccessfulShellBuild( buildId, projectId, "a" + EOL + "b" + EOL );
 
         removeProject( projectId );

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=233299&r1=233298&r2=233299&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
Thu Aug 18 01:20:24 2005
@@ -32,6 +32,7 @@
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
@@ -218,17 +219,17 @@
     public void buildProjects()
         throws ContinuumException
     {
-        buildProjects( true );
+        buildProjects( ContinuumProjectState.TRIGGER_FORCED );
     }
 
-    public void buildProjects( boolean force )
+    public void buildProjects( int trigger )
         throws ContinuumException
     {
         for ( Iterator i = getProjects().iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
 
-            buildProject( project.getId(), force );
+            buildProject( project.getId(), trigger );
         }
 
         /*
@@ -258,10 +259,10 @@
     public void buildProject( int projectId )
         throws ContinuumException
     {
-        buildProject( projectId, true );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
     }
 
-    public void buildProject( int projectId, boolean force )
+    public void buildProject( int projectId, int trigger )
         throws ContinuumException
     {
         try
@@ -270,7 +271,7 @@
 
             getLogger().info( "Enqueuing '" + project.getName() + "'." );
 
-            buildQueue.put( new BuildProjectTask( projectId, force ) );
+            buildQueue.put( new BuildProjectTask( projectId, trigger ) );
         }
         catch ( ContinuumStoreException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
Thu Aug 18 01:20:24 2005
@@ -24,5 +24,5 @@
 {
     String ROLE = BuildController.class.getName();
 
-    void build( int projectId, boolean forced );
+    void build( int projectId, int trigger );
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
Thu Aug 18 01:20:24 2005
@@ -31,10 +31,14 @@
     extends AbstractLogEnabled
     implements TaskExecutor
 {
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private BuildController controller;
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private ContinuumStore store;
 
     // ----------------------------------------------------------------------
@@ -46,6 +50,6 @@
     {
         BuildProjectTask buildProjectTask = (BuildProjectTask) task;
 
-        controller.build( buildProjectTask.getProjectId(), buildProjectTask.isForced() );
+        controller.build( buildProjectTask.getProjectId(), buildProjectTask.getTrigger()
);
     }
 }

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=233299&r1=233298&r2=233299&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
Thu Aug 18 01:20:24 2005
@@ -69,7 +69,7 @@
     /**
      * @todo structure of this method is a bit of a mess (too much exception/finally code)
      */
-    public void build( int projectId, boolean forced )
+    public void build( int projectId, int trigger )
     {
         long startTime = System.currentTimeMillis();
 
@@ -109,7 +109,7 @@
 
             actionContext.put( AbstractContinuumAction.KEY_PROJECT_ID, new Integer( projectId
) );
 
-            actionContext.put( AbstractContinuumAction.KEY_FORCED, Boolean.valueOf( forced
) );
+            actionContext.put( AbstractContinuumAction.KEY_TRIGGER, new Integer( trigger
) );
 
             ScmResult scmResult = null;
 
@@ -146,7 +146,7 @@
                     if ( !StringUtils.isEmpty( checkoutErrorMessage ) ||
                         !StringUtils.isEmpty( checkoutErrorException ) || checkOutScmResult
== null )
                     {
-                        build = makeBuildResult( scmResult, startTime, forced );
+                        build = makeBuildResult( scmResult, startTime, trigger );
 
                         String error = "";
 
@@ -195,7 +195,7 @@
                 }
                 else
                 {
-                    build = makeBuildResult( scmResult, startTime, forced );
+                    build = makeBuildResult( scmResult, startTime, trigger );
                 }
 
                 // This can happen if the "update project from scm" action fails
@@ -262,14 +262,13 @@
     //
     // ----------------------------------------------------------------------
 
-    private BuildResult makeBuildResult( ScmResult scmResult, long startTime, boolean forced
)
+    private BuildResult makeBuildResult( ScmResult scmResult, long startTime, int trigger
)
     {
         BuildResult build = new BuildResult();
 
         build.setState( ContinuumProjectState.ERROR );
 
-        // TODO: set trigger properly
-        build.setTrigger( forced ? ContinuumProjectState.TRIGGER_FORCED : ContinuumProjectState.TRIGGER_UNKNOWN
);
+        build.setTrigger( trigger );
 
         build.setStartTime( startTime );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Thu Aug 18 01:20:24 2005
@@ -29,15 +29,15 @@
 
     private long timestamp;
 
-    private boolean forced;
+    private int trigger;
 
-    public BuildProjectTask( int projectId, boolean forced )
+    public BuildProjectTask( int projectId, int trigger )
     {
         this.projectId = projectId;
 
         this.timestamp = System.currentTimeMillis();
 
-        this.forced = forced;
+        this.trigger = trigger;
     }
 
     public int getProjectId()
@@ -50,8 +50,8 @@
         return timestamp;
     }
 
-    public boolean isForced()
+    public int getTrigger()
     {
-        return forced;
+        return trigger;
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
Thu Aug 18 01:20:24 2005
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.taskqueue.TaskViabilityEvaluator;
@@ -108,7 +109,7 @@
             // If this build is forces, don't remove it
             // ----------------------------------------------------------------------
 
-            if ( buildProjectTask.isForced() )
+            if ( buildProjectTask.getTrigger() == ContinuumProjectState.TRIGGER_FORCED )
             {
                 continue;
             }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Thu Aug 18 01:20:24 2005
@@ -58,7 +58,7 @@
 
     public static final String KEY_UPDATE_SCM_RESULT = "update-result";
 
-    public static final String KEY_FORCED = "forced";
+    public static final String KEY_TRIGGER = "forced";
 
     // ----------------------------------------------------------------------
     // Utils
@@ -93,9 +93,9 @@
         return getString( context, KEY_BUILD_ID );
     }
 
-    public static boolean isForced( Map context )
+    public static int getTrigger( Map context )
     {
-        return getBoolean( context, KEY_FORCED );
+        return getInteger( context, KEY_TRIGGER );
     }
 
     public static Project getUnvalidatedProject( Map context )

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=233299&r1=233298&r2=233299&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
Thu Aug 18 01:20:24 2005
@@ -55,7 +55,7 @@
 
         Project project = store.getProjectWithBuildDetails( getProjectId( context ) );
 
-        boolean forced = isForced( context );
+        int trigger = getTrigger( context );
 
         ScmResult scmResult = getUpdateScmResult( context );
 
@@ -65,7 +65,8 @@
         // This is really a precondition for this action to execute
         // ----------------------------------------------------------------------
 
-        if ( scmResult.getChanges().size() == 0 && !forced && !isNew( project
) )
+        if ( scmResult.getChanges().size() == 0 && trigger != ContinuumProjectState.TRIGGER_FORCED
&&
+            !isNew( project ) )
         {
             getLogger().info( "No files updated, not building. Project id '" + project.getId()
+ "'." );
 
@@ -82,8 +83,7 @@
 
         build.setState( ContinuumProjectState.BUILDING );
 
-        // TODO: set trigger properly
-        build.setTrigger( forced ? ContinuumProjectState.TRIGGER_FORCED : ContinuumProjectState.TRIGGER_UNKNOWN
);
+        build.setTrigger( trigger );
 
         // TODO: select actualy build def
         List buildDefinitions = project.getBuildDefinitions();

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
Thu Aug 18 01:20:24 2005
@@ -18,6 +18,7 @@
 
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 
@@ -45,18 +46,18 @@
 
         int projectId = project.getId();
 
-        buildProject( projectId, false );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
 
         assertNextBuildIs( projectId );
 
         assertNextBuildIsNull();
 
-        buildProject( projectId, false );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
 
-        buildProject( projectId, false );
-        buildProject( projectId, false );
-        buildProject( projectId, false );
-        buildProject( projectId, false );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_UNKNOWN );
 
         assertNextBuildIs( projectId );
 
@@ -70,9 +71,9 @@
 
         int projectId2 = addProject( getStore(), "Build Queue Project 3" ).getId();
 
-        buildProject( projectId1, false );
+        buildProject( projectId1, ContinuumProjectState.TRIGGER_UNKNOWN );
 
-        buildProject( projectId2, false );
+        buildProject( projectId2, ContinuumProjectState.TRIGGER_UNKNOWN );
 
         assertNextBuildIs( projectId1 );
 
@@ -80,18 +81,11 @@
 
         assertNextBuildIsNull();
 
-        buildProject( projectId1, false );
-
-        buildProject( projectId2, false );
-
-        buildProject( projectId1, false );
-        buildProject( projectId2, false );
-        buildProject( projectId1, false );
-        buildProject( projectId2, false );
-        buildProject( projectId1, false );
-        buildProject( projectId2, false );
-        buildProject( projectId1, false );
-        buildProject( projectId2, false );
+        for ( int i = 0; i < 5; i++ )
+        {
+            buildProject( projectId1, ContinuumProjectState.TRIGGER_UNKNOWN );
+            buildProject( projectId2, ContinuumProjectState.TRIGGER_UNKNOWN );
+        }
 
         assertNextBuildIs( projectId1 );
         assertNextBuildIs( projectId2 );
@@ -106,17 +100,16 @@
 
         int projectId = addProject( getStore(), name ).getId();
 
-        buildProject( projectId, true );
+        buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
 
         assertNextBuildIs( projectId );
 
         assertNextBuildIsNull();
 
-        buildProject( projectId, true );
-        buildProject( projectId, true );
-        buildProject( projectId, true );
-        buildProject( projectId, true );
-        buildProject( projectId, true );
+        for ( int i = 0; i < 5; i++ )
+        {
+            buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
+        }
 
         assertNextBuildIs( projectId );
         assertNextBuildIs( projectId );
@@ -131,10 +124,10 @@
     //
     // ----------------------------------------------------------------------
 
-    private void buildProject( int projectId, boolean force )
+    private void buildProject( int projectId, int trigger )
         throws Exception
     {
-        buildQueue.put( new BuildProjectTask( projectId, force ) );
+        buildQueue.put( new BuildProjectTask( projectId, trigger ) );
     }
 
     private void assertNextBuildIs( int expectedProjectId )

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
Thu Aug 18 01:20:24 2005
@@ -46,7 +46,7 @@
     // Building
     // ----------------------------------------------------------------------
 
-    Hashtable buildProject( int projectId, boolean force );
+    Hashtable buildProject( int projectId, int trigger );
 
     // ----------------------------------------------------------------------
     // Builds

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=233299&r1=233298&r2=233299&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
Thu Aug 18 01:20:24 2005
@@ -111,11 +111,11 @@
     // Build handling
     // ----------------------------------------------------------------------
 
-    public Hashtable buildProject( int projectId, boolean force )
+    public Hashtable buildProject( int projectId, int trigger )
     {
         try
         {
-            continuum.buildProject( projectId, force );
+            continuum.buildProject( projectId, trigger );
 
             return makeHashtable();
         }



Mime
View raw message