Bug 156234 - CompositeTransactionalCommandTest under-specifies test criteria for undo/redo
Summary: CompositeTransactionalCommandTest under-specifies test criteria for undo/redo
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Linux
: P2 major
Target Milestone: 1.0.1   Edit
Assignee: Linda Damus CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-09-05 13:53 EDT by Christian Damus CLA
Modified: 2010-07-19 12:25 EDT (History)
0 users

See Also:


Attachments
Patch to update the test case (5.17 KB, patch)
2006-09-05 13:56 EDT, Christian Damus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2006-09-05 13:53:13 EDT
The CompositeTransactionalCommandTest.test_execute_undo_redo JUnit test under-specifies the test criteria for whether an AbstractEMFOperation in a CompositeEMFOperation has been executed, undone, or redone.  Currently, it is testing that the composed commands are literally executed, undone, or redone, but not that the changes they effect are actually observed in a test model.

With changes implemented for memory scalability problems in the EMFT Transaction API (bug 153908), this JUnit test will fail.  Bug 153908 optimizes the recording of EMF changes and undo/redo of CompositeEMFOperations now will not call undo() and redo() on nested AbstractEMFOperations, applying a consolidated ChangeDescription, instead.  Thus, a more effective test of whether a composed command was undone/redone is to check that the model changes it made were undone/redone.
Comment 1 Christian Damus CLA 2006-09-05 13:56:18 EDT
Created attachment 49417 [details]
Patch to update the test case

Attached a patch to rework the TransactionalTestCommand fixture.  It now makes a model change when executed, and the assertUndone() and assertRedone() methods check that the model change is not observable or is observable in the model (respectively).
Comment 2 Linda Damus CLA 2006-09-05 16:18:15 EDT
Reviewed and committed the patch.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:25:01 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug