You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by an...@apache.org on 2006/08/30 05:44:59 UTC

svn commit: r438339 - in /tapestry/tapestry4/trunk/tapestry-framework/src: scripts/TestShellAndRelation.xml test/org/apache/tapestry/html/TestShell.java test/org/apache/tapestry/junit/mock/app/Styled.html

Author: andyhot
Date: Tue Aug 29 20:44:58 2006
New Revision: 438339

URL: http://svn.apache.org/viewvc?rev=438339&view=rev
Log:
TAPESTRY-274: Tests

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestShellAndRelation.xml
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java
    tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/Styled.html

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestShellAndRelation.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestShellAndRelation.xml?rev=438339&r1=438338&r2=438339&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestShellAndRelation.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/scripts/TestShellAndRelation.xml Tue Aug 29 20:44:58 2006
@@ -35,6 +35,14 @@
 <link rel="stylesheet" type="text/css" href="dummy.css"/>
 ]]>
 		</assert-output>
+		
+		<assert-output name="Inline styles">
+<![CDATA[		
+<style type="text/css" media="all">
+a {background:yellow;}
+</style>
+]]>
+		</assert-output>		
 	
 	</request>	
 			 	 	 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java?rev=438339&r1=438338&r2=438339&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/html/TestShell.java Tue Aug 29 20:44:58 2006
@@ -40,7 +40,7 @@
      * holdback to the action service).
      */
 
-    public void testRewinding()
+    public void test_Rewinding()
     {
         IMarkupWriter writer = newWriter();
         NestedMarkupWriter nested = newNestedWriter();
@@ -72,7 +72,7 @@
         verify();
     }
     
-    public void testAddRelation()
+    public void test_Add_Relation()
     {        
         Shell shell = newInstance(Shell.class, null);
         RelationBean css1 = new RelationBean();
@@ -85,6 +85,22 @@
         List all = shell.getRelations();
         assertEquals(all.size(), 1);   
     }
+    
+    public void test_Include_Additional_Content_Null()
+    {
+        StringBuffer sb = new StringBuffer();
+        Shell shell = (Shell) newInstance(Shell.class, "contentBuffer", sb);
+        shell.includeAdditionalContent(null);
+        assertEquals(sb.length(), 0);
+    }
+    
+    public void test_Include_Additional_Content()
+    {
+        StringBuffer sb = new StringBuffer();
+        Shell shell = (Shell) newInstance(Shell.class, "contentBuffer", sb);
+        shell.includeAdditionalContent("data");
+        assertEquals(sb.toString(), "data");
+    }    
 
     protected void trainStoreShellInCycle(IRequestCycle cycle, Shell shell)
     {

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/Styled.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/Styled.html?rev=438339&r1=438338&r2=438339&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/Styled.html (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/app/Styled.html Tue Aug 29 20:44:58 2006
@@ -4,6 +4,8 @@
 
 <link jwcid="@Relation" href="dummy.css"/>
 Empty page...
-
+<style jwcid="@Style" media="all">
+a {background:yellow;}    
+</style>    
 </span>
 </span>