use of commonj.sdo.Sequence in project eclipselink by eclipse-ee4j.
the class ChangeSummaryGetOldSequenceTestCases method testGetOldSequenceReattached.
public void testGetOldSequenceReattached() {
cs.beginLogging();
address1Object.detach();
purchaseOrderObject.getList("address").add(address1Object);
Sequence oldSeq = cs.getOldSequence(address1Object);
assertNotNull(oldSeq);
}
use of commonj.sdo.Sequence in project eclipselink by eclipse-ee4j.
the class ChangeSummaryGetOldSequenceTestCases method testGetOldSequenceDeletedAddress.
public void testGetOldSequenceDeletedAddress() {
cs.beginLogging();
Sequence currentSeq = address1Object.getSequence();
assertEquals(4, currentSeq.size());
address1Object.delete();
assertEquals(0, currentSeq.size());
Sequence oldSeq = cs.getOldSequence(address1Object);
assertNotNull(oldSeq);
assertEquals(4, ((SDOSequence) oldSeq).getSettings().size());
}
use of commonj.sdo.Sequence in project eclipselink by eclipse-ee4j.
the class ChangeSummaryGetOldSequenceTestCases method testGetOldSequenceAfterRemoveText.
public void testGetOldSequenceAfterRemoveText() {
assertEquals(4, address1Object.getSequence().size());
address1Object.getSequence().addText("abc");
address1Object.getSequence().addText("def");
assertEquals(6, address1Object.getSequence().size());
cs.beginLogging();
address1Object.getSequence().remove(4);
assertEquals(5, address1Object.getSequence().size());
assertEquals("def", (String) address1Object.getSequence().getValue(4));
Sequence oldSeq = cs.getOldSequence(address1Object);
assertNotNull(oldSeq);
assertEquals(6, oldSeq.size());
assertEquals("abc", (String) oldSeq.getValue(4));
assertEquals("def", (String) oldSeq.getValue(5));
}
use of commonj.sdo.Sequence in project eclipselink by eclipse-ee4j.
the class ChangeSummaryGetOldSequenceTestCases method testGetOldSequenceDetachedItem.
public void testGetOldSequenceDetachedItem() {
DataObject lineItem1 = (DataObject) itemsObject.getList("item").get(0);
DataObject lineItem2 = (DataObject) itemsObject.getList("item").get(1);
Sequence currentSeq = itemsObject.getSequence();
assertEquals(2, currentSeq.size());
cs.beginLogging();
lineItem1.detach();
assertEquals(1, currentSeq.size());
Sequence oldSeq = cs.getOldSequence(itemsObject);
assertNotNull(oldSeq);
assertEquals(2, ((SDOSequence) oldSeq).getSettings().size());
DataObject oldLineItem1 = (DataObject) oldSeq.getValue(0);
assertEquals("Lawnmower", oldLineItem1.get("productName"));
DataObject oldLineItem2 = (DataObject) oldSeq.getValue(1);
assertEquals("Baby Monitor", oldLineItem2.get("productName"));
// should be a deep copy not the same object
assertNotSame(lineItem1, oldLineItem1);
assertNotSame(lineItem2, oldLineItem2);
assertFalse(lineItem1.equals(oldLineItem1));
assertFalse(lineItem2.equals(oldLineItem2));
}
use of commonj.sdo.Sequence in project eclipselink by eclipse-ee4j.
the class ChangeSummaryGetOldSequenceTestCases method testGetOldSequenceReattachedItem.
public void testGetOldSequenceReattachedItem() {
DataObject lineItem1 = (DataObject) itemsObject.getList("item").get(0);
cs.beginLogging();
lineItem1.detach();
assertEquals(1, itemsObject.getSequence().size());
DataObject firstObject = (DataObject) itemsObject.getSequence().getValue(0);
assertEquals("Baby Monitor", firstObject.get("productName"));
itemsObject.getList("item").add(lineItem1);
assertEquals(2, itemsObject.getSequence().size());
DataObject firstObjectAgain = (DataObject) itemsObject.getSequence().getValue(0);
assertEquals("Baby Monitor", firstObjectAgain.get("productName"));
Sequence oldSeq = cs.getOldSequence(itemsObject);
assertNotNull(oldSeq);
assertEquals(2, oldSeq.size());
DataObject firstObjectOld = (DataObject) oldSeq.getValue(0);
assertEquals("Lawnmower", firstObjectOld.get("productName"));
}
Aggregations