CVS: Tapestry/junit/src/net/sf/tapestry/junit/mock TestMissingAppSpec.xml,NONE,1.1.2.1 TestSearchPages.xml,NONE,1.1.2.1 TestSearchComponents.xml,NONE,1.1.2.1 TestLibraryInWebInfApplication.xml,NONE,1.1.2.1 MockTestCase.java,1.10.2.9,1.10.2.10 TestImplicitPages.xml,1.1.2.2,NONE

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

Modified Files:
      Tag: hship-2-3
	MockTestCase.java 
Added Files:
      Tag: hship-2-3
	TestMissingAppSpec.xml TestSearchPages.xml 
	TestSearchComponents.xml TestLibraryInWebInfApplication.xml 
Removed Files:
      Tag: hship-2-3
	TestImplicitPages.xml 
Log Message:
Allow searches for component specifications.
Allow application specification to be in WEB-INF instead of on classpath.
Allow application to run without an application specification.

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

<!-- $Id: TestMissingAppSpec.xml,v 1.1.2.1 2002/12/15 16:26:11 hship Exp $ -->

<mock-test>
    <context name="c3" root="context3"/>

  	<servlet name="app" class="net.sf.tapestry.ApplicationServlet">
  		<init-parameter
  			name="net.sf.tapestry.engine-class"
  			value="net.sf.tapestry.junit.mock.c3.C3Engine"/>
  	</servlet>
       
    <request>
 		
 		<assert-output name="Page Title">
<![CDATA[
<title>No Application Spec</title>
]]> 		
 		</assert-output>
 		
 		<assert-output name="Application Name">
Application name: app 		
 		</assert-output>
 		
 		<assert-output name="Engine Class">
Engine class: net.sf.tapestry.junit.mock.c3.C3Engine
		</assert-output>
		
 	</request>
			
</mock-test>
    	

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

<!-- $Id: TestSearchPages.xml,v 1.1.2.1 2002/12/15 16:26:11 hship Exp $ -->

<mock-test>
    <context name="c2" root="context2"/>

  	<servlet name="app" class="net.sf.tapestry.ApplicationServlet">
  		<init-parameter
  			name="net.sf.tapestry.application-specification"
  			value="/net/sf/tapestry/junit/mock/c2/C2.application"/>
  	</servlet>      
    
<!-- Check that the home service is the default service. -->
    
    <request>   			
		<assert-output name="Title">
