Return-Path: Delivered-To: apmail-continuum-commits-archive@www.apache.org Received: (qmail 55321 invoked from network); 25 Feb 2010 05:57:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Feb 2010 05:57:38 -0000 Received: (qmail 27654 invoked by uid 500); 25 Feb 2010 05:57:38 -0000 Delivered-To: apmail-continuum-commits-archive@continuum.apache.org Received: (qmail 27601 invoked by uid 500); 25 Feb 2010 05:57:38 -0000 Mailing-List: contact commits-help@continuum.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@continuum.apache.org Delivered-To: mailing list commits@continuum.apache.org Received: (qmail 27593 invoked by uid 99); 25 Feb 2010 05:57:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 05:57:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Feb 2010 05:57:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 52D8E23888E7; Thu, 25 Feb 2010 05:57:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r916137 - in /continuum/trunk: continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/ac... Date: Thu, 25 Feb 2010 05:57:14 -0000 To: commits@continuum.apache.org From: ctan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100225055714.52D8E23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ctan Date: Thu Feb 25 05:57:13 2010 New Revision: 916137 URL: http://svn.apache.org/viewvc?rev=916137&view=rev Log: [CONTINUUM-2604] show the error message only if there are no project groups to choose from when adding ant/shell project. merge -r 916131 of 1.3.x branch Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java?rev=916137&r1=916136&r2=916137&view=diff ============================================================================== --- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java (original) +++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/AntProjectTest.java Thu Feb 25 05:57:13 2010 @@ -32,8 +32,7 @@ public class AntProjectTest extends AbstractContinuumTest { - // TODO: seems like a bug, currently giving "Project Group is required and all projects must be in a project group" - @Test( enabled = false/*, dependsOnMethods = { "testAddProjectGroup" }*/ ) + @Test( dependsOnMethods = { "testAddProjectGroup" } ) public void testAddAntProject() throws Exception { @@ -49,7 +48,7 @@ String TEST_PROJ_GRP_DESCRIPTION = getProperty( "TEST_PROJ_GRP_DESCRIPTION" ); goToAddAntProjectPage(); addProject( ANT_NAME, ANT_DESCRIPTION, ANT_VERSION, ANT_SCM_URL, ANT_SCM_USERNAME, ANT_SCM_PASSWORD, ANT_TAG, - false, TEST_PROJ_GRP_NAME, null, true ); + false, TEST_PROJ_GRP_NAME, null, true, "ant" ); assertProjectGroupSummaryPage( TEST_PROJ_GRP_NAME, TEST_PROJ_GRP_ID, TEST_PROJ_GRP_DESCRIPTION ); } @@ -63,9 +62,8 @@ assertTextPresent( "SCM Url is required and cannot contain null or spaces only" ); } - // TODO: disabled due to the above test also being disabled - @Test( enabled = false, dependsOnMethods = { "testAddAntProject" } ) - public void testAddDupliedAntProject() + @Test( dependsOnMethods = { "testAddAntProject" } ) + public void testAddDuplicateAntProject() throws Exception { String ANT_NAME = getProperty( "ANT_NAME" ); @@ -77,7 +75,7 @@ String ANT_SCM_PASSWORD = getProperty( "ANT_SCM_PASSWORD" ); goToAddAntProjectPage(); addProject( ANT_NAME, ANT_DESCRIPTION, ANT_VERSION, ANT_SCM_URL, ANT_SCM_USERNAME, ANT_SCM_PASSWORD, ANT_TAG, - false, null, null, false ); + false, null, null, false, "ant" ); assertTextPresent( "Project name already exist" ); } } Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java?rev=916137&r1=916136&r2=916137&view=diff ============================================================================== --- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java (original) +++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ShellProjectTest.java Thu Feb 25 05:57:13 2010 @@ -32,8 +32,6 @@ public class ShellProjectTest extends AbstractContinuumTest { - // TODO: seems like a bug, currently giving "Project Group is required and all projects must be in a project group", and returning to the Ant add page? - @Test( enabled = false ) public void testAddShellProject() throws Exception { @@ -49,7 +47,7 @@ String DEFAULT_PROJ_GRP_DESCRIPTION = getProperty( "DEFAULT_PROJ_GRP_DESCRIPTION" ); goToAddShellProjectPage(); addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME, - SHELL_SCM_PASSWORD, SHELL_TAG, false, DEFAULT_PROJ_GRP_NAME, null, true ); + SHELL_SCM_PASSWORD, SHELL_TAG, false, DEFAULT_PROJ_GRP_NAME, null, true, "shell" ); assertProjectGroupSummaryPage( DEFAULT_PROJ_GRP_NAME, DEFAULT_PROJ_GRP_ID, DEFAULT_PROJ_GRP_DESCRIPTION ); } @@ -63,9 +61,8 @@ assertTextPresent( "SCM Url is required and cannot contain null or spaces only" ); } - // TODO: disabled due to the above test also being disabled - @Test( enabled = false, dependsOnMethods = { "testAddShellProject" } ) - public void testAddDupliedShellProject() + @Test( dependsOnMethods = { "testAddShellProject" } ) + public void testAddDuplicateShellProject() throws Exception { String SHELL_NAME = getProperty( "SHELL_NAME" ); @@ -77,7 +74,7 @@ String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD" ); goToAddShellProjectPage(); addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME, - SHELL_SCM_PASSWORD, SHELL_TAG, false, null, null, false ); + SHELL_SCM_PASSWORD, SHELL_TAG, false, null, null, false, "shell" ); assertTextPresent( "Project name already exist" ); } } Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java?rev=916137&r1=916136&r2=916137&view=diff ============================================================================== --- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java (original) +++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java Thu Feb 25 05:57:13 2010 @@ -766,7 +766,7 @@ public void addProject(String name,String description,String version,String scmUrl,String scmUser, String scmPassword,String scmTag,boolean useCache,String projectGroup, - String buildTemplate,boolean success ) + String buildTemplate,boolean success,String type ) throws Exception { setFieldValue( "projectName", name ); @@ -790,13 +790,14 @@ } submit(); String title; + type = type.substring( 0, 1 ).toUpperCase() + type.substring( 1 ).toLowerCase(); if ( success ) { title = "Continuum - Project Group"; } else { - title = "Continuum - Add "; + title = "Continuum - Add " + type + " Project"; } waitAddProject( title ); } Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=916137&r1=916136&r2=916137&view=diff ============================================================================== --- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java (original) +++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java Thu Feb 25 05:57:13 2010 @@ -87,6 +87,8 @@ private List buildDefinitionTemplates; + private boolean emptyProjectGroups; + public void validate() { clearErrorsAndMessages(); @@ -104,7 +106,7 @@ { addActionError( getText( "addProject.scmUrl.required" ) ); } - if ( selectedProjectGroup == 0 ) + if ( isEmptyProjectGroups() ) { addActionError( getText( "addProject.projectGroup.required" ) ); } @@ -434,4 +436,14 @@ { this.projectDescription = projectDescription; } + + public boolean isEmptyProjectGroups() + { + return emptyProjectGroups; + } + + public void setEmptyProjectGroups( boolean emptyProjectGroups ) + { + this.emptyProjectGroups = emptyProjectGroups; + } } Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp?rev=916137&r1=916136&r2=916137&view=diff ============================================================================== --- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp (original) +++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/addProject.jsp Thu Feb 25 05:57:13 2010 @@ -86,6 +86,14 @@ + + + + + + + +