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 2012/02/08 16:08:49 UTC

svn commit: r1241925 - in /myfaces/tobago/branches/tobago-tree-table: ./ tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/ tobago-example/tobago-example-test/src/main/webapp/ tobago-example/tobago-example-test/src...

Author: lofwyr
Date: Wed Feb  8 15:08:48 2012
New Revision: 1241925

URL: http://svn.apache.org/viewvc?rev=1241925&view=rev
Log:
merged from trunk

Added:
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/pidgeon-pointDisabled.jpg
      - copied unchanged from r1241924, myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/pidgeon-pointDisabled.jpg
Modified:
    myfaces/tobago/branches/tobago-tree-table/   (props changed)
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Filter.java
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/404.xhtml
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SimpleSeleniumTest.java
    myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java

Propchange: myfaces/tobago/branches/tobago-tree-table/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb  8 15:08:48 2012
@@ -1 +1 @@
-/myfaces/tobago/trunk:1226794-1240209
+/myfaces/tobago/trunk:1226794-1241924

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Filter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Filter.java?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Filter.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/Filter.java Wed Feb  8 15:08:48 2012
@@ -55,6 +55,8 @@ public class Filter {
       "/index.html", // intern
       "/navigation.*", // intern
 
+      "/404.*", // meta test
+
       "/meta-test/meta-1.*", // meta test
       "/meta-test/meta-2.*\\.jspx", // meta test
       "/meta-test/meta-3.*\\.xhtml", // meta test

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/404.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/404.xhtml?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/404.xhtml (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/main/webapp/404.xhtml Wed Feb  8 15:08:48 2012
@@ -26,12 +26,14 @@
 
     <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout rows="auto;*;*" />
+        <tc:gridLayout rows="auto;*;*"/>
       </f:facet>
 
-      <tc:messages />
+      <tc:messages/>
       <tc:out value="The page was not found!"/>
     </tc:panel>
 
+    <tc:script onload="LOG.error('404 - page not found.')"/>
+
   </tc:page>
 </f:view>

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/AutomaticSeleniumTest.java Wed Feb  8 15:08:48 2012
@@ -48,7 +48,14 @@ public class AutomaticSeleniumTest exten
   public static Collection<Object[]> findPages() {
     List<String> paths = new ArrayList<String>();
 
-    collect(paths, MAVEN_TARGET + '/', "");
+    String base = MAVEN_TARGET + '/';
+
+    // e.g. in the IDE normally the base dir is the tobago project root
+    if (! new File(base).exists()) {
+      base = "tobago-example/tobago-example-test/" + base;
+    }
+    
+    collect(paths, base, "");
 
     Collections.sort(paths);
 

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SeleniumTest.java Wed Feb  8 15:08:48 2012
@@ -25,7 +25,8 @@ import org.junit.Before;
 
 public abstract class SeleniumTest {
 
-  private static final String CONTEXT_PATH = "tobago-example-test";
+  private static final String CONTEXT_PATH = "";
+  //  private static final String CONTEXT_PATH = "tobago-example-test";
   private static final String SERVLET_MAPPING = "faces";
 
   public static final String ERROR_ON_SERVER = "error on server";
@@ -56,7 +57,9 @@ public abstract class SeleniumTest {
   protected void checkPage() {
     final String location = selenium.getLocation();
     final String html = getHtmlSource();
-    Assert.assertFalse(format(ERROR_ON_SERVER, location, html, ""), errorOnServer());
+    if (errorOnServer()) {
+      Assert.fail(format(ERROR_ON_SERVER, location, html, ""));
+    }
     try {
       if (isErrorOnPage()) {
         Assert.fail(format(HAS_ERROR_SEVERITY, location, html, getErrors()));
@@ -109,6 +112,10 @@ public abstract class SeleniumTest {
 
   protected static String createUrl(String page) {
     Assert.assertTrue("Page name must start with a slash.", page.startsWith("/"));
-    return '/' + CONTEXT_PATH + '/' + SERVLET_MAPPING + page;
+    if (CONTEXT_PATH.length() == 0) {
+      return '/' + SERVLET_MAPPING + page;
+    } else {
+      return '/' + CONTEXT_PATH + '/' + SERVLET_MAPPING + page;
+    }
   }
 }

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SimpleSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SimpleSeleniumTest.java?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SimpleSeleniumTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/SimpleSeleniumTest.java Wed Feb  8 15:08:48 2012
@@ -24,7 +24,8 @@ public class SimpleSeleniumTest extends 
 
   @Test
   public void testHelloWorld() {
-    getSelenium().open("/tobago-example-test/faces/simple.xhtml");
+    getSelenium().open("/faces/simple.xhtml");
+    checkPage();
     Assert.assertEquals("Simple Test", getSelenium().getValue("page:in"));
     getSelenium().captureScreenshot(SimpleSeleniumTest.class.getName() + ".testHelloWorld.png");
   }

Modified: myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java?rev=1241925&r1=1241924&r2=1241925&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java (original)
+++ myfaces/tobago/branches/tobago-tree-table/tobago-example/tobago-example-test/src/test/java/org/apache/myfaces/tobago/example/test/TestTheAutomaticSeleniumTest.java Wed Feb  8 15:08:48 2012
@@ -17,7 +17,6 @@ package org.apache.myfaces.tobago.exampl
  * limitations under the License.
  */
 
-import com.thoughtworks.selenium.SeleniumException;
 import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -40,7 +39,7 @@ public class TestTheAutomaticSeleniumTes
     Collection<Object[]> pages = AutomaticSeleniumTest.findPages();
     for (Object[] page : pages) {
       String url = (String) page[1];
-      String prefix = "/tobago-example-test/faces/meta-test/";
+      String prefix = "/faces/meta-test/";
       if (url.startsWith(prefix)) {
         metaTestList.add(url.substring(prefix.length()));
       }
@@ -68,8 +67,8 @@ public class TestTheAutomaticSeleniumTes
       test.testPageConsistency();
       test.tearDown();
       Assert.fail("The test should fail, but wasn't.");
-    } catch (SeleniumException e) {
-      Assert.assertTrue(e.getMessage().contains("Response_Code = 404"));
+    } catch (AssertionError e) {
+      Assert.assertTrue(e.getMessage().contains("404 - page not found"));
     }
   }