continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1372260 [14/30] - in /continuum/trunk: ./ continuum-api/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/ continuum-api/src/main/java/org/apache/continuum/builder/distributed/executor/ continuum-api/src/main/java/org/a...
Date Mon, 13 Aug 2012 04:29:28 GMT
Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java Mon Aug 13 04:29:09 2012
@@ -19,13 +19,6 @@ package org.apache.continuum.buildmanage
  * under the License.
  */
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.continuum.buildqueue.BuildQueueService;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.dao.ProjectDao;
@@ -51,6 +44,13 @@ import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * ParallelBuildsManagerTest
  *
@@ -171,8 +171,8 @@ public class ParallelBuildsManagerTest
     public void setupMockOverallBuildQueues()
         throws Exception
     {
-        Map<Integer, OverallBuildQueue> overallBuildQueues =
-            Collections.synchronizedMap( new HashMap<Integer, OverallBuildQueue>() );
+        Map<Integer, OverallBuildQueue> overallBuildQueues = Collections.synchronizedMap(
+            new HashMap<Integer, OverallBuildQueue>() );
         overallBuildQueue = context.mock( OverallBuildQueue.class );
         for ( int i = 1; i <= 5; i++ )
         {
@@ -206,7 +206,8 @@ public class ParallelBuildsManagerTest
 
                 exactly( 7 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
                 will( returnValue( buildTaskQueueExecutor ) );
-            }} );
+            }
+        } );
     }
 
     private void recordBuildProjectBuildQueuesAreEmpty()
@@ -221,13 +222,14 @@ public class ParallelBuildsManagerTest
             {
                 exactly( 2 ).of( buildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-                
+
                 exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
 
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
+            }
+        } );
 
         recordAddToBuildQueue();
     }
@@ -239,7 +241,8 @@ public class ParallelBuildsManagerTest
         {
             {
                 one( overallBuildQueue ).addToBuildQueue( with( any( BuildProjectTask.class ) ) );
-            }} );
+            }
+        } );
     }
 
     // checkout project recordings
@@ -260,7 +263,8 @@ public class ParallelBuildsManagerTest
 
                 exactly( 2 ).of( overallBuildQueue ).getCheckoutTaskQueueExecutor();
                 will( returnValue( checkoutTaskQueueExecutor ) );
-            }} );
+            }
+        } );
 
     }
 
@@ -281,7 +285,8 @@ public class ParallelBuildsManagerTest
 
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
+            }
+        } );
 
         recordAddToCheckoutQueue();
     }
@@ -293,7 +298,8 @@ public class ParallelBuildsManagerTest
         {
             {
                 one( overallBuildQueue ).addToCheckoutQueue( with( any( CheckOutTask.class ) ) );
-            }} );
+            }
+        } );
     }
 
     // prepare build project recordings
@@ -307,7 +313,8 @@ public class ParallelBuildsManagerTest
         context.checking( new Expectations()
         {
             {
-                exactly( 5 ).of( overallBuildQueue ).isInPrepareBuildQueue( with( any( int.class ) ), with( any( int.class ) ) );
+                exactly( 5 ).of( overallBuildQueue ).isInPrepareBuildQueue( with( any( int.class ) ), with( any(
+                    int.class ) ) );
                 will( returnValue( false ) );
 
                 one( buildDefinitionDao ).getBuildDefinition( 1 );
@@ -315,34 +322,36 @@ public class ParallelBuildsManagerTest
 
                 one( configurationService ).getNumberOfBuildsInParallel();
                 will( returnValue( 2 ) );
-    
+
                 exactly( 2 ).of( overallBuildQueue ).getPrepareBuildQueue();
                 will( returnValue( prepareBuildQueue ) );
-    
+
                 exactly( 2 ).of( overallBuildQueue ).getPrepareBuildTaskQueueExecutor();
                 will( returnValue( prepareBuildTaskQueueExecutor ) );
-            }} );
+            }
+        } );
     }
 
     private void recordPrepareBuildProjectPrepareBuildQueuesAreEmpty()
         throws TaskQueueException, ContinuumStoreException
     {
         recordStartOfPrepareBuildProjectSequence();
-    
+
         final List<Task> tasks = new ArrayList<Task>();
         context.checking( new Expectations()
         {
             {
                 exactly( 2 ).of( prepareBuildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-                
+
                 exactly( 2 ).of( prepareBuildTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-    
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
-    
+            }
+        } );
+
         recordAddToPrepareBuildQueue();
     }
 
@@ -380,7 +389,8 @@ public class ParallelBuildsManagerTest
 
         recordBuildProjectBuildQueuesAreEmpty();
 
-        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
+        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null,
+                                    1 );
 
         context.assertIsSatisfied();
     }
@@ -396,7 +406,8 @@ public class ParallelBuildsManagerTest
 
         recordBuildProjectBuildQueuesAreEmpty();
 
-        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
+        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null,
+                                    1 );
         context.assertIsSatisfied();
 
         //queue second project - 1st queue is not empty, 2nd queue is empty 
@@ -405,8 +416,9 @@ public class ParallelBuildsManagerTest
         // the first build queue already has a task queued
         final List<Task> tasks = new ArrayList<Task>();
         final List<Task> tasksOfFirstBuildQueue = new ArrayList<Task>();
-        tasksOfFirstBuildQueue.add(
-        		new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", buildDef.getDescription(), null, 2 ) );
+        tasksOfFirstBuildQueue.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ),
+                                                          "continuum-project-test-2", buildDef.getDescription(), null,
+                                                          2 ) );
         context.checking( new Expectations()
         {
             {
@@ -422,11 +434,13 @@ public class ParallelBuildsManagerTest
 
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_3" ) );
-            }} );
+            }
+        } );
 
         recordAddToBuildQueue();
 
-        buildsManager.buildProject( 2, buildDef, "continuum-project-test-2", new BuildTrigger( 1, "test-user" ), null, 2 );
+        buildsManager.buildProject( 2, buildDef, "continuum-project-test-2", new BuildTrigger( 1, "test-user" ), null,
+                                    2 );
         context.assertIsSatisfied();
 
         // queue third project - both queues have 1 task queued each
@@ -441,14 +455,16 @@ public class ParallelBuildsManagerTest
 
                 exactly( 2 ).of( buildTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-                
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
+            }
+        } );
 
         recordAddToBuildQueue();
 
-        buildsManager.buildProject( 3, buildDef, "continuum-project-test-3", new BuildTrigger( 1, "test-user" ), null, 3 );
+        buildsManager.buildProject( 3, buildDef, "continuum-project-test-3", new BuildTrigger( 1, "test-user" ), null,
+                                    3 );
         context.assertIsSatisfied();
     }
 
@@ -464,7 +480,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( true ) );
 
                 one( overallBuildQueue ).removeProjectFromBuildQueue( 1 );
-            }} );
+            }
+        } );
 
         buildsManager.removeProjectFromBuildQueue( 1 );
         context.assertIsSatisfied();
@@ -483,7 +500,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( true ) );
 
                 exactly( 3 ).of( overallBuildQueue ).removeProjectFromBuildQueue( with( any( int.class ) ) );
