Class UndoRedoTest


  • public class UndoRedoTest
    extends Object
    A set of tests for Undo/Redo mechanism.
    • Constructor Detail

      • UndoRedoTest

        public UndoRedoTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws Exception
        Sets up the necessary environment right before each test run.
        Throws:
        Exception
      • tearDown

        public void tearDown()
                      throws Exception
        Tears down the environment.
        Throws:
        Exception
      • testAttachContainedObject1

        public void testAttachContainedObject1()
        1. Attaches an object to an existing container.
        2. Performs 'undo' operation. Checks that the object is detached.
        3. Performs 'redo' operation. Checks that the object is re-attached.
      • testAttachContainedObject4

        public void testAttachContainedObject4()
        1. Attaches an object to an existing container and changes it within the same BM task.
        2. Performs 'undo' operation. Checks that the object is detached.
        3. Performs 'redo' operation. Checks that the object is re-attached.
      • testAttachCyclicGraph

        public void testAttachCyclicGraph()
        1. Attaches a cyclic graph of objects.
        2. Performs 'undo' operation.
        3. Performs 'redo' operation. Checks that all the objects are re-attached and the references restored correctly.
      • testAttachDeepHierarchy

        public void testAttachDeepHierarchy()
        1. Attaches a deep hierarchy of objects.
        2. Performs 'undo' operation.
        3. Performs 'redo' operation. Checks that all the objects are re-attached.
      • testAttachTopObject1

        public void testAttachTopObject1()
        1. Attaches a top object.
        2. Performs 'undo' operation. Checks that the object is detached.
        3. Performs 'redo' operation. Checks that the object is re-attached.
      • testAttachTopObject4

        public void testAttachTopObject4()
        1. Attaches a top object and changes it within the same BM task.
        2. Performs 'undo' operation. Checks that the object is detached.
        3. Performs 'redo' operation. Checks that the object is re-attached with the same state it had when the BM task had just finished.
      • testAttachTopObject5

        public void testAttachTopObject5()
        1. Detaches a top object and then within the same transaction attaches another top object with the same FQN the detached object had.
        2. Performs 'undo' operation. Checks that the first object is attached and the second object is detached.
        3. Performs 'redo' operation. Checks that the first object is detached again and the second object is attached.
      • testAttachTopObjectWithChildren

        public void testAttachTopObjectWithChildren()
        1. Attaches a top object along with its children within the same BM task.
        2. Performs 'undo' operation. Checks that the top object and all its children are detached.
        3. Performs 'redo' operation. Checks that the top object and all its children are re-attached.
      • testUndoObjectAttachWhichHasDerivedContainedObjects

        public void testUndoObjectAttachWhichHasDerivedContainedObjects()
        1. Attaches a top object in a local editing context.
        2. Adds a contained derived object outside the editing context.
        3. Performes 'undo' operation in the local editing context.
        4. Checks that the top object is detached along with the derived contained object.
      • testUndoTaskThatModifiesContainedDerivedObjects

        public void testUndoTaskThatModifiesContainedDerivedObjects()
        1. Modifies a top object and its contained derived object.
        2. Detaches the contained derived object outside the editing context.
        3. Performes 'undo' operation in the local editing context.
        4. Checks that the top object modifications are undone and the derived object is not reattached.
        5. Performes 'redo' operation in the local editing context.
        6. Checks that the top object modifications are redone and the derived object is not reattached.
      • testChangeBinaryAttachments

        public void testChangeBinaryAttachments()
        1. Changes a few binary attachments of an existing object.
        2. Performs 'undo' operation. Checks that all the attachments a reset to its original state.
        3. Performs 'redo' operation. Checks that all the attachments are changed again.
      • testChangeProperties

        public void testChangeProperties()
        1. Changes a few properties of an existing object.
        2. Performs 'undo' operation. Checks that all the properties a reset to its original state.
        3. Performs 'redo' operation. Checks that all the properties are changed again.
      • testDetachContainedObject1

        public void testDetachContainedObject1()
        1. Changes an existing contained object and then removes it from its containing collection (within the same BM task).
        2. Performs 'undo' operation. Checks that the object is attached to its container and its state is the same as it was just before step 1 execution.
        3. Performs 'redo' operation. Checks that the object is detached.
      • testDetachContainedObject2

        public void testDetachContainedObject2()
        1. Creates a container with a few children, adds all the children to a non-containment collection.
        2. Detaches one of the children from the container. Checks that the non-containment reference to this child is broken.
        3. Performs 'undo' operation. Checks that the child is attached and the non-containment is restored correctly.
        4. Performs 'redo' operation. Checks that the child is detached and the non-containment reference is broken again.
      • testDetachTopObject

        public void testDetachTopObject()
        1. Changes an existing top object and then detaches it (within the same BM task).
        2. Performs 'undo' operation. Checks that the object is attached and its state is the same as it was just before step 1 execution.
        3. Performs 'redo' operation. Checks that the object is detached.
      • testChangeMapFeature

        public void testChangeMapFeature()
        1. Changes a map.
        2. Performs 'undo' operation. Checks that the map is reset to its original state.
        3. Performs 'redo' operation. Checks that the map is changed again.
      • testBackReferenceUpdateWhenAttachIsUndone

        public void testBackReferenceUpdateWhenAttachIsUndone()
      • testBackReferenceUpdateWhenDetachIsUndone

        public void testBackReferenceUpdateWhenDetachIsUndone()
      • testBackReferenceUpdateWhenChangeIsUndone

        public void testBackReferenceUpdateWhenChangeIsUndone()