예제 #1
0
 public void testUndoSimpleTransaction() {
   Cls cls = createCls();
   Slot slot1 = createSlot();
   Slot slot2 = createSlot();
   cls.addDirectTemplateSlot(slot1);
   cls.addDirectTemplateSlot(slot2);
   Instance instance = cls.createDirectInstance(null);
   _frameStore.beginTransaction("simple nonsense");
   _frameStore.setDirectOwnSlotValues(instance, slot1, makeList("foo1"));
   _frameStore.setDirectOwnSlotValues(instance, slot2, makeList("foo2"));
   _frameStore.commitTransaction();
   assertEqualsList(makeList("foo1"), _frameStore.getDirectOwnSlotValues(instance, slot1));
   assertEqualsList(makeList("foo2"), _frameStore.getDirectOwnSlotValues(instance, slot2));
   _frameStore.undo();
   assertEqualsList(makeList(), _frameStore.getDirectOwnSlotValues(instance, slot1));
   assertEqualsList(makeList(), _frameStore.getDirectOwnSlotValues(instance, slot2));
   _frameStore.redo();
   assertEqualsList(makeList("foo1"), _frameStore.getDirectOwnSlotValues(instance, slot1));
   assertEqualsList(makeList("foo2"), _frameStore.getDirectOwnSlotValues(instance, slot2));
 }