continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1373223 - in /continuum/trunk/continuum-webapp-test/src/test: resources/ testng/org/apache/continuum/web/test/ testng/org/apache/continuum/web/test/parent/
Date Wed, 15 Aug 2012 06:03:19 GMT
Author: brett
Date: Wed Aug 15 06:03:18 2012
New Revision: 1373223

URL: http://svn.apache.org/viewvc?rev=1373223&view=rev
Log:
make distributed build tests more independent and adjust for flow on effects

Removed:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildEnvironmentTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractConfigurationTest.java
Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractContinuumTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Wed Aug 15 06:03:18 2012
@@ -44,6 +44,7 @@ MAVEN2_POM_PROJECT_GROUP_DESCRIPTION=
 MAVEN2_POM_PROJECT_GROUP_SCM_ROOT_URL=scm:svn:${svn.base.url}/trunk/simple-example
 
 MAVEN2_PROJECT_WITH_TAG_POM_URL=http://localhost:9595/example-projects/continuum-2437-example/pom.xml
+MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_NAME=Continuum 2437 Example Project
 # values used for "Defined by POM" - tests should clean up this group afterwards if added
 MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_NAME=Continuum 2437 Example Project
 MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_GROUP_ID=org.apache.continuum.examples
@@ -79,6 +80,16 @@ MAVEN1_POM_URL=http://localhost:9595/exa
 MAVEN1_POM_USERNAME=
 MAVEN1_POM_PASSWORD=
 
+# Shell projects to load
+
+SHELL_PROJECT_NAME=Test Shell Project
+SHELL_PROJECT_DESCRIPTION=This is a sample Shell Project used for testing
+SHELL_PROJECT_VERSION=1.0.0-SNAPSHOT
+SHELL_PROJECT_TAG=
+SHELL_PROJECT_SCM_URL=scm:svn:${svn.base.url}/trunk/shell/
+SHELL_PROJECT_SCM_USERNAME=
+SHELL_PROJECT_SCM_PASSWORD=
+
 # Default project group
 
 DEFAULT_PROJECT_GROUP_NAME=Default Project Group
@@ -155,6 +166,16 @@ ANT_PROJECT_GROUP_NAME=Ant Project Group
 ANT_PROJECT_GROUP_ID=com.example.ant
 ANT_PROJECT_GROUP_DESCRIPTION=Group for Ant test projects
 
+# Distributed build properties
+
+DISTRIBUTED_PROJECT_GROUP_NAME=Distributed Build Test Project Group
+DISTRIBUTED_PROJECT_GROUP_ID=org.apache.continuum.examples.distributed
+DISTRIBUTED_PROJECT_GROUP_DESCRIPTION=
+
+DISTRIBUTED_BUILD_ENV_NAME=Distributed Build Env
+DISTRIBUTED_BUILD_AGENT_GROUP_NAME=Distributed Build Agent Group
+DISTRIBUTED_DUPLICATE_BUILD_ENV=Distributed Duplicate Build Env
+
 # Release test properties
 
 RELEASE_PROJECT_GROUP_NAME=Distributed Release Test Project Group
@@ -165,6 +186,10 @@ RELEASE_PROJECT_VERSION=1.0
 RELEASE_PROJECT_DEVELOPMENT_VERSION=1.1-SNAPSHOT
 RELEASE_PROJECT_SCM_URL=scm:svn:${svn.base.url}/trunk/simple-example
 
+RELEASE_BUILD_ENV=RELEASE_BUILD_ENV
+RELEASE_BUILD_AGENT_GROUP=RELEASE_BUILDAGENT_GROUP
+RELEASE_NO_AGENT_MESSAGE=Unable to prepare release because build agent
+
 # Report test properties
 
 REPORT_PROJECT_GROUP_NAME=Report Test Project Group
@@ -201,25 +226,12 @@ DEFAULT_PROJ_GRP_DESCRIPTION=Contains al
 M2_POM_URL=http://localhost:9595/example-projects/continuum-build-queue-test-data/pom.xml
 M2_POM_USERNAME=
 M2_POM_PASSWORD=
-M2_PROJ_GRP_NAME=ContinuumBuildQueueTestData
-M2_PROJ_GRP_ID=org.apache.continuum
-M2_PROJ_GRP_DESCRIPTION=Project for testing continuum build queue
 
 # Properties for testDeleteMavenTwoProject
 M2_DELETE_POM_URL=http://localhost:9595/example-projects/simple-example/pom.xml
 M2_DELETE_PROJ_GRP_NAME=Continuum Simple Example Project
 M2_DELETE_PROJ_GRP_ID=org.apache.continuum.examples.simple
 
-# Properties for testBuildMaven2ProjectWithTag
-M2_PROJ_WITH_TAG_POM_URL=http://localhost:9595/example-projects/continuum-2437-example/pom.xml
-M2_PROJ_WITH_TAG_PROJ_GRP_NAME=Continuum 2437 Example Project
-M2_PROJ_WITH_TAG_PROJ_GRP_ID=org.apache.continuum.examples
-
-# Properties for testReleasePrepareProjectWithNoBuildagentInBuildEnvironment
-M2_RELEASE_BUILD_ENV=RELEASE_BUILD_ENV
-M2_RELEASE_AGENT_GROUP=RELEASE_BUILDAGENT_GROUP
-M2_RELEASE_NO_AGENT_MESSAGE=Unable to prepare release because build agent
-
 ########################
 # shellProject group 
 ########################
@@ -232,18 +244,6 @@ SHELL_SCM_URL=http://localhost:9595/exam
 SHELL_SCM_USERNAME=
 SHELL_SCM_PASSWORD=
 
-SHELL_GROUP_NAME=Shell Group
-SHELL_GROUP_ID=Shell Group Id
-SHELL_GROUP_DESC=Shell Group Description
-
-SHELL_NAME_TWO=Shell Project Two
-SHELL_DESCRIPTION_TWO=This is a sample Shell Project used for testing
-SHELL_VERSION_TWO=1.0.0-SNAPSHOT
-SHELL_TAG_TWO=
-SHELL_SCM_URL_TWO=scm:svn:${svn.base.url}/trunk/shell/
-SHELL_SCM_USERNAME_TWO=
-SHELL_SCM_PASSWORD_TWO=
-
 ########################
 # projectGroup group 
 ########################

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildAgentsTest.java Wed Aug 15 06:03:18 2012
@@ -25,29 +25,39 @@ import org.testng.annotations.AfterMetho
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-@Test( groups = {"agent"} )
+import java.io.UnsupportedEncodingException;
+
+@Test( groups = { "agent" } )
 public class BuildAgentsTest
     extends AbstractBuildAgentsTest
 {
+    private String buildAgentGroup;
+
+    private String buildAgentDescription;
+
     @BeforeMethod
     public void setUp()
     {
         enableDistributedBuilds();
+
+        buildAgentGroup = getProperty( "BUILD_AGENT_GROUPNAME" );
+
+        buildAgentDescription = getProperty( "BUILD_AGENT_DESCRIPTION" );
     }
 
     @AfterMethod
     public void tearDown()
+        throws UnsupportedEncodingException
     {
+        removeBuildAgentGroup( buildAgentGroup, false );
+
         disableDistributedBuilds();
     }
 
     public void testAddBuildAgent()
     {
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
-
         goToAddBuildAgent();
-        addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, true, true, true );
+        addBuildAgent( buildAgentUrl, buildAgentDescription, true, true, true );
     }
 
     public void testAddBuildAgentWithXSS()
