Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ISPN-2271 removed deprecated api usage in tests

  • Loading branch information...
commit d2456405fee9ec737d7e66fad7f2be20b6188260 1 parent d9ee40a
@kosch kosch authored tristantarrant committed
View
9 spring/src/main/java/org/infinispan/spring/ConfigurationOverrides.java
@@ -30,6 +30,7 @@
import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.eviction.EvictionThreadPolicy;
import org.infinispan.remoting.ReplicationQueue;
+import org.infinispan.transaction.LockingMode;
import org.infinispan.transaction.lookup.TransactionManagerLookup;
import org.infinispan.util.Util;
import org.infinispan.util.concurrent.IsolationLevel;
@@ -692,8 +693,7 @@ public void applyOverridesTo(final ConfigurationBuilder configurationToOverride)
}
if (this.useEagerLocking != null) {
this.logger.debug("Overriding property [useEagerLocking] with value [" + this.useEagerLocking + "]");
- //FIXME
- //.setUseEagerLocking(this.useEagerLocking);
+ configurationToOverride.transaction().lockingMode(useEagerLocking ? LockingMode.PESSIMISTIC : LockingMode.OPTIMISTIC);
}
if (this.useReplQueue != null) {
this.logger.debug("Overriding property [useReplQueue] with value [" + this.useReplQueue + "]");
@@ -751,11 +751,12 @@ public void applyOverridesTo(final ConfigurationBuilder configurationToOverride)
}
if (this.rehashEnabled != null) {
this.logger.debug("Overriding property [rehashEnabled] with value [" + this.rehashEnabled + "]");
- configurationToOverride.clustering().hash().rehashEnabled(this.rehashEnabled);
+ configurationToOverride.clustering().stateTransfer().fetchInMemoryState(this.rehashEnabled);
}
if (this.rehashWaitTime != null) {
this.logger.debug("Overriding property [rehashWaitTime] with value [" + this.rehashWaitTime + "]");
- configurationToOverride.clustering().hash().rehashWait(this.rehashWaitTime);
+ //FIXME
+ // no longer used
}
if (this.useAsyncMarshalling != null) {
this.logger.debug("Overriding property [useAsyncMarshalling] with value [" + this.useAsyncMarshalling + "]");
View
8 spring/src/main/java/org/infinispan/spring/provider/SpringEmbeddedCacheManagerFactoryBean.java
@@ -34,7 +34,7 @@
* A {@link org.springframework.beans.factory.FactoryBean <code>FactoryBean</code>} for creating an
* {@link org.infinispan.spring.provider.SpringEmbeddedCacheManager
* <code>SpringEmbeddedCacheManager</code>} instance. The location of the Infinispan configuration
- * file used to provide the default {@link org.infinispan.config.Configuration configuration} for
+ * file used to provide the default {@link org.infinispan.configuration.cache.Configuration configuration} for
* the <code>EmbeddedCacheManager</code> instance created by this <code>FactoryBean</code> is
* {@link #setConfigurationFileLocation(org.springframework.core.io.Resource) configurable}.
* </p>
@@ -66,7 +66,7 @@
* @see #destroy()
* @see org.infinispan.spring.provider.SpringEmbeddedCacheManager
* @see org.infinispan.manager.EmbeddedCacheManager
- * @see org.infinispan.config.Configuration
+ * @see org.infinispan.configuration.cache.Configuration
*
*/
public class SpringEmbeddedCacheManagerFactoryBean extends AbstractEmbeddedCacheManagerFactory
@@ -83,12 +83,12 @@
*/
@Override
public void afterPropertiesSet() throws Exception {
- this.logger.info("Initializing SpringEmbeddedCacheManager instance ...");
+ logger.info("Initializing SpringEmbeddedCacheManager instance ...");
final EmbeddedCacheManager nativeEmbeddedCacheManager = createBackingEmbeddedCacheManager();
this.cacheManager = new SpringEmbeddedCacheManager(nativeEmbeddedCacheManager);
- this.logger.info("Successfully initialized SpringEmbeddedCacheManager instance ["
+ logger.info("Successfully initialized SpringEmbeddedCacheManager instance ["
+ this.cacheManager + "]");
}
View
8 spring/src/main/java/org/infinispan/spring/support/embedded/InfinispanEmbeddedCacheManagerFactoryBean.java
@@ -34,7 +34,7 @@
* A {@link org.springframework.beans.factory.FactoryBean <code>FactoryBean</code>} for creating an
* {@link org.infinispan.manager.EmbeddedCacheManager <code>Infinispan EmbeddedCacheManager</code>}
* instance. The location of the Infinispan configuration file used to provide the default
- * {@link org.infinispan.config.Configuration configuration} for the
+ * {@link org.infinispan.configuration.cache.Configuration configuration} for the
* <code>EmbeddedCacheManager</code> instance created by this <code>FactoryBean</code> is
* {@link #setConfigurationFileLocation(org.springframework.core.io.Resource) configurable}.
* </p>
@@ -65,7 +65,7 @@
* @see #setConfigurationFileLocation(org.springframework.core.io.Resource)
* @see #destroy()
* @see org.infinispan.manager.EmbeddedCacheManager
- * @see org.infinispan.config.Configuration
+ * @see org.infinispan.configuration.cache.Configuration
*
*/
public class InfinispanEmbeddedCacheManagerFactoryBean extends AbstractEmbeddedCacheManagerFactory
@@ -82,11 +82,11 @@
*/
@Override
public void afterPropertiesSet() throws Exception {
- this.logger.info("Initializing Infinispan EmbeddedCacheManager instance ...");
+ logger.info("Initializing Infinispan EmbeddedCacheManager instance ...");
this.cacheManager = createBackingEmbeddedCacheManager();
- this.logger.info("Successfully initialized Infinispan EmbeddedCacheManager instance ["
+ logger.info("Successfully initialized Infinispan EmbeddedCacheManager instance ["
+ this.cacheManager + "]");
}
View
14 spring/src/test/java/org/infinispan/spring/ConfigurationOverridesTest.java
@@ -27,12 +27,13 @@
import java.util.List;
import org.infinispan.config.CacheLoaderManagerConfig;
+import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.Configuration;
-import org.infinispan.config.Configuration.CacheMode;
import org.infinispan.config.CustomInterceptorConfig;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.eviction.EvictionThreadPolicy;
+import org.infinispan.transaction.LockingMode;
import org.infinispan.transaction.lookup.JBossTransactionManagerLookup;
import org.infinispan.transaction.lookup.TransactionManagerLookup;
import org.infinispan.util.concurrent.IsolationLevel;
@@ -591,10 +592,11 @@ public final void configurationOverridesShouldOverrideSyncRollbackPhasePropIfExp
@Test
public final void configurationOverridesShouldOverrideUseEagerLockingPropIfExplicitlySet()
throws Exception {
- final boolean expectedUseEagerLocking = true;
+
+ final LockingMode expectedLockingMode = LockingMode.PESSIMISTIC;
final ConfigurationOverrides objectUnderTest = new ConfigurationOverrides();
- objectUnderTest.setUseEagerLocking(expectedUseEagerLocking);
+ objectUnderTest.setUseEagerLocking(true);
final ConfigurationBuilder defaultConfiguration = new ConfigurationBuilder();
objectUnderTest.applyOverridesTo(defaultConfiguration);
Configuration configuration = defaultConfiguration.build();
@@ -602,8 +604,8 @@ public final void configurationOverridesShouldOverrideUseEagerLockingPropIfExpli
AssertJUnit
.assertEquals(
"ConfigurationOverrides should have overridden default value with explicitly set UseEagerLocking property. However, it didn't.",
- expectedUseEagerLocking,
- configuration.transaction().useEagerLocking());
+ expectedLockingMode,
+ configuration.transaction().lockingMode());
}
@Test
@@ -777,7 +779,7 @@ public final void configurationOverridesShouldOverrideConsistentHashClassPropIfE
AssertJUnit
.assertEquals(
"ConfigurationOverrides should have overridden default value with explicitly set ConsistentHashClass property. However, it didn't.",
- expectedConsistentHashClass, configuration.clustering().hash().consistentHash().getClass().getName());
+ expectedConsistentHashClass, configuration.clustering().hash().consistentHashFactory().getClass().getName());
}
@Test
View
75 spring/src/test/java/org/infinispan/spring/provider/SpringEmbeddedCacheManagerFactoryBeanTest.java
@@ -31,9 +31,9 @@
import java.util.Properties;
import org.infinispan.Cache;
-import org.infinispan.config.GlobalConfiguration.ShutdownHookBehavior;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.global.GlobalConfigurationBuilder;
+import org.infinispan.configuration.global.ShutdownHookBehavior;
import org.infinispan.jmx.MBeanServerLookup;
import org.infinispan.jmx.PlatformMBeanServerLookup;
import org.infinispan.lifecycle.ComponentStatus;
@@ -204,10 +204,9 @@ protected EmbeddedCacheManager createCacheManager(GlobalConfigurationBuilder glo
final SpringEmbeddedCacheManager springEmbeddedCacheManager = objectUnderTest.getObject();
assertEquals(
- "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ExposeGlobalJmxStatistics. However, it didn't.",
- expectedExposeGlobalJmxStatistics, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .isExposeGlobalJmxStatistics());
+ "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ExposeGlobalJmxStatistics. However, it didn't.",
+ expectedExposeGlobalJmxStatistics, springEmbeddedCacheManager
+ .getNativeCacheManager().getCacheManagerConfiguration().globalJmxStatistics().enabled());
springEmbeddedCacheManager.stop();
}
@@ -229,7 +228,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseJmxDomainPropIfE
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set JmxDomain. However, it didn't.",
expectedJmxDomain, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getJmxDomain());
+ .getCacheManagerConfiguration().globalJmxStatistics().domain());
springEmbeddedCacheManager.stop();
}
@@ -252,7 +251,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerPrope
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerProperties. However, it didn't.",
expectedMBeanServerProperties, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getMBeanServerProperties());
+ .getCacheManagerConfiguration().globalJmxStatistics().properties());
springEmbeddedCacheManager.stop();
}
@@ -296,7 +295,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerLooku
assertSame(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerLookup. However, it didn't.",
expectedMBeanServerLookup.getClass().getName(), springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration().getMBeanServerLookup());
+ .getNativeCacheManager().getCacheManagerConfiguration().globalJmxStatistics().mbeanServerLookup().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -318,7 +317,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseAllowDuplicateDo
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AllowDuplicateDomains. However, it didn't.",
expectedAllowDuplicateDomains, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().isAllowDuplicateDomains());
+ .getCacheManagerConfiguration().globalJmxStatistics().allowDuplicateDomains());
springEmbeddedCacheManager.stop();
}
@@ -340,7 +339,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseCacheManagerName
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set CacheManagerName. However, it didn't.",
expectedCacheManagerName, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getCacheManagerName());
+ .getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName());
springEmbeddedCacheManager.stop();
}
@@ -362,7 +361,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseStrictPeerToPeer
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set StrictPeerToPeer. However, it didn't.",
expectedStrictPeerToPeer, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().isStrictPeerToPeer());
+ .getCacheManagerConfiguration().transport().strictPeerToPeer());
springEmbeddedCacheManager.stop();
}
@@ -385,8 +384,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseAsyncListenerExe
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncListenerExecutorFactoryClass. However, it didn't.",
expectedAsyncListenerExecutorFactoryClass, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getAsyncListenerExecutorFactoryClass());
+ .getNativeCacheManager().getCacheManagerConfiguration().asyncListenerExecutor().factory().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -409,8 +407,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseAsyncTransportEx
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncTransportExecutorFactoryClass. However, it didn't.",
expectedAsyncTransportExecutorFactoryClass, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getAsyncTransportExecutorFactoryClass());
+ .getNativeCacheManager().getCacheManagerConfiguration().asyncTransportExecutor().factory().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -434,8 +431,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseEvictionSchedule
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set EvictionScheduledExecutorFactoryClass. However, it didn't.",
expectedEvictionScheduledExecutorFactoryClass, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getEvictionScheduledExecutorFactoryClass());
+ .getNativeCacheManager().getCacheManagerConfiguration().evictionScheduledExecutor().factory().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -459,8 +455,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseReplicationQueue
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ReplicationQueueScheduledExecutorFactoryClass. However, it didn't.",
expectedReplicationQueueScheduledExecutorFactoryClass, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getReplicationQueueScheduledExecutorFactoryClass());
+ .getNativeCacheManager().getCacheManagerConfiguration().replicationQueueScheduledExecutor().factory().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -480,9 +475,9 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseMarshallerClassP
final SpringEmbeddedCacheManager springEmbeddedCacheManager = objectUnderTest.getObject();
assertEquals(
- "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MarshallerClass. However, it didn't.",
- expectedMarshallerClass, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getMarshallerClass());
+ "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MarshallerClass. However, it didn't.",
+ expectedMarshallerClass, springEmbeddedCacheManager.getNativeCacheManager()
+ .getCacheManagerConfiguration().serialization().marshaller().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -502,9 +497,9 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseTransportNodeNam
final SpringEmbeddedCacheManager springEmbeddedCacheManager = objectUnderTest.getObject();
assertEquals(
- "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportNodeName. However, it didn't.",
- expectedTransportNodeName, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getTransportNodeName());
+ "SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportNodeName. However, it didn't.",
+ expectedTransportNodeName, springEmbeddedCacheManager.getNativeCacheManager()
+ .getCacheManagerConfiguration().transport().nodeName());
springEmbeddedCacheManager.stop();
}
@@ -526,7 +521,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseTransportClassPr
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportClass. However, it didn't.",
expectedTransportClass, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getTransportClass());
+ .getCacheManagerConfiguration().transport().transport().getClass().getName());
springEmbeddedCacheManager.stop();
}
@@ -549,7 +544,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseTransportPropert
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportProperties. However, it didn't.",
expectedTransportProperties, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getTransportProperties());
+ .getCacheManagerConfiguration().transport().properties());
springEmbeddedCacheManager.stop();
}
@@ -571,7 +566,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseClusterNamePropI
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ClusterName. However, it didn't.",
expectedClusterName, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getClusterName());
+ .getCacheManagerConfiguration().transport().clusterName());
springEmbeddedCacheManager.stop();
}
@@ -593,7 +588,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseMachineIdPropIfE
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MachineId. However, it didn't.",
expectedMachineId, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getMachineId());
+ .getCacheManagerConfiguration().transport().machineId());
springEmbeddedCacheManager.stop();
}
@@ -615,7 +610,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseRackIdPropIfExpl
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set RackId. However, it didn't.",
expectedRackId, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getRackId());
+ .getCacheManagerConfiguration().transport().rackId());
springEmbeddedCacheManager.stop();
}
@@ -637,7 +632,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseSiteIdPropIfExpl
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set SiteId. However, it didn't.",
expectedSiteId, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getSiteId());
+ .getCacheManagerConfiguration().transport().siteId());
springEmbeddedCacheManager.stop();
}
@@ -657,7 +652,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseShutdownHookBeha
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ShutdownHookBehavior. However, it didn't.",
ShutdownHookBehavior.DONT_REGISTER, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration().getShutdownHookBehavior());
+ .getNativeCacheManager().getCacheManagerConfiguration().shutdown().hookBehavior());
springEmbeddedCacheManager.stop();
}
@@ -680,8 +675,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseAsyncListenerExe
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncListenerExecutorProperties. However, it didn't.",
expectedAsyncListenerExecutorProperties, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getAsyncListenerExecutorProperties());
+ .getNativeCacheManager().getCacheManagerConfiguration().asyncListenerExecutor().properties());
springEmbeddedCacheManager.stop();
}
@@ -704,8 +698,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseAsyncTransportEx
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncTransportExecutorProperties. However, it didn't.",
expectedAsyncTransportExecutorProperties, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getAsyncTransportExecutorProperties());
+ .getNativeCacheManager().getCacheManagerConfiguration().asyncTransportExecutor().properties());
springEmbeddedCacheManager.stop();
}
@@ -729,8 +722,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseEvictionSchedule
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set EvictionScheduledExecutorProperties. However, it didn't.",
expectedEvictionScheduledExecutorProperties, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getEvictionScheduledExecutorProperties());
+ .getNativeCacheManager().getCacheManagerConfiguration().evictionScheduledExecutor().properties());
springEmbeddedCacheManager.stop();
}
@@ -754,8 +746,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseReplicationQueue
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ReplicationQueueScheduledExecutorProperties. However, it didn't.",
expectedReplicationQueueScheduledExecutorProperties, springEmbeddedCacheManager
- .getNativeCacheManager().getGlobalConfiguration()
- .getReplicationQueueScheduledExecutorProperties());
+ .getNativeCacheManager().getCacheManagerConfiguration().replicationQueueScheduledExecutor().properties());
springEmbeddedCacheManager.stop();
}
@@ -777,7 +768,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseMarshallVersionP
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MarshallVersion. However, it didn't.",
setMarshallVersion, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getMarshallVersion());
+ .getCacheManagerConfiguration().serialization().version());
springEmbeddedCacheManager.stop();
}
@@ -799,7 +790,7 @@ public final void springEmbeddedCacheManagerFactoryBeanShouldUseDistributedSyncT
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set DistributedSyncTimeout. However, it didn't.",
expectedDistributedSyncTimeout, springEmbeddedCacheManager.getNativeCacheManager()
- .getGlobalConfiguration().getDistributedSyncTimeout());
+ .getCacheManagerConfiguration().transport().distributedSyncTimeout());
springEmbeddedCacheManager.stop();
}
}
View
107 .../src/test/java/org/infinispan/spring/support/embedded/InfinispanEmbeddedCacheManagerFactoryBeanTest.java
@@ -32,9 +32,9 @@
import java.util.Properties;
import org.infinispan.Cache;
-import org.infinispan.config.Configuration;
-import org.infinispan.config.Configuration.CacheMode;
-import org.infinispan.config.GlobalConfiguration.ShutdownHookBehavior;
+import org.infinispan.configuration.cache.CacheMode;
+import org.infinispan.configuration.cache.Configuration;
+import org.infinispan.configuration.global.ShutdownHookBehavior;
import org.infinispan.jmx.MBeanServerLookup;
import org.infinispan.jmx.PlatformMBeanServerLookup;
import org.infinispan.lifecycle.ComponentStatus;
@@ -111,9 +111,8 @@ public void call() {
"getObject() should have returned a valid EmbeddedCacheManager, configured using the configuration file "
+ "set on SpringEmbeddedCacheManagerFactoryBean. However, it returned null.",
cm);
- final Cache<Object, Object> cacheDefinedInCustomConfiguration = cm
- .getCache(CACHE_NAME_FROM_CONFIGURATION_FILE);
- final Configuration configuration = cacheDefinedInCustomConfiguration.getConfiguration();
+ final Cache<Object, Object> cacheDefinedInCustomConfiguration = cm.getCache(CACHE_NAME_FROM_CONFIGURATION_FILE);
+ final Configuration configuration = cacheDefinedInCustomConfiguration.getCacheConfiguration();
assertEquals(
"The cache named ["
+ CACHE_NAME_FROM_CONFIGURATION_FILE
@@ -121,7 +120,7 @@ public void call() {
+ CACHE_NAME_FROM_CONFIGURATION_FILE
+ ") has a different cache mode. Obviously, SpringEmbeddedCacheManagerFactoryBean did not use "
+ "the configuration file when instantiating EmbeddedCacheManager.",
- CacheMode.REPL_ASYNC, configuration.getCacheMode());
+ CacheMode.REPL_ASYNC, configuration.clustering().cacheMode());
}
});
}
@@ -212,8 +211,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseExposeGlobal
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ExposeGlobalJmxStatistics. However, it didn't.",
- expectedExposeGlobalJmxStatistics, cm.getGlobalConfiguration()
- .isExposeGlobalJmxStatistics());
+ expectedExposeGlobalJmxStatistics, cm.getCacheManagerConfiguration().globalJmxStatistics().enabled());
}
});
}
@@ -236,7 +234,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseJmxDomainPro
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set JmxDomain. However, it didn't.",
- expectedJmxDomain, cm.getGlobalConfiguration().getJmxDomain());
+ expectedJmxDomain, cm.getCacheManagerConfiguration().globalJmxStatistics().domain());
}
});
}
@@ -260,8 +258,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerP
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerProperties. However, it didn't.",
- expectedMBeanServerProperties, cm.getGlobalConfiguration()
- .getMBeanServerProperties());
+ expectedMBeanServerProperties, cm.getCacheManagerConfiguration().globalJmxStatistics().properties());
}
});
}
@@ -284,8 +281,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerL
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerLookupClass. However, it didn't.",
- expectedMBeanServerLookup.getClass().getName(), cm
- .getGlobalConfiguration().getMBeanServerLookup());
+ expectedMBeanServerLookup.getClass().getName(),
+ cm.getCacheManagerConfiguration().globalJmxStatistics().mbeanServerLookup().getClass().getName());
}
});
}
@@ -308,8 +305,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMBeanServerL
public void call() {
assertSame(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MBeanServerLookup. However, it didn't.",
- expectedMBeanServerLookup.getClass().getName(), cm
- .getGlobalConfiguration().getMBeanServerLookup());
+ expectedMBeanServerLookup, cm.getCacheManagerConfiguration().globalJmxStatistics().mbeanServerLookup());
}
});
}
@@ -332,8 +328,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseAllowDuplica
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AllowDuplicateDomains. However, it didn't.",
- expectedAllowDuplicateDomains, cm.getGlobalConfiguration()
- .isAllowDuplicateDomains());
+ expectedAllowDuplicateDomains, cm.getCacheManagerConfiguration().globalJmxStatistics().allowDuplicateDomains());
}
});
}
@@ -356,8 +351,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseCacheManager
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set CacheManagerName. However, it didn't.",
- expectedCacheManagerName, cm.getGlobalConfiguration()
- .getCacheManagerName());
+ expectedCacheManagerName, cm.getCacheManagerConfiguration().globalJmxStatistics().cacheManagerName());
}
});
@@ -381,8 +375,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseStrictPeerTo
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set StrictPeerToPeer. However, it didn't.",
- expectedStrictPeerToPeer, cm.getGlobalConfiguration()
- .isStrictPeerToPeer());
+ expectedStrictPeerToPeer, cm.getCacheManagerConfiguration().transport().strictPeerToPeer());
}
});
@@ -407,8 +400,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseAsyncListene
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncListenerExecutorFactoryClass. However, it didn't.",
- expectedAsyncListenerExecutorFactoryClass, cm
- .getGlobalConfiguration().getAsyncListenerExecutorFactoryClass());
+ expectedAsyncListenerExecutorFactoryClass,
+ cm.getCacheManagerConfiguration().asyncListenerExecutor().factory().getClass().getName());
}
});
}
@@ -432,8 +425,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseAsyncTranspo
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncTransportExecutorFactoryClass. However, it didn't.",
- expectedAsyncTransportExecutorFactoryClass, cm
- .getGlobalConfiguration().getAsyncTransportExecutorFactoryClass());
+ expectedAsyncTransportExecutorFactoryClass,
+ cm.getCacheManagerConfiguration().asyncTransportExecutor().factory().getClass().getName());
}
});
}
@@ -457,8 +450,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseEvictionSche
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set EvictionScheduledExecutorFactoryClass. However, it didn't.",
- expectedEvictionScheduledExecutorFactoryClass, cm
- .getGlobalConfiguration().getEvictionScheduledExecutorFactoryClass());
+ expectedEvictionScheduledExecutorFactoryClass,
+ cm.getCacheManagerConfiguration().evictionScheduledExecutor().factory().getClass().getName());
}
});
}
@@ -482,9 +475,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseReplicationQ
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ReplicationQueueScheduledExecutorFactoryClass. However, it didn't.",
- expectedReplicationQueueScheduledExecutorFactoryClass, cm
- .getGlobalConfiguration()
- .getReplicationQueueScheduledExecutorFactoryClass());
+ expectedReplicationQueueScheduledExecutorFactoryClass,
+ cm.getCacheManagerConfiguration().replicationQueueScheduledExecutor().factory().getClass().getName());
}
});
}
@@ -497,7 +489,7 @@ public void call() {
@Test
public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMarshallerClassPropIfExplicitlySet()
throws Exception {
- final String expectedMarshallerClass = new VersionAwareMarshaller().getClass().getName();
+ final String expectedMarshallerClass = VersionAwareMarshaller.class.getName();
final InfinispanEmbeddedCacheManagerFactoryBean objectUnderTest = new TestInfinispanEmbeddedCacheManagerFactoryBean();
objectUnderTest.setMarshallerClass(expectedMarshallerClass);
@@ -507,8 +499,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMarshallerCl
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MarshallerClass. However, it didn't.",
- expectedMarshallerClass, cm.getGlobalConfiguration()
- .getMarshallerClass());
+ expectedMarshallerClass,
+ cm.getCacheManagerConfiguration().serialization().marshaller().getClass().getName());
}
});
}
@@ -531,8 +523,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseTransportNod
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportNodeName. However, it didn't.",
- expectedTransportNodeName, cm.getGlobalConfiguration()
- .getTransportNodeName());
+ expectedTransportNodeName, cm.getCacheManagerConfiguration().transport().nodeName());
}
});
}
@@ -555,8 +546,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseTransportCla
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportClass. However, it didn't.",
- expectedTransportClass, cm.getGlobalConfiguration()
- .getTransportClass());
+ expectedTransportClass,
+ cm.getCacheManagerConfiguration().transport().transport().getClass().getName());
}
});
}
@@ -580,8 +571,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseTransportPro
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set TransportProperties. However, it didn't.",
- expectedTransportProperties, cm.getGlobalConfiguration()
- .getTransportProperties());
+ expectedTransportProperties,
+ cm.getCacheManagerConfiguration().transport().properties());
}
});
}
@@ -604,7 +595,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseClusterNameP
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ClusterName. However, it didn't.",
- expectedClusterName, cm.getGlobalConfiguration().getClusterName());
+ expectedClusterName, cm.getCacheManagerConfiguration().transport().clusterName());
}
});
}
@@ -627,7 +618,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMachineIdPro
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MachineId. However, it didn't.",
- expectedMachineId, cm.getGlobalConfiguration().getMachineId());
+ expectedMachineId, cm.getCacheManagerConfiguration().transport().machineId());
}
});
}
@@ -650,7 +641,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseRackIdPropIf
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set RackId. However, it didn't.",
- expectedRackId, cm.getGlobalConfiguration().getRackId());
+ expectedRackId, cm.getCacheManagerConfiguration().transport().rackId());
}
});
}
@@ -673,7 +664,7 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseSiteIdPropIf
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set SiteId. However, it didn't.",
- expectedSiteId, cm.getGlobalConfiguration().getSiteId());
+ expectedSiteId, cm.getCacheManagerConfiguration().transport().siteId());
}
});
}
@@ -694,8 +685,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseShutdownHook
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ShutdownHookBehavior. However, it didn't.",
- ShutdownHookBehavior.DONT_REGISTER, cm.getGlobalConfiguration()
- .getShutdownHookBehavior());
+ ShutdownHookBehavior.DONT_REGISTER,
+ cm.getCacheManagerConfiguration().shutdown().hookBehavior());
}
});
}
@@ -719,8 +710,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseAsyncListene
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncListenerExecutorProperties. However, it didn't.",
- expectedAsyncListenerExecutorProperties, cm
- .getGlobalConfiguration().getAsyncListenerExecutorProperties());
+ expectedAsyncListenerExecutorProperties,
+ cm.getCacheManagerConfiguration().asyncListenerExecutor().properties());
}
});
}
@@ -744,8 +735,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseAsyncTranspo
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set AsyncTransportExecutorProperties. However, it didn't.",
- expectedAsyncTransportExecutorProperties, cm
- .getGlobalConfiguration().getAsyncTransportExecutorProperties());
+ expectedAsyncTransportExecutorProperties,
+ cm.getCacheManagerConfiguration().asyncTransportExecutor().properties());
}
});
}
@@ -770,8 +761,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseEvictionSche
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set EvictionScheduledExecutorProperties. However, it didn't.",
- expectedEvictionScheduledExecutorProperties, cm
- .getGlobalConfiguration().getEvictionScheduledExecutorProperties());
+ expectedEvictionScheduledExecutorProperties,
+ cm.getCacheManagerConfiguration().evictionScheduledExecutor().properties());
}
});
}
@@ -796,8 +787,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseReplicationQ
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set ReplicationQueueScheduledExecutorProperties. However, it didn't.",
- expectedReplicationQueueScheduledExecutorProperties, cm
- .getGlobalConfiguration().getReplicationQueueScheduledExecutorProperties());
+ expectedReplicationQueueScheduledExecutorProperties,
+ cm.getCacheManagerConfiguration().replicationQueueScheduledExecutor().properties());
}
});
}
@@ -820,8 +811,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseMarshallVers
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set MarshallVersion. However, it didn't.",
- setMarshallVersion, cm.getGlobalConfiguration()
- .getMarshallVersion());
+ setMarshallVersion,
+ cm.getCacheManagerConfiguration().serialization().version());
}
});
}
@@ -844,8 +835,8 @@ public final void infinispanEmbeddedCacheManagerFactoryBeanShouldUseDistributedS
public void call() {
assertEquals(
"SpringEmbeddedCacheManagerFactoryBean should have used explicitly set DistributedSyncTimeout. However, it didn't.",
- expectedDistributedSyncTimeout, cm.getGlobalConfiguration()
- .getDistributedSyncTimeout());
+ expectedDistributedSyncTimeout,
+ cm.getCacheManagerConfiguration().transport().distributedSyncTimeout());
}
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.