本文整理汇总了Java中org.springframework.boot.autoconfigure.cache.support.MockCachingProvider类的典型用法代码示例。如果您正苦于以下问题:Java MockCachingProvider类的具体用法?Java MockCachingProvider怎么用?Java MockCachingProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MockCachingProvider类属于org.springframework.boot.autoconfigure.cache.support包,在下文中一共展示了MockCachingProvider类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jCacheCacheWithCachesAndCustomConfig
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithCachesAndCustomConfig() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(JCacheCustomConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.cacheNames[0]=one", "spring.cache.cacheNames[1]=two");
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames(), containsInAnyOrder("one", "two"));
assertThat(cacheManager.getCacheNames(), hasSize(2));
CompleteConfiguration<?, ?> defaultCacheConfiguration = this.context
.getBean(CompleteConfiguration.class);
verify(cacheManager.getCacheManager()).createCache("one",
defaultCacheConfiguration);
verify(cacheManager.getCacheManager()).createCache("two",
defaultCacheConfiguration);
}
示例2: jCacheCacheWithProvider
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithProvider() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(DefaultCacheConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn);
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames()).isEmpty();
assertThat(this.context.getBean(javax.cache.CacheManager.class))
.isEqualTo(cacheManager.getCacheManager());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:CacheAutoConfigurationTests.java
示例3: jCacheCacheWithCaches
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithCaches() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(DefaultCacheConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("foo", "bar");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:CacheAutoConfigurationTests.java
示例4: jCacheCacheWithCachesAndCustomConfig
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithCachesAndCustomConfig() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(JCacheCustomConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.cacheNames[0]=one", "spring.cache.cacheNames[1]=two");
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames()).containsOnly("one", "two");
CompleteConfiguration<?, ?> defaultCacheConfiguration = this.context
.getBean(CompleteConfiguration.class);
verify(cacheManager.getCacheManager()).createCache("one",
defaultCacheConfiguration);
verify(cacheManager.getCacheManager()).createCache("two",
defaultCacheConfiguration);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:CacheAutoConfigurationTests.java
示例5: jCacheCacheWithConfig
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithConfig() throws IOException {
String cachingProviderFqn = MockCachingProvider.class.getName();
String configLocation = "org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml";
load(JCacheCustomConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.jcache.config=" + configLocation);
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
Resource configResource = new ClassPathResource(configLocation);
assertThat(cacheManager.getCacheManager().getURI())
.isEqualTo(configResource.getURI());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:CacheAutoConfigurationTests.java
示例6: jCacheCacheWithWrongConfig
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithWrongConfig() {
String cachingProviderFqn = MockCachingProvider.class.getName();
String configLocation = "org/springframework/boot/autoconfigure/cache/does-not-exist.xml";
this.thrown.expect(BeanCreationException.class);
this.thrown.expectMessage("does not exist");
this.thrown.expectMessage(configLocation);
load(JCacheCustomConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.jcache.config=" + configLocation);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:CacheAutoConfigurationTests.java
示例7: jCacheCacheWithProvider
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithProvider() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(DefaultCacheConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn);
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames(), empty());
assertThat(this.context.getBean(javax.cache.CacheManager.class),
equalTo(cacheManager.getCacheManager()));
}
示例8: jCacheCacheWithCaches
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithCaches() {
String cachingProviderFqn = MockCachingProvider.class.getName();
load(DefaultCacheConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.cacheNames[0]=foo", "spring.cache.cacheNames[1]=bar");
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
assertThat(cacheManager.getCacheNames(), containsInAnyOrder("foo", "bar"));
assertThat(cacheManager.getCacheNames(), hasSize(2));
}
示例9: jCacheCacheWithConfig
import org.springframework.boot.autoconfigure.cache.support.MockCachingProvider; //导入依赖的package包/类
@Test
public void jCacheCacheWithConfig() throws IOException {
String cachingProviderFqn = MockCachingProvider.class.getName();
String configLocation = "org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml";
load(JCacheCustomConfiguration.class, "spring.cache.type=jcache",
"spring.cache.jcache.provider=" + cachingProviderFqn,
"spring.cache.jcache.config=" + configLocation);
JCacheCacheManager cacheManager = validateCacheManager(JCacheCacheManager.class);
Resource configResource = new ClassPathResource(configLocation);
assertThat(cacheManager.getCacheManager().getURI(),
equalTo(configResource.getURI()));
}