[jboss-cvs] JBossAS SVN: r95443 - in trunk/testsuite/src/main/org/jboss/test/cluster: web/jvmroute and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 22 16:13:44 EDT 2009
Author: bstansberry at jboss.com
Date: 2009-10-22 16:13:44 -0400 (Thu, 22 Oct 2009)
New Revision: 95443
Added:
trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockClusteredManager.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManager.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManagerFactory.java
Removed:
trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockDistributedCacheManager.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockJBossManager.java
Modified:
trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JvmRouteValveUnitTestCase.java
trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockSession.java
Log:
Rearrange clustered web test mock classes
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JvmRouteValveUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JvmRouteValveUnitTestCase.java 2009-10-22 20:11:51 UTC (rev 95442)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/simpleweb/test/JvmRouteValveUnitTestCase.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -27,8 +27,8 @@
import org.apache.catalina.Session;
import org.apache.catalina.connector.Response;
import org.jboss.logging.Logger;
-import org.jboss.test.cluster.web.jvmroute.MockJBossManager;
import org.jboss.test.cluster.web.jvmroute.MockRequest;
+import org.jboss.test.cluster.web.mocks.MockClusteredManager;
import org.jboss.test.cluster.web.mocks.MockValve;
import org.jboss.web.tomcat.service.session.JvmRouteValve;
@@ -64,7 +64,7 @@
{
log.info("Enter testNonFailover");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -92,7 +92,7 @@
{
log.info("Enter testFailover");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -121,7 +121,7 @@
{
log.info("Enter testFailoverFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -150,7 +150,7 @@
{
log.info("Enter testFailoverMismatchBadReq");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -178,7 +178,7 @@
{
log.info("Enter testFailoverMismatchBadReqFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -207,7 +207,7 @@
{
log.info("Enter testFailoverMismatchBadSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -235,7 +235,7 @@
{
log.info("Enter testFailoverMismatchBadSessionFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -264,7 +264,7 @@
{
log.info("Enter testNoSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -290,7 +290,7 @@
{
log.info("Enter testNoSessionFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -317,7 +317,7 @@
{
log.info("Enter testFailoverNoSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -344,7 +344,7 @@
{
log.info("Enter testNoSessionNoRequestedSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -370,7 +370,7 @@
{
log.info("Enter testSessionNoRequestedSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -397,7 +397,7 @@
{
log.info("Enter testSessionNoRequestedSessionFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -425,7 +425,7 @@
{
log.info("Enter testFailoverSessionNoRequestedSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -452,7 +452,7 @@
{
log.info("Enter testFailoverSessionNoRequestedSessionFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -480,7 +480,7 @@
{
log.info("Enter testNoJvmRouteSession");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -508,7 +508,7 @@
{
log.info("Enter testNoJvmRouteSessionFromURL");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -537,7 +537,7 @@
{
log.info("Enter testNoJvmRouteRequest");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -565,7 +565,7 @@
{
log.info("Enter testNoJvmRouteRequest");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
@@ -594,7 +594,7 @@
{
log.info("Enter testJvmRouteIncludesDomain");
- MockJBossManager mgr = new MockJBossManager();
+ MockClusteredManager mgr = new MockClusteredManager();
mgr.setJvmRoute(DOMAIN_JVM_ROUTE);
JvmRouteValve jvmRouteValve = new JvmRouteValve(mgr);
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockDistributedCacheManager.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockDistributedCacheManager.java 2009-10-22 20:11:51 UTC (rev 95442)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockDistributedCacheManager.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -1,165 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.cluster.web.jvmroute;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.web.tomcat.service.session.distributedcache.spi.BatchingManager;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.IncomingDistributableSessionData;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
-
-/**
- * @author Brian Stansberry
- *
- */
-public class MockDistributedCacheManager implements DistributedCacheManager<OutgoingDistributableSessionData>
-{
- public static final MockDistributedCacheManager INSTANCE = new MockDistributedCacheManager();
-
-
- public void evictSession(String realId)
- {
- // no-op
- }
-
- public void evictSession(String realId, String dataOwner)
- {
- // no-op
- }
-
- public Object getAttribute(String realId, String key)
- {
- return null;
- }
-
- public Set<String> getAttributeKeys(String realId)
- {
- return Collections.emptySet();
- }
-
- public Map<String, Object> getAttributes(String realId)
- {
- return Collections.emptyMap();
- }
-
- public BatchingManager getBatchingManager()
- {
- return null;
- }
-
- public IncomingDistributableSessionData getSessionData(String realId, boolean initialLoad)
- {
- return null;
- }
-
- public IncomingDistributableSessionData getSessionData(String realId, String dataOwner, boolean includeAttributes)
- {
- return null;
- }
-
- public Map<String, String> getSessionIds()
- {
- return Collections.emptyMap();
- }
-
- public boolean isPassivationEnabled()
- {
- return false;
- }
-
- public void putAttribute(String realId, Map<String, Object> map)
- {
- // no-op
- }
-
- public void putAttribute(String realId, String key, Object value)
- {
- // no-op
- }
-
-
-
- public Object removeAttribute(String realId, String key)
- {
- return null;
- }
-
- public void removeAttributeLocal(String realId, String key)
- {
- // no-op
- }
-
- public void removeAttributes(String realId)
- {
- // no-op
- }
-
- public void removeAttributesLocal(String realId)
- {
- // no-op
- }
-
- public void removeSession(String realId)
- {
- // no-op
- }
-
- public void removeSessionLocal(String realId)
- {
- // no-op
- }
-
- public void removeSessionLocal(String realId, String dataOwner)
- {
- // no-op
- }
-
- public void start()
- {
- // no-op
- }
-
- public void stop()
- {
- // no-op
- }
-
- public boolean getSupportsAttributeOperations()
- {
- return true;
- }
-
- public void sessionCreated(String realId)
- {
- // no-op
- }
-
- public void storeSessionData(OutgoingDistributableSessionData sessionData)
- {
- // no-op
- }
-
-}
Deleted: trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockJBossManager.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockJBossManager.java 2009-10-22 20:11:51 UTC (rev 95442)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockJBossManager.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -1,276 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.test.cluster.web.jvmroute;
-
-import java.beans.PropertyChangeListener;
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.Session;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.jboss.ReplicationTrigger;
-import org.jboss.web.tomcat.service.session.ClusteredManager;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.ClusteringNotSupportedException;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
-import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
-import org.jboss.web.tomcat.service.session.notification.ClusteredSessionNotificationPolicy;
-import org.jboss.web.tomcat.service.session.notification.LegacyClusteredSessionNotificationPolicy;
-
-/**
- * @author Brian Stansberry
- *
- */
-public class MockJBossManager implements ClusteredManager<OutgoingDistributableSessionData>
-{
- private String jvmRoute = null;
- private String newCookieIdSession = null;
- private Session session = null;
-
- /**
- * Create a new MockJBossManager.
- *
- */
- public MockJBossManager()
- {
- }
-
- public String getJvmRoute()
- {
- return jvmRoute;
- }
-
- public void setJvmRoute(String jvmRoute)
- {
- this.jvmRoute = jvmRoute;
- }
-
- public void setNewSessionCookie(String sessionId, HttpServletResponse response)
- {
- newCookieIdSession = sessionId;
- }
-
- public String getNewCookieIdSession()
- {
- return newCookieIdSession;
- }
-
- public Session createSession(String s)
- {
- Session session = new MockSession(this);
- session.setId(s);
- return session;
- }
-
- public Session findSession(String s) throws IOException
- {
- return session;
- }
-
- public void add(Session session)
- {
- this.session = session;
- }
-
- public ReplicationTrigger getReplicationTrigger()
- {
- return ReplicationTrigger.SET_AND_NON_PRIMITIVE_GET;
- }
-
- public void init(String name, JBossWebMetaData webMetaData) throws ClusteringNotSupportedException
- {
-
- }
-
- public void removeLocal(Session session)
- {
- }
-
- public boolean storeSession(Session session)
- {
- return false;
- }
-
- public void addPropertyChangeListener(PropertyChangeListener propertychangelistener)
- {
- }
-
- public void backgroundProcess()
- {
- }
-
- public Session createEmptySession()
- {
- return null;
- }
-
- public Session createSession()
- {
- return null;
- }
-
- public Session[] findSessions()
- {
- return null;
- }
-
- public int getActiveSessions()
- {
- return 0;
- }
-
- public Container getContainer()
- {
- return null;
- }
-
- public boolean getDistributable()
- {
- return false;
- }
-
- public int getExpiredSessions()
- {
- return 0;
- }
-
- public String getInfo()
- {
- return null;
- }
-
- public int getMaxActive()
- {
- return 0;
- }
-
- public int getMaxInactiveInterval()
- {
- return 0;
- }
-
- public int getRejectedSessions()
- {
- return 0;
- }
-
- public int getSessionAverageAliveTime()
- {
- return 0;
- }
-
- public int getSessionCounter()
- {
- return 0;
- }
-
- public int getSessionIdLength()
- {
- return 0;
- }
-
- public int getSessionMaxAliveTime()
- {
- return 0;
- }
-
- public void load() throws ClassNotFoundException, IOException
- {
- }
-
- public void remove(Session session)
- {
- }
-
- public void removePropertyChangeListener(PropertyChangeListener propertychangelistener)
- {
- }
-
- public void setContainer(Container container)
- {
- }
-
- public void setDistributable(boolean flag)
- {
- }
-
- public void setExpiredSessions(int i)
- {
- }
-
- public void setMaxActive(int i)
- {
- }
-
- public void setMaxInactiveInterval(int i)
- {
- }
-
- public void setRejectedSessions(int i)
- {
- }
-
- public void setSessionAverageAliveTime(int i)
- {
- }
-
- public void setSessionCounter(int i)
- {
- }
-
- public void setSessionIdLength(int i)
- {
- }
-
- public void setSessionMaxAliveTime(int i)
- {
- }
-
- public void unload() throws IOException
- {
- }
-
- public DistributedCacheManager<OutgoingDistributableSessionData> getDistributedCacheManager()
- {
- return MockDistributedCacheManager.INSTANCE;
- }
-
- public int getMaxUnreplicatedInterval()
- {
- return -1;
- }
-
- public ClusteredSessionNotificationPolicy getNotificationPolicy()
- {
- return new LegacyClusteredSessionNotificationPolicy();
- }
-
- public boolean getUseJK()
- {
- return true;
- }
-
-
-
-}
Modified: trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockSession.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockSession.java 2009-10-22 20:11:51 UTC (rev 95442)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockSession.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -25,6 +25,7 @@
import javax.servlet.http.HttpSession;
import org.apache.catalina.session.StandardSessionFacade;
+import org.jboss.test.cluster.web.mocks.MockClusteredManager;
import org.jboss.web.tomcat.service.session.ClusteredSession;
import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
import org.jboss.web.tomcat.service.session.notification.ClusteredSessionNotificationCause;
@@ -43,7 +44,7 @@
*
* @param manager
*/
- public MockSession(MockJBossManager manager)
+ public MockSession(MockClusteredManager manager)
{
super(manager);
}
Copied: trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockClusteredManager.java (from rev 95130, trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockJBossManager.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockClusteredManager.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockClusteredManager.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -0,0 +1,277 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.mocks;
+
+import java.beans.PropertyChangeListener;
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Session;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.jboss.ReplicationTrigger;
+import org.jboss.test.cluster.web.jvmroute.MockSession;
+import org.jboss.web.tomcat.service.session.ClusteredManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.ClusteringNotSupportedException;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
+import org.jboss.web.tomcat.service.session.notification.ClusteredSessionNotificationPolicy;
+import org.jboss.web.tomcat.service.session.notification.LegacyClusteredSessionNotificationPolicy;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockClusteredManager implements ClusteredManager<OutgoingDistributableSessionData>
+{
+ private String jvmRoute = null;
+ private String newCookieIdSession = null;
+ private Session session = null;
+
+ /**
+ * Create a new MockJBossManager.
+ *
+ */
+ public MockClusteredManager()
+ {
+ }
+
+ public String getJvmRoute()
+ {
+ return jvmRoute;
+ }
+
+ public void setJvmRoute(String jvmRoute)
+ {
+ this.jvmRoute = jvmRoute;
+ }
+
+ public void setNewSessionCookie(String sessionId, HttpServletResponse response)
+ {
+ newCookieIdSession = sessionId;
+ }
+
+ public String getNewCookieIdSession()
+ {
+ return newCookieIdSession;
+ }
+
+ public Session createSession(String s)
+ {
+ Session session = new MockSession(this);
+ session.setId(s);
+ return session;
+ }
+
+ public Session findSession(String s) throws IOException
+ {
+ return session;
+ }
+
+ public void add(Session session)
+ {
+ this.session = session;
+ }
+
+ public ReplicationTrigger getReplicationTrigger()
+ {
+ return ReplicationTrigger.SET_AND_NON_PRIMITIVE_GET;
+ }
+
+ public void init(String name, JBossWebMetaData webMetaData) throws ClusteringNotSupportedException
+ {
+
+ }
+
+ public void removeLocal(Session session)
+ {
+ }
+
+ public boolean storeSession(Session session)
+ {
+ return false;
+ }
+
+ public void addPropertyChangeListener(PropertyChangeListener propertychangelistener)
+ {
+ }
+
+ public void backgroundProcess()
+ {
+ }
+
+ public Session createEmptySession()
+ {
+ return null;
+ }
+
+ public Session createSession()
+ {
+ return null;
+ }
+
+ public Session[] findSessions()
+ {
+ return null;
+ }
+
+ public int getActiveSessions()
+ {
+ return 0;
+ }
+
+ public Container getContainer()
+ {
+ return null;
+ }
+
+ public boolean getDistributable()
+ {
+ return false;
+ }
+
+ public int getExpiredSessions()
+ {
+ return 0;
+ }
+
+ public String getInfo()
+ {
+ return null;
+ }
+
+ public int getMaxActive()
+ {
+ return 0;
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return 0;
+ }
+
+ public int getRejectedSessions()
+ {
+ return 0;
+ }
+
+ public int getSessionAverageAliveTime()
+ {
+ return 0;
+ }
+
+ public int getSessionCounter()
+ {
+ return 0;
+ }
+
+ public int getSessionIdLength()
+ {
+ return 0;
+ }
+
+ public int getSessionMaxAliveTime()
+ {
+ return 0;
+ }
+
+ public void load() throws ClassNotFoundException, IOException
+ {
+ }
+
+ public void remove(Session session)
+ {
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener propertychangelistener)
+ {
+ }
+
+ public void setContainer(Container container)
+ {
+ }
+
+ public void setDistributable(boolean flag)
+ {
+ }
+
+ public void setExpiredSessions(int i)
+ {
+ }
+
+ public void setMaxActive(int i)
+ {
+ }
+
+ public void setMaxInactiveInterval(int i)
+ {
+ }
+
+ public void setRejectedSessions(int i)
+ {
+ }
+
+ public void setSessionAverageAliveTime(int i)
+ {
+ }
+
+ public void setSessionCounter(int i)
+ {
+ }
+
+ public void setSessionIdLength(int i)
+ {
+ }
+
+ public void setSessionMaxAliveTime(int i)
+ {
+ }
+
+ public void unload() throws IOException
+ {
+ }
+
+ public DistributedCacheManager<OutgoingDistributableSessionData> getDistributedCacheManager()
+ {
+ return MockDistributedCacheManager.INSTANCE;
+ }
+
+ public int getMaxUnreplicatedInterval()
+ {
+ return -1;
+ }
+
+ public ClusteredSessionNotificationPolicy getNotificationPolicy()
+ {
+ return new LegacyClusteredSessionNotificationPolicy();
+ }
+
+ public boolean getUseJK()
+ {
+ return true;
+ }
+
+
+
+}
Copied: trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManager.java (from rev 95130, trunk/testsuite/src/main/org/jboss/test/cluster/web/jvmroute/MockDistributedCacheManager.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManager.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManager.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -0,0 +1,165 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.mocks;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.web.tomcat.service.session.distributedcache.spi.BatchingManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.IncomingDistributableSessionData;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockDistributedCacheManager implements DistributedCacheManager<OutgoingDistributableSessionData>
+{
+ public static final MockDistributedCacheManager INSTANCE = new MockDistributedCacheManager();
+
+
+ public void evictSession(String realId)
+ {
+ // no-op
+ }
+
+ public void evictSession(String realId, String dataOwner)
+ {
+ // no-op
+ }
+
+ public Object getAttribute(String realId, String key)
+ {
+ return null;
+ }
+
+ public Set<String> getAttributeKeys(String realId)
+ {
+ return Collections.emptySet();
+ }
+
+ public Map<String, Object> getAttributes(String realId)
+ {
+ return Collections.emptyMap();
+ }
+
+ public BatchingManager getBatchingManager()
+ {
+ return null;
+ }
+
+ public IncomingDistributableSessionData getSessionData(String realId, boolean initialLoad)
+ {
+ return null;
+ }
+
+ public IncomingDistributableSessionData getSessionData(String realId, String dataOwner, boolean includeAttributes)
+ {
+ return null;
+ }
+
+ public Map<String, String> getSessionIds()
+ {
+ return Collections.emptyMap();
+ }
+
+ public boolean isPassivationEnabled()
+ {
+ return false;
+ }
+
+ public void putAttribute(String realId, Map<String, Object> map)
+ {
+ // no-op
+ }
+
+ public void putAttribute(String realId, String key, Object value)
+ {
+ // no-op
+ }
+
+
+
+ public Object removeAttribute(String realId, String key)
+ {
+ return null;
+ }
+
+ public void removeAttributeLocal(String realId, String key)
+ {
+ // no-op
+ }
+
+ public void removeAttributes(String realId)
+ {
+ // no-op
+ }
+
+ public void removeAttributesLocal(String realId)
+ {
+ // no-op
+ }
+
+ public void removeSession(String realId)
+ {
+ // no-op
+ }
+
+ public void removeSessionLocal(String realId)
+ {
+ // no-op
+ }
+
+ public void removeSessionLocal(String realId, String dataOwner)
+ {
+ // no-op
+ }
+
+ public void start()
+ {
+ // no-op
+ }
+
+ public void stop()
+ {
+ // no-op
+ }
+
+ public boolean getSupportsAttributeOperations()
+ {
+ return true;
+ }
+
+ public void sessionCreated(String realId)
+ {
+ // no-op
+ }
+
+ public void storeSessionData(OutgoingDistributableSessionData sessionData)
+ {
+ // no-op
+ }
+
+}
Copied: trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManagerFactory.java (from rev 95441, branches/Branch_5_x/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManagerFactory.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManagerFactory.java (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/web/mocks/MockDistributedCacheManagerFactory.java 2009-10-22 20:13:44 UTC (rev 95443)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009 Red Hat, Inc. and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.mocks;
+
+import org.jboss.web.tomcat.service.session.distributedcache.spi.ClusteringNotSupportedException;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManagerFactory;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager;
+import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
+
+/**
+ *
+ *
+ * @author Brian Stansberry
+ *
+ * @version $Revision: $
+ */
+public class MockDistributedCacheManagerFactory implements DistributedCacheManagerFactory
+{
+
+ public <T extends OutgoingDistributableSessionData> DistributedCacheManager<T> getDistributedCacheManager(
+ LocalDistributableSessionManager localManager) throws ClusteringNotSupportedException
+ {
+ return (DistributedCacheManager<T>) MockDistributedCacheManager.INSTANCE;
+ }
+
+}
More information about the jboss-cvs-commits
mailing list