harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [14/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/JListTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JListTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JListTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JListTest.java Sat Nov 25 16:04:10 2006
@@ -34,7 +34,6 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Vector;
-
 import javax.swing.event.ListDataListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -43,18 +42,23 @@
 
 public class JListTest extends SwingTestCase {
     private JList list;
+
     private TestPropertyChangeListener changeListener;
-    private JFrame frame;
 
+    private JFrame frame;
 
     public JListTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-        list = new JList(new Object[] {"a", "b", "c"});
+        list = new JList(new Object[] { "a", "b", "c" });
         list.setCellRenderer(new DefaultListCellRenderer() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public FontMetrics getFontMetrics(Font f) {
                 return JListTest.this.getFontMetrics(f, 10, 10);
             }
@@ -64,6 +68,7 @@
         frame = new JFrame();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         list = null;
         changeListener = null;
@@ -77,7 +82,6 @@
         assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
         assertNotNull(list.getUI());
         assertTrue(list.isOpaque());
-
         ListModel testModel = new ListModel() {
             public void addListDataListener(final ListDataListener l) {
             }
@@ -97,13 +101,11 @@
         assertEquals(testModel, list.getModel());
         assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
         assertNotNull(list.getUI());
-
-        list = new JList(new Object[] {"a", "b"});
+        list = new JList(new Object[] { "a", "b" });
         assertNotNull(list.getModel());
         assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
         assertNotNull(list.getUI());
-
-        list = new JList(new Vector());
+        list = new JList(new Vector<Object>());
         assertNotNull(list.getModel());
         assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
         assertNotNull(list.getUI());
@@ -111,13 +113,11 @@
 
     public void testAddGetRemoveListSelectionListener() throws Exception {
         assertEquals(0, list.getListSelectionListeners().length);
-
         TestListSelectionListener l = new TestListSelectionListener();
         list.addListSelectionListener(l);
         list.addListSelectionListener(new TestListSelectionListener());
         list.addListSelectionListener(new TestListSelectionListener());
         assertEquals(3, list.getListSelectionListeners().length);
-
         list.removeListSelectionListener(l);
         assertEquals(2, list.getListSelectionListeners().length);
     }
@@ -125,34 +125,29 @@
     public void testAddSelectionInterval() throws Exception {
         assertTrue(list.isSelectionEmpty());
         assertTrue(list.getSelectionModel().isSelectionEmpty());
-
         list.addSelectionInterval(1, 2);
         assertFalse(list.isSelectionEmpty());
         assertFalse(list.getSelectionModel().isSelectionEmpty());
-
         try {
             // Regression for HARMONY-1965
             list.addSelectionInterval(1, -2);
             fail("IndexOutOfBoundsException expected.");
         } catch (IndexOutOfBoundsException e) {
         }
-
         try {
             // Regression for HARMONY-1965
             list.addSelectionInterval(-2, 2);
             fail("IndexOutOfBoundsException expected.");
-        } catch (IndexOutOfBoundsException e) {            
+        } catch (IndexOutOfBoundsException e) {
         }
     }
 
     public void testClearSelection() throws Exception {
         assertTrue(list.isSelectionEmpty());
         assertTrue(list.getSelectionModel().isSelectionEmpty());
-
         list.setSelectedIndex(1);
         assertFalse(list.isSelectionEmpty());
         assertFalse(list.getSelectionModel().isSelectionEmpty());
-
         list.clearSelection();
         assertTrue(list.isSelectionEmpty());
         assertTrue(list.getSelectionModel().isSelectionEmpty());
@@ -164,19 +159,17 @@
 
     public void testEnsureIndexIsVisible() throws Exception {
         JScrollPane scroller = insertListToFrame();
+        assertNotNull(scroller);
         Rectangle bounds = list.getCellBounds(1, 1);
         assertFalse(list.getVisibleRect().contains(bounds));
-
         list.ensureIndexIsVisible(1);
         assertTrue(list.getVisibleRect().contains(bounds));
-        
-        list  = new JList();
+        list = new JList();
         assertEquals(0, list.getModel().getSize());
         list.ensureIndexIsVisible(0);
         list.ensureIndexIsVisible(10);
         list.ensureIndexIsVisible(-10);
-        
-        list.setListData(new String[] {"1", "2"});
+        list.setListData(new String[] { "1", "2" });
         list.ensureIndexIsVisible(0);
         list.ensureIndexIsVisible(10);
         list.ensureIndexIsVisible(-10);
@@ -186,36 +179,29 @@
         TestListSelectionListener l1 = new TestListSelectionListener();
         TestListSelectionListener l2 = new TestListSelectionListener();
         TestListSelectionListener l3 = new TestListSelectionListener();
-
         TestList list = new TestList();
         list.addListSelectionListener(l1);
         list.addListSelectionListener(l2);
         list.getSelectionModel().addListSelectionListener(l3);
-
         list.fireSelectionValueChanged(2, 5, true);
         assertNotNull(l1.getEvent());
         assertNotNull(l2.getEvent());
         assertNull(l3.getEvent());
-
         assertEquals(2, l1.getEvent().getFirstIndex());
         assertEquals(5, l1.getEvent().getLastIndex());
         assertTrue(l1.getEvent().getValueIsAdjusting());
-
         if (isHarmony()) {
             l1.reset();
             l2.reset();
             l3.reset();
-
             list.setSelectedIndex(1);
             assertNotNull(l1.getEvent());
             assertNotNull(l2.getEvent());
             assertNotNull(l3.getEvent());
-
             assertEquals(list, l1.getEvent().getSource());
             assertEquals(1, l1.getEvent().getFirstIndex());
             assertEquals(1, l1.getEvent().getLastIndex());
             assertFalse(l1.getEvent().getValueIsAdjusting());
-
             assertEquals(list.getSelectionModel(), l3.getEvent().getSource());
             assertEquals(1, l3.getEvent().getFirstIndex());
             assertEquals(1, l3.getEvent().getLastIndex());
@@ -235,37 +221,38 @@
 
     public void testGetCellBounds() throws Exception {
         list.setUI(new ListUI() {
+            @Override
             public Point indexToLocation(final JList arg0, final int arg1) {
                 return null;
             }
 
+            @Override
             public int locationToIndex(final JList arg0, final Point arg1) {
                 return 0;
             }
 
+            @Override
             public Rectangle getCellBounds(final JList arg0, final int arg1, final int arg2) {
                 return new Rectangle(10, 20, 30, 40);
             }
         });
-
         assertEquals(new Rectangle(10, 20, 30, 40), list.getCellBounds(0, 0));
     }
 
     public void testGetSetCellRenderer() throws Exception {
         assertTrue(list.getCellRenderer() instanceof DefaultListCellRenderer);
         ListCellRenderer testRenderer = new ListCellRenderer() {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
+            public Component getListCellRendererComponent(final JList list, final Object value,
+                    final int index, final boolean isSelected, final boolean cellHasFocus) {
                 return null;
             }
         };
-
         list.setCellRenderer(testRenderer);
         assertEquals(testRenderer, list.getCellRenderer());
     }
 
     public void testGetSetDragEnabled() throws Exception {
         assertFalse(list.getDragEnabled());
-
         list.setDragEnabled(true);
         assertTrue(list.getDragEnabled());
     }
@@ -273,15 +260,14 @@
     public void testGetFirstVisibleIndex() throws Exception {
         JScrollPane scroller = insertListToFrame();
         Rectangle bounds = list.getCellBounds(1, 1);
+        assertNotNull(bounds);
         assertEquals(0, list.getFirstVisibleIndex());
-
         scroller.getVerticalScrollBar().setValue(scroller.getVerticalScrollBar().getMaximum());
         assertEquals(1, list.getFirstVisibleIndex());
     }
 
     public void testGetSetFixedCellHeight() throws Exception {
         assertEquals(-1, list.getFixedCellHeight());
-
         list.setFixedCellHeight(10);
         assertEquals(10, list.getFixedCellHeight());
         assertTrue(changeListener.isChanged("fixedCellHeight"));
@@ -289,7 +275,6 @@
 
     public void testGetSetFixedCellWidth() throws Exception {
         assertEquals(-1, list.getFixedCellWidth());
-
         list.setFixedCellWidth(10);
         assertEquals(10, list.getFixedCellWidth());
         assertTrue(changeListener.isChanged("fixedCellWidth"));
@@ -298,23 +283,21 @@
     public void testGetLastVisibleIndex() throws Exception {
         JScrollPane scroller = insertListToFrame();
         Rectangle bounds = list.getCellBounds(1, 1);
+        assertNotNull(bounds);
         assertEquals(1, list.getLastVisibleIndex());
-
         scroller.getVerticalScrollBar().setValue(scroller.getVerticalScrollBar().getMaximum());
         assertEquals(2, list.getLastVisibleIndex());
     }
 
     public void testGetSetLayoutOrientation() throws Exception {
         assertEquals(JList.VERTICAL, list.getLayoutOrientation());
-
         list.setLayoutOrientation(JList.VERTICAL_WRAP);
         assertEquals(JList.VERTICAL_WRAP, list.getLayoutOrientation());
         assertTrue(changeListener.isChanged("layoutOrientation"));
-
         list.setLayoutOrientation(JList.HORIZONTAL_WRAP);
         assertEquals(JList.HORIZONTAL_WRAP, list.getLayoutOrientation());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.setLayoutOrientation(10);
             }
@@ -341,7 +324,6 @@
 
     public void testGetSetModel() throws Exception {
         assertNotNull(list.getModel());
-
         ListModel m = new DefaultListModel();
         list.setModel(m);
         assertEquals(m, list.getModel());
@@ -349,8 +331,7 @@
     }
 
     public void testGetNextMatch() throws Exception {
-        list = new JList(new Object[] {"a1", "b1", "c1", "a2", "B2", "c2"});
-
+        list = new JList(new Object[] { "a1", "b1", "c1", "a2", "B2", "c2" });
         assertEquals(0, list.getNextMatch("a", 0, Position.Bias.Forward));
         assertEquals(3, list.getNextMatch("a", 1, Position.Bias.Forward));
         assertEquals(0, list.getNextMatch("a", 4, Position.Bias.Forward));
@@ -359,18 +340,20 @@
         assertEquals(4, list.getNextMatch("b", 5, Position.Bias.Backward));
         assertEquals(5, list.getNextMatch("c", 1, Position.Bias.Backward));
         assertEquals(-1, list.getNextMatch("d", 1, Position.Bias.Backward));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getNextMatch("a", -1, Position.Bias.Forward);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getNextMatch("a", 10, Position.Bias.Forward);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getNextMatch(null, 1, Position.Bias.Forward);
             }
@@ -381,62 +364,60 @@
         list.setFixedCellHeight(10);
         list.setFixedCellWidth(100);
         list.setVisibleRowCount(5);
-
         assertEquals(new Dimension(100, 50), list.getPreferredScrollableViewportSize());
-
         list.setFixedCellWidth(-1);
-        list.setListData(new Object[] {"a", "bbb", "cc"});
-        int expectedWidth = list.getCellRenderer().getListCellRendererComponent(list, "bbb", 1, false, false).getPreferredSize().width;
-        assertEquals(new Dimension(expectedWidth, 50), list.getPreferredScrollableViewportSize());
-
+        list.setListData(new Object[] { "a", "bbb", "cc" });
+        int expectedWidth = list.getCellRenderer().getListCellRendererComponent(list, "bbb", 1,
+                false, false).getPreferredSize().width;
+        assertEquals(new Dimension(expectedWidth, 50), list
+                .getPreferredScrollableViewportSize());
         list.setFixedCellHeight(-1);
-        int expectedHeight = list.getCellRenderer().getListCellRendererComponent(list, "bbb", 1, false, false).getPreferredSize().height * 5;
-        assertEquals(new Dimension(expectedWidth, expectedHeight), list.getPreferredScrollableViewportSize());
-
+        int expectedHeight = list.getCellRenderer().getListCellRendererComponent(list, "bbb",
+                1, false, false).getPreferredSize().height * 5;
+        assertEquals(new Dimension(expectedWidth, expectedHeight), list
+                .getPreferredScrollableViewportSize());
         list.setListData(new Object[] {});
         assertEquals(new Dimension(256, 16 * 5), list.getPreferredScrollableViewportSize());
     }
 
     public void testGetSetPrototypeCellValue() throws Exception {
         assertNull(list.getPrototypeCellValue());
-
         list.setFixedCellHeight(1);
         list.setFixedCellWidth(1);
-
         changeListener.reset();
         list.setPrototypeCellValue("abcdef");
         assertEquals("abcdef", list.getPrototypeCellValue());
         assertTrue(changeListener.isChanged("prototypeCellValue"));
         assertEquals(1, changeListener.getNumberOfChanges());
-
         assertTrue(list.getFixedCellHeight() > 10);
         assertTrue(list.getFixedCellWidth() > 10);
     }
 
     //TODO
     public void testGetScrollableBlockIncrement() throws Exception {
-        list.setListData(new Object[] {"a", "b", "c", "d", "e", "f", "g", "h"});
+        list.setListData(new Object[] { "a", "b", "c", "d", "e", "f", "g", "h" });
         JScrollPane scroller = insertListToFrame(50);
         int lastVisibleIndex = list.getLastVisibleIndex();
         assertEquals(3, lastVisibleIndex);
         int rowHeight = list.getCellBounds(lastVisibleIndex, lastVisibleIndex).height;
-        assertEquals(rowHeight * lastVisibleIndex, list.getScrollableBlockIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, 1));
-        scroller.getVerticalScrollBar().setValue(scroller.getVerticalScrollBar().getValue() + rowHeight * 2);
+        assertEquals(rowHeight * lastVisibleIndex, list.getScrollableBlockIncrement(list
+                .getVisibleRect(), SwingConstants.VERTICAL, 1));
+        scroller.getVerticalScrollBar().setValue(
+                scroller.getVerticalScrollBar().getValue() + rowHeight * 2);
         assertEquals(2, list.getFirstVisibleIndex());
-
-//        scroller.getVerticalScrollBar().setValue(columnWidth * 3);
-//        assertEquals(3, list.getFirstVisibleIndex());
-//        assertEquals(columnWidth * 2, list.getScrollableBlockIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, -1));
-//        scroller.getVerticalScrollBar().setValue(scroller.getVerticalScrollBar().getValue() - columnWidth * 2);
-//        assertEquals(1, list.getFirstVisibleIndex());
-
-
+        //        scroller.getVerticalScrollBar().setValue(columnWidth * 3);
+        //        assertEquals(3, list.getFirstVisibleIndex());
+        //        assertEquals(columnWidth * 2, list.getScrollableBlockIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, -1));
+        //        scroller.getVerticalScrollBar().setValue(scroller.getVerticalScrollBar().getValue() - columnWidth * 2);
+        //        assertEquals(1, list.getFirstVisibleIndex());
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getScrollableBlockIncrement(null, SwingConstants.VERTICAL, 1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getScrollableBlockIncrement(list.getVisibleRect(), 10, 1);
             }
@@ -445,14 +426,13 @@
 
     public void testGetScrollableTracksViewportHeight() throws Exception {
         JScrollPane scroller = insertListToFrame();
+        assertNotNull(scroller);
         list.setPreferredSize(new Dimension(1000, 10));
         assertTrue(list.getScrollableTracksViewportHeight());
         list.setPreferredSize(new Dimension(1000, 1000));
         assertFalse(list.getScrollableTracksViewportHeight());
-
         list.setLayoutOrientation(JList.VERTICAL_WRAP);
         assertFalse(list.getScrollableTracksViewportHeight());
-
         list.setVisibleRowCount(0);
         assertTrue(list.getScrollableTracksViewportHeight());
         list.setVisibleRowCount(-1);
@@ -461,14 +441,13 @@
 
     public void testGetScrollableTracksViewportWidth() throws Exception {
         JScrollPane scroller = insertListToFrame();
+        assertNotNull(scroller);
         list.setPreferredSize(new Dimension(10, 1000));
         assertTrue(list.getScrollableTracksViewportWidth());
         list.setPreferredSize(new Dimension(1000, 1000));
         assertFalse(list.getScrollableTracksViewportWidth());
-
         list.setLayoutOrientation(JList.HORIZONTAL_WRAP);
         assertFalse(list.getScrollableTracksViewportWidth());
-
         list.setVisibleRowCount(0);
         assertTrue(list.getScrollableTracksViewportWidth());
         list.setVisibleRowCount(-1);
@@ -479,39 +458,47 @@
         JScrollPane scroller = insertListToFrame();
         assertEquals(0, list.getFirstVisibleIndex());
         int rowHeight = list.getCellBounds(0, 0).height;
-
-        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, 1));
-        assertEquals(0, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, -1));
+        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, 1));
+        assertEquals(0, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, -1));
         scroller.getVerticalScrollBar().setValue(5);
-        assertEquals(rowHeight - 5, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, 1));
-        assertEquals(5, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, -1));
-
+        assertEquals(rowHeight - 5, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, 1));
+        assertEquals(5, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, -1));
         scroller.getVerticalScrollBar().setValue(rowHeight);
