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 2011/12/23 19:55:21 UTC

svn commit: r1222792 - in /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1: CoreBehaviorsTests.java pages/Datum.java pages/ProtectedFields.java

Author: hlship
Date: Fri Dec 23 18:55:20 2011
New Revision: 1222792

URL: http://svn.apache.org/viewvc?rev=1222792&view=rev
Log:
TAP5-1801: Allow non-public fields in instrumented classes

Update some tests, due to non-private fields being allowed now

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Datum.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProtectedFields.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java?rev=1222792&r1=1222791&r2=1222792&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java Fri Dec 23 18:55:20 2011
@@ -936,13 +936,13 @@ public class CoreBehaviorsTests extends 
      * TAPESTRY-2196
      */
     @Test
-    public void protected_field_in_page_class()
+    public void public_field_in_page_class()
     {
         openLinks("Protected Fields Demo", "Trigger the Exception");
 
         assertTextPresent(
                 "An unexpected application exception has occurred.",
-                "Field _field of class org.apache.tapestry5.integration.app1.pages.ProtectedFields is not private. Class transformation requires that all instance fields be private.");
+                "Field _field of class org.apache.tapestry5.integration.app1.pages.ProtectedFields must be instrumented, and may not be public.");
     }
 
     /**
@@ -955,7 +955,7 @@ public class CoreBehaviorsTests extends 
     {
         openLinks("Class Transformation Exception Demo");
 
-        assertTextPresent("Field _value of class org.apache.tapestry5.integration.app1.pages.Datum is not private. Class transformation requires that all instance fields be private.");
+        assertTextPresent("Field _value of class org.apache.tapestry5.integration.app1.pages.Datum must be instrumented, and may not be public.");
     }
 
     @Test

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Datum.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Datum.java?rev=1222792&r1=1222791&r2=1222792&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Datum.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Datum.java Fri Dec 23 18:55:20 2011
@@ -19,7 +19,9 @@ package org.apache.tapestry5.integration
  */
 public class Datum
 {
-    protected int _value;
+    // This will be instrumented as with any Tapestry component field, and that will fail as the field may not
+    // be public.
+    public int _value;
 
     public int getValue()
     {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProtectedFields.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProtectedFields.java?rev=1222792&r1=1222791&r2=1222792&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProtectedFields.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ProtectedFields.java Fri Dec 23 18:55:20 2011
@@ -19,7 +19,8 @@ package org.apache.tapestry5.integration
  */
 public class ProtectedFields
 {
-    protected String _field;
+    // Until Tapestry 5.4, component fields had to be private. Starting in 5.4, they merely must not be public.
+    public String _field;
 
     public String getField()
     {