Author: jkuhnert
Date: Sun Oct 29 14:49:43 2006
New Revision: 469021
URL: http://svn.apache.org/viewvc?view=rev&rev=469021
Log:
Updated @If/@Else components to renderTags by default, optionally allowing for
various levels of default configuration using
hivemind configured global properties.
Also updated documentation on these properties in the configuration section of
the users guide and referenced this ability
in the If and Else component documentation sections as well.
Modified:
tapestry/tapestry4/trunk/src/site/xdoc/components/general/else.xml
tapestry/tapestry4/trunk/src/site/xdoc/components/general/if.xml
tapestry/tapestry4/trunk/src/site/xdoc/usersguide/configuration.xml
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Tapestry.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Else.jwc
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/If.jwc
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ResponseBuilder.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/components/TestIfElse.java
Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/general/else.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/general/else.xml?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/general/else.xml
(original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/general/else.xml Sun Oct
29 14:49:43 2006
@@ -62,6 +62,17 @@
component. This logic also deprecates the
<code>element</code> parameter in
that tag names are already captured from the html
temlpate read in, so you
only need to tell the component to render or not
render whatever tag you used.
+
+ <span class="info">
+ <strong>Info:</strong>
+ <p>
+ You can also control the default value of
this property via the global
+ configuration property
<code>org.apache.tapestry.renderTags</code> which
+ is covered in more depth in the
+ <a
href="../../usersguide/configuration.html#Configuration%20Properties">configuration
section</a>
+ of the <a
href="../../usersguide/index.html">Users Guide</a>.
+ </p>
+ </span>
</td>
</tr>
<tr>
Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/general/if.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/general/if.xml?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/general/if.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/general/if.xml Sun Oct 29
14:49:43 2006
@@ -91,6 +91,17 @@
component. This logic also deprecates the
<code>element</code> parameter in
that tag names are already captured from the html
temlpate read in, so you
only need to tell the component to render or not
render whatever tag you used.
+
+ <span class="info">
+ <strong>Info:</strong>
+ <p>
+ You can also control the default value of
this property via the global
+ configuration property
<code>org.apache.tapestry.renderTags</code> which
+ is covered in more depth in the
+ <a
href="../../usersguide/configuration.html#Configuration%20Properties">configuration
section</a>
+ of the <a
href="../../usersguide/index.html">Users Guide</a>.
+ </p>
+ </span>
</td>
</tr>
<tr>
Modified: tapestry/tapestry4/trunk/src/site/xdoc/usersguide/configuration.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/usersguide/configuration.xml?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/usersguide/configuration.xml
(original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/usersguide/configuration.xml Sun Oct
29 14:49:43 2006
@@ -76,7 +76,7 @@
- <section name="Web deployment descriptor">
+ <subsection name="Web deployment descriptor">
<p>
@@ -233,9 +233,9 @@
</p>
- </section><!-- configuration.deployment-descriptor -->
+ </subsection><!-- configuration.deployment-descriptor -->
- <section name="Application Property Source">
+ <subsection name="Application Property Source">
<p>
@@ -282,12 +282,13 @@
<p>Applications are free to leverage this lookup mechanism as
well.</p>
- <p>
+ <span class="info">
<strong>Fixme:</strong>
- <br />
+ <p>
Need to reference the ApplicationPropertySource,
GlobalPropertySource and
ComponentPropertySource services here.
- </p>
+ </p>
+ </span>
<p>
Applications may also want to change or augment the default
search path; this is
@@ -301,17 +302,18 @@
. For example, some configuration data could be drawn from a
database.
</p>
- <p>
+ <span class="info">
<strong>Fixme:</strong>
- <br />
+ <p>
The previous paragraph is out of date; extension of the search
path will involve a
HiveMind contribution, details to be provided.
- </p>
+ </p>
+ </span>
- </section><!-- configuration.app-property-source -->
+ </subsection><!-- configuration.app-property-source -->
- <section name="Global Property Source">
+ <subsection name="Global Property Source">
<p>
@@ -335,21 +337,26 @@
symbols.
</li>
</ul>
- </section><!-- configuration.global-property-source -->
+ </subsection><!-- configuration.global-property-source -->
- <section name="Configuration Properties">
+ <subsection name="Configuration Properties">
<p>The following are all the configuration values currently used
in Tapestry:</p>
<table>
- <tr>
+ <thead>
+ <tr>
<th>Property</th>
+ <th>Default Value</th>
<th>Description</th>
- </tr>
-
+ </tr>
+ </thead>
+
+ <tbody>
<tr>
<td>org.apache.tapestry.accepted-locales</td>
+ <td>any/all</td>
<td>
Controls which locales are supported by the
application; see the
documentation on
@@ -362,6 +369,7 @@
<tr>
<td>org.apache.tapestry.bean-class-packages</td>
+ <td></td>
<td>
A comma-seperated list, used when converting class
names for managed beans
(specified using the
@@ -373,6 +381,7 @@
<tr>
<td>org.apache.tapestry.component-class-packages</td>
+ <td></td>
<td>
A comma-seperated list of package names, used when
<a href="page-class.html#page-class.component">
@@ -386,6 +395,7 @@
<tr>
<td>org.apache.tapestry.default-binding-prefix</td>
+ <td>ognl</td>
<td>
The default binding to use when no explicit binding
prefix is provided. This
is typically set inside a page or component
specification, or within an
@@ -397,6 +407,7 @@
<tr>
<td>org.apache.tapestry.default-cookie-max-age</td>
+ <td>6123600</td>
<td>
The default max age (in seconds) for cookies written
by Tapestry, including
the cookie used to track the user's locale. A value of
-1 means the cookie
@@ -408,7 +419,8 @@
<tr>
<td>org.apache.tapestry.default-page-class</td>
-
+ <td>org.apache.tapestry.
+ html.BasePage</td>
<td>
By default, any page that omits the class attribute
(in its
<a
href="spec.html#spec.page-specification"><page-specification></a>
@@ -425,7 +437,7 @@
<tr>
<td>org.apache.tapestry.disable-caching</td>
-
+ <td>false</td>
<td>
If specified (as "true"), then the framework will
discard all cached data
(specifications, templates, pooled objects, etc.) at
the end of each request
@@ -445,13 +457,9 @@
</p>
</td>
</tr>
-
-
-
-
<tr>
<td>org.apache.tapestry.enable-reset-service</td>
-
+ <td>false</td>
<td>
If not specified as "true", then the reset service
will be non-functional.
The reset service is used to force the running
Tapestry application to
@@ -469,7 +477,8 @@
<tr>
<td>org.apache.tapestry.engine-class</td>
-
+ <td>org.apache.tapestry.
+ engine.BaseEngine</td>
<td>
The fully qualified class name to instantiate as the
application engine.
This configuration value is only used when the
application specification
@@ -481,11 +490,10 @@
is used if this configuration value is also left
unspecified.
</td>
</tr>
-
-
<tr>
-
<td>org.apache.tapestry.enhance.disable-abstract-method-validation</td>
-
+ <td>org.apache.tapestry.enhance.
+ disable-abstract-method-validation</td>
+ <td>false</td>
<td>
Used to trigger a work around for a bug in IBM's JDK
1.4.0. This particular
JDK reports
@@ -495,18 +503,19 @@
Specifying true for this property disables checks for
unimplemented abstract
methods.
- <p>
+ <span class="warn">
<strong>Warning:</strong>
- <br />
+ <p>
Support for this property has been temporarily
removed from release 4.0.
- </p>
+ </p>
+ </span>
</td>
</tr>
<tr>
<td>org.apache.tapestry.global-class</td>
-
+ <td>java.util.HashMap</td>
<td>
The fully qualified class name to instantiate as the
engine global property.
The Global object is much like Visit object, except
that it is shared by all
@@ -518,6 +527,7 @@
<tr>
<td>org.apache.tapestry.home-page</td>
+ <td>Home</td>
<td>
The name of the page to be displayed by the home
engine service (that is,
the page initially displayed when there's no other
information in the
@@ -527,6 +537,7 @@
<tr>
<td>org.apache.tapestry.jwcid-attribute-name</td>
+ <td>jwcid</td>
<td>
Controls the attribute used to recognize the locations
of contained
components within a
@@ -537,7 +548,7 @@
<tr>
<td>org.apache.tapestry.messages-encoding</td>
-
+ <td>ISO-8859-1</td>
<td>
Defines the character set used when reading the
properties files comprising
a page or component
@@ -560,7 +571,7 @@
<tr>
<td>org.apache.tapestry.output-encoding</td>
-
+ <td>UTF-8</td>
<td>
Defines the character set used by the application to
encode its HTTP
responses. This is also the character set that the
application assumes that
@@ -575,12 +586,9 @@
</td>
</tr>
-
-
-
-
<tr>
<td>org.apache.tapestry.page-class-packages</td>
+ <td></td>
<td>
A comma-seperated list of package names, used when
<a href="page-class.html">searching for the page
class</a>
@@ -592,6 +600,7 @@
<tr>
<td>org.apache.tapestry.servlet-path</td>
+ <td>/app</td>
<td>
Defines the servlet path used when constructing URLs.
The default value is
<code>/app</code>
@@ -608,7 +617,7 @@
<tr>
<td>org.apache.tapestry.template-encoding</td>
-
+ <td>ISO-8859-1</td>
<td>
Defines the character set used by the application
templates. The default
value is ISO-8859-1.
@@ -626,7 +635,7 @@
<tr>
<td>org.apache.tapestry.template-extension</td>
-
+ <td>html</td>
<td>
Overrides the default extension used to locate
templates for pages or
components. The default extension is "html", this
configuration property
@@ -660,7 +669,7 @@
<tr>
<td>org.apache.tapestry.607-patch</td>
-
+ <td>false</td>
<td>
A workaround for
<a
href="http://issues.apache.org/jira/browse/TAPESTRY-607">TAPESTRY-607</a>
@@ -676,7 +685,7 @@
<tr>
<td>org.apache.tapestry.visit-class</td>
-
+ <td>java.util.HashMap</td>
<td>
The fully qualified class name to instantiate as the
<a href="index.html#intro.engine-service-visit">Visit
object</a>
@@ -694,10 +703,37 @@
</td>
</tr>
+ <tr>
+ <td>org.apache.tapestry.renderTags</td>
+ <td>true</td>
+ <td>
+ Whether or not some block level components will render
their template
+ tag names by default.
+
+ <p>
+ This currently affects only the <a
href="../components/general/if.html">If</a> and
+ <a href="../components/general/else.html">Else</a>
components but is expected
+ to be applied to <a
href="../components/general/for.html">For</a> as well.
+ </p>
+
+ <p>
+ For example, with the default value of true - the
following h2 element tag would
+ be printed out literally as specified:
+ </p>
+
+<source><![CDATA[
+<h2 jwcid="@If" condition="true">
+This is a header
+</h2>
+]]></source>
+ </td>
+ </tr>
+
+ </tbody>
</table>
- </section><!-- configuration.properties -->
+ </subsection><!-- configuration.properties -->
- <section name="Application extensions">
+ <subsection name="Application extensions">
<span class="warn">
@@ -834,7 +870,8 @@
<tr>
-
<td>org.apache.tapestry.specification-resolver-delegate</td>
+ <td>org.apache.tapestry.
+ specification-resolver-delegate</td>
<td>
<a
href="../tapestry-framework/apidocs/org/apache/tapestry/resolver/ISpecificationResolverDelegate.html">
@@ -853,7 +890,8 @@
<tr>
- <td>org.apache.tapestry.template-source-delegate</td>
+ <td>org.apache.tapestry.
+ template-source-delegate</td>
<td>
<a
href="../tapestry-framework/apidocs/org/apache/tapestry/engine/ITemplateSourceDelegate.html">
@@ -886,7 +924,7 @@
</table>
- </section><!-- configuration.extensions -->
+ </subsection><!-- configuration.extensions -->
</section>
Modified:
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application
(original)
+++
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/timetracker.application
Sun Oct 29 14:49:43 2006
@@ -20,7 +20,7 @@
"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
<application name="Tapestry TimeTracker">
-
+
<library id="contrib"
specification-path="classpath:/org/apache/tapestry/contrib/Contrib.library"/>
</application>
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
Sun Oct 29 14:49:43 2006
@@ -180,7 +180,7 @@
<provider prefix="global-property"
service-id="GlobalPropertyObjectProvider"/>
<provider prefix="app-property"
service-id="ApplicationPropertyObjectProvider"/>
</contribution>
-
+
<contribution configuration-id="hivemind.FactoryDefaults">
<default symbol="org.apache.tapestry.engine-class"
value="org.apache.tapestry.engine.BaseEngine"/>
<default symbol="org.apache.tapestry.visit-class"
value="java.util.HashMap"/>
@@ -190,7 +190,8 @@
<default symbol="org.apache.tapestry.template-extension" value="html"/>
<default symbol="org.apache.tapestry.jwcid-attribute-name" value="jwcid"/>
<default symbol="org.apache.tapestry.default-binding-prefix"
value="ognl"/>
- </contribution>
+ <default symbol="org.apache.tapestry.renderTags" value="true" />
+ </contribution>
<!-- This may need to be converted into an IPropertySource and injected into
the ApplicationPropertySources
chain. -->
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Tapestry.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Tapestry.java?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Tapestry.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/Tapestry.java
Sun Oct 29 14:49:43 2006
@@ -209,16 +209,6 @@
public static final String SIMPLE_PROPERTY_NAME_PATTERN =
"^_?[a-zA-Z]\\w*$";
/**
- * Name of an application extension used as a factory for
- * [EMAIL PROTECTED] org.apache.tapestry.engine.IMonitor}instances. The
extension must implement
- * [EMAIL PROTECTED] org.apache.tapestry.engine.IMonitorFactory}.
- *
- * @since 3.0
- */
-
- public static final String MONITOR_FACTORY_EXTENSION_NAME =
"org.apache.tapestry.monitor-factory";
-
- /**
* Class name of an [EMAIL PROTECTED] ognl.TypeConverter}implementing
class to use as a type converter for
* [EMAIL PROTECTED] org.apache.tapestry.binding.ExpressionBinding}.
*/
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Else.jwc
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Else.jwc?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Else.jwc
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/Else.jwc
Sun Oct 29 14:49:43 2006
@@ -25,8 +25,8 @@
Conditionally emulates an element and its attributes and/or includes a block
of content
if the condition of the previous If component evaluates to false.
</description>
-
- <parameter name="renderTag" default-value="true" />
+
+ <parameter name="renderTag" default-value="ognl:defaultRenderTags" />
<parameter name="element" deprecated="yes" >
<description>
@@ -34,5 +34,7 @@
whether or not to render the tag.
</description>
</parameter>
+
+ <inject property="defaultRenderTags"
object="app-property:org.apache.tapestry.renderTags" />
</component-specification>
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/If.jwc
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/If.jwc?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/If.jwc
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/If.jwc
Sun Oct 29 14:49:43 2006
@@ -41,7 +41,7 @@
<parameter name="listener"/>
- <parameter name="renderTag" default-value="true" />
+ <parameter name="renderTag" default-value="ognl:defaultRenderTags" />
<parameter name="element" deprecated="yes" >
<description>
@@ -61,6 +61,7 @@
<property name="name"/>
<property name="form"/>
+ <inject property="defaultRenderTags"
object="app-property:org.apache.tapestry.renderTags" />
<inject property="dataSqueezer" object="service:tapestry.data.DataSqueezer"/>
<inject property="listenerInvoker" object="infrastructure:listenerInvoker"/>
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/components/IfBean.java
Sun Oct 29 14:49:43 2006
@@ -34,8 +34,6 @@
{
public static final String IF_VALUE_ATTRIBUTE =
"org.mb.tapestry.base.IfValue";
- public static final String SPAN_TAG = "span";
-
private boolean _rendering = false;
private boolean _conditionValue;
@@ -51,11 +49,11 @@
public abstract boolean getRenderTag();
public abstract IActionListener getListener();
-
+
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
boolean cycleRewinding = cycle.isRewinding();
-
+
// form may be null if component is not located in a form
IForm form = (IForm) cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE);
@@ -83,14 +81,14 @@
{
String element = HiveMind.isNonBlank(getElement()) ?
getElement() : getTemplateTagName();
- boolean render = !cycleRewinding && getRenderTag() &&
!SPAN_TAG.equalsIgnoreCase(element);
+ boolean render = !cycleRewinding && getRenderTag();
if (render)
{
writer.begin(element);
renderInformalParameters(writer, cycle);
}
-
+
renderBody(writer, cycle);
if (render)
@@ -104,7 +102,7 @@
cycle.setAttribute(IF_VALUE_ATTRIBUTE, new Boolean(_conditionValue));
}
-
+
protected boolean evaluateCondition(IRequestCycle cycle, IForm form,
boolean cycleRewinding)
{
boolean condition;
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ResponseBuilder.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ResponseBuilder.java?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ResponseBuilder.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ResponseBuilder.java
Sun Oct 29 14:49:43 2006
@@ -19,9 +19,6 @@
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRender;
import org.apache.tapestry.IRequestCycle;
-import org.apache.tapestry.PageRenderSupport;
-import org.apache.tapestry.services.impl.DojoAjaxResponseBuilder;
-
/**
* Represents the service responsible for managing all content output that is
sent
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/spec/LibrarySpecification.java
Sun Oct 29 14:49:43 2006
@@ -433,34 +433,6 @@
}
/**
- * Returns the services.
- *
- * @return Map of service class names.
- * @deprecated To be removed in release 4.1.
- */
-
- protected Map getServices()
- {
- return Collections.EMPTY_MAP;
- }
-
- /**
- * Updates the services map.
- *
- * @param services
- * A Map of the fully qualified names of classes which implement
- * [EMAIL PROTECTED]
org.apache.tapestry.engine.IEngineService}keyed on
- * service id.
- * <p>
- * The map is retained, not copied.
- * @deprecated To be removed in release 4.1.
- */
-
- protected void setServices(Map services)
- {
- }
-
- /**
* Returns the components map.
*
* @return Map of [EMAIL PROTECTED] IContainedComponent}.
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/components/TestIfElse.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/components/TestIfElse.java?view=diff&rev=469021&r1=469020&r2=469021
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/components/TestIfElse.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/components/TestIfElse.java
Sun Oct 29 14:49:43 2006
@@ -426,106 +426,6 @@
verify();
}
- public void test_Render_Span_False()
- {
- IRequestCycle cycle = newMock(IRequestCycle.class);
-
- IMarkupWriter writer = newBufferWriter();
-
- IfBean conditional = newInstance(IfBean.class,
- new Object[] { "condition", Boolean.TRUE,
- "templateTagName", "span",
- "renderTag", Boolean.TRUE
- });
-
- ElseBean reverse = (ElseBean) newInstance(ElseBean.class);
-
- expect(cycle.renderStackPush(conditional)).andReturn(conditional);
-
- expect(cycle.isRewinding()).andReturn(false);
-
-
expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(null);
-
- trainResponseBuilder(cycle, writer);
-
- IRender body = newRender(writer, cycle);
-
- cycle.setAttribute(IfBean.IF_VALUE_ATTRIBUTE, Boolean.TRUE);
-
- expect(cycle.renderStackPop()).andReturn(conditional);
-
- expect(cycle.renderStackPush(reverse)).andReturn(reverse);
-
-
expect(cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE)).andReturn(Boolean.TRUE);
-
- expect(cycle.renderStackPop()).andReturn(reverse);
-
- IRender body2 = newRender();
-
- replay();
-
- conditional.addBody(body);
-
- conditional.render(writer, cycle);
-
- reverse.addBody(body2);
- reverse.render(writer, cycle);
-
- verify();
-
- assertBuffer("");
- }
-
- public void test_Render_Div_Tag()
- {
- IRequestCycle cycle = newMock(IRequestCycle.class);
-
- IMarkupWriter writer = newBufferWriter();
-
- IfBean conditional = newInstance(IfBean.class,
- new Object[] { "condition", Boolean.TRUE,
- "templateTagName", "div",
- "renderTag", Boolean.TRUE
- });
-
- ElseBean reverse = (ElseBean) newInstance(ElseBean.class);
-
- expect(cycle.renderStackPush(conditional)).andReturn(conditional);
-
- expect(cycle.isRewinding()).andReturn(false);
-
-
expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(null);
-
- trainResponseBuilder(cycle, writer);
-
- IRender body = newRender(writer, cycle);
-
- cycle.setAttribute(IfBean.IF_VALUE_ATTRIBUTE, Boolean.TRUE);
-
- expect(cycle.renderStackPop()).andReturn(conditional);
-
- expect(cycle.renderStackPush(reverse)).andReturn(reverse);
-
-
expect(cycle.getAttribute(IfBean.IF_VALUE_ATTRIBUTE)).andReturn(Boolean.TRUE);
-
- expect(cycle.renderStackPop()).andReturn(reverse);
-
- IRender body2 = newRender();
-
- replay();
-
- conditional.addBody(body);
-
- conditional.render(writer, cycle);
-
- reverse.addBody(body2);
- reverse.render(writer, cycle);
-
- verify();
-
- assertBuffer("<div></div>");
- }
-
public static abstract class TestIfBean extends IfBean
{
public TestIfBean() {