harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [43/43] - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common: javax/swing/ javax/swing/border/ javax/swing/colorchooser/ javax/swing/event/ javax/swing/filechooser/ javax/swing/plaf/ javax/swing/plaf/basic/ j...
Date Sun, 26 Nov 2006 20:15:55 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/tree/VariableHeightLayoutCacheTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/tree/VariableHeightLayoutCacheTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/tree/VariableHeightLayoutCacheTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/tree/VariableHeightLayoutCacheTest.java Sun Nov 26 12:15:43 2006
@@ -15,22 +15,22 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing.tree;
 
 import java.awt.Rectangle;
 
 public class VariableHeightLayoutCacheTest extends AbstractLayoutCacheTest {
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         cache = new VariableHeightLayoutCache();
         defaultRowValue = cache.getRowForPath(null);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -38,6 +38,7 @@
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.VariableHeightLayoutCache()'
      */
+    @Override
     public void testLayoutCache() {
         assertFalse(cache.rootVisible);
         assertNull(cache.nodeDimensions);
@@ -49,15 +50,14 @@
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.setRootVisible(boolean)'
      */
+    @Override
     public void testSetRootVisible() {
         super.testSetRootVisible();
-
         int height = 1111;
         cache.setRowHeight(height);
         TreeModel model = new UndefaultTreeModel(root);
         root.add(node1);
         root.add(node2);
-
         cache.setModel(model);
         cache.setNodeDimensions(dimensions2);
         if (isHarmony()) {
@@ -65,25 +65,23 @@
         } else {
             assertEquals(new Rectangle(0, -1, 100, 1111), cache.getBounds(rootPath, null));
         }
-        assertEquals(new Rectangle(10, 0*height, 100, height), cache.getBounds(path1, null));
-        assertEquals(new Rectangle(10, 1*height, 100, height), cache.getBounds(path2, null));
-
+        assertEquals(new Rectangle(10, 0 * height, 100, height), cache.getBounds(path1, null));
+        assertEquals(new Rectangle(10, 1 * height, 100, height), cache.getBounds(path2, null));
         cache.setRootVisible(true);
         assertEquals(new Rectangle(0, 0, 100, 1111), cache.getBounds(rootPath, null));
-        assertEquals(new Rectangle(10, 1*height, 100, height), cache.getBounds(path1, null));
-        assertEquals(new Rectangle(10, 2*height, 100, height), cache.getBounds(path2, null));
+        assertEquals(new Rectangle(10, 1 * height, 100, height), cache.getBounds(path1, null));
+        assertEquals(new Rectangle(10, 2 * height, 100, height), cache.getBounds(path2, null));
     }
 
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.setRowHeight(int)'
      */
+    @Override
     public void testSetRowHeight() {
         cache.setRowHeight(100);
         assertEquals(100, cache.getRowHeight());
-
         cache.setRowHeight(200);
         assertEquals(200, cache.getRowHeight());
-
         cache.setRowHeight(-1);
         assertEquals(-1, cache.getRowHeight());
     }
@@ -91,31 +89,25 @@
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.getPreferredHeight()'
      */
+    @Override
     public void testGetPreferredHeight() {
         int height = 1111;
         TreeModel model = new UndefaultTreeModel(root);
         root.add(node1);
         root.add(node2);
-
         cache.setRowHeight(height);
         assertEquals(0, cache.getPreferredHeight());
-
         cache.setModel(model);
         assertEquals(2222, cache.getPreferredHeight());
-
         cache.setRowHeight(-100);
         assertEquals(0, cache.getPreferredHeight());
-
         cache.setRowHeight(height);
         cache.setNodeDimensions(dimensions3);
         assertEquals(2222, cache.getPreferredHeight());
-
         cache.setRootVisible(true);
         assertEquals(3333, cache.getPreferredHeight());
-
         cache.setRowHeight(-100);
         assertEquals(6000, cache.getPreferredHeight());
-
         cache.setRootVisible(false);
         if (isHarmony()) {
             assertEquals(3000, cache.getPreferredHeight());
@@ -127,6 +119,7 @@
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.getPreferredWidth(Rectangle)'
      */
+    @Override
     public void testGetPreferredWidth() {
         int height = 1111;
         TreeModel model = new DefaultTreeModel(root);
@@ -136,24 +129,18 @@
         node1.add(node4);
         node2.add(node5);
         node2.add(node6);
-
         cache.setRowHeight(height);
         assertEquals(0, cache.getPreferredWidth(null));
-
         cache.setModel(model);
         assertEquals(0, cache.getPreferredWidth(null));
-
         cache.setRowHeight(-100);
         assertEquals(0, cache.getPreferredWidth(null));
-
         cache.setNodeDimensions(dimensions2);
         assertEquals(110, cache.getPreferredWidth(new Rectangle(0, 0, 0, 0)));
         assertEquals(20, cache.getPreferredHeight());
         assertEquals(110, cache.getPreferredWidth(new Rectangle(0, 3010, 10, 10)));
-
         cache.setRootVisible(true);
         assertEquals(110, cache.getPreferredWidth(new Rectangle(0, 0, 50, 100)));
-
         cache.setExpandedState(path1, true);
         if (!isHarmony()) {
             assertEquals(120, cache.getPreferredWidth(new Rectangle(0, 0, 0, 0)));
@@ -161,7 +148,6 @@
             assertEquals(100, cache.getPreferredWidth(new Rectangle(0, 0, 0, 0)));
         }
         assertEquals(120, cache.getPreferredWidth(null));
-
         cache.setExpandedState(path1, false);
         cache.setExpandedState(path2, true);
         if (!isHarmony()) {
@@ -185,14 +171,11 @@
         node1.add(node4);
         node2.add(node5);
         node2.add(node6);
-
         cache.setModel(model);
         cache.setExpandedState(rootPath, false);
         assertNull(cache.getBounds(path1, new Rectangle()));
-
         cache.setExpandedState(path1, true);
         cache.setExpandedState(path2, true);
-
         cache.setRowHeight(10);
         if (isHarmony()) {
             assertEquals(new Rectangle(0, -10, 0, 10), cache.getBounds(rootPath, null));
@@ -202,33 +185,27 @@
         assertEquals(new Rectangle(0, 0, 0, 10), cache.getBounds(path1, null));
         assertEquals(new Rectangle(0, 30, 0, 10), cache.getBounds(path2, null));
         assertEquals(new Rectangle(0, 50, 0, 10), cache.getBounds(path26, null));
-
         cache.setRowHeight(-10);
         assertEquals(new Rectangle(0, 0, 0, 0), cache.getBounds(path1, null));
         assertEquals(new Rectangle(0, 0, 0, 0), cache.getBounds(path2, null));
         assertEquals(new Rectangle(0, 0, 0, 0), cache.getBounds(path26, null));
-
         cache.setNodeDimensions(dimensions1);
         assertEquals(new Rectangle(root.hashCode(), 0, 0, 1), cache.getBounds(rootPath, null));
         assertEquals(new Rectangle(node1.hashCode(), 0, 1, 1), cache.getBounds(path1, null));
         assertEquals(new Rectangle(node2.hashCode(), 1, 1, 1), cache.getBounds(path2, null));
-//        assertEquals(new Rectangle(0, 1, 0, 0), cache.getBounds(path13, null));
-//        assertEquals(new Rectangle(0, 1, 0, 0), cache.getBounds(path14, null));
-//        assertEquals(new Rectangle(0, 2, 0, 0), cache.getBounds(path25, null));
-//        assertEquals(new Rectangle(0, 2, 0, 0), cache.getBounds(path26, null));
-
-
+        //        assertEquals(new Rectangle(0, 1, 0, 0), cache.getBounds(path13, null));
+        //        assertEquals(new Rectangle(0, 1, 0, 0), cache.getBounds(path14, null));
+        //        assertEquals(new Rectangle(0, 2, 0, 0), cache.getBounds(path25, null));
+        //        assertEquals(new Rectangle(0, 2, 0, 0), cache.getBounds(path26, null));
         cache.setRowHeight(-110);
         cache.setNodeDimensions(dimensions3);
         assertEquals(new Rectangle(0, 0, 20, 2000), cache.getBounds(rootPath, null));
-
         assertEquals(new Rectangle(10000, 0, 10, 1000), cache.getBounds(path1, null));
         assertEquals(new Rectangle(10000, 6000, 40, 4000), cache.getBounds(path2, null));
         assertEquals(new Rectangle(20000, 1000, 20, 2000), cache.getBounds(path13, null));
         assertEquals(new Rectangle(20000, 3000, 30, 3000), cache.getBounds(path14, null));
         assertEquals(new Rectangle(20000, 10000, 50, 5000), cache.getBounds(path25, null));
         assertEquals(new Rectangle(20000, 15000, 60, 6000), cache.getBounds(path26, null));
-
         cache.setModel(null);
         assertNull(cache.getBounds(path1, null));
     }
@@ -246,27 +223,22 @@
         node1.add(node4);
         node2.add(node5);
         node2.add(node6);
-
         assertNull(cache.getPathClosestTo(-100, -100));
         assertNull(cache.getPathClosestTo(0, 0));
         assertNull(cache.getPathClosestTo(100, 100));
-
         cache.setModel(model);
         cache.setExpandedState(rootPath, false);
         assertNull(cache.getPathClosestTo(-100, -100));
         assertNull(cache.getPathClosestTo(0, 0));
         assertNull(cache.getPathClosestTo(100, 100));
-
         cache.setRootVisible(true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
         assertEquals(rootPath, cache.getPathClosestTo(0, 0));
         assertEquals(rootPath, cache.getPathClosestTo(100, 100));
-
         cache.setExpandedState(rootPath, true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
         assertEquals(rootPath, cache.getPathClosestTo(0, 0));
         assertEquals(path2, cache.getPathClosestTo(100, 100));
-
         cache.setExpandedState(path1, true);
         cache.setExpandedState(path2, true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
@@ -280,33 +252,25 @@
         assertEquals(path2, cache.getPathClosestTo(120, 40));
         assertEquals(path26, cache.getPathClosestTo(120, 60));
         assertEquals(path26, cache.getPathClosestTo(120, 80));
-
-
         cache.setRowHeight(-100);
         cache.setNodeDimensions(dimensions2);
-
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
         assertEquals(rootPath, cache.getPathClosestTo(0, 0));
         assertEquals(path26, cache.getPathClosestTo(100, 100));
-
         cache.setModel(model);
         cache.setRootVisible(false);
         cache.setExpandedState(rootPath, false);
-
         assertNull(cache.getPathClosestTo(-100, -100));
         assertNull(cache.getPathClosestTo(0, 0));
         assertNull(cache.getPathClosestTo(100, 100));
-
         cache.setRootVisible(true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
         assertEquals(rootPath, cache.getPathClosestTo(0, 0));
         assertEquals(rootPath, cache.getPathClosestTo(100, 100));
-
         cache.setExpandedState(rootPath, true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
         assertEquals(rootPath, cache.getPathClosestTo(0, 0));
         assertEquals(path2, cache.getPathClosestTo(100, 100));
-
         cache.setExpandedState(path1, true);
         cache.setExpandedState(path2, true);
         assertEquals(rootPath, cache.getPathClosestTo(-100, -100));
@@ -320,7 +284,6 @@
         assertEquals(path2, cache.getPathClosestTo(120, 40));
         assertEquals(path26, cache.getPathClosestTo(120, 60));
         assertEquals(path26, cache.getPathClosestTo(120, 80));
-
         cache.setModel(null);
         assertNull(cache.getPathClosestTo(0, 0));
     }
@@ -334,13 +297,15 @@
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.invalidateSizes()'
      */
+    @Override
     public void testInvalidateSizes() {
-//        super.testInvalidateSizes();
+        //        super.testInvalidateSizes();
     }
 
     /*
      * Test method for 'javax.swing.tree.VariableHeightLayoutCache.treeNodesChanged(TreeModelEvent)'
      */
+    @Override
     public void testTreeNodesChanged() {
         super.testTreeNodesChanged();
     }
@@ -351,8 +316,8 @@
     public void testSetNodeDimensionsNodeDimensions() {
     }
 
+    @Override
     public void testIsFixedRowHeight() {
         assertFalse(cache.isFixedRowHeight());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/AbstractUndoableEditTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/AbstractUndoableEditTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/AbstractUndoableEditTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/AbstractUndoableEditTest.java Sun Nov 26 12:15:43 2006
@@ -22,28 +22,31 @@
 
 import javax.swing.BasicSwingTestCase;
 import javax.swing.UIManager;
-
 import junit.framework.TestCase;
 
 public class AbstractUndoableEditTest extends TestCase {
     private static final String UNDO_NAME_KEY = "AbstractUndoableEdit.undoText";
+
     private static final String REDO_NAME_KEY = "AbstractUndoableEdit.redoText";
 
     protected AbstractUndoableEdit obj;
 
     private String defaultUndoName;
+
     private String defaultRedoName;
 
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(AbstractUndoableEditTest.class);
     }
 
+    @Override
     protected void setUp() throws Exception {
         obj = new AbstractUndoableEdit();
         defaultUndoName = UIManager.getString(UNDO_NAME_KEY);
         defaultRedoName = UIManager.getString(REDO_NAME_KEY);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         UIManager.put(UNDO_NAME_KEY, defaultUndoName);
         UIManager.put(REDO_NAME_KEY, defaultRedoName);
@@ -71,11 +74,9 @@
 
     public void testDie() {
         obj.die();
-
         if (BasicSwingTestCase.isHarmony()) {
             assertFalse(isAlive(obj));
         }
-
         boolean wasException = false;
         try {
             obj.redo();
@@ -83,7 +84,6 @@
             wasException = true;
         }
         assertTrue("CannotRedoException was expected", wasException);
-
         wasException = false;
         try {
             obj.undo();
@@ -96,11 +96,9 @@
     public void testRedo() {
         obj.undo();
         obj.redo();
-
         if (BasicSwingTestCase.isHarmony()) {
             assertTrue(hasBeenDone(obj));
         }
-
         if (!obj.canRedo()) {
             boolean wasException = false;
             try {
@@ -114,11 +112,9 @@
 
     public void testUndo() {
         obj.undo();
-
         if (BasicSwingTestCase.isHarmony()) {
             assertFalse(hasBeenDone(obj));
         }
-
         if (!obj.canUndo()) {
             boolean wasException = false;
             try {
@@ -155,30 +151,26 @@
     }
 
     public void testGetRedoPresentationName() {
-        assertEquals(UIManager.getString(REDO_NAME_KEY),
-                     obj.getRedoPresentationName());
+        assertEquals(UIManager.getString(REDO_NAME_KEY), obj.getRedoPresentationName());
     }
 
     public void testGetRedoPresentationNameModified() {
         String redoName = "name of Redo";
         UIManager.put(REDO_NAME_KEY, redoName);
         assertEquals(redoName, obj.getRedoPresentationName());
-
         redoName = "alternative redo";
         UIManager.put(REDO_NAME_KEY, redoName);
         assertEquals(redoName, obj.getRedoPresentationName());
     }
 
     public void testGetUndoPresentationName() {
-        assertEquals(UIManager.getString(UNDO_NAME_KEY),
-                     obj.getUndoPresentationName());
+        assertEquals(UIManager.getString(UNDO_NAME_KEY), obj.getUndoPresentationName());
     }
 
     public void testGetUndoPresentationNameModified() {
         String undoName = "name of Undo";
         UIManager.put(UNDO_NAME_KEY, undoName);
         assertEquals(undoName, obj.getUndoPresentationName());
-
         undoName = "alternative undo";
         UIManager.put(UNDO_NAME_KEY, undoName);
         assertEquals(undoName, obj.getUndoPresentationName());
@@ -186,12 +178,14 @@
 
     public void testGetUndoPresentationNameNull() {
         obj = new AbstractUndoableEdit() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public String getPresentationName() {
                 return null;
             }
         };
-        assertEquals(UIManager.getString(UNDO_NAME_KEY),
-                     obj.getUndoPresentationName());
+        assertEquals(UIManager.getString(UNDO_NAME_KEY), obj.getUndoPresentationName());
     }
 
     public void testAddEdit() {
@@ -201,5 +195,4 @@
     public void testReplaceEdit() {
         assertFalse(obj.replaceEdit(null));
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotRedoExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotRedoExceptionTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotRedoExceptionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotRedoExceptionTest.java Sun Nov 26 12:15:43 2006
@@ -18,17 +18,17 @@
  * @author Evgeniya G. Maenkova
  * @version $Revision$
  */
-
 package javax.swing.undo;
 
 import junit.framework.TestCase;
 
-
 public class CannotRedoExceptionTest extends TestCase {
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -38,5 +38,4 @@
         assertNull(exception.getMessage());
         assertNull(exception.getCause());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotUndoExceptionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotUndoExceptionTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotUndoExceptionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CannotUndoExceptionTest.java Sun Nov 26 12:15:43 2006
@@ -18,17 +18,17 @@
  * @author Evgeniya G. Maenkova
  * @version $Revision$
  */
-
 package javax.swing.undo;
 
 import junit.framework.TestCase;
 
-
 public class CannotUndoExceptionTest extends TestCase {
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -38,5 +38,4 @@
         assertNull(exception.getMessage());
         assertNull(exception.getCause());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CompoundEditTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CompoundEditTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CompoundEditTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/CompoundEditTest.java Sun Nov 26 12:15:43 2006
@@ -26,12 +26,12 @@
 import javax.swing.event.EventListenerList;
 
 public class CompoundEditTest extends AbstractUndoableEditTest {
-
     protected CompoundEdit ce;
 
     /*
      * @see AbstractUndoableEditTest#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         ce = new CompoundEdit();
@@ -41,10 +41,12 @@
     /*
      * Class under test for java.lang.String toString()
      */
+    @Override
     public void testToString() {
         assertNotNull(ce.toString());
     }
 
+    @Override
     public void testIsSignificant() {
         assertFalse(ce.isSignificant());
         ce.addEdit(new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE));
@@ -53,13 +55,11 @@
         assertTrue(ce.isSignificant());
     }
 
+    @Override
     public void testCanUndo() {
         if (BasicSwingTestCase.isHarmony()) {
-            assertEquals(
-                    !ce.isInProgress() && (isAlive(ce) && hasBeenDone(ce)),
-                    ce.canUndo());
+            assertEquals(!ce.isInProgress() && (isAlive(ce) && hasBeenDone(ce)), ce.canUndo());
         }
-
         assertFalse(ce.canUndo());
         ce.end();
         assertTrue(ce.canUndo());
@@ -67,13 +67,11 @@
         assertFalse(ce.canUndo());
     }
 
+    @Override
     public void testCanRedo() {
         if (BasicSwingTestCase.isHarmony()) {
-            assertEquals(
-                    !ce.isInProgress() && (isAlive(ce) && !hasBeenDone(ce)),
-                    ce.canRedo());
+            assertEquals(!ce.isInProgress() && (isAlive(ce) && !hasBeenDone(ce)), ce.canRedo());
         }
-
         assertFalse(ce.canRedo());
         ce.end();
         ce.undo();
@@ -102,32 +100,43 @@
      * CAN_REDO_FALSE: canRedo returns false.
      */
     protected static class TestUndoableEdit extends AbstractUndoableEdit {
+        private static final long serialVersionUID = 1L;
 
         public static int counter = 0;
 
         int id;
 
-        public static final int DIE =                       1 << 0;
-        public static final int UNDO =                      1 << 1;
-        public static final int REDO =                      1 << 2;
-
-        public static final int NAME =                      1 << 3;
-        public static final int UNDO_NAME =                 1 << 4;
-        public static final int REDO_NAME =                 1 << 5;
-
-        public static final int ADD_EDIT_TRUE =             1 << 6;
-        public static final int ADD_EDIT_FALSE =            1 << 7;
-        public static final int REPLACE_EDIT_TRUE =         1 << 8;
-        public static final int REPLACE_EDIT_FALSE =        1 << 9;
-
-        public static final int IS_SIGNIFICANT_TRUE =       1 << 10;
-        public static final int IS_SIGNIFICANT_FALSE =      1 << 11;
-
-        public static final int DISCARD =                   1 << 12;
-
-        public static final int UNDO_THROW_EXCEPTION =      1 << 13;
-        public static final int CAN_UNDO_FALSE =            1 << 14;
-        public static final int CAN_REDO_FALSE =            1 << 15;
+        public static final int DIE = 1 << 0;
+
+        public static final int UNDO = 1 << 1;
+
+        public static final int REDO = 1 << 2;
+
+        public static final int NAME = 1 << 3;
+
+        public static final int UNDO_NAME = 1 << 4;
+
+        public static final int REDO_NAME = 1 << 5;
+
+        public static final int ADD_EDIT_TRUE = 1 << 6;
+
+        public static final int ADD_EDIT_FALSE = 1 << 7;
+
+        public static final int REPLACE_EDIT_TRUE = 1 << 8;
+
+        public static final int REPLACE_EDIT_FALSE = 1 << 9;
+
+        public static final int IS_SIGNIFICANT_TRUE = 1 << 10;
+
+        public static final int IS_SIGNIFICANT_FALSE = 1 << 11;
+
+        public static final int DISCARD = 1 << 12;
+
+        public static final int UNDO_THROW_EXCEPTION = 1 << 13;
+
+        public static final int CAN_UNDO_FALSE = 1 << 14;
+
+        public static final int CAN_REDO_FALSE = 1 << 15;
 
         /**
          * If the method die is called and flag is set to DISCARD
@@ -153,12 +162,8 @@
         }
 
         public TestUndoableEdit(final int flag) {
-            if ((flag & DIE) != 0
-                    || (flag & UNDO) != 0
-                    || (flag & REDO) != 0
-                    || (flag & NAME) != 0
-                    || (flag & REDO_NAME) != 0
-                    || (flag & UNDO_NAME) != 0) {
+            if ((flag & DIE) != 0 || (flag & UNDO) != 0 || (flag & REDO) != 0
+                    || (flag & NAME) != 0 || (flag & REDO_NAME) != 0 || (flag & UNDO_NAME) != 0) {
                 id = counter++;
             } else {
                 id = 0;
@@ -171,6 +176,7 @@
             listeners.add(ChangeListener.class, listener);
         }
 
+        @Override
         public void die() {
             //System.out.println("die " + id);
             super.die();
@@ -178,7 +184,6 @@
                 assertEquals(--counter, id);
                 dieCalled = true;
             }
-
             if ((flag & DISCARD) != 0) {
                 dieCalled = true;
             }
@@ -192,6 +197,7 @@
             return dieCalled;
         }
 
+        @Override
         public void undo() {
             //System.out.println("undo " + id);
             super.undo();
@@ -202,6 +208,7 @@
             }
         }
 
+        @Override
         public void redo() {
             //System.out.println("redo " + id);
             super.redo();
@@ -210,6 +217,7 @@
             }
         }
 
+        @Override
         public String getPresentationName() {
             if ((flag & NAME) != 0) {
                 return String.valueOf(id);
@@ -217,6 +225,7 @@
             return "";
         }
 
+        @Override
         public String getRedoPresentationName() {
             if ((flag & REDO_NAME) != 0) {
                 return String.valueOf(id);
@@ -224,6 +233,7 @@
             return "";
         }
 
+        @Override
         public String getUndoPresentationName() {
             if ((flag & UNDO_NAME) != 0) {
                 return String.valueOf(id);
@@ -231,35 +241,39 @@
             return "";
         }
 
+        @Override
         public boolean addEdit(final UndoableEdit edit) {
             return ((flag & ADD_EDIT_TRUE) != 0);
         }
 
+        @Override
         public boolean replaceEdit(final UndoableEdit edit) {
             isReplaceEditCalled = true;
             return ((flag & REPLACE_EDIT_TRUE) != 0);
         }
 
+        @Override
         public boolean isSignificant() {
             //System.out.println("isSignificant " + id);
             return (flag & IS_SIGNIFICANT_FALSE) == 0;
         }
 
+        @Override
         public boolean canUndo() {
             //System.out.println("canUndo " + id);
             //TODO: remove super.canUndo and add UNDO flag where it necessary
-            return (flag & CAN_UNDO_FALSE) == 0
-                  && ((flag & UNDO) != 0 || super.canUndo());
+            return (flag & CAN_UNDO_FALSE) == 0 && ((flag & UNDO) != 0 || super.canUndo());
         }
 
+        @Override
         public boolean canRedo() {
             //System.out.println("canRedo " + id);
             //TODO: remove super.canRedo and add REDO flag where it necessary
-            return (flag & CAN_REDO_FALSE) == 0
-                  && ((flag & REDO) != 0 || super.canRedo());
+            return (flag & CAN_REDO_FALSE) == 0 && ((flag & REDO) != 0 || super.canRedo());
         }
     }
 
+    @Override
     public void testUndo() {
         boolean bWasException = false;
         try {
@@ -268,16 +282,15 @@
             bWasException = true;
         }
         assertTrue("CannotUndoException must be thrown", bWasException);
-
         TestUndoableEdit.counter = 0;
         for (int i = 0; i < 10; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
         }
-
         ce.end();
         ce.undo();
     }
 
+    @Override
     public void testRedo() {
         boolean bWasException = false;
         try {
@@ -286,18 +299,17 @@
             bWasException = true;
         }
         assertTrue("CannotRedoException must be thrown", bWasException);
-
         TestUndoableEdit.counter = 0;
         for (int i = 0; i < 10; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.REDO));
         }
-
         ce.end();
         ce.undo();
         TestUndoableEdit.counter = 0;
         ce.redo();
     }
 
+    @Override
     public void testDie() {
         ce.die();
         TestUndoableEdit.counter = 0;
@@ -307,9 +319,7 @@
             edits[i] = new TestUndoableEdit(TestUndoableEdit.DIE);
             ce.addEdit(edits[i]);
         }
-
         ce.die();
-
         for (int i = 0; i < count; i++) {
             assertTrue(edits[i].isDieCalled());
         }
@@ -335,13 +345,11 @@
      */
     public void testGetPresentationName01() {
         assertEquals("", ce.getPresentationName());
-
         TestUndoableEdit.counter = 0;
         final int n = 10;
         for (int i = 0; i < n; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.NAME));
         }
-
         assertEquals(String.valueOf(n - 1), ce.getPresentationName());
     }
 
@@ -352,7 +360,6 @@
      */
     public void testGetPresentationName02() {
         assertEquals("", ce.getPresentationName());
-
         TestUndoableEdit.counter = 1;
         ce.addEdit(new TestUndoableEdit(TestUndoableEdit.NAME));
         assertEquals(String.valueOf(1), ce.getPresentationName());
@@ -360,51 +367,44 @@
         assertEquals("", ce.getPresentationName());
     }
 
+    @Override
     public void testGetRedoPresentationName() {
-        assertEquals(
-                UIManager.getString("AbstractUndoableEdit.redoText"),
-                ce.getRedoPresentationName());
-
+        assertEquals(UIManager.getString("AbstractUndoableEdit.redoText"), ce
+                .getRedoPresentationName());
         TestUndoableEdit.counter = 0;
         final int n = 10;
         for (int i = 0; i < n; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.REDO_NAME));
         }
-
         assertEquals(String.valueOf(n - 1), ce.getRedoPresentationName());
     }
 
+    @Override
     public void testGetUndoPresentationName() {
-        assertEquals(
-                UIManager.getString("AbstractUndoableEdit.undoText"),
-                ce.getUndoPresentationName());
-
+        assertEquals(UIManager.getString("AbstractUndoableEdit.undoText"), ce
+                .getUndoPresentationName());
         TestUndoableEdit.counter = 0;
         int n = 10;
         for (int i = 0; i < n; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO_NAME));
         }
-
         assertEquals(String.valueOf(n - 1), ce.getUndoPresentationName());
     }
 
     public void testLastEdit() {
         assertNull(ce.lastEdit());
-
         TestUndoableEdit.counter = 0;
         final int n = 10;
         for (int i = 0; i < n; i++) {
             ce.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE));
         }
-
-        assertEquals(n - 1, ((TestUndoableEdit)ce.lastEdit()).id);
+        assertEquals(n - 1, ((TestUndoableEdit) ce.lastEdit()).id);
     }
 
+    @Override
     public void testAddEdit() {
-        TestUndoableEdit ue = new TestUndoableEdit(
-                TestUndoableEdit.ADD_EDIT_FALSE
-                | TestUndoableEdit.UNDO
-                | TestUndoableEdit.REDO);
+        TestUndoableEdit ue = new TestUndoableEdit(TestUndoableEdit.ADD_EDIT_FALSE
+                | TestUndoableEdit.UNDO | TestUndoableEdit.REDO);
         assertTrue(ce.addEdit(ue));
         assertEquals(ue, ce.edits.elementAt(0));
         ce.end();
@@ -413,31 +413,24 @@
         ue.flag = TestUndoableEdit.UNDO;
         assertEquals(ue.canUndo(), ce.canUndo());
         assertEquals(ue.canRedo(), ue.canRedo());
-
         ce = new CompoundEdit();
         ue = new TestUndoableEdit(TestUndoableEdit.ADD_EDIT_TRUE);
         assertTrue(ce.addEdit(ue));
         assertEquals(ue, ce.edits.elementAt(0));
-
         ue = new TestUndoableEdit(TestUndoableEdit.REPLACE_EDIT_FALSE);
         assertTrue(ce.addEdit(ue));
         assertTrue(ce.edits.size() == 1);
-
-        ((TestUndoableEdit)ce.lastEdit()).flag = TestUndoableEdit.
-           ADD_EDIT_FALSE;
+        ((TestUndoableEdit) ce.lastEdit()).flag = TestUndoableEdit.ADD_EDIT_FALSE;
         ue = new TestUndoableEdit(TestUndoableEdit.REPLACE_EDIT_FALSE);
         assertTrue(ce.addEdit(ue));
         assertEquals(ue, ce.edits.elementAt(1));
-
         ue = new TestUndoableEdit(TestUndoableEdit.REPLACE_EDIT_TRUE);
         assertTrue(ce.addEdit(ue));
         assertTrue(ce.edits.size() == 2);
         assertTrue(ue.isReplaceEditCalled);
-
         ce.end();
         assertTrue(ce.canUndo());
         ce.undo();
         assertTrue(ce.canRedo());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/StateEditTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/StateEditTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/StateEditTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/StateEditTest.java Sun Nov 26 12:15:43 2006
@@ -23,21 +23,22 @@
 import java.util.Hashtable;
 import javax.swing.SwingTestCase;
 
+@SuppressWarnings("unchecked")
 public class StateEditTest extends SwingTestCase {
-    StateEdit      se1;
+    StateEdit se1;
 
-    StateEdit      se2;
+    StateEdit se2;
 
-    boolean        bWasException;
+    boolean bWasException;
 
     SimpleEditable obj;
 
     class SimpleEditable implements StateEditable {
-        boolean   wasCallStore   = false;
+        boolean wasCallStore = false;
 
-        boolean   wasCallRestore = false;
+        boolean wasCallRestore = false;
 
-        Hashtable state          = null;
+        Hashtable state = null;
 
         public void storeState(final Hashtable ht) {
             ht.put("store", "state");
@@ -53,11 +54,13 @@
     }
 
     class SimpleStateEdit extends StateEdit {
-        boolean   wasCallRemoveRedudant = false;
+        private static final long serialVersionUID = 1L;
 
-        Hashtable state1                = null;
+        boolean wasCallRemoveRedudant = false;
 
-        Hashtable state2                = null;
+        Hashtable state1 = null;
+
+        Hashtable state2 = null;
 
         void resetDbgInfo() {
             wasCallRemoveRedudant = false;
@@ -73,6 +76,7 @@
             super(s, name);
         }
 
+        @Override
         protected void removeRedundantState() {
             wasCallRemoveRedudant = true;
             state1 = preState;
@@ -81,14 +85,16 @@
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         bWasException = false;
         se1 = new SimpleStateEdit(new SimpleEditable());
-        obj = (SimpleEditable)se1.object;
+        obj = (SimpleEditable) se1.object;
         se2 = new StateEdit(new SimpleEditable(), "presentationName");
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -106,9 +112,7 @@
         se1.postState.put("4", new Integer(4));
         Hashtable oldPreState = se1.preState;
         Hashtable oldPostState = se1.postState;
-
         se1.undo();
-
         assertTrue(obj.wasCallRestore);
         assertEquals(obj.state, se1.preState);
         assertEquals(oldPreState, se1.preState);
@@ -123,7 +127,6 @@
         }
         assertTrue("ExpectedException", bWasException);
         se1.undo();
-
         obj.wasCallRestore = false;
         se1.preState.put("1", new Integer(1));
         se1.preState.put("2", new Integer(2));
@@ -146,8 +149,7 @@
     }
 
     public void testEnd() {
-
-        SimpleStateEdit stEdit = (SimpleStateEdit)se1;
+        SimpleStateEdit stEdit = (SimpleStateEdit) se1;
         se1.preState.put("1", new Integer(1));
         se1.preState.put("2", new Integer(2));
         se1.postState = new Hashtable();
@@ -155,15 +157,12 @@
         se1.postState.put("4", new Integer(4));
         Hashtable oldPreState = se1.preState;
         stEdit.resetDbgInfo();
-
         se1.end();
-
         assertTrue(obj.wasCallStore);
         assertEquals(stEdit.state2, obj.state);
         assertEquals(stEdit.state1, oldPreState);
         assertEquals(stEdit.state2, obj.state);
         assertTrue(stEdit.wasCallRemoveRedudant);
-
     }
 
     public void testRemoveRedundantState() {
@@ -178,23 +177,19 @@
         se1.preState.put("3", new Integer(3));
         se1.preState.put("4", new Integer(4));
         se1.preState.put("5", new Integer(5));
-
         se1.postState.put("1", new Integer(44));
         se1.postState.put("2x", new Integer(2));
         se1.postState.put("3x", new Integer(3));
         se1.postState.put("4x", new Integer(4));
         se1.postState.put("5", new Integer(5));
-
         se1.removeRedundantState();
         Hashtable preState = se1.preState;
         Hashtable postState = se1.postState;
-
         assertEquals(4, se1.preState.size());
         assertEquals(new Integer(1), preState.get("1"));
         assertEquals(new Integer(2), preState.get("2"));
         assertEquals(new Integer(3), preState.get("3"));
         assertEquals(new Integer(4), preState.get("4"));
-
         assertEquals(4, se1.postState.size());
         assertEquals(new Integer(44), postState.get("1"));
         assertEquals(new Integer(2), postState.get("2x"));
@@ -214,9 +209,7 @@
         obj.state = null;
         assertNull(se1.undoRedoName);
         assertEquals("presentationName", se2.undoRedoName);
-
         se1.init(newObj, "name");
-
         assertEquals(newObj, se1.object);
         assertEquals("name", se1.getPresentationName());
         assertTrue(newObj.wasCallStore);
@@ -224,14 +217,12 @@
         assertNull(se1.postState);
         assertEquals(getState(newObj), se1.preState);
         assertEquals("name", se1.undoRedoName);
-
     }
 
     public void testConstants() {
-        assertEquals("$Id: StateEdit.java,v 1.6 1997/10"
-                     + "/01 20:05:51 sandipc Exp $", StateEdit.RCSID);
-        assertEquals("$Id: StateEditable.java,v 1.2 1997/09"
-                     + "/08 19:39:08 marklin Exp $", StateEditable.RCSID);
+        assertEquals("$Id: StateEdit.java,v 1.6 1997/10" + "/01 20:05:51 sandipc Exp $",
+                StateEdit.RCSID);
+        assertEquals("$Id: StateEditable.java,v 1.2 1997/09" + "/08 19:39:08 marklin Exp $",
+                StateEditable.RCSID);
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoManagerTest.java Sun Nov 26 12:15:43 2006
@@ -24,9 +24,9 @@
 import javax.swing.event.UndoableEditEvent;
 
 public class UndoManagerTest extends CompoundEditTest {
-
     protected UndoManager um;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         um = new UndoManager();
@@ -34,66 +34,53 @@
         obj = um;
     }
 
+    @Override
     public void testToString() {
         assertNotNull(um.toString());
     }
 
+    @Override
     public void testCanUndo() {
         assertFalse(um.canUndo());
-
-        TestUndoableEdit edit1 = new TestUndoableEdit(
-             TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit1 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit1);
-
         //canUndo must call isSignificant
         assertFalse(um.canUndo());
-
         edit1.flag |= TestUndoableEdit.CAN_UNDO_FALSE;
-        TestUndoableEdit edit2 = new TestUndoableEdit(
-             TestUndoableEdit.IS_SIGNIFICANT_TRUE);
+        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edit2);
         //if edit is significant then canUndo must be called
         assertEquals(um.canUndo(), edit2.canUndo());
         edit2.flag |= TestUndoableEdit.CAN_UNDO_FALSE;
         assertEquals(um.canUndo(), edit2.canUndo());
-
         edit2.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         //move index to 1
         um.undo();
         //canUndo must return false because
         //there is no any significant edit before indexOfNextAdd
         assertFalse(um.canUndo());
-
         //back index to 2
         um.redo();
-
-        TestUndoableEdit edit3 = new TestUndoableEdit(
-                   TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit3);
-        TestUndoableEdit edit4 = new TestUndoableEdit(
-                   TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit4 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit4);
-
         //isSignificant must be call from the end to start
         // we must stop on significant edit and call canUndo
         edit2.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         assertEquals(um.canUndo(), edit2.canUndo());
         edit2.flag |= TestUndoableEdit.CAN_UNDO_FALSE;
         assertEquals(um.canUndo(), edit2.canUndo());
-
         //first significant's canUndo returns false
         //second's one returns true
-        edit3.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE
-                     | TestUndoableEdit.CAN_UNDO_FALSE;
+        edit3.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE | TestUndoableEdit.CAN_UNDO_FALSE;
         edit2.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         // must look only on last significant
         assertEquals(um.canUndo(), edit3.canUndo());
-
         //if not inProgress
         //set inProgress to false
         um.end();
         assertFalse(um.isInProgress());
-
         //now um must call to super.canUndo
         // must be true if alive && hasBeenDone
         assertTrue(um.canUndo());
@@ -102,53 +89,41 @@
         assertFalse(um.canUndo());
     }
 
+    @Override
     public void testCanRedo() {
         //empty must return false
         assertFalse(um.canRedo());
-
-        TestUndoableEdit edit1 = new TestUndoableEdit(
-                         TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit1 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit1);
-
         //canRedo must call isSignificant
         assertFalse(um.canRedo());
-
         edit1.flag |= TestUndoableEdit.CAN_REDO_FALSE;
-        TestUndoableEdit edit2 = new TestUndoableEdit(
-                         TestUndoableEdit.IS_SIGNIFICANT_TRUE);
+        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edit2);
         //if edit is significant then canUndo must be called
         assertFalse(edit2.canRedo());
         assertEquals(um.canRedo(), edit2.canRedo());
-
-        TestUndoableEdit edit3 = new TestUndoableEdit(
-                         TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit3);
         // false because there is no significant at indexOfNextAdd or after it
         assertFalse(um.canRedo());
-
         //move indexOfNextAdd to 1 and call undo for edit2 & edit 3
         um.undo();
-
         //canRedo must be called for significant edit at indexOfNextAdd or
         // after
         assertEquals(um.canRedo(), edit2.canRedo());
         edit2.flag |= TestUndoableEdit.CAN_REDO_FALSE;
         assertEquals(um.canRedo(), edit2.canRedo());
-
         edit2.flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         // canRedo must return false because there is no any significant edit
         assertFalse(um.canRedo());
-
         edit3.flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         assertEquals(um.canRedo(), edit3.canRedo());
         edit3.flag |= TestUndoableEdit.CAN_REDO_FALSE;
         assertEquals(um.canRedo(), edit3.canRedo());
-
         // set inProgress to false
         um.end();
         assertFalse(um.isInProgress());
-
         //now um must call to super.canRedo
         // must be true if alive && !hasBeenDone
         assertFalse(um.canRedo());
@@ -159,21 +134,21 @@
         assertFalse(um.canRedo());
     }
 
+    @Override
     public void testUndo() {
         TestUndoableEdit.counter = 0;
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO
-             | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
+                | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO
-             | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
+                | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO
-             | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
+                | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
         assertEquals(5, um.indexOfNextAdd);
         um.undo();
         //indexOfNextAdd must be on last significant edit (second edit)
         assertEquals(1, um.indexOfNextAdd);
-
         um.discardAllEdits();
         TestUndoableEdit.counter = 0;
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
@@ -186,7 +161,6 @@
         assertEquals(2, TestUndoableEdit.counter);
         //index must be on last edit
         assertEquals(2, um.indexOfNextAdd);
-
         //set inProgress to false
         um.end();
         //and also remove last edit because it beyond indexOfNextAdd
@@ -194,30 +168,23 @@
         //undo must be called for remain 2 edits
         um.undo();
         assertEquals(0, TestUndoableEdit.counter);
-
         um = new UndoManager();
-
         boolean bWasException = false;
         try {
             um.undo();
         } catch (CannotUndoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotUndoException was expected", bWasException);
-
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO
-               | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
-
+                | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
         bWasException = false;
         try {
             um.undo();
         } catch (CannotUndoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotUndoException was expected", bWasException);
-
         um = new UndoManager();
         TestUndoableEdit.counter = 0;
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
@@ -227,69 +194,49 @@
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO
                 | TestUndoableEdit.IS_SIGNIFICANT_FALSE));
-
         assertEquals(5, um.indexOfNextAdd);
-
         um.undo();
         assertEquals(3, um.indexOfNextAdd);
-
         um.undo();
-
         um.undo();
     }
 
+    @Override
     public void testRedo() {
         TestUndoableEdit.counter = 0;
-        TestUndoableEdit edit1 = new TestUndoableEdit(
-                          TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit1 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit1);
-        TestUndoableEdit edit2 = new TestUndoableEdit(
-                          TestUndoableEdit.IS_SIGNIFICANT_TRUE);
+        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edit2);
-        TestUndoableEdit edit3 = new TestUndoableEdit(
-                           TestUndoableEdit.IS_SIGNIFICANT_TRUE
-                           | TestUndoableEdit.UNDO);
+        TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE
+                | TestUndoableEdit.UNDO);
         um.addEdit(edit3);
-        TestUndoableEdit edit4 = new TestUndoableEdit(
-                           TestUndoableEdit.IS_SIGNIFICANT_FALSE
-                           | TestUndoableEdit.UNDO);
+        TestUndoableEdit edit4 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE
+                | TestUndoableEdit.UNDO);
         um.addEdit(edit4);
-        TestUndoableEdit edit5 = new TestUndoableEdit(
-                           TestUndoableEdit.IS_SIGNIFICANT_FALSE
-                           | TestUndoableEdit.UNDO);
+        TestUndoableEdit edit5 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE
+                | TestUndoableEdit.UNDO);
         um.addEdit(edit5);
-
         //first we call undo
         um.undo();
         //index must be on 2
         // and undo was called for edit3, then for edit4 and last for edit5
         assertEquals(2, um.indexOfNextAdd);
         assertTrue(um.canRedo());
-
         edit3.id = 0;
-        edit3.flag = TestUndoableEdit.REDO
-                     | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
-
+        edit3.flag = TestUndoableEdit.REDO | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edit2.id = -2;
-        edit2.flag = TestUndoableEdit.REDO
-                     | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
-
+        edit2.flag = TestUndoableEdit.REDO | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edit1.id = -1;
         edit1.flag |= TestUndoableEdit.REDO;
-
         edit4.id = 1;
-        edit4.flag = TestUndoableEdit.REDO
-                     | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
-
+        edit4.flag = TestUndoableEdit.REDO | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edit5.id = 2;
-        edit5.flag = TestUndoableEdit.REDO
-                     | TestUndoableEdit.IS_SIGNIFICANT_TRUE;
-
+        edit5.flag = TestUndoableEdit.REDO | TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         TestUndoableEdit.counter = 0;
         assertTrue(um.canRedo());
         //redo must be called first for edit3, then for edit3 & edit2
         assertEquals(2, um.indexOfNextAdd);
-
         // 1) edit3.isSignificant? false
         // 2) edit4.isSignificant? false
         // 3) edit5.isSignificant? true
@@ -299,18 +246,14 @@
         // find significant starting from indexOfNextAdd -> END
         // call redo starting from indexOfNextAdd -> significant
         um.redo();
-
         um.discardAllEdits();
-
         boolean bWasException = false;
         try {
             um.redo();
         } catch (CannotRedoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotRedoException was expected", bWasException);
-
         //set inProgress to false
         um.end();
         // set hasBeenDone to false
@@ -318,29 +261,26 @@
         // call must lead to super.redo
         // exception must not be thrown
         um.redo();
-
         bWasException = false;
         try {
             um.redo();
         } catch (CannotRedoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotRedoException was expected", bWasException);
     }
 
+    @Override
     public void testEnd() {
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE));
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE));
-
         um.undo();
         um.undo();
         um.undo();
         // we moved indexOfNextAdd from 4 to 1
         assertEquals(1, um.indexOfNextAdd);
-
         um.end();
         // must be called:
         // 1) edit3.die
@@ -358,7 +298,6 @@
         // call for empty manager
         // nothing should happen
         um.discardAllEdits();
-
         //add several edits with DISCARD flag
         final int editCount = 10;
         TestUndoableEdit[] edits = new TestUndoableEdit[editCount];
@@ -366,26 +305,20 @@
             edits[i] = new TestUndoableEdit(TestUndoableEdit.DISCARD);
             um.addEdit(edits[i]);
         }
-
         um.setLimit(200);
-
         um.discardAllEdits();
-
         //check that every edit was discard
         for (int i = 0; i < editCount; i++) {
             assertTrue(edits[i].isDieCalled());
         }
-
         assertEquals(0, um.edits.size());
         assertEquals(0, um.indexOfNextAdd);
         assertEquals(200, um.getLimit());
-
         um = new UndoManager();
         um.end();
         um.undo();
         assertFalse(um.isInProgress());
         assertFalse(hasBeenDone(um));
-
         um.discardAllEdits();
         assertFalse(um.isInProgress());
         assertFalse(hasBeenDone(um));
@@ -406,13 +339,9 @@
             //so indexOfNextAdd == limit
         }
         assertEquals(100, um.indexOfNextAdd);
-
         um.trimForLimit();
-
         assertEquals(um.edits.size(), um.getLimit());
-
         int limit = um.getLimit();
-
         // indexOfNextAdd must be a center
         for (int i = 0; i < editCount; i++) {
             if (i < limit / 2 || i > limit * 3 / 2 - 1) {
@@ -421,7 +350,6 @@
                 assertFalse(edits[i].isDieCalled());
             }
         }
-
         assertEquals(limit, um.edits.size());
     }
 
@@ -434,32 +362,26 @@
             wasException = true;
         }
         assertTrue("CannotUndoException was expected", wasException);
-
         //it makes sense to use undoOrRedo only when limit is equal to 1
         um.setLimit(1);
-
         TestUndoableEdit.counter = 0;
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.UNDO));
-
         assertEquals(1, um.indexOfNextAdd);
         //first it should call to undo
         um.undoOrRedo();
         assertEquals(0, TestUndoableEdit.counter);
         assertEquals(0, um.indexOfNextAdd);
-
         um.edits.set(0, new TestUndoableEdit(TestUndoableEdit.REDO));
         //then it should call to redo
         TestUndoableEdit.counter = 0;
         um.undoOrRedo();
         assertEquals(1, TestUndoableEdit.counter);
         assertEquals(1, um.indexOfNextAdd);
-
         TestUndoableEdit.counter = 0;
         um.edits.set(0, new TestUndoableEdit(TestUndoableEdit.UNDO));
         um.undoOrRedo();
         assertEquals(0, TestUndoableEdit.counter);
         assertEquals(0, um.indexOfNextAdd);
-
         um.end();
         // nothing must be call
         um.undoOrRedo();
@@ -468,17 +390,13 @@
     public void testCanUndoOrRedo() {
         //must be false if edits is empty
         assertFalse(um.canUndoOrRedo());
-
         //it makes sense to use canUndoOrRedo only when limit is equal to 1
         um.setLimit(1);
-
         TestUndoableEdit edit = new TestUndoableEdit(TestUndoableEdit.UNDO);
         um.addEdit(edit);
         assertTrue(um.canUndoOrRedo());
-
         um.discardAllEdits();
         assertFalse(um.canUndoOrRedo());
-
         um = new UndoManager();
         um.addEdit(edit);
         assertTrue(um.canUndoOrRedo());
@@ -501,7 +419,6 @@
             um.edits.add(edits[i]);
         }
         um.setLimit(newLimit);
-
         assertEquals(newLimit, um.getLimit());
         assertEquals(newLimit, um.edits.size());
         for (int i = 0; i < editCount; i++) {
@@ -521,11 +438,8 @@
             edits[i] = new TestUndoableEdit(TestUndoableEdit.DISCARD);
             um.edits.add(edits[i]);
         }
-
         final int from = 25, to = 75;
-
         um.trimEdits(from, to);
-
         for (int i = 0; i < editCount; i++) {
             if (i < from || i > to) {
                 assertFalse(edits[i].isDieCalled());
@@ -538,100 +452,74 @@
     /*
      * Class under test for java.lang.String getRedoPresentationName()
      */
+    @Override
     public void testGetRedoPresentationName() {
         assertEquals(UIManager.getString("AbstractUndoableEdit.redoText"), um
                 .getRedoPresentationName());
-
-        TestUndoableEdit edit1 = new TestUndoableEdit(
-                  TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit1 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit1);
-        TestUndoableEdit edit2 = new TestUndoableEdit(
-                  TestUndoableEdit.REDO_NAME
-                  | TestUndoableEdit.IS_SIGNIFICANT_TRUE);
+        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.REDO_NAME
+                | TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edit2);
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE));
-
         um.undo();
-
         // returns getRedoPresentationName of significant edit
-        assertEquals(edit2.getRedoPresentationName(), um
-                .getRedoPresentationName());
-
-        edit2.flag = TestUndoableEdit.REDO_NAME
-                     | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
+        assertEquals(edit2.getRedoPresentationName(), um.getRedoPresentationName());
+        edit2.flag = TestUndoableEdit.REDO_NAME | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         assertEquals(UIManager.getString("AbstractUndoableEdit.redoText"), um
                 .getRedoPresentationName());
-
         um.end();
         // not inProgress
         assertEquals(1, um.edits.size());
         assertFalse(um.isInProgress());
-
         edit1.flag |= TestUndoableEdit.REDO_NAME;
         assertEquals(edit1, um.edits.get(0));
-        assertEquals(edit1.getRedoPresentationName(), um
-                .getRedoPresentationName());
+        assertEquals(edit1.getRedoPresentationName(), um.getRedoPresentationName());
     }
 
     public void testGetUndoOrRedoPresentationName() {
         TestUndoableEdit.counter = 0;
         um.setLimit(1);
-        TestUndoableEdit edit = new TestUndoableEdit(TestUndoableEdit.
-                                                     UNDO_NAME);
+        TestUndoableEdit edit = new TestUndoableEdit(TestUndoableEdit.UNDO_NAME);
         um.addEdit(edit);
-
         //before undo function must call to edit.getUndoPresentationName
-        assertEquals(edit.getUndoPresentationName(), um
-                .getUndoOrRedoPresentationName());
-
+        assertEquals(edit.getUndoPresentationName(), um.getUndoOrRedoPresentationName());
         um.undoOrRedo();
         edit.flag = TestUndoableEdit.REDO_NAME;
         //before undo function must call to edit.getUndoPresentationName
-        assertEquals(edit.getRedoPresentationName(), um
-                .getUndoOrRedoPresentationName());
-
+        assertEquals(edit.getRedoPresentationName(), um.getUndoOrRedoPresentationName());
         //back to undo name
         um.undoOrRedo();
         edit.flag = TestUndoableEdit.UNDO_NAME;
-        assertEquals(edit.getUndoPresentationName(), um
-                .getUndoOrRedoPresentationName());
+        assertEquals(edit.getUndoPresentationName(), um.getUndoOrRedoPresentationName());
     }
 
     /*
      * Class under test for java.lang.String getUndoPresentationName()
      */
+    @Override
     public void testGetUndoPresentationName() {
         assertEquals(UIManager.getString("AbstractUndoableEdit.undoText"), um
                 .getUndoPresentationName());
-
         um.addEdit(new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE));
-        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.
-                   UNDO_NAME
-                   | TestUndoableEdit.IS_SIGNIFICANT_TRUE);
+        TestUndoableEdit edit2 = new TestUndoableEdit(TestUndoableEdit.UNDO_NAME
+                | TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edit2);
-        TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.
-                   IS_SIGNIFICANT_FALSE);
+        TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
         um.addEdit(edit3);
-
         // returns getUndoPresentationName of significant edit
-        assertEquals(edit2.getUndoPresentationName(), um
-                .getUndoPresentationName());
-
-        edit2.flag = TestUndoableEdit.UNDO_NAME
-                     | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
+        assertEquals(edit2.getUndoPresentationName(), um.getUndoPresentationName());
+        edit2.flag = TestUndoableEdit.UNDO_NAME | TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         assertEquals(UIManager.getString("AbstractUndoableEdit.undoText"), um
                 .getUndoPresentationName());
-
         um.end();
         // not inProgress
         assertEquals(3, um.edits.size());
         assertFalse(um.isInProgress());
-
         // last edit is edit3
         edit3.flag |= TestUndoableEdit.UNDO_NAME;
         assertEquals(edit3, um.lastEdit());
-        assertEquals(edit3.getUndoPresentationName(), um
-                .getUndoPresentationName());
+        assertEquals(edit3.getUndoPresentationName(), um.getUndoPresentationName());
     }
 
     public void testUndoableEditHappened() {
@@ -650,43 +538,34 @@
         edits[0] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edits[0]);
         for (int i = 1; i < editCount; i++) {
-            edits[i] = new TestUndoableEdit(TestUndoableEdit.
-                 IS_SIGNIFICANT_FALSE);
+            edits[i] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
             um.addEdit(edits[i]);
         }
-
         um.undo();
         assertEquals(0, um.indexOfNextAdd);
         assertEquals(edits[0], um.editToBeRedone());
-
         //when undo was called only edits[0] was undoable
         //so indexOfNextAdd is located in 0 and
         //the result must be equal to edits[0]
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         assertEquals(edits[0], um.editToBeRedone());
-
         //it must be null if there are no any significant edit
         edits[0].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         assertNull(um.editToBeRedone());
-
         um = new UndoManager();
         edits = new TestUndoableEdit[editCount];
         edits[0] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edits[0]);
         for (int i = 1; i < editCount; i++) {
-            edits[i] = new TestUndoableEdit(TestUndoableEdit.
-                                            IS_SIGNIFICANT_FALSE);
+            edits[i] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
             um.addEdit(edits[i]);
         }
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
-
         um.undo();
         assertEquals(edits[50], um.editToBeRedone());
-
         um.undo();
         assertEquals(edits[0], um.editToBeRedone());
-
         //it must be null if there are no any significant edit
         edits[0].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
@@ -701,22 +580,17 @@
         edits[0] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_TRUE);
         um.addEdit(edits[0]);
         for (int i = 1; i < editCount; i++) {
-            edits[i] = new TestUndoableEdit(TestUndoableEdit.
-                                            IS_SIGNIFICANT_FALSE);
+            edits[i] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
             um.addEdit(edits[i]);
         }
-
         assertEquals(edits[0], um.editToBeUndone());
-
         //returned edit should be first in reverse of the order they were added
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         assertEquals(edits[50], um.editToBeUndone());
-
         //returned edit must be null if there are no any significant edit
         edits[0].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         edits[50].flag = TestUndoableEdit.IS_SIGNIFICANT_FALSE;
         assertNull(um.editToBeUndone());
-
         edits[99].flag = TestUndoableEdit.IS_SIGNIFICANT_TRUE;
         assertEquals(edits[99], um.editToBeUndone());
     }
@@ -730,23 +604,19 @@
             if (i >= start && i < end) {
                 edits[i] = new TestUndoableEdit(TestUndoableEdit.UNDO);
             } else {
-                edits[i] = new TestUndoableEdit(
-                    TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+                edits[i] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
             }
             um.addEdit(edits[i]);
         }
-
         final int limit = 30;
         assertEquals(editCount, um.indexOfNextAdd);
         um.undoTo(edits[limit]);
         assertEquals(limit, um.indexOfNextAdd);
-
         //undo must be called only from END -> START
         //and must stop on TO
         //method undo must not be called for TO - START edits
         //indexOfNextAdd must be replaced to edits[TO]
         assertEquals(limit - start, TestUndoableEdit.counter);
-
         TestUndoableEdit.counter = 0;
         final int countRedo = 40;
         for (int i = limit; i < end; i++) {
@@ -761,25 +631,24 @@
         //indexOfNextAdd must be replaced to edits[TO_REDO]
         assertEquals(countRedo - limit + 1, TestUndoableEdit.counter);
         assertEquals(countRedo + 1, um.indexOfNextAdd);
-
         um = new UndoManager();
         UndoableEdit ed = new AbstractUndoableEdit() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public boolean canRedo() {
                 return false;
             }
         };
         um.addEdit(ed);
-
         // to move indexOfNextAdd from last edit to ed
         um.undoTo(ed);
-
         boolean bWasException = false;
         try {
             um.redoTo(ed);
         } catch (CannotRedoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotRedoException was expected", bWasException);
     }
 
@@ -791,32 +660,30 @@
             if (i < 50) {
                 edits[i] = new TestUndoableEdit(TestUndoableEdit.UNDO);
             } else {
-                edits[i] = new TestUndoableEdit(
-                                  TestUndoableEdit.IS_SIGNIFICANT_FALSE);
+                edits[i] = new TestUndoableEdit(TestUndoableEdit.IS_SIGNIFICANT_FALSE);
             }
             um.addEdit(edits[i]);
         }
