continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r834357 [7/7] - in /continuum/branches/continuum-1.3.x/continuum-webapp-test: ./ src/site/ src/site/apt/ src/test/it/org/apache/continuum/web/test/ src/test/resources/ src/test/testng/config/ src/test/testng/org/apache/continuum/web/test/ s...
Date Tue, 10 Nov 2009 05:38:03 GMT
Added: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java?rev=834357&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractNotifierTest.java Tue Nov 10 05:38:01 2009
@@ -0,0 +1,482 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author José Morales Martínez
+ * @version $Id$
+ */
+public abstract class AbstractNotifierTest
+    extends AbstractContinuumTest
+{
+    public void assertGroupNotifierPage( String projectGroupName )
+    {
+        assertTextPresent( "Project Group Notifiers of group " + projectGroupName );
+    }
+
+    public void assertProjectNotifierPage()
+    {
+        assertTextPresent( "Add Notifier" );
+    }
+
+    public void assertAddNotifierPage()
+    {
+        assertPage( "Continuum - Add Notifier" );
+        assertTextPresent( "Add Notifier" );
+        assertTextPresent( "Type" );
+        assertElementPresent( "notifierType" );
+        assertElementPresent( "Cancel" );
+    }
+
+    public void assertAddEditMailNotifierPage()
+    {
+        assertPage( "Continuum - Add/Edit Mail Notifier" );
+        assertTextPresent( "Add/Edit Mail Notifier" );
+        assertTextPresent( "Mail Recipient Address" );
+        assertTextPresent( "Send a mail to latest committers" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+        assertTextPresent( "Send on SCM Failure" );
+        assertElementPresent( "address" );
+        assertElementPresent( "Cancel" );
+    }
+
+    public void assertAddEditIrcNotifierPage()
+    {
+        assertPage( "Continuum - Add/Edit IRC Notifier" );
+
+        assertTextPresent( "IRC Host" );
+        assertElementPresent( "host" );
+
+        assertTextPresent( "IRC port" );
+        assertElementPresent( "port" );
+
+        assertTextPresent( "IRC channel" );
+        assertElementPresent( "channel" );
+
+        assertTextPresent( "Nick Name" );
+        assertElementPresent( "nick" );
+
+        assertTextPresent( "Alternate Nick Name" );
+        assertElementPresent( "alternateNick" );
+
+        assertTextPresent( "User Name" );
+        assertElementPresent( "username" );
+
+        assertTextPresent( "Full Name" );
+        assertElementPresent( "fullName" );
+
+        assertTextPresent( "Password" );
+        assertElementPresent( "password" );
+
+        assertTextPresent( "SSL" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+        assertTextPresent( "Send on SCM Failure" );
+    }
+
+    public void assertAddEditJabberPage()
+    {
+        assertPage( "Continuum - Add/Edit Jabber Notifier" );
+
+        assertTextPresent( "Jabber Host" );
+        assertElementPresent( "host" );
+        assertTextPresent( "Jabber port" );
+        assertElementPresent( "port" );
+        assertTextPresent( "Jabber login" );
+        assertElementPresent( "login" );
+        assertTextPresent( "Jabber Password" );
+        assertElementPresent( "password" );
+        assertTextPresent( "Jabber Domain Name" );
+        assertElementPresent( "domainName" );
+        assertTextPresent( "Jabber Recipient Address" );
+        assertElementPresent( "address" );
+
+        assertTextPresent( "Is it a SSL connection?" );
+        assertTextPresent( "Is it a Jabber group?" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+        assertTextPresent( "Send on SCM Failure" );
+    }
+
+    public void assertAddEditMsnPage()
+    {
+        assertPage( "Continuum - Add/Edit MSN Notifier" );
+
+        assertTextPresent( "MSN login" );
+        assertElementPresent( "login" );
+        assertTextPresent( "MSN Password" );
+        assertElementPresent( "password" );
+        assertTextPresent( "MSN Recipient Address" );
+        assertElementPresent( "address" );
+
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+        assertTextPresent( "Send on SCM Failure" );
+    }
+
+    public void assertAddEditWagonPage()
+    {
+        assertPage( "Continuum - Add/Edit Wagon Notifier" );
+
+        assertTextPresent( "Project Site URL" );
+        assertTextPresent( "Server Id (defined in your settings.xml for authentication)" );
+        assertElementPresent( "url" );
+        assertElementPresent( "id" );
+        assertTextPresent( "Send on Success" );
+        assertTextPresent( "Send on Failure" );
+        assertTextPresent( "Send on Error" );
+        assertTextPresent( "Send on Warning" );
+    }
+
+    public void goToGroupNotifier( String projectGroupName, String projectGroupId, String projectGroupDescription )
+        throws Exception
+    {
+        showProjectGroup( projectGroupName, projectGroupId, projectGroupDescription );
+        clickLinkWithText( "Notifiers" );
+        assertGroupNotifierPage( projectGroupName );
+        clickButtonWithValue( "Add" );
+        assertAddNotifierPage();
+    }
+
+    public void goToProjectNotifier( String projectGroupName, String projectName )
+        throws Exception
+    {
+        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
+    {
+        selectValue( "//select", "Mail" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditMailNotifierPage();
+        setFieldValue( "address", email );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Address is invalid" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+
+    public void editMailNotifier( String projectGroupName, String projectName, String oldMail, String newMail,
+                                  boolean isValid )
+        throws Exception
+    {
+        if ( projectName == null )
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'mail')])//img" );
+        }
+        else
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'mail')])//img" );
+        }
+        assertAddEditMailNotifierPage();
+        assertFieldValue( oldMail, "address" );
+        setFieldValue( "address", newMail );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Address is invalid" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+
+    public void addIrcNotifier( String projectGroupName, String projectName, String host, String channel,
+                                boolean isValid )
+        throws Exception
+    {
+        selectValue( "//select", "IRC" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditIrcNotifierPage();
+        setFieldValue( "host", host );
+        setFieldValue( "channel", channel );
+
+        clickButtonWithValue( "Save" );
+        if ( !isValid )
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Channel is required" );
+        }
+        else 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
+    {
+        if ( projectName == null )
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'irc')])//img" );
+        }
+        else
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'irc')])//img" );
+        }
+        assertAddEditIrcNotifierPage();
+        assertFieldValue( oldHost, "host" );
+        assertFieldValue( oldChannel, "channel" );
+        setFieldValue( "host", newHost );
+        setFieldValue( "channel", newChannel );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Channel is required" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+
+    public void addJabberNotifier( String projectGroupName, String projectName, String host, String login,
+                                   String password, String address, boolean isValid )
+        throws Exception
+    {
+        selectValue( "//select", "Jabber" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditJabberPage();
+        setFieldValue( "host", host );
+        setFieldValue( "login", login );
+        setFieldValue( "password", password );
+        setFieldValue( "address", address );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+        else 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
+    {
+        if ( projectName == null )
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'jabber')])//img" );
+        }
+        else
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'jabber')])//img" );
+        }
+        assertAddEditJabberPage();
+        assertFieldValue( oldHost, "host" );
+        assertFieldValue( oldLogin, "login" );
+        assertFieldValue( oldAddress, "address" );
+        setFieldValue( "host", newHost );
+        setFieldValue( "login", newLogin );
+        setFieldValue( "password", newPassword );
+        setFieldValue( "address", newAddress );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Host is required" );
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+
+    public void addMsnNotifier( String projectGroupName, String projectName, String login, String password,
+                                String recipientAddress, boolean isValid )
+        throws Exception
+    {
+        selectValue( "//select", "MSN" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditMsnPage();
+        setFieldValue( "login", login );
+        setFieldValue( "password", password );
+        setFieldValue( "address", recipientAddress );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+        else 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
+    {
+        if ( projectName == null )
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'msn')])//img" );
+        }
+        else
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'msn')])//img" );
+        }
+        assertAddEditMsnPage();
+        assertFieldValue( oldLogin, "login" );
+        assertFieldValue( oldAddress, "address" );
+        setFieldValue( "login", newLogin );
+        setFieldValue( "password", newPassword );
+        setFieldValue( "address", newAddress );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Login is required" );
+            assertTextPresent( "Password is required" );
+            assertTextPresent( "Address is required" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+
+    public void addWagonNotifierPage( String projectGroupName, String projectName, String siteUrl, String serverId,
+                                      boolean isValid )
+        throws Exception
+    {
+        selectValue( "//select", "Wagon" );
+        clickButtonWithValue( "Submit" );
+        assertAddEditWagonPage();
+        setFieldValue( "url", siteUrl );
+        setFieldValue( "id", serverId );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Destination URL is required" );
+            assertTextPresent( "Server Id is required" );
+        }
+        else 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
+    {
+        if ( projectName == null )
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectGroupNotifier') and contains(@href,'wagon')])//img" );
+        }
+        else
+        {
+            clickLinkWithXPath( "(//a[contains(@href,'editProjectNotifier') and contains(@href,'wagon')])//img" );
+        }
+        assertAddEditWagonPage();
+        assertFieldValue( oldUrl, "url" );
+        assertFieldValue( oldId, "id" );
+        setFieldValue( "url", newUrl );
+        setFieldValue( "id", newId );
+        clickButtonWithValue( "Save" );
+
+        if ( !isValid )
+        {
+            assertTextPresent( "Destination URL is required" );
+            assertTextPresent( "Server Id is required" );
+        }
+        else if ( projectName != null )
+        {
+            assertProjectInformationPage();
+        }
+        else
+        {
+            assertGroupNotifierPage( projectGroupName );
+        }
+    }
+}

