doc.delete(true);
return;
}
// check out
ObjectId pwcId = doc.checkOut();
Document pwc = (Document) session.getObject(pwcId, SELECT_ALL_NO_CACHE_OC);
addResult(checkObject(session, pwc, getAllProperties(pwc), "PWC spec compliance - test 1"));
checkCheckedOut(pwc);
// cancel checkout
pwc.cancelCheckOut();
doc.refresh();
checkCheckedIn(doc);
// check out again
pwcId = doc.checkOut();
pwc = (Document) session.getObject(pwcId, SELECT_ALL_NO_CACHE_OC);
addResult(checkObject(session, pwc, getAllProperties(pwc), "PWC spec compliance - test 2"));
checkCheckedOut(pwc);
// check in
ObjectId newVersionId = pwc.checkIn(true, null, null, "Test Version 2");
Document newVersion = (Document) session.getObject(newVersionId, SELECT_ALL_NO_CACHE_OC);
addResult(checkObject(session, newVersion, getAllProperties(newVersion), "New version compliance"));
checkCheckedIn(newVersion);