continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r233212 [3/3] - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-api/src/main/java/org/apache/maven/continuum/notification/ contin...
Date Wed, 17 Aug 2005 17:36:17 GMT
Modified: maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml Wed Aug 17 10:34:49 2005
@@ -255,10 +255,6 @@
             <value>true</value>
           </property>
           <property>
-            <name>org.jpox.autoCreateColumns</name>
-            <value>true</value>
-          </property>
-          <property>
             <name>org.jpox.autoStartMechanism</name>
             <value>SchemaTable</value>
           </property>
@@ -266,18 +262,6 @@
             <name>org.jpox.autoStartMechanismMode</name>
             <value>Ignored</value>
           </property>
-          <property>
-            <name>org.jpox.validateTables</name>
-            <value>false</value>
-          </property>
-          <property>
-            <name>org.jpox.validateColumns</name>
-            <value>false</value>
-          </property>
-          <property>
-            <name>org.jpox.validateConstraints</name>
-            <value>false</value>
-          </property>
           <!-- Apache Derby Configuration -->
           <property>
             <name>javax.jdo.option.ConnectionDriverName</name>
@@ -322,24 +306,32 @@
             HSQLDB keeps all data in memory at all times.
           -->
           <!--
-          <property>
-            <name>javax.jdo.option.ConnectionDriverName</name>
-            <value>org.hsqldb.jdbcDriver</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionURL</name>
-            <value>jdbc:hsqldb:${plexus.home}/database</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionUserName</name>
-            <value>sa</value>
-          </property>
-          <property>
-            <name>javax.jdo.option.ConnectionPassword</name>
-            <value></value>
-          </property>
-          -->
+                    <property>
+                      <name>javax.jdo.option.ConnectionDriverName</name>
+                      <value>org.hsqldb.jdbcDriver</value>
+                    </property>
+                    <property>
+                      <name>javax.jdo.option.ConnectionURL</name>
+                      <value>jdbc:hsqldb:${plexus.home}/database</value>
+                    </property>
+                    <property>
+                      <name>javax.jdo.option.ConnectionUserName</name>
+                      <value>sa</value>
+                    </property>
+                    <property>
+                      <name>javax.jdo.option.ConnectionPassword</name>
+                      <value></value>
+                    </property>
 
+                    <property>
+                      <name>org.jpox.transactionIsolation</name>
+                      <value>READ_UNCOMMITTED</value>
+                    </property>
+                    <property>
+                      <name>org.jpox.poid.transactionIsolation</name>
+                      <value>READ_UNCOMMITTED</value>
+                    </property>
+          -->
           <property>
             <name>org.jpox.transactionIsolation</name>
             <value>READ_COMMITTED</value>

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java Wed Aug 17 10:34:49 2005
@@ -37,7 +37,7 @@
      */
     private ConfigurationService configurationService;
 