Added: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java?rev=834357&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractPurgeTest.java Tue Nov 10 05:38:01 2009
@@ -0,0 +1,181 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author José Morales Martínez
+ * @version $Id$
+ */
+public abstract class AbstractPurgeTest
+    extends AbstractSeleniumTest
+{
+    public void goToGeneralPurgePage()
+    {
+        clickLinkWithText( "Purge Configurations" );
+        assertGeneralPurgePage();
+    }
+
+    public void assertGeneralPurgePage()
+    {
+        assertPage( "Continuum - Purge Configurations" );
+        assertTextPresent( "Repository Purge Configurations" );
+        assertTextPresent( "Directory Purge Configurations" );
+        assertButtonWithValuePresent( "Add" );
+    }
+
+    public void removeRepositoryPurge( String purgeDescription )
+    {
+        goToGeneralPurgePage();
+        clickLinkWithXPath( "(//a[contains(@href,'removePurgeConfig.action') and contains(@href, '" + purgeDescription
+            + "')])//img" );
+        assertTextPresent( "Delete Purge Configuration" );
+        assertTextPresent( "Are you sure you want to delete Purge Configuration \"" + purgeDescription + "\"?" );
+        assertButtonWithValuePresent( "Delete" );
+        assertButtonWithValuePresent( "Cancel" );
+        clickButtonWithValue( "Delete" );
+        assertGeneralPurgePage();
+    }
+
+    public void removeDirectoryPurge( String purgeDescription )
+    {
+        goToGeneralPurgePage();
+        clickLinkWithXPath( "(//a[contains(@href,'removePurgeConfig.action') and contains(@href, '" + purgeDescription
+            + "')])//img" );
+        assertTextPresent( "Delete Purge Configuration" );
+        assertTextPresent( "Are you sure you want to delete Purge Configuration \"" + purgeDescription + "\"?" );
+        assertButtonWithValuePresent( "Delete" );
+        assertButtonWithValuePresent( "Cancel" );
+        clickButtonWithValue( "Delete" );
+        assertGeneralPurgePage();
+    }
+
+    public void assertAddRepositoryPurgePage()
+    {
+        assertPage( "Continuum - Add/Edit Purge Configuration" );
+        assertTextPresent( "Add/Edit Purge Configuration" );
+        assertTextPresent( "Repository" );
+        assertElementPresent( "repositoryId" );
+        assertTextPresent( "Days Older" );
+        assertElementPresent( "daysOlder" );
+        assertTextPresent( "Retention Count" );
+        assertElementPresent( "retentionCount" );
+        assertElementPresent( "deleteAll" );
+        assertElementPresent( "deleteReleasedSnapshots" );
+        assertElementPresent( "defaultPurgeConfiguration" );
+        assertTextPresent( "Schedule" );
+        assertElementPresent( "scheduleId" );
+        assertTextPresent( "Description" );
+        assertElementPresent( "description" );
+        assertButtonWithValuePresent( "Save" );
+        assertButtonWithValuePresent( "Cancel" );
+    }
+
+    public void assertAddEditDirectoryPurgePage()
+    {
+        assertPage( "Continuum - Add/Edit Purge Configuration" );
+        assertTextPresent( "Add/Edit Purge Configuration" );
+        assertTextPresent( "Directory Type" );
+        assertElementPresent( "directoryType" );
+        assertTextPresent( "Days Older" );
+        assertElementPresent( "daysOlder" );
+        assertTextPresent( "Retention Count" );
+        assertElementPresent( "retentionCount" );
+        assertElementPresent( "deleteAll" );
+        assertElementPresent( "defaultPurgeConfiguration" );
+        assertTextPresent( "Schedule" );
+        assertElementPresent( "scheduleId" );
+        assertTextPresent( "Description" );
+        assertElementPresent( "description" );
+        assertButtonWithValuePresent( "Save" );
+        assertButtonWithValuePresent( "Cancel" );
+    }
+
+    public void goToAddRepositoryPurge()
+    {
+        goToGeneralPurgePage();
+        assertGeneralPurgePage();
+        clickLinkWithXPath( "//preceding::input[@value='repository' and @type='hidden']//following::input[@type='submit']" );
+        assertAddRepositoryPurgePage();
+    }
+
+    public void goToEditRepositoryPurge( String daysOlder, String retentionCount, String description )
+    {
+        goToGeneralPurgePage();
+        assertGeneralPurgePage();
+        String xPath = "//preceding::td[text()='" + description + "']//following::img[@alt='Edit']";
+        clickLinkWithXPath( xPath );
+        assertAddRepositoryPurgePage();
+        assertFieldValue( daysOlder, "daysOlder" );
+        assertFieldValue( retentionCount, "retentionCount" );
+        assertFieldValue( description, "description" );
+    }
+
+    public void goToEditDirectoryPurge( String daysOlder, String retentionCount, String description )
+    {
+        goToGeneralPurgePage();
+        assertGeneralPurgePage();
+        String xPath = "//preceding::td[text()='" + description + "']//following::img[@alt='Edit']";
+        clickLinkWithXPath( xPath );
+        assertAddEditDirectoryPurgePage();
+        assertFieldValue( daysOlder, "daysOlder" );
+        assertFieldValue( retentionCount, "retentionCount" );
+        assertFieldValue( description, "description" );
+    }
+
+    public void addEditRepositoryPurge( String daysOlder, String retentionCount, String description, boolean success )
+    {
+        setFieldValue( "daysOlder", daysOlder );
+        setFieldValue( "retentionCount", retentionCount );
+        setFieldValue( "description", description );
+        submit();
+        if ( success )
+        {
+            assertGeneralPurgePage();
+        }
+        else
+        {
+            assertAddRepositoryPurgePage();
+        }
+    }
+
+    public void goToAddDirectoryPurge()
+    {
+        goToGeneralPurgePage();
+        assertGeneralPurgePage();
+        clickLinkWithXPath( "//preceding::input[@value='directory' and @type='hidden']//following::input[@type='submit']" );
+        assertAddEditDirectoryPurgePage();
+    }
+
+    public void addEditDirectoryPurge( String daysOlder, String retentionCount, String description, boolean success )
+    {
+        setFieldValue( "daysOlder", daysOlder );
+        setFieldValue( "retentionCount", retentionCount );
+        setFieldValue( "description", description );
+        submit();
+        if ( success )
+        {
+            assertGeneralPurgePage();
+        }
+        else
+        {
+            assertAddEditDirectoryPurgePage();
+        }
+    }
+}

