You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by mi...@apache.org on 2004/01/07 02:19:44 UTC

cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/junit/mock/c9 Twelve.java

mindbridge    2004/01/06 17:19:44

  Modified:    junit/mock-scripts TestPropertySpecification.xml
  Added:       junit/Context9/WEB-INF Twelve.page
               junit/Context9 Twelve.html
               junit/src/org/apache/tapestry/junit/mock/c9 Twelve.java
  Log:
  Adding a unit test to make sure that the property initializers are evaluated every time
  
  Revision  Changes    Path
  1.1                  jakarta-tapestry/junit/Context9/WEB-INF/Twelve.page
  
  Index: Twelve.page
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE page-specification
        PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
        "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
  <!-- generated by Spindle, http://spindle.sourceforge.net -->
  
  <page-specification class="org.apache.tapestry.junit.mock.c9.Twelve">
      <property-specification name="variableValue" type="int" initial-value="initialValue"/>
      <property-specification name="constantValue" type="int" initial-value="5"/>
  </page-specification>
  
  
  
  1.7       +37 -1     jakarta-tapestry/junit/mock-scripts/TestPropertySpecification.xml
  
  Index: TestPropertySpecification.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/mock-scripts/TestPropertySpecification.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestPropertySpecification.xml	8 Dec 2003 22:23:20 -0000	1.6
  +++ TestPropertySpecification.xml	7 Jan 2004 01:19:44 -0000	1.7
  @@ -394,5 +394,41 @@
   		it_IT is the Italy locale
   		</assert-output>	
   	</request>	
  +
  +	<request>
  +		<parameter name="service" value="page/Twelve"/>
  +		
  +		<assert-output name="Title">
  +<![CDATA[
  +<title>Twelve</title>
  +]]>	
  +		</assert-output>
  +		
  +		<assert-output name="Two">
  +		Variable initial value = 0
  +		</assert-output>	
  +		
  +		<assert-output name="Two">
  +		Constant initial value = 5
  +		</assert-output>	
  +	</request>	
  +
  +	<request>
  +		<parameter name="service" value="page/Twelve"/>
  +		
  +		<assert-output name="Title">
  +<![CDATA[
  +<title>Twelve</title>
  +]]>	
  +		</assert-output>
  +		
  +		<assert-output name="Two">
  +		Variable initial value = 1
  +		</assert-output>	
  +		
  +		<assert-output name="Two">
  +		Constant initial value = 5
  +		</assert-output>	
  +	</request>	
    </mock-test>
    
  
  
  
  1.1                  jakarta-tapestry/junit/Context9/Twelve.html
  
  Index: Twelve.html
  ===================================================================
  <html jwcid="@Shell" title="Twelve">
  <body jwcid="@Body">
  
  <p>
  Variable initial value = <span jwcid="@Insert" value="ognl:variableValue">0</span>
  <p>
  Constant initial value = <span jwcid="@Insert" value="ognl:constantValue">5</span>
  
  </body>
  </html>
  
  
  1.1                  jakarta-tapestry/junit/src/org/apache/tapestry/junit/mock/c9/Twelve.java
  
  Index: Twelve.java
  ===================================================================
  /*
   * Created on 2004-1-7
   *
   */
  package org.apache.tapestry.junit.mock.c9;
  
  import org.apache.tapestry.html.BasePage;
  
  /**
   *  Testing for correct initialization of properties
   *
   *  @author mindbridge
   *  @version $Id: Twelve.java,v 1.1 2004/01/07 01:19:44 mindbridge Exp $
   *  @since 3.0
   *
   **/
  public class Twelve extends BasePage
  {
      private int _initialValue = 0;
      
      public int getInitialValue()
      {
          return _initialValue++;
      }
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org