continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r232249 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ continuum-api/src/main/java/org/apache/maven/continuum/store/ continuum-cor...
Date Fri, 12 Aug 2005 09:45:55 GMT
Author: brett
Date: Fri Aug 12 02:45:31 2005
New Revision: 232249

URL: http://svn.apache.org/viewcvs?rev=232249&view=rev
Log:
replace project group with the new model version

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
    maven/continuum/trunk/continuum-store/src/main/java/org/apache/maven/continuum/store/JdoContinuumStore.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Fri Aug 12 02:45:31 2005
@@ -22,7 +22,6 @@
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildSettings;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.ContinuumSchedule;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
@@ -92,9 +91,6 @@
         throws ContinuumException;
 
     void buildProject( String projectId, boolean force )
-        throws ContinuumException;
-
-    void buildProjectGroup( ContinuumProjectGroup projectGroup, ContinuumBuildSettings buildSettings
)
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
Fri Aug 12 02:45:31 2005
@@ -16,12 +16,12 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.ProjectGroup;
+import org.apache.maven.continuum.project.ContinuumProject;
+
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -39,7 +39,7 @@
         projects.add( project );
     }
 
-    public void addProjectGroup( ContinuumProjectGroup projectGroup )
+    public void addProjectGroup( ProjectGroup projectGroup )
     {
         projectGroups.add( projectGroup );
     }

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Fri Aug 12 02:45:31 2005
@@ -27,7 +27,6 @@
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildSettings;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.ContinuumSchedule;
 
 import java.io.File;
@@ -109,24 +108,6 @@
     ContinuumSchedule getSchedule( String scheduleId )
         throws ContinuumStoreException;
 
-    ContinuumProjectGroup addProjectGroup( ContinuumProjectGroup projectGroup )
-        throws ContinuumStoreException;
-
-    ContinuumProjectGroup updateProjectGroup( ContinuumProjectGroup projectGroup )
-        throws ContinuumStoreException;
-
-    void removeProjectGroup( String projectGroupId )
-        throws ContinuumStoreException;
-
-    ContinuumProjectGroup getProjectGroup( String projectGroupId )
-        throws ContinuumStoreException;
-
-    ContinuumProjectGroup getProjectGroupByGroupId( String groupId )
-        throws ContinuumStoreException;
-
-    Collection getProjectGroups()
-        throws ContinuumStoreException;
-
     ContinuumBuildSettings addBuildSettings( ContinuumBuildSettings buildSettings )
         throws ContinuumStoreException;
 
@@ -210,4 +191,7 @@
 
     Profile getProfile( int profileId )
         throws ContinuumObjectNotFoundException;
+
+    ProjectGroup getProjectGroupByGroupId( String groupId )
+        throws ContinuumStoreException;
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Fri Aug 12 02:45:31 2005
@@ -32,13 +32,13 @@
 import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
 import org.apache.maven.continuum.initialization.ContinuumInitializer;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildSettings;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.ContinuumSchedule;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
@@ -65,7 +65,6 @@
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 
-import javax.jdo.JDOHelper;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -75,7 +74,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -333,27 +331,6 @@
         }
     }
 
-    public void buildProjectGroup( ContinuumProjectGroup projectGroup, ContinuumBuildSettings
buildSettings )
-        throws ContinuumException
-    {
-        Set projects = projectGroup.getProjects();
-
-        for ( Iterator j = projects.iterator(); j.hasNext(); )
-        {
-            ContinuumProject project = (ContinuumProject) j.next();
-
-            try
-            {
-                buildProject( project.getId(), false );
-            }
-            catch ( ContinuumException ex )
-            {
-                getLogger().error(
-                    "Could not enqueue project: " + project.getId() + " " + "('" + project.getName()
+ "').", ex );
-            }
-        }
-    }
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -599,7 +576,7 @@
             throw new ContinuumException( "The project building result has to contain exactly
one project group." );
         }
 
-        ContinuumProjectGroup projectGroup = (ContinuumProjectGroup) result.getProjectGroups().iterator().next();
+        ProjectGroup projectGroup = (ProjectGroup) result.getProjectGroups().iterator().next();
 
         try
         {
@@ -624,7 +601,7 @@
 
                 executeAction( "store-project-group", pgContext );
 
-                String projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext
);
+                int projectGroupId = AbstractContinuumAction.getProjectGroupId( pgContext
);
 
                 projectGroup = store.getProjectGroup( projectGroupId );
             }
