harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [16/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/JPopupMenuTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPopupMenuTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPopupMenuTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPopupMenuTest.java Sat Nov 25 16:04:10 2006
@@ -15,9 +15,9 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 import java.awt.Component;
@@ -30,7 +30,6 @@
 import java.awt.image.BufferedImage;
 import java.beans.PropertyChangeListener;
 import java.util.EventListener;
-
 import javax.accessibility.AccessibleRole;
 import javax.swing.event.MenuEvent;
 import javax.swing.event.PopupMenuEvent;
@@ -39,9 +38,11 @@
 import javax.swing.plaf.basic.BasicPopupMenuUI;
 
 public class JPopupMenuTest extends SwingTestCase {
-
     public static class MyAction extends AbstractAction {
+        private static final long serialVersionUID = 1L;
+
         final String command = "dnammoc";
+
         final KeyStroke accelerator = KeyStroke.getKeyStroke('a');
 
         public boolean performed = false;
@@ -59,6 +60,7 @@
 
     class ConcretePopupMenuListener implements PopupMenuListener {
         public Object event;
+
         public Object src;
 
         public void menuSelected(MenuEvent e) {
@@ -89,11 +91,13 @@
 
     protected JPopupMenu popup;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         popup = new JPopupMenu();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         popup = null;
         super.tearDown();
@@ -103,11 +107,12 @@
      * Test method for 'javax.swing.JPopupMenu.getAccessibleContext()'
      */
     public void testGetAccessibleContext() {
-        boolean assertedValue = (popup.getAccessibleContext() != null &&
-                popup.getAccessibleContext().getClass().getName().equals("javax.swing.JPopupMenu$AccessibleJPopupMenu"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.POPUP_MENU, popup.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (popup.getAccessibleContext() != null && popup
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JPopupMenu$AccessibleJPopupMenu"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.POPUP_MENU, popup.getAccessibleContext()
+                .getAccessibleRole());
     }
 
     /*
@@ -118,11 +123,8 @@
         popup.addPropertyChangeListener(listener1);
         ConcretePopupMenuListener listener2 = new ConcretePopupMenuListener();
         popup.addPopupMenuListener(listener2);
-
-
         assertNull(popup.getParent());
         assertFalse(popup.isVisible());
-
         assertNull(SwingUtilities.getWindowAncestor(popup));
         popup.setVisible(true);
         assertNotNull(SwingUtilities.getWindowAncestor(popup));
@@ -130,23 +132,18 @@
         assertEquals("event fired properly ", "visible", listener2.event);
         assertEquals("source ", popup, listener2.src);
         listener2.reset();
-        listener1.checkPropertyFired(popup, "visible",
-                             Boolean.FALSE, Boolean.TRUE);
-        listener1.checkPropertyFired(popup, "ancestor",
-                                    null, ancestor);
+        listener1.checkPropertyFired(popup, "visible", Boolean.FALSE, Boolean.TRUE);
+        listener1.checkPropertyFired(popup, "ancestor", null, ancestor);
         assertNotNull(ancestor);
         assertTrue(popup.isVisible());
         listener1.reset();
-
         popup.setVisible(false);
         assertNull(SwingUtilities.getWindowAncestor(popup));
         assertEquals("event fired properly ", "invisible", listener2.event);
         assertEquals("source ", popup, listener2.src);
         listener2.reset();
-        listener1.checkPropertyFired(popup, "visible",
-                             Boolean.TRUE, Boolean.FALSE);
-        listener1.checkPropertyFired(popup, "ancestor",
-                                    ancestor, null);
+        listener1.checkPropertyFired(popup, "visible", Boolean.TRUE, Boolean.FALSE);
+        listener1.checkPropertyFired(popup, "ancestor", ancestor, null);
         assertNull(popup.getParent());
         assertFalse(popup.isVisible());
         listener1.reset();
@@ -155,6 +152,7 @@
     /*
      * Test method for 'javax.swing.JPopupMenu.setLocation(int, int)'
      */
+    @SuppressWarnings("deprecation")
     public void testSetLocationIntInt() {
         JFrame frame = new JFrame();
         JMenuBar menuBar = new JMenuBar();
@@ -168,35 +166,30 @@
         assertEquals(new Point(0, 0), popup.getLocation());
         popup.setVisible(true);
         assertEquals(new Point(100, 200), popup.getLocationOnScreen());
-
         popup.setLocation(10, 20);
         assertEquals(new Point(0, 0), popup.getLocation());
         assertEquals(new Point(10, 20), popup.getLocationOnScreen());
-
         popup.setInvoker(menu2);
         popup.setLocation(100, 200);
         assertEquals(new Point(0, 0), popup.getLocation());
         assertEquals(new Point(100, 200), popup.getLocationOnScreen());
-
         frame.pack();
         frame.show();
-
         popup.setVisible(true);
         popup.setLocation(10, 20);
         assertEquals(new Point(0, 0), popup.getLocation());
         assertEquals(new Point(10, 20), popup.getLocationOnScreen());
-
         popup.setInvoker(menu2);
         popup.setLocation(100, 200);
         assertEquals(new Point(0, 0), popup.getLocation());
         assertEquals(new Point(100, 200), popup.getLocationOnScreen());
-
         frame.dispose();
     }
 
     /*
      * Test method for 'javax.swing.JPopupMenu.show(Component, int, int)'
      */
+    @SuppressWarnings("deprecation")
     public void testShowComponentIntInt() {
         JFrame frame = new JFrame();
         JMenuBar menuBar = new JMenuBar();
@@ -206,7 +199,6 @@
         menuBar.add(menu1);
         menuBar.add(menu2);
         popup = menu1.getPopupMenu();
-
         popup.setInvoker(new JButton());
         assertNotNull(popup.getInvoker());
         popup.show(null, 111, 222);
@@ -214,16 +206,13 @@
         assertEquals(new Point(111, 222), popup.getLocationOnScreen());
         assertTrue(popup.isVisible());
         assertTrue(popup.isShowing());
-
         frame.pack();
         frame.show();
-
         popup.show(menu2, 333, 111);
         assertSame(menu2, popup.getInvoker());
         assertFalse(popup.getLocationOnScreen().equals(new Point(333, 111)));
         assertTrue(popup.isVisible());
         assertTrue(popup.isShowing());
-
         frame.dispose();
     }
 
@@ -234,7 +223,6 @@
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
         JMenuItem item3 = new JMenuItem();
-
         popup.add(item1);
         popup.add(item2);
         assertEquals(0, popup.getComponentIndex(item1));
@@ -248,23 +236,21 @@
     public void testRemoveInt() {
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
-
         popup.add(item1);
         popup.add(item2);
         assertEquals(2, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
         assertSame(item2, popup.getComponent(1));
-
         try {
             popup.remove(5);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
-
+        } catch (IllegalArgumentException e) {
+        }
         try {
             popup.remove(-5);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
-
+        } catch (IllegalArgumentException e) {
+        }
         popup.remove(0);
         assertEquals(1, popup.getComponentCount());
         assertSame(item2, popup.getComponent(0));
@@ -303,7 +289,6 @@
         assertEquals(popup, popup.getComponent());
         assertNull(popup.getInvoker());
         assertEquals(0, popup.getSubElements().length);
-
         popup = new JPopupMenu(null);
         assertNull("text ", popup.getLabel());
         assertTrue(popup.getSelectionModel() instanceof DefaultSingleSelectionModel);
@@ -328,12 +313,11 @@
     public void testAddAction() {
         Icon icon = new ImageIcon(new BufferedImage(20, 20, BufferedImage.TYPE_BYTE_GRAY));
         String text = "texttext";
-
         MyAction action = new MyAction(text, icon);
         JMenuItem menuItem = popup.add(action);
         assertEquals(1, popup.getComponentCount());
         assertTrue(popup.getComponent(0) instanceof JMenuItem);
-        menuItem = ((JMenuItem)popup.getComponent(0));
+        menuItem = ((JMenuItem) popup.getComponent(0));
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertSame(action, menuItem.getAction());
@@ -345,21 +329,18 @@
     public void testAddString() {
         String label1 = "label1";
         String label2 = "label1";
-
-        popup.add((String)null);
+        popup.add((String) null);
         assertEquals(1, popup.getComponentCount());
         assertTrue(popup.getComponent(0) instanceof JMenuItem);
-        assertEquals("", ((JMenuItem)popup.getComponent(0)).getText());
-
+        assertEquals("", ((JMenuItem) popup.getComponent(0)).getText());
         popup.add(label1);
         assertEquals(2, popup.getComponentCount());
         assertTrue(popup.getComponent(1) instanceof JMenuItem);
-        assertEquals(label1, ((JMenuItem)popup.getComponent(1)).getText());
-
+        assertEquals(label1, ((JMenuItem) popup.getComponent(1)).getText());
         popup.add(label2);
         assertEquals(3, popup.getComponentCount());
         assertTrue(popup.getComponent(2) instanceof JMenuItem);
-        assertEquals(label2, ((JMenuItem)popup.getComponent(2)).getText());
+        assertEquals(label2, ((JMenuItem) popup.getComponent(2)).getText());
     }
 
     /*
@@ -368,11 +349,9 @@
     public void testAddJMenuItem() {
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
-
         popup.add(item1);
         assertEquals(1, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
-
         popup.add(item2);
         assertEquals(2, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
@@ -386,30 +365,23 @@
         PopupMenuListener listener1 = new ConcretePopupMenuListener();
         PopupMenuListener listener2 = new ConcretePopupMenuListener();
         PopupMenuListener listener3 = new ConcretePopupMenuListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = popup.getPopupMenuListeners();
         int initialValue = listenersArray.length;
-
         popup.addPopupMenuListener(listener1);
         popup.addPopupMenuListener(listener2);
         popup.addPopupMenuListener(listener2);
-
         listenersArray = popup.getPopupMenuListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         popup.removePopupMenuListener(listener1);
         popup.addPopupMenuListener(listener3);
         popup.addPopupMenuListener(listener3);
         listenersArray = popup.getPopupMenuListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         popup.removePopupMenuListener(listener3);
         popup.removePopupMenuListener(listener3);
         listenersArray = popup.getPopupMenuListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         popup.removePopupMenuListener(listener2);
         popup.removePopupMenuListener(listener2);
         listenersArray = popup.getPopupMenuListeners();
@@ -422,20 +394,16 @@
     public void testAddSeparator() {
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
-
         popup.add(item1);
         assertEquals(1, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
-
         popup.addSeparator();
         assertEquals(2, popup.getComponentCount());
         assertTrue(popup.getComponent(1) instanceof JPopupMenu.Separator);
-
         popup.add(item2);
         assertEquals(3, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
         assertSame(item2, popup.getComponent(2));
-
         popup.addSeparator();
         assertEquals(4, popup.getComponentCount());
         assertTrue(popup.getComponent(3) instanceof JPopupMenu.Separator);
@@ -447,6 +415,8 @@
      */
     public void testCreateActionChangeListener() {
         AbstractAction action1 = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(ActionEvent e) {
             }
         };
@@ -470,7 +440,6 @@
         String text = "texttext";
         MyAction action = new MyAction(text, icon);
         JMenuItem menuItem = popup.createActionComponent(action);
-
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertNull("action", menuItem.getAction());
@@ -487,7 +456,6 @@
         ConcretePopupMenuListener listener2 = new ConcretePopupMenuListener();
         popup.addPopupMenuListener(listener1);
         popup.addPopupMenuListener(listener2);
-
         popup.firePopupMenuCanceled();
         assertEquals("event fired properly ", "canceled", listener1.event);
         assertEquals("event fired properly ", "canceled", listener2.event);
@@ -503,7 +471,6 @@
         ConcretePopupMenuListener listener2 = new ConcretePopupMenuListener();
         popup.addPopupMenuListener(listener1);
         popup.addPopupMenuListener(listener2);
-
         popup.firePopupMenuWillBecomeInvisible();
         assertEquals("event fired properly ", "invisible", listener1.event);
         assertEquals("event fired properly ", "invisible", listener2.event);
@@ -519,7 +486,6 @@
         ConcretePopupMenuListener listener2 = new ConcretePopupMenuListener();
         popup.addPopupMenuListener(listener1);
         popup.addPopupMenuListener(listener2);
-
         popup.firePopupMenuWillBecomeVisible();
         assertEquals("event fired properly ", "visible", listener1.event);
         assertEquals("event fired properly ", "visible", listener2.event);
@@ -537,14 +503,13 @@
     /*
      * Test method for 'javax.swing.JPopupMenu.getComponent(int)'
      */
+    @SuppressWarnings("deprecation")
     public void testGetComponentAtIndex() {
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
-
         popup.add(item1);
         assertEquals(1, popup.getComponentCount());
         assertSame(item1, popup.getComponentAtIndex(0));
-
         popup.add(item2);
         assertEquals(2, popup.getComponentCount());
         assertSame(item1, popup.getComponentAtIndex(0));
@@ -566,29 +531,24 @@
         JMenuItem item2 = new JMenuItem();
         JMenuItem item3 = new JMenuItem();
         assertEquals(0, popup.getSubElements().length);
-
         popup.add(item1);
         assertEquals(1, popup.getSubElements().length);
         assertSame(item1, popup.getSubElements()[0]);
-
         popup.add(item2);
         popup.addSeparator();
         assertEquals(2, popup.getSubElements().length);
         assertSame(item1, popup.getSubElements()[0]);
         assertSame(item2, popup.getSubElements()[1]);
-
         popup.add(item3);
         assertEquals(3, popup.getSubElements().length);
         assertSame(item1, popup.getSubElements()[0]);
         assertSame(item2, popup.getSubElements()[1]);
         assertSame(item3, popup.getSubElements()[2]);
-
         popup.addSeparator();
         assertEquals(3, popup.getSubElements().length);
         assertSame(item1, popup.getSubElements()[0]);
         assertSame(item2, popup.getSubElements()[1]);
         assertSame(item3, popup.getSubElements()[2]);
-
         item1.setEnabled(false);
         assertEquals(3, popup.getSubElements().length);
     }
@@ -610,29 +570,25 @@
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
         Component item3 = new JPanel();
-
         popup.insert(item1, 0);
         assertEquals(1, popup.getComponentCount());
         assertSame(item1, popup.getComponent(0));
-
         popup.insert(item2, 0);
         assertEquals(2, popup.getComponentCount());
         assertSame(item2, popup.getComponent(0));
         assertSame(item1, popup.getComponent(1));
-
         popup.insert(item3, 1);
         assertEquals(3, popup.getComponentCount());
         assertSame(item2, popup.getComponent(0));
         assertSame(item3, popup.getComponent(1));
         assertSame(item1, popup.getComponent(2));
-
         popup.insert(item3, 16);
         assertEquals(3, popup.getComponentCount());
-
         try {
             popup.insert(item3, -6);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
     }
 
     /*
@@ -641,36 +597,31 @@
     public void testInsertActionInt() {
         Icon icon = new ImageIcon(new BufferedImage(20, 20, BufferedImage.TYPE_BYTE_GRAY));
         String text = "texttext";
-
         MyAction action1 = new MyAction(text, icon);
         MyAction action2 = new MyAction(text, icon);
-
         popup.insert(action1, 0);
         assertEquals(1, popup.getComponentCount());
         assertTrue(popup.getComponent(0) instanceof JMenuItem);
-        JMenuItem menuItem = ((JMenuItem)popup.getComponent(0));
+        JMenuItem menuItem = ((JMenuItem) popup.getComponent(0));
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
-
         popup.insert(action2, 1);
         assertEquals(2, popup.getComponentCount());
         assertTrue(popup.getComponent(0) instanceof JMenuItem);
-
-        menuItem = ((JMenuItem)popup.getComponent(1));
+        menuItem = ((JMenuItem) popup.getComponent(1));
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
-
         popup.insert(action1, 16);
         assertEquals(3, popup.getComponentCount());
         assertTrue(popup.getComponent(2) instanceof JMenuItem);
-        menuItem = ((JMenuItem)popup.getComponent(2));
+        menuItem = ((JMenuItem) popup.getComponent(2));
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
-
         try {
             popup.insert(action1, -3);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
     }
 
     /*
@@ -678,10 +629,8 @@
      */
     public void testSetIsBorderPainted() {
         assertTrue(popup.isBorderPainted());
-
         popup.setBorderPainted(false);
         assertFalse(popup.isBorderPainted());
-
         popup.setBorderPainted(true);
         assertTrue(popup.isBorderPainted());
     }
@@ -692,17 +641,18 @@
     public void testIsPopupTrigger() {
         class MyPopupMenuUI extends PopupMenuUI {
             public boolean value = false;
+
+            @Override
             public boolean isPopupTrigger(final MouseEvent event) {
                 return value;
             }
-        };
+        }
+        ;
         MyPopupMenuUI fakeUI = new MyPopupMenuUI();
         popup.setUI(fakeUI);
         assertSame(fakeUI, popup.getUI());
-
         fakeUI.value = true;
         assertEquals(fakeUI.value, popup.isPopupTrigger(null));
-
         fakeUI.value = false;
         assertEquals(fakeUI.value, popup.isPopupTrigger(null));
     }
@@ -710,6 +660,7 @@
     /*
      * Test method for 'javax.swing.JPopupMenu.menuSelectionChanged(boolean)'
      */
+    @SuppressWarnings("deprecation")
     public void testMenuSelectionChanged() {
         JFrame frame = new JFrame();
         JMenuBar menuBar = new JMenuBar();
@@ -720,14 +671,11 @@
         popup.menuSelectionChanged(true);
         assertFalse(popup.isShowing());
         assertFalse(popup.isVisible());
-
         frame.pack();
         frame.show();
-
         popup.menuSelectionChanged(true);
         assertTrue(popup.isShowing());
         assertTrue(popup.isVisible());
-
         popup.menuSelectionChanged(false);
         assertFalse(popup.isShowing());
         assertFalse(popup.isVisible());
@@ -743,7 +691,6 @@
         popup.add(button1);
         popup.add(button2);
         popup.pack();
-
         Dimension size = popup.getMinimumSize();
         assertEquals(size, popup.getMinimumSize());
         assertEquals(size, popup.getPreferredSize());
@@ -762,10 +709,8 @@
      */
     public void testSetGetDefaultLightWeightPopupEnabled() {
         assertTrue(JPopupMenu.getDefaultLightWeightPopupEnabled());
-
         JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         assertFalse(JPopupMenu.getDefaultLightWeightPopupEnabled());
-
         JPopupMenu.setDefaultLightWeightPopupEnabled(true);
         assertTrue(JPopupMenu.getDefaultLightWeightPopupEnabled());
     }
@@ -785,13 +730,10 @@
     public void testSetInvoker() {
         Component invoker1 = new JButton();
         Component invoker2 = new JLabel();
-
         popup.setInvoker(invoker1);
         assertEquals("invoker", invoker1, popup.getInvoker());
-
         popup.setInvoker(invoker2);
         assertEquals("invoker", invoker2, popup.getInvoker());
-
         popup.setInvoker(invoker2);
         assertEquals("invoker", invoker2, popup.getInvoker());
     }
@@ -807,25 +749,19 @@
      * Test method for 'javax.swing.JPopupMenu.setLabel(String)'
      */
     public void testSetLabel() {
-        PropertyChangeController listener =  new PropertyChangeController();
+        PropertyChangeController listener = new PropertyChangeController();
         String label1 = "dog is dog";
         String label2 = "0xdeadbeef";
-
         popup.setLabel(null);
         popup.addPropertyChangeListener(listener);
-
         popup.setLabel(label1);
-        listener.checkPropertyFired(popup, "label",
-                                    null, label1);
+        listener.checkPropertyFired(popup, "label", null, label1);
         assertEquals("label", label1, popup.getLabel());
         listener.reset();
-
         popup.setLabel(label2);
-        listener.checkPropertyFired(popup, "label",
-                                    label1, label2);
+        listener.checkPropertyFired(popup, "label", label1, label2);
         assertEquals("label", label2, popup.getLabel());
         listener.reset();
-
         popup.setLabel(label2);
         assertFalse("event's not been fired ", listener.isChanged());
     }
@@ -835,20 +771,15 @@
      */
     public void testSetIsLightWeightPopupEnabled() {
         assertTrue(JPopupMenu.getDefaultLightWeightPopupEnabled());
-
         JPopupMenu menu = new JPopupMenu();
         assertTrue(menu.isLightWeightPopupEnabled());
-
         menu.setLightWeightPopupEnabled(false);
         assertFalse(menu.isLightWeightPopupEnabled());
-
         JPopupMenu.setDefaultLightWeightPopupEnabled(false);
         menu = new JPopupMenu();
         assertFalse(menu.isLightWeightPopupEnabled());
-
         menu.setLightWeightPopupEnabled(true);
         assertTrue(menu.isLightWeightPopupEnabled());
-
         JPopupMenu.setDefaultLightWeightPopupEnabled(true);
     }
 
@@ -871,7 +802,6 @@
         Dimension oldPrefs = popup.getPreferredSize();
         popup.setPopupSize(new Dimension(height, width));
         assertEquals(new Dimension(height, width), popup.getPreferredSize());
-
         popup.setPopupSize(null);
         assertEquals(oldPrefs, popup.getPreferredSize());
     }
@@ -881,21 +811,16 @@
      */
     public void testSetSelected() {
         SingleSelectionModel selectionModel1 = new DefaultSingleSelectionModel();
-        SingleSelectionModel selectionModel2 = new DefaultSingleSelectionModel();
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
-
         popup.setSelectionModel(null);
         popup.add(item1);
         popup.add(item2);
-
         popup.setSelectionModel(selectionModel1);
         popup.setSelected(item1);
         assertEquals("selection", 0, selectionModel1.getSelectedIndex());
-
         popup.setSelected(item2);
         assertEquals("selection", 1, selectionModel1.getSelectedIndex());
-
         popup.setSelected(new JButton());
         assertEquals("selection", -1, selectionModel1.getSelectedIndex());
     }
@@ -906,14 +831,10 @@
     public void testSetGetSelectionModel() {
         SingleSelectionModel selectionModel1 = new DefaultSingleSelectionModel();
         SingleSelectionModel selectionModel2 = new DefaultSingleSelectionModel();
-
         popup.setSelectionModel(null);
-
         popup.setSelectionModel(selectionModel1);
         assertEquals("selectionModel", selectionModel1, popup.getSelectionModel());
-
         popup.setSelectionModel(selectionModel2);
         assertEquals("selectionModel", selectionModel2, popup.getSelectionModel());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JProgressBarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JProgressBarTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JProgressBarTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JProgressBarTest.java Sat Nov 25 16:04:10 2006
@@ -18,25 +18,25 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.util.Arrays;
-
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleState;
 import javax.accessibility.AccessibleValue;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import javax.swing.plaf.ProgressBarUI;
-
 import org.apache.harmony.x.swing.StringConstants;
 
 public class JProgressBarTest extends BasicSwingTestCase {
     private JProgressBar progressBar;
+
     private DefaultBoundedRangeModel model;
+
     private ChangeController controller;
 
+    @Override
     public void setUp() {
         propertyChangeController = new PropertyChangeController();
         model = new DefaultBoundedRangeModel(0, 0, 0, 256);
@@ -46,6 +46,7 @@
         progressBar.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     public void tearDown() {
         propertyChangeController = null;
         progressBar = null;
@@ -55,24 +56,23 @@
 
     public void testJProgressBar() {
         progressBar = new JProgressBar();
-        assertEquals(JProgressBar.HORIZONTAL, progressBar.orientation);
+        assertEquals(SwingConstants.HORIZONTAL, progressBar.orientation);
         assertNull(progressBar.progressString);
         assertFalse(progressBar.paintString);
         assertTrue(progressBar.paintBorder);
         assertFalse(progressBar.isIndeterminate());
         assertNotNull(progressBar.getUI());
         assertNotNull(progressBar.changeListener);
-
         progressBar = new JProgressBar(model);
         assertSame(model, progressBar.model);
         assertNotNull(progressBar.getUI());
-
-        testExceptionalCase( new IllegalArgumentCase () {
+        testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
-                progressBar = new JProgressBar(JProgressBar.HORIZONTAL + JProgressBar.VERTICAL + 1);
+                progressBar = new JProgressBar(SwingConstants.HORIZONTAL
+                        + SwingConstants.VERTICAL + 1);
             }
         });
-
         progressBar = new JProgressBar(1, 23);
         assertNotNull(progressBar.getUI());
         assertEquals(1, progressBar.getMinimum());
@@ -81,11 +81,13 @@
     }
 
     public void testSetGetOrientation() {
-        progressBar.setOrientation(JProgressBar.VERTICAL);
-        assertEquals(JProgressBar.VERTICAL, progressBar.getOrientation());
-        testExceptionalCase( new IllegalArgumentCase () {
+        progressBar.setOrientation(SwingConstants.VERTICAL);
+        assertEquals(SwingConstants.VERTICAL, progressBar.getOrientation());
+        testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
-                progressBar.setOrientation(JProgressBar.HORIZONTAL + JProgressBar.VERTICAL + 1);
+                progressBar.setOrientation(SwingConstants.HORIZONTAL + SwingConstants.VERTICAL
+                        + 1);
             }
         });
         assertTrue(propertyChangeController.isChanged(StringConstants.ORIENTATION));
@@ -95,20 +97,18 @@
         DefaultBoundedRangeModel newModel = new DefaultBoundedRangeModel(1, 0, 1, 12);
         progressBar.setModel(newModel);
         assertSame(newModel, progressBar.getModel());
-        assertTrue(Arrays.asList(newModel.getChangeListeners()).contains(progressBar.changeListener));
-
+        assertTrue(Arrays.asList(newModel.getChangeListeners()).contains(
+                progressBar.changeListener));
         progressBar.setModel(null);
         assertNull(progressBar.getModel());
     }
 
     public void testProgressString() {
         assertFalse(progressBar.isStringPainted());
-
         String string = "someDisplayString";
         progressBar.setString(string);
         assertSame(string, progressBar.getString());
         assertTrue(propertyChangeController.isChanged("string"));
-
         progressBar.setStringPainted(true);
         assertTrue(progressBar.isStringPainted());
         assertTrue(propertyChangeController.isChanged("stringPainted"));
@@ -128,17 +128,15 @@
         assertNull(accessibleContext.getAccessibleDescription());
         assertNull(accessibleContext.getAccessibleAction());
         assertSame(accessibleContext.getAccessibleValue(), accessibleContext);
-
-        assertTrue(accessibleContext.getAccessibleStateSet().contains(AccessibleState.HORIZONTAL));
-
-        AccessibleValue value = (AccessibleValue)accessibleContext;
-        int currentValue = (progressBar.getMinimum() + progressBar.getMaximum())/2;
+        assertTrue(accessibleContext.getAccessibleStateSet().contains(
+                AccessibleState.HORIZONTAL));
+        AccessibleValue value = (AccessibleValue) accessibleContext;
+        int currentValue = (progressBar.getMinimum() + progressBar.getMaximum()) / 2;
         progressBar.setValue(currentValue);
         assertTrue(controller.isChanged());
         assertEquals(new Integer(currentValue), value.getCurrentAccessibleValue());
         assertEquals(new Integer(progressBar.getMaximum()), value.getMaximumAccessibleValue());
         assertEquals(new Integer(progressBar.getMinimum()), value.getMinimumAccessibleValue());
-
         value.setCurrentAccessibleValue(new Integer(currentValue + 1));
         assertTrue(controller.isChanged());
         assertEquals(currentValue + 1, progressBar.getValue());
@@ -148,24 +146,21 @@
 
     public void testSetGetUpdateUI() {
         assertEquals("ProgressBarUI", progressBar.getUIClassID());
-
         ProgressBarUI defaultUI = progressBar.getUI();
         assertNotNull(defaultUI);
-
-        ProgressBarUI ui = new ProgressBarUI() {};
+        ProgressBarUI ui = new ProgressBarUI() {
+        };
         progressBar.setUI(ui);
         assertEquals(ui, progressBar.getUI());
-
         progressBar.updateUI();
         assertNotSame(ui, progressBar.getUI());
     }
 
     public void testSetGetValue() {
-        int currentValue = (progressBar.getMinimum() + progressBar.getMaximum())/2;
+        int currentValue = (progressBar.getMinimum() + progressBar.getMaximum()) / 2;
         progressBar.setValue(currentValue);
         assertEquals(currentValue, progressBar.getValue());
         assertTrue(controller.isChanged());
-
         progressBar.setValue(progressBar.getMaximum() + 10);
         assertEquals(progressBar.getMaximum(), progressBar.getValue());
     }
@@ -196,7 +191,8 @@
         int min = progressBar.getMinimum();
         for (int i = progressBar.getMinimum(); i < progressBar.getMaximum() + 1; i++) {
             progressBar.setValue(i);
-            assertEquals(1. * (i - min) / (range), progressBar.getPercentComplete(), 0.0000000001);
+            assertEquals(1. * (i - min) / (range), progressBar.getPercentComplete(),
+                    0.0000000001);
         }
         progressBar.setMinimum(progressBar.getMaximum());
         assertTrue(Double.isNaN(progressBar.getPercentComplete()));
@@ -210,13 +206,12 @@
     public void testAddRemoveGetChangeListener() {
         assertEquals(2, progressBar.getChangeListeners().length);
         assertTrue(Arrays.asList(progressBar.getChangeListeners()).contains(controller));
-
         ChangeListener listener = new ChangeListener() {
-            public void stateChanged(ChangeEvent e) {}
+            public void stateChanged(ChangeEvent e) {
+            }
         };
         progressBar.addChangeListener(listener);
         assertTrue(Arrays.asList(progressBar.getChangeListeners()).contains(listener));
-
         progressBar.removeChangeListener(controller);
         progressBar.removeChangeListener(listener);
         assertEquals(1, progressBar.getChangeListeners().length);
@@ -228,4 +223,3 @@
         assertTrue(controller.isChanged());
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonMenuItemTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonMenuItemTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonMenuItemTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonMenuItemTest.java Sat Nov 25 16:04:10 2006
@@ -15,24 +15,24 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 import java.awt.event.ActionEvent;
-
 import javax.accessibility.AccessibleRole;
 import javax.swing.JToggleButton.ToggleButtonModel;
 
 public class JRadioButtonMenuItemTest extends JMenuItemTest {
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         menuItem = new JRadioButtonMenuItem();
         button = menuItem;
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -46,7 +46,6 @@
         assertNull("icon ", button.getIcon());
         assertEquals("text ", "", button.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -63,7 +62,6 @@
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", "", menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -80,7 +78,6 @@
         assertTrue("default buttonModel ", button.getModel() instanceof ToggleButtonModel);
         assertNull("icon ", menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -99,7 +96,6 @@
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -113,7 +109,7 @@
         final String command = "dnammoc";
         final KeyStroke accelerator = KeyStroke.getKeyStroke('a');
         class MyAction extends AbstractAction {
-            public boolean performed = false;
+            private static final long serialVersionUID = 1L;
 
             public MyAction(final String text, final Icon icon) {
                 super(text, icon);
@@ -122,15 +118,14 @@
             }
 
             public void actionPerformed(final ActionEvent e) {
-                performed = true;
             }
-        };
+        }
+        ;
         Icon icon = createNewIcon();
         String text = "texttext";
         MyAction action = new MyAction(text, icon);
         menuItem = new JRadioButtonMenuItem(action);
         assertFalse(menuItem.isSelected());
-
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertEquals("action", action, menuItem.getAction());
@@ -138,10 +133,8 @@
         assertFalse("selected ", menuItem.isSelected());
         assertTrue("enabled ", menuItem.isEnabled());
         assertEquals("accelerator ", accelerator, menuItem.getAccelerator());
-
         action.setEnabled(false);
         menuItem = new JRadioButtonMenuItem(action);
-
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertEquals("action", action, menuItem.getAction());
@@ -149,18 +142,14 @@
         assertFalse("selected ", menuItem.isSelected());
         assertFalse("enabled ", menuItem.isEnabled());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
-
-        menuItem = new JRadioButtonMenuItem((Action)null);
-
+        menuItem = new JRadioButtonMenuItem((Action) null);
         assertNull("icon ", menuItem.getIcon());
         assertNull("text ", menuItem.getText());
         assertNull("action", menuItem.getAction());
         assertNull("command ", menuItem.getActionCommand());
         assertFalse("selected ", menuItem.isSelected());
         assertTrue("enabled ", menuItem.isEnabled());
-
         assertTrue("default buttonModel ", button.getModel() instanceof ToggleButtonModel);
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -178,12 +167,10 @@
         assertEquals("text ", "", menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertTrue(menuItem.isSelected());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
         assertEquals(SwingConstants.CENTER, button.getVerticalTextPosition());
-
         menuItem = new JRadioButtonMenuItem(icon, false);
         assertFalse(menuItem.isSelected());
     }
@@ -200,12 +187,10 @@
         assertEquals("text ", text, menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertTrue(menuItem.isSelected());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
         assertEquals(SwingConstants.CENTER, button.getVerticalTextPosition());
-
         menuItem = new JRadioButtonMenuItem(text, icon, false);
         assertFalse(menuItem.isSelected());
     }
@@ -213,20 +198,21 @@
     /*
      * Test method for 'javax.swing.JRadioButtonMenuItem.getAccessibleContext()'
      */
+    @Override
     public void testGetAccessibleContext() {
-        boolean assertedValue = (menuItem.getAccessibleContext() != null &&
-                menuItem.getAccessibleContext().getClass().getName().
-                equals("javax.swing.JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.RADIO_BUTTON, menuItem.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (menuItem.getAccessibleContext() != null && menuItem
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JRadioButtonMenuItem$AccessibleJRadioButtonMenuItem"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.RADIO_BUTTON, menuItem
+                .getAccessibleContext().getAccessibleRole());
     }
 
     /*
      * Test method for 'javax.swing.JRadioButtonMenuItem.getUIClassID()'
      */
+    @Override
     public void testGetUIClassID() {
         assertEquals("RadioButtonMenuItemUI", menuItem.getUIClassID());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonTest.java Sat Nov 25 16:04:10 2006
@@ -24,36 +24,36 @@
 
 import java.awt.event.ActionEvent;
 import java.awt.image.BufferedImage;
-
 import javax.accessibility.AccessibleRole;
 import javax.swing.plaf.ButtonUI;
 
 public class JRadioButtonTest extends SwingTestCase {
-
     protected AbstractButton button = null;
 
     /*
      * @see JToggleButtonTest#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         button = new JRadioButton();
     }
 
     /*
      * @see JToggleButtonTest#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
 
     public void testGetAccessibleContext() {
-        boolean assertedValue = (button.getAccessibleContext() != null &&
-                button.getAccessibleContext().getClass().getName().equals("javax.swing.JRadioButton$AccessibleJRadioButton"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.RADIO_BUTTON, button.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (button.getAccessibleContext() != null && button
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JRadioButton$AccessibleJRadioButton"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.RADIO_BUTTON, button
+                .getAccessibleContext().getAccessibleRole());
     }
 
     public void testParamString() {
@@ -67,10 +67,8 @@
     public void testUpdateUI() {
         ButtonUI ui = new ButtonUI() {
         };
-
         button.setUI(ui);
         assertEquals(ui, button.getUI());
-
         button.updateUI();
         assertNotSame(ui, button.getUI());
     }
@@ -79,19 +77,21 @@
         Object res1 = null;
         Object res2 = null;
         AbstractAction action1 = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
         AbstractAction action2 = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
         res1 = button.createActionPropertyChangeListener(action1);
         assertNotNull("returned value is not null", res1);
-
         res2 = button.createActionPropertyChangeListener(action2);
         assertNotNull("returned value is not null", res2);
-
         res2 = button.createActionPropertyChangeListener(null);
         assertNotNull("returned value is not null", res2);
     }
@@ -104,10 +104,14 @@
         String text3 = "texttext3";
         String text4 = "texttext4";
         AbstractAction action1 = new AbstractAction(text1, icon1) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
         AbstractAction action2 = new AbstractAction(text2, icon2) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
@@ -115,7 +119,6 @@
         action1.putValue(Action.SHORT_DESCRIPTION, text3);
         action1.putValue(Action.MNEMONIC_KEY, new Integer(1));
         button.setAction(action1);
-
         assertEquals("action ", action1, button.getAction());
         assertTrue("enabled ", button.isEnabled());
         assertTrue("enabled ", action1.isEnabled());
@@ -123,25 +126,20 @@
         button.isEnabled();
         assertFalse("enabled ", button.isEnabled());
         assertFalse("enabled ", action1.isEnabled());
-
         assertNull("icon ", button.getIcon());
         action1.putValue(Action.SMALL_ICON, icon2);
         assertNull("icon ", button.getIcon());
-
         if (isHarmony()) {
             assertEquals("mnemonic ", 1, button.getMnemonic());
             action1.putValue(Action.MNEMONIC_KEY, new Integer(27));
             assertEquals("mnemonic ", 27, button.getMnemonic());
         }
-
         assertEquals("text ", text1, button.getText());
         action1.putValue(Action.NAME, text2);
         assertEquals("text ", text2, button.getText());
-
         assertEquals("ToolTipText ", text3, button.getToolTipText());
         action1.putValue(Action.SHORT_DESCRIPTION, text4);
         assertEquals("ToolTipText ", text4, button.getToolTipText());
-
         button.setAction(action2);
         action1.putValue(Action.SHORT_DESCRIPTION, text4);
         assertNull("ToolTipText ", button.getToolTipText());
@@ -163,7 +161,7 @@
     public void testJRadioButtonAction() {
         final String command = "dnammoc";
         class MyAction extends AbstractAction {
-            public boolean performed = false;
+            private static final long serialVersionUID = 1L;
 
             public MyAction(final String text, final Icon icon) {
                 super(text, icon);
@@ -171,24 +169,21 @@
             }
 
             public void actionPerformed(final ActionEvent e) {
-                performed = true;
             }
-        };
+        }
+        ;
         Icon icon = new ImageIcon(new BufferedImage(20, 20, BufferedImage.TYPE_BYTE_GRAY));
         String text = "texttext";
         MyAction action = new MyAction(text, icon);
         action.setEnabled(false);
         button = new JRadioButton(action);
-
         assertNull("icon ", button.getIcon());
         assertEquals("text ", text, button.getText());
         assertEquals("action", action, button.getAction());
         assertEquals("command ", command, button.getActionCommand());
         assertFalse("selected ", button.isSelected());
         assertFalse("enabled ", button.isEnabled());
-
-        button = new JRadioButton((Action)null);
-
+        button = new JRadioButton((Action) null);
         assertNull("icon ", button.getIcon());
         assertNull("text ", button.getText());
         assertNull("action", button.getAction());
@@ -207,12 +202,10 @@
         String text2 = "";
         boolean state1 = false;
         boolean state2 = false;
-
         button = new JRadioButton(icon1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(icon2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
@@ -229,12 +222,10 @@
         String text2 = "";
         boolean state1 = true;
         boolean state2 = false;
-
         button = new JRadioButton(icon1, state1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(icon2, state2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
@@ -251,12 +242,10 @@
         String text2 = "texttext2";
         boolean state1 = false;
         boolean state2 = false;
-
         button = new JRadioButton(text1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(text2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
@@ -273,12 +262,10 @@
         String text2 = "texttext2";
         boolean state1 = true;
         boolean state2 = false;
-
         button = new JRadioButton(text1, state1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(text2, state2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
@@ -295,12 +282,10 @@
         String text2 = "texttext2";
         boolean state1 = false;
         boolean state2 = false;
-
         button = new JRadioButton(text1, icon1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(text2, icon2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
@@ -317,16 +302,13 @@
         String text2 = "texttext2";
         boolean state1 = true;
         boolean state2 = false;
-
         button = new JRadioButton(text1, icon1, state1);
         assertEquals("icon ", icon1, button.getIcon());
         assertEquals("text ", text1, button.getText());
         assertEquals("selected ", state1, button.isSelected());
-
         button = new JRadioButton(text2, icon2, state2);
         assertEquals("icon ", icon2, button.getIcon());
         assertEquals("text ", text2, button.getText());
         assertEquals("selected ", state2, button.isSelected());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneRTest.java Sat Nov 25 16:04:10 2006
@@ -29,9 +29,9 @@
         super(name);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
-
         if (frame != null) {
             frame.dispose();
             frame = null;
@@ -48,13 +48,10 @@
         frame = new JFrame();
         frame.setContentPane(desktop);
         frame.setVisible(true);
-
         iframe.setIcon(true);
         assertNull(iframe.getRootPane().getDefaultButton());
-
         iframe.setIcon(false);
         assertSame(button, iframe.getRootPane().getDefaultButton());
-
         iframe.setIcon(true);
         iframe.getContentPane().remove(button);
         iframe.setIcon(false);

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneTest.java Sat Nov 25 16:04:10 2006
@@ -14,15 +14,12 @@
  *  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;
 import java.awt.Component;
 import java.awt.Container;
@@ -33,7 +30,6 @@
 import java.awt.Rectangle;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 import javax.swing.border.Border;
@@ -46,22 +42,29 @@
      * This class overload protected methods with public methods
      */
     private class TestRootPane extends JRootPane {
+        private static final long serialVersionUID = 1L;
+
+        @Override
         public String paramString() {
             return super.paramString();
         }
 
+        @Override
         public Container createContentPane() {
             return super.createContentPane();
         }
 
+        @Override
         public Component createGlassPane() {
             return super.createGlassPane();
         }
 
+        @Override
         public JLayeredPane createLayeredPane() {
             return super.createLayeredPane();
         }
 
+        @Override
         public LayoutManager createRootLayout() {
             return super.createRootLayout();
         }
@@ -91,6 +94,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         rootPane = new JRootPane();
@@ -100,6 +104,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -111,13 +116,12 @@
         assertEquals("RootPaneUI", rootPane.getUIClassID());
     }
 
+    @SuppressWarnings("deprecation")
     public void testSetGetMenuBar() {
         assertNull(rootPane.getMenuBar());
-
         JMenuBar menuBar = new JMenuBar();
         rootPane.setMenuBar(menuBar);
         assertTrue(rootPane.getMenuBar() == menuBar);
-
         rootPane.setMenuBar(null);
         assertNull(rootPane.getMenuBar());
     }
@@ -133,15 +137,13 @@
         JPanel contentPane = new JPanel();
         contentPane.setOpaque(true);
         rootPane.setContentPane(contentPane);
-        assertTrue(contentPane==rootPane.getContentPane());
+        assertTrue(contentPane == rootPane.getContentPane());
     }
 
     public void testSetGetLayeredPane() {
         JLayeredPane pane = new JLayeredPane();
-
         rootPane.setLayeredPane(pane);
         assertTrue(pane == rootPane.getLayeredPane());
-
         boolean thrown = false;
         try {
             rootPane.setLayeredPane(null);
@@ -150,17 +152,14 @@
         } finally {
             assertTrue(thrown);
         }
-
         assertTrue(rootPane.getLayeredPane() != null);
     }
 
     public void testSetGetGlassPane() {
         JPanel pane = new JPanel();
         pane.setVisible(false);
-
         rootPane.setGlassPane(pane);
         assertTrue(pane == rootPane.getGlassPane());
-
         boolean thrown = false;
         try {
             rootPane.setGlassPane(null);
@@ -169,17 +168,14 @@
         } finally {
             assertTrue(thrown);
         }
-
         assertTrue(rootPane.getGlassPane() != null);
     }
 
     public void testSetGetJMenuBar() {
         assertNull(rootPane.getJMenuBar());
-
         JMenuBar menuBar = new JMenuBar();
         rootPane.setJMenuBar(menuBar);
         assertTrue(rootPane.getJMenuBar() == menuBar);
-
         rootPane.setJMenuBar(null);
         assertNull(rootPane.getJMenuBar());
     }
@@ -192,7 +188,6 @@
 
     public void testUpdateUI() {
         rootPane.updateUI();
-
         ComponentUI ui1 = rootPane.getUI();
         ComponentUI ui2 = UIManager.getUI(rootPane);
         // at least names of classes must be the same
@@ -203,13 +198,10 @@
         // rootPane must be inside window in this test
         JFrame frame = new JFrame();
         rootPane = frame.getRootPane();
-
         assertEquals(JRootPane.NONE, rootPane.getWindowDecorationStyle());
-
         int newStyle = JRootPane.FRAME;
         rootPane.setWindowDecorationStyle(newStyle);
         assertEquals(newStyle, rootPane.getWindowDecorationStyle());
-
         // test for invalid style - an exception must be thrown
         boolean ok = false;
         try {
@@ -219,7 +211,6 @@
         } finally {
             assertTrue(ok);
         }
-
         // test that this is a bound property
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         rootPane.addPropertyChangeListener("windowDecorationStyle", listener);
@@ -231,13 +222,11 @@
 
     public void testAddImpl() {
         JPanel pane = new JPanel();
-
         // setGlassPane() calls addImpl(), which enshures that glass pane
         // has index 0
         rootPane.setGlassPane(pane);
         // glass pane must always have index 0
         assertTrue(rootPane.getComponent(0) == pane);
-
         pane = new JPanel();
         rootPane.add(pane, 0);
         // not a glass pane, cannot have index 0
@@ -251,7 +240,6 @@
     public void testIsOptimizedDrawingEnabled() {
         rootPane.getGlassPane().setVisible(false);
         assertTrue(rootPane.isOptimizedDrawingEnabled());
-
         rootPane.getGlassPane().setVisible(true);
         assertFalse(rootPane.isOptimizedDrawingEnabled());
     }
@@ -270,21 +258,17 @@
 
     public void testSetGetDefaultButton() {
         assertNull(rootPane.getDefaultButton());
-
         JButton button = new JButton();
         rootPane.setDefaultButton(button);
         assertTrue(rootPane.getDefaultButton() == button);
-
         rootPane.setDefaultButton(null);
         assertNull(rootPane.getDefaultButton());
-
         // test that this is a bound property
         MyPropertyChangeListener listener = new MyPropertyChangeListener();
         rootPane.addPropertyChangeListener("defaultButton", listener);
         assertFalse(listener.ok);
         rootPane.setDefaultButton(button);
         assertTrue(listener.ok);
-
         rootPane.setDefaultButton(null);
         button.setDefaultCapable(false);
         rootPane.setDefaultButton(button);
@@ -299,52 +283,42 @@
         final Dimension base = new Dimension(640, 480);
         rootPane.setSize(base);
         rootPane.getLayout().layoutContainer(rootPane);
-
-
         // test without menu
-        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane
-                .getGlassPane().getBounds());
-        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane
-                .getLayeredPane().getBounds());
-        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane
-                .getContentPane().getBounds());
-
+        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane.getGlassPane()
+                .getBounds());
+        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane.getLayeredPane()
+                .getBounds());
+        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane.getContentPane()
+                .getBounds());
         // test with menu
         JMenuBar menuBar = new JMenuBar();
         menuBar.add(new JMenu("Menu"));
         rootPane.setJMenuBar(menuBar);
         rootPane.getLayout().layoutContainer(rootPane);
-
-        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane
-                .getGlassPane().getBounds());
-        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane
-                .getLayeredPane().getBounds());
-        assertEquals(new Rectangle(0, menuBar.getHeight(), base.width,
-                base.height - menuBar.getHeight()), rootPane.getContentPane()
+        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane.getGlassPane()
                 .getBounds());
-        assertEquals(new Rectangle(0, 0, base.width, menuBar.getHeight()),
-                rootPane.getJMenuBar().getBounds());
-
+        assertEquals(new Rectangle(0, 0, base.width, base.height), rootPane.getLayeredPane()
+                .getBounds());
+        assertEquals(new Rectangle(0, menuBar.getHeight(), base.width, base.height
+                - menuBar.getHeight()), rootPane.getContentPane().getBounds());
+        assertEquals(new Rectangle(0, 0, base.width, menuBar.getHeight()), rootPane
+                .getJMenuBar().getBounds());
         // test with menu and border
         Border border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
         rootPane.setBorder(border);
         rootPane.getLayout().layoutContainer(rootPane);
         Insets insets = border.getBorderInsets(menuBar);
-
         int insetsWidth = insets.left + insets.right;
         int insetsHeight = insets.top + insets.bottom;
-        assertEquals(new Rectangle(insets.left, insets.top, base.width
-                - insetsWidth, base.height - insetsHeight), rootPane
-                .getGlassPane().getBounds());
-        assertEquals(new Rectangle(insets.left, insets.top, base.width
-                - insetsWidth, base.height - insetsHeight), rootPane.getLayeredPane()
-                .getBounds());
-        assertEquals(
-                new Rectangle(0, menuBar.getHeight(), base.width - insetsWidth,
-                        base.height - insetsHeight - menuBar.getHeight()),
-                rootPane.getContentPane().getBounds());
-        assertEquals(new Rectangle(0, 0, base.width - insetsWidth, menuBar.getHeight()), rootPane.getJMenuBar()
+        assertEquals(new Rectangle(insets.left, insets.top, base.width - insetsWidth,
+                base.height - insetsHeight), rootPane.getGlassPane().getBounds());
+        assertEquals(new Rectangle(insets.left, insets.top, base.width - insetsWidth,
+                base.height - insetsHeight), rootPane.getLayeredPane().getBounds());
+        assertEquals(new Rectangle(0, menuBar.getHeight(), base.width - insetsWidth,
+                base.height - insetsHeight - menuBar.getHeight()), rootPane.getContentPane()
                 .getBounds());
+        assertEquals(new Rectangle(0, 0, base.width - insetsWidth, menuBar.getHeight()),
+                rootPane.getJMenuBar().getBounds());
     }
 
     /*
@@ -366,7 +340,7 @@
      */
     public void testCreateContentPane() {
         TestRootPane root = new TestRootPane();
-        JComponent content = (JComponent)root.createContentPane();
+        JComponent content = (JComponent) root.createContentPane();
         assertTrue(content != null);
         assertTrue(content.isOpaque());
         assertTrue(content.getLayout() instanceof BorderLayout);
@@ -377,10 +351,9 @@
      */
     public void testCreateGlassPane() {
         TestRootPane root = new TestRootPane();
-        JComponent glass = (JComponent)root.createGlassPane();
+        JComponent glass = (JComponent) root.createGlassPane();
         assertTrue(glass != null);
         assertFalse(glass.isVisible());
-
         // there is nothing about default opacity in the docs,
         // but it really must be false
         assertFalse(glass.isOpaque());
@@ -400,22 +373,16 @@
      */
     public void testGetAccessibleContext() {
         AccessibleContext c = rootPane.getAccessibleContext();
-
-        assertTrue("instanceof AccessibleJRootPane",
-                   c instanceof JRootPane.AccessibleJRootPane);
-        assertTrue("AccessibleRole is ok",
-                   c.getAccessibleRole() == AccessibleRole.ROOT_PANE);
+        assertTrue("instanceof AccessibleJRootPane", c instanceof JRootPane.AccessibleJRootPane);
+        assertTrue("AccessibleRole is ok", c.getAccessibleRole() == AccessibleRole.ROOT_PANE);
         assertNull("AccessibleName is ok", c.getAccessibleName());
-        assertNull("AccessibleDescription is ok",
-                   c.getAccessibleDescription());
-
+        assertNull("AccessibleDescription is ok", c.getAccessibleDescription());
         rootPane.add(new JPanel());
         rootPane.getLayeredPane().add(new JPanel());
         //System.out.println(c.getAccessibleChildrenCount());
         //System.out.println(c.getAccessibleChild(0));
-        assertTrue("AccessibleChildrenCount == 1",
-                   c.getAccessibleChildrenCount() == 1);
-        assertTrue("AccessibleChild(0) == contentPane",
-                   c.getAccessibleChild(0) == rootPane.getContentPane());
+        assertTrue("AccessibleChildrenCount == 1", c.getAccessibleChildrenCount() == 1);
+        assertTrue("AccessibleChild(0) == contentPane", c.getAccessibleChild(0) == rootPane
+                .getContentPane());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollBarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollBarTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollBarTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollBarTest.java Sat Nov 25 16:04:10 2006
@@ -14,32 +14,31 @@
  *  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.Adjustable;
 import java.awt.event.AdjustmentEvent;
 import java.awt.event.AdjustmentListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.List;
 import java.util.Vector;
-
 import javax.accessibility.AccessibleRole;
 import javax.accessibility.AccessibleState;
 
-
 public class JScrollBarTest extends SwingTestCase {
     private JScrollBar bar;
-    private List testList;
 
+    private List<String> testList;
+
+    @Override
     public void setUp() {
         bar = new JScrollBar();
-        testList = new Vector();
+        testList = new Vector<String>();
         bar.addPropertyChangeListener(new PropertyChangeListener() {
             public void propertyChange(final PropertyChangeEvent e) {
                 testList.add("1");
@@ -47,43 +46,37 @@
         });
     }
 
+    @Override
     protected void tearDown() throws Exception {
         bar = null;
         testList = null;
     }
 
     public void testGetAccessibleContext() throws Exception {
-        JScrollBar.AccessibleJScrollBar accJScrollBar = (JScrollBar.AccessibleJScrollBar)bar.getAccessibleContext();
+        JScrollBar.AccessibleJScrollBar accJScrollBar = (JScrollBar.AccessibleJScrollBar) bar
+                .getAccessibleContext();
         assertNotNull(accJScrollBar);
-
         assertTrue(bar.getAccessibleContext() == bar.getAccessibleContext());
-
         assertTrue(accJScrollBar.getAccessibleValue() == accJScrollBar.getAccessibleValue());
         assertTrue(bar.getAccessibleContext() == accJScrollBar.getAccessibleValue());
-
         assertEquals(new Integer(bar.getValue()), accJScrollBar.getCurrentAccessibleValue());
         accJScrollBar.setCurrentAccessibleValue(new Float(1));
         assertEquals(new Integer(1), accJScrollBar.getCurrentAccessibleValue());
         assertEquals(new Integer(bar.getValue()), accJScrollBar.getCurrentAccessibleValue());
-
         bar.setMinimum(20);
         assertEquals(new Integer(20), accJScrollBar.getMinimumAccessibleValue());
         assertEquals(new Integer(bar.getMinimum()), accJScrollBar.getMinimumAccessibleValue());
-
         bar.setMaximum(345);
         assertEquals(new Integer(335), accJScrollBar.getMaximumAccessibleValue());
         bar.setVisibleAmount(20);
         assertEquals(new Integer(325), accJScrollBar.getMaximumAccessibleValue());
-
         assertTrue(accJScrollBar.getAccessibleRole() == AccessibleRole.SCROLL_BAR);
-
         assertEquals(5, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.FOCUSABLE));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VISIBLE));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.OPAQUE));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VERTICAL));
-
         bar.setVisible(false);
         assertEquals(4, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
@@ -91,8 +84,7 @@
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VISIBLE));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.OPAQUE));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VERTICAL));
-
-        bar.setOrientation(JScrollBar.HORIZONTAL);
+        bar.setOrientation(Adjustable.HORIZONTAL);
         assertEquals(4, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.FOCUSABLE));
@@ -100,7 +92,6 @@
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.OPAQUE));
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VERTICAL));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.HORIZONTAL));
-
         bar.setEnabled(false);
         assertEquals(3, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
@@ -109,7 +100,6 @@
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.OPAQUE));
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VERTICAL));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.HORIZONTAL));
-
         bar.setOpaque(false);
         assertEquals(2, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
@@ -118,7 +108,6 @@
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.OPAQUE));
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.VERTICAL));
         assertTrue(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.HORIZONTAL));