@@ -62,183 +72,132 @@ public class BuildAgentsTest
 
     public void testViewBuildAgentInstallationXSS()
     {
-        getSelenium().open( baseUrl +
-                                "/security/viewBuildAgent.action?buildAgent.url=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E" );
+        String url = baseUrl
+            + "/security/viewBuildAgent.action?buildAgent.url=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E";
+        getSelenium().open( url );
         Assert.assertFalse( getSelenium().isAlertPresent() );
         assertTextPresent( "<script>alert('xss')</script>" );
     }
 
     public void testEditBuildAgentXSS()
     {
-        getSelenium().open( baseUrl +
-                                "/security/editBuildAgent.action?buildAgent.url=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E" );
+        String url = baseUrl
+            + "/security/editBuildAgent.action?buildAgent.url=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E";
+        getSelenium().open( url );
         Assert.assertFalse( getSelenium().isAlertPresent() );
     }
 
-    @Test( dependsOnMethods = {"testEditBuildAgent"} )
+    @Test( dependsOnMethods = { "testAddBuildAgent" } )
     public void testAddAnExistingBuildAgent()
     {
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
-
         goToAddBuildAgent();
-        addBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION, false, false, true );
+        addBuildAgent( buildAgentUrl, buildAgentDescription, false, false, true );
         assertTextPresent( "Build agent already exists" );
     }
 
-    @Test( dependsOnMethods = {"testAddBuildAgent"} )
+    @Test( dependsOnMethods = { "testAddBuildAgent" } )
     public void testEditBuildAgent()
     {
-        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
-
-        addBuildAgent( getBuildAgentUrl(), BUILD_AGENT_DESCRIPTION );
+        addBuildAgent( buildAgentUrl, buildAgentDescription );
 
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
         String new_agentDescription = "new_agentDescription";
 
-        goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
-        addEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription );
-        goToEditBuildAgent( BUILD_AGENT_NAME, new_agentDescription );
-        addEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
+        goToEditBuildAgent( buildAgentUrl, buildAgentDescription );
+        addEditBuildAgent( buildAgentUrl, new_agentDescription );
+        goToEditBuildAgent( buildAgentUrl, new_agentDescription );
+        addEditBuildAgent( buildAgentUrl, buildAgentDescription );
     }
 
-    @Test( dependsOnMethods = {"testAddAnExistingBuildAgent", "testDeleteBuildAgentGroup"} )
     public void testDeleteBuildAgent()
         throws Exception
     {
+        addBuildAgent( buildAgentUrl, buildAgentDescription );
+
         goToBuildAgentPage();
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        removeBuildAgent( BUILD_AGENT_NAME );
-        assertTextNotPresent( BUILD_AGENT_NAME );
+        removeBuildAgent( buildAgentUrl );
+        assertTextNotPresent( buildAgentUrl );
     }
 
-    @Test( dependsOnMethods = {"testDeleteBuildAgent"} )
     public void testAddEmptyBuildAgent()
     {
-        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
-
         goToAddBuildAgent();
-        addBuildAgent( "", BUILD_AGENT_DESCRIPTION, false, false, false );
+        addBuildAgent( "", buildAgentDescription, false, false, false );
         assertTextPresent( "Build agent url is required." );
     }
 
-    @Test( dependsOnMethods = {"testDeleteBuildAgent"}, enabled = false )
-    public void testBuildSuccessWithDistributedBuildsAfterDisableEnableOfBuildAgent()
-        throws Exception
-    {
-        addBuildAgent( getBuildAgentUrl() );
-
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_DESCRIPTION = getProperty( "BUILD_AGENT_DESCRIPTION" );
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-        String M2_POM_URL = getProperty( "M2_DELETE_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
-
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        goToProjectGroupsSummaryPage();
-        assertLinkPresent( M2_PROJ_GRP_NAME );
-
-        clickLinkWithText( M2_PROJ_GRP_NAME );
-
-        assertPage( "Continuum - Project Group" );
-
-        // disable then enable build agent
-        goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
-        enableDisableBuildAgent( BUILD_AGENT_NAME, false );
-        goToEditBuildAgent( BUILD_AGENT_NAME, BUILD_AGENT_DESCRIPTION );
-        enableDisableBuildAgent( BUILD_AGENT_NAME, true );
-
-        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true );
-
-        removeProjectGroup( M2_PROJ_GRP_NAME );
-        assertLinkNotPresent( M2_PROJ_GRP_NAME );
-    }
-
     //TESTS FOR BUILD AGENT GROUPS
 
-    @Test( dependsOnMethods = {"testAddBuildAgent"} )
     public void testAddBuildAgentGroupXSS()
         throws Exception
     {
-        addBuildAgent( getBuildAgentUrl() );
+        addBuildAgent( buildAgentUrl );
 
         goToAddBuildAgentGroup();
-        addEditBuildAgentGroup( "%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E", new String[]{}, new String[]{},
+        addEditBuildAgentGroup( "%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E", new String[]{ }, new String[]{ },
                                 false );
         assertTextPresent( "Build agent group name contains invalid characters" );
     }
 
     public void testEditBuildAgentGroupXSS()
     {
-        getSelenium().open( baseUrl +
-                                "/security/editBuildAgentGroup.action?buildAgentGroup.name=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E" );
+        String url = baseUrl
+            + "/security/editBuildAgentGroup.action?buildAgentGroup.name=test%3Cscript%3Ealert%28%27xss%27%29%3C/script%3E";
+        getSelenium().open( url );
         Assert.assertFalse( getSelenium().isAlertPresent() );
     }
 
     public void testAddBuildAgentGroup()
         throws Exception
     {
-        addBuildAgent( getBuildAgentUrl() );
-
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+        addBuildAgent( buildAgentUrl );
 
         goToAddBuildAgentGroup();
-        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[]{BUILD_AGENT_NAME}, new String[]{}, true );
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{ }, true );
     }
 
-    @Test( dependsOnMethods = {"testAddBuildAgentGroup"} )
+    @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
     public void testEditBuildAgentGroup()
         throws Exception
     {
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
-
         String newName = "new_agentgroupname";
-        goToEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[]{BUILD_AGENT_NAME} );
-        addEditBuildAgentGroup( newName, new String[]{}, new String[]{BUILD_AGENT_NAME}, true );
-        goToEditBuildAgentGroup( newName, new String[]{} );
-        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[]{BUILD_AGENT_NAME}, new String[]{}, true );
+        goToEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl } );
+        addEditBuildAgentGroup( newName, new String[]{ }, new String[]{ buildAgentUrl }, true );
+        goToEditBuildAgentGroup( newName, new String[]{ } );
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{ }, true );
     }
 
-    @Test( dependsOnMethods = {"testEditBuildAgentGroup"} )
+    @Test( dependsOnMethods = { "testAddBuildAgentGroup" } )
     public void testAddAnExistingBuildAgentGroup()
         throws Exception
     {
-        String BUILD_AGENT_NAME = getBuildAgentUrl();
-        String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
-
         goToAddBuildAgentGroup();
-        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[]{BUILD_AGENT_NAME}, new String[]{}, false );
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{ }, false );
         assertTextPresent( "Build agent group already exists." );
     }
 
-    @Test( dependsOnMethods = {"testAddAnExistingBuildAgentGroup"} )
     public void testAddEmptyBuildAgentGroupName()
         throws Exception
     {
         goToAddBuildAgentGroup();
-        addEditBuildAgentGroup( "", new String[]{}, new String[]{}, false );
+        addEditBuildAgentGroup( "", new String[]{ }, new String[]{ }, false );
         assertTextPresent( "Build agent group name is required." );
     }
 
-    @Test( dependsOnMethods = {"testAddEmptyBuildAgentGroupName"} )
     public void testDeleteBuildAgentGroup()
+        throws UnsupportedEncodingException
     {
-        String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
+        addBuildAgent( buildAgentUrl );
 
-        removeBuildAgentGroup( BUILD_AGENT_GROUPNAME );
+        goToAddBuildAgentGroup();
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ buildAgentUrl }, new String[]{ }, true );
+
+        removeBuildAgentGroup( buildAgentGroup );
     }
 
