You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ct...@apache.org on 2011/04/27 03:02:24 UTC

svn commit: r1096976 - in /continuum/trunk: continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src/main/webapp/WEB-INF/jsp/components/

Author: ctan
Date: Wed Apr 27 01:02:24 2011
New Revision: 1096976

URL: http://svn.apache.org/viewvc?rev=1096976&view=rev
Log:
fixed 'invalid project group id' when deleting a project

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java?rev=1096976&r1=1096975&r2=1096976&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenOneProjectTest.java Wed Apr 27 01:02:24 2011
@@ -199,12 +199,12 @@ public class MavenOneProjectTest
         clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
         assertTextPresent( "Delete Continuum Project" );
         clickButtonWithValue( "Delete" );
-        assertProjectGroupsSummaryPage();
-        clickLinkWithText( M1_PROJ_GRP_NAME );
+        assertPage( "Continuum - Project Group" );
+        assertLinkNotPresent( M1_PROJ_GRP_NAME );
         
         // remove group for next test
         removeProjectGroup( M1_PROJ_GRP_NAME );
-        /*
+        
         // delete project - "Delete Project(s)" button
         addMaven1Project( M1_PROJ_GRP_NAME );
         clickLinkWithText( M1_PROJ_GRP_NAME );
@@ -218,7 +218,7 @@ public class MavenOneProjectTest
         if ( !isExisting )
         {
             removeProjectGroup( M1_PROJ_GRP_NAME );
-        }*/
+        }
     }
     
     private void addMaven1Project( String groupName )

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java?rev=1096976&r1=1096975&r2=1096976&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/MavenTwoProjectTest.java Wed Apr 27 01:02:24 2011
@@ -244,14 +244,15 @@ public class MavenTwoProjectTest
         clickLinkWithXPath( "//tbody/tr['0']/td['10']/a/img[@alt='Delete']" );
         assertTextPresent( "Delete Continuum Project" );
         clickButtonWithValue( "Delete" );
-        assertProjectGroupsSummaryPage();
+        assertPage( "Continuum - Project Group" );
+        assertTextNotPresent( "Unable to delete project" );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
         assertTextNotPresent( M2_PROJ_GRP_SCM_ROOT_URL );
 
         // remove group for next test
         removeProjectGroup( M2_PROJ_GRP_NAME );
         assertLinkNotPresent( M2_PROJ_GRP_NAME );
-/*
+
         // delete project - "Delete Project(s)" button
         addMaven2Project( M2_PROJ_GRP_NAME );
         clickLinkWithText( M2_PROJ_GRP_NAME );
@@ -271,7 +272,7 @@ public class MavenTwoProjectTest
 
         // remove project group
         removeProjectGroup( M2_PROJ_GRP_NAME );
-        assertLinkNotPresent( M2_PROJ_GRP_NAME );*/
+        assertLinkNotPresent( M2_PROJ_GRP_NAME );
     }
 
     public void testBuildProjectGroupNoBuildAgentConfigured()

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java?rev=1096976&r1=1096975&r2=1096976&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java (original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/DeleteProjectAction.java Wed Apr 27 01:02:24 2011
@@ -23,6 +23,7 @@ import org.apache.continuum.web.util.Aud
 import org.apache.continuum.web.util.AuditLogConstants;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -135,7 +136,9 @@ public class DeleteProjectAction
             }
             else
             {
-                projectGroupName = getContinuum().getProjectGroupByProjectId( projectId ).getName();
+                ProjectGroup group = getContinuum().getProjectGroupByProjectId( projectId );
+                projectGroupName = group.getName();
+                projectGroupId = group.getId();
             }
         }
 

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp?rev=1096976&r1=1096975&r2=1096976&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp Wed Apr 27 01:02:24 2011
@@ -45,6 +45,7 @@
   <form id="projectsForm" action="ProjectsList.action" method="post">
     <input type="hidden" name="methodToCall" value="" />
     <input type="hidden" name="buildDefinitionId" value="-1" />
+    <input type="hidden" name="projectGroupId" value="${projectGroupId}" />
   <ec:table items="projects"
             var="project"
             autoIncludeParameters="false"
@@ -238,7 +239,6 @@
           <tr>
             <td>
               <redback:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
-                <input type="hidden" name="projectGroupId" value="${projectGroupId}" />
                 <s:select theme="simple" name="buildDef" list="buildDefinitions"
                            listKey="value" listValue="key" headerKey="-1" headerValue="%{getText('projectGroup.buildDefinition.label')}"
                            onchange="$('projectsForm').buildDefinitionId.value=$('buildDef').value" />