Author: pedro
Date: Fri Jan 21 12:35:02 2011
New Revision: 1061786
URL: http://svn.apache.org/viewvc?rev=1061786&view=rev
Log:
testing the expected getObject result on SessionSizeModel after r1061176
Issue: WICKET-3355
Added:
wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/
wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/SessionSizeModelTest.java
Added:
wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/SessionSizeModelTest.java
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/SessionSizeModelTest.java?rev=1061786&view=auto
==============================================================================
---
wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/SessionSizeModelTest.java
(added)
+++
wicket/trunk/wicket-devutils/src/test/java/org/apache/wicket/devutils/inspector/SessionSizeModelTest.java
Fri Jan 21 12:35:02 2011
@@ -0,0 +1,57 @@
+/*
+ * 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.devutils.inspector;
+
+import junit.framework.TestCase;
+
+import org.apache.wicket.Session;
+import org.apache.wicket.mock.MockApplication;
+import org.apache.wicket.protocol.http.WebSession;
+import org.apache.wicket.request.Request;
+import org.apache.wicket.request.Response;
+import org.apache.wicket.util.tester.WicketTester;
+
+/**
+ * @author Pedro Santos
+ */
+public class SessionSizeModelTest extends TestCase {
+
+ /**
+ * @see <a
+ *
href="https://issues.apache.org/jira/browse/WICKET-3355">WICKET-3355</a>
+ */
+ public void testTorelanceOnProblematicSessions() {
+ WicketTester tester = new WicketTester(new MockApplication() {
+ @Override
+ public Session newSession(Request request, Response
response) {
+ return new TestSession(request);
+ }
+ });
+ SessionSizeModel model = new
SessionSizeModel(tester.getSession());
+ assertEquals(null, model.getObject());
+ }
+
+ public static class TestSession extends WebSession {
+ private static final long serialVersionUID = 1L;
+ public Object nonSerializableObject = new Object();
+
+ public TestSession(Request request) {
+ super(request);
+ }
+
+ }
+}