-    @Test( dependsOnMethods = {"testDeleteBuildAgentGroup"} )
     public void testAddBuildAgentGroupWithEmptyBuildAgent()
         throws Exception
     {
-        String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
-
         goToAddBuildAgentGroup();
-        addEditBuildAgentGroup( BUILD_AGENT_GROUPNAME, new String[]{}, new String[]{}, true );
+        addEditBuildAgentGroup( buildAgentGroup, new String[]{ }, new String[]{ }, true );
     }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/BuildEnvironmentTest.java Wed Aug 15 06:03:18 2012
@@ -19,123 +19,111 @@ package org.apache.continuum.web.test;
  * under the License.
  */
 
-import org.apache.continuum.web.test.parent.AbstractBuildEnvironmentTest;
+import org.apache.continuum.web.test.parent.AbstractAdminTest;
 import org.testng.annotations.Test;
 
 /**
  * @author José Morales Martínez
  * @version $Id$
  */
-@Test( groups = {"buildEnvironment"} )
+@Test( groups = { "buildEnvironment" } )
 public class BuildEnvironmentTest
-    extends AbstractBuildEnvironmentTest
+    extends AbstractAdminTest
 {
     public void testAddBuildEnvironment()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         goToAddBuildEnvironment();
-        addBuildEnvironment( BUILD_ENV_NAME, new String[]{}, true );
+        addBuildEnvironment( BUILD_ENV_NAME, new String[]{ }, true );
     }
 
     public void testAddInvalidBuildEnvironment()
     {
         goToAddBuildEnvironment();
-        addBuildEnvironment( "", new String[]{}, false );
+        addBuildEnvironment( "", new String[]{ }, false );
         assertTextPresent( "You must define a name" );
     }
 
     public void testAddBuildEnvironmentWithXSS()
     {
         goToAddBuildEnvironment();
-        addBuildEnvironment( "<script>alert('gotcha')</script>", new String[]{}, false );
+        addBuildEnvironment( "<script>alert('gotcha')</script>", new String[]{ }, false );
         assertTextPresent( "Build environment name contains invalid characters." );
     }
 
-    @Test( dependsOnMethods = {"testAddBuildEnvironment"} )
+    @Test( dependsOnMethods = { "testAddBuildEnvironment" } )
     public void testEditInvalidBuildEnvironment()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         goToEditBuildEnvironment( BUILD_ENV_NAME );
-        editBuildEnvironment( "", new String[]{}, false );
+        editBuildEnvironment( "", new String[]{ }, false );
         assertTextPresent( "You must define a name" );
     }
 
-    @Test( dependsOnMethods = {"testAddBuildEnvironment"} )
+    @Test( dependsOnMethods = { "testAddBuildEnvironment" } )
     public void testAddDuplicatedBuildEnvironment()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         goToAddBuildEnvironment();
-        addBuildEnvironment( BUILD_ENV_NAME, new String[]{}, false );
+        addBuildEnvironment( BUILD_ENV_NAME, new String[]{ }, false );
         assertTextPresent( "A Build Environment with the same name already exists" );
     }
 
-    @Test( dependsOnMethods = {"testAddBuildEnvironment"} )
+    @Test( dependsOnMethods = { "testAddBuildEnvironment" } )
     public void testEditBuildEnvironment()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         String newName = "new_name";
         goToEditBuildEnvironment( BUILD_ENV_NAME );
-        editBuildEnvironment( newName, new String[]{}, true );
+        editBuildEnvironment( newName, new String[]{ }, true );
         // TODO: ADD INSTALLATIONS TO ENVIROTMENT
         goToEditBuildEnvironment( newName );
-        editBuildEnvironment( BUILD_ENV_NAME, new String[]{}, true );
+        editBuildEnvironment( BUILD_ENV_NAME, new String[]{ }, true );
     }
 
-    @Test( dependsOnMethods = {"testEditInvalidBuildEnvironment", "testEditBuildEnvironment",
-        "testAddDuplicatedBuildEnvironment", "testEditInvalidBuildEnvironment"} )
+    @Test( dependsOnMethods = { "testEditInvalidBuildEnvironment", "testEditBuildEnvironment",
+        "testAddDuplicatedBuildEnvironment", "testEditInvalidBuildEnvironment" } )
     public void testDeleteBuildEnvironment()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         removeBuildEnvironment( BUILD_ENV_NAME );
     }
 
-    @Test( dependsOnMethods = {"testDeleteBuildEnvironment", "testAddBuildAgentGroupWithEmptyBuildAgent"} )
-    public void testAddBuildEnvironmentWithBuildAgentGroup()
-    {
-        try
-        {
-            enableDistributedBuilds();
-
-            String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
-            String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
-            goToAddBuildEnvironment();
-            addBuildEnvironmentWithBuildAgentGroup( BUILD_ENV_NAME, new String[]{}, BUILD_AGENT_GROUPNAME );
-        }
-        finally
-        {
-            disableDistributedBuilds();
-        }
-    }
-
-    @Test( dependsOnMethods = {"testAddBuildEnvironmentWithBuildAgentGroup"} )
+    @Test( dependsOnMethods = { "testAddBuildEnvironmentWithBuildAgentGroup" } )
     public void testEditDuplicatedBuildEnvironmentParallelBuilds()
     {
         String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
         String newName = "NEW_BUILD_ENV";
         goToAddBuildEnvironment();
-        addBuildEnvironment( newName, new String[]{}, true );
+        addBuildEnvironment( newName, new String[]{ }, true );
         goToEditBuildEnvironment( newName );
-        editBuildEnvironment( BUILD_ENV_NAME, new String[]{}, false );
+        editBuildEnvironment( BUILD_ENV_NAME, new String[]{ }, false );
         assertTextPresent( "A Build Environment with the same name already exists" );
     }
 
