CVS: Tapestry/junit/src/net/sf/tapestry/junit/mock TestBlock.xml,NONE,1.1.2.1 MockTestCase.java,1.10.2.10,1.10.2.11 TestLocalization.xml,1.1.2.3,1.1.2.4 TestValidate.xml,1.3.2.1,1.3.2.2 TestProtectedLink.xml,1.2.2.1,1.2.2.2 TestSimple.xml,1.2.2.1,1.2.2.2 TestLibrary.xml,1.4.2.1,1.4.2.2 TestRegisterForm.xml,1.4.2.1,1.4.2.2 TestStaleSessionException.xml,1.2.2.1,1.2.2.2

Howard Lewis Ship <[email protected]>
Newsgroups gmane.comp.java.tapestry.cvs
Message-ID <[email protected]>
Update of /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock
In directory sc8-pr-cvs1:/tmp/cvs-serv29938/junit/src/net/sf/tapestry/junit/mock

Modified Files:
      Tag: hship-2-3
	MockTestCase.java TestLocalization.xml TestValidate.xml 
	TestProtectedLink.xml TestSimple.xml TestLibrary.xml 
	TestRegisterForm.xml TestStaleSessionException.xml 
Added Files:
      Tag: hship-2-3
	TestBlock.xml 
Log Message:
Revise statefulness checks in the action and direct services to be less intrusive.

--- NEW FILE: TestBlock.xml ---
<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: TestBlock.xml,v 1.1.2.1 2002/12/19 12:26:59 hship Exp $ -->

<mock-test>
    <context name="c5" root="context5"/>

  	<servlet name="app" class="net.sf.tapestry.ApplicationServlet">
  		<init-parameter
  			name="net.sf.tapestry.visit-class"
  			value="net.sf.tapestry.junit.mock.c5.Visit"/>
  	</servlet>
       
    <request>
 		
		<assert-output name="Title">
<![CDATA[
<title>Home</title>
]]>
		</assert-output>
		
		<assert-output name="Direct Status">
DirectLink HAS NOT been triggered.		
		</assert-output>		
		
		<assert-output name="Action Status">
ActionLink HAS NOT been triggered.
		</assert-output>		
		
		<assert-output name="Form Status">
Form HAS NOT been triggered.
		</assert-output>		
		
		<assert-output name="Direct URL">
<![CDATA[
href="/c5/app?service=direct&amp;context=1/Home/DirectLinkHolder/$DirectLink"
]]>
		</assert-output>		

		<assert-output name="Action URL">
<![CDATA[
href="/c5/app?service=action&amp;context=1/Home/0/ActionLinkHolder/$ActionLink"
]]>
		</assert-output>
			
		<assert-output name="Form Context">
<![CDATA[
<input type="hidden" name="context" value="1/Home/FormHolder/$Form"/>
]]>
		</assert-output>					

 	</request>
 	
 	<request>
 		<parameter name="service" value="direct"/>
 		<parameter name="context" value="1/Home/DirectLinkHolder/$DirectLink"/>
 		
 		<assert-output name="Updated Direct Status">
DirectLink HAS been triggered.
		</assert-output>
		
	</request> 
	
	<request>
		<parameter name="service" value="action"/>
		<parameter name="context" value="1/Home/0/ActionLinkHolder/$ActionLink"/>
		
		<assert-output name="Updated Action Status">
ActionLink HAS been triggered.
		</assert-output>
	</request>
	
	<request>
		<parameter name="service" value="direct"/>
		<parameter name="context" value="1/Home/FormHolder/$Form"/>
		<parameter name="sp" value="S1"/>
		<parameter name="$Submit" value="Trigger"/>
		<parameter name="Form1" value="1"/>
		
		<assert-output name="Form Status">
Form HAS been triggered.
		</assert-output>
		
	</request>				
			
</mock-test>
    	

Index: MockTestCase.java
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java,v
retrieving revision 1.10.2.10
retrieving revision 1.10.2.11
diff -C2 -d -r1.10.2.10 -r1.10.2.11
*** MockTestCase.java	15 Dec 2002 16:26:11 -0000	1.10.2.10
--- MockTestCase.java	19 Dec 2002 12:26:58 -0000	1.10.2.11
***************
*** 41,44 ****
--- 41,56 ----
      // in a static suite() method.
  
