continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcconn...@apache.org
Subject svn commit: r432677 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/test/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/or...
Date Fri, 18 Aug 2006 18:51:40 GMT
Author: jmcconnell
Date: Fri Aug 18 11:51:38 2006
New Revision: 432677

URL: http://svn.apache.org/viewvc?rev=432677&view=rev
Log:
added remove project group and build project group functionality

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectGroupView.jsp

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=432677&r1=432676&r2=432677&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 18 11:51:38 2006
@@ -57,6 +57,9 @@
 
     public Collection getProjectsInGroup( int projectGroupId )
         throws ContinuumException;
+
+    public void removeProjectGroup( int projectGroupId )
+        throws ContinuumException;
     
     // ----------------------------------------------------------------------
     // Project
@@ -123,6 +126,9 @@
         throws ContinuumException;
 
     void buildProject( int projectId, int buildDefinitionId, int trigger )
+        throws ContinuumException;
+
+    public void buildProjectGroup( int projectGroupId )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=432677&r1=432676&r2=432677&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 18 11:51:38 2006
@@ -215,6 +215,14 @@
         }
     }
 
+    public void removeProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        ProjectGroup projectGroup = getProjectGroup( projectGroupId );
+
+        store.removeProjectGroup( projectGroup );
+    }
+
     // ----------------------------------------------------------------------
     // Projects
     // ----------------------------------------------------------------------
@@ -474,7 +482,7 @@
      * @param trigger
      * @throws ContinuumException
      */
-    public void buildProjectGroup( int projectGroupId, int trigger )
+    public void buildProjectGroup( int projectGroupId )
         throws ContinuumException
     {
         Collection projectsList;
@@ -513,7 +521,7 @@
                     "Project (id=" + project.getId() + " doens't have a default build definition,
this should be even more impossible since store should have throw exception" );
             }
 
-            buildProject( project, buildDefId.intValue(), trigger );
+            buildProject( project, buildDefId.intValue(), ContinuumProjectState.TRIGGER_FORCED
);
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java?rev=432677&r1=432676&r2=432677&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 18 11:51:38 2006
@@ -29,6 +29,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Collection;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -199,5 +200,35 @@
         {
 
         }
+    }
+
+    /**
+     * todo add another project group to test
+     * @throws Exception
+     */
+    public void testProjectGroups()
+        throws Exception
+    {
+        Continuum continuum = (Continuum) lookup( Continuum.ROLE );
+
+        String url = getTestFile( "src/test-projects/project1/pom.xml" ).toURL().toExternalForm();
+
+        ContinuumProjectBuildingResult result = continuum.addMavenTwoProject( url );
+
+        assertNotNull( result );
+
+        Collection projectGroupList = continuum.getAllProjectGroupsWithProjects();
+
+        assertTrue ( "project group missing, should be one project group for now", projectGroupList.size()
== 1 );
+
+        ProjectGroup projectGroup = (ProjectGroup) projectGroupList.iterator().next();
+
+        assertNotNull( projectGroup );
+
+        continuum.removeProjectGroup( projectGroup.getId() );
+
+        projectGroupList = continuum.getAllProjectGroupsWithProjects();
+
+        assertTrue ( "remove project group failed", projectGroupList.size() == 0 );
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=432677&r1=432676&r2=432677&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Fri Aug 18 11:51:38 2006
@@ -63,7 +63,33 @@
     }
 
     public String remove()
-    {        
+    {
+        try
+        {
+            continuum.removeProjectGroup( projectGroupId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionError( "unable to remove project group" );
+            return ERROR;
+        }
+
+        return SUCCESS;
+    }
+
+    public String build()
+    {
+        try
+        {
+            continuum.buildProjectGroup( projectGroupId );
+        }
+        catch ( ContinuumException e )
+        {
+            addActionError( "unable to initiate build of project group" );
+            getLogger().warn( "unable to initiate build of project group " + projectGroupId
);
+            return ERROR;
+        }
+
         return SUCCESS;
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=432677&r1=432676&r2=432677&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Fri Aug 18 11:51:38
2006
@@ -140,7 +140,13 @@
       <result name="success">projectGroupNotifier.jsp</result>
     </action>
 
+    <action name="buildProjectGroup" class="projectGroup" method="build">
+      <result name="success" type="chain">projectGroupView</result>
+    </action>
 
+    <action name="removeProjectGroup" class="projectGroup" method="remove">
+      <result name="success" type="chain">groupSummary</result>
+    </action>
 
     <!--
     * notifier actions

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectGroupView.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectGroupView.jsp?rev=432677&r1=432676&r2=432677&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectGroupView.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectGroupView.jsp Fri Aug 18
11:51:38 2006
@@ -36,7 +36,21 @@
            </table>
         </div>
 
-        <h3>Projects</h3>
+        <h3>Project Group Actions</h3>
+
+        <div class="functnbar3">
+          <!-- switch these to action urls -->
+          <ww:form action="buildProjectGroup" method="post">
+            <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
+            <ww:submit value="Build"/>
+          </ww:form>
+          <ww:form action="removeProjectGroup" method="post">
+            <input type="hidden" name="projectGroupId" value="<ww:property value="projectGroupId"/>"/>
+            <ww:submit value="Remove"/>
+          </ww:form>
+        </div>
+
+        <h3>Member Projects</h3>
 
         <ww:action name="projectSummary" executeResult="true" namespace="component">
           <ww:param name="projectGroupId" value="%{projectGroupId}"/>



Mime
View raw message