tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-tapestry/junit/context12 Home.html
Date Sat, 01 Feb 2003 16:47:22 GMT
hlship      2003/02/01 08:47:22

  Modified:    junit/src/net/sf/tapestry/junit/mock MockTestCase.java
                        TestPropertySpecification.xml
               junit/src/net/sf/tapestry/junit/mock/c9 Five.java
  Added:       junit/src/net/sf/tapestry/junit/mock
                        TestEnhancedParameterProperties.xml
               junit/src/net/sf/tapestry/junit/mock/c12 InsertInteger.java
                        InsertString.java
               junit/context12/WEB-INF InsertString.jwc InsertInteger.jwc
               junit/context12 Home.html
  Log:
  Create properties for connected parameters if needed.
  
  Revision  Changes    Path
  1.17      +13 -1     jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java
  
  Index: MockTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/MockTestCase.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- MockTestCase.java	28 Jan 2003 22:47:28 -0000	1.16
  +++ MockTestCase.java	1 Feb 2003 16:47:21 -0000	1.17
  @@ -95,6 +95,18 @@
       // in a static suite() method?
   
   	/**
  +	 *  Test ability of the enhancer to create properties for
  +	 *  connected parameters.
  +	 * 
  +	 **/
  +	
  +	public void testEnhancedParameterProperties()
  +	throws Exception
  +	{
  +		attempt("TestEnhancedParameterProperties.xml");
  +	}
  +
  +	/**
   	 *  Tests the Select and Option components (and a bit of Form as well).
   	 * 
   	 **/
  
  
  
  1.2       +3 -3      jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/TestPropertySpecification.xml
  
  Index: TestPropertySpecification.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/TestPropertySpecification.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestPropertySpecification.xml	24 Jan 2003 00:49:32 -0000	1.1
  +++ TestPropertySpecification.xml	1 Feb 2003 16:47:21 -0000	1.2
  @@ -189,7 +189,7 @@
   		</assert-output>
   		
   		<assert-output name="Exception Message">
  -Unable to enhance class net.sf.tapestry.junit.mock.c9.Four because it implements a non-abstract
read method for property 'word'.
  +Unable to enhance class net.sf.tapestry.junit.mock.c9.Four because it implements a non-abstract
write method for property 'word'.
   		</assert-output>		
   		
   	</request>		
  @@ -205,7 +205,7 @@
   		</assert-output>
   		
   		<assert-output name="Exception Message">
  -Unable to enhance class net.sf.tapestry.junit.mock.c9.Five because it implements a non-abstract
write method for property 'word'.
  +Unable to enhance class net.sf.tapestry.junit.mock.c9.Five because it implements a non-abstract
read method for property 'word'.
   		</assert-output>		
   		
   	</request>		
  
  
  
  1.1                  jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/TestEnhancedParameterProperties.xml
  
  Index: TestEnhancedParameterProperties.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <!-- $Id: TestEnhancedParameterProperties.xml,v 1.1 2003/02/01 16:47:21 hlship Exp $