+ 
+     /**
+      *  Test Block and InsertBlock, especially w.r.t. links and forms
+      *  inside the Block on foriegn pages.
+      * 
+      **/
+ 
+     public void testBlock() throws Exception
+     {
+         attempt("TestBlock.xml");
+     }
+ 
      /**
       *  Test behavior when the application specification doesn't exist.
***************
*** 236,245 ****
  
      /**
!      *  Tests {@link net.sf.tapestry.StaleLinkException} with
       *  DirectLink (ActionLink and Form to come).
       * 
       **/
  
!     public void testStaleLinkException() throws Exception
      {
          attempt("TestStaleSessionException.xml");
--- 248,257 ----
  
      /**
!      *  Tests {@link net.sf.tapestry.StaleSessionException} with
       *  DirectLink (ActionLink and Form to come).
       * 
       **/
  
!     public void testStaleSessionException() throws Exception
      {
          attempt("TestStaleSessionException.xml");

Index: TestLocalization.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/Attic/TestLocalization.xml,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** TestLocalization.xml	4 Dec 2002 20:22:17 -0000	1.1.2.3
--- TestLocalization.xml	19 Dec 2002 12:26:59 -0000	1.1.2.4
***************
*** 50,54 ****
  		<assert-output name="English Back image">
  /mock/images/back.png
! 		</assert-output>		
  	</request>
  	
--- 50,60 ----
  		<assert-output name="English Back image">
  /mock/images/back.png
! 		</assert-output>	
! 		
! 		<assert-output name="DirectLink switch URL">
! <![CDATA[		
! href="/mock/app?service=direct&amp;context=0/Assets/switch"
! ]]>
! 		</assert-output>	
  	</request>
  	
***************
*** 65,69 ****
  		<assert-output name="French Back image">
  /mock/images/back_fr.png
! 		</assert-output>		
  	</request>	
  	
--- 71,81 ----
  		<assert-output name="French Back image">
  /mock/images/back_fr.png
! 		</assert-output>	
! 		
! 		<assert-output name="DirectLink switch URL still stateless">
! <![CDATA[		
! href="/mock/app?service=direct&amp;context=0/Assets/switch"
! ]]>
! 		</assert-output>							
  	</request>	
  	
***************
*** 74,78 ****
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="Assets/switch"/>
  		
  		<!-- Switch sends us back to the Home page, but in French. -->
--- 86,90 ----
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="0/Assets/switch"/>
  		
  		<!-- Switch sends us back to the Home page, but in French. -->
***************
*** 83,87 ****
  		
  		<assert-cookie name="net.sf.tapestry.locale" value="fr"/>
! 		
  	</request>
  		
--- 95,104 ----
  		
  		<assert-cookie name="net.sf.tapestry.locale" value="fr"/>
! 
! 		<assert-output name="DirectLink switch URL still stateless">
! <![CDATA[		
! href="/mock/app?service=direct&amp;context=0/Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=Hello"
! ]]>
! 		</assert-output>			
  	</request>
  		

Index: TestValidate.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestValidate.xml,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -d -r1.3.2.1 -r1.3.2.2
*** TestValidate.xml	4 Dec 2002 20:22:17 -0000	1.3.2.1
--- TestValidate.xml	19 Dec 2002 12:26:59 -0000	1.3.2.2
***************
*** 28,32 ****
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=Guard/link"
  ]]>
  		</assert-output>
--- 28,32 ----
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=1/Guard/link"
  ]]>
  		</assert-output>
***************
*** 44,48 ****
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="Guard/link"/>
    		
    		<assert-output name="Title">
--- 44,48 ----
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="1/Guard/link"/>
    		
    		<assert-output name="Title">

Index: TestProtectedLink.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestProtectedLink.xml,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** TestProtectedLink.xml	4 Dec 2002 20:22:16 -0000	1.2.2.1
--- TestProtectedLink.xml	19 Dec 2002 12:26:59 -0000	1.2.2.2
***************
*** 29,33 ****
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=ProtectedLink/link&amp;sp=6&amp;sp=13&amp;sp=1999"
  ]]>
  		</assert-output>
--- 29,33 ----
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=0/ProtectedLink/link&amp;sp=6&amp;sp=13&amp;sp=1999"
  ]]>
  		</assert-output>
***************
*** 37,41 ****
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="ProtectedLink/link"/>
  		<parameter name="sp">
  			<value>6</value>
--- 37,41 ----
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="0/ProtectedLink/link"/>
  		<parameter name="sp">
  			<value>6</value>
***************
*** 52,56 ****
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=Guard/link"
  ]]>
  		</assert-output>
