use of org.eclipse.persistence.sdo.helper.SDOMarshalListener in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromContainedToParentLoggingOn.
// these deleted tests are not supported yet for XPath
// TODO: we must store the index (2) position when deleting inside a ListWrapper
public void testGetPathFromAncestorDeletedFromContainedToParentLoggingOn() {
SDODataObject target = (SDODataObject) aRoot5.get("items");
SDODataObject aSibling = (SDODataObject) aRoot5.get("items/item[2]");
// start logging
SDOChangeSummary aCS = aRoot5.getChangeSummary();
aCS.beginLogging();
// delete source object
aSibling.delete();
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aSibling, target, target.getChangeSummary());
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:item[2]", aPath);
}
use of org.eclipse.persistence.sdo.helper.SDOMarshalListener in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromChildToAncestorInsideListWrapperLoggingOn.
// test index=0 from item inside deleted listWrapper
public void testGetPathFromAncestorDeletedFromChildToAncestorInsideListWrapperLoggingOn() {
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());
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("items/item[2]", aPath);
assertEquals("ns0:items/ns0:item[2]", aPath);
}
use of org.eclipse.persistence.sdo.helper.SDOMarshalListener in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromRootToSiblingLoggingOff.
public void testGetPathFromAncestorDeletedFromRootToSiblingLoggingOff() {
SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aRoot5, anItem, aRoot5.getChangeSummary());
// get changeSummary
SDOChangeSummary aCS = aRoot5.getChangeSummary();
assertFalse(aCS.isLogging());
// delete source object
aRoot5.delete();
assertEquals(SDOConstants.SDO_XPATH_INVALID_PATH, aPath);
}
use of org.eclipse.persistence.sdo.helper.SDOMarshalListener in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetXPathFromAncestorDeletedFromRootToCurrentObjectLoggingOn.
public void testGetXPathFromAncestorDeletedFromRootToCurrentObjectLoggingOn() {
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aRoot5, aRoot5, aRoot5.getChangeSummary());
// start logging
SDOChangeSummary aCS = aRoot5.getChangeSummary();
aCS.beginLogging();
assertTrue(aCS.isLogging());
// delete source object
aRoot5.delete();
assertNotNull(aPath);
assertEquals(SDOConstants.EMPTY_STRING, aPath);
}
use of org.eclipse.persistence.sdo.helper.SDOMarshalListener in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathFromAncestorFromChildToRoot.
public void testGetPathFromAncestorFromChildToRoot() {
SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(anItem, aRoot5, anItem.getChangeSummary());
assertNotNull(aPath);
assertEquals("ns0:items/ns0:item[2]", aPath);
}
Aggregations