-            }} );
+            }
+        } );
 
         buildsManager.removeProjectsFromBuildQueue( projectIds );
         context.assertIsSatisfied();
@@ -500,9 +518,9 @@ public class ParallelBuildsManagerTest
 
         recordCheckoutProjectBuildQueuesAreEmpty();
 
-        buildsManager.checkoutProject( 1, "continuum-project-test-1",
-        			new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy", "dummypass",
-        			buildDef, null );
+        buildsManager.checkoutProject( 1, "continuum-project-test-1", new File( getBasedir(),
+                                                                                "/target/test-working-dir/1" ), null,
+                                       "dummy", "dummypass", buildDef, null );
         context.assertIsSatisfied();
     }
 
@@ -517,9 +535,9 @@ public class ParallelBuildsManagerTest
 
         recordCheckoutProjectBuildQueuesAreEmpty();
 
-        buildsManager.checkoutProject( 1, "continuum-project-test-1",
-	        		new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy", "dummypass",
-	    			buildDef, null );
+        buildsManager.checkoutProject( 1, "continuum-project-test-1", new File( getBasedir(),
+                                                                                "/target/test-working-dir/1" ), null,
+                                       "dummy", "dummypass", buildDef, null );
         context.assertIsSatisfied();
 
         // queue second project - 1st queue has 1 task while 2nd queue is empty; project should be queued in
@@ -529,9 +547,9 @@ public class ParallelBuildsManagerTest
         final List<Task> tasks = new ArrayList<Task>();
 
         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, null ) );
+        tasksInFirstCheckoutQueue.add( new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                                         "continuum-project-test-1", "dummy", "dummypass", null,
+                                                         null ) );
 
         context.checking( new Expectations()
         {
@@ -544,16 +562,17 @@ public class ParallelBuildsManagerTest
 
                 exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-                
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_3" ) );
-            }} );
+            }
+        } );
 
         recordAddToCheckoutQueue();
 
-        buildsManager.checkoutProject( 2, "continuum-project-test-2",
-	        		new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy", "dummypass",
-	    			buildDef, null );
+        buildsManager.checkoutProject( 2, "continuum-project-test-2", new File( getBasedir(),
+                                                                                "/target/test-working-dir/1" ), null,
+                                       "dummy", "dummypass", buildDef, null );
         context.assertIsSatisfied();
 
         // queue third project - both queues have 1 task queued each; third project should be queued in 1st queue
@@ -567,16 +586,17 @@ public class ParallelBuildsManagerTest
 
                 exactly( 2 ).of( checkoutTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-                
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
+            }
+        } );
 
         recordAddToCheckoutQueue();
 
-        buildsManager.checkoutProject( 3, "continuum-project-test-3",
-	        		new File( getBasedir(), "/target/test-working-dir/1" ), null, "dummy", "dummypass",
-	    			buildDef, null );
+        buildsManager.checkoutProject( 3, "continuum-project-test-3", new File( getBasedir(),
+                                                                                "/target/test-working-dir/1" ), null,
+                                       "dummy", "dummypass", buildDef, null );
         context.assertIsSatisfied();
     }
 
@@ -592,7 +612,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( true ) );
 
                 one( overallBuildQueue ).removeProjectFromCheckoutQueue( 1 );
-            }} );
+            }
+        } );
 
         buildsManager.removeProjectFromCheckoutQueue( 1 );
         context.assertIsSatisfied();
@@ -610,7 +631,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( true ) );
 
                 exactly( 3 ).of( overallBuildQueue ).removeProjectFromCheckoutQueue( with( any( int.class ) ) );
-            }} );
+            }
+        } );
 
         int[] projectIds = new int[]{1, 2, 3};
 
@@ -629,7 +651,8 @@ public class ParallelBuildsManagerTest
             {
                 exactly( 5 ).of( overallBuildQueue ).isInCheckoutQueue( 1 );
                 will( returnValue( false ) );
-            }} );
+            }
+        } );
 
         buildsManager.removeProjectFromCheckoutQueue( 1 );
         context.assertIsSatisfied();
@@ -647,7 +670,8 @@ public class ParallelBuildsManagerTest
                 {
                     one( overallBuildQueue ).getName();
                     will( returnValue( ConfigurationService.DEFAULT_BUILD_QUEUE_NAME ) );
-                }} );
+                }
+            } );
 
             buildsManager.removeOverallBuildQueue( 1 );
             context.assertIsSatisfied();
@@ -670,18 +694,18 @@ public class ParallelBuildsManagerTest
         buildDef.setSchedule( getSchedule( 1, 1, 2 ) );
 
         final TaskQueueExecutor buildQueueExecutor = context.mock( TaskQueueExecutor.class, "build-queue-executor" );
-        final TaskQueueExecutor checkoutQueueExecutor =
-            context.mock( TaskQueueExecutor.class, "checkout-queue-executor" );
-        final TaskQueueExecutor prepareBuildQueueExecutor =
-            context.mock( TaskQueueExecutor.class, "prepare-build-queue-executor" );
+        final TaskQueueExecutor checkoutQueueExecutor = context.mock( TaskQueueExecutor.class,
+                                                                      "checkout-queue-executor" );
+        final TaskQueueExecutor prepareBuildQueueExecutor = context.mock( TaskQueueExecutor.class,
+                                                                          "prepare-build-queue-executor" );
 
         final List<Task> buildTasks = new ArrayList<Task>();
-        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
+        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2",
+                                              "BUILD_DEF", null, 2 ) );
 
         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, null ) );
+        checkoutTasks.add( new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                             "continuum-project-test-2", "dummy", "dummypass", null, null ) );
 
         final List<Task> prepareBuildTasks = new ArrayList<Task>();
         final Map<Integer, Integer> map = new HashMap<Integer, Integer>();
@@ -689,12 +713,12 @@ public class ParallelBuildsManagerTest
         prepareBuildTasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1,
                                                              "Project Group A", "http://scm.root.address", 2 ) );
 
-        final ParallelBuildsThreadedTaskQueueExecutor buildTaskQueueExecutor =
-            context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-build-task-executor" );
-        final ParallelBuildsThreadedTaskQueueExecutor checkoutTaskQueueExecutor =
-            context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-checkout-task-executor" );
-        final ParallelBuildsThreadedTaskQueueExecutor prepareBuildTaskQueueExecutor =
-            context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-prepare-build-task-executor" );
+        final ParallelBuildsThreadedTaskQueueExecutor buildTaskQueueExecutor = context.mock(
+            ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-build-task-executor" );
+        final ParallelBuildsThreadedTaskQueueExecutor checkoutTaskQueueExecutor = context.mock(
+            ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-checkout-task-executor" );
+        final ParallelBuildsThreadedTaskQueueExecutor prepareBuildTaskQueueExecutor = context.mock(
+            ParallelBuildsThreadedTaskQueueExecutor.class, "parallel-prepare-build-task-executor" );
 
         final List<Task> tasks = new ArrayList<Task>();
 
@@ -782,13 +806,13 @@ public class ParallelBuildsManagerTest
 
                 exactly( 6 ).of( overallBuildQueue ).getBuildTaskQueueExecutor();
                 will( returnValue( buildQueueExecutor ) );
-                
+
                 exactly( 2 ).of( buildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
 
                 exactly( 2 ).of( buildQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-                
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
 
@@ -823,7 +847,8 @@ public class ParallelBuildsManagerTest
                 recordAddToCheckoutQueue();
 
                 // re-queue projects in the prepare build queue of the deleted overall build queue
-                exactly( 4 ).of( overallBuildQueue ).isInPrepareBuildQueue( with( any( int.class ) ), with( any( int.class ) ) );
+                exactly( 4 ).of( overallBuildQueue ).isInPrepareBuildQueue( with( any( int.class ) ), with( any(
+                    int.class ) ) );
                 will( returnValue( false ) );
 
                 one( buildDefinitionDao ).getBuildDefinition( 1 );
@@ -848,7 +873,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( "BUILD_QUEUE_2" ) );
 
                 recordAddToPrepareBuildQueue();
-            }} );
+            }
+        } );
 
         buildsManager.removeOverallBuildQueue( 5 );
         context.assertIsSatisfied();
