continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r684085 [3/6] - in /continuum/trunk: ./ continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-base/continuum-configuration/ continuum-commons/ continuum-commons/src/mai...
Date Fri, 08 Aug 2008 20:48:17 GMT
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=684085&r1=684084&r2=684085&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 Fri Aug  8 13:48:14 2008
@@ -19,10 +19,12 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.DirectoryPurgeConfigurationDao;
+import org.apache.continuum.dao.LocalRepositoryDao;
+import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
-import org.apache.continuum.purge.ContinuumPurgeManager;
 import org.apache.continuum.purge.task.PurgeTask;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.codehaus.plexus.taskqueue.Task;
@@ -35,131 +37,146 @@
  */
 public class DefaultContinuumPurgeManagerTest
     extends AbstractContinuumTest
-{   
+{
+    private LocalRepositoryDao localRepositoryDao;
+
+    private DirectoryPurgeConfigurationDao directoryPurgeConfigurationDao;
+
+    private RepositoryPurgeConfigurationDao repositoryPurgeConfigurationDao;
+
     private ContinuumPurgeManager purgeManager;
-    
+
     private TaskQueue purgeQueue;
-    
+
     private RepositoryPurgeConfiguration repoPurge;
-    
+
     private DirectoryPurgeConfiguration dirPurge;
-    
-    private LocalRepository repository;
-    
+
+    @Override
     protected void setUp()
         throws Exception
     {
         super.setUp();
-        
+
+        localRepositoryDao = (LocalRepositoryDao) lookup( LocalRepositoryDao.class.getName() );
+
+        directoryPurgeConfigurationDao =
+            (DirectoryPurgeConfigurationDao) lookup( DirectoryPurgeConfigurationDao.class.getName() );
+
+        repositoryPurgeConfigurationDao =
+            (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class.getName() );
+
         purgeManager = (ContinuumPurgeManager) lookup( ContinuumPurgeManager.ROLE );
-        
+
         purgeQueue = (TaskQueue) lookup( TaskQueue.ROLE, "purge" );
-        
+
         setupDefaultPurgeConfigurations();
     }
-    
+
     public void testPurgingWithSinglePurgeConfiguration()
         throws Exception
     {
         purgeManager.purgeRepository( repoPurge );
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIsNull();
-        
+
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeRepository( repoPurge );
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIsNull();
     }
-    
+
     public void testPurgingWithMultiplePurgeConfiguration()
         throws Exception
     {
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeDirectory( dirPurge );
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIs( dirPurge.getId() );
         assertNextBuildIsNull();
-        
+
         for ( int i = 0; i < 5; i++ )
         {
             purgeManager.purgeRepository( repoPurge );
             purgeManager.purgeDirectory( dirPurge );
         }
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIs( dirPurge.getId() );
         assertNextBuildIsNull();
     }
-    
+
     public void testRemoveFromPurgeQueue()
         throws Exception
     {
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeDirectory( dirPurge );
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIs( dirPurge.getId() );
         assertNextBuildIsNull();
-     
+
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeDirectory( dirPurge );
         purgeManager.removeFromPurgeQueue( repoPurge.getId() );
-        
+
         assertNextBuildIs( dirPurge.getId() );
         assertNextBuildIsNull();
-        
+
         purgeManager.purgeRepository( repoPurge );
         purgeManager.purgeDirectory( dirPurge );
         purgeManager.removeFromPurgeQueue( dirPurge.getId() );
-        
+
         assertNextBuildIs( repoPurge.getId() );
         assertNextBuildIsNull();
     }
-    
+
     private void setupDefaultPurgeConfigurations()
         throws Exception
     {
-        repository = new LocalRepository();
+        LocalRepository repository = new LocalRepository();
         repository.setName( "defaultRepo" );
         repository.setLocation( getTestFile( "target/default-repository" ).getAbsolutePath() );
-        repository = getStore().addLocalRepository( repository );
-        
+        repository = localRepositoryDao.addLocalRepository( repository );
+
         repoPurge = new RepositoryPurgeConfiguration();
         repoPurge.setRepository( repository );
-        repoPurge = getStore().addRepositoryPurgeConfiguration( repoPurge );
-        
+        repoPurge = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
+
         dirPurge = new DirectoryPurgeConfiguration();
         dirPurge.setDirectoryType( "releases" );
         dirPurge.setLocation( getTestFile( "target/working-directory" ).getAbsolutePath() );
-        dirPurge = getStore().addDirectoryPurgeConfiguration( dirPurge );
+        dirPurge = directoryPurgeConfigurationDao.addDirectoryPurgeConfiguration( dirPurge );
     }
-    
+
     private void assertNextBuildIs( int expectedPurgeConfigId )
         throws Exception
     {
         Task task = purgeQueue.take();
-    
+
         assertEquals( PurgeTask.class.getName(), task.getClass().getName() );
-    
+
         PurgeTask purgeTask = (PurgeTask) task;
-    
-        assertEquals( "Didn't get the expected purge config id.", expectedPurgeConfigId, purgeTask.getPurgeConfigurationId() );
+
+        assertEquals( "Didn't get the expected purge config id.", expectedPurgeConfigId,
+                      purgeTask.getPurgeConfigurationId() );
     }
-    
+
     private void assertNextBuildIsNull()
         throws Exception
     {
         Task task = purgeQueue.take();
-    
+
         if ( task != null )
         {
-            fail( "Got a non-null purge task returned. Purge Config id: " + ( (PurgeTask) task ).getPurgeConfigurationId() );
+            fail( "Got a non-null purge task returned. Purge Config id: " +
+                ( (PurgeTask) task ).getPurgeConfigurationId() );
         }
     }
 }
\ No newline at end of file

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=684085&r1=684084&r2=684085&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 Fri Aug  8 13:48:14 2008
@@ -19,14 +19,14 @@
  * under the License.
  */
 
-import java.util.List;
-
+import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
-import org.apache.continuum.repository.RepositoryService;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 
+import java.util.List;
+
 /**
  * @author Maria Catherine Tan
  * @version $Id$
@@ -35,38 +35,42 @@
 public class DefaultRepositoryServiceTest
     extends AbstractContinuumTest
 {
+    private RepositoryPurgeConfigurationDao repositoryPurgeConfigurationDao;
+
     private RepositoryService repositoryService;
-    
+
     private LocalRepository repository;
-    
-    private RepositoryPurgeConfiguration repoConfig;
-    
+
+    @Override
     protected void setUp()
         throws Exception
     {
         super.setUp();
-        
+
+        repositoryPurgeConfigurationDao =
+            (RepositoryPurgeConfigurationDao) lookup( RepositoryPurgeConfigurationDao.class.getName() );
+
         repositoryService = (RepositoryService) lookup( RepositoryService.ROLE );
-        
+
         setupDefaultRepository();
     }
-    
+
     public void testRemoveRepository()
         throws Exception
     {
         repositoryService.removeLocalRepository( repository.getId() );
-        
+
         List<LocalRepository> repositories = repositoryService.getAllLocalRepositories();
         assertEquals( "check # repositories", 0, repositories.size() );
-        
+
         ProjectGroup group = getDefaultProjectGroup();
         assertNull( group.getLocalRepository() );
-        
-        List<RepositoryPurgeConfiguration> purgeConfigs = 
-            getStore().getRepositoryPurgeConfigurationsByLocalRepository( repository.getId() );
+
+        List<RepositoryPurgeConfiguration> purgeConfigs =
+            repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsByLocalRepository( repository.getId() );
         assertEquals( "check # purge configs of repository", 0, purgeConfigs.size() );
     }
-    
+
     private void setupDefaultRepository()
         throws Exception
     {
@@ -74,25 +78,25 @@
         repository.setName( "DefaultRepo" );
         repository.setLocation( getTestFile( "target/default-repo" ).getAbsolutePath() );
         repository = repositoryService.addLocalRepository( repository );
-        
+
         ProjectGroup group = getDefaultProjectGroup();
         group.setLocalRepository( repository );
-        getStore().updateProjectGroup( group );
-        
-        repoConfig = new RepositoryPurgeConfiguration();
+        getProjectGroupDao().updateProjectGroup( group );
+
+        RepositoryPurgeConfiguration repoConfig = new RepositoryPurgeConfiguration();
         repoConfig.setRepository( repository );
-        repoConfig = getStore().addRepositoryPurgeConfiguration( repoConfig );
-        
+        repoConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoConfig );
+
         List<LocalRepository> repositories = repositoryService.getAllLocalRepositories();
         assertEquals( "check # repositories", 1, repositories.size() );
         assertTrue( "check if repository was added", repositories.contains( repository ) );
-        
+
         ProjectGroup retrievedGroup = getDefaultProjectGroup();
         assertNotNull( retrievedGroup.getLocalRepository() );
         assertEquals( "check if repository is the same", repository, retrievedGroup.getLocalRepository() );
-        
-        List<RepositoryPurgeConfiguration> purgeConfigs = 
-            getStore().getRepositoryPurgeConfigurationsByLocalRepository( repository.getId() );
+
+        List<RepositoryPurgeConfiguration> purgeConfigs =
+            repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsByLocalRepository( repository.getId() );
         assertEquals( "check # purge configs found", 1, purgeConfigs.size() );
         assertEquals( "check if purge configuration is the same", repoConfig, purgeConfigs.get( 0 ) );
     }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java Fri Aug  8 13:48:14 2008
@@ -19,13 +19,8 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
+import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.repository.RepositoryService;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -39,6 +34,13 @@
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
 
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -69,9 +71,9 @@
     {
         Continuum continuum = (Continuum) lookup( Continuum.ROLE );
 
-        int projectCount = getStore().getAllProjectsByName().size();
+        int projectCount = getProjectDao().getAllProjectsByName().size();
 
-        int projectGroupCount = getStore().getAllProjectGroupsWithProjects().size();
+        int projectGroupCount = getProjectGroupDao().getAllProjectGroupsWithProjects().size();
 
         File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-notifiers/pom.xml" );
 
@@ -85,18 +87,19 @@
 
         assertEquals( "result.projectGroups.size", 1, result.getProjectGroups().size() );
 
-        System.err.println( "number of projects: " + getStore().getAllProjectsByName().size() );
+        System.err.println( "number of projects: " + getProjectDao().getAllProjectsByName().size() );
 
-        System.err.println( "number of project groups: " + getStore().getAllProjectGroupsWithProjects().size() );
+        System.err.println(
+            "number of project groups: " + getProjectGroupDao().getAllProjectGroupsWithProjects().size() );
 
-        assertEquals( "Total project count", projectCount + 3, getStore().getAllProjectsByName().size() );
+        assertEquals( "Total project count", projectCount + 3, getProjectDao().getAllProjectsByName().size() );
 
         assertEquals( "Total project group count.", projectGroupCount + 1,
-                      getStore().getAllProjectGroupsWithProjects().size() );
+                      getProjectGroupDao().getAllProjectGroupsWithProjects().size() );
 
         Map projects = new HashMap();
 
-        for ( Iterator i = getStore().getAllProjectsByName().iterator(); i.hasNext(); )
+        for ( Iterator i = getProjectDao().getAllProjectsByName().iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
 
@@ -104,7 +107,7 @@
 
             // validate project in project group
             assertTrue( "project not in project group",
-                        getStore().getProjectGroupByProjectId( project.getId() ) != null );
+                        getProjectGroupDao().getProjectGroupByProjectId( project.getId() ) != null );
         }
 
         assertTrue( "no irc notifier", projects.containsKey( "Continuum IRC Notifier" ) );
@@ -169,9 +172,9 @@
         // reattach
         project = continuum.getProject( project.getId() );
 
-        ProjectGroup projectGroup = getStore().getProjectGroupByProjectId( project.getId() );
+        ProjectGroup projectGroup = getProjectGroupDao().getProjectGroupByProjectId( project.getId() );
 
-        projectGroup = getStore().getProjectGroupWithBuildDetailsByProjectGroupId( projectGroup.getId() );
+        projectGroup = getProjectGroupDao().getProjectGroupWithBuildDetailsByProjectGroupId( projectGroup.getId() );
 
         List buildDefs = projectGroup.getBuildDefinitions();
 
@@ -198,7 +201,7 @@
         nbd.setGoals( "clean" );
         nbd.setArguments( "" );
         nbd.setDefaultForProject( true );
-        nbd.setSchedule( getStore().getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME ) );
+        nbd.setSchedule( getScheduleDao().getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME ) );
 
         continuum.addBuildDefinitionToProject( project.getId(), nbd );
 
@@ -350,9 +353,11 @@
 
         Project project = (Project) projects.get( 0 );
 
-        assertTrue( "project missing from the checkout queue", continuum.removeProjectFromCheckoutQueue( project.getId() ) );
+        assertTrue( "project missing from the checkout queue",
+                    continuum.removeProjectFromCheckoutQueue( project.getId() ) );
 
-        assertFalse( "project still exist on the checkout queue", continuum.removeProjectFromCheckoutQueue( project.getId() ) );
+        assertFalse( "project still exist on the checkout queue",
+                     continuum.removeProjectFromCheckoutQueue( project.getId() ) );
     }
 
     public void testAddAntProjectWithdefaultBuildDef()
@@ -367,11 +372,11 @@
         assertEquals( 1, continuum.getProjectGroupWithProjects( defaultProjectGroup.getId() ).getProjects().size() );
         project = continuum.getProjectWithAllDetails( projectId );
         assertNotNull( project );
-        
+
         BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
         assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
         assertEquals( 5, service.getAllBuildDefinitions().size() );
-        
+
         BuildDefinition buildDef = (BuildDefinition) service.getDefaultAntBuildDefinitionTemplate()
             .getBuildDefinitions().get( 0 );
         buildDef = service.cloneBuildDefinition( buildDef );
@@ -382,7 +387,7 @@
         assertEquals( 4, service.getAllBuildDefinitionTemplate().size() );
         assertEquals( 6, service.getAllBuildDefinitions().size() );
     }
-    
+
     public void testRemoveProjectGroupWithRepository()
         throws Exception
     {
@@ -426,6 +431,6 @@
     {
         return (Continuum) lookup( Continuum.ROLE );
     }
-    
+
 
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java Fri Aug  8 13:48:14 2008
@@ -29,7 +29,6 @@
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.TaskQueue;
@@ -53,8 +52,6 @@
 
     private TaskQueueExecutor taskQueueExecutor;
 
-    private ContinuumStore continuumStore;
-
     private ActionManager actionManager;
 
     public void setUp()
@@ -71,8 +68,6 @@
 
             taskQueueExecutor = (TaskQueueExecutor) lookup( TaskQueueExecutor.ROLE, "build-project" );
 
-            continuumStore = (ContinuumStore) lookup( ContinuumStore.ROLE, "jdo" );
-
             actionManager = (ActionManager) lookup( ActionManager.ROLE );
         }
         catch ( Exception e )
@@ -242,7 +237,7 @@
 
         int projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext );
 
-        projectGroup = continuumStore.getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
+        projectGroup = getProjectGroupDao().getProjectGroupWithBuildDetailsByProjectGroupId( projectGroupId );
 
         project = (Project) projectGroup.getProjects().get( 0 );
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java Fri Aug  8 13:48:14 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildDefinitionDao;
+import org.apache.continuum.dao.BuildResultDao;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -48,27 +50,31 @@
     {
         super.setUp();
 
+        BuildDefinitionDao buildDefinitionDao = (BuildDefinitionDao) lookup( BuildDefinitionDao.class.getName() );
+
+        BuildResultDao buildResultDao = (BuildResultDao) lookup( BuildResultDao.class.getName() );
+
         Project project1 = createProject( "project1" );
         BuildDefinition bd1 = createBuildDefinition();
         project1.addBuildDefinition( bd1 );
         project1.setState( ContinuumProjectState.OK );
-        projectId1 = addProject( getStore(), project1 ).getId();
-        buildDefinitionId1 = getStore().getDefaultBuildDefinition( projectId1 ).getId();
-        project1 = getStore().getProject( projectId1 );
+        projectId1 = addProject( project1 ).getId();
+        buildDefinitionId1 = buildDefinitionDao.getDefaultBuildDefinition( projectId1 ).getId();
+        project1 = getProjectDao().getProject( projectId1 );
         BuildResult buildResult1 = new BuildResult();
         buildResult1.setStartTime( Calendar.getInstance().getTimeInMillis() );
         buildResult1.setEndTime( Calendar.getInstance().getTimeInMillis() );
         buildResult1.setState( ContinuumProjectState.OK );
         buildResult1.setSuccess( true );
         buildResult1.setBuildDefinition( bd1 );
-        getStore().addBuildResult( project1, buildResult1 );
+        buildResultDao.addBuildResult( project1, buildResult1 );
         BuildResult buildResult2 = new BuildResult();
         buildResult2.setStartTime( Calendar.getInstance().getTimeInMillis() - 7200000 );
         buildResult2.setEndTime( Calendar.getInstance().getTimeInMillis() - 7200000 );
         buildResult2.setSuccess( true );
         buildResult2.setState( ContinuumProjectState.OK );
         buildResult2.setBuildDefinition( bd1 );
-        getStore().addBuildResult( project1, buildResult2 );
+        buildResultDao.addBuildResult( project1, buildResult2 );
 
         Project project2 = createProject( "project2" );
         ProjectDependency dep1 = new ProjectDependency();
@@ -84,8 +90,8 @@
         BuildDefinition bd2 = createBuildDefinition();
         project2.addBuildDefinition( bd2 );
         project2.setState( ContinuumProjectState.OK );
-        projectId2 = addProject( getStore(), project2 ).getId();
-        buildDefinitionId2 = getStore().getDefaultBuildDefinition( projectId2 ).getId();
+        projectId2 = addProject( project2 ).getId();
+        buildDefinitionId2 = buildDefinitionDao.getDefaultBuildDefinition( projectId2 ).getId();
 
         controller = (DefaultBuildController) lookup( BuildController.ROLE );
     }
@@ -140,13 +146,13 @@
     public void testWithNewProjects()
         throws Exception
     {
-        Project p1 = getStore().getProject( projectId1 );
+        Project p1 = getProjectDao().getProject( projectId1 );
         p1.setState( ContinuumProjectState.NEW );
-        getStore().updateProject( p1 );
+        getProjectDao().updateProject( p1 );
 
-        Project p2 = getStore().getProject( projectId2 );
+        Project p2 = getProjectDao().getProject( projectId2 );
         p2.setState( ContinuumProjectState.NEW );
-        getStore().updateProject( p2 );
+        getProjectDao().updateProject( p2 );
 
         BuildContext context = getContext();
         controller.checkProjectDependencies( context );

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/builddefinition/DefaultBuildDefinitionServiceTest.java Fri Aug  8 13:48:14 2008
@@ -18,24 +18,24 @@
  */
 package org.apache.maven.continuum.builddefinition;
 
-import java.util.List;
-
 import org.apache.log4j.Logger;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildDefinitionTemplate;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.continuum.dao.DaoUtils;
+
+import java.util.List;
 
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
- * @since 15 sept. 07
  * @version $Id$
+ * @since 15 sept. 07
  */
 public class DefaultBuildDefinitionServiceTest
     extends AbstractContinuumTest
 {
-    
     private Logger logger = Logger.getLogger( getClass() );
 
     private ProjectGroup projectGroup;
@@ -43,25 +43,26 @@
     private Project project;
 
     private BuildDefinition buildDefinition;
-    
+
     private BuildDefinitionTemplate buildDefinitionTemplate;
 
     protected void setUp()
         throws Exception
     {
         super.setUp();
-        getStore().eraseDatabase();
+        DaoUtils daoUtils = (DaoUtils) lookup( DaoUtils.class.getName() );
+        daoUtils.eraseDatabase();
 
         projectGroup = new ProjectGroup();
         projectGroup.setName( "test" );
-        projectGroup = getStore().addProjectGroup( projectGroup );
+        projectGroup = getProjectGroupDao().addProjectGroup( projectGroup );
 
         project = new Project();
         project.setGroupId( "foo" );
         project.setArtifactId( "bar" );
         project.setVersion( "0.1-alpha-1-SNAPSHOT" );
         projectGroup.addProject( project );
-        getStore().updateProjectGroup( projectGroup );
+        getProjectGroupDao().updateProjectGroup( projectGroup );
 
         buildDefinition = new BuildDefinition();
         buildDefinition.setTemplate( true );
@@ -70,13 +71,13 @@
         buildDefinition.setBuildFile( "pom.xml" );
         buildDefinition.setDescription( "desc template" );
         buildDefinition = getBuildDefinitionService().addBuildDefinition( buildDefinition );
-        
+
         buildDefinitionTemplate = new BuildDefinitionTemplate();
         buildDefinitionTemplate.setName( "test" );
         buildDefinitionTemplate = getBuildDefinitionService().addBuildDefinitionTemplate( buildDefinitionTemplate );
-        buildDefinitionTemplate = getBuildDefinitionService().addBuildDefinitionInTemplate( buildDefinitionTemplate,
-                                                                                            buildDefinition, false );
-        
+        buildDefinitionTemplate =
+            getBuildDefinitionService().addBuildDefinitionInTemplate( buildDefinitionTemplate, buildDefinition, false );
+
 
     }
 
@@ -94,9 +95,9 @@
             List<BuildDefinitionTemplate> templates = getBuildDefinitionService().getAllBuildDefinitionTemplate();
             assertEquals( 5, templates.size() );
             assertEquals( 5, getBuildDefinitionService().getAllBuildDefinitions().size() );
-            
+
             getBuildDefinitionService().addTemplateInProject( buildDefinitionTemplate.getId(), project );
-            project = getStore().getProjectWithAllDetails( project.getId() );
+            project = getProjectDao().getProjectWithAllDetails( project.getId() );
             templates = getBuildDefinitionService().getAllBuildDefinitionTemplate();
             assertEquals( 1, project.getBuildDefinitions().size() );
             assertEquals( 5, templates.size() );
@@ -105,7 +106,7 @@
 
             getBuildDefinitionService().addTemplateInProject( buildDefinitionTemplate.getId(), project );
 
-            project = getStore().getProjectWithAllDetails( project.getId() );
+            project = getProjectDao().getProjectWithAllDetails( project.getId() );
             templates = getBuildDefinitionService().getAllBuildDefinitionTemplate();
             assertEquals( 2, project.getBuildDefinitions().size() );
             assertEquals( 5, templates.size() );
@@ -119,8 +120,8 @@
             throw e;
         }
     }
