geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
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 GMT
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 {



Mime
View raw message