Search in sources :

Example 1 with SDOChangeSummary

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

the class SDOTestCase method assertValueStoresInitializedAfterLoggingOn.

/**
 */
// test undo when logging is off (with previous changes)
protected void assertValueStoresInitializedAfterLoggingOn(DataObject aRootObject) {
    // verify logging is on
    assertTrue(aRootObject.getChangeSummary().isLogging());
    // verify original VS is null and save a copy of current VS for object
    // identity testing after undo
    ValueStore aCurrentValueStore = ((SDODataObject) aRootObject)._getCurrentValueStore();
    assertNotNull(aCurrentValueStore);
    ValueStore anOriginalValueStore = (ValueStore) ((SDOChangeSummary) aRootObject.getChangeSummary()).getOriginalValueStores().get(aRootObject);
    assertNull(anOriginalValueStore);
}
Also used : ValueStore(org.eclipse.persistence.sdo.ValueStore) SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 2 with SDOChangeSummary

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

the class SDOTestCase method assertValueStoresReturnedToStartStateAfterUndoChanges.

/**
 */
protected void assertValueStoresReturnedToStartStateAfterUndoChanges(DataObject aRootObject, ValueStore aCurrentValueStoreAfterLoggingFirstOnParam) {
    // verify logging is on
    assertTrue(aRootObject.getChangeSummary().isLogging());
    ValueStore anOriginalValueStoreAfterUndo = (ValueStore) ((SDOChangeSummary) aRootObject.getChangeSummary()).getOriginalValueStores().get(aRootObject);
    ValueStore aCurrentValueStoreAfterUndo = ((SDODataObject) aRootObject)._getCurrentValueStore();
    assertNull(anOriginalValueStoreAfterUndo);
    assertNotNull(aCurrentValueStoreAfterUndo);
    // we return the original value store back to the current VS
    assertTrue(aCurrentValueStoreAfterUndo == aCurrentValueStoreAfterLoggingFirstOnParam);
}
Also used : ValueStore(org.eclipse.persistence.sdo.ValueStore) SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 3 with SDOChangeSummary

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

the class SDOTestCase method assertValueStoresCopiedAndSwappedAfterFirstModifyOperation.

/**
 */
protected void assertValueStoresCopiedAndSwappedAfterFirstModifyOperation(DataObject aRootObject, ValueStore aCurrentValueStoreAfterLoggingFirstOnParam) {
    // verify logging is on
    assertTrue(aRootObject.getChangeSummary().isLogging());
    assertNotNull(aCurrentValueStoreAfterLoggingFirstOnParam);
    ValueStore anOriginalValueStoreAfterOperation = (ValueStore) ((SDOChangeSummary) aRootObject.getChangeSummary()).getOriginalValueStores().get(aRootObject);
    ValueStore aCurrentValueStoreAfterOperation = ((SDODataObject) aRootObject)._getCurrentValueStore();
    assertNotNull(anOriginalValueStoreAfterOperation);
    assertNotNull(aCurrentValueStoreAfterOperation);
    assertTrue(anOriginalValueStoreAfterOperation == aCurrentValueStoreAfterLoggingFirstOnParam);
}
Also used : ValueStore(org.eclipse.persistence.sdo.ValueStore) SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 4 with SDOChangeSummary

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

the class SDOTestCase method assertSequencesReturnedToStartStateAfterUndoChanges.

/**
 */
protected void assertSequencesReturnedToStartStateAfterUndoChanges(DataObject aRootObject, Sequence aCurrentSequenceAfterLoggingFirstOnParam) {
    // verify logging is on
    assertTrue(aRootObject.getChangeSummary().isLogging());
    SDOSequence anOriginalSequenceAfterUndo = (SDOSequence) ((SDOChangeSummary) aRootObject.getChangeSummary()).getOriginalSequences().get(aRootObject);
    SDOSequence aCurrentSequenceAfterUndo = ((SDODataObject) aRootObject).getSequence();
    assertNull(anOriginalSequenceAfterUndo);
    assertNotNull(aCurrentSequenceAfterUndo);
    // we return the sequence back to the current VS
    assertEquals(aCurrentSequenceAfterUndo.size(), aCurrentSequenceAfterLoggingFirstOnParam.size());
    assertTrue(compareSequences(aCurrentSequenceAfterUndo, (SDOSequence) aCurrentSequenceAfterLoggingFirstOnParam, true));
}
Also used : SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDOSequence(org.eclipse.persistence.sdo.SDOSequence) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Example 5 with SDOChangeSummary

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

the class SDOTestCase method assertSequencesCopiedAndSwappedAfterFirstModifyOperation.

protected void assertSequencesCopiedAndSwappedAfterFirstModifyOperation(DataObject aRootObject, Sequence aCurrentSequenceAfterLoggingFirstOnParam) {
    // verify logging is on
    assertTrue(aRootObject.getChangeSummary().isLogging());
    assertNotNull(aCurrentSequenceAfterLoggingFirstOnParam);
    Sequence anOriginalSequenceAfterOperation = (Sequence) ((SDOChangeSummary) aRootObject.getChangeSummary()).getOriginalSequences().get(aRootObject);
    Sequence aCurrentSequenceAfterOperation = ((SDODataObject) aRootObject).getSequence();
    assertNotNull(anOriginalSequenceAfterOperation);
    assertNotNull(aCurrentSequenceAfterOperation);
    assertTrue(anOriginalSequenceAfterOperation == aCurrentSequenceAfterLoggingFirstOnParam);
}
Also used : SDOChangeSummary(org.eclipse.persistence.sdo.SDOChangeSummary) SDOSequence(org.eclipse.persistence.sdo.SDOSequence) Sequence(commonj.sdo.Sequence) SDODataObject(org.eclipse.persistence.sdo.SDODataObject)

Aggregations

SDOChangeSummary (org.eclipse.persistence.sdo.SDOChangeSummary)123 SDODataObject (org.eclipse.persistence.sdo.SDODataObject)109 DataObject (commonj.sdo.DataObject)91 ChangeSummary (commonj.sdo.ChangeSummary)66 List (java.util.List)63 ArrayList (java.util.ArrayList)56 SDOSetting (org.eclipse.persistence.sdo.SDOSetting)37 Property (commonj.sdo.Property)25 SDOProperty (org.eclipse.persistence.sdo.SDOProperty)25 ValueStore (org.eclipse.persistence.sdo.ValueStore)17 SDOMarshalListener (org.eclipse.persistence.sdo.helper.SDOMarshalListener)16 SDOXMLHelper (org.eclipse.persistence.sdo.helper.SDOXMLHelper)16 SDOSequence (org.eclipse.persistence.sdo.SDOSequence)9 ListWrapper (org.eclipse.persistence.sdo.helper.ListWrapper)9 SDOType (org.eclipse.persistence.sdo.SDOType)7 Sequence (commonj.sdo.Sequence)6 Iterator (java.util.Iterator)6 Map (java.util.Map)6 HashSet (java.util.HashSet)2 Set (java.util.Set)2