-   
-    
+
+
     public void testGetDefaultBuildDef()
         throws Exception
     {
@@ -137,9 +138,9 @@
         assertNotNull( bd );
         assertEquals( "pom.xml", bd.getBuildFile() );
         assertEquals( "clean install", bd.getGoals() );
-    }    
-    
-    
+    }
+
+
     public void testAddBuildDefinitionTemplate()
         throws Exception
     {
@@ -165,6 +166,6 @@
         assertEquals( 0, template.getBuildDefinitions().size() );
         all = getBuildDefinitionService().getAllBuildDefinitions();
         assertEquals( 5, all.size() );
-        
+
     }
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java Fri Aug  8 13:48:14 2008
@@ -45,7 +45,7 @@
     public void testTestTheQueueWithASingleProject()
         throws Exception
     {
-        Project project = addProject( getStore(), "Build Queue Project 1" );
+        Project project = addProject( "Build Queue Project 1" );
 
         int projectId = project.getId();
 
@@ -70,9 +70,9 @@
     public void testTheQueueWithMultipleProjects()
         throws Exception
     {
-        int projectId1 = addProject( getStore(), "Build Queue Project 2" ).getId();
+        int projectId1 = addProject( "Build Queue Project 2" ).getId();
 
-        int projectId2 = addProject( getStore(), "Build Queue Project 3" ).getId();
+        int projectId2 = addProject( "Build Queue Project 3" ).getId();
 
         buildProject( projectId1, ContinuumProjectState.TRIGGER_SCHEDULED );
 
@@ -101,7 +101,7 @@
     {
         String name = "Build Queue Project 4";
 
-        int projectId = addProject( getStore(), name ).getId();
+        int projectId = addProject( name ).getId();
 
         buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializerTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializerTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializerTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializerTest.java Fri Aug  8 13:48:14 2008
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.DaoUtils;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.Schedule;
-import org.apache.maven.continuum.store.ContinuumStore;
 
 /**
  * @author <a href="mailto:olamy@codehaus.org">olamy</a>
@@ -32,27 +32,21 @@
 public class DefaultContinuumInitializerTest
     extends AbstractContinuumTest
 {
-
     protected void setUp()
         throws Exception
     {
         super.setUp();
-        getContinuumStore().eraseDatabase();
+        DaoUtils daoUtils = (DaoUtils) lookup( DaoUtils.class.getName() );
+        daoUtils.eraseDatabase();
         ContinuumInitializer continuumInitializer =
             (ContinuumInitializer) lookup( ContinuumInitializer.ROLE, "default" );
         continuumInitializer.initialize();
     }
 
-    public ContinuumStore getContinuumStore()
-        throws Exception
-    {
-        return (ContinuumStore) lookup( ContinuumStore.ROLE, "jdo" );
-    }
-
     public void testDefaultSchedule()
         throws Exception
     {
-        Schedule schedule = getContinuumStore().getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
+        Schedule schedule = getScheduleDao().getScheduleByName( ConfigurationService.DEFAULT_SCHEDULE_NAME );
         assertNotNull( schedule );
     }
 

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/DefaultInstallationServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/DefaultInstallationServiceTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/DefaultInstallationServiceTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/installation/DefaultInstallationServiceTest.java Fri Aug  8 13:48:14 2008
@@ -19,8 +19,7 @@
  * under the License.
  */
 
-import java.util.List;
-
+import org.apache.continuum.dao.DaoUtils;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.execution.ExecutorConfigurator;
 import org.apache.maven.continuum.model.system.Installation;
@@ -28,6 +27,8 @@
 import org.apache.maven.continuum.profile.ProfileService;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.util.List;
+
 /**
  * @author <a href="mailto:olamy@codehaus.org">olamy</a>
  * @version $Id$
@@ -46,7 +47,8 @@
         throws Exception
     {
         super.setUp();
-        getStore().eraseDatabase();
+        DaoUtils daoUtils = (DaoUtils) lookup( DaoUtils.class.getName() );
+        daoUtils.eraseDatabase();
         /*if ( getInstallationService().getAllInstallations().isEmpty() )
         {
             defaultInstallation = createDefault();
@@ -95,7 +97,7 @@
         assertEquals( "bar", getted.getVarValue() );
         assertEquals( 1, getInstallationService().getAllInstallations().size() );
     }
-    
+
     public void testAddDuplicateInstallation()
         throws Exception
     {
@@ -114,7 +116,7 @@
             // we must be here
         }
         assertEquals( 1, getInstallationService().getAllInstallations().size() );
-    }    
+    }
 
     public void testRemove()
         throws Exception
@@ -214,9 +216,9 @@
         assertEquals( "automaticJdk", profile.getName() );
         Installation jdk = profile.getJdk();
         assertNotNull( jdk );
-        assertEquals("automaticJdk", jdk.getName());
+        assertEquals( "automaticJdk", jdk.getName() );
     }
-    
+
     public void testUpdateName()
         throws Exception
     {
@@ -226,13 +228,13 @@
         installation.setVarName( "automaticvarName" );
         installation.setVarValue( "automaticvarValue" );
         installation = getInstallationService().add( installation, true );
-        
+
         installation.setName( "new name here" );
         getInstallationService().update( installation );
-        
+
         Installation getted = getInstallationService().getInstallation( installation.getInstallationId() );
         assertEquals( "new name here", getted.getName() );
-        
+
 
     }
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.java Fri Aug  8 13:48:14 2008
@@ -19,11 +19,11 @@
  * under the License.
  */
 
+import org.apache.continuum.dao.BuildResultDao;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStore;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -32,17 +32,25 @@
 public class ContinuumNotificationDispatcherTest
     extends AbstractContinuumTest
 {
+    private BuildResultDao buildResultDao;
+
+    @Override
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+        buildResultDao = (BuildResultDao) lookup( BuildResultDao.class.getName() );
+    }
+
     public void testNotificationDispatcher()
         throws Exception
     {
         ContinuumNotificationDispatcher notificationDispatcher =
             (ContinuumNotificationDispatcher) lookup( ContinuumNotificationDispatcher.ROLE );
 
-        ContinuumStore store = getStore();
-
-        Project project = addProject( store, "Notification Dispatcher Test Project" );
+        Project project = addProject( "Notification Dispatcher Test Project" );
 
-        project = store.getProjectWithBuildDetails( project.getId() );
+        project = getProjectDao().getProjectWithBuildDetails( project.getId() );
 
         BuildResult build = new BuildResult();
 
@@ -52,9 +60,9 @@
 
         build.setTrigger( ContinuumProjectState.TRIGGER_SCHEDULED );
 
-        store.addBuildResult( project, build );
+        buildResultDao.addBuildResult( project, build );
 
-        build = store.getBuildResult( build.getId() );
+        build = buildResultDao.getBuildResult( build.getId() );
 
         notificationDispatcher.buildComplete( project, null, build );
     }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/DefaultProfileServiceTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/DefaultProfileServiceTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/DefaultProfileServiceTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/profile/DefaultProfileServiceTest.java Fri Aug  8 13:48:14 2008
@@ -1,11 +1,10 @@
 package org.apache.maven.continuum.profile;
 
+import org.apache.continuum.dao.DaoUtils;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.util.List;
 
@@ -36,7 +35,7 @@
 public class DefaultProfileServiceTest
     extends AbstractContinuumTest
 {
-    
+
     Installation jdk1;
 
     String jdk1Name = "jdk1";
@@ -73,7 +72,8 @@
         throws Exception
     {
         super.setUp();
-        getStore().eraseDatabase();
+        DaoUtils daoUtils = (DaoUtils) lookup( DaoUtils.class.getName() );
+        daoUtils.eraseDatabase();
 
         jdk1 = new Installation();
         jdk1.setType( InstallationService.JDK_TYPE );
@@ -174,8 +174,8 @@
             // we must be here
         }
         assertEquals( 3, getProfileService().getAllProfiles().size() );
-    }    
-    
+    }
+
     public void testDeleteProfile()
         throws Exception
     {
@@ -210,7 +210,7 @@
         assertNotNull( getted );
         assertEquals( newName, getted.getName() );
     }
-    
+
     public void testupdateProfileDuplicateName()
         throws Exception
     {
@@ -230,7 +230,7 @@
         Profile getted = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNotNull( getted );
         assertEquals( jdk1mvn205Name, getted.getName() );
-    }    
+    }
 
     public void testsetJdkInProfile()
         throws Exception
@@ -275,7 +275,7 @@
         InstallationService installationService = (InstallationService) lookup( InstallationService.ROLE, "default" );
         installationService.delete( jdk2 );
     }
