Author: hlship
Date: Wed Feb 14 11:23:55 2007
New Revision: 507663

URL: http://svn.apache.org/viewvc?view=rev&rev=507663
Log:
Change the Img component to support informal parameters.
Test that the image generated by GridColumns has the correct src and alt 
attributes (reflecting the column sort status).

Modified:
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?view=diff&rev=507663&r1=507662&r2=507663
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
 Wed Feb 14 11:23:55 2007
@@ -825,6 +825,9 @@
 
         clickAndWait("link=Rating");
 
+        assertText("//[EMAIL PROTECTED]'img']/@src", 
"/assets/tapestry/corelib/components/sort-asc.png");
+        assertText("//[EMAIL PROTECTED]'img']/@alt", "[Asc]");
+
         assertTextSeries(
                 "//tr[22]/td[%d]",
                 1,
@@ -839,8 +842,19 @@
 
         clickAndWait("link=Rating");
 
+        assertText("//[EMAIL PROTECTED]'img']/@src", 
"/assets/tapestry/corelib/components/sort-desc.png");
+        assertText("//[EMAIL PROTECTED]'img']/@alt", "[Desc]");
+
         assertTextSeries("//tr[1]/td[%d]", 1, "Hey Blondie", "Out from Out 
Where");
 
+        clickAndWait("link=Title");
+
+        assertText("//[EMAIL PROTECTED]'img']/@src", 
"/assets/tapestry/corelib/components/sort-asc.png");
+        assertText("//[EMAIL PROTECTED]'img']/@alt", "[Asc]");
+
+        clickAndWait("link=1");
+
+        assertText("//tr[1]/td[1]", "(untitled hidden track)");
     }
 
     @Test

Modified: 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java?view=diff&rev=507663&r1=507662&r2=507663
==============================================================================
--- 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java
 (original)
+++ 
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/components/Img.java
 Wed Feb 14 11:23:55 2007
@@ -23,8 +23,10 @@
 import org.apache.tapestry.annotations.Environmental;
 import org.apache.tapestry.annotations.Inject;
 import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.annotations.SupportsInformalParameters;
 import org.apache.tapestry.services.PageRenderSupport;
 
[EMAIL PROTECTED]
 public class Img
 {
     @Environmental
@@ -42,6 +44,8 @@
         String clientId = _support.allocateClientId(_resources.getId());
 
         writer.element("img", "src", _src, "id", clientId);
+
+        _resources.renderInformalParameters(writer);
     }
 
     @BeforeRenderBody


Reply via email to