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/03/01 18:40:19 UTC

svn commit: r632630 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/components/ site/apt/guide/ test/app1/ test/java/org/apache/tapestry/integration/ test/java/org/apache/tapestry/integration/app1/pages/

Author: hlship
Date: Sat Mar  1 09:40:15 2008
New Revision: 632630

URL: http://svn.apache.org/viewvc?rev=632630&view=rev
Log:
TAPESTRY-2196: Protected field in a component class does not generate an understandable exception, instead NoClassDefFound

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/IndirectProtectedFields.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ProtectedFields.java
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.xdoc
    tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/ajax.apt
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
    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

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.xdoc?rev=632630&r1=632629&r2=632630&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/FormFragment.xdoc Sat Mar  1 09:40:15 2008
@@ -6,6 +6,9 @@
                 <li>
                     <a href="Form.html">Form</a>
                 </li>
+                <li>
+                    <a href="../mixins/TriggerFragment.html">TriggerFragment</a>
+                </li>
             </ul>
         </section>
 
@@ -79,7 +82,7 @@
 </html>]]></source>
 
                 <p>
-                    The separateShipTo property is initially null, to the FormFragment is initially invisible. The
+                    The separateShipTo property is initially null, so the FormFragment is initially invisible. The
                     BeanEditor
                     and all of the individual fields are rendered, but the &lt;div&gt; for the FormFragment is simply
                     invisible.
@@ -143,7 +146,7 @@
             <p>
                 The OrderAddress page is largely just a holder of the properties (for simplicity in this example,
                 there is no event handler for the success event, nor are we going into other details that would
-                reflecting in a real application).
+                be reflected in a real application).
             </p>
 
             <p>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/ajax.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/ajax.apt?rev=632630&r1=632629&r2=632630&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/ajax.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/guide/ajax.apt Sat Mar  1 09:40:15 2008
@@ -18,9 +18,9 @@
 
 Changes to Prototype
 
-  Tapestry currently uses a slightly patched version of
+  Tapestry currently uses
   {{{http://www.thebungeebook.net/wp-content/uploads/2008/01/prototype-1601.js}Prototype 1.6.0.1}}.  Version 1.6.0.2
-  appears to have some issues supporting Internet Explorer.  Tapestry's version is slightly patch
+  appears to have some issues supporting Internet Explorer.  Tapestry's version is slightly patched
   for {{{https://issues.apache.org/jira/browse/TAPESTRY-2108}TAPESTRY-2108}}.
 
 Changes to Scriptaculous
@@ -318,7 +318,7 @@
 
   The possible return values are:
 
-  * A Block or Component to render as the response.  The response will be a JSON hash, will a "content" key
+  * A Block or Component to render as the response.  The response will be a JSON hash, with a "content" key
     whose value is the rendered markup.  This is the basis for updates with the Zone component.
 
   * A {{{../../apidocs/org/apache/tapestry/json/JSONObject.html}JSONObject}}, which will be sent as the response.
@@ -326,9 +326,5 @@
   * A {{{../../apidocs/org/apache/tapestry/StreamResponse.html}StreamResponse}}, which will be sent as the response.
 
   []
-
-  In the case of a  Block or Component, the rendering occurs but is packaged up as a JSON response.
-  The JSON response contains a single map containing a single key: "content" whose value is the markup
-  generated from the component or block.
 
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml?rev=632630&r1=632629&r2=632630&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml Sat Mar  1 09:40:15 2008
@@ -49,7 +49,11 @@
         <li>
             <t:pagelink page="listeventcontextdemo" context="demoContext">List Event Context Demo</t:pagelink>
             -- using a List for catch-all event context parameters
+        </li>
 
+        <li>
+            <a href="indirectprotectedfields">Protected Fields Demo</a>
+            -- page that contains protected fields
         </li>
 
     </ul>

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=632630&r1=632629&r2=632630&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 Sat Mar  1 09:40:15 2008
@@ -1244,10 +1244,10 @@
         // HTML entities.
         click("select_0");
 
-          // And that's as far as we can go currently, because
+        // And that's as far as we can go currently, because
         // of limitations in Selenium 0.8.3 and bugs in Selenium 0.9.2.
 
-       // assertTextPresent("Selected: Mr. &lt;Roboto&gt;");
+        // assertTextPresent("Selected: Mr. &lt;Roboto&gt;");
 
         click("link=Direct JSON response");
     }
@@ -1759,6 +1759,7 @@
      * TAPESTRY-2150.  Also demonstrates how to add a ValueEncoder for an entity object, to allow seamless encoding of
      * the entity's id into the URL.
      */
+    @Test
     public void nested_page_names()
     {
         start("Music Page", "2");
@@ -1773,6 +1774,7 @@
     /**
      * TAPESTRY-1869
      */
+    @Test
     public void null_fields_and_bean_editor()
     {
         start("Number BeanEditor Demo");
@@ -1793,6 +1795,7 @@
     /**
      * TAPESTRY-1999
      */
+    @Test
     public void list_as_event_context()
     {
         start("List Event Context Demo");
@@ -1800,6 +1803,7 @@
         assertTextSeries("//ul[@id='eventcontext']/li[%d]", 1, "1", "2", "3");
     }
 
+    @Test
     public void form_injector()
     {
         start("FormInjector Demo");
@@ -1817,6 +1821,18 @@
         clickAndWait(SUBMIT);
 
         assertText("sum", "5.1");
+    }
+
+    /**
+     * TAPESTRY-2196
+     */
+    @Test
+    public void protected_field_in_page_class()
+    {
+        start("Protected Fields Demo");
+
+        assertTextPresent("An unexpected application exception has occurred.",
+                          "Class org.apache.tapestry.integration.app1.pages.ProtectedFields contains field(s) (_field) that are not private. You should change these fields to private, and add accessor methods if needed.");
     }
 
     private void sleep(long timeout)

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/IndirectProtectedFields.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/IndirectProtectedFields.java?rev=632630&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/IndirectProtectedFields.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/IndirectProtectedFields.java Sat Mar  1 09:40:15 2008
@@ -0,0 +1,28 @@
+// 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.InjectPage;
+
+public class IndirectProtectedFields
+{
+    @InjectPage
+    private ProtectedFields _protectedFields;
+
+    Object onActivate()
+    {
+        return _protectedFields;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ProtectedFields.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ProtectedFields.java?rev=632630&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ProtectedFields.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ProtectedFields.java Sat Mar  1 09:40:15 2008
@@ -0,0 +1,33 @@
+// 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;
+
+/**
+ * TAPESTRY-2196
+ */
+public class ProtectedFields
+{
+    protected String _field;
+
+    public String getField()
+    {
+        return _field;
+    }
+
+    public void setField(String field)
+    {
+        _field = field;
+    }
+}

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=632630&r1=632629&r2=632630&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 Sat Mar  1 09:40:15 2008
@@ -268,7 +268,7 @@
     {
         _item = item;
     }
-
+                                                            
     @InjectPage
     private SecurePage _securePage;