-    @Test( dependsOnMethods = {"testEditDuplicatedBuildEnvironmentParallelBuilds"} )
-    public void testEditDuplicatedBuildEnvironmentDistributedBuilds()
+    protected void addBuildEnvironment( String name, String[] installations, boolean success )
     {
-        try
-        {
-            enableDistributedBuilds();
+        setFieldValue( "profile.name", name );
+        submit();
+        editBuildEnvironment( name, installations, success );
+    }
 
-            String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
-            String BUILD_AGENT_GROUPNAME = getProperty( "BUILD_AGENT_GROUPNAME" );
-            String newName = "NEW_BUILD_ENV";
-            goToEditBuildEnvironment( newName );
-            editBuildEnvironmentWithBuildAgentGroup( BUILD_ENV_NAME, new String[]{}, BUILD_AGENT_GROUPNAME, false );
-            assertTextPresent( "A Build Environment with the same name already exists" );
+    protected void editBuildEnvironment( String name, String[] installations, boolean success )
+    {
+        setFieldValue( "profile.name", name );
+        for ( String i : installations )
+        {
+            selectValue( "installationId", i );
+            clickButtonWithValue( "Add" );
+        }
+        submit();
+        if ( success )
+        {
+            assertBuildEnvironmentPage();
         }
-        finally
+        else
         {
-            disableDistributedBuilds();
+            assertAddBuildEnvironmentPage();
         }
     }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ConfigurationTest.java Wed Aug 15 06:03:18 2012
@@ -19,7 +19,7 @@ package org.apache.continuum.web.test;
  * under the License.
  */
 
-import org.apache.continuum.web.test.parent.AbstractConfigurationTest;
+import org.apache.continuum.web.test.parent.AbstractAdminTest;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
@@ -27,9 +27,9 @@ import org.testng.annotations.Test;
  * @author José Morales Martínez
  * @version $Id$
  */
-@Test( groups = {"configuration"} )
+@Test( groups = { "configuration" } )
 public class ConfigurationTest
-    extends AbstractConfigurationTest
+    extends AbstractAdminTest
 {
     private String WORKING_DIRECTORY;
 
@@ -54,7 +54,7 @@ public class ConfigurationTest
         NUMBER_ALLOWED_PARALLEL = getFieldValue( "numberOfAllowedBuildsinParallel" );
     }
 
-    @Test( dependsOnMethods = {"defaultConfiguration"} )
+    @Test( dependsOnMethods = { "defaultConfiguration" } )
     public void editConfiguration()
     {
         String newWorking = "newWorking";
@@ -171,4 +171,77 @@ public class ConfigurationTest
         Assert.assertFalse( getSelenium().isAlertPresent() );
         assertTextPresent( "Copyright 2005-2011 The Apache Software Foundation" );
     }
+
+    void assertEditedConfigurationPage( String working, String buildOutput, String releaseOutput,
+                                        String deploymentRepository, String baseUrl, String numberBuildParallel )
+    {
+        assertPage( "Continuum - Configuration" );
+        assertTextPresent( "General Configuration " );
+        assertTextPresent( "Working Directory" );
+        assertElementNotPresent( "workingDirectory" );
+        assertTextPresent( working );
+        assertTextPresent( "Build Output Directory" );
+        assertElementNotPresent( "buildOutputDirectory" );
+        assertTextPresent( buildOutput );
+        assertTextPresent( "Release Output Directory" );
+        assertElementNotPresent( "releaseOutputDirectory" );
+        assertTextPresent( releaseOutput );
+        assertTextPresent( "Deployment Repository Directory" );
+        assertElementNotPresent( "deploymentRepositoryDirectory" );
+        assertTextPresent( deploymentRepository );
+        assertTextPresent( "Base URL" );
+        assertElementNotPresent( "baseUrl" );
+        assertTextPresent( baseUrl );
+        assertTextPresent( "Number of Allowed Builds in Parallel" );
+        assertElementNotPresent( "numberOfAllowedBuildsinParallel" );
+        assertTextPresent( numberBuildParallel );
+        assertTextPresent( "Enable Distributed Builds" );
+        assertElementNotPresent( "distributedBuildEnabled" );
+        assertButtonWithValuePresent( "Edit" );
+
+    }
+
+    protected void submitConfiguration( String working, String buildOutput, String releaseOutput,
+                                        String deploymentRepository, String baseUrl, String numberBuildParallel,
+                                        boolean distributed, boolean success )
+    {
+        setFieldValue( "workingDirectory", working );
+        setFieldValue( "buildOutputDirectory", buildOutput );
+        setFieldValue( "releaseOutputDirectory", releaseOutput );
+        setFieldValue( "deploymentRepositoryDirectory", deploymentRepository );
+        setFieldValue( "baseUrl", baseUrl );
+        setFieldValue( "numberOfAllowedBuildsinParallel", numberBuildParallel );
+        setFieldValue( "sharedSecretPassword", SHARED_SECRET );
+        if ( distributed )
+        {
+            checkField( "distributedBuildEnabled" );
+        }
+        else
+        {
+            uncheckField( "distributedBuildEnabled" );
+        }
+        submit();
+        if ( success )
+        {
+            assertEditedConfigurationPage( working, buildOutput, releaseOutput, deploymentRepository, baseUrl,
+                                           numberBuildParallel );
+        }
+        else
+        {
+            assertEditConfigurationPage();
+        }
+    }
+
+    protected void goToAppearancePage()
+    {
+        clickLinkWithText( "Appearance" );
+        assertAppearancePage();
+    }
+
+    void assertAppearancePage()
+    {
+        assertPage( "Configure Appearance" );
+        assertTextPresent( "Company Details" );
+        assertTextPresent( "Footer Content" );
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/DistributedBuildTest.java Wed Aug 15 06:03:18 2012
@@ -36,46 +36,75 @@ public class DistributedBuildTest
 {
     private String projectGroupName;
 
+    private String projectGroupId;
+
+    private String projectGroupDescription;
+
+    private String pomUrl;
+
+    private String pomUsername;
+
+    private String pomPassword;
+
+    private String projectName;
+
+    private String buildEnvName;
+
+    private String buildAgentGroupName;
+
+    private String newBuildEnv;
+
     @BeforeMethod
     public void setUp()
     {
         enableDistributedBuilds();
 
-        projectGroupName = null;
+        addBuildAgent( buildAgentUrl );
+
+        projectGroupName = getProperty( "DISTRIBUTED_PROJECT_GROUP_NAME" );
+        projectGroupId = getProperty( "DISTRIBUTED_PROJECT_GROUP_ID" );
+        projectGroupDescription = getProperty( "DISTRIBUTED_PROJECT_GROUP_DESCRIPTION" );
+
+        addProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, true, false );
+
+        pomUrl = getProperty( "MAVEN2_POM_URL" );
+        pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
+        pomPassword = getProperty( "MAVEN2_POM_PASSWORD" );
+        projectName = getProperty( "MAVEN2_POM_PROJECT_NAME" );
+
+        buildAgentGroupName = getProperty( "DISTRIBUTED_BUILD_AGENT_GROUP_NAME" );
+        buildEnvName = getProperty( "DISTRIBUTED_BUILD_ENV_NAME" );
+        newBuildEnv = getProperty( "DISTRIBUTED_DUPLICATE_BUILD_ENV" );
     }
 
     @AfterMethod
     public void tearDown()
-        throws Exception
+        throws Throwable
     {
-        if ( projectGroupName != null )
-        {
-            removeProjectGroup( projectGroupName, false );
-        }
+        removeProjectGroup( projectGroupName, false );
+
+        removeBuildEnvironment( buildEnvName, false );
+
+        removeBuildEnvironment( newBuildEnv, false );
+
+        removeBuildAgentGroup( buildAgentGroupName, false );
 
         disableDistributedBuilds();
     }
 
-    @Test( dependsOnMethods = { "testDeleteBuildAgentGroup" } )
     public void testBuildProjectGroupNoBuildAgentConfigured()
         throws Exception
     {
         goToBuildAgentPage();
-        removeBuildAgent( getBuildAgentUrl(), false );
-
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-        projectGroupName = M2_PROJ_GRP_NAME;
+        removeBuildAgent( buildAgentUrl, false );
 
-        addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
-                            getProperty( "M2_POM_PASSWORD" ), null, true );
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
         goToProjectGroupsSummaryPage();
         assertLinkPresent( projectGroupName );
         clickLinkWithText( projectGroupName );
 
         assertPage( "Continuum - Project Group" );
 
-        showProjectGroup( projectGroupName, M2_PROJ_GRP_ID, "" );
         clickButtonWithValue( "Build all projects" );
 
         assertTextPresent( "Unable to build projects because no build agent is configured" );
@@ -84,43 +113,92 @@ public class DistributedBuildTest
     public void testProjectGroupAllBuildSuccessWithDistributedBuilds()
         throws Exception
     {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-        projectGroupName = M2_PROJ_GRP_NAME;
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
 
-        addBuildAgent( getBuildAgentUrl() );
+        buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
+    }
 
-        addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
-                            getProperty( "M2_POM_PASSWORD" ), null, true );
+    public void testBuildMaven2ProjectWithTagDistributedBuild()
+        throws Exception
+    {
+        String pomUrl = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_URL" );
+        String pomUsername = "";
+        String pomPassword = "";
+        String projectName = getProperty( "MAVEN2_PROJECT_WITH_TAG_POM_PROJECT_NAME" );
+
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
+        assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
 
-        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "", M2_PROJ_GRP_NAME, true );
+        buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
     }
 