-        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, 1));
-        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.VERTICAL, -1));
-
-        assertEquals(list.getFont().getSize(), list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, 1));
-        assertEquals(list.getFont().getSize(), list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, -1));
-
+        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, 1));
+        assertEquals(rowHeight, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.VERTICAL, -1));
+        assertEquals(list.getFont().getSize(), list.getScrollableUnitIncrement(list
+                .getVisibleRect(), SwingConstants.HORIZONTAL, 1));
+        assertEquals(list.getFont().getSize(), list.getScrollableUnitIncrement(list
+                .getVisibleRect(), SwingConstants.HORIZONTAL, -1));
         list.setFont(list.getFont().deriveFont(100f));
-        assertEquals(100, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, 1));
-        assertEquals(100, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, -1));
-
+        assertEquals(100, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.HORIZONTAL, 1));
+        assertEquals(100, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.HORIZONTAL, -1));
         frame.setFont(null);
         frame.getContentPane().setFont(null);
         scroller.setFont(null);
         scroller.getViewport().setFont(null);
         list.setFont(null);
         assertNull(list.getFont());
-        assertEquals(1, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, 1));
-        assertEquals(1, list.getScrollableUnitIncrement(list.getVisibleRect(), SwingConstants.HORIZONTAL, -1));
-
+        assertEquals(1, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.HORIZONTAL, 1));
+        assertEquals(1, list.getScrollableUnitIncrement(list.getVisibleRect(),
+                SwingConstants.HORIZONTAL, -1));
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getScrollableUnitIncrement(null, SwingConstants.VERTICAL, 1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() {
                 list.getScrollableUnitIncrement(list.getVisibleRect(), 10, 1);
             }
@@ -520,19 +507,16 @@
 
     public void testGetSetSelectedIndex() throws Exception {
         assertEquals(-1, list.getSelectedIndex());
-
         list.setSelectedIndex(2);
         assertEquals(2, list.getSelectedIndex());
         assertTrue(list.getSelectionModel().isSelectedIndex(2));
-
         list.clearSelection();
         assertEquals(-1, list.getSelectedIndex());
     }
 
     public void testGetSetSelectedIndices() throws Exception {
         assertEquals(0, list.getSelectedIndices().length);
-
-        list.setSelectedIndices(new int[] {0, 2});
+        list.setSelectedIndices(new int[] { 0, 2 });
         assertEquals(2, list.getSelectedIndices().length);
         assertEquals(0, list.getSelectedIndices()[0]);
         assertEquals(2, list.getSelectedIndices()[1]);
@@ -543,30 +527,25 @@
 
     public void testGetSetSelectedValue() throws Exception {
         assertNull(list.getSelectedValue());
-
         list.setSelectedIndex(1);
         assertEquals("b", list.getSelectedValue());
-
         list.setSelectedValue("c", true);
         assertEquals("c", list.getSelectedValue());
         assertEquals(2, list.getSelectedIndex());
         assertEquals(1, list.getSelectedIndices().length);
         assertEquals(2, list.getSelectedIndices()[0]);
-
         list.setSelectedValue("d", true);
         assertEquals("c", list.getSelectedValue());
     }
 
     public void testGetSelectedValues() throws Exception {
         assertEquals(0, list.getSelectedValues().length);
-
         list.setSelectedIndex(1);
         assertEquals(1, list.getSelectedValues().length);
         list.addSelectionInterval(1, 2);
         assertEquals(2, list.getSelectedValues().length);
         assertEquals("b", list.getSelectedValues()[0]);
         assertEquals("c", list.getSelectedValues()[1]);
-
         list.setSelectedValue("a", true);
         assertEquals(1, list.getSelectedValues().length);
         assertEquals("a", list.getSelectedValues()[0]);
@@ -574,7 +553,6 @@
 
     public void testGetSetSelectionBackground() throws Exception {
         assertNotNull(list.getSelectionBackground());
-
         list.setSelectionBackground(Color.red);
         assertEquals(Color.red, list.getSelectionBackground());
         assertTrue(changeListener.isChanged("selectionBackground"));
@@ -582,7 +560,6 @@
 
     public void testGetSetSelectionForeground() throws Exception {
         assertNotNull(list.getSelectionForeground());
-
         list.setSelectionForeground(Color.red);
         assertEquals(Color.red, list.getSelectionForeground());
         assertTrue(changeListener.isChanged("selectionForeground"));
@@ -590,62 +567,64 @@
 
     public void testGetSetSelectionMode() throws Exception {
         assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, list.getSelectionMode());
-
         list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         assertEquals(ListSelectionModel.SINGLE_SELECTION, list.getSelectionMode());
-        assertEquals(ListSelectionModel.SINGLE_SELECTION, list.getSelectionModel().getSelectionMode());
+        assertEquals(ListSelectionModel.SINGLE_SELECTION, list.getSelectionModel()
+                .getSelectionMode());
     }
 
     public void testGetSetSelectionModel() throws Exception {
         assertTrue(list.getSelectionModel() instanceof DefaultListSelectionModel);
-
         ListSelectionModel model = new DefaultListSelectionModel();
         list.setSelectionModel(model);
         assertEquals(model, list.getSelectionModel());
-
         assertTrue(changeListener.isChanged("selectionModel"));
     }
 
     public void testGetToolTipText() throws Exception {
         insertListToFrame();
         assertNull(list.getToolTipText());
-
         list.setToolTipText("list tooltip");
         assertEquals("list tooltip", list.getToolTipText());
-        assertEquals("list tooltip", list.getToolTipText(new MouseEvent(list, MouseEvent.MOUSE_ENTERED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0, false)));
-
+        assertEquals("list tooltip", list.getToolTipText(new MouseEvent(list,
+                MouseEvent.MOUSE_ENTERED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0,
+                false)));
         list.setCellRenderer(new DefaultListCellRenderer() {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
-                JLabel result = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-                result.setToolTipText("item tooltip");
+            private static final long serialVersionUID = 1L;
 
+            @Override
+            public Component getListCellRendererComponent(final JList list, final Object value,
+                    final int index, final boolean isSelected, final boolean cellHasFocus) {
+                JLabel result = (JLabel) super.getListCellRendererComponent(list, value, index,
+                        isSelected, cellHasFocus);
+                result.setToolTipText("item tooltip");
                 return result;
             }
         });
-        assertEquals("item tooltip", list.getToolTipText(new MouseEvent(list, MouseEvent.MOUSE_ENTERED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0, false)));
+        assertEquals("item tooltip", list.getToolTipText(new MouseEvent(list,
+                MouseEvent.MOUSE_ENTERED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0,
+                false)));
     }
 
-
     public void testGetSetUpdateUI() throws Exception {
-        assertTrue(list.getUI() instanceof ListUI);
-
         ListUI ui = new ListUI() {
+            @Override
             public Point indexToLocation(final JList arg0, final int arg1) {
                 return null;
             }
 
+            @Override
             public int locationToIndex(final JList arg0, final Point arg1) {
                 return 0;
             }
 
+            @Override
             public Rectangle getCellBounds(final JList arg0, final int arg1, final int arg2) {
                 return null;
             }
         };
-
         list.setUI(ui);
         assertEquals(ui, list.getUI());
-
         list.updateUI();
         assertNotSame(ui, list.getUI());
     }
@@ -656,7 +635,6 @@
 
     public void testGetSetValueIsAdjusting() throws Exception {
         assertFalse(list.getValueIsAdjusting());
-
         list.setValueIsAdjusting(true);
         assertTrue(list.getValueIsAdjusting());
         assertTrue(list.getSelectionModel().getValueIsAdjusting());
@@ -664,11 +642,9 @@
 
     public void testGetSetVisibleRowCount() throws Exception {
         assertEquals(8, list.getVisibleRowCount());
-
         list.setVisibleRowCount(10);
         assertEquals(10, list.getVisibleRowCount());
         assertTrue(changeListener.isChanged("visibleRowCount"));
-
         changeListener.reset();
         list.setVisibleRowCount(-2);
         assertEquals(0, list.getVisibleRowCount());
@@ -677,26 +653,27 @@
 
     public void testIndexToLocation() throws Exception {
         ListUI ui = new ListUI() {
+            @Override
             public Point indexToLocation(final JList arg0, final int arg1) {
                 return new Point(10, 20);
             }
 
+            @Override
             public int locationToIndex(final JList arg0, final Point arg1) {
                 return 0;
             }
 
+            @Override
             public Rectangle getCellBounds(final JList arg0, final int arg1, final int arg2) {
                 return null;
             }
         };
         list.setUI(ui);
-
         assertEquals(new Point(10, 20), list.indexToLocation(0));
     }
 
     public void testIsSelectedIndex() throws Exception {
         assertFalse(list.isSelectedIndex(0));
-
         list.setSelectedIndex(0);
         assertTrue(list.isSelectedIndex(0));
         assertTrue(list.getSelectionModel().isSelectedIndex(0));
@@ -704,7 +681,6 @@
 
     public void testIsSelectionEmpty() throws Exception {
         assertTrue(list.isSelectionEmpty());
-
         list.setSelectedIndex(1);
         assertFalse(list.isSelectionEmpty());
         assertFalse(list.getSelectionModel().isSelectionEmpty());
@@ -712,31 +688,31 @@
 
     public void testLocationToIndex() throws Exception {
         ListUI ui = new ListUI() {
+            @Override
             public Point indexToLocation(final JList arg0, final int arg1) {
                 return null;
             }
 
+            @Override
             public int locationToIndex(final JList arg0, final Point arg1) {
                 return 30;
             }
 
+            @Override
             public Rectangle getCellBounds(final JList arg0, final int arg1, final int arg2) {
                 return null;
             }
         };
         list.setUI(ui);
-
         assertEquals(30, list.locationToIndex(null));
     }
 
     public void testRemoveSelectionInterval() throws Exception {
         assertTrue(list.isSelectionEmpty());
         assertTrue(list.getSelectionModel().isSelectionEmpty());
-
         list.addSelectionInterval(0, 2);
         assertFalse(list.isSelectionEmpty());
         assertFalse(list.getSelectionModel().isSelectionEmpty());
-
         list.removeSelectionInterval(0, 1);
         assertFalse(list.isSelectedIndex(0));
         assertFalse(list.isSelectedIndex(1));
@@ -747,15 +723,13 @@
     public void testSetListData() throws Exception {
         ListModel model = list.getModel();
         assertEquals(3, model.getSize());
-
-        list.setListData(new Object[] {"1", "2"});
+        list.setListData(new Object[] { "1", "2" });
         assertTrue(changeListener.isChanged("model"));
         assertNotSame(model, list.getModel());
         assertEquals(2, list.getModel().getSize());
-
         model = list.getModel();
         changeListener.reset();
-        Vector data = new Vector();
+        Vector<String> data = new Vector<String>();
         data.add("x");
         data.add("y");
         data.add("z");
@@ -765,22 +739,22 @@
         assertEquals(3, list.getModel().getSize());
     }
 
-
     private JScrollPane insertListToFrame() {
         return insertListToFrame(25);
     }
 
     private JScrollPane insertListToFrame(final int preferredHeight) {
         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;
     }
 
@@ -801,7 +775,7 @@
     }
 
     private class TestPropertyChangeListener implements PropertyChangeListener {
-        private List changedNames = new ArrayList();
+        private List<String> changedNames = new ArrayList<String>();
 
         public void propertyChange(final PropertyChangeEvent event) {
             changedNames.add(event.getPropertyName());
@@ -823,21 +797,27 @@
             return changedNames.size();
         }
 
-        public List getAllChangedNames() {
+        public List<String> getAllChangedNames() {
             return changedNames;
         }
 
+        @Override
         public String toString() {
             return "Changed: " + changedNames;
         }
     }
 
     private class TestList extends JList {
+        private static final long serialVersionUID = 1L;
+
+        @Override
         public ListSelectionModel createSelectionModel() {
             return super.createSelectionModel();
         }
 
-        public void fireSelectionValueChanged(final int firstIndex, final int lastIndex, final boolean isAdjusting) {
+        @Override
+        public void fireSelectionValueChanged(final int firstIndex, final int lastIndex,
+                final boolean isAdjusting) {
             super.fireSelectionValueChanged(firstIndex, lastIndex, isAdjusting);
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuBarTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuBarTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuBarTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuBarTest.java Sat Nov 25 16:04:10 2006
@@ -15,27 +15,27 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 import java.awt.Insets;
-
 import javax.accessibility.AccessibleRole;
 import javax.swing.plaf.MenuBarUI;
 import javax.swing.plaf.basic.BasicMenuBarUI;
 import javax.swing.plaf.metal.MetalMenuBarUI;
 
 public class JMenuBarTest extends SwingTestCase {
-
     protected JMenuBar menuBar;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         menuBar = new JMenuBar();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         menuBar = null;
         super.tearDown();
@@ -58,11 +58,12 @@
      * Test method for 'javax.swing.JMenuBar.getAccessibleContext()'
      */
     public void testGetAccessibleContext() {
-        boolean assertedValue = (menuBar.getAccessibleContext() != null &&
-                menuBar.getAccessibleContext().getClass().getName().equals("javax.swing.JMenuBar$AccessibleJMenuBar"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.MENU_BAR, menuBar.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (menuBar.getAccessibleContext() != null && menuBar
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JMenuBar$AccessibleJMenuBar"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.MENU_BAR, menuBar.getAccessibleContext()
+                .getAccessibleRole());
     }
 
     /*
@@ -72,7 +73,6 @@
         JMenuItem item1 = new JMenuItem();
         JMenuItem item2 = new JMenuItem();
         JMenuItem item3 = new JMenuItem();
-
         menuBar.add(item1);
         menuBar.add(item2);
         assertEquals(0, menuBar.getComponentIndex(item1));
@@ -85,7 +85,6 @@
      */
     public void testProcessKeyBinding() {
         // TODO implement
-
     }
 
     /*
@@ -101,11 +100,9 @@
     public void testAddJMenu() {
         JMenu item1 = new JMenu();
         JMenu item2 = new JMenu();
-
         menuBar.add(item1);
         assertEquals(1, menuBar.getComponentCount());
         assertSame(item1, menuBar.getComponent(0));
-
         menuBar.add(item2);
         assertEquals(2, menuBar.getComponentCount());
         assertSame(item1, menuBar.getComponent(0));
@@ -125,14 +122,11 @@
     public void testGetMenu() {
         JMenu menu1 = new JMenu();
         JMenu menu2 = new JMenu();
-
         menuBar.add(menu1);
         assertEquals(menu1, menuBar.getMenu(0));
-
         menuBar.add(menu2);
         assertEquals(menu1, menuBar.getMenu(0));
         assertEquals(menu2, menuBar.getMenu(1));
-
         menuBar.add(new JButton());
         assertEquals(menu1, menuBar.getMenu(0));
         assertEquals(menu2, menuBar.getMenu(1));
@@ -165,29 +159,24 @@
         JMenu item3 = new JMenu();
         JMenu item4 = new JMenu();
         assertEquals(0, menuBar.getSubElements().length);
-
         menuBar.add(item1);
         assertEquals(1, menuBar.getSubElements().length);
         assertSame(item1, menuBar.getSubElements()[0]);
-
         menuBar.add(item2);
         menuBar.add(new JButton());
         assertEquals(2, menuBar.getSubElements().length);
         assertSame(item1, menuBar.getSubElements()[0]);
         assertSame(item2, menuBar.getSubElements()[1]);
-
         menuBar.add(item3);
         assertEquals(3, menuBar.getSubElements().length);
         assertSame(item1, menuBar.getSubElements()[0]);
         assertSame(item2, menuBar.getSubElements()[1]);
         assertSame(item3, menuBar.getSubElements()[2]);
-
         menuBar.add(new JButton());
         assertEquals(3, menuBar.getSubElements().length);
         assertSame(item1, menuBar.getSubElements()[0]);
         assertSame(item2, menuBar.getSubElements()[1]);
         assertSame(item3, menuBar.getSubElements()[2]);
-
         item3.add(item4);
         assertEquals(3, menuBar.getSubElements().length);
     }
@@ -199,24 +188,18 @@
         SingleSelectionModel selectionModel1 = new DefaultSingleSelectionModel();
         JMenu item1 = new JMenu();
         JMenuItem item2 = new JMenuItem();
-
         if (isHarmony()) {
             menuBar.setSelectionModel(null);
             assertFalse(menuBar.isSelected());
         }
-
         menuBar.setSelectionModel(selectionModel1);
         menuBar.add(item1);
         menuBar.add(item2);
-
         assertFalse(menuBar.isSelected());
-
         menuBar.setSelected(item1);
         assertTrue(menuBar.isSelected());
-
         menuBar.setSelected(item2);
         assertTrue(menuBar.isSelected());
-
         menuBar.setSelected(new JButton());
         assertFalse(menuBar.isSelected());
     }
@@ -228,17 +211,14 @@
         PropertyChangeController listener = new PropertyChangeController();
         menuBar.addPropertyChangeListener(listener);
         assertTrue(menuBar.isBorderPainted());
-
         menuBar.setBorderPainted(false);
         assertFalse(menuBar.isBorderPainted());
         listener.checkLastPropertyFired(menuBar, "borderPainted", Boolean.TRUE, Boolean.FALSE);
         listener.reset();
-
         menuBar.setBorderPainted(true);
         listener.checkLastPropertyFired(menuBar, "borderPainted", Boolean.FALSE, Boolean.TRUE);
         assertTrue(menuBar.isBorderPainted());
         listener.reset();
-
         menuBar.setBorderPainted(true);
         assertFalse(listener.isChanged("borderPainted"));
     }
@@ -250,11 +230,13 @@
         try {
             menuBar.setHelpMenu(new JMenu());
             fail("no exception has been thrown");
-        } catch (Error e) {}
+        } catch (Error e) {
+        }
         try {
             menuBar.getHelpMenu();
             fail("no exception has been thrown");
-        } catch (Error e) {}
+        } catch (Error e) {
+        }
     }
 
     /*
@@ -265,20 +247,16 @@
         menuBar.setMargin(defaultMargin);
         Insets margin1 = new Insets(1, 1, 1, 1);
         Insets margin2 = new Insets(2, 2, 2, 2);
-        PropertyChangeController listener1 =  new PropertyChangeController();
-
+        PropertyChangeController listener1 = new PropertyChangeController();
         menuBar.addPropertyChangeListener(listener1);
-
         menuBar.setMargin(margin1);
         assertSame(margin1, menuBar.getMargin());
         listener1.checkLastPropertyFired(menuBar, "margin", defaultMargin, margin1);
         listener1.reset();
-
         menuBar.setMargin(margin2);
         assertSame(margin2, menuBar.getMargin());
         listener1.checkLastPropertyFired(menuBar, "margin", margin1, margin2);
         listener1.reset();
-
         menuBar.setMargin(margin2);
         assertFalse(listener1.isChanged("margin"));
         listener1.reset();
@@ -289,21 +267,16 @@
      */
     public void testSetSelected() {
         SingleSelectionModel selectionModel1 = new DefaultSingleSelectionModel();
-        SingleSelectionModel selectionModel2 = new DefaultSingleSelectionModel();
         JMenu item1 = new JMenu();
         JMenuItem item2 = new JMenuItem();
-
         menuBar.setSelectionModel(null);
         menuBar.add(item1);
         menuBar.add(item2);
-
         menuBar.setSelectionModel(selectionModel1);
         menuBar.setSelected(item1);
         assertEquals("selection", 0, selectionModel1.getSelectedIndex());
-
         menuBar.setSelected(item2);
         assertEquals("selection", 1, selectionModel1.getSelectedIndex());
-
         menuBar.setSelected(new JButton());
         assertEquals("selection", -1, selectionModel1.getSelectedIndex());
     }
@@ -314,19 +287,17 @@
     public void testSetGetSelectionModel() {
         SingleSelectionModel selectionModel1 = new DefaultSingleSelectionModel();
         SingleSelectionModel selectionModel2 = new DefaultSingleSelectionModel();
-
         PropertyChangeController listener = new PropertyChangeController();
         menuBar.setSelectionModel(null);
         menuBar.addPropertyChangeListener(listener);
-
         menuBar.setSelectionModel(selectionModel1);
         assertEquals("selectionModel", selectionModel1, menuBar.getSelectionModel());
         listener.checkLastPropertyFired(menuBar, "selectionModel", null, selectionModel1);
         listener.reset();
-
         menuBar.setSelectionModel(selectionModel2);
         assertEquals("selectionModel", selectionModel2, menuBar.getSelectionModel());
-        listener.checkLastPropertyFired(menuBar, "selectionModel", selectionModel1, selectionModel2);
+        listener.checkLastPropertyFired(menuBar, "selectionModel", selectionModel1,
+                selectionModel2);
         listener.reset();
     }
 
@@ -344,10 +315,8 @@
         MenuBarUI ui1 = new BasicMenuBarUI();
         MenuBarUI ui2 = new MetalMenuBarUI();
         JMenuBar menuBar = new JMenuBar();
-
         menuBar.setUI(ui1);
         assertSame(ui1, menuBar.getUI());
-
         menuBar.setUI(ui2);
         assertSame(ui2, menuBar.getUI());
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuItemTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuItemTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuItemTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuItemTest.java Sat Nov 25 16:04:10 2006
@@ -15,34 +15,36 @@
  *  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 java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
 import java.util.EventListener;
-
 import javax.accessibility.AccessibleRole;
 import javax.swing.event.MenuDragMouseEvent;
 import javax.swing.event.MenuDragMouseListener;
 import javax.swing.event.MenuKeyEvent;
 import javax.swing.event.MenuKeyListener;
 
+@SuppressWarnings("serial")
 public class JMenuItemTest extends AbstractButtonTest {
-
     protected JMenuItem menuItem = null;
 
     class ConcreteMenuKeyListener implements MenuKeyListener {
         public Object event;
+
         public void menuKeyPressed(MenuKeyEvent e) {
             event = "pressed";
         }
+
         public void menuKeyReleased(MenuKeyEvent e) {
             event = "released";
         }
+
         public void menuKeyTyped(MenuKeyEvent e) {
             event = "typed";
         }
@@ -50,27 +52,32 @@
 
     class ConcreteMenuDragMouseListener implements MenuDragMouseListener {
         public Object event;
+
         public void menuDragMouseDragged(MenuDragMouseEvent e) {
             event = "dragged";
         }
+
         public void menuDragMouseEntered(MenuDragMouseEvent e) {
             event = "entered";
         }
+
         public void menuDragMouseExited(MenuDragMouseEvent e) {
             event = "exited";
         }
+
         public void menuDragMouseReleased(MenuDragMouseEvent e) {
             event = "released";
         }
     };
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         menuItem = new JMenuItem();
         button = menuItem;
     }
 
+    @Override
     protected void tearDown() throws Exception {
         menuItem = null;
         super.tearDown();
@@ -80,11 +87,12 @@
      * Test method for 'javax.swing.JMenuItem.getAccessibleContext()'
      */
     public void testGetAccessibleContext() {
-        boolean assertedValue = (menuItem.getAccessibleContext() != null &&
-                menuItem.getAccessibleContext().getClass().getName().equals("javax.swing.JMenuItem$AccessibleJMenuItem"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.MENU_ITEM, menuItem.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (menuItem.getAccessibleContext() != null && menuItem
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JMenuItem$AccessibleJMenuItem"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.MENU_ITEM, menuItem
+                .getAccessibleContext().getAccessibleRole());
     }
 
     /*
@@ -103,7 +111,6 @@
         assertEquals("text ", "", button.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertFalse(menuItem.isFocusable());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -121,7 +128,6 @@
         assertEquals("text ", "", menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertFalse(menuItem.isFocusable());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -138,7 +144,6 @@
         assertNull("icon ", menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertFalse(menuItem.isFocusable());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -152,8 +157,6 @@
         final String command = "dnammoc";
         final KeyStroke accelerator = KeyStroke.getKeyStroke('a');
         class MyAction extends AbstractAction {
-            public boolean performed = false;
-
             public MyAction(final String text, final Icon icon) {
                 super(text, icon);
                 putValue(Action.ACTION_COMMAND_KEY, command);
@@ -161,14 +164,13 @@
             }
 
             public void actionPerformed(final ActionEvent e) {
-                performed = true;
             }
-        };
+        }
+        ;
         Icon icon = createNewIcon();
         String text = "texttext";
         MyAction action = new MyAction(text, icon);
         menuItem = new JMenuItem(action);
-
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertEquals("action", action, menuItem.getAction());
@@ -177,10 +179,8 @@
         assertTrue("enabled ", menuItem.isEnabled());
         assertEquals("accelerator ", accelerator, menuItem.getAccelerator());
         assertFalse(menuItem.isFocusable());
-
         action.setEnabled(false);
         menuItem = new JMenuItem(action);
-
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertEquals("action", action, menuItem.getAction());
@@ -188,18 +188,15 @@
         assertFalse("selected ", menuItem.isSelected());
         assertFalse("enabled ", menuItem.isEnabled());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
-
-        menuItem = new JMenuItem((Action)null);
-
+        menuItem = new JMenuItem((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("menuItem model is of the proper type", menuItem.getModel() instanceof DefaultButtonModel);
-
+        assertTrue("menuItem model is of the proper type",
+                menuItem.getModel() instanceof DefaultButtonModel);
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -213,12 +210,12 @@
         Icon icon = createNewIcon();
         String text = "texttext";
         menuItem = new JMenuItem(text, icon);
-        assertTrue("menuItem model is of the proper type", menuItem.getModel() instanceof DefaultButtonModel);
+        assertTrue("menuItem model is of the proper type",
+                menuItem.getModel() instanceof DefaultButtonModel);
         assertEquals("icon ", icon, menuItem.getIcon());
         assertEquals("text ", text, menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertFalse(menuItem.isFocusable());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -232,13 +229,13 @@
         int mnemonic = 100;
         String text = "texttext";
         menuItem = new JMenuItem(text, mnemonic);
-        assertTrue("menuItem model is of the proper type", menuItem.getModel() instanceof DefaultButtonModel);
+        assertTrue("menuItem model is of the proper type",
+                menuItem.getModel() instanceof DefaultButtonModel);
         assertNull("icon ", menuItem.getIcon());
         assertEquals("mnemonic ", mnemonic, menuItem.getMnemonic());
         assertEquals("text ", text, menuItem.getText());
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
         assertFalse(menuItem.isFocusable());
-
         assertEquals(SwingConstants.LEADING, button.getHorizontalAlignment());
         assertEquals(SwingConstants.TRAILING, button.getHorizontalTextPosition());
         assertEquals(SwingConstants.CENTER, button.getVerticalAlignment());
@@ -249,17 +246,14 @@
      * Test method for 'javax.swing.JMenuItem.setArmed(boolean)'
      */
     public void testSetArmed() {
-        PropertyChangeController listener =  new PropertyChangeController();
-
+        PropertyChangeController listener = new PropertyChangeController();
         menuItem.setArmed(false);
         menuItem.addPropertyChangeListener(listener);
-
         menuItem.setArmed(true);
         assertFalse("event's not been fired ", listener.isChanged());
         assertTrue("armed", menuItem.isArmed());
         assertTrue("armed", menuItem.getModel().isArmed());
         listener.reset();
-
         menuItem.setArmed(false);
         assertFalse("event's not been fired ", listener.isChanged());
         assertFalse("armed", menuItem.isArmed());
@@ -278,25 +272,19 @@
      * Test method for 'javax.swing.JMenuItem.setAccelerator(KeyStroke)'
      */
     public void testSetAccelerator() {
-        PropertyChangeController listener =  new PropertyChangeController();
+        PropertyChangeController listener = new PropertyChangeController();
         KeyStroke accelerator1 = KeyStroke.getKeyStroke('a');
         KeyStroke accelerator2 = KeyStroke.getKeyStroke('b');
-
         menuItem.setAccelerator(null);
         menuItem.addPropertyChangeListener(listener);
-
         menuItem.setAccelerator(accelerator1);
-        listener.checkPropertyFired(menuItem, "accelerator",
-                                    null, accelerator1);
+        listener.checkPropertyFired(menuItem, "accelerator", null, accelerator1);
         assertEquals("accelerator", accelerator1, menuItem.getAccelerator());
         listener.reset();
-
         menuItem.setAccelerator(accelerator2);
-        listener.checkPropertyFired(menuItem, "accelerator",
-                                    accelerator1, accelerator2);
+        listener.checkPropertyFired(menuItem, "accelerator", accelerator1, accelerator2);
         assertEquals("accelerator", accelerator2, menuItem.getAccelerator());
         listener.reset();
-
         menuItem.setAccelerator(accelerator2);
         assertFalse("event's not been fired ", listener.isChanged());
     }
@@ -312,18 +300,16 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuDragMouseEntered(MenuDragMouseEvent)'
      */
     public void testFireMenuDragMouseEntered() {
-        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
-        MenuDragMouseEvent event2 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
+        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
+                new MenuElement[0], new MenuSelectionManager());
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener2);
-
         menuItem.fireMenuDragMouseEntered(event1);
         assertEquals("event fired properly ", "entered", listener1.event);
         assertEquals("event fired properly ", "entered", listener2.event);
         assertSame("one event fired ", listener1.event, listener2.event);
-
         menuItem.fireMenuDragMouseEntered(event1);
         assertEquals("event fired properly ", "entered", listener1.event);
         assertEquals("event fired properly ", "entered", listener2.event);
@@ -334,18 +320,16 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuDragMouseExited(MenuDragMouseEvent)'
      */
     public void testFireMenuDragMouseExited() {
-        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
-        MenuDragMouseEvent event2 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
+        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
+                new MenuElement[0], new MenuSelectionManager());
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener2);
-
         menuItem.fireMenuDragMouseExited(event1);
         assertEquals("event fired properly ", "exited", listener1.event);
         assertEquals("event fired properly ", "exited", listener2.event);
         assertSame("one event fired ", listener1.event, listener2.event);
-
         menuItem.fireMenuDragMouseExited(event1);
         assertEquals("event fired properly ", "exited", listener1.event);
         assertEquals("event fired properly ", "exited", listener2.event);
@@ -356,17 +340,15 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuDragMouseDragged(MenuDragMouseEvent)'
      */
     public void testFireMenuDragMouseDragged() {
-        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
-        MenuDragMouseEvent event2 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
+        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
+                new MenuElement[0], new MenuSelectionManager());
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener2);
-
         menuItem.fireMenuDragMouseDragged(event1);
         assertEquals("event fired properly ", "dragged", listener1.event);
         assertEquals("event fired properly ", "dragged", listener2.event);
-
         menuItem.fireMenuDragMouseDragged(event1);
         assertEquals("event fired properly ", "dragged", listener1.event);
         assertEquals("event fired properly ", "dragged", listener2.event);
@@ -376,17 +358,15 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuDragMouseReleased(MenuDragMouseEvent)'
      */
     public void testFireMenuDragMouseReleased() {
-        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
-        MenuDragMouseEvent event2 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false, new MenuElement[0], new MenuSelectionManager());
+        MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
+                new MenuElement[0], new MenuSelectionManager());
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener2);
-
         menuItem.fireMenuDragMouseReleased(event1);
         assertEquals("event fired properly ", "released", listener1.event);
         assertEquals("event fired properly ", "released", listener2.event);
-
         menuItem.fireMenuDragMouseReleased(event1);
         assertEquals("event fired properly ", "released", listener1.event);
         assertEquals("event fired properly ", "released", listener2.event);
@@ -396,17 +376,15 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuKeyPressed(MenuKeyEvent)'
      */
     public void testFireMenuKeyPressed() {
-        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0], new MenuSelectionManager());
-        MenuKeyEvent event2 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'b', new MenuElement[0], new MenuSelectionManager());
+        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0],
+                new MenuSelectionManager());
         ConcreteMenuKeyListener listener1 = new ConcreteMenuKeyListener();
         ConcreteMenuKeyListener listener2 = new ConcreteMenuKeyListener();
         menuItem.addMenuKeyListener(listener1);
         menuItem.addMenuKeyListener(listener2);
-
         menuItem.fireMenuKeyPressed(event1);
         assertEquals("event fired properly ", "pressed", listener1.event);
         assertEquals("event fired properly ", "pressed", listener2.event);
-
         menuItem.fireMenuKeyPressed(event1);
         assertEquals("event fired properly ", "pressed", listener1.event);
         assertEquals("event fired properly ", "pressed", listener2.event);
@@ -416,18 +394,16 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuKeyReleased(MenuKeyEvent)'
      */
     public void testFireMenuKeyReleased() {
-        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0], new MenuSelectionManager());
-        MenuKeyEvent event2 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'b', new MenuElement[0], new MenuSelectionManager());
+        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0],
+                new MenuSelectionManager());
         ConcreteMenuKeyListener listener1 = new ConcreteMenuKeyListener();
         ConcreteMenuKeyListener listener2 = new ConcreteMenuKeyListener();
         menuItem.addMenuKeyListener(listener1);
         menuItem.addMenuKeyListener(listener2);
-
         menuItem.fireMenuKeyReleased(event1);
         assertEquals("event fired properly ", "released", listener1.event);
         assertEquals("event fired properly ", "released", listener2.event);
         assertSame("one event fired ", listener1.event, listener2.event);
-
         menuItem.fireMenuKeyReleased(event1);
         assertEquals("event fired properly ", "released", listener1.event);
         assertEquals("event fired properly ", "released", listener2.event);
@@ -438,18 +414,16 @@
      * Test method for 'javax.swing.JMenuItem.fireMenuKeyTyped(MenuKeyEvent)'
      */
     public void testFireMenuKeyTyped() {
-        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0], new MenuSelectionManager());
-        MenuKeyEvent event2 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'b', new MenuElement[0], new MenuSelectionManager());
+        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, 0, 0, 0, 0, 'a', new MenuElement[0],
+                new MenuSelectionManager());
         ConcreteMenuKeyListener listener1 = new ConcreteMenuKeyListener();
         ConcreteMenuKeyListener listener2 = new ConcreteMenuKeyListener();
         menuItem.addMenuKeyListener(listener1);
         menuItem.addMenuKeyListener(listener2);
-
         menuItem.fireMenuKeyTyped(event1);
         assertEquals("event fired properly ", "typed", listener1.event);
         assertEquals("event fired properly ", "typed", listener2.event);
         assertSame("one event fired ", listener1.event, listener2.event);
-
         menuItem.fireMenuKeyTyped(event1);
         assertEquals("event fired properly ", "typed", listener1.event);
         assertEquals("event fired properly ", "typed", listener2.event);
@@ -463,30 +437,23 @@
         MenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         MenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
         MenuDragMouseListener listener3 = new ConcreteMenuDragMouseListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = menuItem.getMenuDragMouseListeners();
         int initialValue = listenersArray.length;
-
         menuItem.addMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener2);
         menuItem.addMenuDragMouseListener(listener2);
-
         listenersArray = menuItem.getMenuDragMouseListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         menuItem.removeMenuDragMouseListener(listener1);
         menuItem.addMenuDragMouseListener(listener3);
         menuItem.addMenuDragMouseListener(listener3);
         listenersArray = menuItem.getMenuDragMouseListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         menuItem.removeMenuDragMouseListener(listener3);
         menuItem.removeMenuDragMouseListener(listener3);
         listenersArray = menuItem.getMenuDragMouseListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         menuItem.removeMenuDragMouseListener(listener2);
         menuItem.removeMenuDragMouseListener(listener2);
         listenersArray = menuItem.getMenuDragMouseListeners();
@@ -500,30 +467,23 @@
         MenuKeyListener listener1 = new ConcreteMenuKeyListener();
         MenuKeyListener listener2 = new ConcreteMenuKeyListener();
         MenuKeyListener listener3 = new ConcreteMenuKeyListener();
-
         EventListener[] listenersArray = null;
-
         listenersArray = menuItem.getMenuKeyListeners();
         int initialValue = listenersArray.length;
-
         menuItem.addMenuKeyListener(listener1);
         menuItem.addMenuKeyListener(listener2);
         menuItem.addMenuKeyListener(listener2);
-
         listenersArray = menuItem.getMenuKeyListeners();
         assertEquals(initialValue + 3, listenersArray.length);
-
         menuItem.removeMenuKeyListener(listener1);
         menuItem.addMenuKeyListener(listener3);
         menuItem.addMenuKeyListener(listener3);
         listenersArray = menuItem.getMenuKeyListeners();
         assertEquals(initialValue + 4, listenersArray.length);
-
         menuItem.removeMenuKeyListener(listener3);
         menuItem.removeMenuKeyListener(listener3);
         listenersArray = menuItem.getMenuKeyListeners();
         assertEquals(initialValue + 2, listenersArray.length);
-
         menuItem.removeMenuKeyListener(listener2);
         menuItem.removeMenuKeyListener(listener2);
         listenersArray = menuItem.getMenuKeyListeners();
@@ -560,19 +520,18 @@
      */
     public void testProcessMenuKeyEvent() {
         final MenuSelectionManager menuSelectionManager = new MenuSelectionManager();
-        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, KeyEvent.KEY_PRESSED, 0, 0, 0, 'a', new MenuElement[0], menuSelectionManager);
-        MenuKeyEvent event2 = new MenuKeyEvent(menuItem, KeyEvent.KEY_RELEASED, 0, 0, 0, 'b', new MenuElement[0], menuSelectionManager);
-        MenuKeyEvent event3 = new MenuKeyEvent(menuItem, KeyEvent.KEY_TYPED, 0, 0, 0, 'c', new MenuElement[0], menuSelectionManager);
-
+        MenuKeyEvent event1 = new MenuKeyEvent(menuItem, KeyEvent.KEY_PRESSED, 0, 0, 0, 'a',
+                new MenuElement[0], menuSelectionManager);
+        MenuKeyEvent event2 = new MenuKeyEvent(menuItem, KeyEvent.KEY_RELEASED, 0, 0, 0, 'b',
+                new MenuElement[0], menuSelectionManager);
+        MenuKeyEvent event3 = new MenuKeyEvent(menuItem, KeyEvent.KEY_TYPED, 0, 0, 0, 'c',
+                new MenuElement[0], menuSelectionManager);
         ConcreteMenuKeyListener listener1 = new ConcreteMenuKeyListener();
         menuItem.addMenuKeyListener(listener1);
-
         menuItem.processMenuKeyEvent(event1);
         assertEquals("event fired properly ", "pressed", listener1.event);
-
         menuItem.processMenuKeyEvent(event2);
         assertEquals("event fired properly ", "released", listener1.event);
-
         menuItem.processMenuKeyEvent(event3);
         assertEquals("event fired properly ", "typed", listener1.event);
     }
@@ -585,16 +544,12 @@
         KeyEvent event1 = new KeyEvent(menuItem, KeyEvent.KEY_PRESSED, 0, 0, 0, 'a');
         KeyEvent event2 = new KeyEvent(menuItem, KeyEvent.KEY_RELEASED, 0, 0, 0, 'b');
         KeyEvent event3 = new KeyEvent(menuItem, KeyEvent.KEY_TYPED, 0, 0, 0, 'c');
-
         ConcreteMenuKeyListener listener1 = new ConcreteMenuKeyListener();
         menuItem.addMenuKeyListener(listener1);
-
         menuItem.processKeyEvent(event1, new MenuElement[0], menuSelectionManager);
         assertEquals("event fired properly ", "pressed", listener1.event);
-
         menuItem.processKeyEvent(event2, new MenuElement[] {}, menuSelectionManager);
         assertEquals("event fired properly ", "released", listener1.event);
-
         menuItem.processKeyEvent(event3, new MenuElement[] {}, menuSelectionManager);
         assertEquals("event fired properly ", "typed", listener1.event);
     }
@@ -604,33 +559,30 @@
      */
     public void testProcessMenuDragMouseEvent() {
         MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, MouseEvent.MOUSE_DRAGGED,
-                                                           0, 0, 10, 10, 1, true, new MenuElement[0], new MenuSelectionManager());
+                0, 0, 10, 10, 1, true, new MenuElement[0], new MenuSelectionManager());
         MenuDragMouseEvent event2 = new MenuDragMouseEvent(menuItem, MouseEvent.MOUSE_EXITED,
-                                                           0, 0, 10, 10, 1, true, new MenuElement[] {menuItem}, new MenuSelectionManager());
-        MenuDragMouseEvent event3 = new MenuDragMouseEvent(new JButton(), MouseEvent.MOUSE_ENTERED,
-                                                           0, 0, 10, 10, 1, true, new MenuElement[] {menuItem}, new MenuSelectionManager());
+                0, 0, 10, 10, 1, true, new MenuElement[] { menuItem },
+                new MenuSelectionManager());
+        MenuDragMouseEvent event3 = new MenuDragMouseEvent(new JButton(),
+                MouseEvent.MOUSE_ENTERED, 0, 0, 10, 10, 1, true,
+                new MenuElement[] { menuItem }, new MenuSelectionManager());
         MenuDragMouseEvent event4 = new MenuDragMouseEvent(menuItem, MouseEvent.MOUSE_RELEASED,
-                                                           0, MouseEvent.BUTTON1, 10, 10, 1, false, new MenuElement[] {}, new MenuSelectionManager());
+                0, MouseEvent.BUTTON1, 10, 10, 1, false, new MenuElement[] {},
+                new MenuSelectionManager());
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
-
         menuItem.processMenuDragMouseEvent(event2);
         assertEquals("exited", listener1.event);
