// create second version with different content
Holder<String> idHolder = new Holder<String>(verIdV1);
Holder<Boolean> contentCopied = new Holder<Boolean>(false);
fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
ContentStream content2 = createContent('a');
Properties newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID,
"PropertyFromVersion2");
idHolder = new Holder<String>(verIdV1);
// Test check-in and pass content and properties
String checkinComment = "Checkin from Unit Test-2.";
fVerSvc.checkIn(fRepositoryId, idHolder, true, newProps, content2, checkinComment, null, null, null, null);
String verIdV2 = idHolder.getValue();
// create third version with different content
contentCopied = new Holder<Boolean>(false);
fVerSvc.checkOut(fRepositoryId, idHolder, null, contentCopied);
ContentStream content3 = super.createContent('a');
newProps = fCreator.getUpdatePropertyList(VersionTestTypeSystemCreator.PROPERTY_ID, "PropertyFromVersion3");
// Test check-in and pass content and properties
checkinComment = "Checkin from Unit Test-3.";
fVerSvc.checkIn(fRepositoryId, idHolder, true, newProps, content3, checkinComment, null, null, null, null);
/* String verIdV3 = */idHolder.getValue();
// Try to update version2 which should fail (on a versioned document
// only a document that
// is checked out can be modified.
try {
fCreator.updateProperty(verIdV2, VersionTestTypeSystemCreator.PROPERTY_ID, "ChangeWithoutCheckout");
fail("updateProperty for an older version should fail.");
} catch (Exception e) {
assertTrue(e instanceof CmisUpdateConflictException);
}
// try to set content on an older version
ContentStream content4 = super.createContent('x');
idHolder = new Holder<String>(verIdV2);
try {
fObjSvc.setContentStream(fRepositoryId, idHolder, true, null, content4, null);
fail("setContentStream for an older version should fail.");
} catch (Exception e) {