-
         assertEquals(editCount, um.indexOfNextAdd);
         um.undoTo(edits[40]);
         assertEquals(40, TestUndoableEdit.counter);
         assertEquals(40, um.indexOfNextAdd);
-
         um = new UndoManager();
         UndoableEdit ed = new AbstractUndoableEdit() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public boolean canUndo() {
                 return false;
             }
         };
         um.addEdit(ed);
-
         boolean bWasException = false;
         try {
             um.undoTo(ed);
         } catch (CannotUndoException e) {
             bWasException = true;
         }
-
         assertTrue("CannotUndoException was expected", bWasException);
     }
 
@@ -826,13 +693,10 @@
     public void testAddEditUndoableEdit() {
         // if end was called then UndoManager acts as CompoundEdit
         um.end();
-
         // returns false and doesn't add anything
         assertFalse(um.addEdit(new TestUndoableEdit(TestUndoableEdit.DIE)));
         assertEquals(0, um.edits.size());
-
         um = new UndoManager();
-
         TestUndoableEdit.counter = 0;
         TestUndoableEdit edit1 = new TestUndoableEdit();
         assertTrue(um.addEdit(edit1));
@@ -843,17 +707,14 @@
         TestUndoableEdit edit3 = new TestUndoableEdit(TestUndoableEdit.DIE);
         assertTrue(um.addEdit(edit3));
         assertEquals(3, um.indexOfNextAdd);
-
         um.undo();
         um.undo();
         // moved indexOfNextAdd from 3 to 1
         assertEquals(1, um.indexOfNextAdd);
-
         TestUndoableEdit replaceEdit = new TestUndoableEdit();
         assertTrue(um.addEdit(replaceEdit));
         // must be called:
         // 1) edit3.die
         // 2) edit2.die
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoableEditSupportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoableEditSupportTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoableEditSupportTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/undo/UndoableEditSupportTest.java Sun Nov 26 12:15:43 2006
@@ -21,25 +21,24 @@
 package javax.swing.undo;
 
 import java.util.Vector;
-
 import javax.swing.SwingTestCase;
 import javax.swing.event.UndoableEditEvent;
 import javax.swing.event.UndoableEditListener;
 import javax.swing.text.PlainDocument;
 
 public class UndoableEditSupportTest extends SwingTestCase {
-    ExtUESupport        ues1;
+    ExtUESupport ues1;
 
     UndoableEditSupport ues2;
 
-    PlainDocument       realSource;
+    PlainDocument realSource;
 
-    String              fireOrder;
+    String fireOrder;
 
     final String PATTERN = "@[^ }]*";
 
     class UEListener implements UndoableEditListener {
-        String            name;
+        String name;
 
         UndoableEditEvent event = null;
 
@@ -54,11 +53,11 @@
     }
 
     class ExtUESupport extends UndoableEditSupport {
-        boolean      wasCallCreate   = false;
+        boolean wasCallCreate = false;
 
-        boolean      wasCallPostEdit = false;
+        boolean wasCallPostEdit = false;
 
-        UndoableEdit ue              = null;
+        UndoableEdit ue = null;
 
         void resetDbgInfo() {
             wasCallPostEdit = false;
@@ -66,37 +65,43 @@
             ue = null;
         }
 
+        @Override
         protected void _postEdit(final UndoableEdit e) {
             wasCallPostEdit = true;
             ue = e;
             super._postEdit(e);
         }
 
+        @Override
         public synchronized void postEdit(final UndoableEdit a0) {
             super.postEdit(a0);
         }
 
+        @Override
         protected CompoundEdit createCompoundEdit() {
             wasCallCreate = true;
             return super.createCompoundEdit();
         }
-
     }
 
     class ExtCompoundEdit extends CompoundEdit {
+        private static final long serialVersionUID = 1L;
+
         boolean wasCallAddEdit = false;
 
-        boolean wasCallEnd     = false;
+        boolean wasCallEnd = false;
 
         public ExtCompoundEdit() {
             super();
         }
 
+        @Override
         public boolean addEdit(final UndoableEdit anEdit) {
             wasCallAddEdit = true;
             return super.addEdit(anEdit);
         }
 
+        @Override
         public void end() {
             wasCallEnd = true;
             super.end();
@@ -106,7 +111,6 @@
             wasCallAddEdit = false;
             wasCallEnd = false;
         }
-
     }
 
     void resetDbgInfo(final ExtCompoundEdit ce, final ExtUESupport ues) {
@@ -114,6 +118,7 @@
         ues.resetDbgInfo();
     }
 
+    @Override
     protected void setUp() throws Exception {
         ues1 = new ExtUESupport();
         realSource = new PlainDocument();
@@ -122,6 +127,7 @@
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -150,19 +156,16 @@
         UEListener listener1 = new UEListener("1");
         UEListener listener2 = new UEListener("2");
         UEListener listener3 = new UEListener("3");
-
         ues1.addUndoableEditListener(listener1);
         ues1.addUndoableEditListener(listener2);
         ues1.addUndoableEditListener(listener3);
         UndoableEdit ue = new CompoundEdit();
         UndoableEditEvent uee = new UndoableEditEvent(ues1.realSource, ue);
         ues1._postEdit(ue);
-
         assertEquals("123", fireOrder);
         checkEvent(uee, listener1.event);
         checkEvent(uee, listener2.event);
         checkEvent(uee, listener3.event);
-
     }
 
     public void testBeginUpdate() {
@@ -176,7 +179,6 @@
                 assertFalse(ues1.wasCallCreate);
                 assertEquals(i + 1, ues1.getUpdateLevel());
             }
-
         }
     }
 