-
         menuItem.processMenuDragMouseEvent(event1);
         assertEquals("dragged", listener1.event);
-
         menuItem.processMenuDragMouseEvent(event3);
         assertEquals("entered", listener1.event);
         listener1.event = null;
-
         menuItem.processMenuDragMouseEvent(event4);
         assertNull(listener1.event);
-
         menuItem.processMenuDragMouseEvent(event1);
         assertEquals("dragged", listener1.event);
         listener1.event = null;
-
         menuItem.processMenuDragMouseEvent(event4);
         assertEquals("released", listener1.event);
     }
@@ -639,52 +591,51 @@
      * Test method for 'javax.swing.JMenuItem.processMouseEvent(MouseEvent, MenuElement[], MenuSelectionManager)'
      */
     public void testProcessMouseEventMouseEventMenuElementArrayMenuSelectionManager() {
-        MouseEvent event1 = new MouseEvent(menuItem, MouseEvent.MOUSE_DRAGGED,
-                                                           0, 0, 10, 10, 1, true);
-        MouseEvent event2 = new MouseEvent(menuItem, MouseEvent.MOUSE_EXITED,
-                                                           0, 0, 10, 10, 1, true);
-        MouseEvent event3 = new MouseEvent(new JButton(), MouseEvent.MOUSE_ENTERED,
-                                                           0, 0, 10, 10, 1, true);
-        MouseEvent event4 = new MouseEvent(menuItem, MouseEvent.MOUSE_RELEASED,
-                                                           0, MouseEvent.BUTTON1, 10, 10, 1, false);
+        MouseEvent event1 = new MouseEvent(menuItem, MouseEvent.MOUSE_DRAGGED, 0, 0, 10, 10, 1,
+                true);
+        MouseEvent event2 = new MouseEvent(menuItem, MouseEvent.MOUSE_EXITED, 0, 0, 10, 10, 1,
+                true);
+        MouseEvent event3 = new MouseEvent(new JButton(), MouseEvent.MOUSE_ENTERED, 0, 0, 10,
+                10, 1, true);
+        MouseEvent event4 = new MouseEvent(menuItem, MouseEvent.MOUSE_RELEASED, 0,
+                MouseEvent.BUTTON1, 10, 10, 1, false);
         ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
         menuItem.addMenuDragMouseListener(listener1);
-
         menuItem.processMouseEvent(event2, new MenuElement[] {}, new MenuSelectionManager());
         assertEquals("exited", listener1.event);
-
         menuItem.processMouseEvent(event1, new MenuElement[] {}, new MenuSelectionManager());
         assertEquals("dragged", listener1.event);
-
         menuItem.processMouseEvent(event3, new MenuElement[] {}, new MenuSelectionManager());
         assertEquals("entered", listener1.event);
         listener1.event = null;
-
         menuItem.processMouseEvent(event4, new MenuElement[] {}, new MenuSelectionManager());
         assertNull(listener1.event);
-
         menuItem.processMouseEvent(event1, new MenuElement[] {}, new MenuSelectionManager());
         assertEquals("dragged", listener1.event);
         listener1.event = null;
-
         menuItem.processMouseEvent(event4, new MenuElement[] {}, new MenuSelectionManager());
         assertEquals("released", listener1.event);
     }
 
