geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r1005567 - /geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java
Date Thu, 07 Oct 2010 18:37:40 GMT
Author: vamsic007
Date: Thu Oct  7 18:37:40 2010
New Revision: 1005567

URL: http://svn.apache.org/viewvc?rev=1005567&view=rev
Log:
These tests are no good without the assertions. Added assertions.

Modified:
    geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java

Modified: geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java?rev=1005567&r1=1005566&r2=1005567&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java
(original)
+++ geronimo/server/trunk/testsuite/security-testsuite/test-security-annotation-ejb/security-ejb-ear/src/test/java/org/apache/geronimo/testsuite/security/ejb/SecurityEJBTest.java
Thu Oct  7 18:37:40 2010
@@ -28,15 +28,18 @@ public class SecurityEJBTest extends Sel
         selenium.open(baseURL+appContextStr);
         selenium.click("link=Annonymous");
         selenium.waitForPageToLoad("30000");
-        selenium.isTextPresent("1. SecurityBean.permitAllMethod:true");
-        selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:false");
-        selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:false");
-        selenium.isTextPresent("4. SecurityBean.denyAllMethod:false");
-        selenium.isTextPresent("5. SecurityRunAsBean.permitAllMethod:true::SecurityBean.permitAllMethod:true");
-        selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:false");
-        selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:false");
-        selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false");
-        selenium.click("link=Logout");
+        try {
+            assertTrue(selenium.isTextPresent("1. SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:false"));
+            assertTrue(selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:false"));
+            assertTrue(selenium.isTextPresent("4. SecurityBean.denyAllMethod:false"));
+            assertTrue(selenium.isTextPresent("5. SecurityRunAsBean.permitAllMethod:true::SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:false"));
+            assertTrue(selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:false"));
+            assertTrue(selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false"));
+        } finally {
+            selenium.click("link=Logout");
+        }
     
     }
 
@@ -50,15 +53,18 @@ public class SecurityEJBTest extends Sel
         selenium.type("j_password", "bone");
         selenium.click("//input[@value='Login']");
         selenium.waitForPageToLoad("30000");
-        selenium.isTextPresent("1. SecurityBean.permitAllMethod:true");
-        selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:false");
-        selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:true");
-        selenium.isTextPresent("4. SecurityBean.denyAllMethod:false");
-        selenium.isTextPresent("5. SecurityRunAsBean.permitAllMethod:true::SecurityBean.permitAllMethod:true");
-        selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:false");
-        selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:true::SecurityBean.rolesAllowedAdminMethod:false");
-        selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false");
-        selenium.click("link=Logout");
+        try {
+            assertTrue(selenium.isTextPresent("1. SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:false"));
+            assertTrue(selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:true"));
+            assertTrue(selenium.isTextPresent("4. SecurityBean.denyAllMethod:false"));
+            assertTrue(selenium.isTextPresent("5. SecurityRunAsBean.permitAllMethod:true::SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:false"));
+            assertTrue(selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:true::SecurityBean.rolesAllowedAdminMethod:false"));
+            assertTrue(selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false"));
+        } finally {
+            selenium.click("link=Logout");
+        }
     }
     @Test
     public void testEJBSecurityUser() throws Exception {
@@ -70,13 +76,17 @@ public class SecurityEJBTest extends Sel
         selenium.type("j_password", "mouse");
         selenium.click("//input[@value='Login']");
         selenium.waitForPageToLoad("30000");
-        selenium.isTextPresent("1. SecurityBean.permitAllMethod:true");
-        selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:true");
-        selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:false");
-        selenium.isTextPresent("4. SecurityBean.denyAllMethod:false");
-        selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:true::SecurityBean.rolesAllowedUserMethod:true");
-        selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:false");
-        selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false");
-        selenium.click("link=Logout");
+        try {
+            assertTrue(selenium.isTextPresent("1. SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("2. SecurityBean.rolesAllowedUserMethod:true"));
+            assertTrue(selenium.isTextPresent("3. SecurityBean.rolesAllowedAdminMethod:false"));
+            assertTrue(selenium.isTextPresent("4. SecurityBean.denyAllMethod:false"));
+            assertTrue(selenium.isTextPresent("5. SecurityRunAsBean.permitAllMethod:true::SecurityBean.permitAllMethod:true"));
+            assertTrue(selenium.isTextPresent("6. SecurityRunAsBean.rolesAllowedUserMethod:true::SecurityBean.rolesAllowedUserMethod:true"));
+            assertTrue(selenium.isTextPresent("7. SecurityRunAsBean.rolesAllowedAdminMethod:false"));
+            assertTrue(selenium.isTextPresent("8. SecurityRunAsBean.denyAllMethod:false"));
+        } finally {
+            selenium.click("link=Logout");
+        }
     }
 }



Mime
View raw message