You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/04/06 22:22:22 UTC

svn commit: r526269 - in /incubator/wicket/branches/wicket-1.x: jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/ jdk-1.4/wicket/src/main/java/wicket/protocol/http/ jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/ jdk-1.4/wicket/src...

Author: ehillenius
Date: Fri Apr  6 13:22:21 2007
New Revision: 526269

URL: http://svn.apache.org/viewvc?view=rev&rev=526269
Log:
Fixed a couple of test failures (and bugs).

Yesterday, I sent this http://www.nabble.com/not-happy-with-how-we-did-the-backports-tf3534134.html, where I state I'm not happy with amongst
other things:
* removal of methods from the API without providing a final method to
help upgrading. If a class has overridable method fooXX(Blah b) and
that is removed (e.g. because it is renamed to barXX or got another
signature), we should make fooXX(Blah) final for at least the first
release, with a TODO to remove it later. 

This happened again, and *again* I'm fixing other's mess. It's not like I doing that for fun, nor do I have lots of free time. Please everyone,
take API changes seriously and make the methods/ signatures that are replaced final. Thanks.

Modified:
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/QuickStartApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/protocol/http/WebApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/InterceptTest.java
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/header/inheritance/InheritanceHeadTest.java
    incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/authorization/strategies/role/example/RolesApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/HangmanApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/LibraryApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin/SignInApplication.java
    incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin2/SignIn2Application.java

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/QuickStartApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/QuickStartApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/QuickStartApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket-quickstart/src/main/java/wicket/quickstart/QuickStartApplication.java Fri Apr  6 13:22:21 2007
@@ -20,6 +20,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import wicket.Request;
+import wicket.Response;
 import wicket.Session;
 import wicket.protocol.http.WebApplication;
 
@@ -50,9 +51,10 @@
 	}
 
 	/**
-	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request)
+	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request,
+	 *      Response)
 	 */
-	public Session newSession(Request request)
+	public Session newSession(Request request, Response response)
 	{
 		return new QuickStartSession(QuickStartApplication.this, request);
 	}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/protocol/http/WebApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/protocol/http/WebApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/protocol/http/WebApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/protocol/http/WebApplication.java Fri Apr  6 13:22:21 2007
@@ -354,11 +354,24 @@
 	 * registered your own ISessionFactory with the Application.
 	 * 
 	 * @return The created session
-	 * @deprecated DO NOT CALL THIS METHOD, BUT RATHER
-	 *             {@link WebApplication#newSession(Request)}.
+	 * @deprecated see {@link WebApplication#newSession(Request, Response)}.
 	 */
 	// FIXME remove this method after 1.3.0
 	public final Session newSession()
+	{
+		throw new UnsupportedOperationException("this method is replaced by Application#newSession");
+	}
+
+	/**
+	 * Create new Wicket Session object. Note, this method is not called if you
+	 * registered your own ISessionFactory with the Application.
+	 * 
+	 * @param request
+	 * @return The created session
+	 * @deprecated {@link WebApplication#newSession(Request, Response)}.
+	 */
+	// FIXME remove this method after 1.3.0
+	public final Session newSession(Request request)
 	{
 		throw new UnsupportedOperationException("this method is replaced by Application#newSession");
 	}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/InterceptTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/InterceptTest.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/InterceptTest.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/form/login/InterceptTest.java Fri Apr  6 13:22:21 2007
@@ -20,6 +20,7 @@
 import wicket.Component;
 import wicket.ISessionFactory;
 import wicket.Request;
+import wicket.Response;
 import wicket.RestartResponseAtInterceptPageException;
 import wicket.Session;
 import wicket.authorization.Action;
@@ -145,9 +146,9 @@
 
 		/**
 		 * 
-		 * @see wicket.ISessionFactory#newSession(Request)
+		 * @see wicket.ISessionFactory#newSession(Request, Response)
 		 */
-		public Session newSession(Request request)
+		public Session newSession(Request request, Response response)
 		{
 			return new MySession(this, request);
 		}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/header/inheritance/InheritanceHeadTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/header/inheritance/InheritanceHeadTest.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/header/inheritance/InheritanceHeadTest.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/test/java/wicket/markup/html/header/inheritance/InheritanceHeadTest.java Fri Apr  6 13:22:21 2007
@@ -17,6 +17,7 @@
 package wicket.markup.html.header.inheritance;
 
 import wicket.Request;
+import wicket.Response;
 import wicket.Session;
 import wicket.WicketTestCase;
 import wicket.markup.MarkupException;
@@ -77,9 +78,9 @@
 		tester = new WicketTester(new WebApplication()
 		{
 			/**
-			 * @see wicket.protocol.http.WebApplication#newSession(Request)
+			 * @see wicket.protocol.http.WebApplication#newSession(Request, Response)
 			 */
-			public Session newSession(Request request)
+			public Session newSession(Request request, Response response)
 			{
 				return new WebSession(this, request).setStyle("myStyle");
 			}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/authorization/strategies/role/example/RolesApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/authorization/strategies/role/example/RolesApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/authorization/strategies/role/example/RolesApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/authorization/strategies/role/example/RolesApplication.java Fri Apr  6 13:22:21 2007
@@ -21,6 +21,7 @@
 
 import wicket.ISessionFactory;
 import wicket.Request;
+import wicket.Response;
 import wicket.Session;
 import wicket.authorization.strategies.role.RoleAuthorizationStrategy;
 import wicket.authorization.strategies.role.example.pages.AdminBookmarkablePage;
@@ -59,9 +60,9 @@
 	}
 
 	/**
-	 * @see wicket.ISessionFactory#newSession(Request request)
+	 * @see wicket.ISessionFactory#newSession(Request, Response)
 	 */
-	public Session newSession(Request request)
+	public Session newSession(Request request, Response response)
 	{
 		return new RolesSession(this, request);
 	}

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/HangmanApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/HangmanApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/HangmanApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/hangman/HangmanApplication.java Fri Apr  6 13:22:21 2007
@@ -1,22 +1,23 @@
 /*
  * 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
- *
+ * 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.
+ * 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 wicket.examples.hangman;
 
 import wicket.Request;
+import wicket.Response;
 import wicket.Session;
 import wicket.examples.WicketExampleApplication;
 
@@ -36,18 +37,19 @@
 	}
 
 	/**
-	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request)
+	 * @see wicket.Application#getHomePage()
 	 */
-	public Session newSession(Request request)
+	public Class getHomePage()
 	{
-		return new HangmanSession(HangmanApplication.this, request);
+		return Home.class;
 	}
 
 	/**
-	 * @see wicket.Application#getHomePage()
+	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request,
+	 *      Response)
 	 */
-	public Class getHomePage()
+	public Session newSession(Request request, Response response)
 	{
-		return Home.class;
+		return new HangmanSession(HangmanApplication.this, request);
 	}
 }

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/LibraryApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/LibraryApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/LibraryApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/library/LibraryApplication.java Fri Apr  6 13:22:21 2007
@@ -1,22 +1,23 @@
 /*
  * 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
- *
+ * 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.
+ * 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 wicket.examples.library;
 
 import wicket.Request;
+import wicket.Response;
 import wicket.Session;
 import wicket.authorization.IAuthorizationStrategy;
 import wicket.authorization.strategies.page.SimplePageAuthorizationStrategy;
@@ -38,6 +39,23 @@
 	}
 
 	/**
+	 * @see wicket.Application#getHomePage()
+	 */
+	public Class getHomePage()
+	{
+		return Home.class;
+	}
+
+	/**
+	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request,
+	 *      Response)
+	 */
+	public Session newSession(Request request, Response response)
+	{
+		return new LibrarySession(LibraryApplication.this, request);
+	}
+
+	/**
 	 * @see wicket.examples.WicketExampleApplication#init()
 	 */
 	protected void init()
@@ -57,21 +75,5 @@
 			}
 		};
 		getSecuritySettings().setAuthorizationStrategy(authorizationStrategy);