--- 52,56 ----
  		<assert-output name="Link URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=1/Guard/link"
  ]]>
  		</assert-output>
***************
*** 68,72 ****
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="Guard/link"/>
    		
    		<assert-output name="Title">
--- 68,72 ----
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="1/Guard/link"/>
    		
    		<assert-output name="Title">
***************
*** 92,96 ****
    	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="ProtectedLink/link"/>
  		<parameter name="sp">
  			<value>6</value>
--- 92,96 ----
    	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="1/ProtectedLink/link"/>
  		<parameter name="sp">
  			<value>6</value>

Index: TestSimple.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestSimple.xml,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** TestSimple.xml	4 Dec 2002 20:22:16 -0000	1.2.2.1
--- TestSimple.xml	19 Dec 2002 12:26:59 -0000	1.2.2.2
***************
*** 16,20 ****
    	  	
    	  <assert-output name="Insert render">
!   	  	The start of the JUnit test suite: JUnit Simple Application.
    	  </assert-output>
    	  
--- 16,20 ----
    	  	
    	  <assert-output name="Insert render">
! The start of the JUnit test suite: JUnit Simple Application.
    	  </assert-output>
    	  
***************
*** 74,78 ****
  	<assert-output name="Page Two: DirectLink">
  <![CDATA[
! 	DirectLink: <a href="/junit/simple?service=direct&amp;context=Two/link">click it</a>
  ]]>	
  	</assert-output>	
--- 74,78 ----
  	<assert-output name="Page Two: DirectLink">
  <![CDATA[
! 	DirectLink: <a href="/junit/simple?service=direct&amp;context=0/Two/link">click it</a>
  ]]>	
  	</assert-output>	
***************
*** 85,89 ****
    <request>
    	<parameter name="service" value="direct"/>
!   	<parameter name="context" value="Two/link"/>	
    	
  	<assert-regexp name="Third request, message displayed">
--- 85,89 ----
    <request>
    	<parameter name="service" value="direct"/>
!   	<parameter name="context" value="0/Two/link"/>	
    	
  	<assert-regexp name="Third request, message displayed">

Index: TestLibrary.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestLibrary.xml,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -d -r1.4.2.1 -r1.4.2.2
*** TestLibrary.xml	4 Dec 2002 20:22:17 -0000	1.4.2.1
--- TestLibrary.xml	19 Dec 2002 12:26:59 -0000	1.4.2.2
***************
*** 15,24 ****
  	  	
    	  <assert-output name="Page Title">
!   	  Mock App Home Page
    	  </assert-output>
    	  	  	
    	  <assert-output name="DirectLink with parameters">
  <![CDATA[  	  
!   	  <a href="/junit/mock?service=direct&amp;context=Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=Hello">
  ]]>
    	  </assert-output>
--- 15,26 ----
  	  	
    	  <assert-output name="Page Title">
! <![CDATA[  	  
! <title>Mock App Home Page</title>
! ]]>
    	  </assert-output>
    	  	  	
    	  <assert-output name="DirectLink with parameters">
  <![CDATA[  	  
!   	  <a href="/junit/mock?service=direct&amp;context=0/Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=Hello">
  ]]>
    	  </assert-output>
***************
*** 63,67 ****
    <request>
    	<parameter name="service" value="direct"/>
!   	<parameter name="context" value="Home/link"/>
    	<parameter name="sp">
    		<value>2</value>
--- 65,69 ----
    <request>
    	<parameter name="service" value="direct"/>
!   	<parameter name="context" value="0/Home/link"/>
    	<parameter name="sp">
    		<value>2</value>
***************
*** 122,125 ****
  	</assert-output-matches>
  	
!   </request>	
  </mock-test>
--- 124,145 ----
  	</assert-output-matches>
  	
!   </request>
!   
!   <!-- Return to the Home page, ensure that the DirectLink renders the stateful flag. -->
!   
!   <request>
! 	
!   	  <assert-output name="Page Title">
! <![CDATA[  	  
! <title>Mock App Home Page</title>
! ]]>
!   	  </assert-output>
! 	
!   	  <assert-output name="DirectLink with parameters">
! <![CDATA[  	  
!   	  <a href="/junit/mock?service=direct&amp;context=1/Home/link&amp;sp=2&amp;sp=d3.5&amp;sp=Hello">
! ]]>
!   	  </assert-output>
!   </request>
!   
  </mock-test>

