continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1369756 [2/3] - in /continuum/trunk/continuum-webapp-test: ./ src/test/java/org/apache/continuum/web/test/ src/test/resources/ src/test/testng/org/apache/continuum/web/test/ src/test/testng/org/apache/continuum/web/test/listener/ src/test/...
Date Mon, 06 Aug 2012 09:24:57 GMT
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=1369756&r1=1369755&r2=1369756&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 Mon Aug  6 09:24:56 2012
@@ -37,12 +37,12 @@ public abstract class AbstractContinuumT
     extends AbstractSeleniumTest
 {
 
-    protected static final String SHARED_SECRET = "continuum1234";
+    static final String SHARED_SECRET = "continuum1234";
 
     // ////////////////////////////////////
     // Create Admin User
     // ////////////////////////////////////
-    public void assertCreateAdmin()
+    void assertCreateAdmin()
     {
         assertPage( "Create Admin User" );
         assertTextPresent( "Username" );
@@ -58,7 +58,7 @@ public abstract class AbstractContinuumT
         assertButtonWithValuePresent( "Create Admin" );
     }
 
-    public void submitAdminData(String fullname,String email,String password )
+    void submitAdminData( String fullname, String email, String password )
     {
         setFieldValue( "user.fullName", fullname );
         setFieldValue( "user.email", email );
@@ -70,14 +70,14 @@ public abstract class AbstractContinuumT
     // ////////////////////////////////////
     // About
     // ////////////////////////////////////
-    public void goToAboutPage()
+    protected void goToAboutPage()
     {
         getSelenium().open( baseUrl );
         clickLinkWithText( "About" );
         assertAboutPage();
     }
 
-    public void assertAboutPage()
+    protected void assertAboutPage()
     {
         assertPage( "Continuum - About" );
         assertTextPresent( "About Continuum" );
@@ -88,7 +88,7 @@ public abstract class AbstractContinuumT
     // Login
     // ////////////////////////////////////
 
-    public void goToLoginPage()
+    protected void goToLoginPage()
     {
         getSelenium().deleteAllVisibleCookies();
         getSelenium().open( baseUrl );
@@ -96,7 +96,7 @@ public abstract class AbstractContinuumT
         assertLoginPage();
     }
 
-    public void assertLoginPage()
+    void assertLoginPage()
     {
         assertPage( "Login Page" );
         assertTextPresent( "Login" );
@@ -113,7 +113,7 @@ public abstract class AbstractContinuumT
         assertTextPresent( "Forgot your Password? Request a password reset." );
     }
 
-    public void assertAutenticatedPage(String username )
+    void assertAutenticatedPage( String username )
     {
         assertTextPresent( "Current User" );
         assertTextPresent( "Edit Details" );
@@ -122,43 +122,11 @@ public abstract class AbstractContinuumT
         assertTextPresent( username );
     }
 
-    public void assertChangePasswordPage()
-    {
-        assertPage( "Change Password" );
-        assertTextPresent( "Change Password" );
-        assertTextPresent( "Existing Password*:" );
-        assertElementPresent( "existingPassword" );
-        assertTextPresent( "New Password*:" );
-        assertElementPresent( "newPassword" );
-        assertTextPresent( "Confirm New Password*:" );
-        assertElementPresent( "newPasswordConfirm" );
-    }
-
-    public void assertUserEditPage( String username, String name, String email )
-    {
-        assertPage( "[Admin] User Edit" );
-        assertTextPresent( "[Admin] User Edit" );
-        assertTextPresent( "Username" );
-        assertTextPresent( username );
-        assertTextPresent( "Full Name*:" );
-        assertFieldValue( name, "userEditForm_user_fullName" );
-        assertTextPresent( "Email Address*:" );
-        assertFieldValue( email, "userEditForm_user_email" );
-        assertTextPresent( "Password*:" );
-        assertFieldValue( "", "userEditForm_user_password" );
-        assertTextPresent( "Confirm Password*:" );
-        assertElementPresent( "userEditForm_user_confirmPassword" );
-        assertTextPresent( "Account Creation:" );
-        assertTextPresent( "Last Password Change:" );
-        assertTextPresent( "Effective Roles" );
-        assertLinkPresent( "Edit Roles" );
-    }
-
     // ////////////////////////////////////
     // Configuration
     // ////////////////////////////////////
 
-    public void assertEditConfigurationPage()
+    void assertEditConfigurationPage()
     {
         assertPage( "Continuum - Configuration" );
         assertTextPresent( "General Configuration " );
@@ -184,7 +152,7 @@ public abstract class AbstractContinuumT
     // Build Queue
     // ////////////////////////////////////
 
-    public void setMaxBuildQueue(int maxBuildQueue )
+    protected void setMaxBuildQueue( int maxBuildQueue )
     {
         clickLinkWithText( "Configuration" );
         setFieldValue( "numberOfAllowedBuildsinParallel", String.valueOf( maxBuildQueue ) );
@@ -194,8 +162,7 @@ public abstract class AbstractContinuumT
     // ////////////////////////////////////
     // Project Groups
     // ////////////////////////////////////
-    public void goToProjectGroupsSummaryPage()
-        throws Exception
+    protected void goToProjectGroupsSummaryPage()
     {
         getSelenium().open( "/continuum/groupSummary.action" );
         waitPage();
@@ -203,7 +170,7 @@ public abstract class AbstractContinuumT
         assertProjectGroupsSummaryPage();
     }
 
-    public void assertProjectGroupsSummaryPage()
+    protected void assertProjectGroupsSummaryPage()
     {
         assertPage( "Continuum - Group Summary" );
         assertTextPresent( "Project Groups" );
@@ -223,8 +190,7 @@ public abstract class AbstractContinuumT
     // ////////////////////////////////////
     // Project Group
     // ////////////////////////////////////
-    public void showProjectGroup(String name,String groupId,String description )
-        throws Exception
+    protected void showProjectGroup( String name, String groupId, String description )
     {
         goToProjectGroupsSummaryPage();
 
@@ -235,7 +201,7 @@ public abstract class AbstractContinuumT
         assertProjectGroupSummaryPage( name, groupId, description );
     }
 
-    public void assertProjectGroupSummaryPage(String name,String groupId,String description )
+    protected void assertProjectGroupSummaryPage( String name, String groupId, String description )
     {
         assertPage( "Continuum - Project Group" );
         assertTextPresent( "Project Group Name" );
@@ -266,8 +232,7 @@ public abstract class AbstractContinuumT
         }
     }
 
-    public void addProjectGroup(String name,String groupId,String description,boolean success )
-        throws Exception
+    protected void addProjectGroup( String name, String groupId, String description, boolean success )
     {
         goToProjectGroupsSummaryPage();
 
@@ -291,7 +256,7 @@ public abstract class AbstractContinuumT
         }
     }
 
-    public void assertAddProjectGroupPage()
+    void assertAddProjectGroupPage()
     {
         assertPage( "Continuum - Add Project Group" );
         assertTextPresent( "Add Project Group" );
@@ -303,28 +268,12 @@ public abstract class AbstractContinuumT
         assertElementPresent( "description" );
     }
 
-    public void removeProjectGroup(String name,String groupId,String description )
-        throws Exception
-    {
-        showProjectGroup( name, groupId, description );
-        // Remove
-        clickLinkWithLocator( "remove" );
-        // Assert Confirmation
-        assertElementPresent( "removeProjectGroup_" );
-        assertElementPresent( "Cancel" );
-        // Confirm Project Group deletion
-        clickButtonWithValue( "Save" );
-        assertProjectGroupsSummaryPage();
-    }
-
-    public void removeProjectGroup( String groupName )
-        throws Exception
+    protected void removeProjectGroup( String groupName )
     {
         removeProjectGroup( groupName, true );
     }
 
-    public void removeProjectGroup( String groupName, boolean failIfMissing )
-        throws Exception
+    protected void removeProjectGroup( String groupName, boolean failIfMissing )
     {
         goToProjectGroupsSummaryPage();
         if ( failIfMissing || isLinkPresent( groupName ) )
@@ -337,8 +286,8 @@ public abstract class AbstractContinuumT
         }
     }
 
-    public void editProjectGroup(String name,String groupId,String description,String newName,String newDescription )
-        throws Exception
+    protected void editProjectGroup( String name, String groupId, String description, String newName,
+                                     String newDescription )
     {
         showProjectGroup( name, groupId, description );
         clickButtonWithValue( "Edit" );
@@ -348,8 +297,7 @@ public abstract class AbstractContinuumT
         clickButtonWithValue( "Save" );
     }
 
-    public void assertEditGroupPage(String groupId )
-        throws Exception
+    void assertEditGroupPage( String groupId )
     {
         assertPage( "Continuum - Update Project Group" );
         assertTextPresent( "Update Project Group" );
@@ -363,8 +311,8 @@ public abstract class AbstractContinuumT
         assertElementPresent( "Cancel" );
     }
 
-    public void buildProjectGroup(String projectGroupName,String groupId,String description,String projectName, boolean success )
-        throws Exception
+    protected void buildProjectGroup( String projectGroupName, String groupId, String description, String projectName,
+                                      boolean success )
     {
         showProjectGroup( projectGroupName, groupId, description );
         waitForProjectUpdate();
@@ -415,7 +363,7 @@ public abstract class AbstractContinuumT
         clickLinkWithText( "Project Group Summary" );
     }
 
-    public void assertReleaseSuccess()
+    protected void assertReleaseSuccess()
     {
         assertTextPresent( "Choose Release Goal for " );
         assertTextPresent( "Prepare project for release " );
@@ -425,34 +373,19 @@ public abstract class AbstractContinuumT
         assertButtonWithValuePresent( "Submit" );
     }
 
-    public void addValidM2ProjectFromProjectGroup(String projectGroupName,String groupId,String description,
-                                                  String m2PomUrl )
-        throws Exception
-    {
-        showProjectGroup( projectGroupName, groupId, description );
-        selectValue( "projectTypes", "Add M2 Project" );
-        clickButtonWithValue( "Add" );
-        assertAddMavenTwoProjectPage();
-        setFieldValue( "m2PomUrl", m2PomUrl );
-        clickButtonWithValue( "Add" );
-        // if success redirect to summary page
-        assertProjectGroupsSummaryPage();
-    }
-
-    public void goToGroupBuildDefinitionPage(String projectGroupName,String groupId,String description )
-        throws Exception
+    protected void goToGroupBuildDefinitionPage( String projectGroupName, String groupId, String description )
     {
         showProjectGroup( projectGroupName, groupId, description );
         clickLinkWithText( "Build Definitions" );
         assertGroupBuildDefinitionPage( projectGroupName );
     }
 
-    public void assertGroupBuildDefinitionPage(String projectGroupName )
+    protected void assertGroupBuildDefinitionPage( String projectGroupName )
     {
         assertTextPresent( "Project Group Build Definitions of " + projectGroupName + " group" );
     }
 
-    public void assertDeleteBuildDefinitionPage(String description,String goals )
+    protected void assertDeleteBuildDefinitionPage( String description, String goals )
     {
         assertTextPresent( "Are you sure you want to delete the build definition with description \"" + description
             + "\", goals \"" + goals + "\" and id" );
@@ -460,7 +393,7 @@ public abstract class AbstractContinuumT
         isButtonWithValuePresent( "Delete" );
     }
 
-    public void assertAddEditBuildDefinitionPage()
+    protected void assertAddEditBuildDefinitionPage()
     {
         assertTextPresent( "Add/Edit Build Definition" );
         assertTextPresent( "POM filename*:" );
@@ -482,12 +415,12 @@ public abstract class AbstractContinuumT
         assertElementPresent( "buildDefinitionType" );
         assertTextPresent( "Build Environment" );
         assertElementPresent( "profileId" );
-        assertEnabled( "alwaysBuild" );
+        assertEnabled();
     }
 
-    public void addEditGroupBuildDefinition(String groupName,String buildFile,String goals,String arguments,
-                                            String description,boolean buildFresh,boolean alwaysBuild,
-                                            boolean isDefault )
+    protected void addEditGroupBuildDefinition( String groupName, String buildFile, String goals, String arguments,
+                                                String description, boolean buildFresh, boolean alwaysBuild,
+                                                boolean isDefault )
     {
         assertAddEditBuildDefinitionPage();
         // Enter values into Add Build Definition fields, and submit
@@ -517,7 +450,7 @@ public abstract class AbstractContinuumT
             click( "buildFresh" );
         }
 
-        assertEnabled( "alwaysBuild" );
+        assertEnabled();
         if ( isElementPresent( "defaultBuildDefinition" ) )
         {
             if ( isDefault )
@@ -552,39 +485,7 @@ public abstract class AbstractContinuumT
         }
     }
 
-    // ////////////////////////////////////
-    // General Project Pages
-    // ////////////////////////////////////
-    public void goToEditProjectPage(String projectGroupName,String projectName )
-    {
-        clickLinkWithText( "Show Project Groups" );
-        clickLinkWithText( projectGroupName );
-        clickLinkWithText( projectName );
-        clickButtonWithValue( "Edit" );
-
-        assertEditProjectPage();
-    }
-
-    public void assertEditProjectPage()
-    {
-        assertTextPresent( "Update Continuum Project" );
-        assertTextPresent( "Project Name*:" );
-        assertElementPresent( "name" );
-        assertTextPresent( "Version*:" );
-        assertElementPresent( "version" );
-        assertTextPresent( "SCM Url*:" );
-        assertElementPresent( "scmUrl" );
-        assertTextPresent( "Use SCM Credentials Cache, if available" );
-        assertElementPresent( "scmUseCache" );
-        assertTextPresent( "SCM Username:" );
-        assertElementPresent( "scmUsername" );
-        assertTextPresent( "SCM Password:" );
-        assertElementPresent( "scmPassword" );
-        assertTextPresent( "SCM Branch/Tag:" );
-        assertElementPresent( "scmTag" );
-    }
-
-    public void goToProjectInformationPage(String projectGroupName,String projectName )
+    protected void goToProjectInformationPage( String projectGroupName, String projectName )
     {
         clickLinkWithText( "Show Project Groups" );
         clickLinkWithText( projectGroupName );
@@ -593,7 +494,7 @@ public abstract class AbstractContinuumT
         assertProjectInformationPage();
     }
 
-    public void assertProjectInformationPage()
+    protected void assertProjectInformationPage()
     {
         assertTextPresent( "Project Group Summary" );
         assertTextPresent( "Project Information" );
@@ -605,9 +506,8 @@ public abstract class AbstractContinuumT
         assertTextPresent( "Developers" );
     }
 
-    public void moveProjectToProjectGroup(String groupName,String groupId,String groupDescription,
-                                          String projectName,String newProjectGroup )
-        throws Exception
+    protected void moveProjectToProjectGroup( String groupName, String groupId, String groupDescription,
+                                              String projectName, String newProjectGroup )
     {
         showProjectGroup( groupName, groupId, groupDescription );
         
@@ -629,14 +529,14 @@ public abstract class AbstractContinuumT
     // ////////////////////////////////////
     // Maven 2.0+ Project
     // ////////////////////////////////////
-    public void goToAddMavenTwoProjectPage()
+    protected void goToAddMavenTwoProjectPage()
     {
         clickLinkWithText( "Maven Project" );
 
         assertAddMavenTwoProjectPage();
     }
 
-    public void assertAddMavenTwoProjectPage()
+    protected void assertAddMavenTwoProjectPage()
     {
         assertTextPresent( "POM Url" );
         assertElementPresent( "m2PomUrl" );
@@ -650,9 +550,8 @@ public abstract class AbstractContinuumT
         assertElementPresent( "selectedProjectGroup" );
     }
 
-    public void addMavenTwoProject(String pomUrl,String username,String password,String projectGroup,
-                                   boolean success )
-        throws Exception
+    protected void addMavenTwoProject( String pomUrl, String username, String password, String projectGroup,
+                                       boolean success )
     {
         goToAddMavenTwoProjectPage();
 
@@ -678,33 +577,21 @@ public abstract class AbstractContinuumT
         waitAddProject( title );
     }
 
-    /**
-     * submit the page
-     *
-     * @param m2PomUrl
-     * @param validPom
-     */
-    public void submitAddMavenTwoProjectPage(String m2PomUrl,boolean validPom )
-        throws Exception
+    protected void submitAddMavenTwoProjectPage( String m2PomUrl )
     {
-        addMavenTwoProject( m2PomUrl, "", "", null, validPom );
-
-        if ( validPom )
-        {
-            assertTextPresent( "Default Project Group" );
-        }
+        addMavenTwoProject( m2PomUrl, "", "", null, false );
     }
 
     // ////////////////////////////////////
     // Maven 1.x Project
     // ////////////////////////////////////
-    public void goToAddMavenOneProjectPage()
+    protected void goToAddMavenOneProjectPage()
     {
         clickLinkWithText( "Maven 1.x Project" );
         assertAddMavenOneProjectPage();
     }
 
-    public void assertAddMavenOneProjectPage()
+    void assertAddMavenOneProjectPage()
     {
         assertPage( "Continuum - Add Maven 1 Project" );
         assertTextPresent( "Add Maven 1.x Project" );
@@ -728,18 +615,13 @@ public abstract class AbstractContinuumT
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void addMavenOneProject(String pomUrl,String username,String password,String projectGroup,
-                                   String buildTemplate,boolean success )
-        throws Exception
+    protected void addMavenOneProject( String pomUrl, String username, String password, String projectGroup,
+                                       boolean success )
     {
         setFieldValue( "m1PomUrl", pomUrl );
         setFieldValue( "scmUsername", username );
         setFieldValue( "scmPassword", password );
 
-        if ( buildTemplate != null )
-        {
-            selectValue( "buildDefinitionTemplateId", buildTemplate );
-        }
         if ( projectGroup != null )
         {
             selectValue( "selectedProjectGroup", projectGroup );
@@ -761,19 +643,19 @@ public abstract class AbstractContinuumT
     // ANT/SHELL Projects
     // ////////////////////////////////////
 
-    public void goToAddAntProjectPage()
+    protected void goToAddAntProjectPage()
     {
         clickLinkWithText( "Ant Project" );
         assertAddProjectPage( "ant" );
     }
 
-    public void goToAddShellProjectPage()
+    protected void goToAddShellProjectPage()
     {
         clickLinkWithText( "Shell Project" );
         assertAddProjectPage( "shell" );
     }
 
-    public void assertAddProjectPage(String type )
+    protected void assertAddProjectPage( String type )
     {
         String title = type.substring( 0, 1 ).toUpperCase() + type.substring( 1 ).toLowerCase();
         assertPage( "Continuum - Add " + title + " Project" );
@@ -806,10 +688,8 @@ public abstract class AbstractContinuumT
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    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 type )
-        throws Exception
+    protected void addProject( String name, String description, String version, String scmUrl, String scmUser,
+                               String scmPassword, String scmTag, String projectGroup, boolean success, String type )
     {
         setFieldValue( "projectName", name );
         setFieldValue( "projectDescription", description );
@@ -818,14 +698,6 @@ public abstract class AbstractContinuumT
         setFieldValue( "projectScmUsername", scmUser );
         setFieldValue( "projectScmPassword", scmPassword );
         setFieldValue( "projectScmTag", scmTag );
-        if ( useCache )
-        {
-            checkField( "projectScmUseCache" );
-        }
-        if ( buildTemplate != null )
-        {
-            selectValue( "buildDefinitionTemplateId", buildTemplate );
-        }
         if ( projectGroup != null )
         {
             selectValue( "selectedProjectGroup", projectGroup );
@@ -844,8 +716,7 @@ public abstract class AbstractContinuumT
         waitAddProject( title );
     }
 
-    public void waitAddProject( String title )
-        throws Exception
+    protected void waitAddProject( String title )
     {
         // the "adding project" interstitial page has an empty title, so we wait for a real title to appear
 
@@ -870,7 +741,7 @@ public abstract class AbstractContinuumT
         assertEquals( getTitle(), title );
     }
 
-    public void createAndAddUserAsDeveloperToGroup( String username, String name, String email, String password, String groupName )
+    protected void createAndAddUserAsDeveloperToGroup( String username, String name, String email, String groupName )
     {
         clickLinkWithText( "Users" );
         assertPage( "[Admin] User List" );
@@ -880,11 +751,11 @@ public abstract class AbstractContinuumT
         setFieldValue( "user.fullName", name );
         setFieldValue( "user.username", username );
         setFieldValue( "user.email", email );
-        setFieldValue( "user.password", password );
-        setFieldValue( "user.confirmPassword", password );
+        setFieldValue( "user.password", "password123" );
+        setFieldValue( "user.confirmPassword", "password123" );
         clickButtonWithValue( "Create User" );
         assertPage( "[Admin] User Edit" );
-        assignContinuumResourceRoleToUser( "Project Developer", groupName );
+        assignContinuumResourceRoleToUser( groupName );
         clickButtonWithValue( "Submit" );
         assertPage( "[Admin] User List" );
         assertTextPresent( username );
@@ -892,8 +763,7 @@ public abstract class AbstractContinuumT
         assertTextPresent( email );
     }
 
-    public void showMembers( String name, String groupId, String description )
-        throws Exception
+    protected void showMembers( String name, String groupId, String description )
     {
         showProjectGroup( name, groupId, description );
         clickLinkWithText( "Members" );
@@ -901,29 +771,27 @@ public abstract class AbstractContinuumT
         assertTextPresent( "Users" );
     }
 
-    public void assertUserPresent( String username, String name, String email )
+    protected void assertUserPresent( String username, String name, String email )
     {
         assertTextPresent( username );
         assertTextPresent( name );
         assertTextPresent( email );
     }
 
-    public void assertUserNotPresent( String username, String name, String email )
+    protected void assertUserNotPresent( String username, String name, String email )
     {
         assertTextNotPresent( username );
         assertTextNotPresent( name );
         assertTextNotPresent( email );
     }
 
-    public void waitForProjectCheckout()
-        throws Exception
+    protected void waitForProjectCheckout()
     {
         // wait for project to finish checking out
         waitForElementPresent( "//img[@alt='Checking Out']", false );
     }
     
-    public void waitForProjectUpdate()
-        throws Exception
+    void waitForProjectUpdate()
     {
         if ( isElementPresent( "//img[@alt='Checking Out']" ) )
         {
@@ -934,8 +802,7 @@ public abstract class AbstractContinuumT
         waitForElementPresent( "//img[@alt='Updating']", false );
     }
     
-    public void waitForProjectBuild()
-        throws Exception
+    void waitForProjectBuild()
     {
         if ( isElementPresent( "//img[@alt='Checking Out']" ) || isElementPresent( "//img[@alt='Updating']" ) )
         {
@@ -946,73 +813,33 @@ public abstract class AbstractContinuumT
         waitForElementPresent( "//img[@alt='Building']", false );
     }
 
-    public void createNewUser( String username, String name, String email, String password )
+    void assignContinuumResourceRoleToUser( String groupName )
     {
-        clickLinkWithText( "Users" );
-        assertPage( "[Admin] User List" );
-        assertTextNotPresent( username );
-        clickButtonWithValue( "Create New User" );
-        assertPage( "[Admin] User Create" );
-        setFieldValue( "user.fullName", name );
-        setFieldValue( "user.username", username );
-        setFieldValue( "user.email", email );
-        setFieldValue( "user.password", password );
-        setFieldValue( "user.confirmPassword", password );
-        clickButtonWithValue( "Create User" );
-        assertPage( "[Admin] User Edit" );
+        clickLinkWithXPath( "//input[@name='addDSelectedRoles' and @value='" + "Project Developer" + " - " + groupName + "']", false );
     }
 
-    public void assignContinuumRoleToUser( String role )
-    {
-        clickLinkWithXPath( "//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='" + role + "']", false );
-    }
-
-    public void assignContinuumResourceRoleToUser( String resourceRole, String groupName )
-    {
-        clickLinkWithXPath( "//input[@name='addDSelectedRoles' and @value='" + resourceRole + " - " + groupName + "']", false );
-    }
-
-    public void assertUserCreatedPage()
-    {
-        assertPage( "[Admin] User List" );
-        assertTextPresent( "[Admin] List of Users in Role: Any" );
-        assertLinkPresent( "admin" );
-        assertLinkPresent( "guest" );
-    }
-
-    public void removeDefaultBuildDefinitionFromTemplate( String type )
+    protected void removeDefaultBuildDefinitionFromTemplate( String type )
     {
         goToEditBuildDefinitionTemplate( type );
         clickLinkWithXPath( "//input[@value='<-']", false );
         submit();
     }
 
-    public void addDefaultBuildDefinitionFromTemplate( String type )
+    protected void addDefaultBuildDefinitionFromTemplate( String type )
     {
         goToEditBuildDefinitionTemplate( type );
 
         if ( "maven2".equals( type ) )
         {
-            selectForOption( "saveBuildDefinitionTemplate_buildDefinitionIds", "Default Maven Build Definition" );
-        }
-        else if ( "maven1".equals( type ) )
-        {
-            
-        }
-        else if ( "ant".equals( type ) )
-        {
-            
-        }
-        else
-        {
-            
+            getSelenium().addSelection(
+                "saveBuildDefinitionTemplate_buildDefinitionIds", "label=" + "Default Maven Build Definition" );
         }
 
         clickLinkWithXPath( "//input[@value='->']", false );
         submit();
     }
 
-    public void goToEditBuildDefinitionTemplate( String type )
+    void goToEditBuildDefinitionTemplate( String type )
     {
         clickLinkWithText( "Build Definition Templates" );
 
@@ -1038,7 +865,7 @@ public abstract class AbstractContinuumT
         assertPage( "Continuum - Build Definition Template" );
     }
 
-    public void assertBuildDefinitionTemplatesPage()
+    void assertBuildDefinitionTemplatesPage()
     {
         assertPage( "Continuum - Build Definition Templates" );
         assertTextPresent( "Default Ant Template" );
@@ -1056,7 +883,7 @@ public abstract class AbstractContinuumT
     // Distributed Builds
     // ////////////////////////////////////
 
-    public void enableDistributedBuilds()
+    protected void enableDistributedBuilds()
     {
         ConfigurationTest config = new ConfigurationTest();
         config.goToConfigurationPage();
@@ -1073,7 +900,7 @@ public abstract class AbstractContinuumT
         assertElementPresent( "link=Build Agents" );
     }
 
-    public void disableDistributedBuilds()
+    protected void disableDistributedBuilds()
     {
         ConfigurationTest config = new ConfigurationTest();
         config.goToConfigurationPage();
@@ -1087,13 +914,13 @@ public abstract class AbstractContinuumT
         assertElementNotPresent( "link=Build Agents" );
     }
 
-    public void goToBuildAgentPage()
+    protected void goToBuildAgentPage()
     {
         clickAndWait("link=Build Agents");
         assertPage("Continuum - Build Agents");
     }
 
-    public void assertBuildAgentPage()
+    void assertBuildAgentPage()
     {
         assertPage("Continuum - Build Agents");
         assertTextPresent("Build Agents");
@@ -1105,13 +932,13 @@ public abstract class AbstractContinuumT
     // Reports
     // ////////////////////////////////////
 
-    public void goToProjectBuildsReport()
+    protected void goToProjectBuildsReport()
     {
         clickLinkWithText( "Project Builds" );
         assertViewBuildsReportPage();
     }
 
-    public void assertViewBuildsReportPage()
+    void assertViewBuildsReportPage()
     {
         assertPage( "Continuum - Project Builds Report" );
         assertTextPresent( "Project Group" );
@@ -1132,7 +959,7 @@ public abstract class AbstractContinuumT
         assertTextNotPresent( "Export to CSV" );
     }
     
-    public void assertProjectBuildReportWithResult()
+    protected void assertProjectBuildReportWithResult()
     {
         assertTextPresent( "Results" );
         assertTextPresent( "Project Group" );
@@ -1145,7 +972,7 @@ public abstract class AbstractContinuumT
         assertTextPresent( "Export to CSV" );
     }
 
-    public void assertProjectBuildReportWithNoResult()
+    protected void assertProjectBuildReportWithNoResult()
     {
         assertTextNotPresent( "Build Date" );
         assertTextNotPresent( "Prev" );
@@ -1155,7 +982,7 @@ public abstract class AbstractContinuumT
         assertTextPresent( "No Results Found" );
     }
 
-    public void assertProjectBuildReportWithFieldError()
+    protected void assertProjectBuildReportWithFieldError()
     {
         assertTextNotPresent( "Build Date" );
         assertTextNotPresent( "Prev" );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractInstallationTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractInstallationTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractInstallationTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractInstallationTest.java Mon Aug  6 09:24:56 2012
@@ -26,20 +26,20 @@ package org.apache.continuum.web.test.pa
 public abstract class AbstractInstallationTest
     extends AbstractAdminTest
 {
-    public void goToInstallationPage()
+    void goToInstallationPage()
     {
         clickLinkWithText( "Installations" );
         assertInstallationPage();
     }
 
-    public void assertInstallationPage()
+    void assertInstallationPage()
     {
         assertPage( "Continuum - Installations" );
         assertTextPresent( "Installations" );
         assertButtonWithValuePresent( "Add" );
     }
 
-    public void goToAddInstallationTool()
+    protected void goToAddInstallationTool()
     {
         goToInstallationPage();
         clickButtonWithValue( "Add" );
@@ -49,7 +49,7 @@ public abstract class AbstractInstallati
         assertAddInstallationToolPage();
     }
 
-    public void goToAddInstallationVariable()
+    protected void goToAddInstallationVariable()
     {
         goToInstallationPage();
         clickButtonWithValue( "Add" );
@@ -59,7 +59,7 @@ public abstract class AbstractInstallati
         assertAddInstallationVariablePage();
     }
 
-    public void assertAddChoiceTypeInstallation()
+    void assertAddChoiceTypeInstallation()
     {
         assertPage( "Continuum - Installation Type Choice" );
         assertTextPresent( "Installation Type Choice" );
@@ -69,14 +69,14 @@ public abstract class AbstractInstallati
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void assertAddInstallationToolPage()
+    void assertAddInstallationToolPage()
     {
         assertEditInstallationToolPage();
         assertElementPresent( "automaticProfile" );
         assertTextPresent( "Create a Build Environment with the Installation name" );
     }
 
-    public void assertEditInstallationToolPage()
+    void assertEditInstallationToolPage()
     {
         assertPage( "Continuum - Installation" );
         assertTextPresent( "Continuum - Installation" );
@@ -90,14 +90,14 @@ public abstract class AbstractInstallati
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void assertAddInstallationVariablePage()
+    void assertAddInstallationVariablePage()
     {
         assertEditInstallationVariablePage();
         assertElementPresent( "automaticProfile" );
         assertTextPresent( "Create a Build Environment with the Installation name" );
     }
 
-    public void assertEditInstallationVariablePage()
+    void assertEditInstallationVariablePage()
     {
         assertPage( "Continuum - Installation" );
         assertTextPresent( "Continuum - Installation" );
@@ -111,8 +111,8 @@ public abstract class AbstractInstallati
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void addInstallation( String name, String var, String path, boolean createBuildEnv, boolean tool,
-                                 boolean success )
+    protected void addInstallation( String name, String var, String path, boolean createBuildEnv, boolean tool,
+                                    boolean success )
     {
         if ( createBuildEnv )
         {
@@ -125,7 +125,7 @@ public abstract class AbstractInstallati
         editInstallation( name, var, path, tool, success );
     }
 
-    public void editInstallation( String name, String var, String path, boolean tool, boolean success )
+    protected void editInstallation( String name, String var, String path, boolean tool, boolean success )
     {
         setFieldValue( "installation.name", name );
         setFieldValue( "installation.varValue", path );
@@ -152,7 +152,7 @@ public abstract class AbstractInstallati
         }
     }
 
-    public void goToEditInstallation( String name, String var, String path, boolean tool )
+    protected void goToEditInstallation( String name, String var, String path, boolean tool )
     {
         goToInstallationPage();
         String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
@@ -170,7 +170,7 @@ public abstract class AbstractInstallati
         assertFieldValue( path, "installation.varValue" );
     }
 
-    public void removeInstallation( String name )
+    protected void removeInstallation( String name )
     {
         goToInstallationPage();
         clickLinkWithXPath( "(//a[contains(@href,'deleteInstallation') and contains(@href, '" + name + "')])//img" );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractLocalRepositoryTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractLocalRepositoryTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractLocalRepositoryTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractLocalRepositoryTest.java Mon Aug  6 09:24:56 2012
@@ -26,14 +26,14 @@ package org.apache.continuum.web.test.pa
 public abstract class AbstractLocalRepositoryTest
     extends AbstractAdminTest
 {
-    public void goToLocalRepositoryPage()
+    void goToLocalRepositoryPage()
     {
         clickLinkWithText( "Local Repositories" );
 
         assertLocalRepositoryPage();
     }
 
-    public void assertLocalRepositoryPage()
+    void assertLocalRepositoryPage()
     {
         assertPage( "Continuum - Local Repositories" );
         assertTextPresent( "Local Repositories" );
@@ -46,7 +46,7 @@ public abstract class AbstractLocalRepos
         assertButtonWithValuePresent( "Add" );
     }
 
-    public void assertAddLocalRepositoryPage()
+    void assertAddLocalRepositoryPage()
     {
         assertPage( "Continuum - Add/Edit Local Repository" );
         assertTextPresent( "Add/Edit Local Repository" );
@@ -60,7 +60,7 @@ public abstract class AbstractLocalRepos
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void removeLocalRepository( String name )
+    protected void removeLocalRepository( String name )
     {
         goToLocalRepositoryPage();
         String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Delete']";
@@ -73,14 +73,14 @@ public abstract class AbstractLocalRepos
         assertLocalRepositoryPage();
     }
 
-    public void goToAddLocalRepository()
+    protected void goToAddLocalRepository()
     {
         goToLocalRepositoryPage();
         clickButtonWithValue( "Add" );
         assertAddLocalRepositoryPage();
     }
 
-    public void goToEditLocalRepository( String name, String location )
+    protected void goToEditLocalRepository( String name, String location )
     {
         goToLocalRepositoryPage();
         String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
@@ -90,7 +90,7 @@ public abstract class AbstractLocalRepos
         assertFieldValue( location, "repository.location" );
     }
 
-    public void addEditLocalRepository( String name, String location, boolean success )
+    protected void addEditLocalRepository( String name, String location, boolean success )
     {
         setFieldValue( "repository.name", name );
         setFieldValue( "repository.location", location );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java Mon Aug  6 09:24:56 2012
@@ -26,17 +26,12 @@ package org.apache.continuum.web.test.pa
 public abstract class AbstractNotifierTest
     extends AbstractContinuumTest
 {
-    public void assertGroupNotifierPage( String projectGroupName )
+    protected void assertGroupNotifierPage( String projectGroupName )
     {
         assertTextPresent( "Project Group Notifiers of group " + projectGroupName );
     }
 
-    public void assertProjectNotifierPage()
-    {
-        assertTextPresent( "Add Notifier" );
-    }
-
-    public void assertAddNotifierPage()
+    void assertAddNotifierPage()
     {
         assertPage( "Continuum - Add Notifier" );
         assertTextPresent( "Add Notifier" );
@@ -45,7 +40,7 @@ public abstract class AbstractNotifierTe
         assertElementPresent( "Cancel" );
     }
 
-    public void assertAddEditMailNotifierPage()
+    void assertAddEditMailNotifierPage()
     {
         assertPage( "Continuum - Add/Edit Mail Notifier" );
         assertTextPresent( "Add/Edit Mail Notifier" );
@@ -60,7 +55,7 @@ public abstract class AbstractNotifierTe
         assertElementPresent( "Cancel" );
     }
 
-    public void assertAddEditIrcNotifierPage()
+    void assertAddEditIrcNotifierPage()
     {
         assertPage( "Continuum - Add/Edit IRC Notifier" );
 
@@ -96,7 +91,7 @@ public abstract class AbstractNotifierTe
         assertTextPresent( "Send on SCM Failure" );
     }
 
-    public void assertAddEditJabberPage()
+    void assertAddEditJabberPage()
     {
         assertPage( "Continuum - Add/Edit Jabber Notifier" );
 
@@ -122,7 +117,7 @@ public abstract class AbstractNotifierTe
         assertTextPresent( "Send on SCM Failure" );
     }
 
-    public void assertAddEditMsnPage()
+    void assertAddEditMsnPage()
     {
         assertPage( "Continuum - Add/Edit MSN Notifier" );
 
@@ -140,7 +135,7 @@ public abstract class AbstractNotifierTe
         assertTextPresent( "Send on SCM Failure" );
     }
 
-    public void assertAddEditWagonPage()
+    void assertAddEditWagonPage()
     {
         assertPage( "Continuum - Add/Edit Wagon Notifier" );
 
@@ -154,8 +149,7 @@ public abstract class AbstractNotifierTe
         assertTextPresent( "Send on Warning" );
     }
 
-    public void goToGroupNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription )
-        throws Exception
+    protected void goToGroupNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription )
     {
         showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
         clickLinkWithText( "Notifiers" );
@@ -164,16 +158,14 @@ public abstract class AbstractNotifierTe
         assertAddNotifierPage();
     }
 
-    public void goToProjectNotifier( String projectGroupName, String projectName )
-        throws Exception
+    protected void goToProjectNotifier( String projectGroupName, String projectName )
     {
         goToProjectInformationPage( projectGroupName, projectName );
         clickLinkWithXPath( "//input[contains(@id,'addProjectNotifier') and @type='submit']" );
         assertAddNotifierPage();
     }
 
-    public void addMailNotifier( String projectGroupName, String projectName, String email, boolean isValid )
-        throws Exception
+    protected void addMailNotifier( String projectGroupName, String projectName, String email, boolean isValid )
     {
         selectValue( "//select", "Mail" );
         clickButtonWithValue( "Submit" );
@@ -195,9 +187,8 @@ public abstract class AbstractNotifierTe
         }
     }
 
-    public void editMailNotifier( String projectGroupName, String projectName, String oldMail, String newMail,
-                                  boolean isValid )
-        throws Exception
+    protected void editMailNotifier( String projectGroupName, String projectName, String oldMail, String newMail,
+                                     boolean isValid )
     {
         if ( projectName == null )
         {
@@ -226,9 +217,8 @@ public abstract class AbstractNotifierTe
         }
     }
 
-    public void addIrcNotifier( String projectGroupName, String projectName, String host, String channel,
-                                boolean isValid )
-        throws Exception
+    protected void addIrcNotifier( String projectGroupName, String projectName, String host, String channel,
+                                   boolean isValid )
     {
         selectValue( "//select", "IRC" );
         clickButtonWithValue( "Submit" );
@@ -237,23 +227,21 @@ public abstract class AbstractNotifierTe
         setFieldValue( "channel", channel );
 
         clickButtonWithValue( "Save" );
-        if ( !isValid )
-        {
-            return;
-        }
-        else if ( projectName != null )
-        {
-            assertProjectInformationPage();
-        }
-        else
+        if ( isValid )
         {
-            assertGroupNotifierPage( projectGroupName );
+            if ( projectName != null )
+            {
+                assertProjectInformationPage();
+            }
+            else
+            {
+                assertGroupNotifierPage( projectGroupName );
+            }
         }
     }
 
-    public void editIrcNotifier( String projectGroupName, String projectName, String oldHost, String oldChannel,
-                                 String newHost, String newChannel, boolean isValid )
-        throws Exception
+    protected void editIrcNotifier( String projectGroupName, String projectName, String oldHost, String oldChannel,
+                                    String newHost, String newChannel, boolean isValid )
     {
         if ( projectName == null )
         {
@@ -285,9 +273,8 @@ public abstract class AbstractNotifierTe
         }
     }
 
-    public void addJabberNotifier( String projectGroupName, String projectName, String host, String login,
-                                   String password, String address, boolean isValid )
-        throws Exception
+    protected void addJabberNotifier( String projectGroupName, String projectName, String host, String login,
+                                      String password, String address, boolean isValid )
     {
         selectValue( "//select", "Jabber" );
         clickButtonWithValue( "Submit" );
@@ -298,24 +285,22 @@ public abstract class AbstractNotifierTe
         setFieldValue( "address", address );
         clickButtonWithValue( "Save" );
 
-        if ( !isValid )
-        {
-            return;
-        }
-        else if ( projectName != null )
-        {
-            assertProjectInformationPage();
-        }
-        else
+        if ( isValid )
         {
-            assertGroupNotifierPage( projectGroupName );
+            if ( projectName != null )
+            {
+                assertProjectInformationPage();
+            }
+            else
+            {
+                assertGroupNotifierPage( projectGroupName );
+            }
         }
     }
 
-    public void editJabberNotifier( String projectGroupName, String projectName, String oldHost, String oldLogin,
-                                    String oldAddress, String newHost, String newLogin, String newPassword,
-                                    String newAddress, boolean isValid )
-        throws Exception
+    protected void editJabberNotifier( String projectGroupName, String projectName, String oldHost, String oldLogin,
+                                       String oldAddress, String newHost, String newLogin, String newPassword,
+                                       String newAddress, boolean isValid )
     {
         if ( projectName == null )
         {
@@ -352,9 +337,8 @@ public abstract class AbstractNotifierTe
         }
     }
 
-    public void addMsnNotifier( String projectGroupName, String projectName, String login, String password,
-                                String recipientAddress, boolean isValid )
-        throws Exception
+    protected void addMsnNotifier( String projectGroupName, String projectName, String login, String password,
+                                   String recipientAddress, boolean isValid )
     {
         selectValue( "//select", "MSN" );
         clickButtonWithValue( "Submit" );
@@ -364,23 +348,21 @@ public abstract class AbstractNotifierTe
         setFieldValue( "address", recipientAddress );
         clickButtonWithValue( "Save" );
 
-        if ( !isValid )
-        {
-            return;
-        }
-        else if ( projectName != null )
-        {
-            assertProjectInformationPage();
-        }
-        else
+        if ( isValid )
         {
-            assertGroupNotifierPage( projectGroupName );
+            if ( projectName != null )
+            {
+                assertProjectInformationPage();
+            }
+            else
+            {
+                assertGroupNotifierPage( projectGroupName );
+            }
         }
     }
 
-    public void editMsnNotifier( String projectGroupName, String projectName, String oldLogin, String oldAddress,
-                                 String newLogin, String newPassword, String newAddress, boolean isValid )
-        throws Exception
+    protected void editMsnNotifier( String projectGroupName, String projectName, String oldLogin, String oldAddress,
+                                    String newLogin, String newPassword, String newAddress, boolean isValid )
     {
         if ( projectName == null )
         {
@@ -414,9 +396,8 @@ public abstract class AbstractNotifierTe
         }
     }
 
-    public void addWagonNotifierPage( String projectGroupName, String projectName, String siteUrl, String serverId,
-                                      boolean isValid )
-        throws Exception
+    protected void addWagonNotifierPage( String projectGroupName, String projectName, String siteUrl, String serverId,
+                                         boolean isValid )
     {
         selectValue( "//select", "Wagon" );
         clickButtonWithValue( "Submit" );
@@ -425,23 +406,21 @@ public abstract class AbstractNotifierTe
         setFieldValue( "id", serverId );
         clickButtonWithValue( "Save" );
 
-        if ( !isValid )
-        {
-            return;
-        }
-        else if ( projectName != null )
+        if ( isValid )
         {
-            assertProjectInformationPage();
-        }
-        else
-        {
-            assertGroupNotifierPage( projectGroupName );
+            if ( projectName != null )
+            {
+                assertProjectInformationPage();
+            }
+            else
+            {
+                assertGroupNotifierPage( projectGroupName );
+            }
         }
     }
 
-    public void editWagonNotifier( String projectGroupName, String projectName, String oldUrl, String oldId,
-                                   String newUrl, String newId, boolean isValid )
-        throws Exception
+    protected void editWagonNotifier( String projectGroupName, String projectName, String oldUrl, String oldId,
+                                      String newUrl, String newId, boolean isValid )
     {
         if ( projectName == null )
         {

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java Mon Aug  6 09:24:56 2012
@@ -26,13 +26,13 @@ package org.apache.continuum.web.test.pa
 public abstract class AbstractPurgeTest
     extends AbstractAdminTest
 {
-    public void goToGeneralPurgePage()
+    void goToGeneralPurgePage()
     {
         clickLinkWithText( "Purge Configurations" );
         assertGeneralPurgePage();
     }
 
-    public void assertGeneralPurgePage()
+    void assertGeneralPurgePage()
     {
         assertPage( "Continuum - Purge Configurations" );
         assertTextPresent( "Repository Purge Configurations" );
@@ -40,7 +40,7 @@ public abstract class AbstractPurgeTest
         assertButtonWithValuePresent( "Add" );
     }
 
-    public void removeRepositoryPurge( String purgeDescription )
+    protected void removeRepositoryPurge( String purgeDescription )
     {
         goToGeneralPurgePage();
         clickLinkWithXPath( "(//a[contains(@href,'removePurgeConfig.action') and contains(@href, '" + purgeDescription
@@ -53,7 +53,7 @@ public abstract class AbstractPurgeTest
         assertGeneralPurgePage();
     }
 
-    public void removeDirectoryPurge( String purgeDescription )
+    protected void removeDirectoryPurge( String purgeDescription )
     {
         goToGeneralPurgePage();
         clickLinkWithXPath( "(//a[contains(@href,'removePurgeConfig.action') and contains(@href, '" + purgeDescription
@@ -66,7 +66,7 @@ public abstract class AbstractPurgeTest
         assertGeneralPurgePage();
     }
 
-    public void assertAddRepositoryPurgePage()
+    void assertAddRepositoryPurgePage()
     {
         assertPage( "Continuum - Add/Edit Purge Configuration" );
         assertTextPresent( "Add/Edit Purge Configuration" );
@@ -87,7 +87,7 @@ public abstract class AbstractPurgeTest
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void assertAddEditDirectoryPurgePage()
+    void assertAddEditDirectoryPurgePage()
     {
         assertPage( "Continuum - Add/Edit Purge Configuration" );
         assertTextPresent( "Add/Edit Purge Configuration" );
@@ -107,7 +107,7 @@ public abstract class AbstractPurgeTest
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void goToAddRepositoryPurge()
+    protected void goToAddRepositoryPurge()
     {
         goToGeneralPurgePage();
         assertGeneralPurgePage();
@@ -115,7 +115,7 @@ public abstract class AbstractPurgeTest
         assertAddRepositoryPurgePage();
     }
 
-    public void goToEditRepositoryPurge( String daysOlder, String retentionCount, String description )
+    protected void goToEditRepositoryPurge( String daysOlder, String retentionCount, String description )
     {
         goToGeneralPurgePage();
         assertGeneralPurgePage();
@@ -127,7 +127,7 @@ public abstract class AbstractPurgeTest
         assertFieldValue( description, "description" );
     }
 
-    public void goToEditDirectoryPurge( String daysOlder, String retentionCount, String description )
+    protected void goToEditDirectoryPurge( String daysOlder, String retentionCount, String description )
     {
         goToGeneralPurgePage();
         assertGeneralPurgePage();
@@ -139,7 +139,8 @@ public abstract class AbstractPurgeTest
         assertFieldValue( description, "description" );
     }
 
-    public void addEditRepositoryPurge( String daysOlder, String retentionCount, String description, boolean success )
+    protected void addEditRepositoryPurge( String daysOlder, String retentionCount, String description,
+                                           boolean success )
     {
         setFieldValue( "daysOlder", daysOlder );
         setFieldValue( "retentionCount", retentionCount );
@@ -155,7 +156,7 @@ public abstract class AbstractPurgeTest
         }
     }
 
-    public void goToAddDirectoryPurge()
+    protected void goToAddDirectoryPurge()
     {
         goToGeneralPurgePage();
         assertGeneralPurgePage();
@@ -163,7 +164,7 @@ public abstract class AbstractPurgeTest
         assertAddEditDirectoryPurgePage();
     }
 
-    public void addEditDirectoryPurge( String daysOlder, String retentionCount, String description, boolean success )
+    protected void addEditDirectoryPurge( String daysOlder, String retentionCount, String description, boolean success )
     {
         setFieldValue( "daysOlder", daysOlder );
         setFieldValue( "retentionCount", retentionCount );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractReleaseTest.java Mon Aug  6 09:24:56 2012
@@ -1,11 +1,12 @@
 package org.apache.continuum.web.test.parent;
 
+import org.testng.Assert;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStreamReader;
-
-import org.testng.Assert;
+import java.util.Arrays;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -29,8 +30,8 @@ import org.testng.Assert;
 public abstract class AbstractReleaseTest
     extends AbstractAdminTest
 {
-    public void releasePrepareProject( String username, String password, String tagBase, String tag, String releaseVersion, String developmentVersion, String buildEnv, boolean success )
-        throws Exception
+    protected void releasePrepareProject( String username, String password, String tagBase, String tag,
+                                          String releaseVersion, String developmentVersion, String buildEnv )
     {
         goToReleasePreparePage();
         setFieldValue( "scmUsername", username );
@@ -43,11 +44,11 @@ public abstract class AbstractReleaseTes
         setFieldValue( "devVersions", developmentVersion );
         submit();
 
-        assertRelease( success );
+        assertRelease();
     }
 
-    public void releasePerformProjectWithProvideParameters( String username, String password, String tagBase, String tag, String scmUrl, String buildEnv, boolean success )
-        throws Exception
+    protected void releasePerformProjectWithProvideParameters( String username, String password, String tagBase,
+                                                               String tag, String scmUrl, String buildEnv )
     {
         goToReleasePerformProvideParametersPage();
         setFieldValue( "scmUrl", scmUrl );
@@ -59,40 +60,24 @@ public abstract class AbstractReleaseTes
         selectValue( "profileId", buildEnv );
         submit();
 
-        assertRelease( success );
-    }
-    
-    public void releasePrepareProject( String username, String password, String tagBase, String tag,
-                                       String releaseVersion, String developmentVersion, String buildEnv )
-        throws Exception
-    {
-        goToReleasePreparePage();
-        setFieldValue( "scmUsername", username );
-        setFieldValue( "scmPassword", password );
-        setFieldValue( "scmTag", tag );
-        setFieldValue( "scmTagBase", tagBase );
-        setFieldValue( "prepareGoals", "clean" );
-        selectValue( "profileId", buildEnv );
-        setFieldValue( "relVersions", releaseVersion );
-        setFieldValue( "devVersions", developmentVersion );
-        submit();
+        assertRelease();
     }
 
-    public void goToReleasePreparePage()
+    void goToReleasePreparePage()
     {
         clickLinkWithLocator( "goal", false );
         submit();
         assertReleasePreparePage();
     }
 
-    public void goToReleasePerformProvideParametersPage()
+    void goToReleasePerformProvideParametersPage()
     {
         clickLinkWithLocator( "//input[@name='goal' and @value='perform']", false );
         submit();
         assertReleasePerformProvideParametersPage();
     }
 
-    public void assertReleasePreparePage()
+    void assertReleasePreparePage()
     {
         assertPage( "Continuum - Release Project" );
         assertTextPresent( "Prepare Project for Release" );
@@ -110,7 +95,7 @@ public abstract class AbstractReleaseTes
         assertButtonWithValuePresent( "Submit" );
     }
 
-    public void assertReleasePerformProvideParametersPage()
+    void assertReleasePerformProvideParametersPage()
     {
         assertPage( "Continuum - Perform Project Release" );
         assertTextPresent( "Perform Project Release" );
@@ -126,45 +111,20 @@ public abstract class AbstractReleaseTes
         assertButtonWithValuePresent( "Submit" );
     }
 
-    public void assertRelease( boolean success )
-        throws Exception
+    void assertRelease()
     {
         String doneButtonLocator = "//input[@id='releaseCleanup_0']";
         String errorTextLocator = "//h3[text()='Release Error']";
         
         // condition for release is complete; "Done" button or "Release Error" in page is present
-        if ( browser.equals( "*iexplore" ) )
-        {
-            int currentIt = 0;
-            int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
-            String pageLoadTimeInMs = getProperty( "PAGE_LOAD_TIME_IN_MS" );
-            
-            while ( ( isElementPresent( doneButtonLocator ) || isElementPresent( errorTextLocator ) ) && currentIt < maxIt )
-            {
-                getSelenium().waitForPageToLoad( pageLoadTimeInMs );
-                currentIt++;
-            }
-        }
-        else
-        {
-            String condition = "( selenium.isElementPresent(\"" + doneButtonLocator + "\") || " +
-                               "selenium.isElementPresent(\"" + errorTextLocator + "\") )";
-            waitForCondition( condition );
-        }
+        waitForOneOfElementsPresent( Arrays.asList( doneButtonLocator, errorTextLocator ), true );
 
         assertButtonWithValuePresent( "Rollback changes" );
-    
-        if ( success )
-        {
-            assertImgWithAltNotPresent( "Error" );
-        }
-        else
-        {
-            assertImgWithAlt( "Error" );
-        }
+
+        assertImgWithAlt( "Error" );
     }
 
-    public void assertPreparedReleasesFileCreated()
+    protected void assertPreparedReleasesFileCreated()
         throws Exception
     {
         File file = new File( "target/conf/prepared-releases.xml" );
@@ -175,7 +135,7 @@ public abstract class AbstractReleaseTes
 
         String BUILD_AGENT_URL = getBuildAgentUrl();
         String strLine;
-        StringBuffer str = new StringBuffer();
+        StringBuilder str = new StringBuilder();
         while( ( strLine = reader.readLine() ) != null )
         {
             str.append( strLine );

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java?rev=1369756&r1=1369755&r2=1369756&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java Mon Aug  6 09:24:56 2012
@@ -26,21 +26,21 @@ package org.apache.continuum.web.test.pa
 public abstract class AbstractScheduleTest
     extends AbstractAdminTest
 {
-    public void goToSchedulePage()
+    void goToSchedulePage()
     {
         clickLinkWithText( "Schedules" );
 
         assertSchedulePage();
     }
 
-    public void goToAddSchedule()
+    protected void goToAddSchedule()
     {
         goToSchedulePage();
         clickButtonWithValue( "Add" );
         assertAddSchedulePage();
     }
 
-    public void assertSchedulePage()
+    void assertSchedulePage()
     {
         assertPage( "Continuum - Schedules" );
         assertTextPresent( "Schedules" );
@@ -56,7 +56,7 @@ public abstract class AbstractScheduleTe
         assertButtonWithValuePresent( "Add" );
     }
 
-    public void assertAddSchedulePage()
+    void assertAddSchedulePage()
     {
         assertPage( "Continuum - Edit Schedule" );
         assertTextPresent( "Edit Schedule" );
@@ -92,9 +92,9 @@ public abstract class AbstractScheduleTe
         assertButtonWithValuePresent( "Cancel" );
     }
 
-    public void addEditSchedule( String name, String description, String second, String minute, String hour,
-                                 String dayMonth, String month, String dayWeek, String year, String maxTime,
-                                 String period, boolean buildQueue, boolean success )
+    protected void addEditSchedule( String name, String description, String second, String minute, String hour,
+                                    String dayMonth, String month, String dayWeek, String year, String maxTime,
+                                    String period, boolean buildQueue, boolean success )
     {
 	if ( buildQueue ) 
 	{
@@ -160,7 +160,7 @@ public abstract class AbstractScheduleTe
         assertFieldValue( period, "delay" );
     }
 
-    public void removeSchedule( String name )
+    protected void removeSchedule( String name )
     {
         goToSchedulePage();
         clickLinkWithXPath( "(//a[contains(@href,'removeSchedule.action') and contains(@href, '" + name + "')])//img" );

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=1369756&r1=1369755&r2=1369756&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 Mon Aug  6 09:24:56 2012
@@ -30,10 +30,8 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
+import java.util.Collections;
 import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Properties;
 
 /**
@@ -44,24 +42,24 @@ import java.util.Properties;
  */
 public abstract class AbstractSeleniumTest
 {
-    public static String baseUrl;
+    protected static String baseUrl;
 
-    public static String browser;
+    static String browser;
 
-    public static String maxWaitTimeInMs;
+    protected static String maxWaitTimeInMs;
 
-    private static ThreadLocal<Selenium> selenium = new ThreadLocal<Selenium>();
+    private static final ThreadLocal<Selenium> selenium = new ThreadLocal<Selenium>();
 
     private static Properties p;
 
     private final static String PROPERTIES_SEPARATOR = "=";
-    
+
     private static String maxProjectWaitTimeInMs;
 
     /**
      * Initialize selenium
      */
-    public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort )
+    void open( String baseUrl, String browser, String seleniumHost, int seleniumPort )
         throws Exception
     {
         InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties" );
@@ -144,117 +142,98 @@ public abstract class AbstractSeleniumTe
     // Auxiliar methods. This method help us and simplify test.
     // *******************************************************
 
-    public void assertFieldValue( String fieldValue, String fieldName )
+    protected void assertFieldValue( String fieldValue, String fieldName )
     {
         assertElementPresent( fieldName );
         Assert.assertEquals( fieldValue, getSelenium().getValue( fieldName ) );
     }
 
-    public void assertPage( String title )
+    protected void assertPage( String title )
     {
         Assert.assertEquals( getTitle(), title );
     }
 
-    public String getTitle()
+    protected String getTitle()
     {
         return getSelenium().getTitle();
     }
 
-    public String getHtmlContent()
-    {
-        return getSelenium().getHtmlSource();
-    }
-
-    public void assertTextPresent( String text )
+    protected void assertTextPresent( String text )
     {
         Assert.assertTrue( getSelenium().isTextPresent( text ), "'" + text + "' isn't present." );
     }
 
-    public void assertTextNotPresent( String text )
+    protected void assertTextNotPresent( String text )
     {
         Assert.assertFalse( getSelenium().isTextPresent( text ), "'" + text + "' is present." );
     }
 
-    public void assertElementPresent( String elementLocator )
+    protected void assertElementPresent( String elementLocator )
     {
         Assert.assertTrue( isElementPresent( elementLocator ), "'" + elementLocator + "' isn't present." );
     }
 
-    public void assertElementNotPresent( String elementLocator )
+    void assertElementNotPresent( String elementLocator )
     {
         Assert.assertFalse( isElementPresent( elementLocator ), "'" + elementLocator + "' is present." );
     }
 
-    public void assertLinkPresent( String text )
+    protected void assertLinkPresent( String text )
     {
         Assert.assertTrue( isElementPresent( "link=" + text ), "The link '" + text + "' isn't present." );
     }
 
-    public void assertLinkNotPresent( String text )
+    protected void assertLinkNotPresent( String text )
     {
             Assert.assertFalse( isElementPresent( "link=" + text ), "The link '" + text + "' is present." );
     }
 
-    public void assertImgWithAlt( String alt )
+    protected void assertImgWithAlt( String alt )
     {
         assertElementPresent( "//img[@alt='" + alt + "']" );
     }
 
-    public void assertImgWithAltAtRowCol( boolean isALink, String alt, int row, int column )
-    {
-        String locator = "//tr[" + row + "]/td[" + column + "]/";
-        locator += isALink ? "a/" : "";
-        locator += "img[@alt='" + alt + "']";
-
-        assertElementPresent( locator );
-    }
-
-    public void assertImgWithAltNotPresent( String alt )
-    {
-        assertElementNotPresent( "//img[@alt='" + alt + "']" );
-    }
-
-    public void assertCellValueFromTable( String expected, String tableElement, int row, int column )
+    protected void assertCellValueFromTable( String expected, String tableElement, int row, int column )
     {
         Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );
     }
 
-    public boolean isTextPresent( String text )
+    protected boolean isTextPresent( String text )
     {
         return getSelenium().isTextPresent( text );
     }
 
-    public boolean isLinkPresent( String text )
+    protected boolean isLinkPresent( String text )
     {
         return isElementPresent( "link=" + text );
     }
 
-    public boolean isElementPresent( String locator )
+    protected boolean isElementPresent( String locator )
     {
         return getSelenium().isElementPresent( locator );
     }
 
-    public void waitPage()
+    protected void waitPage()
     {
         getSelenium().waitForPageToLoad( maxWaitTimeInMs );
     }
 
-    public String getFieldValue( String fieldName )
+    protected String getFieldValue( String fieldName )
     {
         return getSelenium().getValue( fieldName );
     }
 
-    public String getCellValueFromTable( String tableElement, int row, int column )
+    String getCellValueFromTable( String tableElement, int row, int column )
     {
         return getSelenium().getTable( tableElement + "." + row + "." + column );
     }
 
-    public void selectValue( String locator, String value )
+    protected void selectValue( String locator, String value )
     {
         getSelenium().select( locator, "label=" + value );
     }
 
-    public void assertOptionPresent( String selectField, String[] options )
+    void assertOptionPresent( String selectField, String[] options )
     {
         assertElementPresent( selectField );
         String[] optionsPresent = getSelenium().getSelectOptions( selectField );
@@ -264,51 +243,38 @@ public abstract class AbstractSeleniumTe
         Assert.assertTrue( present.containsAll( expected ), "Options expected are not included in present options" );
     }
 
-    public void assertSelectedValue( String value, String fieldName )
-    {
-        assertElementPresent( fieldName );
-        String optionsPresent = getSelenium().getSelectedLabel( value );
-
-        Assert.assertEquals( optionsPresent, value );
-    }
-
-    public void submit()
+    protected void submit()
     {
         clickLinkWithXPath( "//input[@type='submit']" );
     }
 
-    public void assertButtonWithValuePresent( String text )
+    protected void assertButtonWithValuePresent( String text )
     {
         Assert.assertTrue( isButtonWithValuePresent( text ), "'" + text + "' button isn't present" );
     }
 
-    public void assertButtonWithIdPresent( String id )
+    void assertButtonWithIdPresent( String id )
     {
         Assert.assertTrue( isButtonWithIdPresent( id ), "'Button with id =" + id + "' isn't present" );
     }
 
-    public void assertButtonWithValueNotPresent( String text )
-    {
-        Assert.assertFalse( isButtonWithValuePresent( text ), "'" + text + "' button is present" );
-    }
-
-    public boolean isButtonWithValuePresent( String text )
+    boolean isButtonWithValuePresent( String text )
     {
         return isElementPresent( "//button[@value='" + text + "']" )
             || isElementPresent( "//input[@value='" + text + "']" );
     }
 
-    public boolean isButtonWithIdPresent( String text )
+    boolean isButtonWithIdPresent( String text )
     {
         return isElementPresent( "//button[@id='" + text + "']" ) || isElementPresent( "//input[@id='" + text + "']" );
     }
 
-    public void clickButtonWithValue( String text )
+    protected void clickButtonWithValue( String text )
     {
         clickButtonWithValue( text, true );
     }
 
-    public void clickButtonWithValue( String text, boolean wait )
+    void clickButtonWithValue( String text, boolean wait )
     {
         assertButtonWithValuePresent( text );
 
@@ -322,47 +288,37 @@ public abstract class AbstractSeleniumTe
         }
     }
 
-    public void clickSubmitWithLocator( String locator )
+    void clickSubmitWithLocator( String locator )
     {
         clickLinkWithLocator( locator );
     }
 
-    public void clickSubmitWithLocator( String locator, boolean wait )
-    {
-        clickLinkWithLocator( locator, wait );
-    }
-
-    public void clickImgWithAlt( String alt )
+    protected void clickImgWithAlt( String alt )
     {
         clickLinkWithLocator( "//img[@alt='" + alt + "']" );
     }
 
-    public void clickLinkWithText( String text )
-    {
-        clickLinkWithText( text, true );
-    }
-
-    public void clickLinkWithText( String text, boolean wait )
+    protected void clickLinkWithText( String text )
     {
-        clickLinkWithLocator( "link=" + text, wait );
+        clickLinkWithLocator( "link=" + text, true );
     }
 
-    public void clickLinkWithXPath( String xpath )
+    protected void clickLinkWithXPath( String xpath )
     {
         clickLinkWithXPath( xpath, true );
     }
 
-    public void clickLinkWithXPath( String xpath, boolean wait )
+    protected void clickLinkWithXPath( String xpath, boolean wait )
     {
         clickLinkWithLocator( "xpath=" + xpath, wait );
     }
 
-    public void clickLinkWithLocator( String locator )
+    void clickLinkWithLocator( String locator )
     {
         clickLinkWithLocator( locator, true );
     }
 
-    public void clickLinkWithLocator( String locator, boolean wait )
+    protected void clickLinkWithLocator( String locator, boolean wait )
     {
         getSelenium().click( locator );
         if ( wait )
@@ -371,114 +327,100 @@ public abstract class AbstractSeleniumTe
         }
     }
 
-    public void setFieldValues( Map<String, String> fieldMap )
-    {
-        Map.Entry<String, String> entry;
-
-        for ( Iterator<Entry<String, String>> entries = fieldMap.entrySet().iterator(); entries.hasNext(); )
-        {
-            entry = entries.next();
-
-            getSelenium().type( entry.getKey(), entry.getValue() );
-        }
-    }
-
-    public void setFieldValue( String fieldName, String value )
+    protected void setFieldValue( String fieldName, String value )
     {
         getSelenium().type( fieldName, value );
     }
 
-    public void checkField( String locator )
+    protected void checkField( String locator )
     {
         getSelenium().check( locator );
     }
 
-    public void uncheckField( String locator )
+    void uncheckField( String locator )
     {
         getSelenium().uncheck( locator );
     }
 
-    public boolean isChecked( String locator )
+    boolean isChecked( String locator )
     {
         return getSelenium().isChecked( locator );
     }
 
-    public void assertIsChecked( String locator )
+    void assertIsChecked()
     {
-        Assert.assertTrue( getSelenium().isChecked( locator ) );
+        Assert.assertTrue( getSelenium().isChecked( "saveBuildAgent_buildAgent_enabled" ) );
     }
 
-    public void assertIsNotChecked( String locator )
-    {
-        Assert.assertFalse( getSelenium().isChecked( locator ) );
-    }
-
-    public void click( String locator )
+    void click( String locator )
     {
         getSelenium().click( locator );
     }
 
-    public void clickAndWait( String locator )
+    protected void clickAndWait( String locator )
     {
         getSelenium().click( locator );
         getSelenium().waitForPageToLoad( maxWaitTimeInMs );
     }
 
-    public void waitForElementPresent( String locator )
-        throws Exception
+    protected void waitForElementPresent( String locator )
     {
         waitForElementPresent( locator, true );
     }
-    
+
     /*
      * This will wait for the condition to be met.
      *   * shouldBePresent - if the locator is expected or not (true or false respectively)
      */
-    public void waitForElementPresent( String locator, boolean shouldBePresent )
-        throws Exception
+    void waitForElementPresent( String locator, boolean shouldBePresent )
+    {
+        waitForOneOfElementsPresent( Collections.singletonList( locator ), shouldBePresent );
+    }
+
+    void waitForOneOfElementsPresent( List<String> locators, boolean shouldBePresent )
     {
         if ( browser.equals( "*iexplore" ) )
         {
             int currentIt = 0;
             int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
-            String pageLoadTimeInMs = getProperty( "PAGE_LOAD_TIME_IN_MS" );
-            
-            while ( isElementPresent( locator ) != shouldBePresent && currentIt < maxIt )
+            String pageLoadTimeInMs = maxWaitTimeInMs;
+
+            while ( currentIt < maxIt )
             {
+                for ( String locator : locators )
+                {
+                    if ( isElementPresent( locator ) == shouldBePresent )
+                    {
+                        return;
+                    }
+                }
+
                 getSelenium().waitForPageToLoad( pageLoadTimeInMs );
                 currentIt++;
             }
         }
         else
         {
-            String condition = "selenium.isElementPresent(\"" + locator + "\") == " + shouldBePresent;
-            waitForCondition( condition );
+            StringBuilder condition = new StringBuilder();
+            String operator = "";
+            for ( String locator : locators ) {
+                condition.append( operator );
+                condition.append( "(selenium.isElementPresent(\"" ).append( locator ).append( "\")" );
+                condition.append( " == " );
+                condition.append( shouldBePresent ).append( ")" );
+                operator = "||";
+            }
+            waitForCondition( "(" + condition + ")" );
         }
     }
 
-    public void selectForOption( String locator, String text )
-    {
-        getSelenium().addSelection( locator, "label=" + text );
-    }
-
-    public void unselectForOption( String locator, String text )
-    {
-        getSelenium().removeSelection( locator, "label=" + text );
-    }
-    
-    public void waitForCondition( String condition )
-        throws Exception
+    void waitForCondition( String condition )
     {
         getSelenium().waitForCondition( condition, maxProjectWaitTimeInMs );
     }
 
-    public void assertEnabled( String locator )
-    {
-        Assert.assertTrue( getSelenium().isEditable( locator ), "'" + locator + "' is disabled" );
-    }
-
-    public void assertDisabled( String locator )
+    void assertEnabled()
     {
-        Assert.assertFalse( getSelenium().isEditable( locator ), "'" + locator + "' is enabled" );
+        Assert.assertTrue( getSelenium().isEditable( "alwaysBuild" ), "'" + "alwaysBuild" + "' is disabled" );
     }
 }



Mime
View raw message