-    public String getBuildOutput( int buildId, String projectId )
+    public String getBuildOutput( int buildId, int projectId )
         throws ContinuumStoreException
     {
         File file = getBuildOutputFile( buildId, projectId );
@@ -58,10 +58,10 @@
     //
     // ----------------------------------------------------------------------
 
-    public File getBuildOutputFile( int buildId, String projectId )
+    public File getBuildOutputFile( int buildId, int projectId )
         throws ContinuumStoreException
     {
-        File dir = new File( configurationService.getBuildOutputDirectory(), projectId );
+        File dir = new File( configurationService.getBuildOutputDirectory(), Integer.toString( projectId ) );
 
         if ( !dir.exists() && !dir.mkdirs() )
         {

Modified: maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java (original)
+++ maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java Wed Aug 17 10:34:49 2005
@@ -22,15 +22,14 @@
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.model.project.Schedule;
-import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.model.system.Installation;
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.jdo.JdoFactory;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 
 import javax.jdo.Extent;
+import javax.jdo.JDOException;
 import javax.jdo.JDOHelper;
 import javax.jdo.JDOObjectNotFoundException;
 import javax.jdo.JDOUserException;
@@ -39,7 +38,6 @@
 import javax.jdo.Query;
 import javax.jdo.Transaction;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 /**
@@ -67,12 +65,6 @@
     // Fetch Groups
     // ----------------------------------------------------------------------
 
-    private static final String PROJECT_DETAIL_FG = "project-detail";
-
-    private static final String BUILD_DETAIL_FG = "build-detail";
-
-    private static final String BUILD_SETTINGS_DETAIL_FG = "build-settings-detail";
-
     private static final String PROJECT_WITH_BUILDS_FETCH_GROUP = "project-with-builds";
 
     private static final String PROJECT_WITH_CHECKOUT_RESULT_FETCH_GROUP = "project-with-checkout-result";
@@ -97,13 +89,7 @@
     // ContinuumStore Implementation
     // ----------------------------------------------------------------------
 
-    public ContinuumProject addProject( ContinuumProject project )
-        throws ContinuumStoreException
-    {
-        return (ContinuumProject) addObject( project, PROJECT_DETAIL_FG );
-    }
-
-    public void removeProject( String projectId )
+    public Project getProjectByName( String name )
         throws ContinuumStoreException
     {
         PersistenceManager pm = pmf.getPersistenceManager();
@@ -114,99 +100,7 @@
         {
             tx.begin();
 
-            Object id = pm.newObjectIdInstance( ContinuumProject.class, projectId );
-
-            ContinuumProject project = (ContinuumProject) pm.getObjectById( id );
-
-            if ( project.getProjectGroup() != null )
-            {
-                ProjectGroup pg = project.getProjectGroup();
-
-                pg.getProjects().remove( project );
-            }
-
-            pm.deletePersistent( project );
-
-            tx.commit();
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public ContinuumProject updateProject( ContinuumProject project )
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            pm.attachCopy( project, true );
-
-            tx.commit();
-
-            return (ContinuumProject) getDetailedObject( ContinuumProject.class, project.getId(), PROJECT_DETAIL_FG );
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public Collection getAllProjects()
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            Extent extent = pm.getExtent( ContinuumProject.class, true );
-
-            Query query = pm.newQuery( extent );
-
-            query.setOrdering( "name ascending" );
-
-            Collection result = (Collection) query.execute();
-
-            result = pm.detachCopyAll( result );
-
-            // TODO: we want to do this on updating the latest build, not all gets.
-            for ( Iterator it = result.iterator(); it.hasNext(); )
-            {
-                setProjectState( (ContinuumProject) it.next() );
-            }
-
-            tx.commit();
-
-            return result;
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public ContinuumProject getProjectByName( String name )
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            Extent extent = pm.getExtent( ContinuumProject.class, true );
+            Extent extent = pm.getExtent( Project.class, true );
 
             Query query = pm.newQuery( extent );
 
@@ -216,8 +110,6 @@
 
             query.setFilter( "this.name == name" );
 
-            query.getFetchPlan().addGroup( PROJECT_DETAIL_FG );
-
             Collection result = (Collection) query.execute( name );
 
             if ( result.size() == 0 )
@@ -231,7 +123,7 @@
 
             tx.commit();
 
-            return (ContinuumProject) object;
+            return (Project) object;
         }
         finally
         {
@@ -239,37 +131,18 @@
         }
     }
 
-    public ContinuumProject getProject( String projectId )
+
+    public void updateBuildResult( BuildResult build )
         throws ContinuumStoreException
     {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            ContinuumProject project = getContinuumProject( pm, projectId, true );
-
-            project = (ContinuumProject) pm.detachCopy( project );
-
-            tx.commit();
+        updateObject( build );
 
-            return project;
-        }
-        catch ( JDOObjectNotFoundException e )
-        {
-            throw new ContinuumObjectNotFoundException( ContinuumProject.class.getName(), projectId );
-        }
-        finally
-        {
-            rollback( tx );
-        }
+        // TODO: merge requests
+        setProjectState( build.getProject() );
     }
 
-    public ScmResult getScmResultForProject( String projectId )
-        throws ContinuumStoreException
+    public void addBuildResult( Project project, BuildResult build )
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         PersistenceManager pm = pmf.getPersistenceManager();
 
@@ -279,55 +152,22 @@
         {
             tx.begin();
 
-            ContinuumProject project = getContinuumProject( pm, projectId, false );
-
-            ScmResult scmResult = project.getCheckoutResult();
+            pm.getFetchPlan().addGroup( PROJECT_WITH_BUILDS_FETCH_GROUP );
 
-            if ( scmResult == null )
-            {
-                tx.commit();
-
-                return null;
-            }
-
-            scmResult = (ScmResult) pm.detachCopy( scmResult );
-
-            tx.commit();
-
-            return scmResult;
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public BuildResult addBuildResult( ContinuumProject project, BuildResult build )
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
+            Object objectId = pm.newObjectIdInstance( Project.class, new Integer( project.getId() ) );
 
-        try
-        {
-            tx.begin();
-
-            project = getContinuumProject( pm, project.getId(), true );
+            project = (Project) pm.getObjectById( objectId );
 
             build = (BuildResult) makePersistent( pm, build, false );
 
-            // TODO: these are in the wrong spot - set them on success
-            project.setLatestBuildId( Integer.toString( build.getId() ) );
+            // TODO: these are in the wrong spot - set them on success (though currently some depend on latest build being the one in progress)
+            project.setLatestBuildId( build.getId() );
 
             project.setBuildNumber( project.getBuildNumber() + 1 );
 
-            project.addBuild( build );
+            project.addBuildResult( build );
 
             tx.commit();
-
-            // TODO: I think this can be replaced by a detach
-            return getBuildResult( build.getId() );
         }
         finally
         {
@@ -335,14 +175,7 @@
         }
     }
 
-    public void updateBuildResult( BuildResult build )
-        throws ContinuumStoreException
-    {
-        updateObject( build );
-    }
-
-    public BuildResult getLatestBuildResultForProject( String projectId )
-        throws ContinuumStoreException
+    public BuildResult getLatestBuildResultForProject( int projectId )
     {
         PersistenceManager pm = pmf.getPersistenceManager();
 
@@ -352,13 +185,15 @@
         {
             tx.begin();
 
-            ContinuumProject project = getContinuumProject( pm, projectId, false );
+            Object id = pm.newObjectIdInstance( Project.class, new Integer( projectId ) );
+
+            Project project = (Project) pm.getObjectById( id );
 
-            String buildId = project.getLatestBuildId();
+            int buildId = project.getLatestBuildId();
 
-            if ( buildId != null )
+            if ( buildId > 0 )
             {
-                Object id = pm.newObjectIdInstance( BuildResult.class, Integer.valueOf( buildId ) );
+                id = pm.newObjectIdInstance( BuildResult.class, Integer.valueOf( buildId ) );
 
                 Object object = pm.getObjectById( id );
 
@@ -389,7 +224,7 @@
         return notifier;
     }
 
-    private ContinuumProject setProjectState( ContinuumProject project )
+    private Project setProjectState( Project project )
         throws ContinuumStoreException
     {
         BuildResult build = getLatestBuildResultForProject( project.getId() );
@@ -403,57 +238,9 @@
             project.setState( build.getState() );
         }
 
-        return project;
-    }
-
-    private ContinuumProject getContinuumProject( PersistenceManager pm, String projectId, boolean details )
-    {
-        if ( details )
-        {
-            pm.getFetchPlan().addGroup( "project-detail" );
-        }
-
-        Object id = pm.newObjectIdInstance( ContinuumProject.class, projectId );
-
-        return (ContinuumProject) pm.getObjectById( id );
-    }
-
-    private Object addObject( Object object, String detailedFetchGroup )
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            // ----------------------------------------------------------------------
-            // Store the object
-            // ----------------------------------------------------------------------
-
-            pm.makePersistent( object );
+        updateProject( project );
 
-            Object id = pm.getObjectId( object );
-
-            // ----------------------------------------------------------------------
-            // Fetch the object again and return it
-            // ----------------------------------------------------------------------
-
-            pm.getFetchPlan().addGroup( detailedFetchGroup );
-
-            Object addedObject = pm.getObjectById( id );
-
-            addedObject = pm.detachCopy( addedObject );
-
-            tx.commit();
-
-            return addedObject;
-        }
-        finally
-        {
-            rollback( tx );
-        }
+        return project;
     }
 
     private Object makePersistent( PersistenceManager pm, Object object, boolean detach )
@@ -472,41 +259,8 @@
         return persistentObject;
     }
 
-    private Object getDetailedObject( Class clazz, String id, String fetchGroup )
-        throws ContinuumObjectNotFoundException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            pm.getFetchPlan().addGroup( fetchGroup );
-
-            Object objectId = pm.newObjectIdInstance( clazz, id );
-
-            Object object = pm.getObjectById( objectId );
-
-            object = pm.detachCopy( object );
-
-            tx.commit();
-
-            return object;
-        }
-        catch ( JDOObjectNotFoundException e )
-        {
-            throw new ContinuumObjectNotFoundException( clazz.getName(), id );
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
     private Object getObjectFromQuery( Class clazz, String idField, String id, String fetchGroup )
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         PersistenceManager pm = pmf.getPersistenceManager();
 
@@ -611,19 +365,19 @@
     }
 
     public ProjectGroup getProjectGroup( int projectGroupId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId );
     }
 
     private Object getObjectById( Class clazz, int id )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return getObjectById( clazz, id, null );
     }
 
     private Object getObjectById( Class clazz, int id, String fetchGroup )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         PersistenceManager pm = pmf.getPersistenceManager();
 
@@ -652,6 +406,10 @@
         {
             throw new ContinuumObjectNotFoundException( clazz.getName(), Integer.toString( id ) );
         }
+        catch ( JDOException e )
+        {
+            throw new ContinuumStoreException( "Error handling JDO", e );
+        }
         finally
         {
             rollback( tx );
@@ -783,7 +541,7 @@
     }
 
     public Project getProject( int projectId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return (Project) getObjectById( Project.class, projectId );
     }
@@ -807,7 +565,7 @@
     }
 
     public Project getProjectWithBuilds( int projectId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return (Project) getObjectById( Project.class, projectId, PROJECT_WITH_BUILDS_FETCH_GROUP );
     }
@@ -823,13 +581,13 @@
     }
 
     public Project getProjectWithCheckoutResult( int projectId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (Project) getObjectById( Project.class, projectId, PROJECT_WITH_CHECKOUT_RESULT_FETCH_GROUP );
     }
 
     public BuildResult getBuildResult( int buildId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (BuildResult) getObjectById( BuildResult.class, buildId, BUILD_RESULT_WITH_DETAILS_FETCH_GROUP );
     }
@@ -845,7 +603,7 @@
     }
 
     public ProjectGroup getProjectGroupWithBuildDetails( int projectGroupId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (ProjectGroup) getObjectById( ProjectGroup.class, projectGroupId, PROJECT_BUILD_DETAILS_FETCH_GROUP );
     }
@@ -856,19 +614,19 @@
     }
 
     public Project getProjectWithAllDetails( int projectId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (Project) getObjectById( Project.class, projectId, PROJECT_ALL_DETAILS_FETCH_GROUP );
     }
 
     public Schedule getSchedule( int scheduleId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (Schedule) getObjectById( Schedule.class, scheduleId );
     }
 
     public Profile getProfile( int profileId )
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         return (Profile) getObjectById( Profile.class, profileId );
     }
@@ -960,8 +718,24 @@
     }
 
     public ProjectGroup getProjectGroupByGroupId( String groupId )
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         return (ProjectGroup) getObjectFromQuery( ProjectGroup.class, "groupId", groupId, null );
+    }
+
+    /**
+     * @param project
+     * @return
+     * @todo REMOVE
+     */
+    public Project addProject( Project project )
+    {
+        return (Project) addObject( project );
+    }
+
+    public Project getProjectWithBuildDetails( int projectId )
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
+    {
+        return (Project) getObjectById( Project.class, projectId, PROJECT_BUILD_DETAILS_FETCH_GROUP );
     }
 }

Modified: maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java (original)
+++ maven/continuum/trunk/continuum-store/src/test/java/org/apache/maven/continuum/store/ContinuumStoreTest.java Wed Aug 17 10:34:49 2005
@@ -33,10 +33,12 @@
 import org.codehaus.plexus.jdo.ConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.JdoFactory;
+import org.jpox.SchemaTool;
 
 import javax.jdo.JDODetachedFieldAccessException;
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -71,10 +73,14 @@
 
     private Schedule testSchedule2;
 
+    private Schedule testSchedule3;
+
     private Profile testProfile1;
 
     private Profile testProfile2;
 
+    private Profile testProfile3;
+
     private Installation testInstallationJava13;
 
     private Installation testInstallationJava14;
@@ -109,11 +115,13 @@
         testProject1 = createTestProject( "artifactId1", 1, "description1", defaultProjectGroup.getGroupId(), "name1",
                                           "scmUrl1", 1, "url1", "version1", "workingDirectory1" );
 
+        // state must be 1 unless we setup a build in the correct state
         testProject2 = createTestProject( "artifactId2", 2, "description2", defaultProjectGroup.getGroupId(), "name2",
-                                          "scmUrl2", 2, "url2", "version2", "workingDirectory2" );
+                                          "scmUrl2", 1, "url2", "version2", "workingDirectory2" );
 
         testSchedule1 = createTestSchedule( "name1", "description1", 1, "cronExpression1", true );
         testSchedule2 = createTestSchedule( "name2", "description2", 2, "cronExpression2", true );
+        testSchedule3 = createTestSchedule( "name3", "description3", 3, "cronExpression3", true );
 
         testInstallationJava13 = createTestInstallation( "JDK", "/usr/local/java-1.3", "1.3" );
         testInstallationJava14 = createTestInstallation( "JDK", "/usr/local/java-1.4", "1.4" );
@@ -168,6 +176,10 @@
         schedule1 = store.addSchedule( schedule1 );
         testSchedule1.setId( schedule1.getId() );
 
+        Schedule schedule3 = createTestSchedule( testSchedule3 );
+        schedule3 = store.addSchedule( schedule3 );
+        testSchedule3.setId( schedule3.getId() );
+
         Installation installationJava14 = createTestInstallation( testInstallationJava14 );
         installationJava14 = store.addInstallation( installationJava14 );
 
@@ -181,6 +193,8 @@
                                           installationMaven20a3 );
         testProfile2 = createTestProfile( "name2", "description2", 2, false, true, installationJava14,
                                           installationMaven20a3 );