-    
+
     public void testRemoveEnvVarFromProfile()
         throws Exception
     {
@@ -287,24 +287,24 @@
         profile = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNotNull( profile.getJdk() );
         assertEquals( 2, profile.getEnvironmentVariables().size() );
-        
+
         getProfileService().removeInstallationFromProfile( profile, mvnOpts1 );
-        
+
         profile = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNotNull( profile.getJdk() );
         assertEquals( 1, profile.getEnvironmentVariables().size() );
-        
+
         getProfileService().removeInstallationFromProfile( profile, jdk2 );
-        
+
         profile = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNull( profile.getJdk() );
         assertEquals( 1, profile.getEnvironmentVariables().size() );
-        
+
         getProfileService().removeInstallationFromProfile( profile, mvnOpts2 );
         profile = getProfileService().getProfile( jdk1mvn205.getId() );
         assertNull( profile.getJdk() );
         assertEquals( 0, profile.getEnvironmentVariables().size() );
     }
-    
+
 
 }

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java (original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java Fri Aug  8 13:48:14 2008
@@ -19,12 +19,6 @@
  * under the License.
  */
 
-import java.io.File;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
 import org.apache.log4j.Logger;
 import org.apache.maven.continuum.AbstractContinuumTest;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -37,9 +31,14 @@
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -47,7 +46,7 @@
 public class MavenTwoContinuumProjectBuilderTest
     extends AbstractContinuumTest
 {
-    
+
     private Logger logger = Logger.getLogger( getClass() );
 
     /*
@@ -186,10 +185,8 @@
 
         URL url = getClass().getClassLoader().getResource( "projects/continuum/pom.xml" );
 
-
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata( url, null, null );
 
-
         assertNotNull( result );
 
         // ----------------------------------------------------------------------
@@ -343,8 +340,7 @@
     public void testCreateProjectWithoutModules()
         throws Exception
     {
-        
-        
+
         ContinuumProjectBuilder projectBuilder =
             (ContinuumProjectBuilder) lookup( ContinuumProjectBuilder.ROLE, MavenTwoContinuumProjectBuilder.ID );
 
@@ -361,9 +357,9 @@
         bd.setBuildFile( "pom.xml" );
 
         bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR );
-        
+
         BuildDefinitionService service = (BuildDefinitionService) lookup( BuildDefinitionService.class );
-        
+
         bd = service.addBuildDefinition( bd );
         BuildDefinitionTemplate bdt = new BuildDefinitionTemplate();
         bdt.setName( "maven2" );
@@ -372,19 +368,18 @@
         assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
         logger.debug( "templates number " + service.getAllBuildDefinitionTemplate().size() );
 
-        ContinuumStore store = (ContinuumStore) lookup( ContinuumStore.class , "jdo" );
-        logger.debug( "projectGroups number " + store.getAllProjectGroups().size() );        
-        
+        logger.debug( "projectGroups number " + getProjectGroupDao().getAllProjectGroups().size() );
+
         int all = service.getAllBuildDefinitions().size();
-        
+
         ContinuumProjectBuildingResult result;
-        
+
         result = projectBuilder.buildProjectsFromMetadata( url, null, null, false, bdt );
 
         assertEquals( 5, service.getAllBuildDefinitionTemplate().size() );
 
         assertEquals( all + 1, service.getAllBuildDefinitions().size() );
-        
+
         assertNotNull( result );
 
         assertNotNull( result.getErrors() );
@@ -435,7 +430,7 @@
 
         assertFalse( true );
     }
-    
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml (original)
+++ continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml Fri Aug  8 13:48:14 2008
@@ -33,8 +33,10 @@
           <role>org.codehaus.plexus.velocity.VelocityComponent</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-          <role-hint>jdo</role-hint>
+          <role>org.apache.continuum.dao.ProjectDao</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.continuum.dao.BuildResultDao</role>
         </requirement>
         <requirement>
           <role>org.codehaus.plexus.mailsender.MailSender</role>

Modified: continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml (original)
+++ continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml Fri Aug  8 13:48:14 2008
@@ -34,8 +34,10 @@
           <role>org.codehaus.plexus.velocity.VelocityComponent</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-          <role-hint>jdo</role-hint>
+          <role>org.apache.continuum.dao.ProjectDao</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.continuum.dao.BuildResultDao</role>
         </requirement>
         <requirement>
           <role>org.codehaus.plexus.mailsender.MailSender</role>

Modified: continuum/trunk/continuum-data-management/data-management-cli/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-cli/pom.xml?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-cli/pom.xml (original)
+++ continuum/trunk/continuum-data-management/data-management-cli/pom.xml Fri Aug  8 13:48:14 2008
@@ -58,6 +58,10 @@
       <artifactId>plexus-jdo2</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+    </dependency>      
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
     </dependency>

Modified: continuum/trunk/continuum-data-management/data-management-jdo/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-jdo/pom.xml (original)
+++ continuum/trunk/continuum-data-management/data-management-jdo/pom.xml Fri Aug  8 13:48:14 2008
@@ -107,6 +107,11 @@
       <artifactId>jdom</artifactId>
       <version>1.0</version>
       <scope>test</scope>
-    </dependency>      
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 </project>

Modified: continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java (original)
+++ continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDataManagementTool.java Fri Aug  8 13:48:14 2008
@@ -1,24 +1,15 @@
 package org.apache.maven.continuum.management;
 
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
+import org.apache.continuum.dao.DaoUtils;
+import org.apache.continuum.dao.DirectoryPurgeConfigurationDao;
+import org.apache.continuum.dao.InstallationDao;
+import org.apache.continuum.dao.LocalRepositoryDao;
+import org.apache.continuum.dao.ProfileDao;
+import org.apache.continuum.dao.ProjectGroupDao;
+import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
+import org.apache.continuum.dao.ScheduleDao;
+import org.apache.continuum.dao.SystemConfigurationDao;
+import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.ContinuumDatabase;
@@ -29,7 +20,6 @@
 import org.apache.maven.continuum.model.project.io.stax.ContinuumStaxWriter;
 import org.apache.maven.continuum.model.system.Installation;
 import org.apache.maven.continuum.model.system.Profile;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.jdo.ConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.PlexusJdoUtils;
@@ -63,9 +53,49 @@
     implements DataManagementTool
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private DaoUtils daoUtils;
+
+    /**
+     * @plexus.requirement
+     */
+    private LocalRepositoryDao localRepositoryDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private DirectoryPurgeConfigurationDao directoryPurgeConfigurationDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private RepositoryPurgeConfigurationDao repositoryPurgeConfigurationDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private InstallationDao installationDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ProfileDao profileDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ProjectGroupDao projectGroupDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private ScheduleDao scheduleDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private SystemConfigurationDao systemConfigurationDao;
 
     protected static final String BUILDS_XML = "builds.xml";
 
@@ -80,7 +110,7 @@
         ContinuumDatabase database = new ContinuumDatabase();
         try
         {
-            database.setSystemConfiguration( store.getSystemConfiguration() );
+            database.setSystemConfiguration( systemConfigurationDao.getSystemConfiguration() );
         }
         catch ( ContinuumStoreException e )
         {
@@ -88,23 +118,24 @@
         }
 
         // TODO: need these to lazy load to conserve memory while we stream out the model
-        Collection projectGroups = store.getAllProjectGroupsWithTheLot();
+        Collection projectGroups = projectGroupDao.getAllProjectGroupsWithTheLot();
         database.setProjectGroups( new ArrayList( projectGroups ) );
         try
         {
-            database.setInstallations( store.getAllInstallations() );
+            database.setInstallations( installationDao.getAllInstallations() );
         }
         catch ( ContinuumStoreException e )
         {
             throw new DataManagementException( e );
         }
-        database.setSchedules( store.getAllSchedulesByName() );
-        database.setProfiles( store.getAllProfilesByName() );
+        database.setSchedules( scheduleDao.getAllSchedulesByName() );
+        database.setProfiles( profileDao.getAllProfilesByName() );
+
+        database.setLocalRepositories( localRepositoryDao.getAllLocalRepositories() );
+        database.setRepositoryPurgeConfigurations(
+            repositoryPurgeConfigurationDao.getAllRepositoryPurgeConfigurations() );
+        database.setDirectoryPurgeConfigurations( directoryPurgeConfigurationDao.getAllDirectoryPurgeConfigurations() );
 
-        database.setLocalRepositories( store.getAllLocalRepositories() );
-        database.setRepositoryPurgeConfigurations( store.getAllRepositoryPurgeConfigurations() );
-        database.setDirectoryPurgeConfigurations( store.getAllDirectoryPurgeConfigurations() );
-        
         ContinuumStaxWriter writer = new ContinuumStaxWriter();
 
         File backupFile = new File( backupDirectory, BUILDS_XML );
@@ -130,7 +161,7 @@
 
     public void eraseDatabase()
     {
-        store.eraseDatabase();
+        daoUtils.eraseDatabase();
     }
 
     public void restoreDatabase( File backupDirectory )
@@ -203,10 +234,11 @@
         Map<Integer, LocalRepository> localRepositories = new HashMap<Integer, LocalRepository>();
         for ( LocalRepository localRepository : (List<LocalRepository>) database.getLocalRepositories() )
         {
-            localRepository = (LocalRepository) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), localRepository );
+            localRepository =
+                (LocalRepository) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), localRepository );
             localRepositories.put( Integer.valueOf( localRepository.getId() ), localRepository );
         }
