You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2007/11/29 03:10:58 UTC
svn commit: r599247 - in /tapestry/tapestry5/trunk/tapestry-core/src/test:
app3/ app3/WEB-INF/ java/org/apache/tapestry/integration/
java/org/apache/tapestry/integration/app3/
java/org/apache/tapestry/integration/app3/pages/
Author: hlship
Date: Wed Nov 28 18:10:51 2007
New Revision: 599247
URL: http://svn.apache.org/viewvc?rev=599247&view=rev
Log:
TAPESTRY-1627: Start page redirect requests can return an empty response
Added:
tapestry/tapestry5/trunk/tapestry-core/src/test/app3/
tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Login.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Start.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/
tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/web.xml
- copied, changed from r594319, tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/web.xml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RootPathRedirectTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Login.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Start.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Login.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Login.tml?rev=599247&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Login.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Login.tml Wed Nov 28 18:10:51 2007
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>Login</title>
+ </head>
+ <body>
+ <h1>Login Page</h1>
+
+ <p>
+ You have reached this page via a redirect from the Start page's onActivate() event handler method.
+ </p>
+ </body>
+</html>
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Start.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Start.tml?rev=599247&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Start.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app3/Start.tml Wed Nov 28 18:10:51 2007
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>Start</title>
+ </head>
+ <body>
+ <h1>Start page</h1>
+
+ <p>
+ The Start page should not be visible, because of the onActivate() event handler method.
+ </p>
+ </body>
+</html>
\ No newline at end of file
Copied: tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/web.xml (from r594319, tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/web.xml)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/web.xml?p2=tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/web.xml&p1=tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/web.xml&r1=594319&r2=599247&rev=599247&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/web.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app3/WEB-INF/web.xml Wed Nov 28 18:10:51 2007
@@ -19,10 +19,10 @@
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
- <display-name>Integration Test App 1</display-name>
+ <display-name>Integration Test App 3</display-name>
<context-param>
<param-name>tapestry.app-package</param-name>
- <param-value>org.apache.tapestry.integration.app1</param-value>
+ <param-value>org.apache.tapestry.integration.app3</param-value>
</context-param>
<filter>
<filter-name>app</filter-name>
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RootPathRedirectTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RootPathRedirectTest.java?rev=599247&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RootPathRedirectTest.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RootPathRedirectTest.java Wed Nov 28 18:10:51 2007
@@ -0,0 +1,42 @@
+// Copyright 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;
+
+import org.apache.tapestry.test.AbstractIntegrationTestSuite;
+import org.testng.annotations.Test;
+
+@Test(timeOut = 50000, sequential = true, groups = {"integration"})
+public class RootPathRedirectTest extends AbstractIntegrationTestSuite
+{
+
+ public RootPathRedirectTest()
+ {
+ super("src/test/app3");
+ }
+
+
+ /**
+ * Test to prove that a redirect from the start page works correctly.
+ *
+ * @see https://issues.apache.org/jira/browse/TAPESTRY-1627
+ */
+ @Test
+ public void redirect_for_root() throws Exception
+ {
+ open(BASE_URL);
+
+ assertText("//h1", "Login Page");
+ }
+}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java?rev=599247&r1=599246&r2=599247&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/RunJetty.java Wed Nov 28 18:10:51 2007
@@ -24,6 +24,9 @@
{
public static void main(String[] args) throws InterruptedException
{
- new JettyRunner("/app1", 8080, "src/test/app1");
+ String contextName = args[0];
+ String path = args[1];
+
+ new JettyRunner(contextName, 8080, path);
}
}
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Login.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Login.java?rev=599247&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Login.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Login.java Wed Nov 28 18:10:51 2007
@@ -0,0 +1,19 @@
+// Copyright 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.app3.pages;
+
+public class Login
+{
+}
Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Start.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Start.java?rev=599247&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Start.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app3/pages/Start.java Wed Nov 28 18:10:51 2007
@@ -0,0 +1,29 @@
+// Copyright 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.app3.pages;
+
+import org.apache.tapestry.annotations.InjectPage;
+
+public class Start
+{
+ @InjectPage
+ private Login _login;
+
+ Object onActivate()
+ {
+ // Perform a redirect to the login page.
+ return _login;
+ }
+}