@@ -203,10 +205,8 @@
         for (int i = 0; i < 10; i++) {
             CompoundEdit ce1 = ues1.compoundEdit;
             UndoableEditEvent uee = new UndoableEditEvent(ues1.realSource, ce1);
-
             resetDbgInfo(ce, ues1);
             ues1.endUpdate();
-
             assertEquals(4 - i, ues1.updateLevel);
             if (ues1.updateLevel == 0) {
                 assertTrue(ues1.wasCallPostEdit);
@@ -222,9 +222,7 @@
             } else {
                 assertNull(ues1.compoundEdit);
             }
-
         }
-
         for (int i = 0; i < 20; i++) {
             ues1.wasCallCreate = false;
             ues1.beginUpdate();
@@ -271,25 +269,21 @@
                 checkUpdateLevel(count, ues1);
             }
         }
-
     }
 
     public void testPostEdit() {
         ues1.postEdit(null);
         assertTrue(true);
         assertNull(ues1.ue);
-
         UndoableEdit ue = new CompoundEdit();
         ues1.postEdit(ue);
         assertEquals(ue, ues1.ue);
     }
 
     String getString(final UndoableEditSupport ues) {
-        return ues.getClass().getName() + " " + "updateLevel: "
-               + ues.updateLevel + " " + "listeners: "
-               + ues.listeners.toString() + " " + "compoundEdit: "
-               + ues.compoundEdit;
-
+        return ues.getClass().getName() + " " + "updateLevel: " + ues.updateLevel + " "
+                + "listeners: " + ues.listeners.toString() + " " + "compoundEdit: "
+                + ues.compoundEdit;
     }
 
     void checkToString(final UndoableEditSupport ues) {
@@ -302,6 +296,7 @@
         checkToString(ues2);
     }
 