@@ -867,15 +893,16 @@ public class ParallelBuildsManagerTest
         buildDef.setSchedule( getSchedule( 1, 1, 2 ) );
 
         final TaskQueueExecutor buildQueueExecutor = context.mock( TaskQueueExecutor.class, "build-queue-executor" );
-        final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1", "BUILD_DEF", null, 1 );
+        final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ),
+                                                     "continuum-project-test-1", "BUILD_DEF", null, 1 );
 
         final List<BuildProjectTask> buildTasks = new ArrayList<BuildProjectTask>();
-        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
+        buildTasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2",
+                                              "BUILD_DEF", null, 2 ) );
 
         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, null ) );
+        checkoutTasks.add( new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                             "continuum-project-test-2", "dummy", "dummypass", null, null ) );
 
         try
         {
@@ -890,7 +917,8 @@ public class ParallelBuildsManagerTest
                     will( returnValue( buildQueueExecutor ) );
                     one( buildQueueExecutor ).getCurrentTask();
                     will( returnValue( buildTask ) );
-                }} );
+                }
+            } );
 
             buildsManager.removeOverallBuildQueue( 5 );
             context.assertIsSatisfied();
@@ -907,8 +935,8 @@ public class ParallelBuildsManagerTest
     {
         overallBuildQueue = context.mock( OverallBuildQueue.class );
 
-        Map<Integer, OverallBuildQueue> overallBuildQueues =
-            Collections.synchronizedMap( new HashMap<Integer, OverallBuildQueue>() );
+        Map<Integer, OverallBuildQueue> overallBuildQueues = Collections.synchronizedMap(
+            new HashMap<Integer, OverallBuildQueue>() );
         overallBuildQueues.put( 1, overallBuildQueue );
 
         buildsManager.setOverallBuildQueues( overallBuildQueues );
@@ -946,9 +974,11 @@ public class ParallelBuildsManagerTest
                 will( returnValue( ConfigurationService.DEFAULT_BUILD_QUEUE_NAME ) );
 
                 one( overallBuildQueue ).addToBuildQueue( with( any( BuildProjectTask.class ) ) );
-            }} );
+            }
+        } );
 
-        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null, 1 );
+        buildsManager.buildProject( 1, buildDef, "continuum-project-test-1", new BuildTrigger( 1, "test-user" ), null,
+                                    1 );
         context.assertIsSatisfied();
     }
 
@@ -958,7 +988,8 @@ public class ParallelBuildsManagerTest
         setupMockOverallBuildQueues();
 
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2  ) );
+        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2",
+                                         "BUILD_DEF", null, 2 ) );
 
         context.checking( new Expectations()
         {
@@ -968,7 +999,8 @@ public class ParallelBuildsManagerTest
 
                 exactly( 5 ).of( overallBuildQueue ).getProjectsInBuildQueue();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         buildsManager.getProjectsInBuildQueues();
         context.assertIsSatisfied();
@@ -980,9 +1012,8 @@ public class ParallelBuildsManagerTest
         setupMockOverallBuildQueues();
 
         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, null ) );
+        tasks.add( new CheckOutTask( 2, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                     "continuum-project-test-2", "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -992,7 +1023,8 @@ public class ParallelBuildsManagerTest
 
                 exactly( 5 ).of( overallBuildQueue ).getProjectsInCheckoutQueue();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         buildsManager.getProjectsInCheckoutQueues();
         context.assertIsSatisfied();
@@ -1009,8 +1041,8 @@ public class ParallelBuildsManagerTest
 
         recordPrepareBuildProjectPrepareBuildQueuesAreEmpty();
 
-        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, 
-                                            "Project Group A", "http://scm.root.address", 1 );
+        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
+                                            "http://scm.root.address", 1 );
         context.assertIsSatisfied();
     }
 
@@ -1028,9 +1060,10 @@ public class ParallelBuildsManagerTest
         // the first prepare build queue already has a task queued
         final List<Task> tasks = new ArrayList<Task>();
         final List<Task> tasksOfFirstPrepareBuildQueue = new ArrayList<Task>();
-        tasksOfFirstPrepareBuildQueue.add(
-                new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 1,
-                                              "Project Group B", "http://scm.root.address2", 2 ) );
+        tasksOfFirstPrepareBuildQueue.add( new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(),
+                                                                         new BuildTrigger( 1, "test-user" ), 1,
+                                                                         "Project Group B", "http://scm.root.address2",
+                                                                         2 ) );
         context.checking( new Expectations()
         {
             {
@@ -1046,12 +1079,13 @@ public class ParallelBuildsManagerTest
 
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_3" ) );
-            }} );
+            }
+        } );
 
         recordAddToPrepareBuildQueue();
 
-        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, 
-                                            "Project Group A", "http://scm.root.address", 1 );
+        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
+                                            "http://scm.root.address", 1 );
         context.assertIsSatisfied();
 
         // queue third project - both queues have 1 task queued each
@@ -1066,15 +1100,16 @@ public class ParallelBuildsManagerTest
 
                 exactly( 2 ).of( prepareBuildTaskQueueExecutor ).getCurrentTask();
                 will( returnValue( null ) );
-                
+
                 one( overallBuildQueue ).getName();
                 will( returnValue( "BUILD_QUEUE_2" ) );
-            }} );
+            }
+        } );
 
         recordAddToPrepareBuildQueue();
 
-        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, 
-                                            "Project Group A", "http://scm.root.address", 1 );
+        buildsManager.prepareBuildProjects( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
+                                            "http://scm.root.address", 1 );
         context.assertIsSatisfied();
     }
 
