harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [1/28] - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/
Date Sun, 26 Nov 2006 00:04:16 GMT
Author: ndbeyer
Date: Sat Nov 25 16:04:10 2006
New Revision: 479240

URL: http://svn.apache.org/viewvc?view=rev&rev=479240
Log:
Cleanup various compiler warnings in Swing module's tests

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractButtonTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractButton_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractListModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractSpinnerModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AccessibleJButtonTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AccessibleJComponentTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AccessibleJComponent_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ActionMapRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ActionMapTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BorderFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxLayoutRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxLayoutTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BoxTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_AccessibleBoxTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_FillerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_Filler_AccessibleBoxFillerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ButtonGroupTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/CellRendererPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ComponentInputMapTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultButtonModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultCellEditorTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultComboBoxModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultDesktopManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultFocusManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListCellRendererTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListSelectionModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultSingleSelectionModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ExtJTextArea.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/FocusManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/GrayFilterTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIconTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIcon_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InternalFrameFocusTraversalPolicyTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JButtonTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JCheckBoxMenuItemTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JCheckBoxTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JColorChooserTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComboBoxRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComboBoxTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponentTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponent_AddRemoveNotifyTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JComponent_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JDesktopPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JDialogTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JEditorPaneRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JEditorPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JEditorPane_AccessibleJEditorPaneHTMLTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JEditorPane_AccessibleJEditorPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JEditorPane_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFileChooserRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFileChooserTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFormattedTextFieldTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFormattedTextField_AbstractFormatterTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFormattedTextField_CommitActionRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFrameRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JFrameTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JInternalFrame$JDesktopIconTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JInternalFrameTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JInternalFrame_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLabelRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLabelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JLayeredPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JListRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JListTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuBarTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuItemTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JMenuTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JOptionPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPanelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPasswordFieldTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JPopupMenuTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JProgressBarTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonMenuItemTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRadioButtonTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JRootPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollBarTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSeparatorTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSliderTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSpinnerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSplitPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTableTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextAreaTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextArea_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextFieldTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextField_NotifyActionRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTextPaneTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToggleButtonModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToggleButtonTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToolBarTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToolBar_SeparatorRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToolBar_SeparatorTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JToolTipTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTreeTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_DynamicUtilTreeNodeTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTree_EmptySelectionModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JViewportTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JWindowTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/KeyStrokeTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LayoutFocusTraversalPolicyTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/LookAndFeelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/MenuSelectionManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/OverlayLayoutTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/PopupFactoryRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/PopupFactoryTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/PopupTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ProgressMonitorInputStreamTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ProgressMonitorTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/RepaintManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/RobotTestCase.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ScrollPaneLayoutTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SerializableTestCase.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SizeRequirementsTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SizeSequenceTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SortingFocusTraversalPolicyRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SortingFocusTraversalPolicyTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerDateModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerListModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpinnerNumberModelTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringLayoutTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SpringTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingWaitTestCase.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TestBundle.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TimerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerRTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TransferHandlerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIManagerTest.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ViewportLayoutTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionRTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionRTest.java
Sat Nov 25 16:04:10 2006
@@ -28,23 +28,25 @@
 import java.io.ObjectOutputStream;
 
 public class AbstractActionRTest extends SwingTestCase {
-
     protected AbstractAction action;
 
-    /*
-     * @see TestCase#setUp()
-     */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         action = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
 
             private void writeObject(final ObjectOutputStream outStream) throws IOException
{
             }
+
             private void readObject(final ObjectInputStream inStream) throws IOException,
-                                                                       ClassNotFoundException
 {
+                    ClassNotFoundException {
             }
+
+            @Override
             public Object clone() throws CloneNotSupportedException {
                 return super.clone();
             }
@@ -53,18 +55,24 @@
 
     public void testClone() throws CloneNotSupportedException {
         class MyAbstractAction extends AbstractAction {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent e) {
             }
+
+            @Override
             public Object clone() throws CloneNotSupportedException {
                 return super.clone();
             }
-        };
+        }
+        ;
         MyAbstractAction instance = new MyAbstractAction();
         Object value1 = new Object();
         instance.putValue("Value1", value1);
-        MyAbstractAction anotherInstance = (MyAbstractAction)instance.clone();
+        MyAbstractAction anotherInstance = (MyAbstractAction) instance.clone();
         Object value2 = new Object();
         instance.putValue("Value1", value2);
-        assertEquals("cloned object's values list isn't shared", value1, anotherInstance.getValue("Value1"));
+        assertEquals("cloned object's values list isn't shared", value1, anotherInstance
+                .getValue("Value1"));
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/AbstractActionTest.java
Sat Nov 25 16:04:10 2006
@@ -34,11 +34,10 @@
 import java.lang.reflect.InvocationTargetException;
 
 public class AbstractActionTest extends SwingTestCase {
-
     protected boolean find(final Object[] array, final Object value) {
         boolean found = false;
         if (array != null) {
-            for (int i = 0; i < array.length; i++ ){
+            for (int i = 0; i < array.length; i++) {
                 if (array[i].equals(value)) {
                     found = true;
                     break;
@@ -51,14 +50,10 @@
     protected AbstractAction action;
 
     public static class ConcreteSerializableListener implements PropertyChangeListener {
-        private transient String name;
-
         public ConcreteSerializableListener() {
-            name = "";
         }
 
         public ConcreteSerializableListener(final String name) {
-            this.name = name;
         }
 
         private void writeObject(final ObjectOutputStream outStream) throws IOException {
@@ -66,29 +61,34 @@
         }
 
         private void readObject(final ObjectInputStream inStream) throws IOException,
-                                                                   ClassNotFoundException
 {
+                ClassNotFoundException {
             inStream.defaultReadObject();
         }
 
         public void propertyChange(PropertyChangeEvent event) {
         }
-
     };
 
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         action = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
 
             private void writeObject(final ObjectOutputStream outStream) throws IOException
{
             }
+
             private void readObject(final ObjectInputStream inStream) throws IOException,
-                                                                       ClassNotFoundException
 {
+                    ClassNotFoundException {
             }
+
+            @Override
             public Object clone() throws CloneNotSupportedException {
                 return super.clone();
             }
@@ -100,11 +100,12 @@
      */
     public void testAbstractActionStringIcon() {
         Icon icon = new ImageIcon(new BufferedImage(20, 20, BufferedImage.TYPE_BYTE_GRAY));
-        action = new AbstractAction("ActionName", icon){
+        action = new AbstractAction("ActionName", icon) {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
-
         assertEquals("icon initialized properly", icon, action.getValue(Action.SMALL_ICON));
         assertEquals("name initialized properly", "ActionName", action.getValue(Action.NAME));
         assertTrue("enabled property init state is true", action.isEnabled());
@@ -114,11 +115,12 @@
      * Class under test for void AbstractAction(String)
      */
     public void testAbstractActionString() {
-        action = new AbstractAction("ActionName"){
+        action = new AbstractAction("ActionName") {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
-
         assertNull("icon initialized properly", action.getValue(Action.SMALL_ICON));
         assertEquals("name initialized properly", "ActionName", action.getValue(Action.NAME));
         assertTrue("enabled property init state is true", action.isEnabled());
@@ -128,11 +130,12 @@
      * Class under test for void AbstractAction()
      */
     public void testAbstractAction() {
-        action = new AbstractAction(){
+        action = new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
             public void actionPerformed(final ActionEvent event) {
             }
         };
-
         assertNull("icon initialized properly", action.getValue(Action.SMALL_ICON));
         assertNull("name initialized properly", action.getValue(Action.NAME));
         assertTrue("enabled property init state is true", action.isEnabled());
@@ -144,21 +147,17 @@
         String value1 = "value1";
         String value2 = "value2";
         PropertyChangeController changeListener = new PropertyChangeController();
-
         assertNull("value is not stored initially", action.getValue(name1));
         assertNull("value is not stored initially", action.getValue(name2));
-
         action.addPropertyChangeListener(changeListener);
         action.putValue(name1, value1);
         assertEquals("value is stored properly", value1, action.getValue(name1));
         changeListener.checkLastPropertyFired(action, name1, null, value1);
-
         changeListener.reset();
         action.putValue(name2, value2);
         assertEquals("value is stored properly", value1, action.getValue(name1));
         assertEquals("value is stored properly", value2, action.getValue(name2));
         changeListener.checkLastPropertyFired(action, name2, null, value2);
-
         changeListener.reset();
         action.putValue(name1, null);
         assertNull("value is stored properly", action.getValue(name1));
@@ -171,17 +170,13 @@
         String name2 = "name2";
         String value1 = "value1";
         String value2 = "value2";
-
         assertNull("value is not stored initially", action.getValue(name1));
         assertNull("value is not stored initially", action.getValue(name2));
-
         action.putValue(name1, value1);
         assertEquals("value is stored properly", value1, action.getValue(name1));
-
         action.putValue(name2, value2);
         assertEquals("value is stored properly", value1, action.getValue(name1));
         assertEquals("value is stored properly", value2, action.getValue(name2));
-
         action.putValue(name1, null);
         assertNull("value is stored properly", action.getValue(name1));
         assertEquals("value is stored properly", value2, action.getValue(name2));
@@ -196,17 +191,14 @@
         String value2 = "value2";
         String value3 = "value3";
         String value4 = "value4";
-
         Object[] keys = action.getKeys();
-        assertTrue("with default constructor the initial number of keys is 0", keys == null
|| keys.length == 0);
-
+        assertTrue("with default constructor the initial number of keys is 0", keys == null
+                || keys.length == 0);
         action.putValue(name1, value1);
         action.putValue(name2, value2);
         action.putValue(name3, value3);
         action.putValue(name4, value4);
-
         keys = action.getKeys();
-
         assertTrue("the number of keys is correct", keys != null && keys.length ==
4);
         assertTrue(find(keys, name1));
         assertTrue(find(keys, name2));
@@ -217,9 +209,9 @@
     /*
      * Class under test for Object clone()
      */
-    public void testClone() throws IllegalArgumentException, SecurityException, IllegalAccessException,
InvocationTargetException, NoSuchMethodException {
+    public void testClone() throws IllegalArgumentException, SecurityException,
+            IllegalAccessException, InvocationTargetException, NoSuchMethodException {
         AbstractAction actionClone = null;
-
         String name1 = "name1";
         String name2 = "name2";
         String value1 = "value1";
@@ -228,19 +220,17 @@
         action.addPropertyChangeListener(changeListener);
         action.putValue(name1, value1);
         action.putValue(name2, value2);
-
-        actionClone = (AbstractAction)action.getClass().getMethod("clone", null).invoke(action,
null);
-        assertEquals("values in table coinside ", action.getValue(name1), actionClone.getValue(name1));
-        assertEquals("values in table coinside ", action.getValue(name2), actionClone.getValue(name2));
-        assertEquals("listeners coinside ",
-                action.getPropertyChangeListeners().length, actionClone
-                        .getPropertyChangeListeners().length);
-        assertEquals("listeners coinside ",
-                action.getPropertyChangeListeners()[0], actionClone
-                        .getPropertyChangeListeners()[0]);
-        assertTrue("listeners coinside ",
-                action.getPropertyChangeListeners()[0] == actionClone
-                        .getPropertyChangeListeners()[0]);
+        actionClone = (AbstractAction) action.getClass().getMethod("clone").invoke(action);
+        assertEquals("values in table coincide ", action.getValue(name1), actionClone
+                .getValue(name1));
+        assertEquals("values in table coincide ", action.getValue(name2), actionClone
+                .getValue(name2));
+        assertEquals("listeners coincide ", action.getPropertyChangeListeners().length,
+                actionClone.getPropertyChangeListeners().length);
+        assertEquals("listeners coincide ", action.getPropertyChangeListeners()[0], actionClone
+                .getPropertyChangeListeners()[0]);
+        assertTrue("listeners coincide ", action.getPropertyChangeListeners()[0] == actionClone
+                .getPropertyChangeListeners()[0]);
     }
 
     public void testRemovePropertyChangeListener() {
@@ -249,50 +239,44 @@
         PropertyChangeController changeListener3 = new PropertyChangeController();
         PropertyChangeController changeListener4 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         action.addPropertyChangeListener(changeListener1);
         action.addPropertyChangeListener(changeListener2);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue("listeners added successfully", listenersArray.length == 2);
-
         action.removePropertyChangeListener(changeListener1);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue("listener is removed successfully", listenersArray.length == 1);
-        assertEquals("it was the right listener that was removed", listenersArray[0], changeListener2);
-
+        assertEquals("it was the right listener that was removed", listenersArray[0],
+                changeListener2);
         action.removePropertyChangeListener(changeListener2);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue("listener is removed successfully", listenersArray.length == 0);
-
         action.addPropertyChangeListener(changeListener1);
         action.addPropertyChangeListener(changeListener2);
         action.addPropertyChangeListener(changeListener3);
         action.addPropertyChangeListener(changeListener4);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue("listeners added successfully", listenersArray.length == 4);
-
         action.removePropertyChangeListener(changeListener3);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue("listener is removed successfully", listenersArray.length == 3);
-        assertTrue("it was the right listener that was removed", changeListener3.findMe(listenersArray)
== 0);
+        assertTrue("it was the right listener that was removed", changeListener3
+                .findMe(listenersArray) == 0);
     }
 
     public void testAddPropertyChangeListener() {
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         action.addPropertyChangeListener(changeListener1);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 1);
         assertTrue(changeListener1.findMe(listenersArray) > 0);
-
         action.addPropertyChangeListener(changeListener2);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 2);
         assertTrue(changeListener1.findMe(listenersArray) > 0);
         assertTrue(changeListener2.findMe(listenersArray) > 0);
-
         action.addPropertyChangeListener(changeListener2);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 3);
@@ -302,15 +286,12 @@
         PropertyChangeController changeListener1 = new PropertyChangeController();
         PropertyChangeController changeListener2 = new PropertyChangeController();
         PropertyChangeListener[] listenersArray = null;
-
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 0);
-
         action.addPropertyChangeListener(changeListener1);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 1);
         assertTrue(changeListener1.findMe(listenersArray) == 1);
-
         action.addPropertyChangeListener(changeListener2);
         listenersArray = action.getPropertyChangeListeners();
         assertTrue(listenersArray.length == 2);
@@ -327,6 +308,7 @@
     public void testSetEnabled() {
         class PropertyChangeListenerFalse implements PropertyChangeListener {
             public boolean isChanged = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("enabled".equals(evt.getPropertyName()) && (evt.getNewValue()
!= null)) {
                     assertTrue(evt.getNewValue().equals(Boolean.FALSE));
@@ -334,9 +316,11 @@
                     isChanged = true;
                 }
             }
-        };
+        }
+        ;
         class PropertyChangeListenerTrue implements PropertyChangeListener {
             public boolean isChanged = false;
+
             public void propertyChange(final PropertyChangeEvent evt) {
                 if ("enabled".equals(evt.getPropertyName()) && (evt.getNewValue()
!= null)) {
                     assertTrue(evt.getNewValue().equals(Boolean.TRUE));
@@ -344,21 +328,19 @@
                     isChanged = true;
                 }
             }
-        };
+        }
+        ;
         PropertyChangeListenerFalse falseListener = new PropertyChangeListenerFalse();
         PropertyChangeListenerTrue trueListener = new PropertyChangeListenerTrue();
-
         action.addPropertyChangeListener(trueListener);
         action.setEnabled(true);
         assertFalse("state changing event's not fired", trueListener.isChanged);
         assertTrue("state's not changed", action.isEnabled());
-
         action.removePropertyChangeListener(trueListener);
         action.addPropertyChangeListener(falseListener);
         action.setEnabled(false);
         assertTrue("state changing event's fired", falseListener.isChanged);
         assertFalse("state's changed", action.isEnabled());
-
         action.removePropertyChangeListener(falseListener);
         action.addPropertyChangeListener(trueListener);
         action.setEnabled(true);
@@ -368,10 +350,8 @@
 
     public void testIsEnabled() {
         assertTrue("action is enabled initially", action.isEnabled());
-
         action.setEnabled(false);
         assertFalse("action is disabled", action.isEnabled());
-
         action.setEnabled(true);
         assertTrue("action is enabled", action.isEnabled());
     }
@@ -385,7 +365,6 @@
         action.addPropertyChangeListener(changeListener);
         action.putValue(name1, value1);
         action.putValue(name2, value2);
-
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         ObjectOutputStream so = new ObjectOutputStream(output);
         so.writeObject(action);
@@ -402,17 +381,19 @@
         action.addPropertyChangeListener(changeListener);
         action.putValue(name1, value1);
         action.putValue(name2, value2);
-
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         ObjectOutputStream so = new ObjectOutputStream(output);
         so.writeObject(action);
         so.flush();
         assertTrue(output.size() > 1);
-
-        ObjectInputStream si = new ObjectInputStream(new ByteArrayInputStream(output.toByteArray()));
-        AbstractAction ressurectedAction = (AbstractAction)si.readObject();
-        assertEquals("values in table coinside ", action.getValue(name1), ressurectedAction.getValue(name1));
-        assertEquals("values in table coinside ", action.getValue(name2), ressurectedAction.getValue(name2));
-        assertEquals("no listeners resurrected ", 0, ressurectedAction.getPropertyChangeListeners().length);
+        ObjectInputStream si = new ObjectInputStream(new ByteArrayInputStream(output
+                .toByteArray()));
+        AbstractAction ressurectedAction = (AbstractAction) si.readObject();
+        assertEquals("values in table coincide ", action.getValue(name1), ressurectedAction
+                .getValue(name1));
+        assertEquals("values in table coincide ", action.getValue(name2), ressurectedAction
+                .getValue(name2));
+        assertEquals("no listeners resurrected ", 0, ressurectedAction
+                .getPropertyChangeListeners().length);
     }
 }



Mime
View raw message