+        testProfile3 = createTestProfile( "name3", "description3", 3, true, false, installationJava14,
+                                          installationMaven20a3 );
 
         Profile profile1 = createTestProfile( testProfile1 );
         profile1 = store.addProfile( profile1 );
@@ -190,6 +204,10 @@
         profile2 = store.addProfile( profile2 );
         testProfile2.setId( profile2.getId() );
 
+        Profile profile3 = createTestProfile( testProfile3 );
+        profile3 = store.addProfile( profile3 );
+        testProfile3.setId( profile3.getId() );
+
         BuildDefinition testGroupBuildDefinition1 = createTestBuildDefinition( "arguments1", "buildFile1", "goals1",
                                                                                profile1, schedule2 );
         BuildDefinition testGroupBuildDefinition2 = createTestBuildDefinition( "arguments2", "buildFile2", "goals2",
@@ -305,7 +323,7 @@
     // ----------------------------------------------------------------------
 
     public void testAddProjectGroup()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         String name = "testAddProjectGroup";
         String description = "testAddProjectGroup description";
@@ -321,7 +339,7 @@
     }
 
     public void testGetProjectGroup()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         ProjectGroup retrievedGroup = store.getProjectGroup( defaultProjectGroup.getId() );
         assertProjectGroupEquals( retrievedGroup, defaultProjectGroup );
