use of org.eclipse.persistence.sdo.SDOChangeSummary in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDetachedFromChildToAncestorInsideListWrapperLoggingOn.
// TODO: This case fails to find a path because the oldSettings map is not populated during detach()
public void testGetPathFromAncestorDetachedFromChildToAncestorInsideListWrapperLoggingOn() {
SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
// start logging
SDOChangeSummary aCS = aRoot5.getChangeSummary();
aCS.beginLogging();
assertTrue(aCS.isLogging());
// delete source object
// SDODataObject deletedObject = ((SDODataObject)aRoot5.get("items"));
anItem.detach();
// String aPath = anItem.getPathFromAncestor(aCS, aRoot5, useXPathFormat);
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(anItem, aRoot5, aRoot5.getChangeSummary());
// SDODataObject anItemFromPath = (SDODataObject)aRoot5.get(aPath);
assertNotNull(aPath);
// TODO: no storage of deleted indexed postition - defaults to size() = start of list for now
// see SDODataObject: index = ((SDODataObject)parent).getList(aChild).size();
assertEquals("ns0:items/ns0:item[2]", aPath);
}
use of org.eclipse.persistence.sdo.SDOChangeSummary in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method setChangeSummary.
private SDOChangeSummary setChangeSummary(SDODataObject aCSRoot) {
// get and set change summary (temp workaround does not propagate to children)
SDOChangeSummary aCS = new SDOChangeSummary(aCSRoot, aHelperContext);
aCSRoot._setChangeSummary(aCS);
aCS.endLogging();
aCS.beginLogging();
aCS.endLogging();
return aCS;
}
use of org.eclipse.persistence.sdo.SDOChangeSummary in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetXPathFromAncestorDeletedFromChildToRootInsideListWrapperLoggingOn.
public void testGetXPathFromAncestorDeletedFromChildToRootInsideListWrapperLoggingOn() {
SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
// start logging
SDOChangeSummary aCS = aRoot5.getChangeSummary();
aCS.beginLogging();
assertTrue(aCS.isLogging());
// delete source object
// SDODataObject deletedObject = ((SDODataObject)aRoot5.get("items"));
// detach();
anItem.delete();
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(anItem, aRoot5, aRoot5.getChangeSummary());
// SDODataObject anItemFromPath = (SDODataObject)aRoot5.get(aPath);
// System.out.println("testGetPathFromAncestorDeletedFromChildToRootLoggingOn: " + aPath);
assertNotNull(aPath);
// TODO: no storage of deleted indexed postition - defaults to size() = start of list for now
// see SDODataObject: index = ((SDODataObject)parent).getList(aChild).size();
assertEquals("ns0:items/ns0:item[2]", aPath);
}
use of org.eclipse.persistence.sdo.SDOChangeSummary in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromRootToCurrentObjectLoggingOff.
public void testGetPathFromAncestorDeletedFromRootToCurrentObjectLoggingOff() {
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aRoot5, aRoot5, aRoot5.getChangeSummary());
// get changeSummary
SDOChangeSummary aCS = aRoot5.getChangeSummary();
assertFalse(aCS.isLogging());
// delete source object
aRoot5.delete();
assertNotNull(aPath);
assertEquals(SDOConstants.EMPTY_STRING, aPath);
}
use of org.eclipse.persistence.sdo.SDOChangeSummary in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromContainedToParentLoggingOff.
public void testGetPathFromAncestorDeletedFromContainedToParentLoggingOff() {
SDODataObject target = (SDODataObject) aRoot5.get("items");
SDODataObject aSibling = (SDODataObject) aRoot5.get("items/item[2]");
// get changeSummary
SDOChangeSummary aCS = aRoot5.getChangeSummary();
assertFalse(aCS.isLogging());
// delete source object
aSibling.delete();
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aSibling, target, target.getChangeSummary());
assertEquals(SDOConstants.SDO_XPATH_INVALID_PATH, aPath);
}
Aggregations