Author: jbq Date: Tue Jul 3 08:29:54 2007 New Revision: 552878 URL: http://svn.apache.org/viewvc?view=rev&rev=552878 Log: Adding test case for WICKET-702: MockWebApplication doesn't redirect properly to mounted pages under RestartResponseAtInterceptPageException
Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html (with props) incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java (with props) incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html (with props) incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java (with props) incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java (with props) Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html?view=auto&rev=552878 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html (added) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html Tue Jul 3 08:29:54 2007 @@ -0,0 +1,5 @@ +<html> +<body> + +</body> +</html> \ No newline at end of file Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java?view=auto&rev=552878 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java (added) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java Tue Jul 3 08:29:54 2007 @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.wicket.redirect; + +import org.apache.wicket.markup.html.WebPage; + +public class LoginPage extends WebPage +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public LoginPage() { + } + +} Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/LoginPage.java ------------------------------------------------------------------------------ svn:keywords = Id Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html?view=auto&rev=552878 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html (added) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html Tue Jul 3 08:29:54 2007 @@ -0,0 +1,5 @@ +<html> +<body> + +</body> +</html> \ No newline at end of file Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.html ------------------------------------------------------------------------------ svn:eol-style = native Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java?view=auto&rev=552878 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java (added) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java Tue Jul 3 08:29:54 2007 @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.wicket.redirect; + +import org.apache.wicket.RestartResponseAtInterceptPageException; +import org.apache.wicket.markup.html.WebPage; + +/** + * The page that is protected and needs to redirect to the login page. + */ +public class ProtectedPage extends WebPage +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProtectedPage() + { + throw new RestartResponseAtInterceptPageException(LoginPage.class); + } + +} Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/ProtectedPage.java ------------------------------------------------------------------------------ svn:keywords = Id Added: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java?view=auto&rev=552878 ============================================================================== --- incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java (added) +++ incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java Tue Jul 3 08:29:54 2007 @@ -0,0 +1,67 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.wicket.redirect; + +import org.apache.wicket.WicketTestCase; +import org.apache.wicket.util.lang.PackageName; + +public class RestartWithMountedPageTest extends WicketTestCase +{ + + /** + * Construct. + */ + public RestartWithMountedPageTest() + { + super(); + } + + /** + * Construct. + * + * @param name + */ + public RestartWithMountedPageTest(String name) + { + super(name); + } + + /** + * FIXME fix this test + * Tests that a protected page can redirect to a login page from a mounted package. + */ + public void bugTestWithMountedPackage() { + tester.getApplication().mount("/test", PackageName.forPackage(ProtectedPage.class.getPackage())); + tester.startPage(ProtectedPage.class); + tester.assertRenderedPage(LoginPage.class); + } + + /** + * FIXME fix this test + * Tests that a protected page can redirect to a login page from mounted pages. + */ + public void bugTestWithMountedLoginPage() { + tester.getApplication().mountBookmarkablePage("/login", LoginPage.class); + tester.startPage(ProtectedPage.class); + tester.assertRenderedPage(LoginPage.class); + } + + /** + * FIXME remove this dummy test + */ + public void testDummy() {} +} Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: incubator/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/redirect/RestartWithMountedPageTest.java ------------------------------------------------------------------------------ svn:keywords = Id