public void testAddGroup()
throws Exception
{
SecurityService ss = TurbineSecurity.getService();
Group newbie = ss.getGroupInstance();
newbie.setName("newbie");
ss.addGroup(newbie);
assertEquals("Group was not added", 3, ss.getAllGroups().size());
try
{
Group turbine = ss.getGroupByName("Turbine");
ss.addGroup(turbine);
fail("Existing Group could be added!");
}
catch (Exception e)
{
assertEquals("Wrong Exception thrown: " + e.getClass().getName(), EntityExistsException.class, e.getClass());
}
try
{
Group empty = ss.getGroupInstance();
ss.addGroup(empty);
fail("Group with empty Groupname could be added!");
}
catch (Exception e)