+    @Override
     public void testGetUI() {
         assertNotNull("ui is returned ", menuItem.getUI());
     }
 
+    @Override
     public void testIsFocusPainted() {
         assertFalse("default FocusPainted", menuItem.isFocusPainted());
     }
 
+    @Override
     public void testGetHorizontalAlignment() {
     }
 
+    @Override
     public void testConfigurePropertiesFromAction_ShortDescription() {
     }
 
+    @Override
     public void testConfigurePropertiesFromAction() {
         Icon icon1 = createNewIcon();
         Icon icon2 = createNewIcon();
@@ -706,7 +657,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());
@@ -714,14 +664,12 @@
         button.isEnabled();
         assertFalse("enabled ", button.isEnabled());
         assertFalse("enabled ", action1.isEnabled());
-
         assertEquals("icon ", icon1, button.getIcon());
         action1.putValue(Action.SMALL_ICON, icon2);
         assertEquals("icon ", icon2, button.getIcon());
         button.setIcon(icon2);
         action1.putValue(Action.SMALL_ICON, null);
         assertNull("icon ", button.getIcon());
-
         if (isHarmony()) {
             assertEquals("mnemonic ", 1, button.getMnemonic());
             action1.putValue(Action.MNEMONIC_KEY, new Integer(27));
@@ -729,17 +677,14 @@
             action1.putValue(Action.ACCELERATOR_KEY, ks1);
             assertEquals("accelerator ", ks1, menuItem.getAccelerator());
         }
-
         assertEquals("text ", text1, button.getText());
         action1.putValue(Action.NAME, text2);
         assertEquals("text ", text2, button.getText());
-
         if (isHarmony()) {
             assertEquals("ToolTipText ", text3, button.getToolTipText());
             action1.putValue(Action.SHORT_DESCRIPTION, text4);
             assertEquals("ToolTipText ", text4, button.getToolTipText());
         }
-
         action2.putValue(Action.ACCELERATOR_KEY, ks2);
         button.setAction(action2);
         action1.putValue(Action.SHORT_DESCRIPTION, text4);
@@ -749,7 +694,5 @@
             assertEquals("ToolTipText ", text4, button.getToolTipText());
             assertEquals("accelerator ", ks2, menuItem.getAccelerator());
         }
-
     }
-
 }



Mime
View raw message