-    @Test(
-        dependsOnMethods = { "testAddBuildAgentGroupWithEmptyBuildAgent",
-            "testAddBuildEnvironmentWithBuildAgentGroup" } )
-    public void testProjectGroupNoBuildAgentConfiguredInBuildAgentGroup()
+    public void testBuildShellProjectWithDistributedBuildsEnabled()
         throws Exception
     {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_DELETE_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_DELETE_PROJ_GRP_ID" );
-        String BUILD_ENV_NAME = getProperty( "BUILD_ENV_NAME" );
-        projectGroupName = M2_PROJ_GRP_NAME;
+        String projectName = getProperty( "SHELL_PROJECT_NAME" );
+        String projectDescription = getProperty( "SHELL_PROJECT_DESCRIPTION" );
+        String projectVersion = getProperty( "SHELL_PROJECT_VERSION" );
+        String projectTag = getProperty( "SHELL_PROJECT_TAG" );
+        String projectScmUrl = getProperty( "SHELL_PROJECT_SCM_URL" );
+        String projectScmUsername = getProperty( "SHELL_PROJECT_SCM_USERNAME" );
+        String projectScmPassword = getProperty( "SHELL_PROJECT_SCM_PASSWORD" );
+
+        goToAddShellProjectPage();
+        addProject( projectName, projectDescription, projectVersion, projectScmUrl, projectScmUsername,
+                    projectScmPassword, projectTag, projectGroupName, true, "shell" );
+        assertProjectGroupSummaryPage( projectGroupName, projectGroupId, projectGroupDescription );
 
-        addMavenTwoProject( getProperty( "M2_DELETE_POM_URL" ), getProperty( "M2_POM_USERNAME" ),
-                            getProperty( "M2_POM_PASSWORD" ), null, true );
         goToProjectGroupsSummaryPage();
-        assertLinkPresent( M2_PROJ_GRP_NAME );
-        clickLinkWithText( M2_PROJ_GRP_NAME );
+        clickLinkWithText( projectGroupName );
+        clickLinkWithText( "Build Definitions" );
+        clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr/td[14]/a/img" );
 
-        assertPage( "Continuum - Project Group" );
+        editBuildDefinitionShellType();
+
+        buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
+    }
+
+    public void testQueuePageWithProjectCurrentlyBuildingInDistributedBuilds()
+        throws Exception
+    {
+        String pomUrl = getProperty( "MAVEN2_QUEUE_TEST_POM_URL" );
+        String pomUsername = getProperty( "MAVEN2_QUEUE_TEST_POM_USERNAME" );
+        String pomPassword = getProperty( "MAVEN2_QUEUE_TEST_POM_PASSWORD" );
+
+        goToAddMavenTwoProjectPage();
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
+
+        buildProjectForQueuePageTest( projectGroupName, projectGroupId, projectGroupDescription );
+
+        //check queue page while building
+        getSelenium().open( "/continuum/admin/displayQueues!display.action" );
+        assertPage( "Continuum - View Distributed Builds" );
+        assertTextPresent( "Current Build" );
+        assertTextPresent( "Build Queue" );
+        assertTextPresent( "Current Prepare Build" );
+        assertTextPresent( "Prepare Build Queue" );
+        assertTextPresent( projectGroupName );
+        assertTextPresent( "Build Agent URL" );
+    }
+
+    public void testAddBuildEnvironmentWithBuildAgentGroup()
+    {
+        addBuildAgentGroupAndEnvironment( new String[]{ buildAgentUrl } );
+    }
+
+    public void testProjectGroupNoBuildAgentConfiguredInBuildAgentGroup()
+        throws Exception
+    {
+        addBuildAgentGroupAndEnvironment( new String[]{ } );
 
-        goToGroupBuildDefinitionPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, "" );
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
+
+        goToGroupBuildDefinitionPage( projectGroupName, projectGroupId, projectGroupDescription );
         clickImgWithAlt( "Edit" );
         assertAddEditBuildDefinitionPage();
-        selectValue( "profileId", BUILD_ENV_NAME );
+        selectValue( "profileId", buildEnvName );
         submit();
-        assertGroupBuildDefinitionPage( M2_PROJ_GRP_NAME );
+        assertGroupBuildDefinitionPage( projectGroupName );
 
         clickLinkWithText( "Project Group Summary" );
         clickButtonWithValue( "Build all projects" );
@@ -128,62 +206,41 @@ public class DistributedBuildTest
         assertTextPresent( "Unable to build projects because no build agent is configured in the build agent group" );
     }
 
-    public void testBuildMaven2ProjectWithTagDistributedBuild()
-        throws Exception
+    public void testEditDuplicatedBuildEnvironmentDistributedBuilds()
     {
-        String M2_POM_URL = getProperty( "M2_PROJ_WITH_TAG_POM_URL" );
-        String M2_POM_USERNAME = getProperty( "M2_POM_USERNAME" );
-        String M2_POM_PASSWORD = getProperty( "M2_POM_PASSWORD" );
+        addBuildAgentGroupAndEnvironment( new String[]{ buildAgentUrl } );
 
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_WITH_TAG_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = "";
+        goToAddBuildEnvironment();
+        addBuildEnvironmentWithBuildAgentGroup( newBuildEnv, new String[]{ }, buildAgentGroupName );
 
-        projectGroupName = M2_PROJ_GRP_NAME;
-
-        addBuildAgent( getBuildAgentUrl() );
-
-        addMavenTwoProject( M2_POM_URL, M2_POM_USERNAME, M2_POM_PASSWORD, null, true );
-        assertProjectGroupSummaryPage( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
-
-        buildProjectGroup( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION, M2_PROJ_GRP_NAME, true );
+        goToEditBuildEnvironment( newBuildEnv );
+        editBuildEnvironmentWithBuildAgentGroup( buildEnvName, new String[]{ }, buildAgentGroupName, false );
+        assertTextPresent( "A Build Environment with the same name already exists" );
     }
 
-    public void testBuildShellProjectWithDistributedBuildsEnabled()
+    public void testBuildSuccessWithDistributedBuildsAfterDisableEnableOfBuildAgent()
         throws Exception
     {
-        String SHELL_GROUP_NAME = getProperty( "SHELL_GROUP_NAME" );
-        String SHELL_GROUP_ID = getProperty( "SHELL_GROUP_ID" );
-        String SHELL_GROUP_DESC = getProperty( "SHELL_GROUP_DESC" );
-
-        String SHELL_NAME = getProperty( "SHELL_NAME_TWO" );
-        String SHELL_DESCRIPTION = getProperty( "SHELL_DESCRIPTION_TWO" );
-        String SHELL_VERSION = getProperty( "SHELL_VERSION_TWO" );
-        String SHELL_TAG = getProperty( "SHELL_TAG_TWO" );
-        String SHELL_SCM_URL = getProperty( "SHELL_SCM_URL_TWO" );
-        String SHELL_SCM_USERNAME = getProperty( "SHELL_SCM_USERNAME_TWO" );
-        String SHELL_SCM_PASSWORD = getProperty( "SHELL_SCM_PASSWORD_TWO" );
-
-        addProjectGroup( SHELL_GROUP_NAME, SHELL_GROUP_ID, SHELL_GROUP_DESC, true );
-
-        projectGroupName = SHELL_GROUP_NAME;
+        addMavenTwoProject( pomUrl, pomUsername, pomPassword, projectGroupName, true );
 
-        addBuildAgent( getBuildAgentUrl() );
-
-        goToAddShellProjectPage();
-        addProject( SHELL_NAME, SHELL_DESCRIPTION, SHELL_VERSION, SHELL_SCM_URL, SHELL_SCM_USERNAME, SHELL_SCM_PASSWORD,
-                    SHELL_TAG, SHELL_GROUP_NAME, true, "shell" );
-        assertProjectGroupSummaryPage( SHELL_GROUP_NAME, SHELL_GROUP_ID, SHELL_GROUP_DESC );
-
-        goToProjectGroupsSummaryPage();
-        clickLinkWithText( SHELL_GROUP_NAME );
-        clickLinkWithText( "Build Definitions" );
-        clickLinkWithXPath( "//table[@id='ec_table']/tbody/tr/td[14]/a/img" );
+        // disable then enable build agent
+        goToBuildAgentPage();
+        clickImgWithAlt( "Edit" );
+        enableDisableBuildAgent( buildAgentUrl, false );
+        clickImgWithAlt( "Edit" );
+        enableDisableBuildAgent( buildAgentUrl, true );
 
-        editBuildDefinitionShellType();
+        buildProjectGroup( projectGroupName, projectGroupId, projectGroupDescription, projectName, true );
+    }
 
-        buildProjectGroup( SHELL_GROUP_NAME, SHELL_GROUP_ID, SHELL_GROUP_DESC, SHELL_NAME, true );
+    private void addBuildAgentGroupAndEnvironment( String[] buildAgents )
+    {
+        // create build agent group
+        goToAddBuildAgentGroup();
+        addEditBuildAgentGroup( buildAgentGroupName, buildAgents, new String[]{ }, true );
 
+        goToAddBuildEnvironment();
+        addBuildEnvironmentWithBuildAgentGroup( buildEnvName, new String[]{ }, buildAgentGroupName );
     }
 
     private void editBuildDefinitionShellType()
@@ -196,24 +253,4 @@ public class DistributedBuildTest
 
         submit();
     }
