CVS: Tapestry/junit/src/net/sf/tapestry/junit/mock TestListenerBinding.xml,NONE,1.1.2.1 MockTestCase.java,1.10.2.14,1.10.2.15

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-serv3134/junit/src/net/sf/tapestry/junit/mock

Modified Files:
      Tag: hship-2-3
	MockTestCase.java 
Added Files:
      Tag: hship-2-3
	TestListenerBinding.xml 
Log Message:
Add tests for <listener-binding>

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

<!-- $Id: TestListenerBinding.xml,v 1.1.2.1 2003/01/04 02:49:05 hship Exp $ -->

<mock-test>
    <context name="c7" root="context7"/>

  	<servlet name="lb" class="net.sf.tapestry.ApplicationServlet"/>
  	

	<request>
  	 	<parameter name="service" value="page"/>
  	 	<parameter name="context" value="Two"/>
  	  	  	
		<assert-output name="Page Title">
<![CDATA[		
<title>Listener Binding</title>
]]>
		</assert-output>
  	  	  	
		<assert-output name="Initial Message">
Message: No message.
		</assert-output>
	
		<assert-output name="Link">
<![CDATA[		
/c7/lb?service=direct&amp;context=0/Two/link
]]>
		</assert-output>
 
  	</request>
  
	<request>
		<parameter name="service" value="direct"/>
  		<parameter name="context" value="0/Two/link"/>
  		
 		<assert-output name="Page Title">
<![CDATA[		
<title>Listener Binding</title>
]]>
		</assert-output>
  	  	  	
		<assert-output name="Updated Message">
Message: Component was clicked.
		</assert-output>
	</request> 		
  
	<request>
  	 	<parameter name="service" value="reset"/>
  	 	<parameter name="context" value="Two"/>
  	  	  	
		<assert-output name="Page Title">
<![CDATA[		
<title>Listener Binding</title>
]]>
		</assert-output>
  	  	  	
		<assert-output name="Initial Message">
Message: No message.
		</assert-output>	
	</request>

	<request>
		<parameter name="service" value="direct"/>
  		<parameter name="context" value="0/Two/link"/>
  		
 		<assert-output name="Page Title">
<![CDATA[		
<title>Listener Binding</title>
]]>
		</assert-output>
  	  	  	
		<assert-output name="Updated Message">
Message: Component was clicked.
		</assert-output>
		
		<assert-output name="invalidScriptLink URL">
<![CDATA[
/c7/lb?service=direct&amp;context=0/Two/invalidScriptLink
]]>
		</assert-output>
		
		<assert-output name="unknownLanguageLink URL">
<![CDATA[
/c7/lb?service=direct&amp;context=0/Two/unknownLanguageLink
]]>
		</assert-output>	
				
	</request> 		
	  
	<!--  Trigger a case where the script to execute is invalid. -->
	
	<request>
		<parameter name="service" value="direct"/>
  		<parameter name="context" value="0/Two/invalidScriptLink"/>
	
 		<assert-output name="Page Title">
<![CDATA[		
<title>Exception</title>
]]>
		</assert-output>
		
		<assert-output name="Invalid Script Error Message">
Unable to execute listener script "'listener' listener script for component Two/invalidScriptLink": exception from Jython
		</assert-output>		
	</request>

	<!-- Trigger a case where the script language is not defined. -->

	<request>
		<parameter name="service" value="direct"/>
  		<parameter name="context" value="0/Two/unknownLanguageLink"/>
	
 		<assert-output name="Page Title">
<![CDATA[		
<title>Exception</title>
]]>
		</assert-output>
		
		<assert-output name="Unknown Language Error Message">
Unable to execute listener script "'listener' listener script for component Two/unknownLanguageLink": unsupported language: DoesNotExist.
		</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.14
retrieving revision 1.10.2.15
diff -C2 -d -r1.10.2.14 -r1.10.2.15
*** MockTestCase.java	2 Jan 2003 03:04:26 -0000	1.10.2.14
--- MockTestCase.java	4 Jan 2003 02:49:05 -0000	1.10.2.15
***************
*** 43,46 ****
--- 43,57 ----
  
      /**
+      *  Tests related to the listener binding (added in 1.4 DTD).
+      * 
+      **/
+     
+     public void testListenerBinding()
+     throws Exception
+     {
+         attempt("TestListenerBinding.xml");
+     }
+ 
+     /**
       *  Test that default class names for pages and components work.
       * 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://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.