本文整理匯總了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()));
}