throws Exception
{
SecurityService ss = TurbineSecurity.getService();
UserManager um = ss.getUserManager();
User newbie = TurbineSecurity.getUserInstance();
newbie.setName("newbie");
newbie.setFirstName("John");
newbie.setLastName("Doe");
um.createAccount(newbie, "newbie");
List users = um.retrieveList(new org.apache.torque.util.Criteria());
assertEquals("User was not added", users.size(), 3);
try
{
User admin = um.retrieve("admin");
um.createAccount(admin, "admin");
fail("Existing User could be added!");
}
catch (Exception e)
{
assertEquals("Wrong Exception thrown: " + e.getClass().getName(), e.getClass(), EntityExistsException.class);
}
try
{
User empty = TurbineSecurity.getUserInstance();
um.createAccount(empty, "empty");
fail("User with empty Username could be added!");
}
catch (Exception e)