@@ -634,19 +611,6 @@
             throw new ContinuumException( "Error while querying for project group.", e );
         }
 
-        try
-        {
-            System.err.println( "----------------------" );
-            System.err.println( "PRE:" );
-            System.err.println( "projectGroup count: " + store.getProjectGroups().size()
);
-            System.err.println( "project count: " + store.getAllProjects().size() );
-            System.err.println( "----------------------" );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new ContinuumException( "Error while querying for project group.", e );
-        }
-
         // ----------------------------------------------------------------------
         // Save all the projects
         // TODO: Validate all the projects before saving them
@@ -658,60 +622,22 @@
         {
             ContinuumProject project = (ContinuumProject) i.next();
 
-//            for ( Iterator it = result.getProjects().iterator(); it.hasNext(); )
-//            {
-//                ContinuumProject p2 = (ContinuumProject) it.next();
-//
-//                getLogger().info( "Adding project " + p2.getName() + ", project.hashCode():
" + p2.hashCode() );
-//            }
-
             project.setExecutorId( buildExecutorId );
 
             try
             {
-//                System.err.println( "=======================" );
-//                System.err.println( "before store" );
-//                System.err.println( "projectGroup.projects.size: " + store.getProjectGroup(
projectGroup.getId() ).getProjects().size() );
-//                System.err.println( "projectGroup count: " + store.getProjectGroups().size()
);
-//                System.err.println( "project count: " + store.getAllProjects().size() );
-//                for ( Iterator j = store.getAllProjects().iterator(); j.hasNext(); )
-//                {
-//                    project = (ContinuumProject) j.next();
-//                    System.err.println( project.getId() );
-//                }
-//                System.err.println( "=======================" );
-
-                System.err.println( "persisting " + project.getName() + ", id: " + project.getId()
);
                 project = store.addProject( project );
-                System.err.println( "persisting " + project.getName() + ", id: " + project.getId()
);
 
-//                dumpJdoObject( projectGroup, "project group before adding project" );
-//                dumpJdoObject( project, "project before setting project group" );
-                projectGroup.addProject( project );
-//                dumpJdoObject( projectGroup, "project group after adding project" );
-//                dumpJdoObject( project, "project after setting project group" );
-
-                projectGroup = store.updateProjectGroup( projectGroup );
-
-//                System.err.println( "=======================" );
-//                System.err.println( "after store" );
-//                System.err.println( "projectGroup.projects.size: " + store.getProjectGroup(
projectGroup.getId() ).getProjects().size() );
-//                System.err.println( "projectGroup count: " + store.getProjectGroups().size()
);
-//                System.err.println( "project count: " + store.getAllProjects().size() );
-//                for ( Iterator j = store.getAllProjects().iterator(); j.hasNext(); )
-//                {
-//                    project = (ContinuumProject) j.next();
-//                    System.err.println( "project: id: " + project.getId() + ", name: "
+ project.getName() );
-//                }
-//                System.err.println( "=======================" );
+                // TODO: store operation for this instead
+//                projectGroup.addProject( project );
+
+                store.updateProjectGroup( projectGroup );
             }
             catch ( ContinuumStoreException e )
             {
                 throw new ContinuumException( "crap", e );
             }
 
-//            project.setProjectGroup( projectGroup );
-//
             context = new HashMap();
 
             context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
@@ -725,34 +651,7 @@
             executeAction( "add-project-to-checkout-queue", context );
         }
 
-//        try
-//        {
-//            System.err.println( "----------------------" );
-//            System.err.println( "POST:" );
-//            System.err.println( "projectGroup count: " + store.getProjectGroups().size()
);
-//            System.err.println( "project count: " + store.getAllProjects().size() );
-//            System.err.println( "----------------------" );
-//        }
-//        catch ( ContinuumStoreException e )
-//        {
-//            throw new ContinuumException( "Error while querying for the project group.",
e );
-//        }
-
         return result;
