Class UndoRedoTest
java.lang.Object
com._1c.g5.v8.dt.internal.core.platform.bm.itests.UndoRedoTest
A set of tests for Undo/Redo mechanism.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setUp()
static void
void
tearDown()
static void
void
Attaches an object to an existing container. Performs 'undo' operation.void
Attaches an object to an existing container and changes it within the same BM task. Performs 'undo' operation.void
Attaches a cyclic graph of objects. Performs 'undo' operation. Performs 'redo' operation.void
Attaches a deep hierarchy of objects. Performs 'undo' operation. Performs 'redo' operation.void
Attaches a top object. Performs 'undo' operation.void
Attaches a top object and changes it within the same BM task. Performs 'undo' operation.void
Detaches a top object and then within the same transaction attaches another top object with the same FQN the detached object had. Performs 'undo' operation.void
Attaches a top object along with its children within the same BM task. Performs 'undo' operation.void
void
void
void
Changes a few BLOBs. Performs 'undo' operation.void
Creates an object and sets two features. Creates an editing context. Changes the first feature in the editing context. Changes the second feature outside the editing context. Performs 'undo' operation in the editing context. Checks that the change to the first feature is undone but the second feature remains as it is. Performs 'redo' operation in the editing context. Checks that the change to the first feature is redone but the second feature remains as it is.void
Changes a map. Performs 'undo' operation.void
Changes a few properties of an existing object. Performs 'undo' operation.void
Changes an existing contained object and then removes it from its containing collection (within the same BM task). Performs 'undo' operation.void
Creates a container with a few children, adds all the children to a non-containment collection. Detaches one of the children from the container.void
Changes an existing top object and then detaches it (within the same BM task). Performs 'undo' operation.void
Attaches a top object in a local editing context. Adds a contained derived object outside the editing context. Performes 'undo' operation in the local editing context. Checks that the top object is detached along with the derived contained object.void
Modifies a top object and its contained derived object. Detaches the contained derived object outside the editing context. Performes 'undo' operation in the local editing context. Checks that the top object modifications are undone and the derived object is not reattached. Performes 'redo' operation in the local editing context. Checks that the top object modifications are redone and the derived object is not reattached.
-
Constructor Details
-
UndoRedoTest
public UndoRedoTest()
-
-
Method Details
-
setUpClass
- Throws:
IOException
-
tearDownClass
- Throws:
IOException
-
setUp
public void setUp() -
tearDown
public void tearDown() -
testAttachContainedObject1
public void testAttachContainedObject1()- Attaches an object to an existing container.
- Performs 'undo' operation. Checks that the object is detached.
- Performs 'redo' operation. Checks that the object is re-attached.
-
testAttachContainedObject4
public void testAttachContainedObject4()- Attaches an object to an existing container and changes it within the same BM task.
- Performs 'undo' operation. Checks that the object is detached.
- Performs 'redo' operation. Checks that the object is re-attached.
-
testAttachCyclicGraph
public void testAttachCyclicGraph()- Attaches a cyclic graph of objects.
- Performs 'undo' operation.
- Performs 'redo' operation. Checks that all the objects are re-attached and the references restored correctly.
-
testAttachDeepHierarchy
public void testAttachDeepHierarchy()- Attaches a deep hierarchy of objects.
- Performs 'undo' operation.
- Performs 'redo' operation. Checks that all the objects are re-attached.
-
testAttachTopObject1
public void testAttachTopObject1()- Attaches a top object.
- Performs 'undo' operation. Checks that the object is detached.
- Performs 'redo' operation. Checks that the object is re-attached.
-
testAttachTopObject4
public void testAttachTopObject4()- Attaches a top object and changes it within the same BM task.
- Performs 'undo' operation. Checks that the object is detached.
- 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()- Detaches a top object and then within the same transaction attaches another top object with the same FQN the detached object had.
- Performs 'undo' operation. Checks that the first object is attached and the second object is detached.
- Performs 'redo' operation. Checks that the first object is detached again and the second object is attached.
-
testAttachTopObjectWithChildren
public void testAttachTopObjectWithChildren()- Attaches a top object along with its children within the same BM task.
- Performs 'undo' operation. Checks that the top object and all its children are detached.
- Performs 'redo' operation. Checks that the top object and all its children are re-attached.
-
testUndoObjectAttachWhichHasDerivedContainedObjects
public void testUndoObjectAttachWhichHasDerivedContainedObjects()- Attaches a top object in a local editing context.
- Adds a contained derived object outside the editing context.
- Performes 'undo' operation in the local editing context.
- Checks that the top object is detached along with the derived contained object.
-
testUndoTaskThatModifiesContainedDerivedObjects
public void testUndoTaskThatModifiesContainedDerivedObjects()- Modifies a top object and its contained derived object.
- Detaches the contained derived object outside the editing context.
- Performes 'undo' operation in the local editing context.
- Checks that the top object modifications are undone and the derived object is not reattached.
- Performes 'redo' operation in the local editing context.
- Checks that the top object modifications are redone and the derived object is not reattached.
-
testChangeBlobs
public void testChangeBlobs()- Changes a few BLOBs.
- Performs 'undo' operation. Checks that all the BLOBs are reset to its original state.
- Performs 'redo' operation. Checks that all the BLOBs are changed again.
-
testChangeProperties
public void testChangeProperties()- Changes a few properties of an existing object.
- Performs 'undo' operation. Checks that all the properties a reset to its original state.
- Performs 'redo' operation. Checks that all the properties are changed again.
-
testDetachContainedObject1
public void testDetachContainedObject1()- Changes an existing contained object and then removes it from its containing collection (within the same BM task).
- 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.
- Performs 'redo' operation. Checks that the object is detached.
-
testDetachContainedObject2
public void testDetachContainedObject2()- Creates a container with a few children, adds all the children to a non-containment collection.
- Detaches one of the children from the container. Checks that the non-containment reference to this child is broken.
- Performs 'undo' operation. Checks that the child is attached and the non-containment is restored correctly.
- Performs 'redo' operation. Checks that the child is detached and the non-containment reference is broken again.
-
testDetachTopObject
public void testDetachTopObject()- Changes an existing top object and then detaches it (within the same BM task).
- Performs 'undo' operation. Checks that the object is attached and its state is the same as it was just before step 1 execution.
- Performs 'redo' operation. Checks that the object is detached.
-
testChangeMapFeature
public void testChangeMapFeature()- Changes a map.
- Performs 'undo' operation. Checks that the map is reset to its original state.
- Performs 'redo' operation. Checks that the map is changed again.
-
testBackReferenceUpdateWhenAttachIsUndone
public void testBackReferenceUpdateWhenAttachIsUndone() -
testBackReferenceUpdateWhenDetachIsUndone
public void testBackReferenceUpdateWhenDetachIsUndone() -
testBackReferenceUpdateWhenChangeIsUndone
public void testBackReferenceUpdateWhenChangeIsUndone() -
testChangeFeatureInEditingContextThenChangeAnotherFeatureOutsideEditingContext
public void testChangeFeatureInEditingContextThenChangeAnotherFeatureOutsideEditingContext()- Creates an object and sets two features.
- Creates an editing context.
- Changes the first feature in the editing context.
- Changes the second feature outside the editing context.
- Performs 'undo' operation in the editing context.
- Checks that the change to the first feature is undone but the second feature remains as it is.
- Performs 'redo' operation in the editing context.
- Checks that the change to the first feature is redone but the second feature remains as it is.
-