Added: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java?rev=834357&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractScheduleTest.java Tue Nov 10 05:38:01 2009
@@ -0,0 +1,175 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author José Morales Martínez
+ * @version $Id$
+ */
+public abstract class AbstractScheduleTest
+    extends AbstractSeleniumTest
+{
+    public void goToSchedulePage()
+    {
+        clickLinkWithText( "Schedules" );
+
+        assertSchedulePage();
+    }
+
+    public void goToAddSchedule()
+    {
+        goToSchedulePage();
+        clickButtonWithValue( "Add" );
+        assertAddSchedulePage();
+    }
+
+    public void assertSchedulePage()
+    {
+        assertPage( "Continuum - Schedules" );
+        assertTextPresent( "Schedules" );
+        assertTextPresent( "Name" );
+        assertTextPresent( "Description" );
+        assertTextPresent( "Quiet Period" );
+        assertTextPresent( "Cron Expression" );
+        assertTextPresent( "Max Job Time" );
+        assertTextPresent( "Active" );
+        assertTextPresent( "DEFAULT_SCHEDULE" );
+        assertImgWithAlt( "Edit" );
+        assertImgWithAlt( "Delete" );
+        assertButtonWithValuePresent( "Add" );
+    }
+
+    public void assertAddSchedulePage()
+    {
+        assertPage( "Continuum - Edit Schedule" );
+        assertTextPresent( "Edit Schedule" );
+        assertTextPresent( "Name" );
+        assertElementPresent( "name" );
+        assertTextPresent( "Description" );
+        assertElementPresent( "description" );
+        assertTextPresent( "Cron Expression" );
+        assertTextPresent( "Second" );
+        assertElementPresent( "second" );
+        assertTextPresent( "Minute" );
+        assertElementPresent( "minute" );
+        assertTextPresent( "Hour" );
+        assertElementPresent( "hour" );
+        assertTextPresent( "Day of Month" );
+        assertElementPresent( "dayOfMonth" );
+        assertTextPresent( "Month" );
+        assertElementPresent( "month" );
+        assertTextPresent( "Day of Week" );
+        assertElementPresent( "dayOfWeek" );
+        assertTextPresent( "Year [optional]" );
+        assertElementPresent( "year" );
+        assertTextPresent( "Maximum job execution time" );
+        assertElementPresent( "maxJobExecutionTime" );
+        assertTextPresent( "Quiet Period (seconds):" );
+        assertElementPresent( "delay" );
+        assertTextPresent( "Add Build Queue" );
+        assertElementPresent( "availableBuildQueuesIds" );
+        assertElementPresent( "selectedBuildQueuesIds" );
+        assertElementPresent( "active" );
+        assertTextPresent( "Enable/Disable the schedule" );
+        assertButtonWithValuePresent( "Save" );
+        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 )
+    {
+	if ( buildQueue ) 
+	{
+	        setFieldValue( "name", name );
+		setFieldValue( "description", description );
+		setFieldValue( "second", second );
+		setFieldValue( "minute", minute );
+		setFieldValue( "hour", hour );
+		setFieldValue( "dayOfMonth", dayMonth );
+		setFieldValue( "month", month );
+		setFieldValue( "dayOfWeek", dayWeek );
+		setFieldValue( "year", year );
+		setFieldValue( "maxJobExecutionTime", maxTime );
+		setFieldValue( "delay", period );
+		getSelenium().addSelection("saveSchedule_availableBuildQueuesIds", "label=DEFAULT_BUILD_QUEUE");
+		getSelenium().click("//input[@value='->']");
+		submit();
+	}
+	else
+	{
+		setFieldValue( "name", name );
+		setFieldValue( "description", description );
+		setFieldValue( "second", second );
+		setFieldValue( "minute", minute );
+		setFieldValue( "hour", hour );
+		setFieldValue( "dayOfMonth", dayMonth );
+		setFieldValue( "month", month );
+		setFieldValue( "dayOfWeek", dayWeek );
+		setFieldValue( "year", year );
+		setFieldValue( "maxJobExecutionTime", maxTime );
+		setFieldValue( "delay", period );
+		submit();
+	}
+
+        if ( success )
+        {
+            assertSchedulePage();
+        }
+        else
+        {
+            assertAddSchedulePage();
+        }
+    }
+
+    public void goToEditSchedule( String name, String description, String second, String minute, String hour,
+                                  String dayMonth, String month, String dayWeek, String year, String maxTime,
+                                  String period )
+    {
+        goToSchedulePage();
+        String xPath = "//preceding::td[text()='" + name + "']//following::img[@alt='Edit']";
+        clickLinkWithXPath( xPath );
+        assertAddSchedulePage();
+        assertFieldValue( name, "name" );
+        assertFieldValue( description, "description" );
+        assertFieldValue( second, "second" );
+        assertFieldValue( minute, "minute" );
+        assertFieldValue( hour, "hour" );
+        assertFieldValue( dayMonth, "dayOfMonth" );
+        assertFieldValue( month, "month" );
+        assertFieldValue( dayWeek, "dayOfWeek" );
+        assertFieldValue( year, "year" );
+        assertFieldValue( maxTime, "maxJobExecutionTime" );
+        assertFieldValue( period, "delay" );
+    }
+
+    public void removeSchedule( String name )
+    {
+        goToSchedulePage();
+        clickLinkWithXPath( "(//a[contains(@href,'removeSchedule.action') and contains(@href, '" + name + "')])//img" );
+        assertPage( "Continuum - Delete Schedule" );
+        assertTextPresent( "Delete Schedule" );
+        assertTextPresent( "Are you sure you want to delete the schedule \"" + name + "\"?" );
+        assertButtonWithValuePresent( "Delete" );
+        assertButtonWithValuePresent( "Cancel" );
+        clickButtonWithValue( "Delete" );
+        assertSchedulePage();
+    }
+}

