Now the HibernateUserTest is uses components to connect the different parts together...
[utils] / security / src / test / java / org / wamblee / usermgt / hibernate / UserGroupRepositoryComponent.java
index 3c406ea90b7b59f75ef1eef029dfd80ce746f909..31350fc933759e5b468fdd5c0fc4f011a8e04da5 100644 (file)
  */ 
 package org.wamblee.usermgt.hibernate;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
+import net.sf.ehcache.Ehcache;
+
 import org.hibernate.SessionFactory;
+import org.wamblee.cache.EhCache;
 import org.wamblee.system.core.DefaultProvidedInterface;
 import org.wamblee.system.core.DefaultRequiredInterface;
 import org.wamblee.system.core.ProvidedInterface;
@@ -36,13 +40,14 @@ public class UserGroupRepositoryComponent extends SpringComponent {
     }
 
     private static Map<RequiredInterface, String> createRequired() {
-        Map<RequiredInterface, String> required = new TreeMap<RequiredInterface, String>();
+        Map<RequiredInterface, String> required = new HashMap<RequiredInterface, String>();
         required.put(new DefaultRequiredInterface("sessionFactory", SessionFactory.class), "sessionFactory");
         return required;
     }
 
     private static Map<String, ProvidedInterface> createProvided() {
-        Map<String,ProvidedInterface> provided = new TreeMap<String,ProvidedInterface>(); 
+        Map<String,ProvidedInterface> provided = new HashMap<String,ProvidedInterface>();
+        provided.put("userCache", new DefaultProvidedInterface("cache", EhCache.class));
         provided.put(UserSet.class.getName(), new DefaultProvidedInterface("userset", UserSet.class));
         provided.put(GroupSet.class.getName(), new DefaultProvidedInterface("groupset", GroupSet.class));
         return provided;