public void testConfirmAssociation() throws JAXRException
{
String orgTarget = "Target Organization";
String orgSource = "Source Organization";
String type = "Implements";
Key savekey = null;
Collection associationKeys = null;
Collection sourceKeys = null;
Collection targetKeys = null;
String targetId = null;
String sourceId = null;
BusinessQueryManager bqm2 = null;
BusinessLifeCycleManager blm2 = null;
try
{
login();
getJAXREssentials();
// second user.
Connection con2 = loginSecondUser();
RegistryService rs2 = con2.getRegistryService();
blm2 = rs2.getBusinessLifeCycleManager();
bqm2 = rs2.getBusinessQueryManager();
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 Orgs failed");
}
sourceKeys = br.getCollection();
Iterator iter = sourceKeys.iterator();
while (iter.hasNext())
{
savekey = (Key) iter.next();
}
sourceId = savekey.getId();
String objectType = LifeCycleManager.ORGANIZATION;
Organization pubSource = (Organization) bqm.getRegistryObject(sourceId, objectType);
assertNotNull("Source retrieved: ", pubSource.getName().getValue());
orgs.clear();
orgs.add(target);
br = blm2.saveOrganizations(orgs);
if (br.getExceptions() != null)
{
fail("Target:Save Orgs failed");
}
targetKeys = br.getCollection();
iter = targetKeys.iterator();
while (iter.hasNext())
{
savekey = (Key) iter.next();
}
targetId = savekey.getId();
Organization pubTarget = (Organization) bqm2.getRegistryObject(targetId, objectType);
assertNotNull("Target: ", pubTarget.getName().getValue());
Concept associationType = getAssociationConcept(type);