-        
+
         for ( Iterator i = database.getProjectGroups().iterator(); i.hasNext(); )
         {
             ProjectGroup projectGroup = (ProjectGroup) i.next();
@@ -227,12 +259,18 @@
                                                  Integer.valueOf( projectGroup.getLocalRepository().getId() ) ) );
             }
 
+            if ( projectGroup.getLocalRepository() != null )
+            {
+                projectGroup.setLocalRepository(
+                    localRepositories.get( Integer.valueOf( projectGroup.getLocalRepository().getId() ) ) );
+            }
+
             PlexusJdoUtils.addObject( pmf.getPersistenceManager(), projectGroup );
         }
     }
 
     private static void processBuildDefinitions( List buildDefinitions, Map<Integer, Schedule> schedules,
-                                                 Map<Integer, Profile> profiles, 
+                                                 Map<Integer, Profile> profiles,
                                                  Map<Integer, LocalRepository> localRepositories )
     {
         for ( Iterator i = buildDefinitions.iterator(); i.hasNext(); )

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java (original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-api/src/main/java/org/apache/maven/continuum/notification/AbstractContinuumNotifier.java Fri Aug  8 13:48:14 2008
@@ -20,6 +20,8 @@
  */
 
 import org.apache.continuum.configuration.ContinuumConfigurationException;
+import org.apache.continuum.dao.BuildResultDao;
+import org.apache.continuum.dao.ProjectDao;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
 import org.apache.maven.continuum.configuration.ConfigurationLoadingException;
@@ -29,7 +31,6 @@
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,9 +52,14 @@
     private ConfigurationService configurationService;
 
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
+     */
+    private BuildResultDao buildResultDao;
+
+    /**
+     * @plexus.requirement
      */
-    private ContinuumStore store;
+    private ProjectDao projectDao;
 
     /**
      * @plexus.configuration
@@ -235,8 +241,7 @@
         {
             if ( buildDef != null )
             {
-                builds =
-                    getContinuumStore().getBuildResultsByBuildDefinition( project.getId(), buildDef.getId(), 0, 2 );
+                builds = buildResultDao.getBuildResultsByBuildDefinition( project.getId(), buildDef.getId(), 0, 2 );
 
                 if ( builds.size() < 2 )
                 {
@@ -260,7 +265,7 @@
                 //Normally, it isn't possible, buildDef should be != null
                 if ( project.getId() > 0 )
                 {
-                    project = getContinuumStore().getProjectWithBuilds( project.getId() );
+                    project = projectDao.getProjectWithBuilds( project.getId() );
                 }
                 builds = project.getBuildResults();
 
@@ -286,9 +291,4 @@
             throw new NotificationException( "Unable to obtain project builds", e );
         }
     }
-
-    protected ContinuumStore getContinuumStore()
-    {
-        return this.store;
-    }
 }

Modified: continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java (original)
+++ continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java Fri Aug  8 13:48:14 2008
@@ -30,7 +30,6 @@
 import org.apache.maven.continuum.notification.MessageContext;
 import org.apache.maven.continuum.notification.NotificationException;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
 import org.codehaus.plexus.util.StringUtils;
 import org.schwering.irc.lib.IRCConnection;
@@ -67,11 +66,6 @@
     // ----------------------------------------------------------------------
 
     /**
-     * @plexus.requirement role-hint="jdo"
-     */
-    private ContinuumStore store;
-
-    /**
      * @plexus.requirement
      */
     private ConfigurationService configurationService;
@@ -543,9 +537,4 @@
             }
         }
     }
