You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2010/04/19 15:49:05 UTC

svn commit: r935567 - in /tapestry/tapestry5/trunk/tapestry-core/src/test: conf/testng-limited.xml java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java java/org/apache/tapestry5/integration/app1/GridTests.java

Author: hlship
Date: Mon Apr 19 13:49:05 2010
New Revision: 935567

URL: http://svn.apache.org/viewvc?rev=935567&view=rev
Log:
Fix some of the tests broken by recent changes.

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng-limited.xml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng-limited.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng-limited.xml?rev=935567&r1=935566&r2=935567&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng-limited.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng-limited.xml Mon Apr 19 13:49:05 2010
@@ -11,7 +11,10 @@
       <class name="org.apache.tapestry5.test.SeleniumLauncher"/>
 
       <!--  Modify classes below as needed. -->
-      <class name="org.apache.tapestry5.integration.app1.FailureTests"/>
+      <class name="org.apache.tapestry5.integration.app1.AjaxTests"/>
+      <class name="org.apache.tapestry5.integration.app1.FormTests"/>
+      <class name="org.apache.tapestry5.integration.app1.GridTests"/>
+
     </classes>
   </test>
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java?rev=935567&r1=935566&r2=935567&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java Mon Apr 19 13:49:05 2010
@@ -1366,10 +1366,6 @@ public class CoreBehaviorsTests extends 
         assertTextPresent("HTTP ERROR 404");
 
         clickThru("Asset Protection Demo");
-        clickAndWait("link=Unavailable File");
-        assertTextPresent("HTTP ERROR 404");
-
-        clickThru("Asset Protection Demo");
         clickAndWait("link=Available File2");
         assertTextPresent("This file should be available to clients.");
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java?rev=935567&r1=935566&r2=935567&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/GridTests.java Mon Apr 19 13:49:05 2010
@@ -4,7 +4,7 @@
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
@@ -33,13 +33,11 @@ public class GridTests extends TapestryC
 
         // "Sort Rating" via the header cell override (TAPESTRY-2081)
 
-        assertTextSeries("//th[%d]", 1, "Title", "Album", "Artist", "Genre", "Play Count",
-                "Sort Rating");
+        assertTextSeries("//th[%d]", 1, "Title", "Album", "Artist", "Genre", "Play Count", "Sort Rating");
 
         // Strange: I thought tr[1] was the header row ???
 
-        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip",
-                "Electronica", "4", "-");
+        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip", "Electronica", "4", "-");
 
         // Here were checking that the page splits are correct
 
@@ -56,9 +54,8 @@ public class GridTests extends TapestryC
 
         // Here's one with a customized rating cell
 
-        assertTextSeries("//tr[25]/td[%d]", 1, "Smoked",
-                "London (Original Motion Picture Soundtrack)", "The Crystal Method", "Soundtrack",
-                "30", "****");
+        assertTextSeries("//tr[25]/td[%d]", 1, "Smoked", "London (Original Motion Picture Soundtrack)",
+                "The Crystal Method", "Soundtrack", "30", "****");
 
         clickAndWait("link=69");
 
@@ -69,8 +66,8 @@ public class GridTests extends TapestryC
 
         clickAndWait("link=Sort Rating");
 
-        assertTextSeries("//tr[22]/td[%d]", 1, "Mona Lisa Overdrive", "Labyrinth", "Juno Reactor",
-                "Dance", "31", "*****");
+        assertTextSeries("//tr[22]/td[%d]", 1, "Mona Lisa Overdrive", "Labyrinth", "Juno Reactor", "Dance", "31",
+                "*****");
 
         // Toggle to sort descending
 
@@ -80,11 +77,8 @@ public class GridTests extends TapestryC
 
         clickAndWait("link=Title");
 
-        // The lack of a leading slash indicates that the path was optimized,
-        // see TAPESTRY-1502
+        assertAttributeValueEndsWith("//img[@class='t-sort-icon']/@src", "/sort-asc.png");
 
-        assertAttribute("//img[@class='t-sort-icon']/@src",
-                "/assets/tapestry/UNKNOWN/corelib/components/sort-asc.png");
         assertAttribute("//img[@class='t-sort-icon']/@alt", "[Asc]");
 
         clickAndWait("link=1");
@@ -93,16 +87,22 @@ public class GridTests extends TapestryC
 
         clickAndWait("link=Title");
 
-        assertAttribute("//img[@class='t-sort-icon']/@src",
-                "/assets/tapestry/UNKNOWN/corelib/components/sort-desc.png");
+        assertAttributeValueEndsWith("//img[@class='t-sort-icon']/@src", "/sort-desc.png");
         assertAttribute("//img[@class='t-sort-icon']/@alt", "[Desc]");
 
         clickAndWait("link=reset the Grid");
 
         // Back to where we started.
 
-        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip",
-                "Electronica", "4", "-");
+        assertTextSeries("//tr[1]/td[%d]", 1, "Bug Juice", "Late Lounge (2 of 2)", "45 Dip", "Electronica", "4", "-");
+    }
+
+    private void assertAttributeValueEndsWith(String attributeLocator, String suffix)
+    {
+        String value = getAttribute(attributeLocator);
+
+        assertTrue(value.endsWith(suffix), String.format("Value for attribute %s (%s) should end with '%s'.", 
+                attributeLocator, value, suffix));
     }
 
     @Test