Author: jonl
Date: Sun Apr 15 19:27:28 2007
New Revision: 529121

URL: http://svn.apache.org/viewvc?view=rev&rev=529121
Log:
This unit test demonstrates a problem that we currently have with 
setResponsePage.  To see it fail, remove the "failing_" from 
"failing_testSetResponsePage".

Added:
    
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest$Page3.html
    
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java

Added: 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest$Page3.html
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest%24Page3.html?view=auto&rev=529121
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest$Page3.html
 (added)
+++ 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest$Page3.html
 Sun Apr 15 19:27:28 2007
@@ -0,0 +1,5 @@
+<html>
+<body>
+Testing!
+</body>
+</html>

Added: 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java?view=auto&rev=529121
==============================================================================
--- 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java
 (added)
+++ 
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/org/apache/wicket/SetResponsePageTest.java
 Sun Apr 15 19:27:28 2007
@@ -0,0 +1,64 @@
+/*
+ * 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;
+
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.util.tester.WicketTester;
+
+public class SetResponsePageTest extends WicketTestCase
+{
+       // FIXME This test fails currently.  We need to fix this bug.
+       public void failing_testSetResponsePage()
+       {
+               WicketTester tester = new WicketTester(Page1.class);
+               tester.setupRequestAndResponse();
+               tester.getServletRequest()
+                               .setURL("?wicket:bookmarkablePage=:" + 
Page1.class.getName() + "");
+               tester.processRequestCycle();
+               tester.assertRenderedPage(Page3.class);
+               tester.destroy();
+       }
+
+       public static class Page1 extends WebPage
+       {
+               private static final long serialVersionUID = 1L;
+
+               public Page1()
+               {
+                       setResponsePage(Page2.class);
+               }
+       }
+
+       public static class Page2 extends WebPage
+       {
+               private static final long serialVersionUID = 1L;
+
+               public Page2()
+               {
+                       setResponsePage(Page3.class);
+               }
+       }
+
+       public static class Page3 extends WebPage
+       {
+               private static final long serialVersionUID = 1L;
+
+               public Page3()
+               {
+               }
+       }
+}


Reply via email to