public void testRemove() throws PureException { User user = new User(); user.setProperty("id", s_nId); s_cache.remove(user); // to find in cache user = (User) s_cache.lookupById(s_nId); assertNull(user); }
public void testPut() throws PureException { User user = new User(); user.setProperty("id", s_nId); user.setName("user-" + s_nId); s_cache.put(user); // to find in cache user = (User) s_cache.lookupById(s_nId); assertNotNull(user); }
public void testHandleEvent() throws PureException { User user = new User(); user.setProperty("id", s_nId); // create event LifecycleEvent event = new LifecycleEvent(ArkConstants.LCEVENT_CREATED, user); s_cache.handleEvent(event); user = (User) s_cache.lookupById(s_nId); assertNotNull(user); // delete evennt event.setType(ArkConstants.LCEVENT_DELETED_AF); s_cache.handleEvent(event); user = (User) s_cache.lookupById(s_nId); assertNull(user); }