Author: tedst
Date: Sat Apr 5 18:36:34 2008
New Revision: 645194
URL: http://svn.apache.org/viewvc?rev=645194&view=rev
Log:
Integration and unit tests for TAPESTRY-2333 was added
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ActionDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/nested/ActionDemo.java
Modified:
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
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestPathOptimizerImplTest.java
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ActionDemo.tml
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ActionDemo.tml?rev=645194&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ActionDemo.tml
(added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/nested/ActionDemo.tml
Sat Apr 5 18:36:34 2008
@@ -0,0 +1,23 @@
+<html t:type="Border"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+ <t:if test="number">
+ <p>
+ <strong>
+ <span id="message">Number: ${number}</span>
+ </strong>
+ </p>
+ </t:if>
+
+ <p>
+ Choose a number:
+
+ <ul>
+ <t:loop source="1..3" value="var:currentNumber">
+ <li>
+ <t:actionlink t:id="actionlink"
context="var:currentNumber">${var:currentNumber}</t:actionlink>
+ </li>
+ </t:loop>
+ </ul>
+ </p>
+
+</html>
\ No newline at end of file
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=645194&r1=645193&r2=645194&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 Apr 5 18:36:34 2008
@@ -1439,6 +1439,19 @@
}
/**
+ * TAPESTRY-2333
+ */
+ @Test
+ public void action_links_on_custom_url()
+ {
+ open(BASE_URL + "nested/actiondemo/");
+
+ clickAndWait("link=2");
+
+ assertTextPresent("Number: 2");
+ }
+
+ /**
* TAPESTRY-1598
*/
@Test
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=645194&r1=645193&r2=645194&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 Apr 5 18:36:34 2008
@@ -84,6 +84,8 @@
new Item("nested/AssetDemo", "AssetDemo", "declaring an image
using Assets"),
+ new Item("nested/ActionDemo", "Action With Context Demo", "using
action links with context on page with activation context"),
+
new Item("blockdemo", "BlockDemo", "use of blocks to control
rendering"),
new Item("countdown", "Countdown Page", "defining component using
@Component annotation"),
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/nested/ActionDemo.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/nested/ActionDemo.java?rev=645194&view=auto
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/nested/ActionDemo.java
(added)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/nested/ActionDemo.java
Sat Apr 5 18:36:34 2008
@@ -0,0 +1,40 @@
+// Copyright 2006, 2007 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.nested;
+
+import org.apache.tapestry.annotations.OnEvent;
+import org.apache.tapestry.annotations.Property;
+
+public class ActionDemo
+{
+ @Property
+ private Long number;
+
+ @OnEvent(component="actionlink", value="action")
+ public void onAction(Long number)
+ {
+ this.number = number;
+ }
+
+ public void onActivate(Long number)
+ {
+ this.number = number;
+ }
+
+ public Long onPassivate()
+ {
+ return number;
+ }
+}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestPathOptimizerImplTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestPathOptimizerImplTest.java?rev=645194&r1=645193&r2=645194&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestPathOptimizerImplTest.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestPathOptimizerImplTest.java
Sat Apr 5 18:36:34 2008
@@ -83,6 +83,10 @@
// TAPESTRY-2095
{"", "/", "/component:event", "/component:event"},
+
+ // TAPESTRY-2333
+
+ {"", "/nested/actiondemo/", "/nested/actiondemo.actionlink/2",
"../actiondemo.actionlink/2"},
// Make sure the ./ prefix is added even when the relative
path doesn't contain
// a slash ... otherwise, invalid URL component:event (i.e.,
"component" protocol, not "http").