@@ -1085,7 +1120,7 @@ public class ParallelBuildsManagerTest
 
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add( new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 1,
-                                                 "Project Group A", "http://scm.root.address", 2  ) );
+                                                 "Project Group A", "http://scm.root.address", 2 ) );
 
         context.checking( new Expectations()
         {
@@ -1095,7 +1130,8 @@ public class ParallelBuildsManagerTest
 
                 exactly( 5 ).of( overallBuildQueue ).getProjectsInPrepareBuildQueue();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         buildsManager.getProjectsInPrepareBuildQueue();
         context.assertIsSatisfied();
@@ -1112,7 +1148,8 @@ public class ParallelBuildsManagerTest
                 will( returnValue( true ) );
 
                 one( overallBuildQueue ).removeProjectFromPrepareBuildQueue( 1, 2 );
-            }} );
+            }
+        } );
 
         buildsManager.removeProjectFromPrepareBuildQueue( 1, 2 );
         context.assertIsSatisfied();

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/notification/mail/MockJavaMailSender.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/notification/mail/MockJavaMailSender.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/notification/mail/MockJavaMailSender.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/notification/mail/MockJavaMailSender.java Mon Aug 13 04:29:09 2012
@@ -19,15 +19,14 @@ package org.apache.continuum.notificatio
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.mail.internet.MimeMessage;
-
 import org.springframework.mail.MailException;
 import org.springframework.mail.javamail.JavaMailSender;
 import org.springframework.mail.javamail.JavaMailSenderImpl;
 
+import java.util.ArrayList;
+import java.util.List;
+import javax.mail.internet.MimeMessage;
+
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @version $Id$

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/purge/DefaultContinuumPurgeManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/purge/DefaultContinuumPurgeManagerTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/purge/DefaultContinuumPurgeManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/purge/DefaultContinuumPurgeManagerTest.java Mon Aug 13 04:29:09 2012
@@ -69,14 +69,14 @@ public class DefaultContinuumPurgeManage
 
         localRepositoryDao = (LocalRepositoryDao) lookup( LocalRepositoryDao.class.getName() );
 
-        directoryPurgeConfigurationDao =
-            (DirectoryPurgeConfigurationDao) lookup( DirectoryPurgeConfigurationDao.class.getName() );
+        directoryPurgeConfigurationDao = (DirectoryPurgeConfigurationDao) lookup(
+            DirectoryPurgeConfigurationDao.class.getName() );
 
-        repositoryPurgeConfigurationDao =
-            (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class.getName() );
-        
-        distributedDirectoryPurgeConfigurationDao =
-            (DistributedDirectoryPurgeConfigurationDao) lookup( DistributedDirectoryPurgeConfigurationDao.class.getName() );
+        repositoryPurgeConfigurationDao = (RepositoryPurgeConfigurationDao) lookup(
+            RepositoryPurgeConfigurationDao.class.getName() );
+
+        distributedDirectoryPurgeConfigurationDao = (DistributedDirectoryPurgeConfigurationDao) lookup(
+            DistributedDirectoryPurgeConfigurationDao.class.getName() );
 
         purgeManager = (ContinuumPurgeManager) lookup( ContinuumPurgeManager.ROLE );
 
@@ -169,11 +169,12 @@ public class DefaultContinuumPurgeManage
         dirPurge.setDirectoryType( "releases" );
         dirPurge.setLocation( getTestFile( "target/working-directory" ).getAbsolutePath() );
         dirPurge = directoryPurgeConfigurationDao.addDirectoryPurgeConfiguration( dirPurge );
-        
+
         distDirPurge = new DistributedDirectoryPurgeConfiguration();
         distDirPurge.setDirectoryType( "releases" );
         distDirPurge.setBuildAgentUrl( "http://localhost:8186/continuum-buildagent/xmlrpc" );
-        distDirPurge = distributedDirectoryPurgeConfigurationDao.addDistributedDirectoryPurgeConfiguration( distDirPurge );
+        distDirPurge = distributedDirectoryPurgeConfigurationDao.addDistributedDirectoryPurgeConfiguration(
+            distDirPurge );
     }
 
     private void assertNextBuildIs( int expectedPurgeConfigId )
@@ -197,7 +198,7 @@ public class DefaultContinuumPurgeManage
         if ( task != null )
         {
             fail( "Got a non-null purge task returned. Purge Config id: " +
-                ( (PurgeTask) task ).getPurgeConfigurationId() );
+                      ( (PurgeTask) task ).getPurgeConfigurationId() );
         }
     }
 }
\ No newline at end of file

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/release/distributed/manager/DefaultDistributedReleaseManagerTest.java Mon Aug 13 04:29:09 2012
@@ -36,11 +36,11 @@ public class DefaultDistributedReleaseMa
     private DefaultDistributedReleaseManager distributedReleaseManager;
 
     private BuildResultDao buildResultDao;
-    
+
     private BuildResult buildResult;
-    
+
     private Mockery context;
-    
+
     @Override
     protected void setUp()
         throws Exception
@@ -49,40 +49,40 @@ public class DefaultDistributedReleaseMa
 
         context = new JUnit3Mockery();
         context.setImposteriser( ClassImposteriser.INSTANCE );
-        
+
         distributedReleaseManager = new DefaultDistributedReleaseManager();
-        
+
         buildResultDao = context.mock( BuildResultDao.class );
         distributedReleaseManager.setBuildResultDao( buildResultDao );
     }
-    
+
     public void testGetDefaultBuildagent()
         throws Exception
     {
         String defaultBuildagentUrl = "http://localhost:8181/continuum-buildagent/xmlrpc";
-        
+
         buildResult = new BuildResult();
         buildResult.setBuildUrl( defaultBuildagentUrl );
-        
+
         contextBuildResultDaoExpectations();
-        
+
         String returnedBuildagent = distributedReleaseManager.getDefaultBuildagent( 0 );
-        
+
         assertNotNull( returnedBuildagent );
         assertEquals( returnedBuildagent, defaultBuildagentUrl );
 
         context.assertIsSatisfied();
     }
-    
+
     public void testGetDefaultBuildagentNullBuildResult()
         throws Exception
     {
         buildResult = null;
-        
+
         contextBuildResultDaoExpectations();
-        
+
         String returnedBuildagent = distributedReleaseManager.getDefaultBuildagent( 0 );
-        
+
         assertNull( returnedBuildagent );
 
         context.assertIsSatisfied();
@@ -95,7 +95,7 @@ public class DefaultDistributedReleaseMa
         {
             {
                 one( buildResultDao ).getLatestBuildResultForProject( 0 );
-                will( returnValue( buildResult )  );
+                will( returnValue( buildResult ) );
             }
         } );
     }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/repository/DefaultRepositoryServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/repository/DefaultRepositoryServiceTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/repository/DefaultRepositoryServiceTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/repository/DefaultRepositoryServiceTest.java Mon Aug 13 04:29:09 2012
