Author: hlship
Date: Sun Nov 20 07:37:47 2005
New Revision: 345747
URL: http://svn.apache.org/viewcvs?rev=345747&view=rev
Log:
TAPESTRY-759: Body.get(cycle) throws exception
Added:
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/html/BodyTest.java
Modified:
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/Body.java
jakarta/tapestry/trunk/status.xml
Modified:
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/Body.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/Body.java?rev=345747&r1=345746&r2=345747&view=diff
==============================================================================
---
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/Body.java
(original)
+++
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/Body.java
Sun Nov 20 07:37:47 2005
@@ -109,7 +109,7 @@
public static Body get(IRequestCycle cycle)
{
- return (Body) TapestryUtils.getPageRenderSupport(cycle, null);
+ return (Body) TapestryUtils.getOptionalPageRenderSupport(cycle);
}
protected void prepareForRender(IRequestCycle cycle)
Added:
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/html/BodyTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/html/BodyTest.java?rev=345747&view=auto
==============================================================================
---
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/html/BodyTest.java
(added)
+++
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/html/BodyTest.java
Sun Nov 20 07:37:47 2005
@@ -0,0 +1,55 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.html;
+
+import org.apache.tapestry.BaseComponentTestCase;
+import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.TapestryUtils;
+
+/**
+ * A scattering of tests for the [EMAIL PROTECTED]
org.apache.tapestry.html.Body} component.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class BodyTest extends BaseComponentTestCase
+{
+ public void testGetNoBodyReturnsNull()
+ {
+ IRequestCycle cycle = newCycle();
+
+ trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE,
null);
+
+ replayControls();
+
+ assertNull(Body.get(cycle));
+
+ verifyControls();
+ }
+
+ public void testGetReturnsBody()
+ {
+ Body body = (Body) newInstance(Body.class);
+ IRequestCycle cycle = newCycle();
+
+ trainGetAttribute(cycle, TapestryUtils.PAGE_RENDER_SUPPORT_ATTRIBUTE,
body);
+
+ replayControls();
+
+ assertSame(body, Body.get(cycle));
+
+ verifyControls();
+ }
+}
Modified: jakarta/tapestry/trunk/status.xml
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/status.xml?rev=345747&r1=345746&r2=345747&view=diff
==============================================================================
--- jakarta/tapestry/trunk/status.xml (original)
+++ jakarta/tapestry/trunk/status.xml Sun Nov 20 07:37:47 2005
@@ -59,6 +59,7 @@
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-752">XTile service
passes null list of listener parameters to listener method</action>
<action type="update" dev="HLS">Make the logic for localizing resources
extensible</action>
<action type="update" dev="HLS">More work on the QuickStart
documentation</action>
+ <action type="fix" dev="HLS" fixes-bug="TAPESTRY-759">Body.get(cycle)
throws exception</action>
</release>
<release version="4.0-beta-13" date="Nov 12 2005">
<action type="update" dev="HLS">Switch to HiveMind 1.1 (final)</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]