-
-    protected ContinuumStore getContinuumStore()
-    {
-        return this.store;
-    }
 }

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/ContinuumPurgeConstants.java Fri Aug  8 13:48:14 2008
@@ -27,8 +27,8 @@
 public class ContinuumPurgeConstants
 {
     public static final String PURGE_REPOSITORY = "repository";
-    
+
     public static final String PURGE_DIRECTORY_RELEASES = "releases";
-    
+
     public static final String PURGE_DIRECTORY_BUILDOUTPUT = "buildOutput";
 }

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java Fri Aug  8 13:48:14 2008
@@ -19,16 +19,15 @@
  * under the License.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+import org.apache.continuum.dao.DirectoryPurgeConfigurationDao;
+import org.apache.continuum.dao.LocalRepositoryDao;
+import org.apache.continuum.dao.RepositoryPurgeConfigurationDao;
 import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
@@ -37,29 +36,42 @@
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * DefaultPurgeConfigurationService
- * 
+ *
  * @author Maria Catherine Tan
  * @version $Id$
- * @since 25 jul 07
  * @plexus.component role="org.apache.continuum.purge.PurgeConfigurationService" role-hint="default"
+ * @since 25 jul 07
  */
 public class DefaultPurgeConfigurationService
     implements PurgeConfigurationService, Contextualizable
 {
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private ContinuumStore store;
- 
+    private DirectoryPurgeConfigurationDao directoryPurgeConfigurationDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private LocalRepositoryDao localRepositoryDao;
+
+    /**
+     * @plexus.requirement
+     */
+    private RepositoryPurgeConfigurationDao repositoryPurgeConfigurationDao;
+
     private PlexusContainer container;
- 
+
     public AbstractPurgeConfiguration addPurgeConfiguration( AbstractPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
         AbstractPurgeConfiguration purgeConfiguration = null;
-        
+
         if ( purgeConfig instanceof RepositoryPurgeConfiguration )
         {
             purgeConfiguration = addRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) purgeConfig );
@@ -68,10 +80,10 @@
         {
             purgeConfiguration = addDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) purgeConfig );
         }