-
-    public void testQueuePageWithProjectCurrentlyBuildingInDistributedBuilds()
-        throws Exception
-    {
-        String M2_PROJ_GRP_NAME = getProperty( "M2_PROJ_GRP_NAME" );
-        String M2_PROJ_GRP_ID = getProperty( "M2_PROJ_GRP_ID" );
-        String M2_PROJ_GRP_DESCRIPTION = getProperty( "M2_PROJ_GRP_DESCRIPTION" );
-
-        buildProjectForQueuePageTest( M2_PROJ_GRP_NAME, M2_PROJ_GRP_ID, M2_PROJ_GRP_DESCRIPTION );
-
-        //check queue page while building
-        getSelenium().open( "/continuum/admin/displayQueues!display.action" );
-        assertPage( "Continuum - View Distributed Builds" );
-        assertTextPresent( "Current Build" );
-        assertTextPresent( "Build Queue" );
-        assertTextPresent( "Current Prepare Build" );
-        assertTextPresent( "Prepare Build Queue" );
-        assertTextPresent( M2_PROJ_GRP_NAME );
-        assertTextPresent( "Build Agent URL" );
-    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/ReleaseTest.java Wed Aug 15 06:03:18 2012
@@ -19,7 +19,7 @@ package org.apache.continuum.web.test;
  * under the License.
  */
 
-import org.apache.continuum.web.test.parent.AbstractAdminTest;
+import org.apache.continuum.web.test.parent.AbstractBuildAgentsTest;
 import org.testng.Assert;
 import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeClass;
@@ -35,7 +35,7 @@ import java.util.Arrays;
 
 @Test( groups = { "release" } )
 public class ReleaseTest
-    extends AbstractAdminTest
+    extends AbstractBuildAgentsTest
 {
     private String projectGroupName;
 
@@ -68,7 +68,7 @@ public class ReleaseTest
 
         enableDistributedBuilds();
 
-        addBuildAgent( getBuildAgentUrl() );
+        addBuildAgent( buildAgentUrl );
 
         String pomUrl = getProperty( "MAVEN2_POM_URL" );
         String pomUsername = getProperty( "MAVEN2_POM_USERNAME" );
@@ -90,14 +90,15 @@ public class ReleaseTest
     public void setUp()
         throws IOException
     {
-        releaseBuildEnvironment = getProperty( "M2_RELEASE_BUILD_ENV" );
-        releaseBuildAgentGroup = getProperty( "M2_RELEASE_AGENT_GROUP" );
+        releaseBuildEnvironment = getProperty( "RELEASE_BUILD_ENV" );
+        releaseBuildAgentGroup = getProperty( "RELEASE_BUILD_AGENT_GROUP" );
+        errorMessageNoAgent = getProperty( "RELEASE_NO_AGENT_MESSAGE" );
+
         tagBase = getProperty( "RELEASE_PROJECT_TAGBASE" );
         tag = getProperty( "RELEASE_PROJECT_TAG" );
         releaseVersion = getProperty( "RELEASE_PROJECT_VERSION" );
         developmentVersion = getProperty( "RELEASE_PROJECT_DEVELOPMENT_VERSION" );
         releaseProjectScmUrl = getProperty( "RELEASE_PROJECT_SCM_URL" );
-        errorMessageNoAgent = getProperty( "M2_RELEASE_NO_AGENT_MESSAGE" );
 
         File file = new File( "target/conf/prepared-releases.xml" );
 
@@ -108,7 +109,7 @@ public class ReleaseTest
 
         enableDistributedBuilds();
 
-        addBuildAgent( getBuildAgentUrl() );
+        addBuildAgent( buildAgentUrl );
 
         createBuildEnvAndBuildagentGroup( releaseBuildEnvironment, releaseBuildAgentGroup );
     }
@@ -119,6 +120,8 @@ public class ReleaseTest
     {
         removeBuildagentGroupFromBuildEnv( releaseBuildAgentGroup );
 
+        removeBuildAgentGroup( releaseBuildAgentGroup );
+
         disableDistributedBuilds();
     }
 
@@ -251,7 +254,7 @@ public class ReleaseTest
 
     private void attachBuildagentInGroup( String projectAgentGroup )
     {
-        String buildAgent = getBuildAgentUrl();
+        String buildAgent = buildAgentUrl;
 
         clickLinkWithText( "Build Agents" );
         String xPath = "//preceding::td[text()='" + projectAgentGroup + "']//following::img[@alt='Edit']";
@@ -268,7 +271,7 @@ public class ReleaseTest
 
     private void detachBuildagentFromGroup( String projectAgentGroup )
     {
-        String buildAgent = getBuildAgentUrl();
+        String buildAgent = buildAgentUrl;
 
         clickLinkWithText( "Build Agents" );
         String xPath = "//preceding::td[text()='" + projectAgentGroup + "']//following::img[@alt='Edit']";
@@ -398,7 +401,6 @@ public class ReleaseTest
         FileInputStream fis = new FileInputStream( file );
         BufferedReader reader = new BufferedReader( new InputStreamReader( fis ) );
 
-        String BUILD_AGENT_URL = getBuildAgentUrl();
         String strLine;
         StringBuilder str = new StringBuilder();
         while ( ( strLine = reader.readLine() ) != null )
@@ -406,7 +408,7 @@ public class ReleaseTest
             str.append( strLine );
         }
 
-        Assert.assertTrue( str.toString().contains( "<buildAgentUrl>" + BUILD_AGENT_URL + "</buildAgentUrl>" ),
+        Assert.assertTrue( str.toString().contains( "<buildAgentUrl>" + buildAgentUrl + "</buildAgentUrl>" ),
                            "prepared-releases.xml was not populated" );
     }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractAdminTest.java Wed Aug 15 06:03:18 2012
@@ -38,62 +38,9 @@ public abstract class AbstractAdminTest
         }
     }
 
-    protected String getBuildAgentUrl()
+    public void goToConfigurationPage()
     {
-        return baseUrl.substring( 0, baseUrl.indexOf( "/continuum" ) ) + "/continuum-buildagent/xmlrpc";
-    }
-
-    protected void addBuildAgent( String buildAgentUrl )
-    {
-        addBuildAgent( buildAgentUrl, "Default description" );
-    }
-
-    protected void addBuildAgent( String buildAgentUrl, String description )
-    {
-        goToBuildAgentPage();
-        assertBuildAgentPage();
-
-        if ( !isElementPresent( "link=" + buildAgentUrl ) )
-        {
-
-            clickAndWait( "editBuildAgent_0" ); //add button
-            assertAddEditBuildAgentPage( true );
-
-            setFieldValue( "saveBuildAgent_buildAgent_url", buildAgentUrl );
-            setFieldValue( "saveBuildAgent_buildAgent_description", description );
-            checkField( "saveBuildAgent_buildAgent_enabled" );
-
-            submit();
-
-            assertBuildAgentPage();
-            assertElementPresent( "link=" + buildAgentUrl );
-        }
-    }
-
-    protected void goToAddBuildAgent()
-    {
-        goToBuildAgentPage();
-        assertBuildAgentPage();
-        clickAndWait( "editBuildAgent_0" ); //add button
-        assertAddEditBuildAgentPage( true );
-    }
-
-    void assertAddEditBuildAgentPage( boolean isChecked )
-    {
-        assertPage( "Continuum - Add/Edit Build Agent" );
-        assertTextPresent( "Add/Edit Build Agent" );
-        assertTextPresent( "Build Agent URL*:" );
-        assertTextPresent( "Description:" );
-        assertTextPresent( "Enabled" );
-        assertElementPresent( "saveBuildAgent_buildAgent_url" );
-        assertElementPresent( "saveBuildAgent_buildAgent_description" );
-
-        if ( isChecked )
-        {
-            assertIsChecked();
-        }
-
-        assertButtonWithValuePresent( "Save" );
-        assertButtonWithValuePresent( "Cancel" );
+        clickLinkWithText( "Configuration" );
+        assertEditConfigurationPage();
     }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractBuildAgentsTest.java Wed Aug 15 06:03:18 2012
@@ -1,5 +1,8 @@
 package org.apache.continuum.web.test.parent;
 
+import org.testng.annotations.BeforeClass;
+
+import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 
 /*
@@ -24,6 +27,57 @@ import java.net.URLEncoder;
 public abstract class AbstractBuildAgentsTest
     extends AbstractAdminTest
 {
+    protected String buildAgentUrl;
+
+    @BeforeClass( alwaysRun = true )
+    public void initializeBuildAgent()
+    {
+        buildAgentUrl = baseUrl.substring( 0, baseUrl.indexOf( "/continuum" ) ) + "/continuum-buildagent/xmlrpc";
+    }
+
+    protected void enableDistributedBuilds()
+    {
+        goToConfigurationPage();
+        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+        if ( !isChecked( "configuration_distributedBuildEnabled" ) )
+        {
+            // must use click here so the JavaScript enabling the shared secret gets triggered
+            click( "configuration_distributedBuildEnabled" );
+        }
+        setFieldValue( "configuration_sharedSecretPassword", SHARED_SECRET );
+        clickAndWait( "configuration_" );
+        assertTextPresent( "true" );
+        assertTextPresent( "Distributed Builds" );
+        assertElementPresent( "link=Build Agents" );
+    }
+
+    protected void disableDistributedBuilds()
+    {
+        goToConfigurationPage();
+        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
+        if ( isChecked( "configuration_distributedBuildEnabled" ) )
+        {
+            uncheckField( "configuration_distributedBuildEnabled" );
+        }
+        submit();
+        assertTextPresent( "false" );
+        assertElementNotPresent( "link=Build Agents" );
+    }
+
+    protected void goToBuildAgentPage()
+    {
+        clickAndWait( "link=Build Agents" );
+        assertPage( "Continuum - Build Agents" );
+    }
+
+    void assertBuildAgentPage()
+    {
+        assertPage( "Continuum - Build Agents" );
+        assertTextPresent( "Build Agents" );
+        assertTextPresent( "Build Agent Groups" );
+        assertButtonWithValuePresent( "Add" );
+    }
+
     protected void removeBuildAgent( String agentName )
         throws Exception
     {
@@ -33,8 +87,10 @@ public abstract class AbstractBuildAgent
     protected void removeBuildAgent( String agentName, boolean failIfMissing )
         throws Exception
     {
-        String deleteButton = "//a[contains(@href,'deleteBuildAgent.action') and contains(@href, '" + URLEncoder.encode(
-            agentName, "UTF-8" ) + "')]/img";
+        String deleteButton =
+            "//a[contains(@href,'deleteBuildAgent.action') and contains(@href, '" + URLEncoder.encode( agentName,
+                                                                                                       "UTF-8" )
+                + "')]/img";
         if ( failIfMissing || isElementPresent( deleteButton ) )
         {
             clickLinkWithXPath( deleteButton );
@@ -45,6 +101,7 @@ public abstract class AbstractBuildAgent
             assertButtonWithValuePresent( "Cancel" );
             clickButtonWithValue( "Delete" );
             assertBuildAgentPage();
+            assertElementNotPresent( deleteButton );
         }
     }
 
@@ -122,7 +179,7 @@ public abstract class AbstractBuildAgent
     {
         goToBuildAgentPage();
         clickAndWait( "editBuildAgentGroup_0" ); //add button
-        String[] options = new String[]{"--- Available Build Agents ---"};
+        String[] options = new String[]{ "--- Available Build Agents ---" };
         assertAddEditBuildAgentGroupPage( options, null );
     }
 
@@ -187,16 +244,83 @@ public abstract class AbstractBuildAgent
     }
 
     protected void removeBuildAgentGroup( String name )
+        throws UnsupportedEncodingException
+    {
+        removeBuildAgentGroup( name, true );
+    }
+
+    protected void removeBuildAgentGroup( String name, boolean failIfMissing )
+        throws UnsupportedEncodingException
+    {
+        goToBuildAgentPage();
+        if ( isTextPresent( name ) || failIfMissing )
+        {
+            clickLinkWithXPath(
+                "(//a[contains(@href,'deleteBuildAgentGroup.action') and contains(@href, '" + URLEncoder.encode( name,
+                                                                                                                 "UTF-8" )
+                    + "')])//img" );
+            assertPage( "Continuum - Delete Build Agent Group" );
+            assertTextPresent( "Delete Build Agent" );
+            assertTextPresent( "Are you sure you want to delete build agent group " + name + " ?" );
+            assertButtonWithValuePresent( "Delete" );
+            assertButtonWithValuePresent( "Cancel" );
+            clickButtonWithValue( "Delete" );
+            assertBuildAgentPage();
+            assertTextNotPresent( name );
+        }
+    }
+
+    protected void addBuildAgent( String buildAgentUrl )
+    {
+        addBuildAgent( buildAgentUrl, "Default description" );
+    }
+
+    protected void addBuildAgent( String buildAgentUrl, String description )
+    {
+        goToBuildAgentPage();
+        assertBuildAgentPage();
+
+        if ( !isElementPresent( "link=" + buildAgentUrl ) )
+        {
+
+            clickAndWait( "editBuildAgent_0" ); //add button
+            assertAddEditBuildAgentPage( true );
+
+            setFieldValue( "saveBuildAgent_buildAgent_url", buildAgentUrl );
+            setFieldValue( "saveBuildAgent_buildAgent_description", description );
+            checkField( "saveBuildAgent_buildAgent_enabled" );
+
+            submit();
+
+            assertBuildAgentPage();
+            assertElementPresent( "link=" + buildAgentUrl );
+        }
+    }
+
+    protected void goToAddBuildAgent()
     {
         goToBuildAgentPage();
-        clickLinkWithXPath(
-            "(//a[contains(@href,'deleteBuildAgentGroup.action') and contains(@href, '" + name + "')])//img" );
-        assertPage( "Continuum - Delete Build Agent Group" );
-        assertTextPresent( "Delete Build Agent" );
-        assertTextPresent( "Are you sure you want to delete build agent group " + name + " ?" );
-        assertButtonWithValuePresent( "Delete" );
-        assertButtonWithValuePresent( "Cancel" );
-        clickButtonWithValue( "Delete" );
         assertBuildAgentPage();
+        clickAndWait( "editBuildAgent_0" ); //add button
+        assertAddEditBuildAgentPage( true );
+    }
+
+    void assertAddEditBuildAgentPage( boolean isChecked )
+    {
+        assertPage( "Continuum - Add/Edit Build Agent" );
+        assertTextPresent( "Add/Edit Build Agent" );
+        assertTextPresent( "Build Agent URL*:" );
+        assertTextPresent( "Description:" );
+        assertTextPresent( "Enabled" );
+        assertElementPresent( "saveBuildAgent_buildAgent_url" );
+        assertElementPresent( "saveBuildAgent_buildAgent_description" );
+
+        if ( isChecked )
+        {
+            assertIsChecked();
+        }
+
+        assertButtonWithValuePresent( "Save" );
+        assertButtonWithValuePresent( "Cancel" );
     }
 }

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=1373223&r1=1373222&r2=1373223&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 Wed Aug 15 06:03:18 2012
@@ -19,7 +19,6 @@ package org.apache.continuum.web.test.pa
  * under the License.
  */
 
-import org.apache.continuum.web.test.ConfigurationTest;
 import org.testng.Assert;
 import org.testng.annotations.BeforeSuite;
 import org.testng.annotations.Optional;
@@ -37,7 +36,7 @@ public abstract class AbstractContinuumT
     extends AbstractSeleniumTest
 {
 
-    static final String SHARED_SECRET = "continuum1234";
+    protected static final String SHARED_SECRET = "continuum1234";
 
     // ////////////////////////////////////
     // Create Admin User
@@ -126,7 +125,7 @@ public abstract class AbstractContinuumT
     // Configuration
     // ////////////////////////////////////
 
-    void assertEditConfigurationPage()
+    protected void assertEditConfigurationPage()
     {
         assertPage( "Continuum - Configuration" );
         assertTextPresent( "General Configuration " );
@@ -902,55 +901,6 @@ public abstract class AbstractContinuumT
     }
 
     // ////////////////////////////////////
-    // Distributed Builds
-    // ////////////////////////////////////
-
-    protected void enableDistributedBuilds()
-    {
-        ConfigurationTest config = new ConfigurationTest();
-        config.goToConfigurationPage();
-        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
-        if ( !isChecked( "configuration_distributedBuildEnabled" ) )
-        {
-            // must use click here so the JavaScript enabling the shared secret gets triggered
-            click( "configuration_distributedBuildEnabled" );
-        }
-        setFieldValue( "configuration_sharedSecretPassword", SHARED_SECRET );
-        clickAndWait( "configuration_" );
-        assertTextPresent( "true" );
-        assertTextPresent( "Distributed Builds" );
-        assertElementPresent( "link=Build Agents" );
-    }
-
-    protected void disableDistributedBuilds()
-    {
-        ConfigurationTest config = new ConfigurationTest();
-        config.goToConfigurationPage();
-        setFieldValue( "numberOfAllowedBuildsinParallel", "2" );
-        if ( isChecked( "configuration_distributedBuildEnabled" ) )
-        {
-            uncheckField( "configuration_distributedBuildEnabled" );
-        }
-        submit();
-        assertTextPresent( "false" );
-        assertElementNotPresent( "link=Build Agents" );
-    }
-
-    protected void goToBuildAgentPage()
-    {
-        clickAndWait( "link=Build Agents" );
-        assertPage( "Continuum - Build Agents" );
-    }
-
-    void assertBuildAgentPage()
-    {
-        assertPage( "Continuum - Build Agents" );
-        assertTextPresent( "Build Agents" );
-        assertTextPresent( "Build Agent Groups" );
-        assertButtonWithValuePresent( "Add" );
-    }
-
-    // ////////////////////////////////////
     // Reports
     // ////////////////////////////////////
 
@@ -1220,4 +1170,102 @@ public abstract class AbstractContinuumT
             assertAddSchedulePage();
         }
     }
