Index: core-module/src/test/java/egovframework/SpringUnitTestSample.java =================================================================== diff -u -rc41ae0ad9e7fe3b7781abd7686d5a1cbf2a4be3c -r383376746bc1db9dba54a42645d25d0028bf6254 --- core-module/src/test/java/egovframework/SpringUnitTestSample.java (.../SpringUnitTestSample.java) (revision c41ae0ad9e7fe3b7781abd7686d5a1cbf2a4be3c) +++ core-module/src/test/java/egovframework/SpringUnitTestSample.java (.../SpringUnitTestSample.java) (revision 383376746bc1db9dba54a42645d25d0028bf6254) @@ -1,14 +1,21 @@ package egovframework; import egovframework.com.ext.jstree.springHibernate.core.service.JsTreeHibernateService; +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.Element; import org.junit.Test; import org.junit.runner.RunWith; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import javax.annotation.Resource; + /** * Created by Administrator on 2019-10-24. */ @@ -21,11 +28,35 @@ @Qualifier("JsTreeHibernateService") private JsTreeHibernateService jsTreeHibernateService; + public Logger logger = LoggerFactory.getLogger(this.getClass()); + @Resource(name = "customCacheManager") + CacheManager cacheManager; + + @Test public void functionalScannerTest() { System.out.println("springTestStart"); } + @Test + public void chacheTest(){ + Cache tmpcache = cacheManager.getCache("LocalEhCache"); + + String urlCacheKey = "/api/v1/test" + "/engine/2019.12.01.03/2019-12/48967"; + String strCacheValue = "test Value"; + + tmpcache.put(new Element(urlCacheKey, strCacheValue)); + Element value = tmpcache.get(urlCacheKey); + logger.info(value.getValue().toString()); + + tmpcache.remove(urlCacheKey); + + tmpcache.put(new Element(urlCacheKey, strCacheValue)); + + + } + + }