private int indent = 0;
public void testCrossScopeCopy() throws IOException
{
CopyHelper copyHelperB = SDOUtil.createCrossScopeCopyHelper(scopeB);
// Perform Shallow Copy Test
DataObject copiedSDO = copyHelperB.copyShallow(bankSDO);
shallowCopyAssertions(bankSDO, copiedSDO);
// Perform Deep Copy Test
copiedSDO = copyHelperB.copy(bankSDO);
deepCopyAssertions(bankSDO, copiedSDO);
// Inter-Reference Copy
copiedSDO = copyHelperB.copy(customerSDO1);
DataObject prop = (DataObject)copiedSDO.get("HomeBranch");
assertTrue(prop==null);
// Perform invalid namespace test
DataObject sdo = hca.getDataFactory().create(TEST_NAMESPACE, DYNAMIC_TYPE );
sdo.set("custNum", "099" );
sdo.set("firstName", "John");
sdo.set("lastName", "Doe");
boolean failed = false;
try
{
// In this case, we are copying an object to a scope
// where the object's type has not been defined. That
// will generate a null pointer exception what we will
// catch.
copyHelperB.copy(sdo);
}
catch(java.lang.NullPointerException ex)
{
failed = true;
}