continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r827851 - in /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test: LoginTest.java SecurityTest.java
Date Wed, 21 Oct 2009 00:10:41 GMT
Author: ctan
Date: Wed Oct 21 00:10:41 2009
New Revision: 827851

URL: http://svn.apache.org/viewvc?rev=827851&view=rev
Log:
added test for CONTINUUM-2327

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java?rev=827851&r1=827850&r2=827851&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/LoginTest.java
Wed Oct 21 00:10:41 2009
@@ -124,24 +124,10 @@
         getSelenium().type( "passwordForm_newPasswordConfirm", newPassword );
         getSelenium().click( "passwordForm__submit" );
         getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-        assertTextPresent( "Password successfully changed" );
 
         assertLinkPresent( "Edit Details" );
         assertLinkPresent( "Logout" );
-
-        assertProjectAdministratorAccess();
-
-        clickLinkWithText( "Logout" );
-
-        goToLoginPage();
-        getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
-        getSelenium().type( "loginForm_password", getProperty( "ADMIN_PASSWORD" ) );
-        getSelenium().click( "loginForm__login" );
-        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
-
-        clickLinkWithText( "Configuration" );
-        clickLinkWithLocator( "configuration_distributedBuildEnabled", false );
-
+        
         clickLinkWithText( "Logout" );
     }
 

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java?rev=827851&r1=827850&r2=827851&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/SecurityTest.java
Wed Oct 21 00:10:41 2009
@@ -7,6 +7,7 @@
 public class SecurityTest
     extends AbstractContinuumTest
 {
+    @Test( dependsOnMethods = { "testWithCreatedProjectAdminUser", "testWithCorrectUsernamePassword"
})
     public void testProjectAdminAccess()
     {
         String username = getProperty( "PROJECT_ADMIN_USERNAME" );
@@ -64,4 +65,34 @@
 
         clickLinkWithText( "Logout" );
     }
+
+    @Test( dependsOnMethods = { "testProjectAdminAccess" } )
+    public void testNotAuthorizedMessageAfterLoginSuccessful()
+    {
+        assertTextPresent( "Login" );
+        assertTextNotPresent( "Edit Details" );
+        assertTextNotPresent( "Logout" );
+
+        String url;
+
+        if ( baseUrl.endsWith( "/" ) )
+        {
+            url = baseUrl + "projectGroupSummary.action?projectGroupId=1";
+        }
+        else
+        {
+            url = baseUrl + "/projectGroupSummary.action?projectGroupId=1";
+        }
+
+        getSelenium().open( url );
+        assertTextPresent( "You are not authorized to access this page. Please contact your
administrator to be granted the appropriate permissions." );
+
+        goToLoginPage();
+        getSelenium().type( "loginForm_username", getProperty( "ADMIN_USERNAME" ) );
+        getSelenium().type( "loginForm_password", getProperty( "ADMIN_PASSWORD" ) );
+        getSelenium().click( "loginForm__login" );
+        getSelenium().waitForPageToLoad( maxWaitTimeInMs );
+
+        assertTextNotPresent( "You are not authorized to access this page. Please contact
your administrator to be granted the appropriate permissions." );
+    }
 }



Mime
View raw message