Added: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=834357&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java Tue Nov 10 05:38:01 2009
@@ -0,0 +1,447 @@
+package org.apache.continuum.web.test.parent;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Map.Entry;
+
+import org.apache.commons.io.IOUtils;
+import org.testng.Assert;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+import com.thoughtworks.selenium.Selenium;
+
+/**
+ * Based on AbstractSeleniumTestCase of Emmanuel Venisse test.
+ *
+ * @author José Morales Martínez
+ * @version $Id$
+ */
+public abstract class AbstractSeleniumTest
+{
+    public static String baseUrl;
+
+    public static String maxWaitTimeInMs;
+
+    private static ThreadLocal<Selenium> selenium = new ThreadLocal<Selenium>();
+
+    private static Properties p;
+
+    private final static String PROPERTIES_SEPARATOR = "=";
+
+    /**
+     * Initialize properties.
+     */
+    public void open()
+        throws Exception
+    {
+        InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties" );
+        p = new Properties();
+        p.load( input );
+
+        maxWaitTimeInMs = getProperty( "MAX_WAIT_TIME_IN_MS" );
+    }
+
+    /**
+     * Initialize selenium
+     */
+    public void open( String baseUrl, String browser, String seleniumHost, int seleniumPort )
+        throws Exception
+    {
+        this.baseUrl = baseUrl;
+
+        if ( getSelenium() == null )
+        {
+            DefaultSelenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
+            s.start();
+            selenium.set( s );
+        }
+    }
+
+    public static Selenium getSelenium()
+    {
+        return selenium == null ? null : selenium.get();
+    }
+
+    protected String getProperty( String key )
+    {
+        return p.getProperty( key );
+    }
+
+    protected String getEscapeProperty( String key )
+    {
+        InputStream input = this.getClass().getClassLoader().getResourceAsStream( "testng.properties" );
+        String value = null;
+        List<String> lines;
+        try
+        {
+            lines = IOUtils.readLines( input );
+        }
+        catch ( IOException e )
+        {
+            lines = new ArrayList<String>();
+        }
+        for ( String l : lines )
+        {
+            if ( l != null && l.startsWith( key ) )
+            {
+                int indexSeparator = l.indexOf( PROPERTIES_SEPARATOR );
+                value = l.substring( indexSeparator + 1 ).trim();
+                break;
+            }
+        }
+        return value;
+    }
+
+    /**
+     * Close selenium session. Called from AfterSuite method of sub-class
+     */
+    public void close()
+        throws Exception
+    {
+        if ( getSelenium() != null )
+        {
+            getSelenium().stop();
+            selenium.set( null );
+        }
+    }
+
+    // *******************************************************
+    // Auxiliar methods. This method help us and simplify test.
+    // *******************************************************
+
+    public void assertFieldValue( String fieldValue, String fieldName )
+    {
+        assertElementPresent( fieldName );
+        Assert.assertEquals( fieldValue, getSelenium().getValue( fieldName ) );
+    }
+
+    public void assertPage( String title )
+    {
+        Assert.assertEquals( getTitle(), title );
+    }
+
+    public String getTitle()
+    {
+        return getSelenium().getTitle();
+    }
+
+    public String getHtmlContent()
+    {
+        return getSelenium().getHtmlSource();
+    }
+
+    public void assertTextPresent( String text )
+    {
+        Assert.assertTrue( getSelenium().isTextPresent( text ), "'" + text + "' isn't present." );
+    }
+
+    public void assertTextNotPresent( String text )
+    {
+        Assert.assertFalse( getSelenium().isTextPresent( text ), "'" + text + "' is present." );
+    }
+
+    public void assertElementPresent( String elementLocator )
+    {
+        Assert.assertTrue( isElementPresent( elementLocator ), "'" + elementLocator + "' isn't present." );
+    }
+
+    public void assertElementNotPresent( String elementLocator )
+    {
+        Assert.assertFalse( isElementPresent( elementLocator ), "'" + elementLocator + "' is present." );
+    }
+
+    public void assertLinkPresent( String text )
+    {
+        Assert.assertTrue( isElementPresent( "link=" + text ), "The link '" + text + "' isn't present." );
+    }
+
+    public void assertLinkNotPresent( String text )
+    {
+            Assert.assertFalse( isElementPresent( "link=" + text ), "The link '" + text + "' is present." );
+    }
+
+    public 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 assertCellValueFromTable( String expected, String tableElement, int row, int column )
+    {
+        Assert.assertEquals( expected, getCellValueFromTable( tableElement, row, column ) );
+    }
+
+    public boolean isTextPresent( String text )
+    {
+        return getSelenium().isTextPresent( text );
+    }
+
+    public boolean isLinkPresent( String text )
+    {
+        return isElementPresent( "link=" + text );
+    }
+
+    public boolean isElementPresent( String locator )
+    {
+        return getSelenium().isElementPresent( locator );
+    }
+
+    public void waitPage()
+    {
+        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+    }
+
+    public String getFieldValue( String fieldName )
+    {
+        return getSelenium().getValue( fieldName );
+    }
+
+    public String getCellValueFromTable( String tableElement, int row, int column )
+    {
+        return getSelenium().getTable( tableElement + "." + row + "." + column );
+    }
+
+    public void selectValue( String locator, String value )
+    {
+        getSelenium().select( locator, "label=" + value );
+    }
+
+    public void assertOptionPresent( String selectField, String[] options )
+    {
+        assertElementPresent( selectField );
+        String[] optionsPresent = getSelenium().getSelectOptions( selectField );
+        List<String> expected = Arrays.asList( options );
+        List<String> present = Arrays.asList( optionsPresent );
+
+        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()
+    {
+        clickLinkWithXPath( "//input[@type='submit']" );
+    }
+
+    public void assertButtonWithValuePresent( String text )
+    {
+        Assert.assertTrue( isButtonWithValuePresent( text ), "'" + text + "' button isn't present" );
+    }
+
+    public 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 )
+    {
+        return isElementPresent( "//button[@value='" + text + "']" )
+            || isElementPresent( "//input[@value='" + text + "']" );
+    }
+
+    public boolean isButtonWithIdPresent( String text )
+    {
+        return isElementPresent( "//button[@id='" + text + "']" ) || isElementPresent( "//input[@id='" + text + "']" );
+    }
+
+    public void clickButtonWithValue( String text )
+    {
+        clickButtonWithValue( text, true );
+    }
+
+    public void clickButtonWithValue( String text, boolean wait )
+    {
+        assertButtonWithValuePresent( text );
+
+        if ( isElementPresent( "//button[@value='" + text + "']" ) )
+        {
+            clickLinkWithXPath( "//button[@value='" + text + "']", wait );
+        }
+        else
+        {
+            clickLinkWithXPath( "//input[@value='" + text + "']", wait );
+        }
+    }
+
+    public void clickSubmitWithLocator( String locator )
+    {
+        clickLinkWithLocator( locator );
+    }
+
+    public void clickSubmitWithLocator( String locator, boolean wait )
+    {
+        clickLinkWithLocator( locator, wait );
+    }
+
+    public void clickImgWithAlt( String alt )
+    {
+        clickLinkWithLocator( "//img[@alt='" + alt + "']" );
+    }
+
+    public void clickLinkWithText( String text )
+    {
+        clickLinkWithText( text, true );
+    }
+
+    public void clickLinkWithText( String text, boolean wait )
+    {
+        clickLinkWithLocator( "link=" + text, wait );
+    }
+
+    public void clickLinkWithXPath( String xpath )
+    {
+        clickLinkWithXPath( xpath, true );
+    }
+
+    public void clickLinkWithXPath( String xpath, boolean wait )
+    {
+        clickLinkWithLocator( "xpath=" + xpath, wait );
+    }
+
+    public void clickLinkWithLocator( String locator )
+    {
+        clickLinkWithLocator( locator, true );
+    }
+
+    public void clickLinkWithLocator( String locator, boolean wait )
+    {
+        assertElementPresent( locator );
+        getSelenium().click( locator );
+        if ( wait )
+        {
+            waitPage();
+        }
+    }
+
+    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 )
+    {
+        getSelenium().type( fieldName, value );
+    }
+
+    public void checkField( String locator )
+    {
+        getSelenium().check( locator );
+    }
+
+    public void uncheckField( String locator )
+    {
+        getSelenium().uncheck( locator );
+    }
+
+    public boolean isChecked( String locator )
+    {
+        return getSelenium().isChecked( locator );
+    }
+
+    public void assertIsChecked( String locator )
+    {
+        Assert.assertTrue( getSelenium().isChecked( locator ) );
+    }
+
+    public void assertIsNotChecked( String locator )
+    {
+        Assert.assertFalse( getSelenium().isChecked( locator ) );
+    }
+
+    public void clickAndWait( String locator )
+    {
+        getSelenium().click( locator );
+        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+    }
+
+    public void waitForElementPresent( String locator )
+        throws InterruptedException
+    {
+        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+        for ( int second = 0;; second++ )
+        {
+            if ( second >= 60 )
+                Assert.fail( "timeout" );
+            try
+            {
+                if ( isElementPresent( locator ) )
+                    break;
+            }
+            catch ( Exception e )
+            {
+            }
+            Thread.sleep( 1000 );
+        }
+    }
+
+    public void waitForTextPresent( String text )
+        throws InterruptedException
+    {
+        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+        for ( int second = 0;; second++ )
+        {
+            if ( second >= 60 )
+                Assert.fail( "Timeout" );
+            try
+            {
+                if ( isTextPresent( text ) )
+                    break;
+            }
+            catch ( Exception e )
+            {
+            }
+            Thread.sleep( 1000 );
+        }
+    }
+}

