harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [23/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_DynamicUtilTreeNodeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_DynamicUtilTreeNodeTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_DynamicUtilTreeNodeTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_DynamicUtilTreeNodeTest.java Sat Nov 25 16:04:10 2006
@@ -20,10 +20,10 @@
  */
 package javax.swing;
 
+import java.io.Serializable;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.Vector;
-
 import javax.swing.JTree.DynamicUtilTreeNode;
 import javax.swing.tree.DefaultMutableTreeNode;
 
@@ -34,10 +34,12 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         node = new DynamicUtilTreeNode("value", null);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         node = null;
     }
@@ -47,44 +49,36 @@
         assertFalse(node.hasChildren);
         assertTrue(node.loadedChildren);
         assertEquals("value", node.getUserObject());
-
         assertFalse(node.getAllowsChildren());
         assertTrue(node.isLeaf());
         assertEquals(0, node.getChildCount());
-
         node = new DynamicUtilTreeNode("value", "children value");
         assertEquals(node.childValue, "children value");
         assertTrue(node.loadedChildren);
-
-        node = new DynamicUtilTreeNode("value", new Object[] {"1"});
+        node = new DynamicUtilTreeNode("value", new Object[] { "1" });
         assertFalse(node.loadedChildren);
-
         node = new DynamicUtilTreeNode("value", new Object[] {});
         assertFalse(node.loadedChildren);
     }
 
     public void testCreateChildren() throws Exception {
         DynamicUtilTreeNode.createChildren(null, "any");
-
         DefaultMutableTreeNode root = new DefaultMutableTreeNode();
         DynamicUtilTreeNode.createChildren(root, "any");
         assertEquals(0, root.getChildCount());
         assertTrue(root.isLeaf());
-
-        int[] privitiveArrayChildren = new int[] {1, 2, 3};
+        int[] privitiveArrayChildren = new int[] { 1, 2, 3 };
         DynamicUtilTreeNode.createChildren(root, privitiveArrayChildren);
         assertEquals(0, root.getChildCount());
         assertTrue(root.isLeaf());
         assertTrue(root.getAllowsChildren());
-
-        Object[] objectArrayChildren = new Object[] {"a", "b", "c"};
+        Object[] objectArrayChildren = new Object[] { "a", "b", "c" };
         DynamicUtilTreeNode.createChildren(root, objectArrayChildren);
         assertEquals(3, root.getChildCount());
         assertTrue(root.getChildAt(0) instanceof JTree.DynamicUtilTreeNode);
         assertFalse(root.isLeaf());
-        assertEquals("a", ((DefaultMutableTreeNode)root.getChildAt(0)).getUserObject());
-
-        Vector vectorChildren = new Vector();
+        assertEquals("a", ((DefaultMutableTreeNode) root.getChildAt(0)).getUserObject());
+        Vector<String> vectorChildren = new Vector<String>();
         vectorChildren.add("1");
         vectorChildren.add("2");
         DynamicUtilTreeNode.createChildren(root, vectorChildren);
@@ -92,47 +86,41 @@
         assertTrue(root.getChildAt(4) instanceof JTree.DynamicUtilTreeNode);
         assertTrue(root.getChildAt(4).isLeaf());
         assertFalse(root.getChildAt(4).getAllowsChildren());
-        assertEquals("1", ((DefaultMutableTreeNode)root.getChildAt(3)).getUserObject());
-
-        Hashtable hashChildren = new Hashtable();
+        assertEquals("1", ((DefaultMutableTreeNode) root.getChildAt(3)).getUserObject());
+        Hashtable<String, String> hashChildren = new Hashtable<String, String>();
         hashChildren.put("key1", "value1");
         hashChildren.put("key2", "value2");
         DynamicUtilTreeNode.createChildren(root, hashChildren);
         assertEquals(7, root.getChildCount());
         assertTrue(root.getChildAt(5) instanceof JTree.DynamicUtilTreeNode);
-        assertEquals(hashChildren.keys().nextElement(), ((DefaultMutableTreeNode)root.getChildAt(5)).getUserObject());
+        assertEquals(hashChildren.keys().nextElement(), ((DefaultMutableTreeNode) root
+                .getChildAt(5)).getUserObject());
         assertEquals(0, root.getChildAt(5).getChildCount());
-
         root = new DefaultMutableTreeNode();
-        Hashtable subSubChildren = new Hashtable();
+        Hashtable<String, String> subSubChildren = new Hashtable<String, String>();
         subSubChildren.put("221", "any");
         subSubChildren.put("222", "any");
-
-        Vector subChildren = new Vector();
+        Vector<Serializable> subChildren = new Vector<Serializable>();
         subChildren.add("21");
         subChildren.add(subSubChildren);
         subChildren.add("23");
-
-        Object[] complexChildren = new Object[] {"1", subChildren, "3"};
+        Object[] complexChildren = new Object[] { "1", subChildren, "3" };
         DynamicUtilTreeNode.createChildren(root, complexChildren);
         assertEquals(3, root.getChildCount());
-        DynamicUtilTreeNode child1 = (DynamicUtilTreeNode)root.getChildAt(0);
+        DynamicUtilTreeNode child1 = (DynamicUtilTreeNode) root.getChildAt(0);
         assertFalse(child1.getAllowsChildren());
         assertEquals(0, child1.getChildCount());
         assertEquals("1", child1.getUserObject());
         assertEquals("1", child1.childValue);
         assertTrue(child1.loadedChildren);
-
-        DynamicUtilTreeNode child2 = (DynamicUtilTreeNode)root.getChildAt(1);
+        DynamicUtilTreeNode child2 = (DynamicUtilTreeNode) root.getChildAt(1);
         assertTrue(child2.getAllowsChildren());
         assertEquals(3, child2.getChildCount());
         assertEquals(subChildren, child2.getUserObject());
         assertSame(subChildren, child2.childValue);
         assertTrue(child2.loadedChildren);
-
         assertEquals(0, root.getChildAt(2).getChildCount());
-        assertEquals("3", ((DefaultMutableTreeNode)root.getChildAt(2)).getUserObject());
-
+        assertEquals("3", ((DefaultMutableTreeNode) root.getChildAt(2)).getUserObject());
         assertEquals(3, child2.getChildCount());
         assertEquals(0, child2.getChildAt(0).getChildCount());
         assertEquals(2, child2.getChildAt(1).getChildCount());
@@ -143,61 +131,52 @@
         DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", null);
         assertFalse(node.getAllowsChildren());
         assertTrue(node.isLeaf());
-
         node.setAllowsChildren(true);
         assertFalse(node.isLeaf());
     }
 
     public void testGetChildCount() throws Exception {
-        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] {"1", "2"});
+        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] { "1", "2" });
         assertFalse(node.loadedChildren);
-
         assertEquals(2, node.getChildCount());
         assertTrue(node.loadedChildren);
     }
 
     public void testGetChildAt() throws Exception {
-        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] {"1", "2"});
+        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] { "1", "2" });
         assertFalse(node.loadedChildren);