@@ -345,6 +363,7 @@
     }
 
     public void testGetInvalidProjectGroup()
+        throws ContinuumStoreException
     {
         try
         {
@@ -358,7 +377,7 @@
     }
 
     public void testEditProjectGroup()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup newGroup = store.getProjectGroup( testProjectGroup2.getId() );
 
@@ -432,7 +451,7 @@
     }
 
     public void testGetProject()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         Project retrievedProject = store.getProject( testProject1.getId() );
         assertProjectEquals( retrievedProject, testProject1 );
@@ -440,7 +459,7 @@
     }
 
     public void testGetProjectWithDetails()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         Project retrievedProject = store.getProjectWithAllDetails( testProject1.getId() );
         assertProjectEquals( retrievedProject, testProject1 );
@@ -453,7 +472,7 @@
     }
 
     public void testGetProjectWithCheckoutResult()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         Project retrievedProject = store.getProjectWithCheckoutResult( testProject1.getId() );
         assertProjectEquals( retrievedProject, testProject1 );
@@ -462,6 +481,7 @@
     }
 
     public void testGetInvalidProject()
+        throws ContinuumStoreException
     {
         try
         {
@@ -475,7 +495,7 @@
     }
 
     public void testEditProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project newProject = store.getProject( testProject2.getId() );
 
@@ -560,12 +580,14 @@
     public void testRemoveSchedule()
         throws ContinuumStoreException
     {
-        Schedule schedule = (Schedule) store.getAllSchedulesByName().get( 0 );
+        Schedule schedule = (Schedule) store.getAllSchedulesByName().get( 2 );
+
+        // TODO: test if it has any attachments
 
         store.removeSchedule( schedule );
 
         List schedules = store.getAllSchedulesByName();
-        assertEquals( "check size", 1, schedules.size() );
+        assertEquals( "check size", 2, schedules.size() );
         assertFalse( "check not there", schedules.contains( schedule ) );
     }
 
@@ -573,13 +595,15 @@
     {
         List schedules = store.getAllSchedulesByName();
 
-        assertEquals( "check item count", 2, schedules.size() );
+        assertEquals( "check item count", 3, schedules.size() );
 
         // check equality and order
         Schedule schedule = (Schedule) schedules.get( 0 );
         assertScheduleEquals( schedule, testSchedule1 );
         schedule = (Schedule) schedules.get( 1 );
         assertScheduleEquals( schedule, testSchedule2 );
+        schedule = (Schedule) schedules.get( 2 );
+        assertScheduleEquals( schedule, testSchedule3 );
     }
 
     public void testAddProfile()
@@ -622,12 +646,14 @@
     public void testRemoveProfile()
         throws ContinuumStoreException
     {
-        Profile profile = (Profile) store.getAllProfilesByName().get( 0 );
+        Profile profile = (Profile) store.getAllProfilesByName().get( 2 );
+
+        // TODO: test if it has any attachments
 
         store.removeProfile( profile );
 
         List profiles = store.getAllProfilesByName();
-        assertEquals( "check size", 1, profiles.size() );
+        assertEquals( "check size", 2, profiles.size() );
         assertFalse( "check not there", profiles.contains( profile ) );
     }
 
@@ -635,7 +661,7 @@
     {
         List profiles = store.getAllProfilesByName();
 
-        assertEquals( "check item count", 2, profiles.size() );
+        assertEquals( "check item count", 3, profiles.size() );
 
         // check equality and order
         Profile profile = (Profile) profiles.get( 0 );
@@ -646,6 +672,10 @@
         assertProfileEquals( profile, testProfile2 );
         assertInstallationEquals( profile.getBuilder(), testProfile2.getBuilder() );
         assertInstallationEquals( profile.getJdk(), testProfile2.getJdk() );
+        profile = (Profile) profiles.get( 2 );
+        assertProfileEquals( profile, testProfile3 );
+        assertInstallationEquals( profile.getBuilder(), testProfile3.getBuilder() );
+        assertInstallationEquals( profile.getJdk(), testProfile3.getJdk() );
     }
 
     public void testGetAllInstallations()
@@ -664,7 +694,7 @@
     }
 
     public void testDeleteProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithBuilds( testProject1.getId() );
 