+    @SuppressWarnings("unchecked")
     void checkListeners(final UndoableEditSupport ues, final Vector v) {
         UndoableEditListener[] listeners = ues.getUndoableEditListeners();
         int length = v.size();
@@ -312,6 +307,7 @@
         assertEquals(v, ues.listeners);
     }
 
+    @SuppressWarnings("unchecked")
     public void testAddRemoveGetUndoableEditListener() {
         UEListener listener1 = new UEListener("1");
         UEListener listener2 = new UEListener("2");
@@ -320,27 +316,21 @@
         ues1.addUndoableEditListener(listener1);
         listenersVector.add(listener1);
         checkListeners(ues1, listenersVector);
-
         ues1.addUndoableEditListener(listener2);
         listenersVector.add(listener2);
         checkListeners(ues1, listenersVector);
-
         ues1.addUndoableEditListener(listener3);
         listenersVector.add(listener3);
         checkListeners(ues1, listenersVector);
-
         ues1.addUndoableEditListener(listener1);
         listenersVector.add(listener1);
         checkListeners(ues1, listenersVector);
-
         ues1.removeUndoableEditListener(listener2);
         listenersVector.remove(listener2);
         checkListeners(ues1, listenersVector);
-
         ues1.removeUndoableEditListener(listener1);
         listenersVector.remove(listener1);
         checkListeners(ues1, listenersVector);
-
         ues1.removeUndoableEditListener(listener3);
         listenersVector.remove(listener3);
         checkListeners(ues1, listenersVector);
@@ -350,13 +340,11 @@
         ExtCompoundEdit ce = new ExtCompoundEdit();
         ues1.compoundEdit = ce;
         resetDbgInfo(ce, ues1);
-
         UndoableEdit ue = new CompoundEdit();
         assertEquals(0, ues1.updateLevel);
         ues1.postEdit(ue);
         assertTrue(ues1.wasCallPostEdit);
         assertFalse(ce.wasCallAddEdit);
-
         ues1.updateLevel = 3;
         resetDbgInfo(ce, ues1);
         assertEquals(ce, ues1.compoundEdit);
@@ -365,5 +353,4 @@
         assertFalse(ues1.wasCallPostEdit);
         assertTrue(ce.wasCallAddEdit);
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/SizeRequirementsHelperRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/SizeRequirementsHelperRTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/SizeRequirementsHelperRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/SizeRequirementsHelperRTest.java Sun Nov 26 12:15:43 2006
@@ -23,13 +23,13 @@
 import javax.swing.BasicSwingTestCase;
 import javax.swing.SizeRequirements;
 
-import org.apache.harmony.x.swing.SizeRequirementsHelper;
-
 public class SizeRequirementsHelperRTest extends BasicSwingTestCase {
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -37,8 +37,7 @@
     public void testCalculateAlignedPositions() {
         SizeRequirements total = new SizeRequirements(100, 100, Integer.MAX_VALUE, 0.5f);
         SizeRequirements[] children = new SizeRequirements[] {
-             new SizeRequirements(25, 25, 25, 0.5f),
-             new SizeRequirements(50, 50, 50, 0.5f)};
+                new SizeRequirements(25, 25, 25, 0.5f), new SizeRequirements(50, 50, 50, 0.5f) };
         int[] offsets = new int[children.length];
         int[] spans = new int[children.length];
         SizeRequirementsHelper.calculateAlignedPositions(100, total, children, offsets, spans);
@@ -46,11 +45,9 @@
         assertEquals(25, offsets[1]);
         assertEquals(25, spans[0]);
         assertEquals(50, spans[1]);
-
         total = new SizeRequirements(100, 1000, Integer.MAX_VALUE, 0.5f);
-        children = new SizeRequirements[] {
-             new SizeRequirements(50, 50, 250, 0.5f),
-             new SizeRequirements(100, 100, 500, 0.5f)};
+        children = new SizeRequirements[] { new SizeRequirements(50, 50, 250, 0.5f),
+                new SizeRequirements(100, 100, 500, 0.5f) };
         offsets = new int[children.length];
         spans = new int[children.length];
         SizeRequirementsHelper.calculateAlignedPositions(200, total, children, offsets, spans);

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/UtilitiesTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/UtilitiesTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/UtilitiesTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/org/apache/harmony/x/swing/UtilitiesTest.java Sun Nov 26 12:15:43 2006
@@ -24,44 +24,32 @@
 
 import java.awt.Font;
 import java.awt.FontMetrics;
-
-import javax.swing.JPanel;
 import javax.swing.SwingTestCase;
 
 public class UtilitiesTest extends SwingTestCase {
-
     public void testClipString() {
-        JPanel panel = new JPanel();
         FontMetrics metrics;
         String clippedStr;
         String initialString = "Long enough text for this label, can you see that it is clipped now?";
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 12));
         clippedStr = Utilities.clipString(metrics, initialString, 350);
         assertEquals("clipped string ", "Long enough text for this ...", clippedStr);
-
         clippedStr = Utilities.clipString(metrics, initialString, 100);
         assertEquals("clipped string ", "Long ...", clippedStr);
-
         clippedStr = Utilities.clipString(metrics, initialString, 10000);
         assertEquals("clipped string ", initialString, clippedStr);
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 60));
         clippedStr = Utilities.clipString(metrics, initialString, 1500);
         assertEquals("clipped string ", "Long enough text for t...", clippedStr);
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 50));
         clippedStr = Utilities.clipString(metrics, initialString, 500);
         assertEquals("clipped string ", "Long en...", clippedStr);
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 60));
         clippedStr = Utilities.clipString(metrics, initialString, 5);
         assertEquals("clipped string ", "...", clippedStr);
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 2));
         clippedStr = Utilities.clipString(metrics, initialString, 5);
         assertEquals("clipped string ", "...", clippedStr);
-
         metrics = getFontMetrics(new Font("fixed", Font.PLAIN, 3));
         clippedStr = Utilities.clipString(metrics, initialString, 5);
         assertEquals("clipped string ", "...", clippedStr);
@@ -70,11 +58,9 @@
     public void testIsStringEmpty() {
         assertTrue(Utilities.isEmptyString(null));
         assertTrue(Utilities.isEmptyString(""));
-
         assertFalse(Utilities.isEmptyString(" "));
         assertFalse(Utilities.isEmptyString("\t"));
         assertFalse(Utilities.isEmptyString("\n"));
         assertFalse(Utilities.isEmptyString("\r"));
     }
-
 }



Mime
View raw message