use of org.eclipse.persistence.sdo.SDODataObject in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetDataObjectConversionWithPathTest method testGetDataObjectConversionFromDefinedPropertyWithPath.
// purpose: opencontent properties
public void testGetDataObjectConversionFromDefinedPropertyWithPath() {
SDOType dataObjectType = (SDOType) typeHelper.getType(SDOConstants.SDO_URL, SDOConstants.DATAOBJECT);
// dataObject's type add boolean property
type_b.setOpen(true);
SDOProperty property = new SDOProperty(aHelperContext);
property.setName("openTest");
property.setType(dataObjectType);
SDODataObject b = new SDODataObject();
// add it to instance list
dataObject_b.setDataObject(property, b);
assertEquals(b, dataObject_a.getDataObject("PName-a/openTest"));
}
use of org.eclipse.persistence.sdo.SDODataObject in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetXPathFromAncestorDeletedFromChildToAncestorInsideListWrapperLoggingOn.
public void testGetXPathFromAncestorDeletedFromChildToAncestorInsideListWrapperLoggingOn() {
SDODataObject anItem = (SDODataObject) aRoot5.get("billTo/phone[1]");
// start logging
SDOChangeSummary aCS = aRoot5.getChangeSummary();
aCS.beginLogging();
assertTrue(aCS.isLogging());
// delete source object
SDODataObject deletedObjectParent = ((SDODataObject) aRoot5.get("billTo"));
// detach();
deletedObjectParent.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:billTo/ns0:phone[1]", aPath);
}
use of org.eclipse.persistence.sdo.SDODataObject 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.SDODataObject in project eclipselink by eclipse-ee4j.
the class SDODataObjectGetPathTest method testGetPathForInternalNonIsManyObject.
public void testGetPathForInternalNonIsManyObject() {
SDODataObject anItem = (SDODataObject) aRoot5.get("shipTo");
String aPath = anItem._getPath();
assertNotNull(aPath);
assertEquals("shipTo", aPath);
}
use of org.eclipse.persistence.sdo.SDODataObject 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);
}
Aggregations