/**
* Test create relation type, getRoleInfo and getRoleInfos
*/
public void testCreationRelationType() throws Exception
{
RoleInfo roleInfo1 = null;
RoleInfo roleInfo2 = null;
RoleInfo[] roleInfos = null;
RelationService rs = null;
ArrayList result = null;
RoleInfo result1 = null;
RoleInfo result2 = null;
roleInfo1 = new RoleInfo("roleInfo1", Trivial.class.getName());
roleInfo2 = new RoleInfo("roleInfo2", Trivial.class.getName());
roleInfos = new RoleInfo[] { roleInfo1, roleInfo2 };
rs = new RelationService(true);
rs.createRelationType("RelationTypeName", roleInfos);
result = (ArrayList) rs.getRoleInfos("RelationTypeName");
result1 = rs.getRoleInfo("RelationTypeName", "roleInfo1");
result2 = rs.getRoleInfo("RelationTypeName", "roleInfo2");
// Check the roleInfos
assertEquals(2, result.size());
assertEquals(roleInfo1.toString(), result1.toString());
assertEquals(roleInfo2.toString(), result2.toString());
}