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 2010/06/03 01:37:27 UTC
svn commit: r950827 - in /tapestry/tapestry5/trunk/tapestry-core/src/test:
conf/ java/org/apache/tapestry5/integration/linktrans/
java/org/apache/tapestry5/integration/linktrans/components/
java/org/apache/tapestry5/integration/linktrans/pages/ java/or...
Author: hlship
Date: Wed Jun 2 23:37:26 2010
New Revision: 950827
URL: http://svn.apache.org/viewvc?rev=950827&view=rev
Log:
TAP5-1042: Add integration test for the LinkTransformer
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/
tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/
tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml (with props)
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/Layout.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/Index.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/View.tml
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml?rev=950827&r1=950826&r2=950827&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/conf/testng.xml Wed Jun 2 23:37:26 2010
@@ -106,6 +106,16 @@
</classes>
</test>
+ <test name="LinkTransformer Tests" enabled="true">
+ <parameter name="tapestry.web-app-folder" value="src/test/linktrans"/>
+ <packages>
+ <package name="org.apache.tapestry5.integration.linktrans"/>
+ </packages>
+ <classes>
+ <class name="org.apache.tapestry5.test.SeleniumLauncher"/>
+ </classes>
+ </test>
+
<test name="PageTester Tests" enabled="true">
<packages>
<package name="org.apache.tapestry5.integration.pagetester"/>
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,55 @@
+// 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.linktrans;
+
+import org.apache.tapestry5.integration.TapestryCoreTestCase;
+import org.testng.annotations.Test;
+
+public class LinkTransformerIntegrationTest extends TapestryCoreTestCase
+{
+ @Test
+ public void page_render_links()
+ {
+ open(getBaseURL());
+
+ clickAndWait("link=View Toys");
+
+ assertText("content", "toys");
+ assertText("count", "0");
+
+ clickAndWait("link=back to index");
+ clickAndWait("link=View Games");
+
+ assertText("content", "games");
+ }
+
+ @Test
+ public void component_event_links()
+ {
+ open(getBaseURL());
+
+ clickAndWait("link=en");
+
+ assertText("currentLocale", "en");
+
+ clickAndWait("link=View Games");
+ assertText("content", "games");
+
+ clickAndWait("link=increment");
+
+ assertText("content", "games");
+ assertText("count", "1");
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/LinkTransformerIntegrationTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,43 @@
+// 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.linktrans.components;
+
+import java.util.Locale;
+
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.func.F;
+import org.apache.tapestry5.func.Flow;
+import org.apache.tapestry5.func.Mapper;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.services.LocalizationSetter;
+
+public class Layout
+{
+ @Inject
+ private LocalizationSetter ls;
+
+ @Property
+ private String localeName;
+
+ public Flow<String> getLocaleNames()
+ {
+ return F.flow(ls.getSupportedLocales()).map(F.<Locale> stringValueOf());
+ }
+
+ void onLocale(String localeName)
+ {
+ ls.setLocaleFromLocaleName(localeName);
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/components/Layout.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,20 @@
+// 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.linktrans.pages;
+
+public class Index
+{
+
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/Index.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,40 @@
+// 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.linktrans.pages;
+
+import org.apache.tapestry5.annotations.PageActivationContext;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+
+public class View
+{
+ @PageActivationContext
+ @Property
+ private String content;
+
+ @Persist
+ @Property
+ private int count;
+
+ void pageReset()
+ {
+ count = 0;
+ }
+
+ void onActionFromIncrement()
+ {
+ count++;
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/pages/View.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,120 @@
+// 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.linktrans.services;
+
+import java.util.Locale;
+
+import org.apache.tapestry5.EventContext;
+import org.apache.tapestry5.Link;
+import org.apache.tapestry5.internal.EmptyEventContext;
+import org.apache.tapestry5.internal.services.ArrayEventContext;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.services.TypeCoercer;
+import org.apache.tapestry5.services.ComponentEventRequestParameters;
+import org.apache.tapestry5.services.LocalizationSetter;
+import org.apache.tapestry5.services.PersistentLocale;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.linktransform.ComponentEventLinkTransformer;
+
+public class AppComponentEventLinkTransformer implements ComponentEventLinkTransformer
+{
+ @Inject
+ private PersistentLocale persistentLocale;
+
+ @Inject
+ private TypeCoercer typeCoercer;
+
+ @Inject
+ private LocalizationSetter localizationSetter;
+
+ public ComponentEventRequestParameters decodeComponentEventRequest(Request request)
+ {
+ if (!request.getPath().equals("/event"))
+ return null;
+
+ String localeName = request.getParameter("x:locale");
+ String pageName = request.getParameter("x:page");
+ String container = request.getParameter("x:container");
+ String id = request.getParameter("x:id");
+ String pac = request.getParameter("x:pac");
+ String ec = request.getParameter("x:ec");
+ String type = request.getParameter("x:type");
+
+ if (localeName != null)
+ localizationSetter.setLocaleFromLocaleName(localeName);
+
+ return new ComponentEventRequestParameters(pageName, container == null ? pageName : container, id, type,
+ toContext(pac), toContext(ec));
+ }
+
+ private EventContext toContext(String value)
+ {
+ if (value == null)
+ return new EmptyEventContext();
+
+ return new ArrayEventContext(typeCoercer, (Object[]) value.split("/"));
+ }
+
+ public Link transformComponentEventLink(Link defaultLink, ComponentEventRequestParameters parameters)
+ {
+ Link link = defaultLink.copyWithBasePath("/event");
+
+ for (String name : defaultLink.getParameterNames())
+ {
+ link.removeParameter(name);
+ }
+
+ Locale locale = persistentLocale.get();
+
+ if (locale != null)
+ {
+ link.addParameter("x:locale", locale.toString());
+ }
+
+ link.addParameter("x:type", parameters.getEventType());
+
+ addEventContext(link, "x:ec", parameters.getEventContext());
+ addEventContext(link, "x:pac", parameters.getPageActivationContext());
+
+ link.addParameter("x:page", parameters.getActivePageName());
+ link.addParameter("x:id", parameters.getNestedComponentId());
+
+ if (!parameters.getActivePageName().equals(parameters.getContainingPageName()))
+ link.addParameter("x:container", parameters.getContainingPageName());
+
+ return link;
+
+ }
+
+ private void addEventContext(Link link, String parameterName, EventContext eventContext)
+ {
+ int count = eventContext.getCount();
+
+ if (count == 0)
+ return;
+
+ StringBuilder builder = new StringBuilder();
+ String sep = "";
+
+ for (int i = 0; i < count; i++)
+ {
+ builder.append(sep);
+ builder.append(eventContext.get(String.class, i));
+ sep = "/";
+ }
+
+ link.addParameter(parameterName, builder.toString());
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppComponentEventLinkTransformer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,44 @@
+// 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.linktrans.services;
+
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.services.linktransform.ComponentEventLinkTransformer;
+import org.apache.tapestry5.services.linktransform.PageRenderLinkTransformer;
+
+public class AppModule
+{
+ public static void contributeApplicationDefaults(MappedConfiguration<String, String> configuration)
+ {
+ configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en,fr,de");
+ configuration.add(SymbolConstants.PRODUCTION_MODE, "false");
+ configuration.add(SymbolConstants.COMPRESS_WHITESPACE, "false");
+ configuration.add(SymbolConstants.COMBINE_SCRIPTS, "true");
+ configuration.add(SymbolConstants.BLACKBIRD_ENABLED, "true");
+ }
+
+ public static void contributePageRenderLinkTransformer(OrderedConfiguration<PageRenderLinkTransformer> configuration)
+ {
+ configuration.addInstance("App", AppPageRenderLinkTransformer.class);
+ }
+
+ public static void contributeComponentEventLinkTransformer(
+ OrderedConfiguration<ComponentEventLinkTransformer> configuration)
+ {
+ configuration.addInstance("App", AppComponentEventLinkTransformer.class);
+ }
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppModule.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java Wed Jun 2 23:37:26 2010
@@ -0,0 +1,95 @@
+// 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.linktrans.services;
+
+import java.util.Locale;
+
+import org.apache.tapestry5.Link;
+import org.apache.tapestry5.TapestryConstants;
+import org.apache.tapestry5.internal.services.ArrayEventContext;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.services.TypeCoercer;
+import org.apache.tapestry5.services.LocalizationSetter;
+import org.apache.tapestry5.services.PageRenderRequestParameters;
+import org.apache.tapestry5.services.PersistentLocale;
+import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.linktransform.PageRenderLinkTransformer;
+
+public class AppPageRenderLinkTransformer implements PageRenderLinkTransformer
+{
+ @Inject
+ private LocalizationSetter localizationSetter;
+
+ @Inject
+ private PersistentLocale persistentLocale;
+
+ @Inject
+ private TypeCoercer typeCoercer;
+
+ public PageRenderRequestParameters decodePageRenderRequest(Request request)
+ {
+ String path = request.getPath();
+
+ String[] split = path.substring(1).split("/");
+
+ if (split.length == 1 && split[0].equals("")) return null;
+
+ int pacx = 0;
+
+ String possibleLocaleName = split[0];
+
+ // Might be just the page activation context, or it might be locale then page
+ // activation context
+
+ boolean localeSpecified = localizationSetter.isSupportedLocaleName(possibleLocaleName);
+
+ if (localeSpecified)
+ {
+ pacx++;
+ }
+
+ if (pacx >= split.length)
+ return null;
+
+ if (localeSpecified)
+ localizationSetter.setLocaleFromLocaleName(possibleLocaleName);
+
+ boolean isLoopback = request.getParameter(TapestryConstants.PAGE_LOOPBACK_PARAMETER_NAME) != null;
+
+ return new PageRenderRequestParameters("View", new ArrayEventContext(typeCoercer, split[pacx]), isLoopback);
+ }
+
+ public Link transformPageRenderLink(Link defaultLink, PageRenderRequestParameters parameters)
+ {
+ if (!parameters.getLogicalPageName().equals("View"))
+ return null;
+
+ StringBuilder path = new StringBuilder();
+
+ Locale locale = persistentLocale.get();
+
+ if (locale != null)
+ path.append("/").append(locale.toString());
+
+ path.append("/");
+
+ // Cheating: we know there's exactly one value in the context.
+
+ path.append(parameters.getActivationContext().get(String.class, 0));
+
+ return defaultLink.copyWithBasePath(path.toString());
+ }
+
+}
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/linktrans/services/AppPageRenderLinkTransformer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml Wed Jun 2 23:37:26 2010
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+ <display-name>LinkTransformer Test App</display-name>
+ <context-param>
+ <param-name>tapestry.app-package</param-name>
+ <param-value>org.apache.tapestry5.integration.linktrans</param-value>
+ </context-param>
+ <filter>
+ <filter-name>app</filter-name>
+ <filter-class>org.apache.tapestry5.TapestryFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>app</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+</web-app>
Propchange: tapestry/tapestry5/trunk/tapestry-core/src/test/linktrans/WEB-INF/web.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/Layout.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/Layout.tml?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/Layout.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/components/Layout.tml Wed Jun 2 23:37:26 2010
@@ -0,0 +1,31 @@
+<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+ <head>
+ <title>LinkTrans: ${componentresources.pagename}</title>
+ </head>
+ <body>
+ <h1>${componentresources.pagename}</h1>
+
+ <t:body/>
+
+ <hr/>
+
+ <p>
+ Current locale:
+ <span id="currentLocale">${componentresources.locale}</span>
+ </p>
+
+ <ul>
+ <li>
+ <t:pagelink page="index">back to index</t:pagelink>
+ </li>
+ <li>
+ <t:pagelink page="${componentResources.pageName}">refresh</t:pagelink>
+ </li>
+ <t:loop source="localeNames" value="localeName">
+ <li>
+ <t:eventlink event="locale" context="localeName">${localeName}</t:eventlink>
+ </li>
+ </t:loop>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/Index.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/Index.tml?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/Index.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/Index.tml Wed Jun 2 23:37:26 2010
@@ -0,0 +1,13 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+
+ <ul>
+ <li>
+ <t:pagelink page="view" context="literal:toys">View Toys</t:pagelink>
+ </li>
+
+ <li>
+ <t:pagelink page="view" context="literal:games">View Games</t:pagelink>
+ </li>
+ </ul>
+
+</t:layout>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/View.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/View.tml?rev=950827&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/View.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/linktrans/pages/View.tml Wed Jun 2 23:37:26 2010
@@ -0,0 +1,19 @@
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd" xmlns:p="tapestry:parameter">
+
+ <p>
+ You are viewing
+ <span id="content">${content}</span>
+ .
+ </p>
+
+ <p>
+ Count:
+ <span id="count">${count}</span>
+ </p>
+
+ <p>
+
+ <t:actionlink t:id="increment">increment</t:actionlink>
+ </p>
+
+</t:layout>
\ No newline at end of file