-        
+
         return purgeConfiguration;
     }
-    
+
     public void updatePurgeConfiguration( AbstractPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
@@ -84,12 +96,12 @@
             updateDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) purgeConfig );
         }
     }
-    
+
     public void removePurgeConfiguration( int purgeConfigId )
         throws PurgeConfigurationServiceException
     {
         AbstractPurgeConfiguration purgeConfig = getPurgeConfiguration( purgeConfigId );
-        
+
         if ( purgeConfig instanceof RepositoryPurgeConfiguration )
         {
             removeRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) purgeConfig );
@@ -99,45 +111,45 @@
             removeDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) purgeConfig );
         }
     }
-    
+
     public DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
         throws PurgeConfigurationServiceException
     {
         DirectoryPurgeConfiguration dirPurgeConfig = null;
-        
+
         try
         {
-            dirPurgeConfig = store.addDirectoryPurgeConfiguration( dirPurge );
+            dirPurgeConfig = directoryPurgeConfigurationDao.addDirectoryPurgeConfiguration( dirPurge );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
-        
+
         return dirPurgeConfig;
     }
-    
+
     public RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
         throws PurgeConfigurationServiceException
     {
         RepositoryPurgeConfiguration repoPurgeConfig = null;
-        
+
         try
         {
-            repoPurgeConfig = store.addRepositoryPurgeConfiguration( repoPurge );
+            repoPurgeConfig = repositoryPurgeConfigurationDao.addRepositoryPurgeConfiguration( repoPurge );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
-        
+
         return repoPurgeConfig;
     }
-    
+
     public RepositoryPurgeConfiguration getDefaultPurgeConfigurationForRepository( int repositoryId )
     {
         List<RepositoryPurgeConfiguration> purgeConfigs = getRepositoryPurgeConfigurationsByRepository( repositoryId );
-        
+
         for ( RepositoryPurgeConfiguration purgeConfig : purgeConfigs )
         {
             if ( purgeConfig.isDefaultPurge() )
@@ -145,37 +157,38 @@
                 return purgeConfig;
             }
         }
-        
+
         return null;
     }
-    
+
     public List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations()
     {
-        return store.getAllDirectoryPurgeConfigurations();
+        return directoryPurgeConfigurationDao.getAllDirectoryPurgeConfigurations();
     }
-    
+
     public List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations()
     {
-        return store.getAllRepositoryPurgeConfigurations();
+        return repositoryPurgeConfigurationDao.getAllRepositoryPurgeConfigurations();
     }
-    
+
     public List<AbstractPurgeConfiguration> getAllPurgeConfigurations()
     {
         List<RepositoryPurgeConfiguration> repoPurge = getAllRepositoryPurgeConfigurations();
         List<DirectoryPurgeConfiguration> dirPurge = getAllDirectoryPurgeConfigurations();
-        
+
         List<AbstractPurgeConfiguration> allPurgeConfigs = new ArrayList<AbstractPurgeConfiguration>();
-        
+
         allPurgeConfigs.addAll( repoPurge );
         allPurgeConfigs.addAll( dirPurge );
-        
+
         return allPurgeConfigs;
     }
-    
+
     public DirectoryPurgeConfiguration getDefaultPurgeConfigurationForDirectoryType( String directoryType )
     {
-        List<DirectoryPurgeConfiguration> purgeConfigs = store.getDirectoryPurgeConfigurationsByType( directoryType );
-        
+        List<DirectoryPurgeConfiguration> purgeConfigs =
+            directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsByType( directoryType );
+
         for ( DirectoryPurgeConfiguration purgeConfig : purgeConfigs )
         {
             if ( purgeConfig.isDefaultPurge() )
@@ -183,88 +196,88 @@
                 return purgeConfig;
             }
         }
-        
+
         return null;
     }