@@ -47,8 +47,8 @@ public class DefaultRepositoryServiceTes
     {
         super.setUp();
 
-        repositoryPurgeConfigurationDao =
-            (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class.getName() );
+        repositoryPurgeConfigurationDao = (RepositoryPurgeConfigurationDao) lookup(
+            RepositoryPurgeConfigurationDao.class.getName() );
 
         repositoryService = (RepositoryService) lookup( RepositoryService.ROLE );
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java Mon Aug 13 04:29:09 2012
@@ -19,12 +19,6 @@ package org.apache.continuum.taskqueue;
  * under the License.
  */
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
 import org.apache.continuum.utils.build.BuildTrigger;
@@ -37,6 +31,12 @@ import org.jmock.Mockery;
 import org.jmock.integration.junit3.JUnit3Mockery;
 import org.jmock.lib.legacy.ClassImposteriser;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 /**
  * DefaultOverallBuildQueueTest
  *
@@ -72,11 +72,11 @@ public class DefaultOverallBuildQueueTes
 
         buildTaskQueueExecutor = context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "build-queue-executor" );
 
-        checkoutTaskQueueExecutor =
-            context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "checkout-queue-executor" );
+        checkoutTaskQueueExecutor = context.mock( ParallelBuildsThreadedTaskQueueExecutor.class,
+                                                  "checkout-queue-executor" );
 
-        prepareBuildTaskQueueExecutor = 
-            context.mock( ParallelBuildsThreadedTaskQueueExecutor.class, "prepare-build-queue-executor" );
+        prepareBuildTaskQueueExecutor = context.mock( ParallelBuildsThreadedTaskQueueExecutor.class,
+                                                      "prepare-build-queue-executor" );
 
         overallQueue.setBuildDefinitionDao( buildDefinitionDao );
 
@@ -92,9 +92,9 @@ public class DefaultOverallBuildQueueTes
     public void testAddToCheckoutQueue()
         throws Exception
     {
-        final CheckOutTask checkoutTask =
-            new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-            			"dummy", "dummypass", null, null );
+        final CheckOutTask checkoutTask = new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                                            "continuum-project-test-1", "dummy", "dummypass", null,
+                                                            null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
 
         context.checking( new Expectations()
@@ -104,7 +104,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( checkoutQueue ) );
 
                 one( checkoutQueue ).put( checkoutTask );
-            }} );
+            }
+        } );
 
         overallQueue.addToCheckoutQueue( checkoutTask );
         context.assertIsSatisfied();
@@ -115,9 +116,8 @@ public class DefaultOverallBuildQueueTes
     {
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
         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, null ) );
+        tasks.add( new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                     "continuum-project-test-1", "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -127,7 +127,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( checkoutQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         List<CheckOutTask> returnedTasks = overallQueue.getProjectsInCheckoutQueue();
         context.assertIsSatisfied();
@@ -141,9 +142,8 @@ public class DefaultOverallBuildQueueTes
     {
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
         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, null ) );
+        tasks.add( new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                     "continuum-project-test-1", "dummy", "dummypass", null, null ) );
 
         context.checking( new Expectations()
         {
@@ -153,7 +153,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( checkoutQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         assertTrue( overallQueue.isInCheckoutQueue( 1 ) );
         context.assertIsSatisfied();
@@ -162,9 +163,8 @@ public class DefaultOverallBuildQueueTes
     public void testRemoveProjectFromCheckoutQueue()
         throws Exception
     {
-        final Task checkoutTask =
-            new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ), "continuum-project-test-1",
-            			"dummy", "dummypass", null, null );
+        final Task checkoutTask = new CheckOutTask( 1, new File( getBasedir(), "/target/test-working-dir/1" ),
+                                                    "continuum-project-test-1", "dummy", "dummypass", null, null );
         final TaskQueue checkoutQueue = context.mock( TaskQueue.class, "checkout-queue" );
         final List<Task> tasks = new ArrayList<Task>();
         tasks.add( checkoutTask );
@@ -182,7 +182,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( checkoutQueue ) );
 
                 one( checkoutQueue ).remove( checkoutTask );
-            }} );
+            }
+        } );
 
         overallQueue.removeProjectFromCheckoutQueue( 1 );
         context.assertIsSatisfied();
@@ -193,8 +194,8 @@ public class DefaultOverallBuildQueueTes
     public void testAddToBuildQueue()
         throws Exception
     {
-        final BuildProjectTask buildTask =
-        	new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
+        final BuildProjectTask buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ),
+                                                                 "continuum-project-test-2", "BUILD_DEF", null, 2 );
         final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
 
         context.checking( new Expectations()
@@ -204,7 +205,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( buildQueue ) );
 
                 one( buildQueue ).put( buildTask );
-            }} );
+            }
+        } );
 
         overallQueue.addToBuildQueue( buildTask );
         context.assertIsSatisfied();
@@ -215,7 +217,8 @@ public class DefaultOverallBuildQueueTes
     {
         final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
+        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2",
+                                         "BUILD_DEF", null, 2 ) );
 
         context.checking( new Expectations()
         {
@@ -225,7 +228,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( buildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         List<BuildProjectTask> returnedTasks = overallQueue.getProjectsInBuildQueue();
         context.assertIsSatisfied();
@@ -239,7 +243,8 @@ public class DefaultOverallBuildQueueTes
     {
         final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 ) );
+        tasks.add( new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2",
+                                         "BUILD_DEF", null, 2 ) );
 
         context.checking( new Expectations()
         {
@@ -249,7 +254,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( buildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         assertTrue( overallQueue.isInBuildQueue( 2 ) );
         context.assertIsSatisfied();
@@ -258,7 +264,8 @@ public class DefaultOverallBuildQueueTes
     public void testCancelBuildTask()
         throws Exception
     {
-    	final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
+        final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ),
+                                                     "continuum-project-test-2", "BUILD_DEF", null, 2 );
 
         context.checking( new Expectations()
         {
@@ -267,7 +274,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( buildTask ) );
 
                 one( buildTaskQueueExecutor ).cancelTask( buildTask );
-            }} );
+            }
+        } );
 
         overallQueue.cancelBuildTask( 2 );
         context.assertIsSatisfied();
@@ -276,7 +284,8 @@ public class DefaultOverallBuildQueueTes
     public void testCancelCurrentBuild()
         throws Exception
     {
-    	final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 2 );
+        final Task buildTask = new BuildProjectTask( 2, 1, new BuildTrigger( 1, "test-user" ),
+                                                     "continuum-project-test-2", "BUILD_DEF", null, 2 );
 
         context.checking( new Expectations()
         {
@@ -285,7 +294,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( buildTask ) );
 
                 one( buildTaskQueueExecutor ).cancelTask( buildTask );
-            }} );
+            }
+        } );
 
         overallQueue.cancelCurrentBuild();
         context.assertIsSatisfied();
@@ -310,16 +320,19 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( buildQueue ) );
 
                 one( buildQueue ).remove( with( any( Task.class ) ) );
-            }} );
+            }
+        } );
 
-        overallQueue.removeProjectFromBuildQueue( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1", 1 );
+        overallQueue.removeProjectFromBuildQueue( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-1",
+                                                  1 );
         context.assertIsSatisfied();
     }
 
     public void testRemoveProjectFromBuildQueue()
         throws Exception
     {
-    	final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ), "continuum-project-test-2", "BUILD_DEF", null, 1 );
+        final Task buildTask = new BuildProjectTask( 1, 1, new BuildTrigger( 1, "test-user" ),
+                                                     "continuum-project-test-2", "BUILD_DEF", null, 1 );
 
         final TaskQueue buildQueue = context.mock( TaskQueue.class, "build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
@@ -338,7 +351,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( buildQueue ) );
 
                 one( buildQueue ).remove( buildTask );
-            }} );
+            }
+        } );
 
         overallQueue.removeProjectFromBuildQueue( 1 );
         context.assertIsSatisfied();
@@ -349,9 +363,11 @@ public class DefaultOverallBuildQueueTes
     public void testAddToPrepareBuildQueue()
         throws Exception
     {
-        final PrepareBuildProjectsTask prepareBuildTask =
-            new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 1, 
-                                          "Project Group A", "http://scmRootAddress", 1 );
+        final PrepareBuildProjectsTask prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(),
+                                                                                        new BuildTrigger( 1,
+                                                                                                          "test-user" ),
+                                                                                        1, "Project Group A",
+                                                                                        "http://scmRootAddress", 1 );
         final TaskQueue prepareBuildQueue = context.mock( TaskQueue.class, "prepare-build-queue" );
 
         context.checking( new Expectations()
@@ -361,7 +377,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildQueue ) );
 
                 one( prepareBuildQueue ).put( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.addToPrepareBuildQueue( prepareBuildTask );
         context.assertIsSatisfied();
@@ -370,9 +387,8 @@ public class DefaultOverallBuildQueueTes
     public void testCancelCurrentPrepareBuild()
         throws Exception
     {
-        final Task prepareBuildTask = 
-            new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 1, 
-                                          "Project Group A", "http://scm.root.address", 1 );
+        final Task prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger(
+            1, "test-user" ), 1, "Project Group A", "http://scm.root.address", 1 );
 
         context.checking( new Expectations()
         {
@@ -381,7 +397,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildTask ) );
 
                 one( prepareBuildTaskQueueExecutor ).cancelTask( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.cancelCurrentPrepareBuild();
         context.assertIsSatisfied();
@@ -393,9 +410,8 @@ public class DefaultOverallBuildQueueTes
         Map<Integer, Integer> map = new HashMap<Integer, Integer>();
         map.put( 1, 1 );
 
-        final Task prepareBuildTask = 
-            new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, 
-                                          "Project Group A", "http://scm.root.address", 1 );
+        final Task prepareBuildTask = new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1,
+                                                                    "Project Group A", "http://scm.root.address", 1 );
 
         context.checking( new Expectations()
         {
@@ -404,7 +420,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildTask ) );
 
                 one( prepareBuildTaskQueueExecutor ).cancelTask( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.cancelPrepareBuildTask( 1 );
         context.assertIsSatisfied();
@@ -416,9 +433,8 @@ public class DefaultOverallBuildQueueTes
         Map<Integer, Integer> map = new HashMap<Integer, Integer>();
         map.put( 1, 1 );
 
-        final Task prepareBuildTask = 
-            new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, 
-                                          "Project Group A", "http://scm.root.address", 2 );
+        final Task prepareBuildTask = new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1,
+                                                                    "Project Group A", "http://scm.root.address", 2 );
 
         context.checking( new Expectations()
         {
@@ -427,7 +443,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildTask ) );
 
                 one( prepareBuildTaskQueueExecutor ).cancelTask( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.cancelPrepareBuildTask( 1, 2 );
         context.assertIsSatisfied();
@@ -438,7 +455,7 @@ public class DefaultOverallBuildQueueTes
     {
         final TaskQueue prepareBuildQueue = context.mock( TaskQueue.class, "prepare-build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 2, 
+        tasks.add( new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 2,
                                                  "Project Group A", "http://scm.root.address", 2 ) );
 
         context.checking( new Expectations()
@@ -449,7 +466,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( prepareBuildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         List<PrepareBuildProjectsTask> returnedTasks = overallQueue.getProjectsInPrepareBuildQueue();
         context.assertIsSatisfied();
@@ -467,7 +485,7 @@ public class DefaultOverallBuildQueueTes
         map.put( 2, 1 );
 
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A", 
+        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
                                                  "http://scm.root.address", 2 ) );
 
         context.checking( new Expectations()
@@ -478,7 +496,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( prepareBuildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         assertTrue( overallQueue.isInPrepareBuildQueue( 2 ) );
         context.assertIsSatisfied();
@@ -493,7 +512,7 @@ public class DefaultOverallBuildQueueTes
         map.put( 2, 1 );
 
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A", 
+        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
                                                  "http://scm.root.address", 2 ) );
 
         context.checking( new Expectations()
@@ -504,7 +523,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( prepareBuildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         assertTrue( overallQueue.isInPrepareBuildQueue( 1, 2 ) );
         context.assertIsSatisfied();
@@ -519,7 +539,7 @@ public class DefaultOverallBuildQueueTes
         map.put( 2, 1 );
 
         final List<Task> tasks = new ArrayList<Task>();
-        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A", 
+        tasks.add( new PrepareBuildProjectsTask( map, new BuildTrigger( 1, "test-user" ), 1, "Project Group A",
                                                  "http://scm.root.address", 2 ) );
 
         context.checking( new Expectations()
@@ -530,7 +550,8 @@ public class DefaultOverallBuildQueueTes
 
                 one( prepareBuildQueue ).getQueueSnapshot();
                 will( returnValue( tasks ) );
-            }} );
+            }
+        } );
 
         assertTrue( overallQueue.isInPrepareBuildQueue( 1, "http://scm.root.address" ) );
         context.assertIsSatisfied();
@@ -539,8 +560,8 @@ public class DefaultOverallBuildQueueTes
     public void testRemoveProjectsFromPrepareBuildQueueByProjectGroupAndScmRootId()
         throws Exception
     {
-        final Task prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 
-                                                                    1, "Project Group A", "http://scm.root.address", 1 );
+        final Task prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger(
+            1, "test-user" ), 1, "Project Group A", "http://scm.root.address", 1 );
 
         final TaskQueue prepareBuildQueue = context.mock( TaskQueue.class, "prepare-build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
@@ -559,7 +580,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildQueue ) );
 
                 one( prepareBuildQueue ).remove( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.removeProjectFromPrepareBuildQueue( 1, 1 );
         context.assertIsSatisfied();
@@ -568,8 +590,8 @@ public class DefaultOverallBuildQueueTes
     public void testRemoveProjectsFromPrepareBuildQueueByProjectGroupAndScmRootAddress()
         throws Exception
     {
-        final Task prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger( 1, "test-user" ), 
-                                                                    1, "Project Group A", "http://scm.root.address", 1 );
+        final Task prepareBuildTask = new PrepareBuildProjectsTask( new HashMap<Integer, Integer>(), new BuildTrigger(
+            1, "test-user" ), 1, "Project Group A", "http://scm.root.address", 1 );
 
         final TaskQueue prepareBuildQueue = context.mock( TaskQueue.class, "prepare-build-queue" );
         final List<Task> tasks = new ArrayList<Task>();
@@ -588,7 +610,8 @@ public class DefaultOverallBuildQueueTes
                 will( returnValue( prepareBuildQueue ) );
 
                 one( prepareBuildQueue ).remove( prepareBuildTask );
-            }} );
+            }
+        } );
 
         overallQueue.removeProjectFromPrepareBuildQueue( 1, "http://scm.root.address" );
         context.assertIsSatisfied();

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddMaven2ProjectTest.java Mon Aug 13 04:29:09 2012
@@ -1,8 +1,5 @@
 package org.apache.maven.continuum;
 
-import java.io.File;
-import java.util.Collections;
-
 import org.apache.continuum.AbstractAddProjectTest;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -13,6 +10,9 @@ import org.apache.maven.continuum.projec
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+import java.util.Collections;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -31,9 +31,9 @@ import org.slf4j.LoggerFactory;
  * specific language governing permissions and limitations
  * under the License.
  */
+
 /**
  * @author olamy
- * @since 
  * @version $Id$
  */
 public class AddMaven2ProjectTest
@@ -44,7 +44,7 @@ public class AddMaven2ProjectTest
     protected BuildDefinitionTemplate bdt;
 
     protected BuildDefinition bd;
-    
+
     @Override
     protected void setUp()
         throws Exception
@@ -55,17 +55,17 @@ public class AddMaven2ProjectTest
         bd.setBuildFile( "pom.xml" );
         bd.setDescription( "my foo" );
         bd.setTemplate( true );
-        BuildDefinitionService bds = (BuildDefinitionService) lookup( BuildDefinitionService.class.getName(), "default" );
+        BuildDefinitionService bds = (BuildDefinitionService) lookup( BuildDefinitionService.class.getName(),
+                                                                      "default" );
         bd = bds.addBuildDefinition( bd );
-        
-        
+
         assertEquals( 5, bds.getAllBuildDefinitions().size() );
 
         bdt = new BuildDefinitionTemplate();
         bdt.setName( "bdt foo" );
-        
+
         bdt = bds.addBuildDefinitionTemplate( bdt );
-        
+
         bdt = bds.addBuildDefinitionInTemplate( bdt, bd, false );
 
         createLocalRepository();
@@ -84,16 +84,13 @@ public class AddMaven2ProjectTest
         pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
         // group created with the m2 default build def 
         assertEquals( 1, pg.getBuildDefinitions().size() );
-        
 
         File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-core/pom.xml" );
 
         assertTrue( rootPom.exists() );
         //String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
-                                                                                   rootPom.toURI().toURL()
-                                                                                       .toExternalForm(), pg.getId(),
-                                                                                       true, false, false, bdt.getId(), false );
+            rootPom.toURI().toURL().toExternalForm(), pg.getId(), true, false, false, bdt.getId(), false );
         assertNotNull( result );
 
         assertEquals( Collections.emptyList(), result.getErrors() );