-    }
-
-    private void dumpJdoObject( Object object, String message )
-    {
-        getLogger().debug( "---------- Dumping JDO Object: " + message );
-        getLogger().debug( "object.hashCode: " + object.hashCode() );
-        getLogger().debug( "persistent: " + JDOHelper.isPersistent( object ) );
-        getLogger().debug( "transactional: " + JDOHelper.isTransactional( object ) );
-        getLogger().debug( "dirty: " + JDOHelper.isDirty( object ) );
-        getLogger().debug( "new: " + JDOHelper.isNew( object ) );
-        getLogger().debug( "deleted: " + JDOHelper.isDeleted( object ) );
-        getLogger().debug( "detached: " + JDOHelper.isDetached( object ) );
-        getLogger().debug( "object id: " + JDOHelper.getObjectId( object ) );
-        getLogger().debug( "----------" );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Fri Aug 12 02:45:31 2005
@@ -16,9 +16,9 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.codehaus.plexus.action.AbstractAction;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -83,9 +83,9 @@
         return getString( context, KEY_PROJECT_ID );
     }
 
-    public static String getProjectGroupId( Map context )
+    public static int getProjectGroupId( Map context )
     {
-        return getString( context, KEY_PROJECT_GROUP_ID );
+        return Integer.valueOf( getString( context, KEY_PROJECT_GROUP_ID ) ).intValue();
     }
 
     public static String getBuildId( Map context )
@@ -103,9 +103,9 @@
         return (ContinuumProject) getObject( context, KEY_UNVALIDATED_PROJECT );
     }
 
-    public static ContinuumProjectGroup getUnvalidatedProjectGroup( Map context )
+    public static ProjectGroup getUnvalidatedProjectGroup( Map context )
     {
-        return (ContinuumProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP
);
+        return (ProjectGroup) getObject( context, KEY_UNVALIDATED_PROJECT_GROUP );
     }
 
     public static File getWorkingDirectory( Map context )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectGroupAction.java
Fri Aug 12 02:45:31 2005
@@ -1,7 +1,7 @@
 package org.apache.maven.continuum.core.action;
 
 import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
@@ -19,7 +19,7 @@
     public void execute( Map context )
         throws ContinuumException, ContinuumStoreException
     {
-        ContinuumProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
+        ProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
 
         // ----------------------------------------------------------------------
         //
@@ -27,7 +27,7 @@
 
         projectGroup = store.addProjectGroup( projectGroup );
 
-        context.put( KEY_PROJECT_GROUP_ID, projectGroup.getId() );
+        context.put( KEY_PROJECT_GROUP_ID, Integer.toString( projectGroup.getId() ) );
 
         store.updateProjectGroup( projectGroup );
     }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProjectGroup.java
Fri Aug 12 02:45:31 2005
@@ -3,7 +3,7 @@
  */
 package org.apache.maven.continuum.core.action;
 
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 
 import java.util.Map;
 
