You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by ul...@apache.org on 2010/01/26 10:18:48 UTC
svn commit: r903134 - in /tapestry/tapestry5/trunk/tapestry-core/src/test:
app1/ java/org/apache/tapestry5/integration/app1/
java/org/apache/tapestry5/integration/app1/pages/
resources/org/apache/tapestry5/integration/app1/pages/
Author: uli
Date: Tue Jan 26 09:18:45 2010
New Revision: 903134
URL: http://svn.apache.org/viewvc?rev=903134&view=rev
Log:
TAP5-991: BeanDisplay doesn't use Messages for displaying enum properties - make sure it really does.
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml?rev=903134&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml Tue Jan 26 09:18:45 2010
@@ -0,0 +1,7 @@
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <h1>BeanDisplay Enum Demo</h1>
+
+ <t:beandisplay object="prop:object" />
+
+</html>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java?rev=903134&r1=903133&r2=903134&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/BeanEditorTests.java Tue Jan 26 09:18:45 2010
@@ -198,4 +198,12 @@
assertTextPresent("Bean class from context is: " + RegistrationData.class.getName());
}
+
+ /** TAP5-991 */
+ public void bean_display_enum_value_from_messages()
+ {
+ start("BeanDisplay Enum Demo");
+
+ assertText("//dd[2]", "Ultra Important");
+ }
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java?rev=903134&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java Tue Jan 26 09:18:45 2010
@@ -0,0 +1,36 @@
+// Copyright 2010 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.tapestry5.integration.app1.pages;
+
+import org.apache.tapestry5.integration.app1.data.ToDoItem;
+import org.apache.tapestry5.integration.app1.data.Urgency;
+
+/**
+ * Used to demonstrate the built-in support for enum types.
+ */
+public class BeanDisplayEnumDemo
+{
+ public ToDoItem getObject()
+ {
+ ToDoItem item = new ToDoItem();
+
+ item.setId(1);
+ item.setOrder(1);
+ item.setTitle("Develop Faster-Than-Light Travel");
+ item.setUrgency(Urgency.HIGH);
+
+ return item;
+ }
+}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=903134&r1=903133&r2=903134&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Tue Jan 26 09:18:45 2010
@@ -457,7 +457,10 @@
"Use a Select component to update a zone."),
new Item("AssetProtectionDemo", "Asset Protection Demo",
- "AssetProtectionDispatcher is properly contributed and functioning")
+ "AssetProtectionDispatcher is properly contributed and functioning"),
+
+ new Item("BeanDisplayEnumDemo", "BeanDisplay Enum Demo",
+ "User represenation of enum values is correctly read from messages")
);
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties?rev=903134&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties Tue Jan 26 09:18:45 2010
@@ -0,0 +1,15 @@
+# Copyright 2010 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.
+
+Urgency.high=Ultra Important