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/08/10 19:02:17 UTC

svn commit: r1156264 - in /tapestry/tapestry5/trunk/tapestry-core/src/test: groovy/org/apache/tapestry5/integration/app1/ java/org/apache/tapestry5/integration/app1/pages/ resources/org/apache/tapestry5/integration/app1/pages/

Author: hlship
Date: Wed Aug 10 17:02:17 2011
New Revision: 1156264

URL: http://svn.apache.org/viewvc?rev=1156264&view=rev
Log:
TAP5-1600: Add a test case to show that the bug is not valid

Added:
    tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BlockTests.groovy
Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.tml

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BlockTests.groovy
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BlockTests.groovy?rev=1156264&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BlockTests.groovy (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/BlockTests.groovy Wed Aug 10 17:02:17 2011
@@ -0,0 +1,33 @@
+// Copyright 2011 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
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase
+import org.testng.annotations.Test
+
+class BlockTests extends TapestryCoreTestCase
+{
+    // Test for TAP5-1600
+    @Test
+    void components_inside_blocks_are_visible_as_embedded() {
+
+        openLinks "Component Inside Block Demo"
+
+        // If TAP5-1600 was valid (it neve was), we'd get an exception page,
+        // not the actual page.
+
+        assertText "testtitle", "Component Inside Block"
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.java?rev=1156264&r1=1156263&r2=1156264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.java Wed Aug 10 17:02:17 2011
@@ -1,6 +1,8 @@
 package org.apache.tapestry5.integration.app1.pages;
 
+import org.apache.tapestry5.EventConstants;
 import org.apache.tapestry5.alerts.AlertManager;
+import org.apache.tapestry5.annotations.OnEvent;
 import org.apache.tapestry5.ioc.annotations.Inject;
 
 public class ComponentInsideBlockDemo
@@ -8,7 +10,14 @@ public class ComponentInsideBlockDemo
     @Inject
     private AlertManager mgr;
 
-    void onActionFromGoForBroke() {
+    void onActionFromGoForBroke()
+    {
         mgr.info("Go For Broke Clicked");
     }
+
+    @OnEvent(component = "neverForm", value = EventConstants.SUBMIT)
+    void neverFormSubmitted()
+    {
+        mgr.info("Never Form Submitted. How?");
+    }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.tml?rev=1156264&r1=1156263&r2=1156264&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ComponentInsideBlockDemo.tml Wed Aug 10 17:02:17 2011
@@ -1,12 +1,26 @@
 <html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
 
-    <t:delegate to="block:zen"/>
+<h2 id="testtitle">Component Inside Block</h2>
 
-    <t:block id="zen">
+<p>
+    Test to show that TAP5-1600 is not valid.
+</p>
 
-            <t:actionlink t:id="goForBroke">go for broke</t:actionlink>
+<t:delegate to="block:zen"/>
 
-    </t:block>
+<t:block id="zen">
+
+    <t:actionlink t:id="goForBroke">go for broke</t:actionlink>
+
+</t:block>
+
+<t:block id="never">
+
+    <t:form t:id="neverForm">
+        <input type="submit" value="Never Form Submit"/>
+    </t:form>
+
+</t:block>
 
 
 </html>