@@ -678,7 +708,7 @@
     }
 
     public void testDeleteProjectGroup()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         store.removeProjectGroup( store.getProjectGroup( defaultProjectGroup.getId() ) );
 
@@ -699,7 +729,7 @@
     }
 
     public void testDeleteBuildResult()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithBuilds( testProject1.getId() );
 
@@ -728,6 +758,7 @@
     }
 
     public void testGetInvalidBuildResult()
+        throws ContinuumStoreException
     {
         try
         {
@@ -758,7 +789,7 @@
     }
 
     public void testGetBuildResult()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         BuildResult buildResult = store.getBuildResult( testBuildResult3.getId() );
         assertBuildResultEquals( buildResult, testBuildResult3 );
@@ -768,7 +799,7 @@
     }
 
     public void testGetProjectGroupWithDetails()
-        throws ContinuumObjectNotFoundException
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         ProjectGroup retrievedGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
         assertProjectGroupEquals( retrievedGroup, defaultProjectGroup );
@@ -828,7 +859,7 @@
     }
 
     public void testAddDeveloperToProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -843,7 +874,7 @@
     }
 
     public void testEditDeveloper()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -862,7 +893,7 @@
     }
 
     public void testDeleteDeveloper()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
         project.getDevelopers().remove( 0 );
