Class UndoRedoTest
- java.lang.Object
-
- com._1c.g5.v8.bm.integration.itests.UndoRedoTest
-
public class UndoRedoTest extends Object
A set of tests for Undo/Redo mechanism.
-
-
Constructor Summary
Constructors Constructor Description UndoRedoTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setUp()
Sets up the necessary environment right before each test run.void
tearDown()
Tears down the environment.void
testAttachContainedObject1()
Attaches an object to an existing container. Performs 'undo' operation.void
testAttachContainedObject4()
Attaches an object to an existing container and changes it within the same BM task. Performs 'undo' operation.void
testAttachCyclicGraph()
Attaches a cyclic graph of objects. Performs 'undo' operation. Performs 'redo' operation.void
testAttachDeepHierarchy()
Attaches a deep hierarchy of objects. Performs 'undo' operation. Performs 'redo' operation.void
testAttachTopObject1()
Attaches a top object. Performs 'undo' operation.void
testAttachTopObject4()
Attaches a top object and changes it within the same BM task. Performs 'undo' operation.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.void
testAttachTopObjectWithChildren()
Attaches a top object along with its children within the same BM task. Performs 'undo' operation.void
testBackReferenceUpdateWhenAttachIsUndone()
void
testBackReferenceUpdateWhenChangeIsUndone()
void
testBackReferenceUpdateWhenDetachIsUndone()
void
testChangeBinaryAttachments()
Changes a few binary attachments of an existing object. Performs 'undo' operation.void
testChangeMapFeature()
Changes a map. Performs 'undo' operation.void
testChangeProperties()
Changes a few properties of an existing object. Performs 'undo' operation.void
testDetachContainedObject1()
Changes an existing contained object and then removes it from its containing collection (within the same BM task). Performs 'undo' operation.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.void
testDetachTopObject()
Changes an existing top object and then detaches it (within the same BM task). Performs 'undo' operation.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.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.
-
-
-
Method Detail
-
setUp
public void setUp() throws Exception
Sets up the necessary environment right before each test run.- Throws:
Exception
-
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.
-
testChangeBinaryAttachments
public void testChangeBinaryAttachments()
- Changes a few binary attachments of an existing object.
- Performs 'undo' operation. Checks that all the attachments a reset to its original state.
- Performs 'redo' operation. Checks that all the attachments 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()
-
-