continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r769748 - in /continuum/branches/continuum-flat-multi-module: continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-core/src/main/java/org/apache/continuum/build...
Date Wed, 29 Apr 2009 11:15:57 GMT
Author: oching
Date: Wed Apr 29 11:15:55 2009
New Revision: 769748

URL: http://svn.apache.org/viewvc?rev=769748&view=rev
Log:
[CONTINUUM-2193]
o update project state of modules after checkout
o updated scm root key in context of action

Modified:
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
Wed Apr 29 11:15:55 2009
@@ -91,10 +91,11 @@
      * @param scmUsername
      * @param scmPassword
      * @param defaultBuildDefinition
+     * @param subProjects TODO
      * @throws BuildManagerException
      */
     void checkoutProject( int projectId, String projectName, File workingDirectory, String
scmRootUrl,
-                          String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition
)
+                          String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
List<Integer> subProjects )
         throws BuildManagerException;
 
     /**

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
Wed Apr 29 11:15:55 2009
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.util.List;
 
 import org.codehaus.plexus.taskqueue.Task;
 
@@ -41,9 +42,11 @@
     private final String scmPassword;
     
     private final String scmRootUrl;
+    
+    private final List<Integer> subProjects;
 
     public CheckOutTask( int projectId, File workingDirectory, String projectName, String
scmUserName,
-                         String scmPassword, String scmRootUrl )
+                         String scmPassword, String scmRootUrl, List<Integer> subProjects
)
     {
         this.projectId = projectId;
 
@@ -56,6 +59,8 @@
         this.scmPassword = scmPassword;
         
         this.scmRootUrl = scmRootUrl;
+        
+        this.subProjects = subProjects;
     }
 
     public int getProjectId()
@@ -99,4 +104,9 @@
     {
         return scmRootUrl;
     }
+
+    public List<Integer> getSubProjects()
+    {
+        return subProjects;
+    }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Wed Apr 29 11:15:55 2009
@@ -367,10 +367,10 @@
     }
 
     /**
-     * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition)
+     * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition,
List)
      */
     public void checkoutProject( int projectId, String projectName, File workingDirectory,
String scmRootUrl,
-                                 String scmUsername, String scmPassword, BuildDefinition
defaultBuildDefinition )
+                                 String scmUsername, String scmPassword, BuildDefinition
defaultBuildDefinition, List<Integer> subProjects )
         throws BuildManagerException
     {
         try
@@ -390,7 +390,7 @@
         OverallBuildQueue overallBuildQueue =
             getOverallBuildQueue( CHECKOUT_QUEUE, defaultBuildDefinition.getSchedule().getBuildQueues()
);
         CheckOutTask checkoutTask =
-            new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword,
scmRootUrl );
+            new CheckOutTask( projectId, workingDirectory, projectName, scmUsername, scmPassword,
scmRootUrl, subProjects );
         try
         {
             if ( overallBuildQueue != null )
@@ -873,7 +873,7 @@
             {
                 BuildDefinition buildDefinition = buildDefinitionDao.getDefaultBuildDefinition(
task.getProjectId() );
                 checkoutProject( task.getProjectId(), task.getProjectName(), task.getWorkingDirectory(),
-                                 null, task.getScmUserName(), task.getScmPassword(), buildDefinition
);
+                                 null, task.getScmUserName(), task.getScmPassword(), buildDefinition,
null );
             }
             catch ( ContinuumStoreException e )
             {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Wed Apr 29 11:15:55 2009
@@ -1552,7 +1552,7 @@
 
             projectGroup = projectGroupDao.getProjectGroupWithBuildDetailsByProjectGroupId(
projectGroupId );
 
-            String url = (String) context.get( AbstractContinuumAction.KEY_URL );
+            String url = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT,
null );
 
             projectScmRoot = getProjectScmRootByProjectGroupAndScmRootAddress( projectGroup.getId(),
url );
             
@@ -1617,11 +1617,27 @@
              
                 if( project != null )
                 {
-                    String scmRootUrl = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_URL
);
+                    String scmRootUrl = AbstractContinuumAction.getString( context, AbstractContinuumAction.KEY_PROJECT_SCM_ROOT
);
                     
                     context = new HashMap<String, Object>();
+
+                    context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, scmRootUrl
);
+                    
+                    Project rootProject = result.getRootProject();
                     
-                    context.put( AbstractContinuumAction.KEY_URL, scmRootUrl );
+                    if( rootProject != null )
+                    {   
+                        List<Integer> subProjects = new ArrayList<Integer>();
+                        for( Project subProject : projects )
+                        {
+                            if( subProject.getId() != rootProject.getId() )
+                            {
+                                subProjects.add( new Integer( subProject.getId() ) );
+                            }
+                        }
+
+                        context.put( AbstractContinuumAction.KEY_PROJECTS_UNDER_ROOT_PROJECT,
subProjects );
+                    }
                     
                     addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId,
