@Async public Future<Uid> delete( final ConnectorFacade connector, final ObjectClass objectClass, final Uid uid, final OperationOptions options) { connector.delete(objectClass, uid, options); return new AsyncResult<>(uid); }
connectorFacade.delete(objClass, uid, opOptions); } catch (Throwable t) { if(failOnError) {
/** * Performs deletion of object specified by uid. * Fails in case failOnError is true and object wasn't deleted during delete call. */ public static boolean deleteObject(ConnectorFacade connectorFacade, ObjectClass objClass, Uid uid, boolean failOnError, OperationOptions opOptions) { boolean deleted = false; assertFalse((failOnError && (uid == null)), "Connector helper deleteObject method received a null Uid, when it was told it should not fail"); if (uid == null) { return deleted; } try { connectorFacade.delete(objClass, uid, opOptions); } catch (Throwable t) { if (failOnError) { fail("Connector helper deleteObject method caught an exception, when it was told it should not fail"); } } if (failOnError) { // at present javadoc for delete is not clear about what // happens if delete fails, so I'll verify it's gone by searching ConnectorObject obj = connectorFacade.getObject(objClass, uid, opOptions); assertNull(obj, "The deleted object was found. It should be no longer on the resource."); deleted = true; } return deleted; }
/** * Performs deletion of object specified by uid. Fails in case failOnError is true and object wasn't deleted during * delete call. */ public static boolean deleteObject(ConnectorFacade connectorFacade, ObjectClass objClass, Uid uid, boolean failOnError, OperationOptions opOptions) { boolean deleted = false; assertFalse( "Connector helper deleteObject method received a null Uid, when it was told it should not fail", (failOnError && (uid == null))); if (uid == null) { return deleted; } try { connectorFacade.delete(objClass, uid, opOptions); } catch (Throwable t) { if (failOnError) { fail( "Connector helper deleteObject method caught an exception, when it was told it should not fail"); } } if (failOnError) { // at present javadoc for delete is not clear about what // happens if delete fails, so I'll verify it's gone by searching ConnectorObject obj = connectorFacade.getObject(objClass, uid, opOptions); assertNull("The deleted object was found. It should be no longer on the resource.", obj); deleted = true; } return deleted; }
if (uid != null) { getConnectorFacade().delete(objectClass, uid, null);
if (uid != null) { getConnectorFacade().delete(getSupportedObjectClass(), uid, null);
} finally { getConnectorFacade().delete(getSupportedObjectClass(), uid, null);
} finally { getConnectorFacade().delete(getSupportedObjectClass(), uid, null);
/** * {@inheritDoc} */ @Override protected void testRun(ObjectClass objectClass) { Uid uid = null; try { Set<Attribute> attrs = ConnectorHelper.getCreateableAttributes(getDataProvider(), getObjectClassInfo(objectClass), getTestName(), 0, true, false); // should throw UnsupportedObjectClass if not supported uid = getConnectorFacade().create(objectClass, attrs, getOperationOptionsByOp(objectClass, CreateApiOp.class)); // get the user to make sure it exists now ConnectorObject obj = getConnectorFacade().getObject(objectClass, uid, getOperationOptionsByOp(objectClass, GetApiOp.class)); assertNotNull(obj, "Unable to retrieve newly created object"); // compare requested attributes to retrieved attributes ConnectorHelper.checkObject(getObjectClassInfo(objectClass), obj, attrs); } finally { if (uid != null) { // delete the object getConnectorFacade().delete(objectClass, uid, getOperationOptionsByOp(objectClass, DeleteApiOp.class)); } } }
/** * {@inheritDoc} */ @Override public void testRun() { Uid uid = null; try { Set<Attribute> attrs = ConnectorHelper.getCreateableAttributes(getDataProvider(), getObjectClassInfo(), getTestName(), 0, true, false); // should throw UnsupportedObjectClass if not supported uid = getConnectorFacade().create(getObjectClass(), attrs, getOperationOptionsByOp(CreateApiOp.class)); // get the user to make sure it exists now ConnectorObject obj = getConnectorFacade().getObject(getObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNotNull("Unable to retrieve newly created object", obj); // compare requested attributes to retrieved attributes ConnectorHelper.checkObject(getObjectClassInfo(), obj, attrs); } finally { if (uid != null) { // delete the object getConnectorFacade().delete(getSupportedObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class)); } } }
/** * {@inheritDoc} */ @Override public void testRun() { Uid uid = null; try { Set<Attribute> attrs = ConnectorHelper.getCreateableAttributes(getDataProvider(), getObjectClassInfo(), getTestName(), 0, true, false); // should throw UnsupportedObjectClass if not supported uid = getConnectorFacade().create(getObjectClass(), attrs, getOperationOptionsByOp(CreateApiOp.class)); // get the user to make sure it exists now ConnectorObject obj = getConnectorFacade().getObject(getObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNotNull("Unable to retrieve newly created object", obj); // compare requested attributes to retrieved attributes ConnectorHelper.checkObject(getObjectClassInfo(), obj, attrs); } finally { if (uid != null) { // delete the object getConnectorFacade().delete(getSupportedObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class)); } } }
/** * {@inheritDoc} */ @Override protected void testRun(ObjectClass objectClass) { ConnectorObject obj = null; Uid uid = null; try { // create something to delete - object class is always supported uid = ConnectorHelper.createObject(getConnectorFacade(), getDataProvider(), getObjectClassInfo(objectClass), getTestName(), 0, getOperationOptionsByOp(objectClass, DeleteApiOp.class)); // The object should exist now obj = getConnectorFacade().getObject(objectClass, uid, getOperationOptionsByOp(objectClass, GetApiOp.class)); assertNotNull(obj, "Unable to perform delete test because object to be deleted cannot be created"); // try to delete object getConnectorFacade().delete(objectClass, uid, getOperationOptionsByOp(objectClass, DeleteApiOp.class)); // Try to find it now, it should be deleted obj = getConnectorFacade().getObject(objectClass, uid, getOperationOptionsByOp(objectClass, GetApiOp.class)); assertNull(obj, "Object wasn't deleted by delete."); } finally { // try to delete if previous deletes failed ConnectorHelper.deleteObject(getConnectorFacade(), objectClass, uid, false, getOperationOptionsByOp(objectClass, DeleteApiOp.class)); } }
/** * {@inheritDoc} */ @Override public void testRun() { ConnectorObject obj = null; Uid uid = null; try { // create something to delete - object class is always supported uid = ConnectorHelper.createObject(getConnectorFacade(), getDataProvider(), getObjectClassInfo(), getTestName(), 0, getOperationOptionsByOp(DeleteApiOp.class)); // The object should exist now obj = getConnectorFacade().getObject(getSupportedObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNotNull("Unable to perform delete test because object to be deleted cannot be created", obj); // try to delete object getConnectorFacade().delete(getObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class)); // Try to find it now, it should be deleted obj = getConnectorFacade().getObject(getSupportedObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNull("Object wasn't deleted by delete.", obj); } finally { // try to delete if previous deletes failed ConnectorHelper.deleteObject(getConnectorFacade(), getSupportedObjectClass(), uid, false, getOperationOptionsByOp(DeleteApiOp.class)); } }
/** * {@inheritDoc} */ @Override public void testRun() { ConnectorObject obj = null; Uid uid = null; try { // create something to delete - object class is always supported uid = ConnectorHelper.createObject(getConnectorFacade(), getDataProvider(), getObjectClassInfo(), getTestName(), 0, getOperationOptionsByOp(DeleteApiOp.class)); // The object should exist now obj = getConnectorFacade().getObject(getSupportedObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNotNull("Unable to perform delete test because object to be deleted cannot be created", obj); // try to delete object getConnectorFacade().delete(getObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class)); // Try to find it now, it should be deleted obj = getConnectorFacade().getObject(getSupportedObjectClass(), uid, getOperationOptionsByOp(GetApiOp.class)); assertNull("Object wasn't deleted by delete.", obj); } finally { // try to delete if previous deletes failed ConnectorHelper.deleteObject(getConnectorFacade(), getSupportedObjectClass(), uid, false, getOperationOptionsByOp(DeleteApiOp.class)); } }
if (uid != null) { getConnectorFacade().delete(objectClass, uid, getOperationOptionsByOp(objectClass, DeleteApiOp.class));
if (uid != null) { getConnectorFacade().delete(getSupportedObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class));
if (uid != null) { getConnectorFacade().delete(getSupportedObjectClass(), uid, getOperationOptionsByOp(DeleteApiOp.class));