我遇到了以下問題。Ehcache在運行測試套件時會導致異常
我在我的項目中有一個測試套裝,每個測試都運行良好。
然而,當我運行它們作爲套件我一些他們的失敗,出現以下異常:
Caused by: java.lang.IllegalStateException: The dao Cache is not alive (STATUS_SHUTDOWN)
at net.sf.ehcache.Cache$CacheStatus.checkAlive(Cache.java:4269)
at net.sf.ehcache.Cache.checkStatus(Cache.java:2703)
at net.sf.ehcache.Cache.get(Cache.java:1576)
at org.springframework.cache.ehcache.EhCacheCache.get(EhCacheCache.java:61)
at org.springframework.cache.interceptor.CacheAspectSupport.inspectCacheables(CacheAspectSupport.java:310)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:198)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
是否有辦法避免這種行爲,即保持高速緩存活在多個測試或關機正常嗎?
如何可以在測試上下文中將共享屬性設置爲false,可以提供一個示例? – 2013-08-13 10:19:10