Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 59653 invoked from network); 22 Oct 2008 15:04:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Oct 2008 15:04:27 -0000 Received: (qmail 16868 invoked by uid 500); 22 Oct 2008 15:04:29 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 16848 invoked by uid 500); 22 Oct 2008 15:04:29 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 16839 invoked by uid 99); 22 Oct 2008 15:04:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2008 08:04:29 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Oct 2008 15:03:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5B57323888EB; Wed, 22 Oct 2008 08:04:06 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r707096 - in /geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src: main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java Date: Wed, 22 Oct 2008 15:04:06 -0000 To: scm@geronimo.apache.org From: dwoods@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081022150406.5B57323888EB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dwoods Date: Wed Oct 22 08:04:05 2008 New Revision: 707096 URL: http://svn.apache.org/viewvc?rev=707096&view=rev Log: GERONIMO-4299 Session invalidation problem - WADI Tomcat Clustering. Merged in r694867 made by Gianny from trunk. Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java?rev=707096&r1=707095&r2=707096&view=diff ============================================================================== --- geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java (original) +++ geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java Wed Oct 22 08:04:05 2008 @@ -74,6 +74,9 @@ public void notifySessionDestruction(org.apache.geronimo.clustering.Session session) { ClusteredSession clusteredSession = getClusteredSession(session); + if (null == clusteredSession) { + return; + } remove(clusteredSession); } Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java?rev=707096&r1=707095&r2=707096&view=diff ============================================================================== --- geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java (original) +++ geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java Wed Oct 22 08:04:05 2008 @@ -30,6 +30,8 @@ import org.apache.geronimo.clustering.SessionListener; import org.apache.geronimo.clustering.SessionManager; +import com.agical.rmock.core.Action; +import com.agical.rmock.core.MethodHandle; import com.agical.rmock.core.describe.ExpressionDescriber; import com.agical.rmock.core.match.operator.AbstractExpression; import com.agical.rmock.extension.junit.RMockTestCase; @@ -138,16 +140,24 @@ assertFalse(httpSession.isNew()); } - public void testInvalidateSessionReleasesUnderlyingSession() throws Exception { - org.apache.geronimo.clustering.Session underlyingSession =recordCreateUnderlyingSession(); + public void testInvalidateSessionReleasesUnderlyingSessionAndRemoveSessionFromManager() throws Exception { + final org.apache.geronimo.clustering.Session underlyingSession =recordCreateUnderlyingSession(); underlyingSession.release(); - + modify().perform(new Action() { + public Object invocation(Object[] arg0, MethodHandle arg1) throws Throwable { + sessionListener.notifySessionDestruction(underlyingSession); + return null; + } + }); + startVerification(); ClusteredManager manager = newManager(); Session session = manager.createSession(null); HttpSession httpSession = session.getSession(); httpSession.invalidate(); + + assertNull(manager.findSession(sessionId)); } public void testSessionEndAccessTriggersOnEndAccess() throws Exception {