-    
+
     public List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String location )
     {
-        return store.getDirectoryPurgeConfigurationsByLocation( location );
+        return directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsByLocation( location );
     }
-    
+
     public List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int scheduleId )
     {
-        return store.getDirectoryPurgeConfigurationsBySchedule( scheduleId );
+        return directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsBySchedule( scheduleId );
     }
-    
+
     public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository( int repositoryId )
     {
-        return store.getRepositoryPurgeConfigurationsByLocalRepository( repositoryId );
+        return repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsByLocalRepository( repositoryId );
     }
-    
+
     public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule( int scheduleId )
     {
-        return store.getRepositoryPurgeConfigurationsBySchedule( scheduleId );
+        return repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsBySchedule( scheduleId );
     }
-    
+
     public void removeDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            store.removeDirectoryPurgeConfiguration( purgeConfig );
+            directoryPurgeConfigurationDao.removeDirectoryPurgeConfiguration( purgeConfig );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public void removeRepositoryPurgeConfiguration( RepositoryPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            store.removeRepositoryPurgeConfiguration( purgeConfig );
+            repositoryPurgeConfigurationDao.removeRepositoryPurgeConfiguration( purgeConfig );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public void updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            store.updateDirectoryPurgeConfiguration( purgeConfig );
+            directoryPurgeConfigurationDao.updateDirectoryPurgeConfiguration( purgeConfig );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public void updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration purgeConfig )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            store.updateRepositoryPurgeConfiguration( purgeConfig );
+            repositoryPurgeConfigurationDao.updateRepositoryPurgeConfiguration( purgeConfig );
         }
         catch ( ContinuumStoreException e )
         {
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int purgeConfigId )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            return store.getDirectoryPurgeConfiguration( purgeConfigId );
+            return directoryPurgeConfigurationDao.getDirectoryPurgeConfiguration( purgeConfigId );
         }
         catch ( ContinuumObjectNotFoundException e )
         {
@@ -275,13 +288,13 @@
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int purgeConfigId )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            return store.getRepositoryPurgeConfiguration( purgeConfigId );
+            return repositoryPurgeConfigurationDao.getRepositoryPurgeConfiguration( purgeConfigId );
         }
         catch ( ContinuumObjectNotFoundException e )
         {
@@ -292,11 +305,11 @@
             throw new PurgeConfigurationServiceException( e.getMessage(), e );
         }
     }
-    
+
     public AbstractPurgeConfiguration getPurgeConfiguration( int purgeConfigId )
     {
         AbstractPurgeConfiguration purgeConfig = null;
-        
+
         try
         {
             purgeConfig = getRepositoryPurgeConfiguration( purgeConfigId );
@@ -305,7 +318,7 @@
         {
             // purgeConfigId is not of type repository purge configuration
         }
-        
+
         if ( purgeConfig == null )
         {
             try
@@ -317,38 +330,42 @@
                 // purgeConfigId is not of type directory purge configuration
             }
         }
-        
+
         return purgeConfig;
     }
