throws Exception
{
SecurityService ss = TurbineSecurity.getService();
UserManager um = ss.getUserManager();
User u = um.retrieve("admin");
assertNotNull("No Admin found!", u);
assertEquals("Admin Id wrong!", u.getId(), 1);
// Check Logged in
assertFalse(u.hasLoggedIn());
u.setHasLoggedIn(Boolean.TRUE);
assertTrue(u.hasLoggedIn());
u.setHasLoggedIn(Boolean.FALSE);
assertFalse(u.hasLoggedIn());
// Check perm and temp storage
assertEquals(u.getPermStorage().getClass(), Hashtable.class);
assertEquals(u.getTempStorage().getClass(), Hashtable.class);
Hashtable permStorage = u.getPermStorage();
int access = u.getAccessCounter();
u.incrementAccessCounter();
um.store(u);
u = null;
User u2 = um.retrieve("admin");
// Hashtable has changed
assertNotSame(permStorage, u2.getPermStorage());
// But the Count should be the same
assertEquals(access + 1 , u2.getAccessCounter());
checkUserList();
}