@@ -876,7 +907,7 @@
     }
 
     public void testAddDependencyToProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -891,7 +922,7 @@
     }
 
     public void testEditDependency()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -910,7 +941,7 @@
     }
 
     public void testDeleteDependency()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
         ProjectDependency dependency = (ProjectDependency) project.getDependencies().get( 1 );
@@ -926,7 +957,7 @@
     }
 
     public void testAddNotifierToProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -941,7 +972,7 @@
     }
 
     public void testEditNotifier()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -958,7 +989,7 @@
     }
 
     public void testDeleteNotifier()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
         project.getNotifiers().remove( 0 );
@@ -972,7 +1003,7 @@
     }
 
     public void testAddBuildDefinitionToProject()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -993,7 +1024,7 @@
     }
 
     public void testEditBuildDefinition()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
 
@@ -1013,7 +1044,7 @@
     }
 
     public void testDeleteBuildDefinition()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         Project project = store.getProjectWithAllDetails( testProject1.getId() );
         BuildDefinition buildDefinition = (BuildDefinition) project.getBuildDefinitions().get( 1 );
@@ -1033,7 +1064,7 @@
     }
 
     public void testAddNotifierToProjectGroup()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
 
@@ -1048,7 +1079,7 @@
     }
 
     public void testEditGroupNotifier()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
 
@@ -1065,7 +1096,7 @@
     }
 
     public void testDeleteGroupNotifier()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
         ProjectNotifier notifier = (ProjectNotifier) projectGroup.getNotifiers().get( 1 );
@@ -1081,7 +1112,7 @@
     }
 
     public void testAddBuildDefinitionToProjectGroup()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
 
@@ -1102,7 +1133,7 @@
     }
 
     public void testEditGroupBuildDefinition()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
 
@@ -1122,7 +1153,7 @@
     }
 
     public void testDeleteGroupBuildDefinition()
-        throws ContinuumStoreException
+        throws ContinuumStoreException, ContinuumObjectNotFoundException
     {
         ProjectGroup projectGroup = store.getProjectGroupWithBuildDetails( defaultProjectGroup.getId() );
         projectGroup.getBuildDefinitions().remove( 0 );
@@ -1184,6 +1215,7 @@
     }
 
     private void confirmProjectDeletion( Project project )
+        throws ContinuumStoreException
     {
         try
         {
@@ -1465,6 +1497,7 @@
                 assertTrue( true );
             }
         }
+
         if ( !checkoutFetchGroup )
         {
             try
@@ -1477,6 +1510,7 @@
                 assertTrue( true );
             }
         }
+
         if ( !buildResultsFetchGroup )
         {
             try
@@ -1713,7 +1747,7 @@
         // TODO: add ability to test with various
         jdoFactory.setDriverName( "org.hsqldb.jdbcDriver" );
 
-        jdoFactory.setUrl( "jdbc:hsqldb:mem:" + getClass().getName() + "." + getName() );
+        jdoFactory.setUrl( "jdbc:hsqldb:mem:" + getName() );
 
         jdoFactory.setUserName( "sa" );
 
@@ -1723,9 +1757,7 @@
 
         jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_UNCOMMITTED" );
 
-        jdoFactory.setProperty( "org.jpox.autoCreateTables", "true" );
-
-        jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" );
+        jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" );
 
         Properties properties = jdoFactory.getProperties();
 
@@ -1735,6 +1767,9 @@
 
             System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
         }
+
+        File file = getTestFile( "../continuum-model/src/main/resources/META-INF/package.jdo" );
+        SchemaTool.createSchemaTables( new String[]{file.getAbsolutePath()}, false );
 
         PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
 

Modified: maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java (original)
+++ maven/continuum/trunk/continuum-test/src/main/java/org/apache/maven/continuum/AbstractContinuumTest.java Wed Aug 17 10:34:49 2005
@@ -28,11 +28,15 @@
 import org.codehaus.plexus.jdo.ConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
 import org.codehaus.plexus.jdo.JdoFactory;