-    
+
     public RepositoryManagedContent getManagedRepositoryContent( int repositoryId )
         throws PurgeConfigurationServiceException
     {
         try
         {
-            LocalRepository repository = store.getLocalRepository( repositoryId );
-            
+            LocalRepository repository = localRepositoryDao.getLocalRepository( repositoryId );
+
             RepositoryManagedContent repoContent;
-            
-            repoContent = (RepositoryManagedContent) container.lookup( RepositoryManagedContent.class, repository.getLayout() );
+
+            repoContent =
+                (RepositoryManagedContent) container.lookup( RepositoryManagedContent.class, repository.getLayout() );
             repoContent.setRepository( repository );
-            
+
             return repoContent;
         }
         catch ( ContinuumObjectNotFoundException e )
         {
-            throw new PurgeConfigurationServiceException( "Error retrieving managed repository content for: " + repositoryId, e );
+            throw new PurgeConfigurationServiceException(
+                "Error retrieving managed repository content for: " + repositoryId, e );
         }
         catch ( ContinuumStoreException e )
         {
-            throw new PurgeConfigurationServiceException( "Error retrieving managed repository content for: " + repositoryId, e );
+            throw new PurgeConfigurationServiceException(
+                "Error retrieving managed repository content for: " + repositoryId, e );
         }
         catch ( ComponentLookupException e )
         {
-            throw new PurgeConfigurationServiceException( "Error retrieving managed repository content for: " + repositoryId, e );
+            throw new PurgeConfigurationServiceException(
+                "Error retrieving managed repository content for: " + repositoryId, e );
         }
     }
-    
+
     public void contextualize( Context context )
         throws ContextException
     {

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/DirectoryPurgeController.java Fri Aug  8 13:48:14 2008
@@ -30,7 +30,7 @@
 
 /**
  * DirectoryPurgeController
- * 
+ *
  * @author Maria Catherine Tan
  * @plexus.component role="org.apache.continuum.purge.controller.PurgeController" role-hint="purge-directory"
  */
@@ -39,10 +39,10 @@
     implements PurgeController
 {
     private ContinuumPurgeExecutor purgeExecutor;
-    
-    public void doPurge( String path ) 
+
+    public void doPurge( String path )
     {
-        try 
+        try
         {
             purgeExecutor.purge( path );
         }
@@ -56,18 +56,20 @@
         throws ContinuumPurgeExecutorException
     {
         DirectoryPurgeConfiguration dirPurge = (DirectoryPurgeConfiguration) purgeConfig;
-        
+
         if ( dirPurge.isDeleteAll() )
         {
             purgeExecutor = new CleanAllPurgeExecutor( dirPurge.getDirectoryType() );
         }
         else if ( dirPurge.getDaysOlder() > 0 )
         {
-            purgeExecutor = new DaysOldDirectoryPurgeExecutor( dirPurge.getDaysOlder(), dirPurge.getRetentionCount(), dirPurge.getDirectoryType() );
+            purgeExecutor = new DaysOldDirectoryPurgeExecutor( dirPurge.getDaysOlder(), dirPurge.getRetentionCount(),
+                                                               dirPurge.getDirectoryType() );
         }
         else
         {
-            purgeExecutor = new RetentionCountDirectoryPurgeExecutor( dirPurge.getRetentionCount(), dirPurge.getDirectoryType() );
+            purgeExecutor =
+                new RetentionCountDirectoryPurgeExecutor( dirPurge.getRetentionCount(), dirPurge.getDirectoryType() );
         }
     }
 }

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/controller/RepositoryPurgeController.java Fri Aug  8 13:48:14 2008
@@ -35,7 +35,7 @@
 
 /**
  * DefaultPurgeController
- * 
+ *
  * @author Maria Catherine Tan
  * @plexus.component role="org.apache.continuum.purge.controller.PurgeController" role-hint="purge-repository"
  */
@@ -44,61 +44,64 @@
     implements PurgeController
 {
     private ContinuumPurgeExecutor purgeExecutor;
-    
+
     private ContinuumPurgeExecutor purgeReleasedSnapshotsExecutor;
-    
+
     /**
      * @plexus.requirement
      */
     private PurgeConfigurationService purgeConfigurationService;
-    
+
     private boolean deleteReleasedSnapshots = false;
-    
+
     public void initializeExecutors( AbstractPurgeConfiguration purgeConfig )
         throws ContinuumPurgeExecutorException
     {
         RepositoryManagedContent repositoryContent;
-     
+
         RepositoryPurgeConfiguration repoPurge = (RepositoryPurgeConfiguration) purgeConfig;
-        
+
         try
         {
-            repositoryContent = purgeConfigurationService.getManagedRepositoryContent( repoPurge.getRepository().getId() );
+            repositoryContent =
+                purgeConfigurationService.getManagedRepositoryContent( repoPurge.getRepository().getId() );
         }
-        catch( PurgeConfigurationServiceException e )
+        catch ( PurgeConfigurationServiceException e )
         {
             throw new ContinuumPurgeExecutorException( "Error while initializing purge executors", e );
         }
-            
+
         if ( repoPurge.isDeleteAll() )
         {
             purgeExecutor = new CleanAllPurgeExecutor( ContinuumPurgeConstants.PURGE_REPOSITORY );
         }
-        else 
-        {    
+        else
+        {
             if ( repoPurge.getDaysOlder() > 0 )
             {
-                purgeExecutor = new DaysOldRepositoryPurgeExecutor( repositoryContent, repoPurge.getDaysOlder(), repoPurge.getRetentionCount() );
+                purgeExecutor = new DaysOldRepositoryPurgeExecutor( repositoryContent, repoPurge.getDaysOlder(),
+                                                                    repoPurge.getRetentionCount() );
             }
             else
             {
-                purgeExecutor = new RetentionCountRepositoryPurgeExecutor( repositoryContent, repoPurge.getRetentionCount() );
+                purgeExecutor =
+                    new RetentionCountRepositoryPurgeExecutor( repositoryContent, repoPurge.getRetentionCount() );
             }
-            
+
             purgeReleasedSnapshotsExecutor = new ReleasedSnapshotsRepositoryPurgeExecutor( repositoryContent );
             deleteReleasedSnapshots = repoPurge.isDeleteReleasedSnapshots();
         }
     }
-    
+
     public void doPurge( String path )
     {
-        try 
+        try
         {
-            if ( deleteReleasedSnapshots)
+            if ( deleteReleasedSnapshots )
             {
                 purgeReleasedSnapshotsExecutor.purge( path );
             }
-            
+
             purgeExecutor.purge( path );
         }
         catch ( ContinuumPurgeExecutorException e )

Modified: continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java?rev=684085&r1=684084&r2=684085&view=diff
==============================================================================
--- continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java (original)
+++ continuum/trunk/continuum-purge/src/main/java/org/apache/continuum/purge/executor/AbstractContinuumPurgeExecutor.java Fri Aug  8 13:48:14 2008
@@ -19,16 +19,17 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.Set;
-
 import org.apache.continuum.purge.repository.content.RepositoryManagedContent;
 import org.apache.maven.archiva.consumers.core.repository.ArtifactFilenameFilter;
 import org.apache.maven.archiva.model.ArtifactReference;
 
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Set;
+
 /**
  * Some codes were taken from Archiva.
+ *
  * @author Maria Catherine Tan
  */
 public abstract class AbstractContinuumPurgeExecutor
@@ -36,7 +37,7 @@
 {
     public void purge( Set<ArtifactReference> references, RepositoryManagedContent repository )
     {
-        if( references != null && !references.isEmpty() )
+        if ( references != null && !references.isEmpty() )
         {
             for ( ArtifactReference reference : references )
             {
@@ -48,7 +49,7 @@
             }
         }
     }
-    
+
     /**
      * <p>
      * This find support files for the artifactFile and deletes them.
@@ -56,7 +57,7 @@
      * <p>
      * Support Files are things like ".sha1", ".md5", ".asc", etc.
      * </p>
-     * 
+     *
      * @param artifactFile the file to base off of.
      */
     protected void purgeSupportFiles( File artifactFile, String filename )



Mime
View raw message