* the parser configuration exception
*/
@Test
public void testMerge() throws ParserConfigurationException {
// create a newer StringElement
StringElement newEntry = new StringElement(ENTRY_NAME);
newEntry.setContent(UPDATED_CONTENT);
newEntry.setId(TEST_ID);
newEntry
.setLastModified(DateTimeUtil.parseDateTime(UPDATED_TIME_STAMP));
newEntry.setLastAction(MappingElement.ACTIONS.UPDATE);
// create an "old" StringElement
StringElement oldEntry = new StringElement(ENTRY_NAME);
oldEntry.setContent(OLD_CONTENT);
oldEntry.setId(TEST_ID);
oldEntry.setLastModified(DateTimeUtil.parseDateTime(OLD_TIME_STAMP));
oldEntry.setLastAction(MappingElement.ACTIONS.CREATE);
// compare the merged Entry with the newest StringElement.
StringElement mergedEntry = (StringElement) oldEntry.merge(newEntry);
assertEquals("Comparing element name", ENTRY_NAME, mergedEntry
.getElementName());
assertEquals("Comparing content", UPDATED_CONTENT, mergedEntry
.getContent());
assertEquals("Comparing last modified timestamp", UPDATED_TIME_STAMP,
DateTimeUtil.dateTime2String(mergedEntry.getLastModified()));
assertEquals("Comparing last modification action",
MappingElement.ACTIONS.UPDATE, mergedEntry.getLastAction());
}