///////////////// validate querying roles for relationId2(added second) returns the correct roles ////////////////////////////////
RoleResult result1 = m_relationService.getAllRoles("relationID2");
RoleList actual1 = result1.getRoles();
// we have to do this as role does not have an equals or hashcode, must check if it is added it will break compatibility!!!!
final Role role = (Role)roleList1.get(0);
boolean success = false;
for (Iterator iterator = actual1.iterator(); iterator.hasNext();)
{
Role role1 = (Role)iterator.next();
String roleName = role1.getRoleName();
if (roleName.equals(role.getRoleName())) success = true;
}
assertTrue(success);
///////////////////// validate querying roles for relaionID (added first) returns the expected roles ///////////////////////////////
RoleResult result = m_relationService.getAllRoles("relationID");
RoleList actual = result.getRoles();
final Role role2 = (Role)roleList.get(0);
boolean success2 = false;
for (Iterator iterator = actual.iterator(); iterator.hasNext();)
{
Role role1 = (Role)iterator.next();
String roleName = role1.getRoleName();
if (roleName.equals(role2.getRoleName())) success2 = true;
}
assertTrue(success2);
//assertTrue(roleList.contains(actual.get(0)));