Index: TestRegisterForm.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestRegisterForm.xml,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -d -r1.4.2.1 -r1.4.2.2
*** TestRegisterForm.xml	4 Dec 2002 20:22:17 -0000	1.4.2.1
--- TestRegisterForm.xml	19 Dec 2002 12:26:59 -0000	1.4.2.2
***************
*** 48,52 ****
  ]]>
  			<match>direct</match>
! 			<match>Register/form</match>
  			<match>S0</match>
  			<match>4</match>
--- 48,52 ----
  ]]>
  			<match>direct</match>
! 			<match>0/Register/form</match>
  			<match>S0</match>
  			<match>4</match>
***************
*** 113,117 ****
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="Register/form"/>
    		<parameter name="sp" value="S0"/>
    		<parameter name="inputFirstName" value="Suzy"/>
--- 113,117 ----
    	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="0/Register/form"/>
    		<parameter name="sp" value="S0"/>
    		<parameter name="inputFirstName" value="Suzy"/>
***************
*** 175,179 ****
  	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="Register/form"/>
    		<parameter name="sp" value="S0"/>
    		<parameter name="inputFirstName" value="Suzy"/>
--- 175,179 ----
  	<request>
    		<parameter name="service" value="direct"/>
!   		<parameter name="context" value="0/Register/form"/>
    		<parameter name="sp" value="S0"/>
    		<parameter name="inputFirstName" value="Suzy"/>

Index: TestStaleSessionException.xml
===================================================================
RCS file: /cvsroot/tapestry/Tapestry/junit/src/net/sf/tapestry/junit/mock/TestStaleSessionException.xml,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -C2 -d -r1.2.2.1 -r1.2.2.2
*** TestStaleSessionException.xml	4 Dec 2002 20:22:17 -0000	1.2.2.1
--- TestStaleSessionException.xml	19 Dec 2002 12:26:59 -0000	1.2.2.2
***************
*** 29,33 ****
  		<assert-output name="DirectLink URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=Stale/directLink"
  ]]>		
  		</assert-output>
--- 29,33 ----
  		<assert-output name="DirectLink URL">
  <![CDATA[
! href="/mock/app?service=direct&amp;context=0/Stale/directLink"
  ]]>		
  		</assert-output>
***************
*** 36,40 ****
  		<assert-output name="ActionLink URL">
  <![CDATA[
! href="/mock/app?service=action&amp;context=Stale/0/actionLink"
  ]]>		
  		</assert-output>		
--- 36,40 ----
  		<assert-output name="ActionLink URL">
  <![CDATA[
! href="/mock/app?service=action&amp;context=0/Stale/0/actionLink"
  ]]>		
  		</assert-output>		
***************
*** 55,59 ****
  ]]>
  			<match>direct</match>
! 			<match>Stale/form</match>
  			<match>S1</match>
  			<match>0</match>
--- 55,59 ----
  ]]>
  			<match>direct</match>
! 			<match>0/Stale/form</match>
  			<match>S1</match>
  			<match>0</match>
***************
*** 67,71 ****
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="Stale/directLink"/>
  		
  		<assert-output name="StaleSession (DirectLink)">
--- 67,75 ----
  	<request>
  		<parameter name="service" value="direct"/>
! 		
! 		<!-- The one simulates a stateful link (when rendered), but there's
! 		     no session, so there's a check and the exception is thrown. -->
! 		     
! 		<parameter name="context" value="1/Stale/directLink"/>
  		
  		<assert-output name="StaleSession (DirectLink)">
***************
*** 76,82 ****
  	</request>
  	
  	<request>
  		<parameter name="service" value="action"/>
! 		<parameter name="context" value="Stale/0/actionLink"/>
  		
  		<assert-output name="StaleSession (ActionLink)">
--- 80,88 ----
  	</request>
  	
+ 	<!-- Simulate stateful action link. -->
+ 	
  	<request>
  		<parameter name="service" value="action"/>
! 		<parameter name="context" value="1/Stale/0/actionLink"/>
  		
  		<assert-output name="StaleSession (ActionLink)">
***************
*** 89,93 ****
  	<request>
  		<parameter name="service" value="direct"/>
! 		<parameter name="context" value="Stale/form"/>
  		<parameter name="sp" value="S1"/>
  		<parameter name="Form1" value="0"/>
--- 95,102 ----
  	<request>
  		<parameter name="service" value="direct"/>
! 		
! 		<!-- Again, fudge things to force a stateful check -->
! 		
! 		<parameter name="context" value="1/Stale/form"/>
  		<parameter name="sp" value="S1"/>
  		<parameter name="Form1" value="0"/>



-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.