Search in sources :

Example 11 with SDOXMLHelper

use of org.eclipse.persistence.sdo.helper.SDOXMLHelper 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);
}
Also used : SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDOMarshalListener(org.eclipse.persistence.sdo.helper.SDOMarshalListener) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper)

Example 12 with SDOXMLHelper

use of org.eclipse.persistence.sdo.helper.SDOXMLHelper 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);
}
Also used : SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDOMarshalListener(org.eclipse.persistence.sdo.helper.SDOMarshalListener) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 13 with SDOXMLHelper

use of org.eclipse.persistence.sdo.helper.SDOXMLHelper in project eclipselink by eclipse-ee4j.

the class SDODataObjectGetPathTest method testGetPathFromAncestorFromContainedToParent.

public void testGetPathFromAncestorFromContainedToParent() {
    SDODataObject target = (SDODataObject) aRoot5.get("items");
    SDODataObject aSibling = (SDODataObject) aRoot5.get("items/item[2]");
    String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aSibling, target, aSibling.getChangeSummary());
    assertNotNull(aPath);
    assertEquals("ns0:item[2]", aPath);
}
Also used : SDOMarshalListener(org.eclipse.persistence.sdo.helper.SDOMarshalListener) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 14 with SDOXMLHelper

use of org.eclipse.persistence.sdo.helper.SDOXMLHelper in project eclipselink by eclipse-ee4j.

the class SDODataObjectGetPathTest method testGetPathFromAncestorFromRootToSibling.

public void testGetPathFromAncestorFromRootToSibling() {
    SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
    String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(aRoot5, anItem, aRoot5.getChangeSummary());
    assertEquals(SDOConstants.SDO_XPATH_INVALID_PATH, aPath);
}
Also used : SDOMarshalListener(org.eclipse.persistence.sdo.helper.SDOMarshalListener) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 15 with SDOXMLHelper

use of org.eclipse.persistence.sdo.helper.SDOXMLHelper in project eclipselink by eclipse-ee4j.

the class SDODataObjectGetPathTest method testGetPathFromAncestorDeletedFromChildToRootLoggingOff.

// if logging is off we get null path because we need a changeSummary to compute containers
public void testGetPathFromAncestorDeletedFromChildToRootLoggingOff() {
    SDODataObject anItem = (SDODataObject) aRoot5.get("items/item[2]");
    // get changeSummary
    SDOChangeSummary aCS = aRoot5.getChangeSummary();
    assertFalse(aCS.isLogging());
    // delete source object, useXPathFormat
    anItem.delete();
    String aPath = ((SDOMarshalListener) ((SDOXMLHelper) xmlHelper).getXmlMarshaller().getMarshalListener()).getPathFromAncestor(anItem, aRoot5, aRoot5.getChangeSummary());
    assertNull(aPath);
// get path to root
// String aPathAcrossCS = anItem.getPathFromAncestor(aCS, aRoot5, false);
// assertNotNull(aPathAcrossCS);
// assertEquals(aPathAcrossCS, "items/item[2]");
}
Also used : SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDOMarshalListener(org.eclipse.persistence.sdo.helper.SDOMarshalListener) SDOXMLHelper(org.eclipse.persistence.sdo.helper.SDOXMLHelper) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Aggregations

SDOXMLHelper (org.eclipse.persistence.sdo.helper.SDOXMLHelper)40 SDOMarshalListener (org.eclipse.persistence.sdo.helper.SDOMarshalListener)22 SDODataObject (org.eclipse.persistence.sdo.SDODataObject)21 SDOChangeSummary (org.eclipse.persistence.sdo.SDOChangeSummary)16 XMLDocument (commonj.sdo.helper.XMLDocument)6 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)6 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)5 XMLAttachmentMarshaller (org.eclipse.persistence.oxm.attachment.XMLAttachmentMarshaller)5 XMLAttachmentUnmarshaller (org.eclipse.persistence.oxm.attachment.XMLAttachmentUnmarshaller)5 ArrayList (java.util.ArrayList)4 List (java.util.List)3 SDOType (org.eclipse.persistence.sdo.SDOType)3 SDOClassLoader (org.eclipse.persistence.sdo.helper.SDOClassLoader)3 SDOTypeHelper (org.eclipse.persistence.sdo.helper.SDOTypeHelper)3 DataObject (commonj.sdo.DataObject)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 FileInputStream (java.io.FileInputStream)2 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)2 SDOXSDHelper (org.eclipse.persistence.sdo.helper.SDOXSDHelper)2 Type (commonj.sdo.Type)1