當前位置: 首頁>>代碼示例>>Java>>正文


Java MockCachingProvider類代碼示例

本文整理匯總了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);
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:18,代碼來源:CacheAutoConfigurationTests.java

示例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()));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:11,代碼來源:CacheAutoConfigurationTests.java

示例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));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:11,代碼來源:CacheAutoConfigurationTests.java

示例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()));
}
 
開發者ID:Nephilim84,項目名稱:contestparser,代碼行數:13,代碼來源:CacheAutoConfigurationTests.java


注:本文中的org.springframework.boot.autoconfigure.cache.support.MockCachingProvider類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。