-->
  
  <mock-test>
      <context name="c12" root="context12"/>
  
    	<servlet name="app" class="net.sf.tapestry.ApplicationServlet"/>
  
  	<request>
    	  	  	  	  	 	
  		<assert-output name="Page Title">
  <![CDATA[		
  <title>Home</title>
  ]]>
  		</assert-output>
    	  	  	
  		<assert-output name="InsertString Output">
  Greeting: [Aloha!]
  		</assert-output>
  
  		<assert-output name="InsertInteger Output">
  Value: [100]
  		</assert-output>
  		
  	</request>
  		
   </mock-test>
  
  
  1.1                  jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c12/InsertInteger.java
  
  Index: InsertInteger.java
  ===================================================================
  /*
   *  ====================================================================
   *  The Apache Software License, Version 1.1
   *
   *  Copyright (c) 2002 The Apache Software Foundation.  All rights
   *  reserved.
   *
   *  Redistribution and use in source and binary forms, with or without
   *  modification, are permitted provided that the following conditions
   *  are met:
   *
   *  1. Redistributions of source code must retain the above copyright
   *  notice, this list of conditions and the following disclaimer.
   *
   *  2. Redistributions in binary form must reproduce the above copyright
   *  notice, this list of conditions and the following disclaimer in
   *  the documentation and/or other materials provided with the
   *  distribution.
   *
   *  3. The end-user documentation included with the redistribution,
   *  if any, must include the following acknowledgment:
   *  "This product includes software developed by the
   *  Apache Software Foundation (http://www.apache.org/)."
   *  Alternately, this acknowledgment may appear in the software itself,
   *  if and wherever such third-party acknowledgments normally appear.
   *
   *  4. The names "Apache" and "Apache Software Foundation" and
   *  "Apache Tapestry" must not be used to endorse or promote products
   *  derived from this software without prior written permission. For
   *  written permission, please contact apache@apache.org.
   *
   *  5. Products derived from this software may not be called "Apache",
   *  "Apache Tapestry", nor may "Apache" appear in their name, without
   *  prior written permission of the Apache Software Foundation.
   *
   *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   *  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   *  SUCH DAMAGE.
   *  ====================================================================
   *
   *  This software consists of voluntary contributions made by many
   *  individuals on behalf of the Apache Software Foundation.  For more
   *  information on the Apache Software Foundation, please see
   *  <http://www.apache.org/>.
   */
  package net.sf.tapestry.junit.mock.c12;
  
  import net.sf.tapestry.AbstractComponent;
  import net.sf.tapestry.IMarkupWriter;
  import net.sf.tapestry.IRequestCycle;
  import net.sf.tapestry.RequestCycleException;
  
  /**
   *  Used to verify that the enhancer creates a property 
   *  with the correct name (not necessarily the parameter
   *  name).
   *
   *  @author Howard Lewis Ship
   *  @version $Id: InsertInteger.java,v 1.1 2003/02/01 16:47:22 hlship Exp $
   *
   **/
  
  public abstract class InsertInteger extends AbstractComponent
  {
  	public abstract int getIntValue();
  	
      protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          throws RequestCycleException
      {
      	writer.print(getIntValue());
      }
  
  }
  
  
  
  1.1                  jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c12/InsertString.java
  
  Index: InsertString.java
  ===================================================================
  /*
   *  ====================================================================
   *  The Apache Software License, Version 1.1
   *
   *  Copyright (c) 2002 The Apache Software Foundation.  All rights
   *  reserved.
   *
   *  Redistribution and use in source and binary forms, with or without
   *  modification, are permitted provided that the following conditions
   *  are met:
   *
   *  1. Redistributions of source code must retain the above copyright
   *  notice, this list of conditions and the following disclaimer.
   *
   *  2. Redistributions in binary form must reproduce the above copyright
   *  notice, this list of conditions and the following disclaimer in
   *  the documentation and/or other materials provided with the
   *  distribution.
   *
   *  3. The end-user documentation included with the redistribution,
   *  if any, must include the following acknowledgment:
   *  "This product includes software developed by the
   *  Apache Software Foundation (http://www.apache.org/)."
   *  Alternately, this acknowledgment may appear in the software itself,
   *  if and wherever such third-party acknowledgments normally appear.
   *
   *  4. The names "Apache" and "Apache Software Foundation" and
   *  "Apache Tapestry" must not be used to endorse or promote products
   *  derived from this software without prior written permission. For
   *  written permission, please contact apache@apache.org.
   *
   *  5. Products derived from this software may not be called "Apache",
   *  "Apache Tapestry", nor may "Apache" appear in their name, without
   *  prior written permission of the Apache Software Foundation.
   *
   *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   *  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   *  DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   *  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   *  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   *  SUCH DAMAGE.
   *  ====================================================================
   *
   *  This software consists of voluntary contributions made by many
   *  individuals on behalf of the Apache Software Foundation.  For more
   *  information on the Apache Software Foundation, please see
   *  <http://www.apache.org/>.
   */
  package net.sf.tapestry.junit.mock.c12;
  
  import net.sf.tapestry.AbstractComponent;
  import net.sf.tapestry.IMarkupWriter;
  import net.sf.tapestry.IRequestCycle;
  import net.sf.tapestry.RequestCycleException;
  
  /**
   *  A simplified version of the Insert component that requires a parameter
   *  named string of type String.
   *
   *  @author Howard Lewis Ship
   *  @version $Id: InsertString.java,v 1.1 2003/02/01 16:47:22 hlship Exp $
   *
   **/
  
  public abstract class InsertString extends AbstractComponent
  {
  	public abstract String getString();
  
      protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
          throws RequestCycleException
      {
      	writer.print(getString());
      }
  
  }
  
  
  
  1.3       +3 -3      jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c9/Five.java
  
  Index: Five.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/net/sf/tapestry/junit/mock/c9/Five.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Five.java	24 Jan 2003 03:47:17 -0000	1.2
  +++ Five.java	1 Feb 2003 16:47:22 -0000	1.3
  @@ -66,8 +66,8 @@
   
   public class Five extends BasePage
   {
  -	public void setWord(String value)
  +	public String getWord()
   	{
  -		// Nothing, but it screws up the works.
  +		return null;
   	}
   }
  
  
  
  1.1                  jakarta-tapestry/junit/context12/WEB-INF/InsertString.jwc
  
  Index: InsertString.jwc
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- $Id: InsertString.jwc,v 1.1 2003/02/01 16:47:22 hlship Exp $ -->
  <!DOCTYPE component-specification PUBLIC 
    "-//Apache Software Foundation//Tapestry Specification 1.4//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
    
  <component-specification class="net.sf.tapestry.junit.mock.c12.InsertString"
  		allow-body="no" allow-informal-parameters="no">
  
    <parameter name="string" java-type="java.lang.String" direction="in"/>
  		
  </component-specification>
  
  
  
  1.1                  jakarta-tapestry/junit/context12/WEB-INF/InsertInteger.jwc
  
  Index: InsertInteger.jwc
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- $Id: InsertInteger.jwc,v 1.1 2003/02/01 16:47:22 hlship Exp $ -->
  <!DOCTYPE component-specification PUBLIC 
    "-//Apache Software Foundation//Tapestry Specification 1.4//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_1_4.dtd">
    
  <component-specification class="net.sf.tapestry.junit.mock.c12.InsertInteger"
  		allow-body="no" allow-informal-parameters="no">
  
    <parameter name="integer" property-name="intValue" java-type="int" direction="in"/>
  		
  </component-specification>
  
  
  
  1.1                  jakarta-tapestry/junit/context12/Home.html
  
  Index: Home.html
  ===================================================================
  <html jwcid="@Shell" title="Home">
  <body jwcid="@Body">
  
  Greeting: [<span jwcid="@InsertString" string="Aloha!">Shalom</span>]
  
  <br/>
  
  Value: [<span jwcid="@InsertInteger" integer="100">50</span>]
  	
  </body>
  </html>
  
  

Mime
View raw message