<![CDATA[
<title>Implicit Home Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from Home Page">
No page specification.
		</assert-output>
		
	</request>	
	
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="WithApplication"/>
		
		<assert-output name="Title">
<![CDATA[
<title>WithApplication Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
This page's specification is a sibling of the app specification.
		</assert-output>
				
	</request>	
			
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="InPages"/>
		
		<assert-output name="Title">
<![CDATA[
<title>InPages Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
The specification, and properties files, are located in WEB-INF/pages.
		</assert-output>
				
	</request>
	
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="InWebInf"/>
		
		<assert-output name="Title">
<![CDATA[
<title>InWebInf Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
The specification, and properties files, are located in directly in WEB-INF.
		</assert-output>
				
	</request>	
	
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="InAppRoot"/>
		
		<assert-output name="Title">
<![CDATA[
<title>InAppRoot Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
The specification, and properties files, are located in the application root.
		</assert-output>
				
	</request>	
	
		
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="StaleLink"/>
		
		<assert-output name="Title">
<![CDATA[
<title>Application StaleLink Page</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
This is an application-provided version of the StaleLink page.
		</assert-output>
				
	</request>	
	
	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="framework:StaleLink"/>
		
		<assert-output name="Title">
<![CDATA[
<title>Stale Link</title>
]]>
		</assert-output>		

		<assert-output name="Text from page">
<![CDATA[
You have clicked on a <i>stale link</i>.
]]>
		</assert-output>
				
	</request>							 	 	 
</mock-test>
    	

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

<!-- $Id: TestSearchComponents.xml,v 1.1.2.1 2002/12/15 16:26:11 hship Exp $ -->

<mock-test>
    <context name="c2" root="context2"/>

  	<servlet name="app" class="net.sf.tapestry.ApplicationServlet">
  		<init-parameter
  			name="net.sf.tapestry.application-specification"
  			value="/net/sf/tapestry/junit/mock/c2/C2.application"/>
  	</servlet>      
    

	<request>
		<parameter name="service" value="page"/>
		<parameter name="context" value="ImplicitComponents"/>
		
		<assert-output name="Page Title">
<![CDATA[
<title>ImplicitComponents Page</title>
]]>
		</assert-output>
	
		<assert-output name="CRoot output">
This content provided by component CRoot.
		</assert-output>
		
		<assert-output name="CWebInf output">
This content provided by component CWebInf.
		</assert-output>

		<assert-output name="CWebInfApp output">
This content provided by component CWebInfApp.
		</assert-output>	
		
		<assert-output name="CApp output">
This content provided by component CApp.
		</assert-output>			
		
		<assert-output name="CRelative output">
This content provided by component CRelative.
		</assert-output>	
						
	</request>		
						 	 	 
</mock-test>
    	

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

<!-- $Id: TestLibraryInWebInfApplication.xml,v 1.1.2.1 2002/12/15 16:26:12 hship Exp $ -->

<mock-test>
    <context name="c4" root="context4"/>

  	<servlet name="foo" class="net.sf.tapestry.ApplicationServlet"/>
       
    <request>
 		
 		<assert-output name="Page Title">
<![CDATA[
<title>App Spec in WEB-INF</title>
]]> 		
 		</assert-output>
 		
 		<assert-output name="Application Name">
Application name: Application foo in WEB-INF
 		</assert-output>
 		
 		<assert-output name="Engine Class">
Engine class: net.sf.tapestry.junit.mock.c4.C4Engine
		</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.9
retrieving revision 1.10.2.10
diff -C2 -d -r1.10.2.9 -r1.10.2.10
*** MockTestCase.java	13 Dec 2002 12:22:44 -0000	1.10.2.9
--- MockTestCase.java	15 Dec 2002 16:26:11 -0000	1.10.2.10
***************
*** 21,33 ****
      }
  
!     private MockTester attempt(String name)
!     throws Exception
      {
          String path = "/net/sf/tapestry/junit/mock/" + name;
!         
          MockTester tester = new MockTester(path);
!         
          tester.execute();
!         
          return tester;
      }
--- 21,32 ----
      }
  
!     private MockTester attempt(String name) throws Exception
      {
          String path = "/net/sf/tapestry/junit/mock/" + name;
! 
          MockTester tester = new MockTester(path);
! 
          tester.execute();
! 
          return tester;
      }
***************
*** 37,45 ****
      // point, I will order them differently (though since they all pass,
      // the order isn't that important).
!     
      // Should also look at JUnit documentation; perhaps there's a way to
      // implicitly define tests based on the found XML files?  Possibly
      // in a static suite() method.
!     
      /**
       *  Test that relative specification paths in the application specification
--- 36,76 ----
      // point, I will order them differently (though since they all pass,
      // the order isn't that important).
! 
      // Should also look at JUnit documentation; perhaps there's a way to
      // implicitly define tests based on the found XML files?  Possibly
      // in a static suite() method.
! 
!     /**
!      *  Test behavior when the application specification doesn't exist.
!      * 
!      **/
! 
!     public void testMissingAppSpec() throws Exception
!     {
!         attempt("TestMissingAppSpec.xml");
!     }
! 
!     /**
!      *   Demonstrates that libraries defined in application specifications
!      *   within the context can still be located in the classpath.
!      * 
!      **/
! 
!     public void testLibraryInWebInfApplication() throws Exception
!     {
!         attempt("TestLibraryInWebInfApplication.xml");
!     }
! 
!     /**
!      *  Test ability to search for components specifications for 
!      *  component types in the application namespace.
!      * 
!      **/
! 
!     public void testSearchComponents() throws Exception
!     {
!         attempt("TestSearchComponents.xml");
!     }
! 
      /**
       *  Test that relative specification paths in the application specification
***************
*** 47,64 ****
       * 
       **/
!     
      public void testRelative() throws Exception
      {
          // Note, this needs to be expanded to include relative
          // paths to components and libraries.
!         
          attempt("TestRelative.xml");
!     }    
!     
      /**
       *  Test the reset service.
       *
       **/
!     
      public void testReset() throws Exception
      {
--- 78,95 ----
       * 
       **/
! 
      public void testRelative() throws Exception
      {
          // Note, this needs to be expanded to include relative
          // paths to components and libraries.
! 
          attempt("TestRelative.xml");
!     }
! 
      /**
       *  Test the reset service.
       *
       **/
! 
      public void testReset() throws Exception
      {
***************
*** 67,78 ****
  
      /**
!      *  Test failure for application that doesn't provide a home page.
       * 
       **/
!     
!     public void testImplicitPages()
!     throws Exception
      {
!         attempt("TestImplicitPages.xml");
      }
  
--- 98,109 ----
  
      /**
!      *  Test ability to search for page specifications for pages
!      *  in the application namespace.
       * 
       **/
! 
!     public void testSearchPages() throws Exception
      {
!         attempt("TestSearchPages.xml");
      }
  
***************
*** 81,87 ****
       * 
       **/
!     
!     public void testFailNoHome()
!     throws Exception
      {
          attempt("TestFailNoHome.xml");
--- 112,117 ----
       * 
       **/
! 
!     public void testFailNoHome() throws Exception
      {
          attempt("TestFailNoHome.xml");
***************
*** 92,102 ****
       * 
       **/
!     
!     public void testFailMissingClass()
!     throws Exception
      {
          attempt("TestFailMissingClass.xml");
      }
!     
      /**
       *  Test when the class specified for a page 
--- 122,131 ----
       * 
       **/
! 
!     public void testFailMissingClass() throws Exception
      {
          attempt("TestFailMissingClass.xml");
      }
! 
      /**
       *  Test when the class specified for a page 
***************
*** 104,114 ****
       * 
       **/
!     
!     public void testFailNotPage()
!     throws Exception
      {
          attempt("TestFailNotPage.xml");
!     } 
!     
      /**
       *  Test when the class specified for a component 
--- 133,142 ----
       * 
       **/
! 
!     public void testFailNotPage() throws Exception
      {
          attempt("TestFailNotPage.xml");
!     }
! 
      /**
       *  Test when the class specified for a component 
***************
*** 116,137 ****
       * 
       **/
!     
!     public void testFailNotComponent()
!     throws Exception
      {
          attempt("TestFailNotComponent.xml");
!     }     
!        
      /**
       *  Test basics including the PageLink and DirectLink (w/o parameters).
       * 
       **/
!     
!     public void testSimple()
!     throws Exception
      {
          attempt("TestSimple.xml");
      }
!     
      /**
       *  Test ability to embed component in a library and reference
--- 144,163 ----
       * 
       **/
! 
!     public void testFailNotComponent() throws Exception
      {
          attempt("TestFailNotComponent.xml");
!     }
! 
      /**
       *  Test basics including the PageLink and DirectLink (w/o parameters).
       * 
       **/
! 
!     public void testSimple() throws Exception
      {
          attempt("TestSimple.xml");
      }
! 
      /**
       *  Test ability to embed component in a library and reference
***************
*** 139,149 ****
       * 
       **/
!     
!     public void testLibrary()
!     throws Exception
      {
          attempt("TestLibrary.xml");
      }
!        
      /**
       *  Test the External service, ServiceLink and a page implementing
--- 165,174 ----
       * 
       **/
! 
!     public void testLibrary() throws Exception
      {
          attempt("TestLibrary.xml");
      }
! 
      /**
       *  Test the External service, ServiceLink and a page implementing
***************
*** 151,161 ****
       * 
       **/
!     
!     public void testExternal()
!     throws Exception
      {
          attempt("TestExternal.xml");
!     }       
!     
      /**
       * 
--- 176,185 ----
       * 
       **/
! 
!     public void testExternal() throws Exception
      {
          attempt("TestExternal.xml");
!     }
! 
      /**
       * 
***************
*** 163,190 ****
       * 
       **/
!     
!     public void testPage()
!     throws Exception
      {
          attempt("TestPage.xml");
      }
!     
!     public void testLocalization()
!     throws Exception
      {
          attempt("TestLocalization.xml");
      }
!     
      /**
       *   Begin testing forms using the Register page.
       * 
       **/
!     
!     public void testRegisterForm()
!     throws Exception
      {
          attempt("TestRegisterForm.xml");
      }
!     
      /**
       *  Tests the validate() method, tests handling
--- 187,211 ----
       * 
       **/
! 
!     public void testPage() throws Exception
      {
          attempt("TestPage.xml");
      }
! 
!     public void testLocalization() throws Exception
      {
          attempt("TestLocalization.xml");
      }
! 
      /**
       *   Begin testing forms using the Register page.
       * 
       **/
! 
!     public void testRegisterForm() throws Exception
      {
          attempt("TestRegisterForm.xml");
      }
! 
      /**
       *  Tests the validate() method, tests handling
***************
*** 195,205 ****
       * 
       **/
!     
!     public void testValidate()
!     throws Exception
      {
          attempt("TestValidate.xml");
      }
!     
      /**
       *  Tests the use of {@link net.sf.tapestry.callback.DirectCallback}
--- 216,225 ----
       * 
       **/
! 
!     public void testValidate() throws Exception
      {
          attempt("TestValidate.xml");
      }
! 
      /**
       *  Tests the use of {@link net.sf.tapestry.callback.DirectCallback}
***************
*** 209,219 ****
       * 
       **/
!     
!     public void testProtectedLink()
!     throws Exception
      {
          attempt("TestProtectedLink.xml");
      }
!     
      /**
       *  Tests {@link net.sf.tapestry.StaleLinkException} with
--- 229,238 ----
       * 
       **/
! 
!     public void testProtectedLink() throws Exception
      {
          attempt("TestProtectedLink.xml");
      }
! 
      /**
       *  Tests {@link net.sf.tapestry.StaleLinkException} with
***************
*** 221,237 ****
       * 
       **/
!     
!     public void testStaleLinkException()
!     throws Exception
      {
          attempt("TestStaleSessionException.xml");
      }
!     
!     public void testStrings()
!     throws Exception
      {
          attempt("TestStrings.xml");
      }
!     
      /**
       *  Test case for a ValidField with a validator and client-side scripting, but
--- 240,254 ----
       * 
       **/
! 
!     public void testStaleLinkException() throws Exception
      {
          attempt("TestStaleSessionException.xml");
      }
! 
!     public void testStrings() throws Exception
      {
          attempt("TestStrings.xml");
      }
! 
      /**
       *  Test case for a ValidField with a validator and client-side scripting, but
***************
*** 239,249 ****
       * 
       **/
!     
!     public void testValidFieldNoBody()
!     throws Exception
      {
          attempt("TestValidFieldNoBody.xml");
      }
!     
      /**
       *  A series of tests for components where parameters are bound
--- 256,265 ----
       * 
       **/
! 
!     public void testValidFieldNoBody() throws Exception
      {
          attempt("TestValidFieldNoBody.xml");
      }
! 
      /**
       *  A series of tests for components where parameters are bound
***************
*** 251,278 ****
       * 
       **/
!     
!     public void testTemplateExpressions()
!     throws Exception
      {
          attempt("TestTemplateExpr.xml");
      }
!     
!     public void testImplicitComponents()
!     throws Exception
      {
          attempt("TestImplicitComponents.xml");
      }
!     
      /**
       *  Perform basic tests of the home service.
       * 
       **/
!     
!     public void testHome()
!     throws Exception
      {
          attempt("TestHome.xml");
      }
!     
      /**
       *  Test cases where the page's template comes from
--- 267,291 ----
       * 
       **/
! 
!     public void testTemplateExpressions() throws Exception
      {
          attempt("TestTemplateExpr.xml");
      }
! 
!     public void testImplicitComponents() throws Exception
      {
          attempt("TestImplicitComponents.xml");
      }
! 
      /**
       *  Perform basic tests of the home service.
       * 
       **/
! 
!     public void testHome() throws Exception
      {
          attempt("TestHome.xml");
      }
! 
      /**
       *  Test cases where the page's template comes from
***************
*** 280,297 ****
       * 
       **/
!     
!     public void testAssetTemplates()
!     throws Exception
      {
          attempt("TestAssetTemplates.xml");
      }
!     
      /**
       *  Test case for relative context and private assets.
       * 
       **/
!     
!     public void testRelativeAssets()
!     throws Exception
      {
          attempt("TestRelativeAssets.xml");
--- 293,308 ----
       * 
       **/
! 
!     public void testAssetTemplates() throws Exception
      {
          attempt("TestAssetTemplates.xml");
      }
! 
      /**
       *  Test case for relative context and private assets.
       * 
       **/
! 
!     public void testRelativeAssets() throws Exception
      {
          attempt("TestRelativeAssets.xml");

--- TestImplicitPages.xml DELETED ---



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
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.