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:21:03 UTC

svn commit: r903135 - in /tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test: app1/ java/org/apache/tapestry5/integration/ java/org/apache/tapestry5/integration/app1/pages/ resources/org/apache/tapestry5/integration/app1/pages/

Author: uli
Date: Tue Jan 26 09:21:02 2010
New Revision: 903135

URL: http://svn.apache.org/viewvc?rev=903135&view=rev
Log:
TAP5-991: BeanDisplay doesn't use Messages for displaying enum properties - make sure it really does.

Added:
    tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml
    tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java
    tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties
Modified:
    tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
    tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java

Added: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml?rev=903135&view=auto
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml (added)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/BeanDisplayEnumDemo.tml Tue Jan 26 09:21:02 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/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=903135&r1=903134&r2=903135&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Tue Jan 26 09:21:02 2010
@@ -3082,5 +3082,13 @@
         clickAndWait("link=nested tml file");
         assertTextPresent("HTTP ERROR: 404");
     }
+    
+    /** TAP5-991 */
+    public void bean_display_enum_value_from_messages()
+    {
+        start("BeanDisplay Enum Demo");
+        
+        assertText("//dd[2]", "Ultra Important");
+    }
 
 }

Added: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java?rev=903135&view=auto
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java (added)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.java Tue Jan 26 09:21:02 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/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java?rev=903135&r1=903134&r2=903135&view=diff
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java (original)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Tue Jan 26 09:21:02 2010
@@ -356,7 +356,10 @@
             
             new Item("SelectZoneDemo", "Select Zone Demo", "Use a Select component to update a zone."),
 
-            new Item("AssetProtectionDemo", "Asset Protection Demo", "AssetProtectionDispatcher is properly contributed and functioning")
+            new Item("AssetProtectionDemo", "Asset Protection Demo", "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/branches/5.1.0.x-dev/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties?rev=903135&view=auto
==============================================================================
--- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties (added)
+++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BeanDisplayEnumDemo.properties Tue Jan 26 09:21:02 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.
+
+high=Ultra Important