-	}
-
-	/**
-	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request)
-	 */
-	public Session newSession(Request request)
-	{
-		return new LibrarySession(LibraryApplication.this, request);
-	}
-
-	/**
-	 * @see wicket.Application#getHomePage()
-	 */
-	public Class getHomePage()
-	{
-		return Home.class;
 	}
 }

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin/SignInApplication.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin/SignInApplication.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin/SignInApplication.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin/SignInApplication.java Fri Apr  6 13:22:21 2007
@@ -1,23 +1,24 @@
 /*
  * 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
- *
+ * 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.
+ * 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 wicket.examples.signin;
 
 import wicket.Component;
 import wicket.Request;
+import wicket.Response;
 import wicket.RestartResponseAtInterceptPageException;
 import wicket.Session;
 import wicket.authorization.Action;
@@ -39,6 +40,23 @@
 	}
 
 	/**
+	 * @see wicket.Application#getHomePage()
+	 */
+	public Class getHomePage()
+	{
+		return Home.class;
+	}
+
+	/**
+	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request,
+	 *      Response)
+	 */
+	public Session newSession(Request request, Response response)
+	{
+		return new SignInSession(SignInApplication.this, request);
+	}
+
+	/**
 	 * @see wicket.examples.WicketExampleApplication#init()
 	 */
 	protected void init()
@@ -67,22 +85,6 @@
 				return true;
 			}
 		});
-	}
-
-	/**
-	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request)
-	 */
-	public Session newSession(Request request)
-	{
-		return new SignInSession(SignInApplication.this, request);
-	}
-
-	/**
-	 * @see wicket.Application#getHomePage()
-	 */
-	public Class getHomePage()
-	{
-		return Home.class;
 	}
 
 }

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin2/SignIn2Application.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin2/SignIn2Application.java?view=diff&rev=526269&r1=526268&r2=526269
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin2/SignIn2Application.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.5/wicket-examples/src/main/java/wicket/examples/signin2/SignIn2Application.java Fri Apr  6 13:22:21 2007
@@ -1,23 +1,24 @@
 /*
  * 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
- *
+ * 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.
+ * 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 wicket.examples.signin2;
 
 import wicket.Component;
 import wicket.Request;
+import wicket.Response;
 import wicket.RestartResponseAtInterceptPageException;
 import wicket.Session;
 import wicket.authorization.Action;
@@ -52,9 +53,10 @@
 	}
 
 	/**
-	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request)
+	 * @see wicket.protocol.http.WebApplication#newSession(wicket.Request,
+	 *      Response)
 	 */
-	public Session newSession(Request request)
+	public Session newSession(Request request, Response response)
 	{
 		return new SignIn2Session(SignIn2Application.this, request);
 	}