You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2015/02/20 16:30:32 UTC

svn commit: r1661140 - /myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java

Author: lofwyr
Date: Fri Feb 20 15:30:32 2015
New Revision: 1661140

URL: http://svn.apache.org/r1661140
Log:
fix UnitTest

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java?rev=1661140&r1=1661139&r2=1661140&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TobagoSelenium.java Fri Feb 20 15:30:32 2015
@@ -74,6 +74,9 @@ public class TobagoSelenium extends Defa
         if (isErrorOnPage()) {
           Assert.fail(format(HAS_ERROR_SEVERITY, location, html, "TobagoAssert.failed"));
         }
+        if (!getHtmlSource().contains("class=\"tobago-page\"")) {
+          Assert.fail(format(HAS_ERROR_SEVERITY, location, html, TobagoSelenium.IS_BROKEN));
+        }
       } catch (final SeleniumException e) {
         Assert.fail(format(IS_BROKEN, location, html, "Not a Tobago page? Exception=" + e));
       }
@@ -81,16 +84,10 @@ public class TobagoSelenium extends Defa
   }
 
   public String format(final String error, final String location, final String html, final String options) {
-    final StringBuilder b = new StringBuilder();
-    b.append(error);
-    b.append("\nPage URL: ");
-    b.append(location);
-    b.append("\n");
-    b.append(options);
-    b.append("\n---------------------------------------------------------------------------------------------------\n");
-    b.append(html);
-    b.append("\n---------------------------------------------------------------------------------------------------\n");
-    return b.toString();
+    return error + "\nPage URL: " + location + "\n" + options
+        + "\n---------------------------------------------------------------------------------------------------\n"
+        + html
+        + "\n---------------------------------------------------------------------------------------------------\n";
   }
 
   /**