@@ -109,7 +106,7 @@ public class AddMaven2ProjectTest
         assertEquals( 1, project.getBuildDefinitions().size() );
         assertEquals( "clean deploy", ( (BuildDefinition) project.getBuildDefinitions().get( 0 ) ).getGoals() );
     }
-    
+
     public void testAddProjectWithGroupCreationWithBuildDefTemplate()
         throws Exception
     {
@@ -120,9 +117,7 @@ public class AddMaven2ProjectTest
         assertTrue( rootPom.exists() );
 
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
-                                                                                   rootPom.toURI().toURL()
-                                                                                       .toExternalForm(), -1, true,
-                                                                                       false, true, bdt.getId(), false );
+            rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, bdt.getId(), false );
         assertNotNull( result );
 
         assertEquals( Collections.emptyList(), result.getErrors() );
@@ -134,7 +129,7 @@ public class AddMaven2ProjectTest
         log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
         // build def only at the group level du to group creation 
         assertEquals( 0, project.getBuildDefinitions().size() );
-        
+
         log.info( "all pg size " + getContinuum().getAllProjectGroups().size() );
         ProjectGroup pg = result.getProjectGroups().get( 0 );
 
@@ -145,9 +140,9 @@ public class AddMaven2ProjectTest
         log.info( " pg builddefs size " + pg.getBuildDefinitions().size() );
         log.info( "pg bd goals " + ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
         assertEquals( "clean deploy", ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
-        
-    }    
-    
+
+    }
+
     public void testAddProjectWithGroupCreationDefaultBuildDef()
         throws Exception
     {
@@ -158,9 +153,7 @@ public class AddMaven2ProjectTest
         assertTrue( rootPom.exists() );
 
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
-                                                                                   rootPom.toURI().toURL()
-                                                                                       .toExternalForm(), -1, true,
-                                                                                       false, true, -1, false );
+            rootPom.toURI().toURL().toExternalForm(), -1, true, false, true, -1, false );
         assertNotNull( result );
 
         assertEquals( Collections.emptyList(), result.getErrors() );
