Document doc = publication.getArea(AREA).getSite().getNode(PATH).getLink(LANGUAGE).getDocument();
doc.getRepositoryNode().lock();
MetaData dcCore = doc.getMetaData(DublinCore.DC_NAMESPACE);
String title = dcCore.getFirstValue(DublinCore.ELEMENT_TITLE);
String subject = dcCore.getFirstValue(DublinCore.ELEMENT_SUBJECT);
String creator = dcCore.getFirstValue(DublinCore.ELEMENT_CREATOR);
if (creator == null) {
creator = "test";
}
String newCreator = creator + "-test";
dcCore.setValue(DublinCore.ELEMENT_CREATOR, newCreator);
Document doc2 = publication.getArea(AREA).getSite().getNode(PATH).getLink(LANGUAGE).getDocument();
MetaData dcCore2 = doc2.getMetaData(DublinCore.DC_NAMESPACE);
assertEquals(title, dcCore2.getFirstValue(DublinCore.ELEMENT_TITLE));
assertEquals(subject, dcCore2.getFirstValue(DublinCore.ELEMENT_SUBJECT));
assertFalse(creator.equals(dcCore2.getFirstValue(DublinCore.ELEMENT_CREATOR)));
assertEquals(newCreator, dcCore2.getFirstValue(DublinCore.ELEMENT_CREATOR));
doc.getRepositoryNode().unlock();
}