[seam-commits] Seam SVN: r13739 - branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Sep 13 08:34:43 EDT 2010


Author: jharting
Date: 2010-09-13 08:34:42 -0400 (Mon, 13 Sep 2010)
New Revision: 13739

Modified:
   branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
Log:
Minor changes in functional tests.

Modified: branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java	2010-09-13 10:43:33 UTC (rev 13738)
+++ branches/enterprise/JBPAPP_5_0/src/test/ftest/src/main/org/jboss/seam/example/common/test/selenium/SeamSelenium.java	2010-09-13 12:34:42 UTC (rev 13739)
@@ -302,30 +302,28 @@
    @Override
    public void open(String url)
    {
-      if (suppressSeleniumTimeoutException)
-      {
          try
          {
             super.open(url);
          }
          catch (SeleniumException e)
          {
-            if (isTimeoutException(e))
+            if (suppressSeleniumTimeoutException && isTimeoutException(e))
             {
                // NOOP
                // THIS IS A WORKAROUND FOR IE BEHAVIOR
                // SEE JBPAPP-4036
             }
+            else if (is404(e))
+            {
+               // since 1.0.3 Selenium throws SeleniumException when a server returns 404
+               // we suppress this behavior in order to retain backward compatibility
+            }
             else
             {
                throw e;
             }
          }
-      }
-      else
-      {
-         super.open(url);
-      }
    }
 
    private boolean isTimeoutException(SeleniumException e)
@@ -333,6 +331,11 @@
       return e.getMessage().contains("Timed out");
    }
    
+   private boolean is404(SeleniumException e)
+   {
+      return e.getMessage().contains("Response_Code = 404 Error_Message = Not Found");
+   }
+   
    public boolean isSuppressSeleniumTimeoutException()
    {
       return suppressSeleniumTimeoutException;
@@ -342,18 +345,4 @@
    {
       this.suppressSeleniumTimeoutException = suppressSeleniumTimeoutException;
    }
-   
-   @Override
-   public void open(String url)
-   {
-      try
-      {
-         super.open(url);
-      }
-      catch (SeleniumException e)
-      {
-         // since 1.0.3 Selenium throws SeleniumException when a server returns 404
-         // we suppress this behavior in order to retain backward compatibility 
-      }
-   }
 }



More information about the seam-commits mailing list