geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r955849 - /geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
Date Fri, 18 Jun 2010 06:43:01 GMT
Author: xiaming
Date: Fri Jun 18 06:43:01 2010
New Revision: 955849

URL: http://svn.apache.org/viewvc?rev=955849&view=rev
Log:
Fix test failures in sec-tests which are caused by Selenium RC 1.0.3 bug

Modified:
    geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java

Modified: geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java?rev=955849&r1=955848&r2=955849&view=diff
==============================================================================
--- geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
(original)
+++ geronimo/server/branches/2.1/testsuite/enterprise-testsuite/sec-tests/sec-ear/src/test/java/org/apache/geronimo/testsuite/security/RunAsTest.java
Fri Jun 18 06:43:01 2010
@@ -22,6 +22,7 @@ package org.apache.geronimo.testsuite.se
 import org.testng.annotations.Test;
 import org.testng.annotations.BeforeSuite;
 import org.apache.geronimo.testsupport.SeleniumTestSupport;
+import com.thoughtworks.selenium.SeleniumException;
 
 /**
  * ???
@@ -44,7 +45,15 @@ public class RunAsTest
 
     @Test
     public void testServletRunAs() throws Exception {
-        selenium.open("/sec/servlet");
+        // Add try catch block to avoid XHR ERROR bug in Selenium RC 1.0.3
+        try {
+            selenium.open("/sec/servlet");
+        } catch (SeleniumException se) {
+            String message = se.getMessage();
+		    if (message == null || !message.contains("XHR ERROR")) {
+			    throw se;
+		    }
+        }        
         selenium.waitForPageToLoad("30000");
         System.out.println("----------------------------------------------");
         System.out.println(selenium.getText("xpath=/html/body"));
@@ -56,7 +65,15 @@ public class RunAsTest
 
     @Test
     public void testJspRunAs() throws Exception {
-        selenium.open("/sec/jsp");
+        // Add try catch block to avoid XHR ERROR bug in Selenium RC 1.0.3
+        try {
+            selenium.open("/sec/jsp");
+        } catch (SeleniumException se) {
+            String message = se.getMessage();
+		    if (message == null || !message.contains("XHR ERROR")) {
+			    throw se;
+		    }
+        }        
         selenium.waitForPageToLoad("30000");
         System.out.println("----------------------------------------------");
         System.out.println(selenium.getText("xpath=/html/body"));



Mime
View raw message