+
+    protected void goToBuildEnvironmentPage()
+    {
+        clickLinkWithText( "Build Environments" );
+        assertBuildEnvironmentPage();
+    }
+
+    protected void assertBuildEnvironmentPage()
+    {
+        assertPage( "Continuum - Build Environments" );
+        assertTextPresent( "Build Environments" );
+        assertButtonWithValuePresent( "Add" );
+    }
+
+    protected void goToAddBuildEnvironment()
+    {
+        goToBuildEnvironmentPage();
+        clickButtonWithValue( "Add" );
+        assertAddBuildEnvironmentPage();
+    }
+
+    protected void assertAddBuildEnvironmentPage()
+    {
+        assertPage( "Continuum - Build Environment" );
+        assertTextPresent( "Build Environment" );
+        assertTextPresent( "Build Environment Name" );
+        assertElementPresent( "profile.name" );
+        assertButtonWithValuePresent( "Save" );
+        assertButtonWithValuePresent( "Cancel" );
+    }
+
+    protected void addBuildEnvironmentWithBuildAgentGroup( String name, String[] installations,
+                                                           String buildAgentGroupName )
+    {
+        setFieldValue( "profile.name", name );
+        submit();
+        editBuildEnvironmentWithBuildAgentGroup( name, installations, buildAgentGroupName, true );
+    }
+
+    protected void editBuildEnvironmentWithBuildAgentGroup( String name, String[] installations,
+                                                            String buildAgentGroupName, boolean success )
+    {
+        setFieldValue( "profile.name", name );
+        selectValue( "profile.buildAgentGroup", buildAgentGroupName );
+        for ( String i : installations )
+        {
+            selectValue( "installationId", i );
+            clickButtonWithValue( "Add" );
+        }
+        submit();
+        if ( success )
+        {
+            assertBuildEnvironmentPage();
+        }
+        else
+        {
+            assertAddBuildEnvironmentPage();
+        }
+    }
+
+    void assertEditBuildEnvironmentPage( String name )
+    {
+        assertAddBuildEnvironmentPage();
+        assertTextPresent( "Installation Name" );
+        assertTextPresent( "Type" );
+        assertFieldValue( name, "profile.name" );
+    }
+
+    protected void goToEditBuildEnvironment( String name )
+    {
+        goToBuildEnvironmentPage();
+        String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
+        clickLinkWithXPath( xPath );
+        assertEditBuildEnvironmentPage( name );
+    }
+
+    protected void removeBuildEnvironment( String name )
+    {
+        removeBuildEnvironment( name, true );
+    }
+
+    protected void removeBuildEnvironment( String name, boolean failIfMissing )
+    {
+        goToBuildEnvironmentPage();
+        String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Delete']";
+        if ( failIfMissing || isElementPresent( "xpath=" + xPath ) )
+        {
+            clickLinkWithXPath( xPath );
+            assertPage( "Continuum - Delete Build Environment" );
+            assertTextPresent( "Delete Build Environment" );
+            assertTextPresent( "Are you sure you want to delete Build Environment \"" + name + "\" ?" );
+            assertButtonWithValuePresent( "Delete" );
+            assertButtonWithValuePresent( "Cancel" );
+            clickButtonWithValue( "Delete" );
+            assertBuildEnvironmentPage();
+            assertElementNotPresent( "xpath=" + xPath );
+        }
+    }
 }

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=1373223&r1=1373222&r2=1373223&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java Wed Aug 15 06:03:18 2012
@@ -174,7 +174,7 @@ public abstract class AbstractSeleniumTe
         Assert.assertTrue( isElementPresent( elementLocator ), "'" + elementLocator + "' isn't present." );
     }
 
-    void assertElementNotPresent( String elementLocator )
+    protected void assertElementNotPresent( String elementLocator )
     {
         Assert.assertFalse( isElementPresent( elementLocator ), "'" + elementLocator + "' is present." );
     }
@@ -338,7 +338,7 @@ public abstract class AbstractSeleniumTe
         getSelenium().check( locator );
     }
 
-    void uncheckField( String locator )
+    protected void uncheckField( String locator )
     {
         getSelenium().uncheck( locator );
     }



Mime
View raw message