1 package eu
.etaxonomy
.cdm
.api
.cache
;
5 import net
.sf
.ehcache
.Cache
;
7 import org
.apache
.log4j
.Logger
;
8 import org
.junit
.Assert
;
11 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.CdmModelCacher
;
12 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.CdmModelFieldPropertyFromClass
;
13 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.CdmRemoteCacheManager
;
16 public class CdmModelGetMethodCacherTest
{
18 private static final Logger logger
= Logger
.getLogger(CdmModelGetMethodCacherTest
.class);
22 public void cacheGettersTest() {
24 CdmModelCacher cmdmc
= new CdmModelCacher();
26 Cache cdmlibCache
= CdmRemoteCacheManager
.getInstance().getCdmModelGetMethodsCache();
27 List
<CdmModelFieldPropertyFromClass
> cmgmfcList
= cmdmc
.getCdmModelGetMethodFromClassList();
29 List
<Object
> keys
= cdmlibCache
.getKeys();
30 Assert
.assertEquals(cmgmfcList
.size(), keys
.size());
32 for(CdmModelFieldPropertyFromClass cmgmfc
: cmgmfcList
) {
33 String className
= cmgmfc
.getClassName();
34 Assert
.assertTrue(keys
.contains(className
));
35 logger
.info("Class Name : " + className
+ " has been cached");
38 //FIXME:Remoting do we need to test this ?
39 // this will cause the following tests to fail since all caches are shutdown
40 //cdmlibCache.removeAll();
41 //CacheManager.create().shutdown();