+import org.jpox.SchemaTool;
 
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
+import java.io.File;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
 
 /**
@@ -128,7 +132,17 @@
 
         jdoFactory.setProperty( "org.jpox.autoCreateTables", "true" );
 
-        jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" );
+        Properties properties = jdoFactory.getProperties();
+
+        for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); )
+        {
+            Map.Entry entry = (Map.Entry) it.next();
+
+            System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
+        }
+
+        File file = getTestFile( "../continuum-model/src/main/resources/META-INF/package.jdo" );
+        SchemaTool.createSchemaTables( new String[]{file.getAbsolutePath()}, false );
 
         // ----------------------------------------------------------------------
         // Check the configuration

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java (original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ContinuumStateContentGenerator.java Wed Aug 17 10:34:49 2005
@@ -19,7 +19,7 @@
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.codehaus.plexus.formica.web.ContentGenerator;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -41,9 +41,9 @@
     {
         int state = 0;
 
-        if ( item instanceof ContinuumProject )
+        if ( item instanceof Project )
         {
-            ContinuumProject project = (ContinuumProject) item;
+            Project project = (Project) item;
 
             // TODO: can't we just use project.getState()?
             try

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml Wed Aug 17 10:34:49 2005
@@ -1,7 +1,7 @@
 <form>
   <extend>continuumProject</extend>
   <id>antProject</id>
-  <target-class>org.apache.maven.continuum.project.ContinuumProject</target-class>
+  <target-class>org.apache.maven.continuum.model.project.Project</target-class>
   <lookup-expression>getProject(#id)</lookup-expression>
   <elements>
     <!-- TODO: into build definition

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenOneProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenOneProject.xml?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenOneProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenOneProject.xml Wed Aug 17 10:34:49 2005
@@ -1,7 +1,7 @@
 <form>
   <extend>continuumProject</extend>
   <id>maven-1Project</id>
-  <target-class>org.apache.maven.continuum.project.ContinuumProject</target-class>
+  <target-class>org.apache.maven.continuum.model.project.Project</target-class>
   <lookup-expression>getProject(#id)</lookup-expression>
   <elements>
     <!-- TODO - build definition

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/mavenTwoProject.xml Wed Aug 17 10:34:49 2005
@@ -1,7 +1,7 @@
 <form>
   <extend>continuumProject</extend>
   <id>maven2Project</id>
-  <target-class>org.apache.maven.continuum.project.ContinuumProject</target-class>
+  <target-class>org.apache.maven.continuum.model.project.Project</target-class>
   <lookup-expression>getProject(#id)</lookup-expression>
   <elements>
     <!-- TODO: build definition

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml Wed Aug 17 10:34:49 2005
@@ -2,7 +2,7 @@
   <extend>continuumProject</extend>
   <id>shellProject</id>
   <!-- TODO: why not inherited? -->
-  <target-class>org.apache.maven.continuum.project.ContinuumProject</target-class>
+  <target-class>org.apache.maven.continuum.model.project.Project</target-class>
   <lookup-expression>getProject(#id)</lookup-expression>
   <elements>
     <!-- TODO: remove

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpc.java Wed Aug 17 10:34:49 2005
@@ -36,19 +36,17 @@
     // Projects
     // ----------------------------------------------------------------------
 
-    Hashtable removeProject( String projectId );
+    Hashtable removeProject( int projectId );
 
-    Hashtable getProject( String projectId );
+    Hashtable getProject( int projectId );
 
     Hashtable getProjects();
 
-    Hashtable getScmResultForProject( String projectId );
-
     // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
 
-    Hashtable buildProject( String projectId, boolean force );
+    Hashtable buildProject( int projectId, boolean force );
 
     // ----------------------------------------------------------------------
     // Builds

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java Wed Aug 17 10:34:49 2005
@@ -19,8 +19,7 @@
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
-import org.apache.maven.continuum.model.scm.ScmResult;
-import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
@@ -59,7 +58,7 @@
     // ContinuumXmlRpc Implementation
     // ----------------------------------------------------------------------
 
-    public Hashtable removeProject( String projectId )
+    public Hashtable removeProject( int projectId )
     {
         try
         {
@@ -73,11 +72,11 @@
         }
     }
 
-    public Hashtable getProject( String projectId )
+    public Hashtable getProject( int projectId )
     {
         try
         {
-            ContinuumProject project = continuum.getProject( projectId );
+            Project project = continuum.getProject( projectId );
 
             return makeHashtable( "project", convertContinuumProject( project, false ) );
         }
@@ -108,25 +107,11 @@
         }
     }
 
-    public Hashtable getScmResultForProject( String projectId )
-    {
-        try
-        {
-            ScmResult result = continuum.getScmResultForProject( projectId );
-
-            return makeHashtable( "scmResult", convertScmResult( result ) );
-        }
-        catch ( Throwable e )
-        {
-            return handleException( "ContinuumXmlRpc.getScmResultForProject()", "Project id: '" + projectId + "'.", e );
-        }
-    }
-
     // ----------------------------------------------------------------------
     // Build handling
     // ----------------------------------------------------------------------
 
-    public Hashtable buildProject( String projectId, boolean force )
+    public Hashtable buildProject( int projectId, boolean force )
     {
         try
         {
@@ -156,9 +141,9 @@
 
             for ( Iterator it = projects.iterator(); it.hasNext(); )
             {
-                ContinuumProject project = (ContinuumProject) it.next();
+                Project project = (Project) it.next();
 
-                projectIds.add( project.getId() );
+                projectIds.add( new Integer( project.getId() ) );
             }
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
@@ -173,15 +158,15 @@
     {
         try
         {
-            ContinuumProject project = new ContinuumProject();
+            Project project = new Project();
 
             xmlRpcHelper.hashtableToObject( mavenTwoProject, project );
 
-            String projectId = continuum.addProject( project, ContinuumBuildExecutor.MAVEN_TWO_EXECUTOR_ID );
+            int projectId = continuum.addProject( project, ContinuumBuildExecutor.MAVEN_TWO_EXECUTOR_ID );
 
             Collection projectIds = new Vector();
 
-            projectIds.add( projectId );
+            projectIds.add( Integer.toString( projectId ) );
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
         }
@@ -193,11 +178,11 @@
 
     public Hashtable updateMavenTwoProject( Hashtable mavenTwoProject )
     {
-        String id = getId( mavenTwoProject );
+        int id = getId( mavenTwoProject );
 
         try
         {
-            ContinuumProject project = continuum.getProject( id );
+            Project project = continuum.getProject( id );
 
             xmlRpcHelper.hashtableToObject( mavenTwoProject, project );
 
@@ -227,9 +212,9 @@
 
             for ( Iterator it = projects.iterator(); it.hasNext(); )
             {
-                ContinuumProject project = (ContinuumProject) it.next();
+                Project project = (Project) it.next();
 
-                projectIds.add( project.getId() );
+                projectIds.add( new Integer( project.getId() ) );
             }
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
@@ -244,15 +229,15 @@
     {
         try
         {
-            ContinuumProject project = new ContinuumProject();
+            Project project = new Project();
 
             xmlRpcHelper.hashtableToObject( mavenOneProject, project );
 
-            String projectId = continuum.addProject( project, ContinuumBuildExecutor.MAVEN_ONE_EXECUTOR_ID );
+            int projectId = continuum.addProject( project, ContinuumBuildExecutor.MAVEN_ONE_EXECUTOR_ID );
 
             Collection projectIds = new ArrayList();
 
-            projectIds.add( projectId );
+            projectIds.add( Integer.toString( projectId ) );
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
         }
@@ -264,11 +249,11 @@
 
     public Hashtable updateMavenOneProject( Hashtable mavenOneProject )
     {
-        String id = getId( mavenOneProject );
+        int id = getId( mavenOneProject );
 
         try
         {
-            ContinuumProject project = continuum.getProject( id );
+            Project project = continuum.getProject( id );
 
             xmlRpcHelper.hashtableToObject( mavenOneProject, project );
 
@@ -290,15 +275,15 @@
     {
         try
         {
-            ContinuumProject project = new ContinuumProject();
+            Project project = new Project();
 
             xmlRpcHelper.hashtableToObject( antProject, project );
 
-            String projectId = continuum.addProject( project, ShellBuildExecutor.ANT_EXECUTOR_ID );
+            int projectId = continuum.addProject( project, ShellBuildExecutor.ANT_EXECUTOR_ID );
 
             Collection projectIds = new ArrayList();
 
-            projectIds.add( projectId );
+            projectIds.add( Integer.toString( projectId ) );
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
         }
@@ -310,11 +295,11 @@
 
     public Hashtable updateAntProject( Hashtable antProject )
     {
-        String id = getId( antProject );
+        int id = getId( antProject );
 
         try
         {
-            ContinuumProject project = continuum.getProject( id );
+            Project project = continuum.getProject( id );
 
             xmlRpcHelper.hashtableToObject( antProject, project );
 
@@ -336,15 +321,15 @@
     {
         try
         {
-            ContinuumProject project = new ContinuumProject();
+            Project project = new Project();
 
             xmlRpcHelper.hashtableToObject( shellProject, project );
 
-            String projectId = continuum.addProject( project, ShellBuildExecutor.SHELL_EXECUTOR_ID );
+            int projectId = continuum.addProject( project, ShellBuildExecutor.SHELL_EXECUTOR_ID );
 
             Collection projectIds = new ArrayList();
 
-            projectIds.add( projectId );
+            projectIds.add( Integer.toString( projectId ) );
 
             return makeHashtable( "projectIds", xmlRpcHelper.collectionToVector( projectIds, false ) );
         }
@@ -356,11 +341,11 @@
 
     public Hashtable updateShellProject( Hashtable shellProject )
     {
-        String id = getId( shellProject );
+        int id = getId( shellProject );
 
         try
         {
-            ContinuumProject project = continuum.getProject( id );
+            Project project = continuum.getProject( id );
 
             xmlRpcHelper.hashtableToObject( shellProject, project );
 
@@ -378,9 +363,9 @@
     //
     // ----------------------------------------------------------------------
 
-    private String getId( Hashtable hashtable )
+    private int getId( Hashtable hashtable )
     {
-        return (String) hashtable.get( "id" );
+        return Integer.valueOf( (String) hashtable.get( "id" ) ).intValue();
     }
 
     // ----------------------------------------------------------------------
@@ -403,7 +388,7 @@
             excludedProperties.add( "checkOutScmResult" );
         }
 
-        ContinuumProject project = (ContinuumProject) object;
+        Project project = (Project) object;
 
         Hashtable hashtable = xmlRpcHelper.objectToHashtable( project, excludedProperties );
 

Modified: maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java?rev=233212&r1=233211&r2=233212&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java (original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/test/java/org/apache/maven/continuum/xmlrpc/ContinuumXmlRpcTest.java Wed Aug 17 10:34:49 2005
@@ -57,7 +57,7 @@
         //
         // ----------------------------------------------------------------------
 
-        Hashtable hashtable = xmlRpc.getProject( Integer.toString( project.getId() ) );
+        Hashtable hashtable = xmlRpc.getProject( project.getId() );
 
         dumpValue( 0, "result", hashtable );
     }



Mime
View raw message