You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2008/06/24 13:20:41 UTC

svn commit: r671132 - /myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java

Author: skitching
Date: Tue Jun 24 04:20:41 2008
New Revision: 671132

URL: http://svn.apache.org/viewvc?rev=671132&view=rev
Log:
TOMAHAWK-1266. Relative paths are not valid with t:stylesheet inline or filtered options

Modified:
    myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java

Modified: myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java?rev=671132&r1=671131&r2=671132&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java (original)
+++ myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/stylesheet/StylesheetRendererTest.java Tue Jun 24 04:20:41 2008
@@ -22,6 +22,8 @@
 import java.io.IOException;
 import java.io.StringWriter;
 
+import javax.faces.FacesException;
+
 import junit.framework.Test;
 
 import org.apache.myfaces.test.AbstractTomahawkViewControllerTestCase;
@@ -69,15 +71,31 @@
      */
     public void testInline() throws IOException
     {
-
         stylesheet.setInline(true);
+        stylesheet.setPath("/styles/test.css");
         stylesheet.encodeEnd(facesContext);
         facesContext.renderResponse();
 
         String output = writer.getWriter().toString();
         
         assertTrue("looking for a <style>", output.trim().startsWith("<style"));
-        
+    }
+
+    /*
+     * Test method for 'org.apache.myfaces.custom.stylesheet.StylesheetRenderer.encodeEnd(FacesContext, UIComponent)'
+     */
+    public void testInlineInvalid() throws IOException
+    {
+        stylesheet.setInline(true);
+        try
+        {
+            stylesheet.encodeEnd(facesContext);
+            fail("No exception was thrown for an invalid stylesheet path");
+        }
+        catch(FacesException e)
+        {
+            // expected
+        }
     }
 
     public void testLink() throws IOException