boolean isDeletionEventTested = false;
boolean isCustomDeletionTested = false;
DocumentList docList =
getObjectUnderTest(os, docSet, customDeletionSet, deletionEventSet);
Document doc = null;
while ((doc = docList.nextDocument()) != null) {
Property actionProp = doc.findProperty(SpiConstants.PROPNAME_ACTION);
ActionType actionType = SpiConstants.ActionType.findActionType(
actionProp.nextValue().toString());
String id =
doc.findProperty(SpiConstants.PROPNAME_DOCID).nextValue().toString();
if (ActionType.ADD.equals(actionType)) {
IBaseObject object = os.getObject(null, id);
assertFalse(object instanceof FileDeletionObject);
assertTrue(checkpointContains(docList.checkpoint(),
doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
JsonField.LAST_MODIFIED_TIME));
isAddTested = true;
} else if (ActionType.DELETE.equals(actionType)) {
IBaseObject object = os.getObject(null, id);
if (object.isDeletionEvent()) {
assertTrue(checkpointContains(docList.checkpoint(),
doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
JsonField.LAST_DELETION_EVENT_TIME));
isDeletionEventTested = true;
} else {
assertTrue(checkpointContains(docList.checkpoint(),
doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED),
JsonField.LAST_CUSTOM_DELETION_TIME));
isCustomDeletionTested = true;
}
}
}