-
         bar.setFocusable(false);
         assertEquals(1, accJScrollBar.getAccessibleStateSet().toArray().length);
         assertFalse(accJScrollBar.getAccessibleStateSet().contains(AccessibleState.ENABLED));
@@ -130,16 +119,14 @@
     }
 
     public void testGetOrientation() throws Exception {
-        assertEquals(JToolBar.VERTICAL, bar.getOrientation());
-        bar.setOrientation(JToolBar.HORIZONTAL);
-        assertEquals(JToolBar.HORIZONTAL, bar.getOrientation());
-
+        assertEquals(SwingConstants.VERTICAL, bar.getOrientation());
+        bar.setOrientation(SwingConstants.HORIZONTAL);
+        assertEquals(SwingConstants.HORIZONTAL, bar.getOrientation());
         try {
             bar.setOrientation(200);
             fail("illegal argument exception shal be thrown");
         } catch (IllegalArgumentException e) {
         }
-
         assertEquals(1, testList.size());
     }
 
@@ -152,7 +139,6 @@
         bar.setValue(180);
         assertEquals(90, bar.getValue());
         assertEquals(bar.getModel().getValue(), bar.getValue());
-
         assertEquals(0, testList.size());
     }
 
@@ -168,7 +154,6 @@
         bar.setMinimum(200);
         assertEquals(200, bar.getMinimum());
         assertEquals(200, bar.getModel().getMinimum());
