[jboss-cvs] JBossAS SVN: r107096 - projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 26 20:46:29 EDT 2010
Author: pferraro
Date: 2010-07-26 20:46:29 -0400 (Mon, 26 Jul 2010)
New Revision: 107096
Modified:
projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java
Log:
Test static getInstance() method.
Parse container name from cache name.
Modified: projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java 2010-07-27 00:45:27 UTC (rev 107095)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/test/java/org/jboss/ha/web/tomcat/service/session/distributedcache/impl/DistributedCacheManagerTest.java 2010-07-27 00:46:29 UTC (rev 107096)
@@ -21,9 +21,12 @@
*/
package org.jboss.ha.web.tomcat.service.session.distributedcache.impl;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
+import javax.naming.Context;
+
import junit.framework.Assert;
import org.easymock.Capture;
@@ -32,6 +35,7 @@
import org.infinispan.Cache;
import org.infinispan.atomic.AtomicMap;
import org.infinispan.config.Configuration;
+import org.infinispan.config.InfinispanConfiguration;
import org.infinispan.context.Flag;
import org.infinispan.lifecycle.ComponentStatus;
import org.infinispan.manager.CacheContainer;
@@ -40,6 +44,12 @@
import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
import org.infinispan.transaction.tm.BatchModeTransactionManager;
+import org.jboss.ha.ispn.CacheContainerConfiguration;
+import org.jboss.ha.ispn.CacheContainerFactory;
+import org.jboss.ha.ispn.DefaultCacheContainerRegistry;
+import org.jboss.ha.ispn.config.CacheContainerRegistryConfiguration;
+import org.jboss.ha.ispn.config.CacheContainerRegistryConfigurationEntry;
+import org.jboss.ha.ispn.config.CacheContainerRegistryConfigurationSource;
import org.jboss.metadata.web.jboss.ReplicationConfig;
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata;
import org.jboss.web.tomcat.service.session.distributedcache.spi.DistributedCacheManager;
@@ -47,6 +57,8 @@
import org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager;
import org.jboss.web.tomcat.service.session.distributedcache.spi.OutgoingDistributableSessionData;
import org.jboss.web.tomcat.service.session.distributedcache.spi.SessionOwnershipSupport;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
/**
@@ -55,14 +67,78 @@
*/
public class DistributedCacheManagerTest
{
- private LocalDistributableSessionManager manager = EasyMock.createStrictMock(LocalDistributableSessionManager.class);
- private CacheContainer container = EasyMock.createStrictMock(CacheContainer.class);
+ private final CacheContainerFactory factory = EasyMock.createStrictMock(CacheContainerFactory.class);
+ private final CacheContainerRegistryConfigurationSource source = EasyMock.createStrictMock(CacheContainerRegistryConfigurationSource.class);
+ private final CacheContainer defaultContainer = EasyMock.createStrictMock(CacheContainer.class);
+ private final CacheContainer customContainer = EasyMock.createStrictMock(CacheContainer.class);
+ private final Context context = EasyMock.createNiceMock(Context.class);
+
+ private DefaultCacheContainerRegistry registry;
+
+ private final LocalDistributableSessionManager manager = EasyMock.createStrictMock(LocalDistributableSessionManager.class);
@SuppressWarnings("unchecked")
- private SessionAttributeStorage<OutgoingDistributableSessionData> storage = EasyMock.createStrictMock(SessionAttributeStorage.class);
+ private final SessionAttributeStorage<OutgoingDistributableSessionData> storage = EasyMock.createStrictMock(SessionAttributeStorage.class);
@SuppressWarnings("unchecked")
- private AdvancedCache<String, AtomicMap<Object, Object>> cache = EasyMock.createStrictMock(AdvancedCache.class);
- private CacheInvoker invoker = EasyMock.createStrictMock(CacheInvoker.class);
+ private final AdvancedCache<String, AtomicMap<Object, Object>> cache = EasyMock.createStrictMock(AdvancedCache.class);
+ private final CacheInvoker invoker = EasyMock.createStrictMock(CacheInvoker.class);
+
+ @Before
+ public void init() throws Exception
+ {
+ InfinispanConfiguration config = InfinispanConfiguration.newInfinispanConfiguration("config-samples/minimal.xml");
+
+ CacheContainerRegistryConfigurationEntry entry1 = new CacheContainerRegistryConfigurationEntry();
+
+ entry1.setId("default");
+ entry1.setConfiguration(config);
+
+ CacheContainerRegistryConfigurationEntry entry2 = new CacheContainerRegistryConfigurationEntry();
+
+ entry2.setId("custom");
+ entry2.setConfiguration(config);
+
+ CacheContainerRegistryConfiguration registryConfig = new CacheContainerRegistryConfiguration();
+ registryConfig.setEntries(Arrays.asList(entry1, entry2));
+
+ this.registry = new DefaultCacheContainerRegistry(this.factory, this.source, this.context);
+
+ EasyMock.expect(this.source.getRegistryConfiguration()).andReturn(registryConfig);
+
+ EasyMock.expect(this.factory.createCacheContainer(EasyMock.isA(CacheContainerConfiguration.class), EasyMock.eq(Collections.<String, String>emptyMap()))).andReturn(this.defaultContainer);
+ EasyMock.expect(this.context.composeName("default", "java:CacheManager")).andReturn("java:CacheManager/default");
+
+ this.context.bind("java:CacheManager/default", this.defaultContainer);
+
+ EasyMock.expect(this.factory.createCacheContainer(EasyMock.isA(CacheContainerConfiguration.class), EasyMock.eq(Collections.<String, String>emptyMap()))).andReturn(this.customContainer);
+ EasyMock.expect(this.context.composeName("custom", "java:CacheManager")).andReturn("java:CacheManager/custom");
+
+ this.context.bind("java:CacheManager/custom", this.customContainer);
+
+ EasyMock.replay(this.factory, this.source, this.context, this.defaultContainer);
+
+ this.registry.start();
+
+ EasyMock.verify(this.factory, this.source, this.context, this.defaultContainer);
+ EasyMock.reset(this.factory, this.source, this.context, this.defaultContainer);
+ }
+ @After
+ public void cleanup() throws Exception
+ {
+ this.defaultContainer.stop();
+ this.context.unbind("java:CacheManager/default");
+
+ this.customContainer.stop();
+ this.context.unbind("java:CacheManager/custom");
+
+ EasyMock.replay(this.factory, this.source, this.context, this.defaultContainer);
+
+ this.registry.stop();
+
+ EasyMock.verify(this.factory, this.source, this.context, this.defaultContainer);
+ EasyMock.reset(this.factory, this.source, this.context, this.defaultContainer);
+ }
+
@Test
public void start()
{
@@ -70,36 +146,46 @@
config.setCacheName("session-cache");
// Validate host contribution to cache name
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration());
- this.start("", "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration());
- this.start("host1", "", "host1/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration());
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", "", "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", "host1", "", "host1/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
// Validate context path contribution to cache name
- this.start(null, "/", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration());
- this.start(null, "/context1", "localhost/context1", config, ComponentStatus.INSTANTIATED, true, new Configuration());
- this.start(null, "/path/context1", "localhost/path/context1", config, ComponentStatus.INSTANTIATED, true, new Configuration());
+ this.start("session-cache", null, "/", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "/context1", "localhost/context1", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "/path/context1", "localhost/path/context1", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
// Validate starting of cache per cache status
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.FAILED, true, new Configuration());
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.INITIALIZING, true, new Configuration());
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.RUNNING, false, new Configuration());
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.STOPPING, true, new Configuration());
- this.start(null, "", "localhost/ROOT", config, ComponentStatus.TERMINATED, true, new Configuration());
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.FAILED, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INITIALIZING, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.RUNNING, false, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.STOPPING, true, new Configuration(), this.defaultContainer);
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.TERMINATED, true, new Configuration(), this.defaultContainer);
+
+ // Validate cache container qualified cache name
+ config.setCacheName("default:session-cache");
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+
+ config.setCacheName("dummy:session-cache");
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
+
+ config.setCacheName("custom:session-cache");
+ this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.customContainer);
}
- private DistributedCacheManagerImpl<OutgoingDistributableSessionData> start(String hostName, String contextName, String cacheName, ReplicationConfig config, ComponentStatus cacheStatus, boolean startCache, Configuration configuration)
+ private DistributedCacheManagerImpl<OutgoingDistributableSessionData> start(String templateCacheName, String hostName, String contextName, String cacheName, ReplicationConfig config, ComponentStatus cacheStatus, boolean startCache, Configuration configuration, CacheContainer container)
{
- DistributedCacheManagerImpl<OutgoingDistributableSessionData> manager = new DistributedCacheManagerImpl<OutgoingDistributableSessionData>(this.manager, this.container, this.storage, this.invoker);
+ DistributedCacheManagerImpl<OutgoingDistributableSessionData> manager = new DistributedCacheManagerImpl<OutgoingDistributableSessionData>(this.manager, this.storage, this.invoker);
@SuppressWarnings("unchecked")
Cache<Object, Object> cache = EasyMock.createStrictMock(Cache.class);
EmbeddedCacheManager cacheManager = EasyMock.createStrictMock(EmbeddedCacheManager.class);
- String templateCacheName = config.getCacheName();
+ EasyMock.expect(this.manager.getReplicationConfig()).andReturn(config);
+
EasyMock.expect(this.manager.getHostName()).andReturn(hostName);
EasyMock.expect(this.manager.getContextName()).andReturn(contextName);
- EasyMock.expect(this.manager.getReplicationConfig()).andReturn(config);
- EasyMock.expect(this.container.getCache()).andReturn(cache);
+ EasyMock.expect(container.getCache()).andReturn(cache);
EasyMock.expect(cache.getCacheManager()).andReturn(cacheManager);
EasyMock.expect(cacheManager.defineConfiguration(cacheName, templateCacheName, new Configuration())).andReturn(configuration);
EasyMock.expect(cacheManager.<String, AtomicMap<Object, Object>>getCache(cacheName)).andReturn(this.cache);
@@ -115,15 +201,15 @@
EasyMock.expect(this.cache.getConfiguration()).andReturn(configuration);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, cache, cacheManager);
+ EasyMock.replay(this.manager, container, this.storage, this.cache, this.invoker, cache, cacheManager);
manager.start();
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, cache, cacheManager);
+ EasyMock.verify(this.manager, container, this.storage, this.cache, this.invoker, cache, cacheManager);
Assert.assertNotNull(manager.getBatchingManager());
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, cache, cacheManager);
+ EasyMock.reset(this.manager, container, this.storage, this.cache, this.invoker, cache, cacheManager);
return manager;
}
@@ -133,7 +219,7 @@
ReplicationConfig config = new ReplicationConfig();
config.setCacheName("session-cache");
- return this.start(null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration());
+ return this.start("session-cache", null, "", "localhost/ROOT", config, ComponentStatus.INSTANTIATED, true, new Configuration(), this.defaultContainer);
}
@Test
@@ -144,12 +230,12 @@
this.cache.removeListener(manager);
this.cache.stop();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.stop();
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -157,12 +243,12 @@
{
DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.sessionCreated("abc");
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -188,11 +274,11 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
manager.storeSessionData(data);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
AtomicMap<Object, Object> map = capturedMap.getValue();
@@ -201,7 +287,7 @@
Assert.assertEquals(timestamp, map.get(Byte.valueOf((byte) AtomicMapEntry.TIMESTAMP.ordinal())));
Assert.assertSame(metadata, map.get(Byte.valueOf((byte) AtomicMapEntry.METADATA.ordinal())));
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -210,15 +296,15 @@
EasyMock.expect(this.cache.put(EasyMock.same(sessionId), EasyMock.same(map))).andReturn(oldMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
AtomicMap<Object, Object> result = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
Assert.assertSame(oldMap, result);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, data);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, data);
}
@Test
@@ -255,11 +341,11 @@
EasyMock.expect(this.storage.load(map)).andReturn(attributes);
}
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, map);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, map);
IncomingDistributableSessionData result = manager.getSessionData(sessionId, null, includeAttributes);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, map);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, map);
Assert.assertNotNull(result);
Assert.assertEquals(version.intValue(), result.getVersion());
@@ -288,7 +374,7 @@
Assert.assertNotNull(exception);
}
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, map);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, map);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -297,15 +383,15 @@
EasyMock.expect(this.cache.get(EasyMock.same(sessionId))).andReturn(expectedMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, expectedMap);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, expectedMap);
AtomicMap<Object, Object> resultMap = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, expectedMap);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, expectedMap);
Assert.assertSame(expectedMap, resultMap);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, expectedMap);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, expectedMap);
}
@Test
@@ -324,15 +410,15 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
IncomingDistributableSessionData result = manager.getSessionData("abc", null, includeAttributes);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertNull(result);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -341,15 +427,15 @@
EasyMock.expect(this.cache.get("abc")).andReturn(expectedMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
AtomicMap<Object, Object> resultMap = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertSame(expectedMap, resultMap);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -364,15 +450,15 @@
{
DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
IncomingDistributableSessionData result = manager.getSessionData("abc", "owner1", includeAttributes);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertNull(result);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -386,12 +472,12 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.removeSession(sessionId);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -400,15 +486,15 @@
EasyMock.expect(this.cache.remove(sessionId)).andReturn(expectedMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
AtomicMap<Object, Object> resultMap = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertSame(expectedMap, resultMap);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -422,12 +508,12 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.removeSessionLocal(sessionId);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -438,15 +524,15 @@
EasyMock.expect(this.cache.withFlags(Flag.CACHE_MODE_LOCAL)).andReturn(this.cache);
EasyMock.expect(this.cache.remove(sessionId)).andReturn(expectedMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
AtomicMap<Object, Object> resultMap = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertSame(expectedMap, resultMap);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -460,12 +546,12 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.removeSessionLocal(sessionId, null);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<AtomicMap<Object, Object>> operation = capturedOperation.getValue();
@@ -476,15 +562,15 @@
EasyMock.expect(this.cache.withFlags(Flag.CACHE_MODE_LOCAL)).andReturn(this.cache);
EasyMock.expect(this.cache.remove(sessionId)).andReturn(expectedMap);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
AtomicMap<Object, Object> resultMap = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertSame(expectedMap, resultMap);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -492,12 +578,12 @@
{
DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.removeSessionLocal("abc", "owner1");
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -511,27 +597,27 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.evictSession(sessionId);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<Void> operation = capturedOperation.getValue();
this.cache.evict(sessionId);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Void result = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertNull(result);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -545,27 +631,27 @@
EasyMock.expect(this.invoker.invoke(EasyMock.same(this.cache), EasyMock.capture(capturedOperation))).andReturn(null);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.evictSession(sessionId, null);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
CacheInvoker.Operation<Void> operation = capturedOperation.getValue();
this.cache.evict(sessionId);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Void result = operation.invoke(this.cache);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertNull(result);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -573,12 +659,12 @@
{
DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.evictSession("abc", "owner1");
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -588,18 +674,18 @@
EasyMock.expect(this.cache.keySet()).andReturn(Collections.singleton("abc"));
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Map<String, String> result = manager.getSessionIds();
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
Assert.assertNotNull(result);
Assert.assertEquals(1, result.size());
Assert.assertTrue(result.containsKey("abc"));
Assert.assertNull(result.get("abc"));
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -615,12 +701,12 @@
this.invoker.setForceSynchronous(forceSynchronous);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
manager.setForceSynchronous(forceSynchronous);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -628,17 +714,17 @@
{
DistributedCacheManager<OutgoingDistributableSessionData> manager = this.startDistributedCacheManager();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
SessionOwnershipSupport support = manager.getSessionOwnershipSupport();
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
// TODO when session ownership support is added, replace these assertions
Assert.assertNull(support);
// Assert.assertSame(manager, support);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker);
}
@Test
@@ -651,23 +737,23 @@
EasyMock.expect(event.isPre()).andReturn(true);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.removed(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
EasyMock.expect(event.isPre()).andReturn(false);
EasyMock.expect(event.isOriginLocal()).andReturn(true);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.removed(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
EasyMock.expect(event.isPre()).andReturn(false);
@@ -676,12 +762,12 @@
this.manager.notifyRemoteInvalidation("abc");
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.removed(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
}
@Test
@@ -694,23 +780,23 @@
EasyMock.expect(event.isPre()).andReturn(true);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.modified(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
EasyMock.expect(event.isPre()).andReturn(false);
EasyMock.expect(event.isOriginLocal()).andReturn(true);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.modified(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
@SuppressWarnings("unchecked")
@@ -731,12 +817,12 @@
EasyMock.expect(this.manager.sessionChangedInDistributedCache("abc", null, version.intValue(), timestamp.longValue(), metadata)).andReturn(false);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event, map);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event, map);
manager.modified(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event, map);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event, map);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event, map);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event, map);
}
@Test
@@ -748,32 +834,32 @@
EasyMock.expect(event.isPre()).andReturn(true);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.activated(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
EasyMock.expect(this.manager.isPassivationEnabled()).andReturn(false);
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.activated(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
EasyMock.expect(this.manager.isPassivationEnabled()).andReturn(true);
this.manager.sessionActivated();
- EasyMock.replay(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.replay(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
manager.activated(event);
- EasyMock.verify(this.manager, this.container, this.storage, this.cache, this.invoker, event);
- EasyMock.reset(this.manager, this.container, this.storage, this.cache, this.invoker, event);
+ EasyMock.verify(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
+ EasyMock.reset(this.manager, this.defaultContainer, this.storage, this.cache, this.invoker, event);
}
}
More information about the jboss-cvs-commits
mailing list