context, projectGroupCreation,
                                                scmUserName, scmPassword, project );    

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Wed Apr 29 11:15:55 2009
@@ -20,6 +20,7 @@
  */
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -100,6 +101,8 @@
     public static final String KEY_SCM_RESULT_MAP = "scm-result-map";
     
     public static final String KEY_URL = "url";
+    
+    public static final String KEY_PROJECTS_UNDER_ROOT_PROJECT = "projects-under-root-project";
 
     // ----------------------------------------------------------------------
     //
@@ -231,6 +234,12 @@
         return (Map<Integer, ScmResult>) getObject( context, KEY_SCM_RESULT_MAP );
     }
     
+    public static List<Integer> getListOfProjectsUnderRootProject( Map<String, Object>
context )
+    {
+        return (List<Integer>) getObject( context, KEY_PROJECTS_UNDER_ROOT_PROJECT,
new ArrayList<Integer>() );
+    }
+    
+    
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
Wed Apr 29 11:15:55 2009
@@ -61,12 +61,12 @@
             project = projectDao.getProject( getProjectId( context ) );
         }
 
-        String scmRootUrl = getString( context, KEY_URL, null );
+        String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT, null );
         
         BuildDefinition defaultBuildDefinition = getBuildDefinition( context );
         parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
                                                workingDirectoryService.getWorkingDirectory(
project ),
                                                scmRootUrl, project.getScmUsername(),
-                                               project.getScmPassword(), defaultBuildDefinition
);
+                                               project.getScmPassword(), defaultBuildDefinition,
getListOfProjectsUnderRootProject( context ) );
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
Wed Apr 29 11:15:55 2009
@@ -93,11 +93,13 @@
 
         ScmResult result;
 
+        List<Integer> subProjects = getListOfProjectsUnderRootProject( context );
+        
         try
         {
             String scmUserName = getString( context, KEY_SCM_USERNAME, project.getScmUsername()
);
             String scmPassword = getString( context, KEY_SCM_PASSWORD, project.getScmPassword()
);
-            String scmRootUrl = getString( context, KEY_URL, project.getScmUrl() );
+            String scmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT, project.getScmUrl()
);            
             
             ContinuumScmConfiguration config =
                 createScmConfiguration( project, workingDirectory, scmUserName, scmPassword,
scmRootUrl );
@@ -108,12 +110,13 @@
                     workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag +
"." : "." ) );
 
             CheckOutScmResult checkoutResult = scm.checkout( config );
+            
             if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory()
) )
             {
                 context.put( AbstractContinuumAction.KEY_PROJECT_RELATIVE_PATH,
                              checkoutResult.getRelativePathProjectDirectory() );
             }
-
+            
             if ( !checkoutResult.isSuccess() )
             {
                 // TODO: is it more appropriate to return this in the converted result so
that it can be presented to
@@ -186,11 +189,22 @@
             }
 
             project = projectDao.getProject( project.getId() );
-
+            
             project.setState( ContinuumProjectState.CHECKEDOUT );
 
             projectDao.updateProject( project );
-
+            
+            // update state of sub-projects 
+            // if multi-module project was checked out in a single directory, subProjects
must not be null            
+            for( Integer id : subProjects )
+            {
+                Project subProject = projectDao.getProject( id.intValue() );
+                if( subProject != null )
+                {
+                    subProject.setState( ContinuumProjectState.CHECKEDOUT );
+                    projectDao.updateProject( subProject );                    
+                }
+            }
             notifier.checkoutComplete( project, buildDefinition );
         }
 

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataAction.java
Wed Apr 29 11:15:55 2009
@@ -23,6 +23,7 @@
 import java.net.MalformedURLException;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -178,8 +179,8 @@
                         scmRootUrl = curl;
                     }
                 }
-
-                context.put( KEY_URL, scmRootUrl );
+                
+                context.put( KEY_PROJECT_SCM_ROOT, scmRootUrl );
             }
         }
         catch ( MalformedURLException e )

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
Wed Apr 29 11:15:55 2009
@@ -93,7 +93,9 @@
 
         context.put( AbstractContinuumAction.KEY_SCM_USERNAME, task.getScmUserName() );
 
-        context.put( AbstractContinuumAction.KEY_URL, task.getScmRootUrl() );
+        context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, task.getScmRootUrl() );
+
+        context.put( AbstractContinuumAction.KEY_PROJECTS_UNDER_ROOT_PROJECT, task.getSubProjects()
);
         
         try
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
Wed Apr 29 11:15:55 2009
@@ -392,7 +392,7 @@
 
         buildsManager.checkoutProject( 1, "continuum-project-test-1",
                                        new File( getBasedir(), "/target/test-working-dir/1"
), null, "dummy",
-                                       "dummypass", buildDef );
+                                       "dummypass", buildDef, null );
         context.assertIsSatisfied();
     }
 