-
         assertEquals(0, testList.size());
     }
 
@@ -178,7 +163,6 @@
         bar.setMaximum(200);
         assertEquals(200, bar.getMaximum());
         assertEquals(200, bar.getModel().getMaximum());
-
         assertEquals(0, testList.size());
     }
 
@@ -186,57 +170,45 @@
         assertFalse(bar.getValueIsAdjusting());
         bar.setValueIsAdjusting(true);
         assertTrue(bar.getValueIsAdjusting());
-
         assertEquals(0, testList.size());
     }
 
     public void testGetUnitIncrement() throws Exception {
         assertEquals(1, bar.getUnitIncrement());
-
         propertyChangeController = new PropertyChangeController();
         bar.addPropertyChangeListener(propertyChangeController);
         bar.setUnitIncrement(23);
         assertEquals(23, bar.getUnitIncrement());
         assertTrue(propertyChangeController.isChanged("unitIncrement"));
-
         propertyChangeController.reset();
         bar.setUnitIncrement(23);
         assertFalse(propertyChangeController.isChanged("unitIncrement"));
-
         assertEquals(23, bar.getUnitIncrement(-1));
         assertEquals(23, bar.getUnitIncrement(1));
-
         assertEquals(23, bar.getUnitIncrement(-134));
     }
 
     public void testGetBlockIncrement() throws Exception {
         assertEquals(10, bar.getBlockIncrement());
-        bar = new JScrollBar(JScrollBar.VERTICAL, 0, 32, 0, 150);
+        bar = new JScrollBar(Adjustable.VERTICAL, 0, 32, 0, 150);
         assertEquals(32, bar.getBlockIncrement());
         assertEquals(bar.getModel().getExtent(), bar.getBlockIncrement());
-
         propertyChangeController = new PropertyChangeController();
         bar.addPropertyChangeListener(propertyChangeController);
         bar.setBlockIncrement(40);
         assertTrue(propertyChangeController.isChanged("blockIncrement"));
-
         propertyChangeController.reset();
         bar.setBlockIncrement(40);
         assertFalse(propertyChangeController.isChanged("blockIncrement"));
-
         assertEquals(40, bar.getBlockIncrement());
         assertEquals(32, bar.getModel().getExtent());
-
         bar.setValues(0, 50, 0, 200);
         assertEquals(40, bar.getBlockIncrement());
         assertEquals(50, bar.getModel().getExtent());
-
         assertEquals(0, testList.size());
-
         assertEquals(40, bar.getBlockIncrement(1));
         assertEquals(40, bar.getBlockIncrement(-1));
         assertEquals(40, bar.getBlockIncrement(241));
-
     }
 
     public void testGetVisibleAmount() throws Exception {
@@ -244,18 +216,16 @@
         bar.setVisibleAmount(20);
         assertEquals(20, bar.getVisibleAmount());
         assertEquals(20, bar.getModel().getExtent());
-
         assertEquals(0, testList.size());
     }
 
     public void testAdjustmentListener() throws Exception {
-        final List test = new Vector();
+        final List<String> test = new Vector<String>();
         bar.addAdjustmentListener(new AdjustmentListener() {
             public void adjustmentValueChanged(final AdjustmentEvent e) {
                 test.add("1");
             }
         });
-
         assertEquals(0, test.size());
         bar.setValue(300);
         assertEquals(1, test.size());



Mime
View raw message