use of org.eclipse.persistence.sdo.helper.SDOXMLHelper 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.SDOXMLHelper 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.SDOXMLHelper 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.SDOXMLHelper in project eclipselink by eclipse-ee4j.
the class LoadAndSavePurchaseOrderComplexTestCases method compareXML.
@Override
protected void compareXML(String controlFileName, String testString, boolean compareNodes) throws Exception {
super.compareXML(controlFileName, testString, compareNodes);
XMLMarshaller marshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
XMLMarshalListener listener = marshaller.getMarshalListener();
assertNull(((SDOMarshalListener) listener).getMarshalledObject());
assertNull(((SDOMarshalListener) listener).getMarshalledObjectRootQName());
assertNull(((SDOMarshalListener) listener).getRootMarshalRecord());
}
use of org.eclipse.persistence.sdo.helper.SDOXMLHelper in project eclipselink by eclipse-ee4j.
the class LoadAndSaveMimeTypeOnPropertyTestCases method setUp.
@Override
public void setUp() {
super.setUp();
XMLMarshaller aMarshaller = ((SDOXMLHelper) xmlHelper).getXmlMarshaller();
XMLUnmarshaller anUnmarshaller = ((SDOXMLHelper) xmlHelper).getXmlUnmarshaller();
XMLAttachmentMarshaller anAttachmentMarshaller = new AttachmentMarshallerImpl("c_id0");
XMLAttachmentUnmarshaller anAttachmentUnmarshaller = new AttachmentUnmarshallerImpl("Testing".getBytes());
aMarshaller.setAttachmentMarshaller(anAttachmentMarshaller);
anUnmarshaller.setAttachmentUnmarshaller(anAttachmentUnmarshaller);
}
Aggregations