@@ -409,7 +409,7 @@
 
         buildsManager.checkoutProject( 1, "continuum-project-test-1",
                                        new File( getBasedir(), "/target/test-working-dir/1"
), null, "dummy",
-                                       "dummypass", buildDef );
+                                       "dummypass", buildDef, null );
         context.assertIsSatisfied();
 
         // queue second project - 1st queue has 1 task while 2nd queue is empty; project
should be queued in
@@ -421,7 +421,7 @@
         final List<Task> tasksInFirstCheckoutQueue = new ArrayList<Task>();
         tasksInFirstCheckoutQueue.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-1",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -440,7 +440,7 @@
 
         buildsManager.checkoutProject( 2, "continuum-project-test-2",
                                        new File( getBasedir(), "/target/test-working-dir/1"
), null, "dummy",
-                                       "dummypass", buildDef );
+                                       "dummypass", buildDef, null );
         context.assertIsSatisfied();
 
         // queue third project - both queues have 1 task queued each; third project should
be queued in 1st queue
@@ -460,7 +460,7 @@
 
         buildsManager.checkoutProject( 3, "continuum-project-test-3",
                                        new File( getBasedir(), "/target/test-working-dir/1"
), null, "dummy",
-                                       "dummypass", buildDef );
+                                       "dummypass", buildDef, null );
         context.assertIsSatisfied();
     }
 
@@ -563,7 +563,7 @@
         final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
         checkoutTasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-2",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         final ParallelBuildsThreadedTaskQueueExecutor buildTaskQueueExecutor =
             context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-build-task-executor"
);
@@ -688,7 +688,7 @@
         final List<CheckOutTask> checkoutTasks = new ArrayList<CheckOutTask>();
         checkoutTasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-2",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         try
         {
@@ -786,7 +786,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-2",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
Wed Apr 29 11:15:55 2009
@@ -84,7 +84,7 @@
     {
         final CheckOutTask checkoutTask =
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-1",
-                              "dummy", "dummypass", null );
+                              "dummy", "dummypass", null, null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
 
         context.checking( new Expectations()
@@ -107,7 +107,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-1",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -133,7 +133,7 @@
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add(
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-1",
-                              "dummy", "dummypass", null ) );
+                              "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -154,7 +154,7 @@
     {
         final Task checkoutTask =
             new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
"continuum-project-test-1",
-                              "dummy", "dummypass", null );
+                              "dummy", "dummypass", null, null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add( checkoutTask );

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Wed Apr 29 11:15:55 2009
@@ -40,6 +40,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.jmock.Expectations;
 import org.jmock.Mockery;
@@ -144,7 +145,11 @@
 
         List<Project> projects = result.getProjects();
 
-        assertEquals( 3, projects.size() );        
+        assertEquals( 3, projects.size() );     
+        
+        Project rootProject = result.getRootProject();
+        
+        assertNotNull( rootProject );
         
         Map<String, Project> projectsMap = new HashMap<String, Project>();
 
@@ -185,7 +190,16 @@
         
         assertTrue( "module-a was not checked out in the same directory as it's parent.",
new File( checkoutDir, "module-a" ).exists() );
         
-        assertTrue( "module-b was not checked out in the same directory as it's parent.",
new File( checkoutDir, "module-b" ).exists() );        
+        assertTrue( "module-b was not checked out in the same directory as it's parent.",
new File( checkoutDir, "module-b" ).exists() );
+        
+        // assert project state 
+        assertEquals( "state of 'parent-project' should have been updated.", ContinuumProjectState.CHECKEDOUT,
parentProject.getState() );
+        
+        assertEquals( "state of 'module-a' should have been updated.", ContinuumProjectState.CHECKEDOUT,
+                      getProjectDao().getProjectByName( "module-a" ).getState() );
+        
+        assertEquals( "state of 'module-b' should have been updated.", ContinuumProjectState.CHECKEDOUT,
+                      getProjectDao().getProjectByName( "module-b" ).getState() );      
 
     }
 
     public void testUpdateMavenTwoProject()

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java?rev=769748&r1=769747&r2=769748&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
Wed Apr 29 11:15:55 2009
@@ -201,6 +201,6 @@
             "Should not have errors but had " + result.getErrorsAsString() + " (this test
requires internet access)",
             result.hasErrors() );
         assertEquals( "Incorrect SCM Root Url for flat multi-module project.",
-                      "scm:local:src/test-projects:flat-multi-module/", context.get( AbstractContinuumAction.KEY_URL
) );
+                      "scm:local:src/test-projects:flat-multi-module/", context.get( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT
) );
     }
 }



Mime
View raw message