public void setUp() throws Exception { this.service = (CacheService) PortalContainer.getInstance().getComponentInstanceOfType(CacheService.class); this.cache = (MCExoCache<Serializable, Object>) service.getCacheInstance("myCache"); this.factory = (ExoCacheFactory) PortalContainer.getInstance().getComponentInstanceOfType(ExoCacheFactory.class); listener = new MyCacheListener<Object>(); cache.addCacheListener(listener); }