*/
public void testDeleteAssociations() throws JAXRException
{
Key savekey = null;
Key assockey = null;
BusinessQueryManager bqm2 = null;
BusinessLifeCycleManager blm2 = null;
Collection sourceKeys = null;
Collection targetKeys = null;
try
{
login();
getJAXREssentials();
// second user.
Connection con2 = loginSecondUser();
RegistryService rs2 = con2.getRegistryService();
blm2 = rs2.getBusinessLifeCycleManager();
bqm2 = rs2.getBusinessQueryManager();
String orgTarget = "Target Organization";
String orgSource = "Source Organization";
Organization target = blm2.createOrganization(blm.createInternationalString(orgTarget));
Organization source = blm.createOrganization(blm.createInternationalString(orgSource));
Collection orgs = new ArrayList();
orgs.add(source);
br = blm.saveOrganizations(orgs);
if (br.getExceptions() != null)
{
fail(" Source::Save Organizations failed");
}
log.debug("Saved Source Organization");
sourceKeys = br.getCollection();
Iterator iter = sourceKeys.iterator();
while (iter.hasNext())
{
savekey = (Key) iter.next();
}
String sourceid = savekey.getId();
String objectType = LifeCycleManager.ORGANIZATION;
Organization pubSource = (Organization) bqm.getRegistryObject(sourceid, objectType);
assertNotNull("Source Org", pubSource.getName().getValue());
orgs.clear();
orgs.add(target);
br = blm2.saveOrganizations(orgs);
if (br.getExceptions() != null)
{
fail("Target:: Save Organizations failed");
}
targetKeys = br.getCollection();
iter = targetKeys.iterator();
while (iter.hasNext())
{
savekey = (Key) iter.next();
}
String targetid = savekey.getId();
Organization targetOrg = (Organization) bqm2.getRegistryObject(targetid, objectType);
assertNotNull("Target Org", targetOrg.getName().getValue());
Concept associationType = getAssociationConcept("Implements");
assertNotNull("AssociationType", associationType);