@@ -169,13 +162,13 @@ public class AddMaven2ProjectTest
 
         Project project = result.getProjects().get( 0 );
         assertNotNull( project );
-        
+
         assertNotNull( project );
         project = getContinuum().getProjectWithBuildDetails( project.getId() );
         log.info( "project buildDef list size : " + project.getBuildDefinitions().size() );
         // only build def at group level
         assertEquals( 0, project.getBuildDefinitions().size() );
-        
+
         log.info( "all pg size " + getContinuum().getAllProjectGroups().size() );
         ProjectGroup pg = result.getProjectGroups().get( 0 );
 
@@ -190,7 +183,7 @@ public class AddMaven2ProjectTest
         log.info( "pg bd goals " + ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
         assertEquals( "clean install", ( (BuildDefinition) pg.getBuildDefinitions().get( 0 ) ).getGoals() );
 
-    }       
+    }
 
     public void testAddProjectToExistingGroupDefaultBuildDef()
         throws Exception
@@ -208,9 +201,7 @@ public class AddMaven2ProjectTest
         assertTrue( rootPom.exists() );
         //String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
         ContinuumProjectBuildingResult result = getContinuum().addMavenTwoProject(
-                                                                                   rootPom.toURI().toURL()
-                                                                                       .toExternalForm(), pg.getId(),
-                                                                                       true, false, false, -1, false );
+            rootPom.toURI().toURL().toExternalForm(), pg.getId(), true, false, false, -1, false );
         assertNotNull( result );
 
         assertEquals( Collections.emptyList(), result.getErrors() );
@@ -226,11 +217,11 @@ public class AddMaven2ProjectTest
         pg = result.getProjectGroups().get( 0 );
 
         pg = getContinuum().getProjectGroupWithBuildDetails( pg.getId() );
-        
+
         assertEquals( "clean install", pg.getBuildDefinitions().get( 0 ).getGoals() );
     }
-    
-    
+
+
     private Continuum getContinuum()
         throws Exception
     {
@@ -247,7 +238,7 @@ public class AddMaven2ProjectTest
     protected String getSpringConfigLocation()
     {
         return "applicationContextSlf4jPlexusLogger.xml";
-    }    
-    
-    
+    }
+
+
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectTest.java Mon Aug 13 04:29:09 2012
@@ -28,19 +28,19 @@ import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.DefaultHandler;
 import org.mortbay.jetty.handler.ResourceHandler;
-import org.mortbay.jetty.nio.SelectChannelConnector;
 
 import java.util.Collections;
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
- * @since 12 juin 2008
  * @version $Id$
+ * @since 12 juin 2008
  */
 public class AddProjectTest
