public void remove(AssociationRoleIF role) { role.remove(); }
public void perform(ActionParametersIF params, ActionResponseIF response) { AssociationRoleIF role = (AssociationRoleIF) params.get(0); role.remove(); }
xr.remove(); afterTest();
@Override public void run() { AssociationIF a = getAssociation(); AssociationRoleIF r = (AssociationRoleIF)this.data.remove("AssociationRoleIF"); this.objectId = r.getObjectId(); r.remove(); } });
public void testRoles() { // STATE 1: no roles assertTrue("role set not empty initially", assoc.getRoles().size() == 0); // STATE 2: one child role AssociationRoleIF role = builder.makeAssociationRole(assoc, builder.makeTopic(), builder.makeTopic()); // builder should add it to the assoc assertTrue("role not added to child role set", assoc.getRoles().size() == 1); assertTrue("role identity not retained", assoc.getRoles().iterator().next().equals(role)); // STATE 3: no child roles again role.remove(); assertTrue("role not removed", assoc.getRoles().size() == 0); // checking that it's safe role.remove(); }
public void testFourRoles() { // STATE 1: no roles assertTrue("role set not empty initially", assoc.getRoles().size() == 0); // STATE 2: four child roles TopicIF type = builder.makeTopic(); TopicIF player = builder.makeTopic(); AssociationRoleIF role = builder.makeAssociationRole(assoc, type, player); AssociationRoleIF role2 = builder.makeAssociationRole(assoc, type, player); AssociationRoleIF role3 = builder.makeAssociationRole(assoc, type, player); AssociationRoleIF role4 = builder.makeAssociationRole(assoc, type, player); assertTrue("roles not added to child role set", assoc.getRoles().size() == 4); assertTrue("roles not added to player's role set", player.getRoles().size() == 4); // STATE 3: no child roles again role.remove(); role2.remove(); role3.remove(); role4.remove(); assertTrue("roles not removed", assoc.getRoles().size() == 0); assertTrue("roles not removed from player's role set", player.getRoles().size() == 0); // checking that it's safe role.remove(); }
/** * PUBLIC: Merges the source role into the target role. The two * roles must be in the same topic map, but need not have the same * parent association. If the associations are not the same, they * are merged, provided that they are equal; if they are not equal, * a ConstraintViolationException is thrown. It is assumed (but not * verified) that the two roles are actually equal. * @since 5.1.0 */ public static void mergeInto(AssociationRoleIF target, AssociationRoleIF source) { if (target.getAssociation() != source.getAssociation()) { String key1 = KeyGenerator.makeAssociationKey(target.getAssociation()); String key2 = KeyGenerator.makeAssociationKey(source.getAssociation()); if (!key1.equals(key2)) throw new ConstraintViolationException("Cannot merge roles in different " + " associations"); mergeInto(target.getAssociation(), source.getAssociation()); } else { mergeIntoChecked(target, source); source.remove(); } }
TopicIF player = or.getPlayer(); log.trace(" -R {} :{}", player, or.getType()); or.remove(); if (player != null) ctx.characteristicsChanged(player);
log.trace(" -R " + or.getPlayer() + " :" + or.getType()); TopicIF player = or.getPlayer(); or.remove(); if (player != null) ctx.characteristicsChanged(player);
TopicIF player = or.getPlayer(); log.trace(" -R {} :{}", player, or.getType()); or.remove(); if (player != null) ctx.characteristicsChanged(player);
log.trace(" -R " + or.getPlayer() + " :" + or.getType()); TopicIF player = or.getPlayer(); or.remove(); if (player != null) ctx.characteristicsChanged(player);
r1B.remove(); assertTrue("p1B.rolesByType(rt3,at1).size is not 0.", p1B.getRolesByType(rt3B,at1B).size() == 0); assertTrue("p1B.rolesByType(rt3,at2).size is not 0.", p1B.getRolesByType(rt3B,at2B).size() == 0);