You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/09/29 00:53:23 UTC

svn commit: r819765 - /myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java

Author: lu4242
Date: Mon Sep 28 22:53:23 2009
New Revision: 819765

URL: http://svn.apache.org/viewvc?rev=819765&view=rev
Log:
MYFACES-2284 Allow h:outputLink "fragment" property to append text to url after '#' (Thanks to Jakob Korherr for provide this patch)

Modified:
    myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java

Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java?rev=819765&r1=819764&r2=819765&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/renderkit/html/HtmlLinkRendererTest.java Mon Sep 28 22:53:23 2009
@@ -288,4 +288,18 @@
         }
         
     }
+    
+    /**
+     * Test for the right use of the fragment attribute.
+     * The value of the fragment attribute is appended to the end of target URL following a hash (#) mark.
+     * @throws Exception
+     */
+    public void testOutputLinkFragment() throws Exception
+    {
+        outputLink.setFragment("fragment");
+        outputLink.setValue("http://www.irian.at");
+        outputLink.encodeAll(facesContext);
+        String output = writer.getWriter().toString();
+        assertEquals("<a href=\"http://www.irian.at#fragment\"></a>", output);
+    }
 }