You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/02/26 20:38:24 UTC

svn commit: r631353 - in /tapestry/tapestry5/trunk/tapestry-core/src/test: app1/ java/org/apache/tapestry/integration/ java/org/apache/tapestry/integration/app1/data/ java/org/apache/tapestry/integration/app1/pages/

Author: hlship
Date: Tue Feb 26 11:38:21 2008
New Revision: 631353

URL: http://svn.apache.org/viewvc?rev=631353&view=rev
Log:
TAPESTRY-1869: Null Fields and BeanEditForm do not fit together

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanDisplayDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanEditorDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/IntegerHolder.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanDisplayDemo.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanEditorDemo.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanDisplayDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanDisplayDemo.tml?rev=631353&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanDisplayDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanDisplayDemo.tml Tue Feb 26 11:38:21 2008
@@ -0,0 +1,9 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <t:beandisplay object="holder"/>
+
+    <p>
+        <t:pagelink page="numberbeaneditordemo">Back to form</t:pagelink>
+    </p>
+
+</html>
\ No newline at end of file

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanEditorDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanEditorDemo.tml?rev=631353&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanEditorDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/NumberBeanEditorDemo.tml Tue Feb 26 11:38:21 2008
@@ -0,0 +1,13 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <h1>Number BeanEditor Demo</h1>
+
+    <p>
+        Demonstrates that BeanEditor can handle null properties.
+    </p>
+
+
+    <t:beaneditform t:id="holder"/>
+
+
+</html>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=631353&r1=631352&r2=631353&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Tue Feb 26 11:38:21 2008
@@ -1767,4 +1767,22 @@
 
         assertText("activePageName", "music/Details");
     }
+
+    /** TAPESTRY-1869 */
+    public void null_fields_and_bean_editor()
+    {
+        start("Number BeanEditor Demo");
+
+        clickAndWait(SUBMIT);
+
+        // Hard to check for anything here.
+
+        clickAndWait("link=Back to form");
+
+        type("value", "237");
+
+        clickAndWait(SUBMIT);
+
+        assertSourcePresent("<div class=\"t-beandisplay-value\">237</div>");
+    }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/IntegerHolder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/IntegerHolder.java?rev=631353&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/IntegerHolder.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/IntegerHolder.java Tue Feb 26 11:38:21 2008
@@ -0,0 +1,30 @@
+// Copyright 2008 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.integration.app1.data;
+
+public class IntegerHolder
+{
+    private Integer _value;
+
+    public Integer getValue()
+    {
+        return _value;
+    }
+
+    public void setValue(Integer value)
+    {
+        _value = value;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanDisplayDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanDisplayDemo.java?rev=631353&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanDisplayDemo.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanDisplayDemo.java Tue Feb 26 11:38:21 2008
@@ -0,0 +1,36 @@
+// Copyright 2008 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.integration.app1.pages;
+
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.integration.app1.data.IntegerHolder;
+
+public class NumberBeanDisplayDemo
+{
+    @Persist
+    private IntegerHolder _holder;
+
+    Object initialize(IntegerHolder holder)
+    {
+        _holder = holder;
+
+        return this;
+    }
+
+    public IntegerHolder getHolder()
+    {
+        return _holder;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanEditorDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanEditorDemo.java?rev=631353&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanEditorDemo.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/NumberBeanEditorDemo.java Tue Feb 26 11:38:21 2008
@@ -0,0 +1,41 @@
+// Copyright 2008 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.integration.app1.pages;
+
+import org.apache.tapestry.integration.app1.data.IntegerHolder;
+import org.apache.tapestry.annotations.InjectPage;
+
+public class NumberBeanEditorDemo
+{
+    private IntegerHolder _holder;
+
+    @InjectPage
+    private NumberBeanDisplayDemo _page;
+
+    public IntegerHolder getHolder()
+    {
+        return _holder;
+    }
+
+    public void setHolder(IntegerHolder holder)
+    {
+        _holder = holder;
+    }
+
+    Object onSuccess()
+    {
+        return _page.initialize(_holder);
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java?rev=631353&r1=631352&r2=631353&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/Start.java Tue Feb 26 11:38:21 2008
@@ -62,6 +62,8 @@
     private static final List<Item> ITEMS = CollectionFactory.newList(
             new Item("actionpage", "Action Page", "tests fixture for ActionLink component"),
 
+            new Item("numberbeaneditordemo", "Number BeanEditor Demo", "use of nulls and wrapper types with BeanEditor"),
+
             new Item("music", "Music Page", "demo handling of edge cases of page naming"),
 
             new Item("PersistentDemo", "Persistent Demo", "storing and clearing persistent properties"),