@@ -17,7 +17,7 @@
     public void execute( Map context )
         throws Exception
     {
-        ContinuumProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
+        ProjectGroup projectGroup = getUnvalidatedProjectGroup( context );
 
         // TODO: assert that the name is unique
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
Fri Aug 12 02:45:31 2005
@@ -19,8 +19,8 @@
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneMetadataHelper;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneMetadataHelperException;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.project.MavenOneProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.builder.AbstractContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -39,7 +39,9 @@
 {
     public static final String ID = "maven-one-builder";
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private MavenOneMetadataHelper metadataHelper;
 
     // ----------------------------------------------------------------------
@@ -84,7 +86,7 @@
         // This is a hack.
         // ----------------------------------------------------------------------
 
-        ContinuumProjectGroup projectGroup = new ContinuumProjectGroup();
+        ProjectGroup projectGroup = new ProjectGroup();
 
         projectGroup.setName( "Maven 1 group" );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
Fri Aug 12 02:45:31 2005
@@ -19,7 +19,7 @@
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper;
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelperException;
 import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.builder.AbstractContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
@@ -104,7 +104,7 @@
 
         if ( groupPom )
         {
-            ContinuumProjectGroup projectGroup = buildProjectGroup( mavenProject );
+            ProjectGroup projectGroup = buildProjectGroup( mavenProject );
 
             if ( projectGroup != null )
             {
@@ -170,9 +170,9 @@
         }
     }
 
-    private ContinuumProjectGroup buildProjectGroup( MavenProject mavenProject )
+    private ProjectGroup buildProjectGroup( MavenProject mavenProject )
     {
-        ContinuumProjectGroup projectGroup = new ContinuumProjectGroup();
+        ProjectGroup projectGroup = new ProjectGroup();
 
         // ----------------------------------------------------------------------
         // Group id
@@ -208,9 +208,9 @@
         // URL
         // ----------------------------------------------------------------------
 
+/*
         projectGroup.setUrl( mavenProject.getUrl() );
 
-/*
         // ----------------------------------------------------------------------
         //
         // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
Fri Aug 12 02:45:31 2005
@@ -60,7 +60,7 @@
 
         int projectCount = getStore().getAllProjects().size();
 
-        int projectGroupCount = getStore().getProjectGroups().size();
+        int projectGroupCount = getStore().getAllProjectGroupsWithProjects().size();
 
         File rootPom = getTestFile( "src/test/resources/projects/continuum/continuum-notifiers/pom.xml"
);
 
@@ -76,11 +76,12 @@
 
         System.err.println( "number of projects: " + getStore().getAllProjects().size() );
 
-        System.err.println( "number of project groups: " + getStore().getProjectGroups().size()
);
+        System.err.println( "number of project groups: " + getStore().getAllProjectGroupsWithProjects().size()
);
 
         assertEquals( "Total project count", projectCount + 2, getStore().getAllProjects().size()
);
 
-        assertEquals( "Total project group count.", projectGroupCount + 1, getStore().getProjectGroups().size()
);
+        assertEquals( "Total project group count.", projectGroupCount + 1,
+                      getStore().getAllProjectGroupsWithProjects().size() );
 
         Map projects = new HashMap();
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Fri Aug 12 02:45:31 2005
@@ -16,8 +16,8 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.model.project.ProjectNotifier;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -138,7 +138,7 @@
 
         assertEquals( 1, result.getProjectGroups().size() );
 
-        ContinuumProjectGroup projectGroup = (ContinuumProjectGroup) result.getProjectGroups().iterator().next();
+        ProjectGroup projectGroup = (ProjectGroup) result.getProjectGroups().iterator().next();
 
         assertEquals( "projectGroup.groupId", "org.apache.maven.continuum", projectGroup.getGroupId()
);
 
@@ -146,7 +146,7 @@
 
         assertEquals( "projectGroup.description", "Continuum Project Description", projectGroup.getDescription()
);
 
-        assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl()
);
+//        assertEquals( "projectGroup.url", "http://cvs.continuum.codehaus.org/", projectGroup.getUrl()
);
 
         // ----------------------------------------------------------------------
         // Assert the projects built

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo Fri Aug 12 02:45:31 2005
@@ -833,7 +833,7 @@
           <version>1.0.0</version>
           <type>Set</type>
           <association stash.part="false">
-            <type>ContinuumProjectGroup</type>
+            <type>ProjectGroup</type>
           </association>
         </field>
       </fields>
@@ -1030,51 +1030,6 @@
           <version>1.0.0</version>
           <association stash.part="true">
             <type>ScmResult</type>
-          </association>
-        </field>
-      </fields>
-    </class>
-
-    <!-- New Object Model -->
-
-    <class>
-      <packageName>org.apache.maven.continuum.project</packageName>
-      <name>ContinuumProjectGroup</name>
-      <version>1.0.0</version>
-      <fields>
-        <field>
-          <name>id</name>
-          <version>1.0.0</version>
-          <type>String</type>
-          <identifier>true</identifier>
-        </field>
-        <field>
-          <name>groupId</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>name</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>description</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>url</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>projects</name>
-          <version>1.0.0</version>
-          <type>Set</type>
-          <association stash.part="false">
-            <type>ContinuumProject</type>
-            <multiplicity>*</multiplicity>
           </association>
         </field>
       </fields>

Modified: maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo?rev=232249&r1=232248&r2=232249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo Fri Aug
12 02:45:31 2005
@@ -109,23 +109,6 @@
       <field name="scmResult" persistence-modifier="persistent" default-fetch-group="true"
dependent="true"/>
     </class>
 
-    <!-- New Object Model -->
-
-    <class name="ContinuumProjectGroup" detachable="true" identity-type="application"
-           objectid-class="javax.jdo.identity.StringIdentity" table="project_group">
-      <field name="id" persistence-modifier="persistent" primary-key="true" value-strategy="native"/>
-      <field name="groupId" persistence-modifier="persistent"/>
-      <field name="name" persistence-modifier="persistent"/>
-      <field name="description" persistence-modifier="persistent"/>
-      <field name="url" persistence-modifier="persistent"/>
-      <field name="projects" persistence-modifier="persistent" mapped-by="projectGroup">
-        <collection element-type="ContinuumProject"/>
-      </field>
-      <fetch-group name="project-group-detail">
-        <field name="projects"/>
-      </fetch-group>
-    </class>
-
     <class name="ContinuumBuildSettings" detachable="true">
       <field name="name" persistence-modifier="persistent"/>
       <field name="cronExpression" persistence-modifier="persistent"/>

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=232249&r1=232248&r2=232249&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
Fri Aug 12 02:45:31 2005
@@ -27,7 +27,6 @@
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildSettings;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ContinuumProjectGroup;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.ContinuumSchedule;
 import org.codehaus.plexus.jdo.JdoFactory;
@@ -75,8 +74,6 @@
 
     private static final String BUILD_DETAIL_FG = "build-detail";
 
-    private static final String PROJECT_GROUP_DETAIL_FG = "project-group-detail";
-
     private static final String SCHEDULE_DETAIL_FG = "schedule-detail";
 
     private static final String BUILD_SETTINGS_DETAIL_FG = "build-settings-detail";
@@ -128,7 +125,7 @@
 
             if ( project.getProjectGroup() != null )
             {
-                ContinuumProjectGroup pg = project.getProjectGroup();
+                ProjectGroup pg = project.getProjectGroup();
 
                 pg.getProjects().remove( project );
             }
@@ -597,90 +594,6 @@
         return notifier;
     }
 
-    public ContinuumProjectGroup addProjectGroup( ContinuumProjectGroup projectGroup )
-        throws ContinuumStoreException
-    {
-        return (ContinuumProjectGroup) addObject( projectGroup, PROJECT_GROUP_DETAIL_FG );
-    }
-
-    public ContinuumProjectGroup updateProjectGroup( ContinuumProjectGroup projectGroup )
-        throws ContinuumStoreException
-    {
-        updateObject( projectGroup );
-        return projectGroup;
-    }
-
-    public Collection getProjectGroups()
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            Extent extent = pm.getExtent( ContinuumProjectGroup.class, true );
-
-            Query query = pm.newQuery( extent );
-
-            query.setOrdering( "name ascending" );
-
-            Collection result = (Collection) query.execute();
-
-            result = pm.detachCopyAll( result );
-
-            tx.commit();
-
-            return result;
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public void removeProjectGroup( String projectGroupId )
-        throws ContinuumStoreException
-    {
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        Transaction tx = pm.currentTransaction();
-
-        try
-        {
-            tx.begin();
-
-            Object id = pm.newObjectIdInstance( ContinuumProjectGroup.class, projectGroupId
);
-
-            ContinuumProjectGroup projectGroup = (ContinuumProjectGroup) pm.getObjectById(
id );
-
-            pm.deletePersistent( projectGroup );
-
-            tx.commit();
-        }
-        finally
-        {
-            rollback( tx );
-        }
-    }
-
-    public ContinuumProjectGroup getProjectGroup( String projectGroupId )
-        throws ContinuumStoreException
-    {
-        return (ContinuumProjectGroup) getDetailedObject( ContinuumProjectGroup.class, projectGroupId,
-                                                          PROJECT_GROUP_DETAIL_FG );
-    }
-
-    public ContinuumProjectGroup getProjectGroupByGroupId( String groupId )
-        throws ContinuumStoreException
-    {
-        return (ContinuumProjectGroup) getObjectFromQuery( ContinuumProjectGroup.class, "groupId",
groupId,
-                                                           PROJECT_GROUP_DETAIL_FG );
-
-    }
-
     public ContinuumBuildSettings addBuildSettings( ContinuumBuildSettings buildSettings
)
         throws ContinuumStoreException
     {
@@ -1346,4 +1259,9 @@
         }
     }
 
+    public ProjectGroup getProjectGroupByGroupId( String groupId )
+        throws ContinuumStoreException
+    {
+        return (ProjectGroup) getObjectFromQuery( ProjectGroup.class, "groupId", groupId,
null );
+    }
 }



Mime
View raw message