-
-        assertEquals("1", ((DynamicUtilTreeNode)node.getChildAt(0)).getUserObject());
+        assertEquals("1", ((DynamicUtilTreeNode) node.getChildAt(0)).getUserObject());
         assertTrue(node.loadedChildren);
     }
 
     public void testChildren() throws Exception {
-        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] {"1", "2"});
+        DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", new Object[] { "1", "2" });
         assertFalse(node.loadedChildren);
-
-        Enumeration children = node.children();
+        Enumeration<?> children = node.children();
         assertTrue(node.loadedChildren);
-        assertEquals("1", ((DefaultMutableTreeNode)children.nextElement()).getUserObject());
-        assertEquals("2", ((DefaultMutableTreeNode)children.nextElement()).getUserObject());
+        assertEquals("1", ((DefaultMutableTreeNode) children.nextElement()).getUserObject());
+        assertEquals("2", ((DefaultMutableTreeNode) children.nextElement()).getUserObject());
     }
 
     public void testLoadChildren() throws Exception {
-        Object[] children = new Object[] {"1", "2"};
+        Object[] children = new Object[] { "1", "2" };
         DynamicUtilTreeNode node = new DynamicUtilTreeNode("value", children);
         assertFalse(node.loadedChildren);
         assertEquals(children, node.childValue);
         assertEquals("value", node.getUserObject());
-
         node.loadChildren();
         assertTrue(node.loadedChildren);
         assertEquals(2, node.getChildCount());
-
         node.childValue = "any";
         node.loadChildren();
         assertEquals(2, node.getChildCount());
         assertEquals("value", node.getUserObject());
-
-
-        node.childValue = new Object[] {"3", "4", "5"};
+        node.childValue = new Object[] { "3", "4", "5" };
         node.loadChildren();
         assertTrue(node.loadedChildren);
         assertEquals(5, node.getChildCount());
-        assertEquals("5", ((DefaultMutableTreeNode)node.getChildAt(4)).getUserObject());
-
-        node.childValue = new Object[] {"6"};
+        assertEquals("5", ((DefaultMutableTreeNode) node.getChildAt(4)).getUserObject());
+        node.childValue = new Object[] { "6" };
         assertEquals(5, node.getChildCount());
         node.loadedChildren = false;
         assertEquals(6, node.getChildCount());

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_EmptySelectionModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_EmptySelectionModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_EmptySelectionModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_EmptySelectionModelTest.java Sat Nov 25 16:04:10 2006
@@ -20,6 +20,7 @@
  */
 package javax.swing;
 
+import javax.swing.JTree.EmptySelectionModel;
 import javax.swing.tree.TreePath;
 
 public class JTree_EmptySelectionModelTest extends BasicSwingTestCase {
@@ -29,28 +30,26 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         model = new JTree.EmptySelectionModel();
     }
 
     public void testEmptySelectionModel() throws Exception {
-        assertNotNull(model.sharedInstance);
+        assertNotNull(EmptySelectionModel.sharedInstance);
     }
 
     public void testSharedInstance() throws Exception {
-        assertSame(model.sharedInstance(), model.sharedInstance());
-        assertSame(model.sharedInstance(), model.sharedInstance);
+        assertSame(EmptySelectionModel.sharedInstance(), EmptySelectionModel.sharedInstance());
+        assertSame(EmptySelectionModel.sharedInstance(), EmptySelectionModel.sharedInstance);
     }
 
     public void testSetAddRemoveSelectionPaths() throws Exception {
-        model.setSelectionPaths(new TreePath[] {new TreePath("any")});
+        model.setSelectionPaths(new TreePath[] { new TreePath("any") });
         assertNull(model.getSelectionPaths());
-
-        model.addSelectionPaths(new TreePath[] {new TreePath("any2")});
+        model.addSelectionPaths(new TreePath[] { new TreePath("any2") });
         assertNull(model.getSelectionPaths());
-
-        model.removeSelectionPaths(new TreePath[] {new TreePath("any2")});
+        model.removeSelectionPaths(new TreePath[] { new TreePath("any2") });
         assertNull(model.getSelectionPaths());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JViewportTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JViewportTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JViewportTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JViewportTest.java Sat Nov 25 16:04:10 2006
@@ -14,12 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Anton Avtamonov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.Color;
@@ -31,26 +29,29 @@
 import java.beans.PropertyChangeListener;
 import java.util.List;
 import java.util.Vector;
-
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 import javax.swing.JViewport.ViewListener;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
-import javax.swing.plaf.ViewportUI;
 import javax.swing.plaf.basic.BasicViewportUI;
 
 public class JViewportTest extends SwingTestCase {
     private JViewport port;
+
     private JList list;
+
     private TestListener listener;
+
     private JFrame frame;
 
+    @Override
     public void setUp() {
         port = new JViewport();
         listener = new TestListener();
     }
 
+    @Override
     public void tearDown() {
         port = null;
         listener = null;
@@ -61,7 +62,7 @@
     }
 
     public void testAddRemoveChangeListener() {
-        final List test = new Vector();
+        final List<String> test = new Vector<String>();
         assertEquals(0, port.getChangeListeners().length);
         ChangeListener listener = new ChangeListener() {
             public void stateChanged(final ChangeEvent e) {
@@ -71,17 +72,15 @@
         port.addChangeListener(listener);
         assertEquals(1, port.getChangeListeners().length);
         assertEquals(listener, port.getChangeListeners()[0]);
-
         assertEquals(0, test.size());
         port.fireStateChanged();
         assertEquals(1, test.size());
-
         port.removeChangeListener(listener);
         assertEquals(0, port.getChangeListeners().length);
     }
 
     public void testAddRemovePropertyChangeListener() {
-        final List test = new Vector();
+        final List<String> test = new Vector<String>();
         assertEquals(0, port.getPropertyChangeListeners().length);
         PropertyChangeListener listener = new PropertyChangeListener() {
             public void propertyChange(final PropertyChangeEvent e) {
@@ -91,11 +90,9 @@
         port.addPropertyChangeListener(listener);
         assertEquals(1, port.getPropertyChangeListeners().length);
         assertEquals(listener, port.getPropertyChangeListeners()[0]);
-
         assertEquals(0, test.size());
         port.setBackground(Color.CYAN);
         assertEquals(1, test.size());
-
         port.removePropertyChangeListener(listener);
         assertEquals(0, port.getPropertyChangeListeners().length);
     }
@@ -130,7 +127,6 @@
 
     public void testGetUI() {
         assertNotNull(port.getUI());
-        assertTrue(port.getUI() instanceof ViewportUI);
         assertEquals("ViewportUI", port.getUIClassID());
     }
 
@@ -155,7 +151,6 @@
         assertNotNull(listener.getEvent());
         assertEquals(port, listener.getEvent().getSource());
         assertEquals(point, port.getViewPosition());
-
         listener.reset();
         port.setViewPosition(new Point(2, 6));
         assertNull(listener.getEvent());
@@ -171,16 +166,13 @@
     public void testGetSetViewSize() {
         JLabel l = new JLabel();
         port.add(l);
-
         Dimension dimension = new Dimension(20, 50);
         l.setPreferredSize(dimension);
         assertEquals(dimension, port.getViewSize());
-
         dimension = new Dimension(20, 20);
         port.setViewSize(dimension);
         assertEquals(dimension, port.getViewSize());
         assertEquals(dimension, port.getView().getSize());
-
         dimension = new Dimension(100, 50);
         l.setSize(dimension);
         assertEquals(dimension, port.getViewSize());
@@ -207,77 +199,61 @@
         assertTrue(port.paramString().indexOf(",scrollUnderway=") > 0);
     }
 
+    @SuppressWarnings("deprecation")
     public void testScrollRectToVisible() throws Exception {
         JLabel label = new JLabel();
         label.setPreferredSize(new Dimension(300, 300));
         label.setBackground(Color.RED);
         label.setOpaque(true);
         final JScrollPane pane = new JScrollPane(label);
-//        pane.setPreferredSize(new Dimension(118, 118));
+        //        pane.setPreferredSize(new Dimension(118, 118));
         pane.setPreferredSize(new Dimension(120, 119));
-
         frame = new JFrame();
         frame.getContentPane().add(pane);
-
         frame.pack();
         frame.show();
-
         port = pane.getViewport();
-
         assertEquals(new Dimension(100, 100), port.getExtentSize());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(50, 50, 100, 100));
         assertEquals(new Point(50, 50), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(50, 50, 50, 50));
         assertEquals(new Point(0, 0), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(50, 50, 60, 60));
         assertEquals(new Point(10, 10), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(0, 0, 60, 60));
         assertEquals(new Point(0, 0), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(0, 0, 60, 60));
         assertEquals(new Point(100, 100), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(50, 50, 60, 60));
         assertEquals(new Point(110, 110), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(-50, -50, 60, 60));
         assertEquals(new Point(50, 50), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(-50, -50, 130, 130));
         assertEquals(new Point(80, 80), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(-10, -10, 130, 130));
         assertEquals(new Point(100, 100), port.getViewPosition());
-
         port.setViewPosition(new Point(100, 100));
         port.scrollRectToVisible(new Rectangle(-50, -50, 200, 200));
         assertEquals(new Point(100, 100), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(1000, 1000, 100, 100));
         assertEquals(new Point(200, 200), port.getViewPosition());
         port.scrollRectToVisible(new Rectangle(1000, 1000, 100, 100));
         assertEquals(new Point(200, 200), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(-1000, 1000, 100, 100));
         assertEquals(new Point(0, 200), port.getViewPosition());
         port.scrollRectToVisible(new Rectangle(-1000, 1000, 100, 100));
         assertEquals(new Point(0, 200), port.getViewPosition());
-
         port.setViewPosition(new Point(0, 0));
         port.scrollRectToVisible(new Rectangle(-1000, -1000, 100, 100));
         assertEquals(new Point(0, 0), port.getViewPosition());
@@ -295,7 +271,6 @@
         Dimension dimension = new Dimension(20, 50);
         l.setPreferredSize(dimension);
         port.add(l);
-
         Dimension dim = new Dimension(1000, 200);
         assertEquals(dim, port.toViewCoordinates(dim));
         Point point = new Point(1000, 200);
@@ -307,7 +282,6 @@
         Dimension dimension = new Dimension(20, 50);
         l.setPreferredSize(dimension);
         port.add(l);
-
         assertTrue(port.createLayoutManager() instanceof ViewportLayout);
         assertTrue((port.getComponent(0) == l));
         assertTrue((port.getView() == l));
@@ -331,14 +305,14 @@
         assertEquals(1, port.getComponentCount());
         assertEquals(comp, port.getView());
         assertEquals(comp, port.getComponent(0));
-
         port.setView(new JButton());
         assertEquals(1, port.getComponentCount());
     }
 
     public void testEnsureIndexIsVisible() throws Exception {
-        list = new JList(new Object[] {"a", "b", "c"});
+        list = new JList(new Object[] { "a", "b", "c" });
         JScrollPane scroller = insertListToFrame();
+        assertNotNull(scroller);
         Rectangle bounds = list.getCellBounds(1, 1);
         assertFalse(list.getVisibleRect().contains(bounds));
         list.ensureIndexIsVisible(1);
@@ -357,11 +331,13 @@
         frame = new JFrame();
         frame.setLocation(100, 100);
         JScrollPane result = new JScrollPane(list) {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public Dimension getPreferredSize() {
                 return new Dimension(100, preferredHeight);
             }
         };
-
         frame.getContentPane().add(result);
         frame.pack();
         return result;
@@ -369,9 +345,9 @@
 
     private JComponent newJComponent() {
         return new JComponent() {
+            private static final long serialVersionUID = 1L;
         };
     }
-
 
     private class TestListener implements ChangeListener {
         private ChangeEvent event;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JWindowTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JWindowTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JWindowTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JWindowTest.java Sat Nov 25 16:04:10 2006
@@ -14,12 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Vadim L. Bogdanov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.BorderLayout;
@@ -34,37 +32,43 @@
 import java.awt.Window;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 
-
 public class JWindowTest extends SwingTestCase {
     /*
      * This class is used to test protected methods
      */
     static private class TestWindow extends JWindow {
+        private static final long serialVersionUID = 1L;
+
         public static boolean createRootPaneCalled = false;
+
         public static boolean setRootPaneCalled = false;
 
+        @Override
         public JRootPane createRootPane() {
             createRootPaneCalled = true;
             return super.createRootPane();
         }
 
+        @Override
         public void setRootPane(final JRootPane root) {
             setRootPaneCalled = true;
             super.setRootPane(root);
         }
 
+        @Override
         public void setRootPaneCheckingEnabled(final boolean enabled) {
             super.setRootPaneCheckingEnabled(enabled);
         }
 
+        @Override
         public boolean isRootPaneCheckingEnabled() {
             return super.isRootPaneCheckingEnabled();
         }
 
+        @Override
         public void addImpl(final Component comp, final Object constraints, final int index) {
             super.addImpl(comp, constraints, index);
         }
@@ -74,6 +78,7 @@
             setRootPaneCalled = false;
         }
 
+        @Override
         public String paramString() {
             return super.paramString();
         }
@@ -99,6 +104,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         window = new JWindow();
@@ -108,6 +114,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -125,7 +132,6 @@
      */
     public void testJWindow() {
         window = new JWindow();
-
         assertTrue("owner is not null", window.getOwner() != null);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
@@ -138,24 +144,17 @@
      */
     public void testWindowInit() {
         TestWindow window = new TestWindow();
-
         assertTrue("rootPaneCheckingEnabled is true", window.isRootPaneCheckingEnabled());
-
         assertTrue("layout is not null", window.getLayout() != null);
-
         assertTrue("rootPane is not null", window.getRootPane() != null);
-
         assertTrue("locale is set", window.getLocale() == JComponent.getDefaultLocale());
-
-        assertTrue("rootPane.windowDecorationStyle is NONE",
-                window.getRootPane().getWindowDecorationStyle() == JRootPane.NONE);
-
+        assertTrue("rootPane.windowDecorationStyle is NONE", window.getRootPane()
+                .getWindowDecorationStyle() == JRootPane.NONE);
         // test that defaultFocusTraversalPolicy is set
         assertTrue("focusTraversalPolicy is set correctly",
-                window.getFocusTraversalPolicy() == KeyboardFocusManager.
-                    getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy());
-        assertTrue("focusTraversalPolicy is set",
-                   window.isFocusTraversalPolicySet());
+                window.getFocusTraversalPolicy() == KeyboardFocusManager
+                        .getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy());
+        assertTrue("focusTraversalPolicy is set", window.isFocusTraversalPolicySet());
         assertTrue(window.isFocusCycleRoot());
         assertFalse(window.isFocusTraversalPolicyProvider());
     }
@@ -167,21 +166,20 @@
      */
     public void testSetIsRootPaneCheckingEnabled() {
         TestWindow window = new TestWindow();
-
-        assertTrue("rootPaneCheckingEnabled is true by default", window.isRootPaneCheckingEnabled());
-
+        assertTrue("rootPaneCheckingEnabled is true by default", window
+                .isRootPaneCheckingEnabled());
         window.setRootPaneCheckingEnabled(false);
-        assertFalse("rootPaneCheckingEnabled is set to false", window.isRootPaneCheckingEnabled());
+        assertFalse("rootPaneCheckingEnabled is set to false", window
+                .isRootPaneCheckingEnabled());
     }
 
     /*
      * Class under test for void JWindow(Window, GraphicsConfiguration)
      */
     public void testJWindowWindowGraphicsConfiguration() {
-        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
-            getDefaultScreenDevice().getDefaultConfiguration();
+        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration();
         Window owner = new JWindow();
-
         // test with valid owner and valid gc
         // would be nice to test non-default gc here
         window = new JWindow(owner, gc);
@@ -190,15 +188,13 @@
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
-
         // test with valid owner and gc == null
-        window = new JWindow(owner, (GraphicsConfiguration)null);
+        window = new JWindow(owner, (GraphicsConfiguration) null);
         assertTrue("owner is set", window.getOwner() == owner);
         assertTrue(window.getGraphicsConfiguration() == gc);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
-
         // test with owner == null and valid gc
         window = new JWindow(null, gc);
         assertTrue("owner is not null", window.getOwner() != null);
@@ -206,11 +202,11 @@
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
-
         // test with owner == null and gc == null
         window = new JWindow(null, null);
         assertTrue("owner is not null", window.getOwner() != null);
-        assertTrue(window.getGraphicsConfiguration() == window.getOwner().getGraphicsConfiguration());
+        assertTrue(window.getGraphicsConfiguration() == window.getOwner()
+                .getGraphicsConfiguration());
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
@@ -222,15 +218,13 @@
     public void testJWindowWindow() {
         Window owner = new JWindow();
         window = new JWindow(owner);
-
         // test with the correct owner
         assertTrue("owner is set", window.getOwner() == owner);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
-
         // test with owner = null
-        window = new JWindow((Window)null);
+        window = new JWindow((Window) null);
         assertTrue("owner is not null", window.getOwner() != null);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
@@ -241,9 +235,8 @@
      * Class under test for void JWindow(GraphicsConfiguration)
      */
     public void testJWindowGraphicsConfiguration() {
-        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().
-            getDefaultScreenDevice().getDefaultConfiguration();
-
+        GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
+                .getDefaultScreenDevice().getDefaultConfiguration();
         // test with valid gc
         // would be nice to test non-default gc here
         window = new JWindow(gc);
@@ -252,9 +245,8 @@
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
         assertTrue(window.getGraphicsConfiguration() == gc);
-
         // test with gc == null
-        window = new JWindow((GraphicsConfiguration)null);
+        window = new JWindow((GraphicsConfiguration) null);
         assertTrue("owner is not null", window.getOwner() != null);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
@@ -268,15 +260,13 @@
     public void testJWindowFrame() {
         Frame owner = new Frame();
         window = new JWindow(owner);
-
         // test with the correct owner
         assertTrue("owner is set", window.getOwner() == owner);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
         assertFalse("window is not focusable", window.isFocusableWindow());
-
         // test with owner = null
-        window = new JWindow((Frame)null);
+        window = new JWindow((Frame) null);
         assertTrue("owner is not null", window.getOwner() != null);
         assertFalse("JWindow is invisible by default", window.isVisible());
         assertTrue(window.getLocale() == JComponent.getDefaultLocale());
@@ -289,7 +279,6 @@
     public void testAddImpl() {
         TestWindow window = new TestWindow();
         JComponent comp = new JPanel();
-
         // rootPaneCheckingEnabled is true, no exception since 1.5
         window.setRootPaneCheckingEnabled(true);
         boolean ok = false;
@@ -299,10 +288,9 @@
             ok = true;
         } finally {
             assertFalse("no exception", ok);
-            assertTrue("The component is added to contentPane",
-                       comp.getParent() == window.getContentPane());
+            assertTrue("The component is added to contentPane", comp.getParent() == window
+                    .getContentPane());
         }
-
         // rootPaneCheckingEnabled is false, no exception
         window.setRootPaneCheckingEnabled(false);
         ok = false;
@@ -312,10 +300,8 @@
             ok = true;
         } finally {
             assertFalse("no exception", ok);
-            assertTrue("the component is added to JWindow",
-                       comp.getParent() == window);
-            assertTrue("index of the component is 0",
-                       window.getComponent(0) == comp);
+            assertTrue("the component is added to JWindow", comp.getParent() == window);
+            assertTrue("index of the component is 0", window.getComponent(0) == comp);
         }
     }
 
@@ -326,16 +312,13 @@
      */
     public void testSetGetRootPane() {
         TestWindow window = new TestWindow();
-        assertTrue("setRootPane() is called from the constructor",
-                TestWindow.setRootPaneCalled);
-
+        assertTrue("setRootPane() is called from the constructor", TestWindow.setRootPaneCalled);
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         window.addPropertyChangeListener("rootPane", listener);
         JRootPane root = new JRootPane();
         window.setRootPane(root);
         assertTrue(window.getRootPane() == root);
         assertFalse("rootPane is not a bound property", listener.ok);
-
         // test setting rootPane to null
         window.setRootPane(null);
         assertNull(window.getRootPane());
@@ -349,7 +332,6 @@
         TestWindow frame = new TestWindow();
         assertTrue("createRootPane() is called from the constructor",
                 TestWindow.createRootPaneCalled);
-
         JRootPane root = frame.createRootPane();
         assertTrue("createRootPane() cannot return null", root != null);
     }
@@ -362,12 +344,10 @@
     public void testSetGetLayeredPane() {
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         window.addPropertyChangeListener("layeredPane", listener);
-
         JLayeredPane pane = new JLayeredPane();
         window.setLayeredPane(pane);
         assertTrue(window.getLayeredPane() == pane);
         assertFalse("layeredPane is not a bound property", listener.ok);
-
         // test throwing exception if the parameter is null
         boolean ok = false;
         try {
@@ -379,7 +359,6 @@
         }
         // layeredPane cannot be null, even after setLayeredPane(null)
         assertTrue(window.getLayeredPane() != null);
-
         // setLayeredPane() method is not called by the constructor
         // (seems that there is an error in docs)
     }
@@ -389,16 +368,11 @@
      */
     public void testGetAccessibleContext() {
         AccessibleContext c = window.getAccessibleContext();
-
-        assertTrue("instance of AccessibleJWindow",
-                   c instanceof JWindow.AccessibleJWindow);
-        assertTrue("AccessibleRole is ok",
-                c.getAccessibleRole() == AccessibleRole.WINDOW);
+        assertTrue("instance of AccessibleJWindow", c instanceof JWindow.AccessibleJWindow);
+        assertTrue("AccessibleRole is ok", c.getAccessibleRole() == AccessibleRole.WINDOW);
         assertNull("AccessibleName is ok", c.getAccessibleName());
-        assertNull("AccessibleDescription is ok",
-                c.getAccessibleDescription());
-        assertTrue("AccessibleChildrenCount == 1",
-                   c.getAccessibleChildrenCount() == 1);
+        assertNull("AccessibleDescription is ok", c.getAccessibleDescription());
+        assertTrue("AccessibleChildrenCount == 1", c.getAccessibleChildrenCount() == 1);
     }
 
     /*
@@ -416,7 +390,6 @@
         TestWindow window = new TestWindow();
         LayoutManager contentLayout = window.getContentPane().getLayout();
         LayoutManager frameLayout = window.getLayout();
-
         // rootPaneCheckingEnabled is true, no exception since 1.5
         window.setRootPaneCheckingEnabled(true);
         boolean ok = false;
@@ -427,12 +400,10 @@
         } finally {
             assertFalse("no exception since 1.5", ok);
             assertTrue("contentPane layout is changed",
-                       window.getContentPane().getLayout() != contentLayout);
-            assertTrue("Window layout shouldn't be changed",
-                       window.getLayout() == frameLayout);
+                    window.getContentPane().getLayout() != contentLayout);
+            assertTrue("Window layout shouldn't be changed", window.getLayout() == frameLayout);
             window.getContentPane().setLayout(contentLayout);
         }
-
         // rootPaneCheckingEnabled is false
         window.setRootPaneCheckingEnabled(false);
         ok = false;
@@ -442,10 +413,9 @@
             ok = true;
         } finally {
             assertFalse("no exception", ok);
-            assertTrue("contentPane layout shouldn't be changed",
-                    window.getContentPane().getLayout() == contentLayout);
-            assertTrue("Window layout is changed)",
-                    window.getLayout() != frameLayout);
+            assertTrue("contentPane layout shouldn't be changed", window.getContentPane()
+                    .getLayout() == contentLayout);
+            assertTrue("Window layout is changed)", window.getLayout() != frameLayout);
         }
     }
 
@@ -464,12 +434,10 @@
     public void testSetGetContentPane() {
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         window.addPropertyChangeListener("contentPane", listener);
-
         JPanel pane = new JPanel();
         window.setContentPane(pane);
         assertTrue(window.getContentPane() == pane);
         assertFalse("contentPane is not a bound property", listener.ok);
-
         // test throwing exception if the parameter is null
         boolean ok = false;
         try {
@@ -481,7 +449,6 @@
         }
         // contentPane cannot be null, even after setContentPane(null)
         assertTrue(window.getContentPane() != null);
-
         // setContentPane() method is not called by the constructor
         // (seems that there is an error in docs)
     }
@@ -494,12 +461,10 @@
     public void testSetGetGlassPane() {
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         window.addPropertyChangeListener("glassPane", listener);
-
         JPanel pane = new JPanel();
         window.setGlassPane(pane);
         assertTrue(window.getGlassPane() == pane);
         assertFalse("glassPane is not a bound property", listener.ok);
-
         // test throwing exception if the parameter is null
         boolean ok = false;
         try {
@@ -511,7 +476,6 @@
         }
         // glassPane cannot be null, even after setGlassPane(null)
         assertTrue(window.getGlassPane() != null);
-
         // setGlassPane() method is not called by the constructor
         // (seems that there is an error in docs)
     }
@@ -525,28 +489,24 @@
         assertTrue("label is in contentPane", window.isAncestorOf(comp));
         window.remove(comp);
         assertFalse("label is removed from contentPane", window.isAncestorOf(comp));
-
-        ((JPanel)window.getGlassPane()).add(comp);
+        ((JPanel) window.getGlassPane()).add(comp);
         window.remove(comp);
         assertTrue("label is not removed from glassPane", window.isAncestorOf(comp));
-
         // test removing directly from the container
         window.setRootPaneCheckingEnabled(false);
         window.add(comp, BorderLayout.EAST);
         assertTrue("added", comp.getParent() == window);
         window.remove(comp);
         assertTrue("not removed", comp.getParent() == window);
-
         // test removing null
-//        boolean ok = false;
-//        try {
-//            window.remove((Component)null);
-//        } catch (NullPointerException e) {
-//            ok = true;
-//        } finally {
-//            assertTrue("exception", ok);
-//        }
-
+        //        boolean ok = false;
+        //        try {
+        //            window.remove((Component)null);
+        //        } catch (NullPointerException e) {
+        //            ok = true;
+        //        } finally {
+        //            assertTrue("exception", ok);
+        //        }
         // test removing rootPane
         assertTrue(window.isAncestorOf(window.getRootPane()));
         window.remove(window.getRootPane());

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/KeyStrokeTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/KeyStrokeTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/KeyStrokeTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/KeyStrokeTest.java Sat Nov 25 16:04:10 2006
@@ -26,7 +26,6 @@
 import java.awt.event.KeyEvent;
 
 public class KeyStrokeTest extends SwingTestCase {
-
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(KeyStrokeTest.class);
     }
@@ -40,39 +39,39 @@
         assertEquals("keyCode's correct", KeyEvent.VK_INSERT, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke("control DELETE");
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_DELETE, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke("alt shift X");
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_X, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0);
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke("altGraph X");
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_X, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.ALT_GRAPH_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.ALT_GRAPH_DOWN_MASK) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke("alt shift released X");
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_X, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0);
-        assertTrue("modifiers are correct", (keyStroke.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0);
+        assertTrue("modifiers are correct",
+                (keyStroke.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0);
         assertTrue("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke("typed a");
         assertEquals("keyChar's correct", 'a', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke("typed a");
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke("typed a");
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);
@@ -82,53 +81,58 @@
      * Class under test for KeyStroke getKeyStroke(Character, int)
      */
     public void testGetKeyStrokeCharacterint() {
-        KeyStroke keyStroke = KeyStroke.getKeyStroke(new Character('A'), InputEvent.ALT_DOWN_MASK);
+        KeyStroke keyStroke = KeyStroke.getKeyStroke(new Character('A'),
+                InputEvent.ALT_DOWN_MASK);
         assertEquals("keyChar's correct", 'A', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(new Character('t'), InputEvent.CTRL_DOWN_MASK);
         assertEquals("keyChar's correct", 't', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(new Character('_'), InputEvent.SHIFT_DOWN_MASK);
         assertEquals("keyChar's correct", '_', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
-        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(new Character('_'), InputEvent.SHIFT_DOWN_MASK);
-        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(new Character('_'), InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(new Character('_'),
+                InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(new Character('_'),
+                InputEvent.SHIFT_DOWN_MASK);
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);
     }
 
     public void testGetKeyStrokeForEvent() {
         JComponent source = new JPanel();
-        KeyEvent event = new KeyEvent(source, KeyEvent.KEY_PRESSED, 0, InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_B, 'B');
-
+        KeyEvent event = new KeyEvent(source, KeyEvent.KEY_PRESSED, 0,
+                InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_B, 'B');
         KeyStroke keyStroke = KeyStroke.getKeyStrokeForEvent(event);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_B, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
-        event = new KeyEvent(source, KeyEvent.KEY_RELEASED, 0, InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_C, 'C');
+        event = new KeyEvent(source, KeyEvent.KEY_RELEASED, 0, InputEvent.SHIFT_DOWN_MASK,
+                KeyEvent.VK_C, 'C');
         keyStroke = KeyStroke.getKeyStrokeForEvent(event);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_C, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertTrue("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
-        event = new KeyEvent(source, KeyEvent.KEY_TYPED, 0, InputEvent.SHIFT_DOWN_MASK, KeyEvent.VK_UNDEFINED, 'T');
+        event = new KeyEvent(source, KeyEvent.KEY_TYPED, 0, InputEvent.SHIFT_DOWN_MASK,
+                KeyEvent.VK_UNDEFINED, 'T');
         keyStroke = KeyStroke.getKeyStrokeForEvent(event);
         assertEquals("keyChar's correct", 'T', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_UNDEFINED, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         KeyStroke keyStroke1 = KeyStroke.getKeyStrokeForEvent(event);
         KeyStroke keyStroke2 = KeyStroke.getKeyStrokeForEvent(event);
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);
@@ -138,26 +142,29 @@
      * Class under test for KeyStroke getKeyStroke(int, int, boolean)
      */
     public void testGetKeyStrokeintintboolean() {
-        KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_0, InputEvent.ALT_DOWN_MASK, true);
+        KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_0, InputEvent.ALT_DOWN_MASK,
+                true);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_0, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertTrue("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK, false);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_A, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK, true);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_SHIFT, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertTrue("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
-        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK, true);
-        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK, true);
+        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT,
+                InputEvent.SHIFT_DOWN_MASK, true);
+        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT,
+                InputEvent.SHIFT_DOWN_MASK, true);
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);
     }
 
@@ -168,45 +175,43 @@
         KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_0, InputEvent.ALT_DOWN_MASK);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_0, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.ALT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_DOWN_MASK);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_A, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.CTRL_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", KeyEvent.VK_SHIFT, keyStroke.getKeyCode());
-        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke.getModifiers()) != 0);
+        assertTrue("modifiers are correct", (InputEvent.SHIFT_DOWN_MASK & keyStroke
+                .getModifiers()) != 0);
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
-        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK);
-        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT, InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT,
+                InputEvent.SHIFT_DOWN_MASK);
+        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_SHIFT,
+                InputEvent.SHIFT_DOWN_MASK);
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);
     }
 
     /*
      * Class under test for KeyStroke getKeyStroke(char, boolean)
      */
-    /**
-     * @deprecated
-     */
+    @SuppressWarnings("deprecation")
     public void testGetKeyStrokecharboolean() {
         KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.CHAR_UNDEFINED, false);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke('a', true);
         assertEquals("keyChar's correct", 'a', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertTrue("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke('T', true);
         assertEquals("keyChar's correct", 'T', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
@@ -218,24 +223,21 @@
      * Class under test for KeyStroke getKeyStroke(char)
      */
     public void testGetKeyStrokechar() {
-        KeyStroke keyStroke = KeyStroke.getKeyStroke((char)-1);
+        KeyStroke keyStroke = KeyStroke.getKeyStroke((char) -1);
         assertEquals("keyChar's correct", KeyEvent.CHAR_UNDEFINED, keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke('a');
         assertEquals("keyChar's correct", 'a', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         keyStroke = KeyStroke.getKeyStroke('T');
         assertEquals("keyChar's correct", 'T', keyStroke.getKeyChar());
         assertEquals("keyCode's correct", 0, keyStroke.getKeyCode());
         assertEquals("modifiers are correct", 0, keyStroke.getModifiers());
         assertFalse("onKeyRelease is correct", keyStroke.isOnKeyRelease());
-
         KeyStroke keyStroke1 = KeyStroke.getKeyStroke('a');
         KeyStroke keyStroke2 = KeyStroke.getKeyStroke('a');
         assertTrue("keyStrokes are shared properly", keyStroke1 == keyStroke2);

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java Sat Nov 25 16:04:10 2006
@@ -23,24 +23,28 @@
 import java.awt.Component;
 import java.awt.ComponentOrientation;
 import java.awt.GridLayout;
-
 import javax.swing.plaf.ComboBoxUI;
 
 public class LayoutFocusTraversalPolicyTest extends BasicSwingTestCase {
     private LayoutFocusTraversalPolicy policy;
+
     private JButton button1;
+
     private JButton button2;
+
     private JButton button3;
+
     private JButton button4;
+
     private JFrame frame;
 
     public LayoutFocusTraversalPolicyTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         policy = new LayoutFocusTraversalPolicy();
-
         frame = new JFrame();
         button1 = createButton("1");
         button2 = createButton("2");
@@ -48,14 +52,13 @@
         button4 = createButton("4");
     }
 
+    @Override
     protected void tearDown() throws Exception {
         policy = null;
-
         button1 = null;
         button2 = null;
         button3 = null;
         button4 = null;
-
         frame.dispose();
         frame = null;
     }
@@ -63,52 +66,40 @@
     public void testAccept() throws Exception {
         frame.setVisible(true);
         SwingWaitTestCase.isRealized(frame);
-
         Component invisible = new JPanel();
         frame.getContentPane().add(invisible);
         invisible.setVisible(false);
         assertFalse(policy.accept(invisible));
-
         Component undisplayable = new JPanel();
         assertFalse(policy.accept(undisplayable));
-
         Component disabled = new JPanel();
         frame.getContentPane().add(disabled);
         disabled.setEnabled(false);
         assertFalse(policy.accept(disabled));
-
         Component unfocusable = new JPanel();
         frame.getContentPane().add(unfocusable);
         unfocusable.setFocusable(false);
         assertFalse(policy.accept(unfocusable));
-
-
         JComboBox comboBox = new JComboBox();
         comboBox.setUI(new TestComboBoxUI(false));
         frame.getContentPane().add(comboBox);
         assertFalse(policy.accept(comboBox));
-
         comboBox = new JComboBox();
         comboBox.setUI(new TestComboBoxUI(true));
         frame.getContentPane().add(comboBox);
         assertTrue(policy.accept(comboBox));
-
         JComponent panel = new JPanel();
         frame.getContentPane().add(panel);
         panel.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke('a'), "anything");
         assertTrue(policy.accept(panel));
         panel.getInputMap(JComponent.WHEN_FOCUSED).clear();
         assertFalse(policy.accept(panel));
-
         JMenuBar menuBar = new JMenuBar();
         frame.setJMenuBar(menuBar);
         assertFalse(policy.accept(menuBar));
-
         JMenu menu = new JMenu();
         menuBar.add(menu);
         assertFalse(policy.accept(menu));
-
-
         //TODO: check for DefaultFocusTraversalPolicy.accept() should be provided here
     }
 
@@ -118,7 +109,6 @@
         assertEquals(button2, policy.getComponentBefore(cycleRoot, button3));
         assertEquals(button3, policy.getComponentBefore(cycleRoot, button4));
         assertEquals(button4, policy.getComponentBefore(cycleRoot, button1));
-
         cycleRoot = createTestPanel(ComponentOrientation.RIGHT_TO_LEFT);
         assertEquals(button1, policy.getComponentBefore(cycleRoot, button2));
         assertEquals(button2, policy.getComponentBefore(cycleRoot, button3));
@@ -132,7 +122,6 @@
         assertEquals(button2, policy.getComponentAfter(cycleRoot, button1));
         assertEquals(button3, policy.getComponentAfter(cycleRoot, button2));
         assertEquals(button4, policy.getComponentAfter(cycleRoot, button3));
-
         cycleRoot = createTestPanel(ComponentOrientation.RIGHT_TO_LEFT);
         assertEquals(button1, policy.getComponentAfter(cycleRoot, button4));
         assertEquals(button2, policy.getComponentAfter(cycleRoot, button1));
@@ -143,7 +132,6 @@
     public void testGetLastComponent() throws Exception {
         JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
         assertEquals(button1, policy.getLastComponent(cycleRoot));
-
         cycleRoot = createTestPanel(ComponentOrientation.RIGHT_TO_LEFT);
         assertEquals(button1, policy.getLastComponent(cycleRoot));
     }
@@ -151,58 +139,51 @@
     public void testGetFirstComponent() throws Exception {
         JPanel cycleRoot = createTestPanel(ComponentOrientation.LEFT_TO_RIGHT);
         assertEquals(button2, policy.getFirstComponent(cycleRoot));
-
         cycleRoot = createTestPanel(ComponentOrientation.RIGHT_TO_LEFT);
         assertEquals(button2, policy.getFirstComponent(cycleRoot));
     }
 
-
     private JPanel createTestPanel(final ComponentOrientation co) throws Exception {
         JPanel result = new JPanel(new GridLayout(2, 2));
         frame.getContentPane().add(result);
-
         result.setFocusCycleRoot(true);
         result.setFocusable(false);
-
         result.setFocusTraversalPolicy(policy);
         result.setComponentOrientation(co);
-
         result.add(button2);
         result.add(button3);
         result.add(button4);
         result.add(button1);
-
         frame.pack();
         frame.setVisible(true);
         SwingWaitTestCase.isRealized(frame);
         return result;
     }
 
-
     private JButton createButton(final String name) {
         JButton result = new JButton(name);
         result.setName(name);
-
         return result;
     }
 
-
     private class TestComboBoxUI extends ComboBoxUI {
         private final boolean isFocusTraversable;
 
         public TestComboBoxUI(final boolean isFocusTraversable) {
             this.isFocusTraversable = isFocusTraversable;
-
         }
 
+        @Override
         public boolean isFocusTraversable(final JComboBox comboBox) {
             return isFocusTraversable;
         }
 
+        @Override
         public boolean isPopupVisible(final JComboBox comboBox) {
             return false;
         }
 
+        @Override
         public void setPopupVisible(final JComboBox comboBox, final boolean isVisible) {
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java Sat Nov 25 16:04:10 2006
@@ -14,19 +14,16 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Sergey Burlak
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.Color;
 import java.awt.Font;
 import java.awt.Toolkit;
 import java.lang.reflect.Method;
-
 import javax.swing.plaf.ColorUIResource;
 import javax.swing.plaf.ComponentInputMapUIResource;
 import javax.swing.plaf.FontUIResource;
@@ -38,21 +35,31 @@
 public class LookAndFeelTest extends SwingTestCase {
     LookAndFeel lf;
 
+    @Override
     public void setUp() throws Exception {
         super.setUp();
         lf = new LookAndFeel() {
+            @Override
             public String getDescription() {
                 return "description";
             }
+
+            @Override
             public String getID() {
                 return "id";
             }
+
+            @Override
             public String getName() {
                 return "name";
             }
+
+            @Override
             public boolean isNativeLookAndFeel() {
                 return false;
             }
+
+            @Override
             public boolean isSupportedLookAndFeel() {
                 return false;
             }
@@ -60,18 +67,19 @@
         timeoutDelay = 5 * DEFAULT_TIMEOUT_DELAY;
     }
 
+    @Override
     public void tearDown() throws Exception {
         lf = null;
         super.tearDown();
     }
 
     public void testToString() {
-        assertEquals("[" + lf.getDescription() + " - "  + lf.getClass().getName() + "]", lf.toString());
+        assertEquals("[" + lf.getDescription() + " - " + lf.getClass().getName() + "]", lf
+                .toString());
     }
 
     public void testMakeComponentInputMap() {
         Object[] keys = new Object[] { "SPACE", "pressed" };
-
         JButton button = new JButton();
         ComponentInputMap componentInputMap = LookAndFeel.makeComponentInputMap(button, keys);
         assertTrue(componentInputMap instanceof ComponentInputMapUIResource);
@@ -82,8 +90,7 @@
 
     public void testMakeIcon() {
         Object icon = LookAndFeel.makeIcon(lf.getClass(), "empty_path");
-        assertNull(((UIDefaults.LazyValue)icon).createValue(new UIDefaults()));
-
+        assertNull(((UIDefaults.LazyValue) icon).createValue(new UIDefaults()));
         lf = new MetalLookAndFeel();
         icon = LookAndFeel.makeIcon(MetalLookAndFeel.class, "icons/TreeLeaf.gif");
         assertTrue(icon instanceof UIDefaults.LazyValue);
@@ -91,29 +98,24 @@
 
     public void testMakeInputMap() {
         Object[] keys = new Object[] { "SPACE", "pressed" };
-
-        JButton button = new JButton();
         InputMap inputMap = LookAndFeel.makeInputMap(keys);
         assertTrue(inputMap instanceof InputMapUIResource);
         assertEquals(1, inputMap.size());
     }
 
     public void testMakeKeyBindings() {
-        Object[] binds = { "UP", DefaultEditorKit.beepAction,
-                           "DOWN", DefaultEditorKit.beginWordAction,
-                           "TAB", DefaultEditorKit.beginWordAction };
+        Object[] binds = { "UP", DefaultEditorKit.beepAction, "DOWN",
+                DefaultEditorKit.beginWordAction, "TAB", DefaultEditorKit.beginWordAction };
         JTextComponent.KeyBinding[] b = LookAndFeel.makeKeyBindings(binds);
         assertEquals(3, b.length);
-        assertTrue(b[0] instanceof JTextComponent.KeyBinding);
         assertEquals(DefaultEditorKit.beepAction, b[0].actionName);
         assertEquals(DefaultEditorKit.beginWordAction, b[1].actionName);
     }
 
     public void testMakeKeyBindingsFromErrorArray() {
-        Object[] binds = { "UP", DefaultEditorKit.beepAction,
-                           "DOWN" };
+        Object[] binds = { "UP", DefaultEditorKit.beepAction, "DOWN" };
         try {
-            JTextComponent.KeyBinding[] b = LookAndFeel.makeKeyBindings(binds);
+            LookAndFeel.makeKeyBindings(binds);
             fail("shall throw ArrayIndexOutOfBoundsException");
         } catch (ArrayIndexOutOfBoundsException e) {
         }
@@ -146,7 +148,7 @@
         lf = new MetalLookAndFeel();
         JLabel label = new JLabel();
         LookAndFeel.installColorsAndFont(label, "Tree.selectionBackground",
-                                         "TextPane.background", "CheckBox.font");
+                "TextPane.background", "CheckBox.font");
         UIDefaults defaults = lf.getDefaults();
         assertNotNull(defaults);
         assertEquals(UIManager.get("Tree.selectionBackground"), label.getBackground());
@@ -173,39 +175,39 @@
     public void testLoadKeyBindings() {
         InputMap map = new InputMap();
         Object[] binds = { "SPACE", DefaultEditorKit.beepAction,
-                           KeyStroke.getKeyStroke("DOWN"), DefaultEditorKit.beginWordAction };
+                KeyStroke.getKeyStroke("DOWN"), DefaultEditorKit.beginWordAction };
         try {
             LookAndFeel.loadKeyBindings(null, binds);
             fail("NullPointerException shall be thrown");
         } catch (NullPointerException e) {
         }
         LookAndFeel.loadKeyBindings(map, null);
-
         assertEquals(0, map.size());
         LookAndFeel.loadKeyBindings(map, binds);
         assertEquals(2, map.size());
     }
 
     public void testGetDesktopPropertyValue() throws Exception {
-        Method setProperty = Toolkit.class.getDeclaredMethod("setDesktopProperty",
-                                                             new Class[] {String.class, Object.class});
+        Method setProperty = Toolkit.class.getDeclaredMethod("setDesktopProperty", new Class[] {
+                String.class, Object.class });
         setProperty.setAccessible(true);
         final Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
-        setProperty.invoke(defaultToolkit,
-                           new Object[] {"win.icon.hspacing", new Integer(1)});
-        setProperty.invoke(defaultToolkit,
-                           new Object[] {"win.frame.captionFont", new Font("arial", Font.BOLD, 10)});
-        setProperty.invoke(defaultToolkit,
-                           new Object[] {"win.frame.activeCaptionColor", Color.red});
+        setProperty
+                .invoke(defaultToolkit, new Object[] { "win.icon.hspacing", new Integer(1) });
+        setProperty.invoke(defaultToolkit, new Object[] { "win.frame.captionFont",
+                new Font("arial", Font.BOLD, 10) });
+        setProperty.invoke(defaultToolkit, new Object[] { "win.frame.activeCaptionColor",
+                Color.red });
         assertTrue(LookAndFeel.getDesktopPropertyValue("win.icon.hspacing", "") instanceof Integer);
         assertTrue(LookAndFeel.getDesktopPropertyValue("win.frame.captionFont", "") instanceof FontUIResource);
-
-        Object desktopPropertyValue = LookAndFeel.getDesktopPropertyValue("win.frame.activeCaptionColor", "default");
+        Object desktopPropertyValue = LookAndFeel.getDesktopPropertyValue(
+                "win.frame.activeCaptionColor", "default");
         assertTrue(desktopPropertyValue instanceof ColorUIResource);
-
         assertTrue(desktopPropertyValue instanceof ColorUIResource);
-        assertEquals(defaultToolkit.getDesktopProperty("win.frame.activeCaptionColor"), desktopPropertyValue);
-        assertEquals("default", LookAndFeel.getDesktopPropertyValue("win.frame.activeCaptionColor???", "default"));
+        assertEquals(defaultToolkit.getDesktopProperty("win.frame.activeCaptionColor"),
+                desktopPropertyValue);
+        assertEquals("default", LookAndFeel.getDesktopPropertyValue(
+                "win.frame.activeCaptionColor???", "default"));
     }
 
     public void testGetSupportsWindowsDecorations() {
@@ -218,7 +220,6 @@
         }
         JComponent comp1 = new JPanel();
         JButton comp2 = new JButton();
-
         LookAndFeel.installProperty(comp1, "opaque", Boolean.TRUE);
         assertTrue("opaque", comp1.isOpaque());
         LookAndFeel.installProperty(comp1, "opaque", Boolean.FALSE);
@@ -226,7 +227,6 @@
         comp1.setOpaque(true);
         LookAndFeel.installProperty(comp1, "opaque", Boolean.FALSE);
         assertTrue("opaque", comp1.isOpaque());
-
         LookAndFeel.installProperty(comp2, "opaque", Boolean.TRUE);
         assertTrue("opaque", comp2.isOpaque());
         LookAndFeel.installProperty(comp2, "opaque", Boolean.FALSE);
@@ -234,21 +234,18 @@
         comp1.setOpaque(true);
         LookAndFeel.installProperty(comp2, "opaque", Boolean.FALSE);
         assertFalse("opaque", comp2.isOpaque());
-
         try {
             LookAndFeel.installProperty(comp1, "iconTextGap", Boolean.TRUE);
             fail("IllegalArgumentException shall be thrown");
         } catch (IllegalArgumentException e) {
             // expected
         }
-
         try {
             LookAndFeel.installProperty(comp2, "iconTextGap", Boolean.TRUE);
             fail("ClassCastException shall be thrown");
         } catch (ClassCastException e) {
             // expected
         }
-
         LookAndFeel.installProperty(comp2, "iconTextGap", new Integer(0));
         assertEquals("iconTextGap", 0, comp2.getIconTextGap());
         LookAndFeel.installProperty(comp2, "iconTextGap", new Integer(120));

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerRTest.java Sat Nov 25 16:04:10 2006
@@ -15,20 +15,21 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 public class MenuSelectionManagerRTest extends SwingTestCase {
-
     protected MenuSelectionManager manager;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         manager = new MenuSelectionManager();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         manager = null;
         super.tearDown();
@@ -45,27 +46,23 @@
         menu8.add(menu9);
         menu8.add(menu10);
         menu9.add(menu11);
-        MenuElement[] path7 = new MenuElement[] {menu8};
-        MenuElement[] path8 = new MenuElement[] {menu8, menu9};
-        MenuElement[] path9 = new MenuElement[] {menu8, menu10};
-
+        MenuElement[] path7 = new MenuElement[] { menu8 };
+        MenuElement[] path8 = new MenuElement[] { menu8, menu9 };
+        MenuElement[] path9 = new MenuElement[] { menu8, menu10 };
         manager.setSelectedPath(path7);
         assertTrue(manager.isComponentPartOfCurrentMenu(menu8));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu9));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu10));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu11));
-
         manager.setSelectedPath(path8);
         assertTrue(manager.isComponentPartOfCurrentMenu(menu8));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu9));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu10));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu11));
-
         manager.setSelectedPath(path9);
         assertTrue(manager.isComponentPartOfCurrentMenu(menu8));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu9));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu10));
         assertTrue(manager.isComponentPartOfCurrentMenu(menu11));
     }
-
 }



Mime
View raw message