-        extends AbstractAddProjectTest {
+    extends AbstractAddProjectTest
+{
     static final String SCM_USERNAME = "test";
-    
+
     static final String SCM_PASSWORD = ";password";
 
     private Server server;
@@ -74,7 +74,7 @@ public class AddProjectTest
         Server server = new Server( 0 );
         ResourceHandler handler = new ResourceHandler();
         handler.setResourceBase( getTestFile( "src/test/resources" ).getAbsolutePath() );
-        server.setHandlers( new Handler[]{ handler, new DefaultHandler() } );
+        server.setHandlers( new Handler[]{handler, new DefaultHandler()} );
         server.start();
         return server;
     }
@@ -84,17 +84,18 @@ public class AddProjectTest
     {
         DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
 
-        ContinuumProjectBuildingResult result = continuum
-            .executeAddProjectsFromMetadataActivity( scmUrl, MavenTwoContinuumProjectBuilder.ID,
-                                                     getDefaultProjectGroup().getId(), false, true, false, -1, false,
-                                                     false );
+        ContinuumProjectBuildingResult result = continuum.executeAddProjectsFromMetadataActivity( scmUrl,
+                                                                                                  MavenTwoContinuumProjectBuilder.ID,
+                                                                                                  getDefaultProjectGroup().getId(),
+                                                                                                  false, true, false,
+                                                                                                  -1, false, false );
         assertEquals( Collections.emptyList(), result.getErrors() );
 
         assertEquals( 1, result.getProjects().size() );
-        
+
         // read the project from store
-        Project project = continuum.getProject( result.getProjects().get( 0 ).getId());
-        assertNull(  project.getScmUsername() );
+        Project project = continuum.getProject( result.getProjects().get( 0 ).getId() );
+        assertNull( project.getScmUsername() );
         assertNull( project.getScmPassword() );
         assertTrue( project.isScmUseCache() );
     }
@@ -104,10 +105,11 @@ public class AddProjectTest
     {
         DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
 
-        ContinuumProjectBuildingResult result = continuum
-            .executeAddProjectsFromMetadataActivity( scmUrl, MavenTwoContinuumProjectBuilder.ID,
-                                                     getDefaultProjectGroup().getId(), false, false, false, -1, false,
-                                                     false );
+        ContinuumProjectBuildingResult result = continuum.executeAddProjectsFromMetadataActivity( scmUrl,
+                                                                                                  MavenTwoContinuumProjectBuilder.ID,
+                                                                                                  getDefaultProjectGroup().getId(),
+                                                                                                  false, false, false,
+                                                                                                  -1, false, false );
         assertEquals( Collections.emptyList(), result.getErrors() );
 
         assertEquals( 1, result.getProjects().size() );
@@ -117,13 +119,13 @@ public class AddProjectTest
         assertEquals( SCM_USERNAME, project.getScmUsername() );
         assertEquals( SCM_PASSWORD, project.getScmPassword() );
         assertFalse( project.isScmUseCache() );
-    }    
-    
+    }
+
     public void testAntProjectScmUserNamePasswordNotStoring()
         throws Exception
     {
         DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
-        
+
         Project project = new Project();
         project.setName( "Sample Ant Project" );
         project.setVersion( "1.0" );
@@ -131,46 +133,44 @@ public class AddProjectTest
         project.setScmPassword( SCM_PASSWORD );
         project.setScmUrl( this.scmUrl );
         project.setScmUseCache( true );
-        
-        BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
-        
-        int projectId =
-            continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
-                                  getDefaultProjectGroup().getId(),
-                                  bdService.getDefaultAntBuildDefinitionTemplate().getId() );
-                
+
+        BuildDefinitionService bdService = (BuildDefinitionService) lookup( BuildDefinitionService.class.getName() );
+
+        int projectId = continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
+                                              getDefaultProjectGroup().getId(),
+                                              bdService.getDefaultAntBuildDefinitionTemplate().getId() );
+
         // read the project from store
         Project retrievedProject = continuum.getProject( projectId );
-        assertNull(  retrievedProject.getScmUsername() );
+        assertNull( retrievedProject.getScmUsername() );
         assertNull( retrievedProject.getScmPassword() );
         assertTrue( retrievedProject.isScmUseCache() );
     }
-    
+
     public void testAntProjectScmUserNamePasswordStoring()
         throws Exception
     {
         DefaultContinuum continuum = (DefaultContinuum) lookup( Continuum.ROLE );
-        
+
         Project project = new Project();
         project.setName( "Sample Ant Project" );
         project.setVersion( "1.0" );
         project.setScmUsername( SCM_USERNAME );
         project.setScmPassword( SCM_PASSWORD );
-        project.setScmUrl( scmUrl );        
+        project.setScmUrl( scmUrl );
         project.setScmUseCache( false );
-        
-        BuildDefinitionService bdService = ( BuildDefinitionService )lookup( BuildDefinitionService.class.getName() );
-        
-        int projectId =
-            continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
-                                  getDefaultProjectGroup().getId(),
-                                  bdService.getDefaultAntBuildDefinitionTemplate().getId() );
-               
+
+        BuildDefinitionService bdService = (BuildDefinitionService) lookup( BuildDefinitionService.class.getName() );
+
+        int projectId = continuum.addProject( project, ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR,
+                                              getDefaultProjectGroup().getId(),
+                                              bdService.getDefaultAntBuildDefinitionTemplate().getId() );
+
         // read the project from store
         Project retrievedProject = continuum.getProject( projectId );
         assertEquals( SCM_USERNAME, retrievedProject.getScmUsername() );
         assertEquals( SCM_PASSWORD, retrievedProject.getScmPassword() );
         assertFalse( retrievedProject.isScmUseCache() );
     }
-    
+
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java?rev=1372260&r1=1372259&r2=1372260&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/AddProjectToCheckoutQueueStub.java Mon Aug 13 04:29:09 2012
@@ -19,13 +19,12 @@ package org.apache.maven.continuum;
  * under the License.
  */
 
-import java.util.Map;
-
 import junit.framework.Assert;
-
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.core.action.CheckoutProjectContinuumAction;
 
+import java.util.Map;
+
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  */
@@ -35,11 +34,13 @@ public class AddProjectToCheckoutQueueSt
     @SuppressWarnings( "unchecked" )
     public void execute( Map context )
         throws Exception
-    {       
+    {
         getLogger().info( "Executing add-project-to-checkout-queue (stub for testing) action." );
-        
+
         // check if scm credentials were set in context (CONTINUUM-2466)
-        Assert.assertEquals( AddProjectTest.SCM_USERNAME, CheckoutProjectContinuumAction.getScmUsername( context, null ) );
-        Assert.assertEquals( AddProjectTest.SCM_PASSWORD, CheckoutProjectContinuumAction.getScmPassword( context, null ) );
+        Assert.assertEquals( AddProjectTest.SCM_USERNAME, CheckoutProjectContinuumAction.getScmUsername( context,
+                                                                                                         null ) );
+        Assert.assertEquals( AddProjectTest.SCM_PASSWORD, CheckoutProjectContinuumAction.getScmPassword( context,
+                                                                                                         null ) );
     }
 }



Mime
View raw message