Search in sources :

Example 1 with SpringEmbeddedCacheManager

use of org.infinispan.spring.provider.SpringEmbeddedCacheManager in project spring-boot by spring-projects.

the class CacheAutoConfigurationTests method infinispanCacheWithCachesAndCustomConfig.

@Test
public void infinispanCacheWithCachesAndCustomConfig() {
    load(InfinispanCustomConfiguration.class, "spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
    SpringEmbeddedCacheManager cacheManager = validateCacheManager(SpringEmbeddedCacheManager.class);
    assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
    ConfigurationBuilder defaultConfigurationBuilder = this.context.getBean(ConfigurationBuilder.class);
    verify(defaultConfigurationBuilder, times(2)).build();
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) SpringEmbeddedCacheManager(org.infinispan.spring.provider.SpringEmbeddedCacheManager) Test(org.junit.Test)

Example 2 with SpringEmbeddedCacheManager

use of org.infinispan.spring.provider.SpringEmbeddedCacheManager in project spring-boot by spring-projects.

the class CacheAutoConfigurationTests method infinispanCacheWithCaches.

@Test
public void infinispanCacheWithCaches() {
    load(DefaultCacheConfiguration.class, "spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
    SpringEmbeddedCacheManager cacheManager = validateCacheManager(SpringEmbeddedCacheManager.class);
    assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
}
Also used : SpringEmbeddedCacheManager(org.infinispan.spring.provider.SpringEmbeddedCacheManager) Test(org.junit.Test)

Example 3 with SpringEmbeddedCacheManager

use of org.infinispan.spring.provider.SpringEmbeddedCacheManager in project spring-boot by spring-projects.

the class CacheAutoConfigurationTests method infinispanCacheWithConfig.

@Test
public void infinispanCacheWithConfig() {
    load(DefaultCacheConfiguration.class, "spring.cache.type=infinispan", "spring.cache.infinispan.config=infinispan.xml");
    SpringEmbeddedCacheManager cacheManager = validateCacheManager(SpringEmbeddedCacheManager.class);
    assertThat(cacheManager.getCacheNames()).contains("foo", "bar");
}
Also used : SpringEmbeddedCacheManager(org.infinispan.spring.provider.SpringEmbeddedCacheManager) Test(org.junit.Test)

Aggregations

SpringEmbeddedCacheManager (org.infinispan.spring.provider.SpringEmbeddedCacheManager)3 Test (org.junit.Test)3 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1