Added: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java?rev=834357&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractUserRolesManagementTest.java Tue Nov 10 05:38:01 2009
@@ -0,0 +1,375 @@
+package org.apache.continuum.web.test.parent;
+
+import java.io.File;
+
+import org.apache.continuum.web.test.XPathExpressionUtil;
+
+public abstract class AbstractUserRolesManagementTest
+	extends AbstractContinuumTest
+{
+	protected String username;
+	protected String fullname;
+
+	public String getUserEmail()
+	{
+		String email = getProperty( "USERROLE_EMAIL" );
+		return email;
+	}
+
+	public String getUserRolePassword()
+	{
+		String password = getProperty( "USERROLE_PASSWORD" );
+		return password;
+	}
+
+	public String getUserRoleNewPassword()
+	{
+		String password_new = getProperty( "NEW_USERROLE_PASSWORD" );
+		return password_new;
+	}
+
+	public String getBasedir()
+    {
+        String basedir = System.getProperty( "basedir" );
+
+        if ( basedir == null )
+        {
+            basedir = new File( "" ).getAbsolutePath();
+        }
+
+        return basedir;
+    }
+
+	public String getAdminUsername()
+	{
+		String adminUsername = getProperty( "ADMIN_USERNAME" );
+		return adminUsername;
+	}
+
+	public String getAdminPassword()
+	{
+		String adminPassword = getProperty( "ADMIN_PASSWORD" );
+		return adminPassword;
+	}
+
+	////////////////////////////
+	// Assertions
+	////////////////////////////
+	public void assertCreateUserPage()
+	{
+		assertPage( "[Admin] User Create" );
+		assertTextPresent( "[Admin] User Create" );
+		assertTextPresent( "Username*:" );
+		assertElementPresent( "user.username" );
+		assertTextPresent( "Full Name*:");
+		assertElementPresent( "user.fullName" );
+		assertTextPresent( "Email Address*:" );
+		assertElementPresent( "user.email" );
+		assertTextPresent( "Password*:" );
+		assertElementPresent( "user.password" );
+		assertTextPresent( "Confirm Password*:" );
+		assertElementPresent( "user.confirmPassword" );
+		assertButtonWithValuePresent( "Create User" );
+	}
+
+	public void assertUserRolesPage()
+	{
+		assertPage( "[Admin] User Edit" );
+		assertTextPresent( "[Admin] User Roles" );
+		String userRoles = "Username,Full Name,Email,redback-xwork-integration-core,Redback XWork Integration Security Core,Guest,Registered User,System Administrator,User Administrator,Continuum Group Project Administrator,Continuum Group Project Developer,Continuum Group Project User,Continuum Manage Build Environments,Continuum Manage Build Templates,Continuum Manage Installations,Continuum Manage Local Repositories,Continuum Manage Purging,Continuum Manage Queues,Continuum Manage Scheduling,Project Administrator,Project Developer,Project User,Default Project Group";
+		String[] arrayUserRoles = userRoles.split( "," );
+			for ( String userroles : arrayUserRoles )
+				assertTextPresent( userroles );
+	}
+
+	   public void assertCreatedUserInfo( String username )
+    {
+        selectValue( "name=ec_rd", "50" );
+        waitPage();
+        clickLinkWithText( username );
+        clickLinkWithText( "Edit Roles" );
+    }
+
+	public void assertUserRoleCheckBoxPresent( String value )
+    {
+    	getSelenium().isElementPresent( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
+    }
+
+    public void assertResourceRolesCheckBoxPresent( String value )
+    {
+    	getSelenium().isElementPresent( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
+    }
+
+    public void checkUserRoleWithValue( String value )
+    {
+    	assertUserRoleCheckBoxPresent( value );
+    	getSelenium().click( "xpath=//input[@id='addRolesToUser_addNDSelectedRoles' and @name='addNDSelectedRoles' and @value='"+ value + "']" );
+    }
+
+    public void checkResourceRoleWithValue( String value )
+    {
+    	assertResourceRolesCheckBoxPresent( value );
+    	getSelenium().click( "xpath=//input[@name='addDSelectedRoles' and @value='" + value + "']" );
+    }
+
+	public void assertLeftNavMenuWithRole( String role )
+	{
+		if( role == "System Administrator" )
+    	{
+    		String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Local Repositories,Purge Configurations,Schedules,Installations,Build Environments,Queues,Build Definition Templates,Configuration,Appearance,Users,Roles,Build Queue";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "User Administrator" )
+    	{
+    		String navMenu = "About,Show Project Groups,Users,Roles";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Group Project Administrator" )
+    	{
+    		String navMenu = "About,Show Project Groups,Maven 2.0.x Project,Maven 1.x Project,Ant Project,Shell Project,Schedules,Queues,Users,Roles";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Group Project Developer" )
+    	{
+    		String navMenu = "About,Show Project Groups,Queues";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Group Project User" )
+    	{
+    		String navMenu = "About,Show Project Groups,Queues";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Build Environments" )
+    	{
+    		String navMenu = "About,Show Project Groups,Build Environments";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Build Templates" )
+    	{
+    		String navMenu = "About,Show Project Groups,Build Definition Templates";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Installations" )
+    	{
+    		String navMenu = "About,Show Project Groups,Installations";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Local Repositories" )
+    	{
+    		String navMenu = "About,Show Project Groups,Local Repositories";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Purging" )
+    	{
+    		String navMenu = "About,Show Project Groups,Purge Configurations";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Queues" )
+    	{
+    		String navMenu = "About,Show Project Groups,Queues";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Continuum Manage Scheduling" )
+    	{
+    		String navMenu = "About,Show Project Groups,Schedules";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Project Administrator - Default Project Group" )
+    	{
+    		String navMenu = "About,Show Project Groups,Queues,Users,Roles";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else if( role == "Project Developer - Default Project Group" || role == "Project User - Default Project Group" )
+    	{
+    		String navMenu = "About,Show Project Groups,Queues";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    	}
+    	else
+    	{
+    		String navMenu = "About,Show Project Groups";
+    		String[] arrayNavMenu = navMenu.split( "," );
+    		for( String navmenu : arrayNavMenu )
+    			assertLinkPresent( navmenu );
+    		assertTextPresent( "Project Groups" );
+    		//assertTextPresent( "Project Groups list is empty." );
+    	}
+
+	}
+
+    public void assertDeleteUserPage( String username )
+    {
+        assertPage( "[Admin] User Delete" ); //TODO
+        assertTextPresent( "[Admin] User Delete" );
+        assertTextPresent( "The following user will be deleted:" );
+        assertTextPresent( "Username: " + username );
+        assertButtonWithValuePresent( "Delete User" );
+    }
+
+	public void assertProjectAdministratorAccess()
+    {
+        assertLinkPresent( "About" );
+        assertLinkPresent( "Show Project Groups" );
+        assertLinkPresent( "Maven 2.0.x Project" );
+        assertLinkPresent( "Maven 1.x Project" );
+        assertLinkPresent( "Ant Project" );
+        assertLinkPresent( "Shell Project" );
+        assertLinkPresent( "Schedules" );
+        assertLinkPresent( "Queues" );
+        assertLinkPresent( "Users" );
+        assertLinkPresent( "Roles" );
+        assertLinkNotPresent( "Local Repositories" );
+        assertLinkNotPresent( "Purge Configurations" );
+        assertLinkNotPresent( "Installations" );
+        assertLinkNotPresent( "Build Environments" );
+        assertLinkNotPresent( "Build Definition Templates" );
+        assertLinkNotPresent( "Configuration" );
+        assertLinkNotPresent( "Appearance" );
+        assertLinkNotPresent( "Build Queue" );
+        assertLinkNotPresent( "Build Agent" );
+    }
+
+	/////////////////////////////////////////
+	// User Roles Management
+	/////////////////////////////////////////
+    public void changePassword( String oldPassword, String newPassword )
+	{
+		assertPage( "Change Password" );
+		setFieldValue( "existingPassword", oldPassword );
+		setFieldValue( "newPassword", newPassword );
+		setFieldValue( "newPasswordConfirm", newPassword );
+		clickButtonWithValue( "Change Password" );
+	}
+
+	public void createUser( String userName, String fullName, String email, String password, boolean valid )
+	{
+		createUser( userName, fullName, email, password, password, valid );
+	}
+
+	private void createUser( String userName, String fullName, String emailAd, String password, String confirmPassword,
+                             boolean valid )
+	{
+		login( getAdminUsername() , getAdminPassword() );
+		clickLinkWithText( "Users" );
+		clickButtonWithValue( "Create New User" );
+		assertCreateUserPage();
+        setFieldValue( "user.username", userName );
+        setFieldValue( "user.fullName", fullName );
+        setFieldValue( "user.email", emailAd );
+        setFieldValue( "user.password", password );
+        setFieldValue( "user.confirmPassword", confirmPassword );
+        submit();
+
+        assertUserRolesPage( );
+        clickButtonWithValue( "Submit" );
+
+        /*if (valid )
+        {
+        	String[] columnValues = {userName, fullName, emailAd};
+            assertElementPresent( XPathExpressionUtil.getTableRow( columnValues ) );
+        }
+        else
+        {
+            assertCreateUserPage();
+        }*/
+	}
+
+
+	public void login( String username, String password )
+	{
+	    login( username, password, true, "Login Page" );
+	}
+
+    public void login( String username, String password, boolean valid, String assertReturnPage )
+	{
+        if ( isLinkPresent( "Login" ) )
+	    {
+            goToLoginPage();
+
+            submitLoginPage( username, password, false, valid, assertReturnPage );
+	    }
+    }
+
+    public void submitLoginPage( String username, String password )
+    {
+        submitLoginPage( username, password, false, true, "Login Page" );
+    }
+
+    public void submitLoginPage( String username, String password, boolean validUsernamePassword )
+    {
+        submitLoginPage( username, password, false, validUsernamePassword, "Login Page" );
+    }
+
+    public void submitLoginPage( String username, String password, boolean rememberMe, boolean validUsernamePassword,
+                                 String assertReturnPage )
+    {
+        assertLoginPage();
+        setFieldValue( "username", username );
+        setFieldValue( "password", password );
+        if ( rememberMe )
+        {
+            checkField( "rememberMe" );
+        }
+        clickButtonWithValue( "Login" );
+
+        if ( validUsernamePassword )
+        {
+            assertTextPresent( "Current User:" );
+            assertTextPresent( username );
+            assertLinkPresent( "Edit Details" );
+            assertLinkPresent( "Logout" );
+        }
+        else
+        {
+            if ( "Login Page".equals( assertReturnPage ) )
+            {
+                assertLoginPage();
+            }
+            else
+            {
+                assertPage( assertReturnPage );
+            }
+        }
+    }
+
+	public void deleteUser( String userName, String fullName, String emailAdd )
+    {
+        deleteUser( userName, fullName, emailAdd, false, false );
+    }
+
+    public void deleteUser( String userName, String fullName, String emailAd, boolean validated, boolean locked )
+    {
+	    //clickLinkWithText( "userlist" );
+        clickLinkWithXPath( "//table[@id='ec_table']/tbody[2]/tr[3]/td[7]/a/img" );
+        assertDeleteUserPage( userName );
+        submit();
+        assertElementNotPresent( userName );
+    }
+}

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy?rev=834357&r1=834356&r2=834357&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/src/test/tomcat5x/conf/catalina.policy Tue Nov 10 05:38:01 2009
@@ -1,172 +1,172 @@
-// ============================================================================
-// catalina.corepolicy - Security Policy Permissions for Tomcat 5
-//
-// This file contains a default set of security policies to be enforced (by the
-// JVM) when Catalina is executed with the "-security" option.  In addition
-// to the permissions granted here, the following additional permissions are
-// granted to the codebase specific to each web application:
-//
-// * Read access to the document root directory
-//
-// $Id: catalina.policy 393732 2006-04-13 06:32:25Z pero $
-// ============================================================================
-
-
-// ========== SYSTEM CODE PERMISSIONS =========================================
-
-
-// These permissions apply to javac
-grant codeBase "file:${java.home}/lib/-" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions
-grant codeBase "file:${java.home}/jre/lib/ext/-" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/../lib/-" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions when
-// ${java.home} points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/lib/ext/-" {
-        permission java.security.AllPermission;
-};
-
-
-// ========== CATALINA CODE PERMISSIONS =======================================
-
-
-// These permissions apply to the launcher code
-grant codeBase "file:${catalina.home}/bin/commons-launcher.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the daemon code
-grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the commons-logging API
-grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the server startup code
-grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the JMX server
-grant codeBase "file:${catalina.home}/bin/jmx.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to JULI
-grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the servlet API classes
-// and those that are shared across all class loaders
-// located in the "common" directory
-grant codeBase "file:${catalina.home}/common/-" {
-        permission java.security.AllPermission;
-};
-
-// These permissions apply to the container's core code, plus any additional
-// libraries installed in the "server" directory
-grant codeBase "file:${catalina.home}/server/-" {
-        permission java.security.AllPermission;
-};
-
-// The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory
-grant codeBase "file:${catalina.home}/webapps/balancer/-" {
-        permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
-        permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*";
-};
-// ========== WEB APPLICATION PERMISSIONS =====================================
-
-
-// These permissions are granted by default to all web applications
-// In addition, a web application will be given a read FilePermission
-// and JndiPermission for all files and directories in its document root.
-grant { 
-    // Required for JNDI lookup of named JDBC DataSource's and
-    // javamail named MimePart DataSource used to send mail
-    permission java.util.PropertyPermission "java.home", "read";
-    permission java.util.PropertyPermission "java.naming.*", "read";
-    permission java.util.PropertyPermission "javax.sql.*", "read";
-
-    // OS Specific properties to allow read access
-    permission java.util.PropertyPermission "os.name", "read";
-    permission java.util.PropertyPermission "os.version", "read";
-    permission java.util.PropertyPermission "os.arch", "read";
-    permission java.util.PropertyPermission "file.separator", "read";
-    permission java.util.PropertyPermission "path.separator", "read";
-    permission java.util.PropertyPermission "line.separator", "read";
-
-    // JVM properties to allow read access
-    permission java.util.PropertyPermission "java.version", "read";
-    permission java.util.PropertyPermission "java.vendor", "read";
-    permission java.util.PropertyPermission "java.vendor.url", "read";
-    permission java.util.PropertyPermission "java.class.version", "read";
-	permission java.util.PropertyPermission "java.specification.version", "read";
-	permission java.util.PropertyPermission "java.specification.vendor", "read";
-	permission java.util.PropertyPermission "java.specification.name", "read";
-
-	permission java.util.PropertyPermission "java.vm.specification.version", "read";
-	permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
-	permission java.util.PropertyPermission "java.vm.specification.name", "read";
-	permission java.util.PropertyPermission "java.vm.version", "read";
-	permission java.util.PropertyPermission "java.vm.vendor", "read";
-	permission java.util.PropertyPermission "java.vm.name", "read";
-
-    // Required for OpenJMX
-    permission java.lang.RuntimePermission "getAttribute";
-
-	// Allow read of JAXP compliant XML parser debug
-	permission java.util.PropertyPermission "jaxp.debug", "read";
-
-    // Precompiled JSPs need access to this package.
-    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
-    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
-    
-};
-
-
-// You can assign additional permissions to particular web applications by
-// adding additional "grant" entries here, based on the code base for that
-// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
-//
-// Different permissions can be granted to JSP pages, classes loaded from
-// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
-// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
-//
-// For instance, assume that the standard "examples" application
-// included a JDBC driver that needed to establish a network connection to the
-// corresponding database and used the scrape taglib to get the weather from
-// the NOAA web server.  You might create a "grant" entries like this:
-//
-// The permissions granted to the context root directory apply to JSP pages.
-// grant codeBase "file:${catalina.home}/webapps/examples/-" {
-//      permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-//      permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-//
-// The permissions granted to the context WEB-INF/classes directory
-// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
-// };
-//
-// The permission granted to your JDBC driver
-// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
-//      permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-// };
-// The permission granted to the scrape taglib
-// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
-//      permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-
+// ============================================================================
+// catalina.corepolicy - Security Policy Permissions for Tomcat 5
+//
+// This file contains a default set of security policies to be enforced (by the
+// JVM) when Catalina is executed with the "-security" option.  In addition
+// to the permissions granted here, the following additional permissions are
+// granted to the codebase specific to each web application:
+//
+// * Read access to the document root directory
+//
+// $Id$
+// ============================================================================
+
+
+// ========== SYSTEM CODE PERMISSIONS =========================================
+
+
+// These permissions apply to javac
+grant codeBase "file:${java.home}/lib/-" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions
+grant codeBase "file:${java.home}/jre/lib/ext/-" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/../lib/-" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions when
+// ${java.home} points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/lib/ext/-" {
+        permission java.security.AllPermission;
+};
+
+
+// ========== CATALINA CODE PERMISSIONS =======================================
+
+
+// These permissions apply to the launcher code
+grant codeBase "file:${catalina.home}/bin/commons-launcher.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the daemon code
+grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the commons-logging API
+grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the server startup code
+grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the JMX server
+grant codeBase "file:${catalina.home}/bin/jmx.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to JULI
+grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the servlet API classes
+// and those that are shared across all class loaders
+// located in the "common" directory
+grant codeBase "file:${catalina.home}/common/-" {
+        permission java.security.AllPermission;
+};
+
+// These permissions apply to the container's core code, plus any additional
+// libraries installed in the "server" directory
+grant codeBase "file:${catalina.home}/server/-" {
+        permission java.security.AllPermission;
+};
+
+// The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory
+grant codeBase "file:${catalina.home}/webapps/balancer/-" {
+        permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
+        permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*";
+};
+// ========== WEB APPLICATION PERMISSIONS =====================================
+
+
+// These permissions are granted by default to all web applications
+// In addition, a web application will be given a read FilePermission
+// and JndiPermission for all files and directories in its document root.
+grant { 
+    // Required for JNDI lookup of named JDBC DataSource's and
+    // javamail named MimePart DataSource used to send mail
+    permission java.util.PropertyPermission "java.home", "read";
+    permission java.util.PropertyPermission "java.naming.*", "read";
+    permission java.util.PropertyPermission "javax.sql.*", "read";
+
+    // OS Specific properties to allow read access
+    permission java.util.PropertyPermission "os.name", "read";
+    permission java.util.PropertyPermission "os.version", "read";
+    permission java.util.PropertyPermission "os.arch", "read";
+    permission java.util.PropertyPermission "file.separator", "read";
+    permission java.util.PropertyPermission "path.separator", "read";
+    permission java.util.PropertyPermission "line.separator", "read";
+
+    // JVM properties to allow read access
+    permission java.util.PropertyPermission "java.version", "read";
+    permission java.util.PropertyPermission "java.vendor", "read";
+    permission java.util.PropertyPermission "java.vendor.url", "read";
+    permission java.util.PropertyPermission "java.class.version", "read";
+	permission java.util.PropertyPermission "java.specification.version", "read";
+	permission java.util.PropertyPermission "java.specification.vendor", "read";
+	permission java.util.PropertyPermission "java.specification.name", "read";
+
+	permission java.util.PropertyPermission "java.vm.specification.version", "read";
+	permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
+	permission java.util.PropertyPermission "java.vm.specification.name", "read";
+	permission java.util.PropertyPermission "java.vm.version", "read";
+	permission java.util.PropertyPermission "java.vm.vendor", "read";
+	permission java.util.PropertyPermission "java.vm.name", "read";
+
+    // Required for OpenJMX
+    permission java.lang.RuntimePermission "getAttribute";
+
+	// Allow read of JAXP compliant XML parser debug
+	permission java.util.PropertyPermission "jaxp.debug", "read";
+
+    // Precompiled JSPs need access to this package.
+    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
+    permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
+    
+};
+
+
+// You can assign additional permissions to particular web applications by
+// adding additional "grant" entries here, based on the code base for that
+// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
+//
+// Different permissions can be granted to JSP pages, classes loaded from
+// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
+// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
+//
+// For instance, assume that the standard "examples" application
+// included a JDBC driver that needed to establish a network connection to the
+// corresponding database and used the scrape taglib to get the weather from
+// the NOAA web server.  You might create a "grant" entries like this:
+//
+// The permissions granted to the context root directory apply to JSP pages.
+// grant codeBase "file:${catalina.home}/webapps/examples/-" {
+//      permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+//      permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+//
+// The permissions granted to the context WEB-INF/classes directory
+// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
+// };
+//
+// The permission granted to your JDBC driver
+// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
+//      permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+// };
+// The permission granted to the scrape taglib
+// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
+//      permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+

Modified: continuum/branches/continuum-1.3.x/continuum-webapp-test/testng-pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-webapp-test/testng-pom.xml?rev=834357&r1=834356&r2=834357&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-webapp-test/testng-pom.xml (original)
+++ continuum/branches/continuum-1.3.x/continuum-webapp-test/testng-pom.xml Tue Nov 10 05:38:01 2009
@@ -1,122 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>org.apache.continuum</groupId>
-    <artifactId>continuum</artifactId>
-    <version>1.3.2-SNAPSHOT</version>
-  </parent>
-  <artifactId>continuum-webapp-test</artifactId>
-  <name>Continuum Webapp Test</name>
-  <packaging>pom</packaging>
-
-  <build>
-    <testSourceDirectory>src/test/testng</testSourceDirectory>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-          <verbose>true</verbose>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>testCompile</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <artifactId>maven-resources-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>testResources</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>selenium-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <phase>pre-integration-test</phase>
-            <goals>
-              <goal>start-server</goal>
-            </goals>
-            <configuration>
-              <background>true</background>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <suiteXmlFiles>
-            <suiteXmlFile>src/test/testng/config/testng.xml</suiteXmlFile>
-          </suiteXmlFiles>
-        </configuration>
-        <executions>
-          <execution>
-            <id>integration-tests</id>
-            <phase>integration-test</phase>
-            <goals>
-              <goal>test</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <dependency>
-      <groupId>org.testng</groupId>
-      <artifactId>testng</artifactId>
-      <version>5.8</version>
-      <scope>test</scope>
-      <classifier>jdk15</classifier>
-    </dependency>
-    <dependency>
-      <groupId>org.openqa.selenium.client-drivers</groupId>
-      <artifactId>selenium-java-client-driver</artifactId>
-      <version>0.9.2</version>
-      <scope>test</scope>
-    </dependency>
-    
-    <!-- dependencies below are for code in src/test/it -->
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.openqa.selenium.server</groupId>
-      <artifactId>selenium-server</artifactId>
-      <version>0.9.2</version>
-    </dependency>
-  </dependencies>
-</project>



Mime
View raw message