harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [7/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/DefaultFocusManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultFocusManagerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultFocusManagerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultFocusManagerTest.java Sat Nov 25 16:04:10 2006
@@ -25,45 +25,50 @@
 import java.awt.FocusTraversalPolicy;
 import java.util.ArrayList;
 import java.util.List;
-
 import junit.framework.TestCase;
 
 public class DefaultFocusManagerTest extends TestCase {
     private DefaultFocusManager focusManager;
-    private List components;
+
+    private List<JButton> components;
 
     public DefaultFocusManagerTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
-        components = new ArrayList();
+        components = new ArrayList<JButton>();
         components.add(new JButton("1"));
         components.add(new JButton("2"));
         components.add(new JButton("3"));
         components.add(new JButton("4"));
-
         focusManager = new DefaultFocusManager();
         focusManager.setDefaultFocusTraversalPolicy(new TestFocusTraversalPolicy(components));
     }
 
+    @Override
     protected void tearDown() throws Exception {
         components = null;
         focusManager = null;
     }
 
     public void testGetComponentBefore() throws Exception {
-        assertEquals(components.get(0), focusManager.getComponentBefore(null, (Component)components.get(1)));
-        assertEquals(components.get(1), focusManager.getComponentBefore(null, (Component)components.get(2)));
-        assertEquals(components.get(2), focusManager.getComponentBefore(null, (Component)components.get(3)));
-        assertEquals(components.get(3), focusManager.getComponentBefore(null, (Component)components.get(0)));
+        assertEquals(components.get(0), focusManager
+                .getComponentBefore(null, components.get(1)));
+        assertEquals(components.get(1), focusManager
+                .getComponentBefore(null, components.get(2)));
+        assertEquals(components.get(2), focusManager
+                .getComponentBefore(null, components.get(3)));
+        assertEquals(components.get(3), focusManager
+                .getComponentBefore(null, components.get(0)));
     }
 
     public void testGetComponentAfter() throws Exception {
-        assertEquals(components.get(0), focusManager.getComponentAfter(null, (Component)components.get(3)));
-        assertEquals(components.get(1), focusManager.getComponentAfter(null, (Component)components.get(0)));
-        assertEquals(components.get(2), focusManager.getComponentAfter(null, (Component)components.get(1)));
-        assertEquals(components.get(3), focusManager.getComponentAfter(null, (Component)components.get(2)));
+        assertEquals(components.get(0), focusManager.getComponentAfter(null, components.get(3)));
+        assertEquals(components.get(1), focusManager.getComponentAfter(null, components.get(0)));
+        assertEquals(components.get(2), focusManager.getComponentAfter(null, components.get(1)));
+        assertEquals(components.get(3), focusManager.getComponentAfter(null, components.get(2)));
     }
 
     public void testGetLastComponent() throws Exception {
@@ -76,54 +81,55 @@
 
     //TODO: Is not clear how this method should work
     public void testCompareTabOrder() throws Exception {
-        assertFalse(focusManager.compareTabOrder((Component)components.get(1), (Component)components.get(2)));
+        assertFalse(focusManager.compareTabOrder(components.get(1), components.get(2)));
     }
 
-
-
     private class TestFocusTraversalPolicy extends FocusTraversalPolicy {
-        private List components;
+        private List<JButton> components;
 
-        public TestFocusTraversalPolicy(final List components) {
+        public TestFocusTraversalPolicy(final List<JButton> components) {
             this.components = components;
         }
 
-        public Component getComponentAfter(final Container focusCycleRoot, final Component component) {
+        @Override
+        public Component getComponentAfter(final Container focusCycleRoot,
+                final Component component) {
             int index = components.indexOf(component);
             if (index == -1) {
                 return null;
             }
-
             if (index == components.size() - 1) {
-                return (Component)components.get(0);
-            } else {
-                return (Component)components.get(index + 1);
+                return components.get(0);
             }
+            return components.get(index + 1);
         }
 
-        public Component getComponentBefore(final Container focusCycleRoot, final Component component) {
+        @Override
+        public Component getComponentBefore(final Container focusCycleRoot,
+                final Component component) {
             int index = components.indexOf(component);
             if (index == -1) {
                 return null;
             }
-
             if (index == 0) {
-                return (Component)components.get(components.size() - 1);
-            } else {
-                return (Component)components.get(index - 1);
+                return components.get(components.size() - 1);
             }
+            return components.get(index - 1);
         }
 
+        @Override
         public Component getDefaultComponent(final Container focusCycleRoot) {
             return getFirstComponent(focusCycleRoot);
         }
 
+        @Override
         public Component getFirstComponent(final Container focusCycleRoot) {
-            return (Component)components.get(0);
+            return components.get(0);
         }
 
+        @Override
         public Component getLastComponent(final Container focusCycleRoot) {
-            return (Component)components.get(components.size() - 1);
+            return components.get(components.size() - 1);
         }
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListCellRendererTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListCellRendererTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListCellRendererTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListCellRendererTest.java Sat Nov 25 16:04:10 2006
@@ -25,7 +25,6 @@
 import java.awt.Font;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-
 import javax.swing.border.Border;
 
 public class DefaultListCellRendererTest extends SwingTestCase {
@@ -35,11 +34,13 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         renderer = new DefaultListCellRenderer();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         renderer = null;
         super.tearDown();
@@ -51,38 +52,34 @@
         list.setBackground(Color.blue);
         list.setSelectionForeground(Color.pink);
         list.setSelectionBackground(Color.yellow);
-
         Component result = renderer.getListCellRendererComponent(list, "one", 0, false, false);
         assertTrue(result == renderer);
-        JLabel label = (JLabel)result;
+        JLabel label = (JLabel) result;
         assertEquals("one", label.getText());
         assertEquals(Color.red, label.getForeground());
         assertEquals(Color.blue, label.getBackground());
         assertEquals(DefaultListCellRenderer.noFocusBorder, label.getBorder());
-
         result = renderer.getListCellRendererComponent(list, "two", 0, true, false);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("two", label.getText());
         assertEquals(Color.pink, label.getForeground());
         assertEquals(Color.yellow, label.getBackground());
         assertEquals(DefaultListCellRenderer.noFocusBorder, label.getBorder());
-
         Border border = BorderFactory.createEtchedBorder();
         DefaultListCellRenderer.noFocusBorder = border;
         result = renderer.getListCellRendererComponent(list, "one", 0, false, false);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("one", label.getText());
         assertEquals(Color.red, label.getForeground());
         assertEquals(Color.blue, label.getBackground());
         assertEquals(border, label.getBorder());
-
         border = BorderFactory.createRaisedBevelBorder();
         UIManager.put("List.focusCellHighlightBorder", border);
         result = renderer.getListCellRendererComponent(list, "three", 0, true, true);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("three", label.getText());
         assertEquals(Color.pink, label.getForeground());
         assertEquals(Color.yellow, label.getBackground());
@@ -95,23 +92,20 @@
         list.setBackground(Color.blue);
         list.setSelectionForeground(Color.pink);
         list.setSelectionBackground(Color.yellow);
-
         Component result = renderer.getListCellRendererComponent(list, "one", 0, false, false);
         assertTrue(result == renderer);
-        JLabel label = (JLabel)result;
+        JLabel label = (JLabel) result;
         assertEquals("one", label.getText());
         assertEquals(Color.red, label.getForeground());
         assertEquals(Color.blue, label.getBackground());
         assertEquals(list.getFont(), label.getFont());
         assertTrue(label.isEnabled());
-
         result = renderer.getListCellRendererComponent(list, "two", 0, true, false);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("two", label.getText());
         assertEquals(Color.pink, label.getForeground());
         assertEquals(Color.yellow, label.getBackground());
-
         list.setForeground(Color.black);
         list.setBackground(Color.green);
         list.setSelectionForeground(Color.gray);
@@ -119,19 +113,17 @@
         Font font = list.getFont().deriveFont(100);
         list.setFont(font);
         list.setEnabled(false);
-
         result = renderer.getListCellRendererComponent(list, "one", 0, false, false);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("one", label.getText());
         assertEquals(Color.black, label.getForeground());
         assertEquals(Color.green, label.getBackground());
         assertEquals(font, label.getFont());
         assertFalse(label.isEnabled());
-
         result = renderer.getListCellRendererComponent(list, "two", 0, true, false);
         assertTrue(result == renderer);
-        label = (JLabel)result;
+        label = (JLabel) result;
         assertEquals("two", label.getText());
         assertEquals(Color.gray, label.getForeground());
         assertEquals(Color.yellow, label.getBackground());
@@ -140,20 +132,17 @@
     public void testFirePropertyChange() throws Exception {
         TestListener listener = new TestListener();
         renderer.addPropertyChangeListener(listener);
-
         renderer.firePropertyChange("qqq", true, false);
-        renderer.firePropertyChange("qqq", (byte)5, (byte)7);
+        renderer.firePropertyChange("qqq", (byte) 5, (byte) 7);
         renderer.firePropertyChange("qqq", 'a', 'b');
         renderer.firePropertyChange("qqq", 5d, 7d);
         renderer.firePropertyChange("qqq", 5f, 7f);
         renderer.firePropertyChange("qqq", 5, 7);
-        renderer.firePropertyChange("qqq", (long)5, (long)7);
-        renderer.firePropertyChange("qqq", (short)5, (short)7);
+        renderer.firePropertyChange("qqq", (long) 5, (long) 7);
+        renderer.firePropertyChange("qqq", (short) 5, (short) 7);
         renderer.firePropertyChange("qqq", "a", "b");
-
         assertNull(listener.getEvent());
     }
-
 
     private class TestListener implements PropertyChangeListener {
         private PropertyChangeEvent event;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListModelTest.java Sat Nov 25 16:04:10 2006
@@ -23,24 +23,26 @@
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
 import java.util.Vector;
-
 import javax.swing.event.ListDataEvent;
 import javax.swing.event.ListDataListener;
 
 public class DefaultListModelTest extends SwingTestCase {
     private DefaultListModel model;
+
     private TestListener listener;
 
     public DefaultListModelTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         model = new DefaultListModel();
         listener = new TestListener();
         model.addListDataListener(listener);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         model = null;
         listener = null;
@@ -51,38 +53,36 @@
         model.add(0, element1);
         assertEquals(element1, model.get(0));
         checkListDataEvent(ListDataEvent.INTERVAL_ADDED, 0, 0);
-
         listener.reset();
         Object element2 = new Object();
         model.insertElementAt(element2, 1);
         assertEquals(element2, model.get(1));
         checkListDataEvent(ListDataEvent.INTERVAL_ADDED, 1, 1);
-
         listener.reset();
         Object element3 = new Object();
         model.add(1, element3);
         assertEquals(element3, model.get(1));
         checkListDataEvent(ListDataEvent.INTERVAL_ADDED, 1, 1);
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.add(-1, "any");
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.insertElementAt("any", -1);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.add(4, "any");
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.insertElementAt("any", 4);
             }
@@ -93,18 +93,16 @@
         Object element1 = new Object();
         model.addElement(element1);
         checkListDataEvent(ListDataEvent.INTERVAL_ADDED, 0, 0);
-
         listener.reset();
         Object element2 = new Object();
         model.addElement(element2);
         checkListDataEvent(ListDataEvent.INTERVAL_ADDED, 1, 1);
-
         assertEquals(element1, model.get(0));
         assertEquals(element2, model.get(1));
     }
 
     public void testCapacity() throws Exception {
-        assertEquals(new Vector().capacity(), model.capacity());
+        assertEquals(new Vector<Object>().capacity(), model.capacity());
     }
 
     public void testClear() throws Exception {
@@ -113,21 +111,17 @@
         Object element2 = new Object();
         model.addElement(element2);
         assertEquals(2, model.getSize());
-
         listener.reset();
         model.clear();
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 1);
         assertEquals(0, model.getSize());
-
         listener.reset();
         model.clear();
         assertNull(listener.getEvent());
         assertEquals(0, model.getSize());
-
         model.addElement(element1);
         model.addElement(element2);
         assertEquals(2, model.getSize());
-
         listener.reset();
         model.removeAllElements();
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 1);
@@ -139,7 +133,6 @@
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
-
         assertTrue(model.contains(element1));
         assertTrue(model.contains(element2));
         assertFalse(model.contains("any"));
@@ -147,17 +140,14 @@
 
     public void testCopyInfo() throws Exception {
         Object[] copied = new Object[2];
-
         model.copyInto(copied);
         assertNotNull(copied);
         assertNull(copied[0]);
         assertNull(copied[1]);
-
         Object element1 = new Object();
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
-
         model.copyInto(copied);
         assertEquals(element1, copied[0]);
         assertEquals(element2, copied[1]);
@@ -168,50 +158,46 @@
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
-
         assertEquals(element1, model.elementAt(0));
         assertEquals(element2, model.elementAt(1));
     }
 
     public void testElements() throws Exception {
         assertFalse(model.elements().hasMoreElements());
-
         Object element = new Object();
         model.addElement(element);
-        Enumeration e = model.elements();
+        Enumeration<?> e = model.elements();
         assertTrue(e.hasMoreElements());
         assertEquals(element, e.nextElement());
-
         assertFalse(e.hasMoreElements());
     }
 
     public void testEnsureCapacity() throws Exception {
         model.ensureCapacity(500);
         assertEquals(500, model.capacity());
-
         model.ensureCapacity(1000);
         assertEquals(1000, model.capacity());
-
         model.ensureCapacity(800);
         assertEquals(1000, model.capacity());
     }
 
     public void testFirstElement() throws Exception {
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() {
                 model.firstElement();
             }
-            public Class expectedExceptionClass() {
+
+            @Override
+            public Class<?> expectedExceptionClass() {
                 return NoSuchElementException.class;
             }
         });
-
         Object element1 = new Object();
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
         assertEquals(element1, model.firstElement());
-
         Object element0 = new Object();
         model.add(0, element0);
         assertEquals(element0, model.firstElement());
@@ -222,31 +208,30 @@
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
-
         assertEquals(element1, model.get(0));
         assertEquals(element1, model.getElementAt(0));
         assertEquals(element2, model.get(1));
         assertEquals(element2, model.getElementAt(1));
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.get(-1);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.getElementAt(-1);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.get(2);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.getElementAt(2);
             }
@@ -256,11 +241,9 @@
     public void testSizeGetSize() throws Exception {
         assertEquals(0, model.size());
         assertEquals(0, model.getSize());
-
         model.addElement("any");
         assertEquals(1, model.size());
         assertEquals(1, model.getSize());
-
         model.addElement("any");
         assertEquals(2, model.size());
         assertEquals(2, model.getSize());
@@ -268,25 +251,24 @@
 
     public void testIndexOf() throws Exception {
         assertEquals(-1, model.indexOf("1"));
-
         model.addElement("1");
         model.addElement("2");
         model.addElement("3");
         model.addElement("2");
-
         assertEquals(0, model.indexOf("1"));
         assertEquals(1, model.indexOf("2"));
         assertEquals(2, model.indexOf("3"));
-
         assertEquals(3, model.indexOf("2", 2));
         assertEquals(-1, model.indexOf("1", 2));
         assertEquals(-1, model.indexOf("1", 20));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() {
                 model.indexOf("1", -1);
             }
-            public Class expectedExceptionClass() {
+
+            @Override
+            public Class<?> expectedExceptionClass() {
                 return IndexOutOfBoundsException.class;
             }
         });
@@ -294,27 +276,27 @@
 
     public void testIsEmpty() throws Exception {
         assertTrue(model.isEmpty());
-
         model.addElement("1");
         assertFalse(model.isEmpty());
     }
 
     public void testLastElement() throws Exception {
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() {
                 model.lastElement();
             }
-            public Class expectedExceptionClass() {
+
+            @Override
+            public Class<?> expectedExceptionClass() {
                 return NoSuchElementException.class;
             }
         });
-
         Object element1 = new Object();
         model.addElement(element1);
         Object element2 = new Object();
         model.addElement(element2);
         assertEquals(element2, model.lastElement());
-
         Object element3 = new Object();
         model.add(2, element3);
         assertEquals(element3, model.lastElement());
@@ -322,32 +304,30 @@
 
     public void testLastIndexOf() throws Exception {
         assertEquals(-1, model.indexOf("1"));
-
         model.addElement("1");
         model.addElement("2");
         model.addElement("3");
         model.addElement("2");
         model.addElement("1");
         model.addElement("0");
-
         assertEquals(5, model.lastIndexOf("0"));
         assertEquals(4, model.lastIndexOf("1"));
         assertEquals(3, model.lastIndexOf("2"));
         assertEquals(2, model.lastIndexOf("3"));
-
         assertEquals(3, model.lastIndexOf("2", 3));
         assertEquals(-1, model.lastIndexOf("0", 1));
         assertEquals(-1, model.lastIndexOf("0", -1));
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() {
                 model.lastIndexOf("1", 100);
             }
-            public Class expectedExceptionClass() {
+
+            @Override
+            public Class<?> expectedExceptionClass() {
                 return IndexOutOfBoundsException.class;
             }
         });
-
     }
 
     public void testRemove() throws Exception {
@@ -355,19 +335,18 @@
         model.addElement(element);
         model.addElement(element);
         assertEquals(2, model.size());
-
         listener.reset();
         assertEquals(element, model.remove(0));
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 0);
         assertEquals(1, model.size());
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.remove(4);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.remove(-1);
             }
@@ -376,14 +355,11 @@
 
     public void testRemoveElement() throws Exception {
         assertFalse(model.removeElement("1"));
-
         model.addElement("1");
         model.addElement("2");
-
         listener.reset();
         assertTrue(model.removeElement("2"));
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 1, 1);
-
         listener.reset();
         assertFalse(model.removeElement("2"));
         assertNull(listener.getEvent());
@@ -393,19 +369,18 @@
     public void testRemoveElementAt() throws Exception {
         Object element = new Object();
         model.addElement(element);
-
         assertEquals(1, model.size());
         model.removeElementAt(0);
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 0);
         assertEquals(0, model.size());
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.removeElementAt(4);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.removeElementAt(-1);
             }
@@ -416,12 +391,10 @@
         model.addElement("1");
         model.addElement("2");
         model.addElement("3");
-
         model.removeRange(1, 2);
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 1, 2);
         assertEquals(1, model.size());
         assertEquals("1", model.get(0));
-
         listener.reset();
         model.addElement("2");
         model.addElement("3");
@@ -429,7 +402,6 @@
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 1);
         assertEquals(1, model.size());
         assertEquals("3", model.get(0));
-
         listener.reset();
         model.addElement("5");
         model.addElement("6");
@@ -437,7 +409,6 @@
         model.removeRange(0, 3);
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 0, 3);
         assertEquals(0, model.size());
-
         listener.reset();
         model.addElement("1");
         model.addElement("2");
@@ -445,14 +416,14 @@
         model.removeRange(2, 2);
         checkListDataEvent(ListDataEvent.INTERVAL_REMOVED, 2, 2);
         assertEquals(2, model.size());
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.removeRange(-1, 1);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.removeRange(1, 2);
             }
@@ -464,38 +435,35 @@
         model.addElement("2");
         model.addElement("3");
         assertEquals("2", model.get(1));
-
         listener.reset();
         model.set(1, "another1");
         checkListDataEvent(ListDataEvent.CONTENTS_CHANGED, 1, 1);
         assertEquals("another1", model.get(1));
-
         listener.reset();
         model.setElementAt("another2", 2);
         checkListDataEvent(ListDataEvent.CONTENTS_CHANGED, 2, 2);
         assertEquals("another2", model.get(2));
-
         assertEquals(3, model.size());
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.set(-1, "any");
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.set(3, "any");
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.setElementAt("any", -1);
             }
         });
-
         testExceptionalCase(new ArrayIndexOutOfBoundsCase() {
+            @Override
             public void exceptionalAction() {
                 model.setElementAt("any", 3);
             }
@@ -505,17 +473,14 @@
     public void testSetSize() throws Exception {
         model.setSize(1000);
         assertEquals(1000, model.getSize());
-
         model.setSize(500);
         assertEquals(500, model.getSize());
     }
 
     public void testToArray() throws Exception {
         assertEquals(0, model.toArray().length);
-
         model.addElement("1");
         model.addElement("2");
-
         Object[] array = model.toArray();
         assertEquals(2, array.length);
         assertEquals("1", array[0]);
@@ -525,7 +490,6 @@
     public void testTrimToSize() throws Exception {
         model.ensureCapacity(1000);
         assertEquals(1000, model.capacity());
-
         model.addElement("1");
         model.trimToSize();
         assertEquals(1, model.capacity());
@@ -534,13 +498,12 @@
     public void testToString() throws Exception {
         model.addElement("1");
         model.addElement("2");
-
         assertEquals("[1, 2]", model.toString());
     }
 
-
     private class TestListener implements ListDataListener {
         private ListDataEvent event;
+
         private int eventType = -1;
 
         public void contentsChanged(final ListDataEvent e) {
@@ -572,7 +535,8 @@
         }
     }
 
-    private void checkListDataEvent(final int expectedEventType, final int expectedIndex0, final int expectedIndex1) {
+    private void checkListDataEvent(final int expectedEventType, final int expectedIndex0,
+            final int expectedIndex1) {
         assertNotNull(listener.getEvent());
         assertEquals(model, listener.getEvent().getSource());
         assertEquals(expectedEventType, listener.getEvent().getType());
@@ -581,7 +545,8 @@
     }
 
     private abstract class ArrayIndexOutOfBoundsCase extends ExceptionalCase {
-        public Class expectedExceptionClass() {
+        @Override
+        public Class<?> expectedExceptionClass() {
             return ArrayIndexOutOfBoundsException.class;
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListSelectionModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListSelectionModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListSelectionModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultListSelectionModelTest.java Sat Nov 25 16:04:10 2006
@@ -23,23 +23,25 @@
 import java.awt.event.KeyListener;
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
 public class DefaultListSelectionModelTest extends SwingTestCase {
     private DefaultListSelectionModel model;
+
     private TestListener listener;
 
     public DefaultListSelectionModelTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         model = new DefaultListSelectionModel();
         listener = new TestListener();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         model = null;
         listener = null;
@@ -47,12 +49,10 @@
 
     public void testAddRemoveListSelectionListener() throws Exception {
         assertEquals(0, model.getListSelectionListeners().length);
-
         model.addListSelectionListener(new TestListener());
         model.addListSelectionListener(listener);
         model.addListSelectionListener(new TestListener());
         assertEquals(3, model.getListSelectionListeners().length);
-
         model.removeListSelectionListener(listener);
         assertEquals(2, model.getListSelectionListeners().length);
     }
@@ -66,33 +66,27 @@
         assertTrue(model.isSelectionEmpty());
         assertEquals(0, listener.getEvents().size());
         listener.reset();
-        
         model.setLeadAnchorNotificationEnabled(false);
         assertTrue(model.isSelectionEmpty());
-
         model.addSelectionInterval(3, 5);
         checkSingleEvent(3, 5, false);
         assertFalse(model.isSelectedIndex(2));
         checkIntervalState(3, 5, true);
-
         listener.reset();
         model.addSelectionInterval(10, 7);
         checkSingleEvent(7, 10, false);
         checkIntervalState(3, 5, true);
         checkIntervalState(7, 10, true);
-
         listener.reset();
         model.addSelectionInterval(4, 11);
         checkSingleEvent(6, 11, false);
         checkIntervalState(3, 11, true);
-
         model.clearSelection();
         model.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
         model.addSelectionInterval(4, 11);
         checkIntervalState(4, 11, true);
         model.addSelectionInterval(6, 8);
         checkIntervalState(6, 8, true);
-
         model.clearSelection();
         model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         model.addSelectionInterval(11, 4);
@@ -105,7 +99,6 @@
         model.addSelectionInterval(0, 5);
         model.addSelectionInterval(7, 9);
         assertFalse(model.isSelectionEmpty());
-
         model.addListSelectionListener(listener);
         model.clearSelection();
         checkSingleEvent(0, 9, false);
@@ -119,8 +112,7 @@
         model.addSelectionInterval(7, 9);
         model.setLeadAnchorNotificationEnabled(false);
         model.setValueIsAdjusting(true);
-
-        model = (DefaultListSelectionModel)model.clone();
+        model = (DefaultListSelectionModel) model.clone();
         assertEquals(0, model.getListSelectionListeners().length);
         checkIntervalState(0, 1, false);
         checkIntervalState(2, 4, true);
@@ -136,10 +128,8 @@
         TestListener listener2 = new TestListener();
         model.addListSelectionListener(listener);
         model.addListSelectionListener(listener2);
-
         model.fireValueChanged(true);
         assertEquals(0, listener.getEvents().size());
-
         listener.reset();
         model.setValueIsAdjusting(true);
         model.setAnchorSelectionIndex(5);
@@ -147,25 +137,20 @@
         listener.reset();
         model.fireValueChanged(true);
         checkSingleEvent(listener, 5, 5, true);
-
         model.setSelectionInterval(3, 6);
         model.setSelectionInterval(9, 11);
         listener.reset();
         model.fireValueChanged(true);
         checkSingleEvent(listener, 3, 11, true);
-
         listener.reset();
         model.fireValueChanged(false);
         assertEquals(0, listener.getEvents().size());
-
-
         model.setValueIsAdjusting(false);
         listener.reset();
         listener2.reset();
         model.fireValueChanged(3, 7);
         checkSingleEvent(listener, 3, 7, false);
         checkSingleEvent(listener2, 3, 7, false);
-
         listener.reset();
         listener2.reset();
         model.fireValueChanged(0, 5, false);
@@ -176,15 +161,12 @@
     public void testGetAnchorAndLeadSelectionIndex() throws Exception {
         assertEquals(-1, model.getAnchorSelectionIndex());
         assertEquals(-1, model.getLeadSelectionIndex());
-
         model.addSelectionInterval(2, 6);
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(6, model.getLeadSelectionIndex());
-
         model.setSelectionInterval(1, 4);
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(4, model.getLeadSelectionIndex());
-
         model.removeSelectionInterval(2, 7);
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -193,7 +175,6 @@
     public void testGetListeners() throws Exception {
         assertEquals(0, model.getListeners(ListSelectionListener.class).length);
         assertEquals(0, model.getListeners(KeyListener.class).length);
-
         model.addListSelectionListener(listener);
         assertEquals(1, model.getListeners(ListSelectionListener.class).length);
         assertEquals(0, model.getListeners(KeyListener.class).length);
@@ -208,12 +189,10 @@
     public void testGetMinAndMaxSelectionIndex() throws Exception {
         assertEquals(-1, model.getMinSelectionIndex());
         assertEquals(-1, model.getMaxSelectionIndex());
-
         model.addSelectionInterval(2, 6);
         model.addSelectionInterval(12, 9);
         assertEquals(2, model.getMinSelectionIndex());
         assertEquals(12, model.getMaxSelectionIndex());
-
         model.addSelectionInterval(0, 14);
         assertEquals(0, model.getMinSelectionIndex());
         assertEquals(14, model.getMaxSelectionIndex());
@@ -221,13 +200,10 @@
 
     public void testGetSetSelectionMode() throws Exception {
         assertEquals(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION, model.getSelectionMode());
-
         model.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         assertEquals(ListSelectionModel.SINGLE_SELECTION, model.getSelectionMode());
-
         model.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
         assertEquals(ListSelectionModel.SINGLE_INTERVAL_SELECTION, model.getSelectionMode());
-
         try {
             model.setSelectionMode(100);
             fail("Incorrect selection model should be detected");
@@ -238,22 +214,17 @@
     public void testGetSetValueIsAdjusting() throws Exception {
         model.addListSelectionListener(listener);
         assertFalse(model.getValueIsAdjusting());
-
         model.setValueIsAdjusting(true);
         assertEquals(0, listener.getEvents().size());
         assertTrue(model.getValueIsAdjusting());
-
         model.setSelectionInterval(2, 3);
         checkSingleEvent(2, 3, true);
-
         listener.reset();
         model.setSelectionInterval(5, 7);
         checkSingleEvent(2, 7, true);
-
         listener.reset();
         model.setSelectionInterval(5, 8);
         checkSingleEvent(7, 8, true);
-
         listener.reset();
         model.setValueIsAdjusting(false);
         assertEquals(1, listener.getEvents().size());
@@ -264,7 +235,6 @@
     public void testInsertIndexInterval() throws Exception {
         model.addListSelectionListener(listener);
         model.setSelectionInterval(3, 5);
-
         if (isHarmony()) {
             listener.reset();
             model.insertIndexInterval(-1, 0, true);
@@ -275,7 +245,6 @@
             model.insertIndexInterval(0, -1, false);
             assertEquals(0, listener.getEvents().size());
         }
-
         listener.reset();
         model.insertIndexInterval(4, 10, true);
         checkIntervalState(0, 2, false);
@@ -283,13 +252,11 @@
         if (isHarmony()) {
             checkSingleEvent(5, 15, false);
         }
-
         listener.reset();
         model.insertIndexInterval(0, 3, true);
         checkIntervalState(0, 5, false);
         checkIntervalState(6, 18, true);
         checkSingleEvent(3, 18, false);
-
         model.clearSelection();
         model.setSelectionInterval(3, 5);
         listener.reset();
@@ -300,7 +267,6 @@
         assertEquals(0, listener.getEvents().size());
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
-
         model.clearSelection();
         model.setSelectionInterval(3, 5);
         listener.reset();
@@ -311,7 +277,6 @@
         assertEquals(0, listener.getEvents().size());
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
-
         model.clearSelection();
         model.setSelectionInterval(3, 5);
         listener.reset();
@@ -322,7 +287,6 @@
         checkSingleEvent(6, 8, false);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
-
         model.clearSelection();
         model.setSelectionInterval(3, 5);
         listener.reset();
@@ -333,7 +297,6 @@
         checkSingleEvent(5, 8, false);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
-
         model.clearSelection();
         model.setSelectionInterval(3, 5);
         listener.reset();
@@ -344,7 +307,6 @@
         checkSingleEvent(3, 8, false);
         assertEquals(6, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
-
         model.clearSelection();
         model.setSelectionInterval(1, 2);
         listener.reset();
@@ -354,7 +316,6 @@
         checkIntervalState(6, 20, false);
         assertEquals(4, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
-
         listener.reset();
         model.removeSelectionInterval(-1, 0);
         model.removeSelectionInterval(0, -1);
@@ -364,7 +325,6 @@
 
     public void testRemoveIndexInterval() throws Exception {
         model.setSelectionInterval(3, 8);
-
         model.addListSelectionListener(listener);
         model.removeSelectionInterval(-1, 10);
         model.removeSelectionInterval(-1, 0);
@@ -373,7 +333,6 @@
         assertEquals(0, listener.getEvents().size());
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
-
         listener.reset();
         model.removeIndexInterval(2, 6);
         checkIntervalState(0, 1, false);
@@ -381,7 +340,6 @@
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(3, model.getLeadSelectionIndex());
         checkSingleEvent(1, 8, false);
-
         listener.reset();
         model.removeIndexInterval(0, 2);
         checkIntervalState(0, 0, true);
@@ -393,7 +351,6 @@
         } else {
             checkSingleEvent(-1, 3, false);
         }
-
         listener.reset();
         model.removeIndexInterval(0, 2);
         checkIntervalState(0, 10, false);
@@ -402,7 +359,6 @@
             assertEquals(-1, model.getLeadSelectionIndex());
         }
         checkSingleEvent(0, 0, false);
-
         model.setSelectionInterval(3, 8);
         listener.reset();
         model.removeIndexInterval(8, 8);
@@ -411,7 +367,6 @@
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
         checkSingleEvent(7, 8, false);
-
         listener.reset();
         model.removeIndexInterval(3, 3);
         checkIntervalState(3, 6, true);
@@ -419,7 +374,6 @@
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(6, model.getLeadSelectionIndex());
         checkSingleEvent(2, 7, false);
-
         listener.reset();
         model.removeIndexInterval(3, 6);
         checkIntervalState(0, 10, false);
@@ -430,42 +384,32 @@
 
     public void testIsLeadAnchorNotificationEnabled() throws Exception {
         model.addListSelectionListener(listener);
-
         assertTrue(model.isLeadAnchorNotificationEnabled());
         model.addSelectionInterval(3, 5);
         checkSingleEvent(3, 5, false);
-
         listener.reset();
         model.addSelectionInterval(7, 8);
         checkSingleEvent(3, 8, false);
-
         listener.reset();
         model.setSelectionInterval(2, 6);
         checkSingleEvent(2, 8, false);
-
         listener.reset();
         model.removeSelectionInterval(4, 11);
         checkSingleEvent(2, 11, false);
-
         listener.reset();
         model.removeSelectionInterval(4, 11);
         assertEquals(0, listener.getEvents().size());
-
         listener.reset();
         model.removeSelectionInterval(5, 8);
         checkSingleEvent(4, 11, false);
-
         model.setLeadAnchorNotificationEnabled(false);
         assertFalse(model.isLeadAnchorNotificationEnabled());
-
         listener.reset();
         model.addSelectionInterval(10, 12);
         checkSingleEvent(10, 12, false);
-
         listener.reset();
         model.removeSelectionInterval(0, 2);
         checkSingleEvent(2, 2, false);
-
         listener.reset();
         model.removeSelectionInterval(1, 2);
         assertEquals(0, listener.getEvents().size());
@@ -480,22 +424,18 @@
 
     public void testGetSetAnchorSelectionIndex() throws Exception {
         model.addListSelectionListener(listener);
-
         model.setAnchorSelectionIndex(3);
         assertEquals(3, model.getAnchorSelectionIndex());
         checkSingleEvent(3, 3, false);
-
         listener.reset();
         model.setAnchorSelectionIndex(5);
         assertEquals(5, model.getAnchorSelectionIndex());
         checkSingleEvent(3, 5, false);
-
         listener.reset();
         model.setLeadAnchorNotificationEnabled(false);
         model.setAnchorSelectionIndex(7);
         assertEquals(7, model.getAnchorSelectionIndex());
         assertEquals(0, listener.getEvents().size());
-
         listener.reset();
         model.setAnchorSelectionIndex(-1);
         assertEquals(-1, model.getAnchorSelectionIndex());
@@ -505,19 +445,16 @@
     public void testGetSetLeadSelectionIndex() throws Exception {
         model.addListSelectionListener(listener);
         model.setSelectionInterval(3, 6);
-
         listener.reset();
         model.setLeadSelectionIndex(-1);
         assertEquals(6, model.getLeadSelectionIndex());
         assertEquals(0, listener.getEvents().size());
-
         listener.reset();
         model.setLeadSelectionIndex(4);
         assertEquals(4, model.getLeadSelectionIndex());
         checkIntervalState(3, 4, true);
         checkIntervalState(5, 6, false);
         checkSingleEvent(4, 6, false);
-
         model.setSelectionInterval(3, 6);
         model.setAnchorSelectionIndex(2);
         listener.reset();
@@ -527,58 +464,48 @@
         checkSingleEvent(3, 8, false);
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
-
         model.clearSelection();
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
         assertTrue(model.isSelectionEmpty());
-
         model.setAnchorSelectionIndex(5);
         assertEquals(5, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
         assertTrue(model.isSelectionEmpty());
-
         model.setLeadSelectionIndex(8);
         assertEquals(5, model.getAnchorSelectionIndex());
         assertEquals(8, model.getLeadSelectionIndex());
         assertTrue(model.isSelectionEmpty());
-
         model.setLeadSelectionIndex(20);
         assertEquals(5, model.getAnchorSelectionIndex());
         assertEquals(20, model.getLeadSelectionIndex());
         assertTrue(model.isSelectionEmpty());
-
         model.setAnchorSelectionIndex(1);
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(20, model.getLeadSelectionIndex());
         assertTrue(model.isSelectionEmpty());
-
         model.setLeadSelectionIndex(19);
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(19, model.getLeadSelectionIndex());
         checkIntervalState(0, 19, false);
         checkIntervalState(20, 20, true);
         checkIntervalState(21, 100, false);
-
         model.setSelectionInterval(2, 5);
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
         checkIntervalState(0, 1, false);
         checkIntervalState(2, 5, true);
         checkIntervalState(6, 10, false);
-
         model.setAnchorSelectionIndex(1);
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(5, model.getLeadSelectionIndex());
         checkIntervalState(0, 1, false);
         checkIntervalState(2, 5, true);
         checkIntervalState(6, 10, false);
-
         model.setLeadSelectionIndex(7);
         assertEquals(1, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
         checkIntervalState(0, 10, false);
-
         model.setSelectionInterval(2, 7);
         assertEquals(2, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -587,7 +514,6 @@
         checkIntervalState(0, 1, false);
         checkIntervalState(2, 6, true);
         checkIntervalState(7, 10, false);
-
         model.setSelectionInterval(3, 7);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -595,7 +521,6 @@
         checkIntervalState(0, 2, false);
         checkIntervalState(3, 3, true);
         checkIntervalState(4, 10, false);
-
         model.setSelectionInterval(3, 7);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -603,7 +528,6 @@
         checkIntervalState(0, 2, false);
         checkIntervalState(3, 3, true);
         checkIntervalState(4, 10, false);
-
         model.setSelectionInterval(3, 7);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -611,7 +535,6 @@
         checkIntervalState(0, 0, false);
         checkIntervalState(1, 3, true);
         checkIntervalState(4, 10, false);
-
         model.setSelectionInterval(3, 7);
         assertEquals(3, model.getAnchorSelectionIndex());
         assertEquals(7, model.getLeadSelectionIndex());
@@ -626,19 +549,22 @@
         assertNotNull(model.toString());
     }
 
-    private void checkIntervalState(final int beginIndex, final int endIndex, final boolean selected) {
+    private void checkIntervalState(final int beginIndex, final int endIndex,
+            final boolean selected) {
         for (int i = beginIndex; i <= endIndex; i++) {
             assertEquals(selected, model.isSelectedIndex(i));
         }
     }
 
-    private void checkSingleEvent(final int beginIndex, final int endIndex, final boolean isAdjusting) {
+    private void checkSingleEvent(final int beginIndex, final int endIndex,
+            final boolean isAdjusting) {
         checkSingleEvent(listener, beginIndex, endIndex, isAdjusting);
     }
 
-    private void checkSingleEvent(final TestListener listener, final int beginIndex, final int endIndex, final boolean isAdjusting) {
+    private void checkSingleEvent(final TestListener listener, final int beginIndex,
+            final int endIndex, final boolean isAdjusting) {
         assertEquals(1, listener.getEvents().size());
-        ListSelectionEvent event = (ListSelectionEvent)listener.getEvents().get(0);
+        ListSelectionEvent event = listener.getEvents().get(0);
         assertEquals(model, event.getSource());
         assertEquals(beginIndex, event.getFirstIndex());
         assertEquals(endIndex, event.getLastIndex());
@@ -646,13 +572,13 @@
     }
 
     private class TestListener implements ListSelectionListener {
-        private List events = new ArrayList();
+        private List<ListSelectionEvent> events = new ArrayList<ListSelectionEvent>();
 
         public void valueChanged(final ListSelectionEvent event) {
             events.add(event);
         }
 
-        public List getEvents() {
+        public List<ListSelectionEvent> getEvents() {
             return events;
         }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultSingleSelectionModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultSingleSelectionModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultSingleSelectionModelTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultSingleSelectionModelTest.java Sat Nov 25 16:04:10 2006
@@ -21,36 +21,35 @@
 package javax.swing;
 
 import java.awt.event.KeyListener;
-
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
 public class DefaultSingleSelectionModelTest extends SwingTestCase {
     private DefaultSingleSelectionModel model;
+
     private TestChangeListener listener;
 
     public DefaultSingleSelectionModelTest(final String name) {
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         model = new DefaultSingleSelectionModel();
         listener = new TestChangeListener();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         model = null;
     }
 
     public void testAddRemoveGetChangeListener() throws Exception {
         assertEquals(0, model.getChangeListeners().length);
-
         model.addChangeListener(new TestChangeListener());
         model.addChangeListener(listener);
         model.addChangeListener(new TestChangeListener());
-
         assertEquals(3, model.getChangeListeners().length);
-
         model.removeChangeListener(listener);
         assertEquals(2, model.getChangeListeners().length);
     }
@@ -58,16 +57,12 @@
     public void testGetSetIsClearSelection() throws Exception {
         assertEquals(-1, model.getSelectedIndex());
         assertFalse(model.isSelected());
-
         TestChangeListener listener = new TestChangeListener();
         model.addChangeListener(listener);
-
         model.setSelectedIndex(4);
         assertEquals(4, model.getSelectedIndex());
         assertTrue(model.isSelected());
         assertNotNull(listener.getChangeEvent());
-
-
         listener.reset();
         model.clearSelection();
         assertEquals(-1, model.getSelectedIndex());
@@ -78,9 +73,7 @@
     public void testGetListeners() throws Exception {
         assertEquals(0, model.getListeners(ChangeListener.class).length);
         assertEquals(0, model.getListeners(KeyListener.class).length);
-
         model.addChangeListener(listener);
-
         assertEquals(1, model.getListeners(ChangeListener.class).length);
         assertEquals(0, model.getListeners(KeyListener.class).length);
     }
@@ -89,17 +82,14 @@
         TestChangeListener listener2 = new TestChangeListener();
         model.addChangeListener(listener);
         model.addChangeListener(listener2);
-
         assertNull(model.changeEvent);
         model.fireStateChanged();
         assertNotNull(model.changeEvent);
         assertEquals(model, model.changeEvent.getSource());
-
         assertEquals(model.changeEvent, listener.getChangeEvent());
         assertEquals(model.changeEvent, listener2.getChangeEvent());
     }
 
-
     private class TestChangeListener implements ChangeListener {
         private ChangeEvent changeEvent;
 
@@ -116,5 +106,3 @@
         }
     }
 }
-
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ExtJTextArea.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ExtJTextArea.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ExtJTextArea.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ExtJTextArea.java Sat Nov 25 16:04:10 2006
@@ -19,16 +19,20 @@
  * @version $Revision$
  */
 package javax.swing;
-import java.awt.Rectangle;
 
+import java.awt.Rectangle;
 import javax.swing.text.Document;
 
 public class ExtJTextArea extends JTextArea {
+    private static final long serialVersionUID = 1L;
+
     public int flag = 0;
+
     public boolean wasCallInvalidate = false;
+
     public boolean wasCallRevalidate = false;
 
-    public ExtJTextArea(){
+    public ExtJTextArea() {
         super();
     }
 
@@ -36,36 +40,37 @@
         super(doc);
     }
 
-    public ExtJTextArea(final Document doc, final String text, final int rows, final int columns){
+    public ExtJTextArea(final Document doc, final String text, final int rows, final int columns) {
         super(doc, text, rows, columns);
     }
 
     public ExtJTextArea(final int rows, final int columns) {
-        super(rows,columns);
+        super(rows, columns);
     }
 
-    public ExtJTextArea(final String s){
+    public ExtJTextArea(final String s) {
         super(s);
     }
 
-    public ExtJTextArea(final String text, final int rows, final int columns){
+    public ExtJTextArea(final String text, final int rows, final int columns) {
         super(text, rows, columns);
     }
 
+    @Override
     public void invalidate() {
         wasCallInvalidate = true;
         super.invalidate();
     }
 
+    @Override
     public void revalidate() {
         wasCallRevalidate = true;
         super.revalidate();
     }
 
+    @Override
     public void scrollRectToVisible(final Rectangle aRect) {
         flag = 1;
         super.scrollRectToVisible(aRect);
     }
-
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/FocusManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/FocusManagerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/FocusManagerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/FocusManagerTest.java Sat Nov 25 16:04:10 2006
@@ -25,7 +25,6 @@
 import java.awt.DefaultFocusTraversalPolicy;
 import java.awt.FocusTraversalPolicy;
 import java.awt.KeyboardFocusManager;
-
 import junit.framework.TestCase;
 
 public class FocusManagerTest extends TestCase {
@@ -33,43 +32,51 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
-        KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(new TestPolicy());
+        KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalPolicy(
+                new TestPolicy());
     }
 
     public void testGetSetCurrentManager() throws Exception {
-        FocusManager m = new FocusManager() {};
+        FocusManager m = new FocusManager() {
+        };
         FocusManager.setCurrentManager(m);
         assertEquals(m, KeyboardFocusManager.getCurrentKeyboardFocusManager());
     }
 
     public void testIsFocusManagerEnabled() throws Exception {
         assertTrue(FocusManager.isFocusManagerEnabled());
-        assertFalse(KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy() instanceof DefaultFocusTraversalPolicy);
-
+        assertFalse(KeyboardFocusManager.getCurrentKeyboardFocusManager()
+                .getDefaultFocusTraversalPolicy() instanceof DefaultFocusTraversalPolicy);
         FocusManager.disableSwingFocusManager();
         assertFalse(FocusManager.isFocusManagerEnabled());
-        assertTrue(KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalPolicy() instanceof DefaultFocusTraversalPolicy);
+        assertTrue(KeyboardFocusManager.getCurrentKeyboardFocusManager()
+                .getDefaultFocusTraversalPolicy() instanceof DefaultFocusTraversalPolicy);
     }
 
-
     private class TestPolicy extends FocusTraversalPolicy {
+        @Override
         public Component getComponentAfter(final Container a0, final Component a1) {
             return null;
         }
 
+        @Override
         public Component getComponentBefore(final Container a0, final Component a1) {
             return null;
         }
 
+        @Override
         public Component getDefaultComponent(final Container a0) {
             return null;
         }
 
+        @Override
         public Component getFirstComponent(final Container a0) {
             return null;
         }
 
+        @Override
         public Component getLastComponent(final Container a0) {
             return null;
         }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/GrayFilterTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/GrayFilterTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/GrayFilterTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/GrayFilterTest.java Sat Nov 25 16:04:10 2006
@@ -24,7 +24,6 @@
 import java.awt.Image;
 import java.awt.image.BufferedImage;
 
-
 public class GrayFilterTest extends SwingTestCase {
     private GrayFilter filter;
 
@@ -32,6 +31,7 @@
         super(name);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         filter = null;
     }
@@ -60,9 +60,7 @@
     public void testCreateDisabledImage() throws Exception {
         Image original = new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
         Image grayed = GrayFilter.createDisabledImage(original);
-
         assertNotNull(grayed);
-
         assertEquals(original.getHeight(null), grayed.getHeight(null));
         assertEquals(original.getWidth(null), grayed.getWidth(null));
         assertEquals(20, grayed.getWidth(null));
@@ -70,7 +68,6 @@
         assertNotSame(original, grayed);
     }
 
-
     private void checkIncorrectGrayPercentage(final int percentage) {
         try {
             new GrayFilter(false, percentage);
@@ -84,19 +81,19 @@
     private void checkRange(final int percentage, final int expectedInterval) {
         filter = new GrayFilter(false, percentage);
         checkIsClosedTo(0, filter.filterRGB(0, 0, new Color(0, 0, 0).getRGB()));
-        checkIsClosedTo(expectedInterval, filter.filterRGB(0, 0, new Color(255, 255, 255).getRGB()));
-
+        checkIsClosedTo(expectedInterval, filter.filterRGB(0, 0, new Color(255, 255, 255)
+                .getRGB()));
         int lowBound = 255 * percentage / 100;
         filter = new GrayFilter(true, percentage);
         checkIsClosedTo(lowBound, filter.filterRGB(0, 0, new Color(0, 0, 0).getRGB()));
-        checkIsClosedTo(lowBound + expectedInterval, filter.filterRGB(0, 0, new Color(255, 255, 255).getRGB()));
+        checkIsClosedTo(lowBound + expectedInterval, filter.filterRGB(0, 0, new Color(255, 255,
+                255).getRGB()));
     }
 
     private void checkIsClosedTo(final int expected, final int actualRGB) {
         Color c = new Color(actualRGB);
         assertEquals(c.getRed(), c.getGreen());
         assertEquals(c.getRed(), c.getBlue());
-
         assertTrue(Math.abs(c.getRed() - expected) <= 1);
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIconTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIconTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIconTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIconTest.java Sat Nov 25 16:04:10 2006
@@ -30,18 +30,20 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
-
 import javax.accessibility.AccessibleContext;
 
 public class ImageIconTest extends SwingTestCase {
-
     private static final String FILE_NAME_1 = "images/Error.gif";
+
     private static final int FILE_SIZE_1 = 923;
+
     private static final int ICON_SIZE_1 = 32;
 
     private static final String FILE_NAME_2 = "ImageIconTest.class";
 
     class MyImageIcon extends ImageIcon {
+        private static final long serialVersionUID = 1L;
+
         public Component getComponent() {
             return component;
         }
@@ -50,10 +52,10 @@
             return tracker;
         }
 
+        @Override
         public void loadImage(final Image image) {
             super.loadImage(image);
         }
-
     };
 
     protected ImageIcon icon = null;
@@ -61,6 +63,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -68,6 +71,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         icon = null;
         super.tearDown();
@@ -79,20 +83,16 @@
     public void testImageIconString() {
         URL url1 = getClass().getResource(FILE_NAME_1);
         URL url2 = getClass().getResource(FILE_NAME_2);
-
         assertNotNull("file is found", url1);
         String filePath1 = url1.getPath();
-
         // preventing jar failures
         if (filePath1.indexOf(".jar!") != -1) {
             return;
         }
-
         icon = new ImageIcon(filePath1);
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertEquals("description", filePath1, icon.getDescription());
         assertEquals("width", ICON_SIZE_1, icon.getIconWidth());
-
         assertNotNull("file is found", url2);
         String filePath2 = url2.getPath();
         icon = new ImageIcon(filePath2);
@@ -109,20 +109,16 @@
         final String description2 = null;
         URL url1 = getClass().getResource(FILE_NAME_1);
         URL url2 = getClass().getResource(FILE_NAME_2);
-
         assertNotNull("file is found", url1);
         String filePath1 = url1.getPath();
-
         // preventing jar failures
         if (filePath1.indexOf(".jar!") != -1) {
             return;
         }
-
         icon = new ImageIcon(filePath1, description1);
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertEquals("description", description1, icon.getDescription());
         assertEquals("width", ICON_SIZE_1, icon.getIconWidth());
-
         assertNotNull("file is found", url2);
         String filePath2 = url2.getPath();
         icon = new ImageIcon(filePath2, description2);
@@ -137,13 +133,11 @@
     public void testImageIconURL() {
         URL url1 = getClass().getResource(FILE_NAME_1);
         URL url2 = getClass().getResource(FILE_NAME_2);
-
         assertNotNull("file is found", url1);
         icon = new ImageIcon(url1);
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertEquals("description", url1.toString(), icon.getDescription());
         assertEquals("width", ICON_SIZE_1, icon.getIconWidth());
-
         assertNotNull("file is found", url2);
         icon = new ImageIcon(url2);
         assertEquals("loaded", MediaTracker.ERRORED, icon.getImageLoadStatus());
@@ -159,13 +153,11 @@
         final String description2 = null;
         URL url1 = getClass().getResource(FILE_NAME_1);
         URL url2 = getClass().getResource(FILE_NAME_2);
-
         assertNotNull("file is found", url1);
         icon = new ImageIcon(url1, description1);
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertEquals("description", description1, icon.getDescription());
         assertEquals("width", ICON_SIZE_1, icon.getIconWidth());
-
         assertNotNull("file is found", url2);
         icon = new ImageIcon(url2, description2);
         assertEquals("loaded", MediaTracker.ERRORED, icon.getImageLoadStatus());
@@ -179,19 +171,16 @@
     public void testImageIconImageString() {
         final String description1 = "bullet in your head";
         final String description2 = "born without a face";
-
         Image image1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB) {
+            @Override
             public Object getProperty(final String name, final ImageObserver observer) {
                 return description1;
             }
         };
-
         icon = new ImageIcon(image1, description2);
         assertEquals("description", description2, icon.getDescription());
-
         icon = new ImageIcon(image1, null);
         assertNull("description", icon.getDescription());
-
         assertEquals("image", image1, icon.getImage());
     }
 
@@ -202,12 +191,10 @@
         InputStream stream1 = getClass().getResourceAsStream(FILE_NAME_1);
         assertTrue("file is found", stream1 != null);
         byte[] array1 = new byte[10000];
-
         icon = new ImageIcon(array1);
         assertEquals("loaded", MediaTracker.ERRORED, icon.getImageLoadStatus());
         assertNull("description", icon.getDescription());
         assertEquals("width", -1, icon.getIconWidth());
-
         int bytesRead = stream1.read(array1);
         assertEquals("array size", FILE_SIZE_1, bytesRead);
         icon = new ImageIcon(array1);
@@ -227,12 +214,10 @@
         InputStream stream1 = getClass().getResourceAsStream(FILE_NAME_1);
         assertTrue("file is found", stream1 != null);
         byte[] array1 = new byte[10000];
-
         icon = new ImageIcon(array1, description1);
         assertEquals("loaded", MediaTracker.ERRORED, icon.getImageLoadStatus());
         assertEquals("description", description1, icon.getDescription());
         assertEquals("width", -1, icon.getIconWidth());
-
         int bytesRead = stream1.read(array1);
         assertEquals("array size", FILE_SIZE_1, bytesRead);
         icon = new ImageIcon(array1, description2);
@@ -246,19 +231,17 @@
      */
     public void testImageIconImage() {
         final String description1 = "bullet in your head";
-
         Image image1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB) {
+            @Override
             public Object getProperty(final String name, final ImageObserver observer) {
                 return description1;
             }
         };
         Image image2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
-
         icon = new ImageIcon(image1);
         assertEquals("description", description1, icon.getDescription());
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertEquals("image", image1, icon.getImage());
-
         icon = new ImageIcon(image2);
         assertNull("description", icon.getDescription());
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
@@ -270,7 +253,6 @@
      */
     public void testImageIcon() {
         icon = new ImageIcon();
-
         assertNull("image", icon.getImage());
         assertEquals("height", -1, icon.getIconHeight());
         assertEquals("width", -1, icon.getIconWidth());
@@ -281,9 +263,10 @@
     public void testGetAccessibleContext() {
         int width = 11;
         int height = 32;
-        ImageIcon icon1 = new ImageIcon(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
-        ImageIcon icon2 = new ImageIcon(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
-
+        ImageIcon icon1 = new ImageIcon(new BufferedImage(width, height,
+                BufferedImage.TYPE_INT_RGB));
+        ImageIcon icon2 = new ImageIcon(new BufferedImage(width, height,
+                BufferedImage.TYPE_INT_RGB));
         AccessibleContext accessible1 = icon1.getAccessibleContext();
         AccessibleContext accessible2 = icon1.getAccessibleContext();
         AccessibleContext accessible3 = icon2.getAccessibleContext();
@@ -303,50 +286,42 @@
      */
     public void testToString() {
         final String description = "bullet in your head";
-
         Image image1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
-
         icon = new ImageIcon(image1, description);
         assertEquals("string is not empty", description, icon.toString());
-
         icon = new ImageIcon(image1);
-        assertTrue("string is not empty", icon.toString() != null && !icon.toString().equals(""));
+        assertTrue("string is not empty", icon.toString() != null
+                && !icon.toString().equals(""));
     }
 
     public void testGetDescription() {
         final String description1 = "bullet in your head";
         final String description2 = "born without a face";
         final String description3 = "snakecharmer";
-
         Image image1 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB) {
+            @Override
             public Object getProperty(final String name, final ImageObserver observer) {
                 return description1;
             }
         };
         Image image2 = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB) {
+            @Override
             public Object getProperty(final String name, final ImageObserver observer) {
                 return description3;
             }
         };
-
         icon = new ImageIcon(image1);
         assertEquals("description", description1, icon.getDescription());
-
         icon.setDescription(description2);
         assertEquals("description", description2, icon.getDescription());
-
         icon.setDescription(null);
         assertNull("description", icon.getDescription());
-
         icon.setDescription(description2);
         assertEquals("description", description2, icon.getDescription());
-
         icon.setImage(image2);
         assertEquals("description", description2, icon.getDescription());
-
         icon = new ImageIcon(image2, description1);
         assertEquals("description", description1, icon.getDescription());
-
         icon = new ImageIcon(image2, null);
         assertNull("description", icon.getDescription());
     }
@@ -354,15 +329,12 @@
     public void testGetImageObserver() {
         ImageObserver observer1 = new JPanel();
         ImageObserver observer2 = new JPanel();
-
         int width = 111;
         int height = 235;
         icon = new ImageIcon(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
         assertNull(icon.getImageObserver());
-
         icon.setImageObserver(observer1);
         assertEquals("observer", observer1, icon.getImageObserver());
-
         icon.setImageObserver(observer2);
         assertEquals("observer", observer2, icon.getImageObserver());
     }
@@ -372,15 +344,12 @@
         int height = 235;
         Image image1 = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
         Image image2 = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
-
         icon = new ImageIcon(image1);
         assertEquals("image", image1, icon.getImage());
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
-
         icon.setImage(image2);
         assertEquals("image", image2, icon.getImage());
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
-
         icon.setImage(image1);
         assertEquals("image", image1, icon.getImage());
         assertEquals("loaded", MediaTracker.COMPLETE, icon.getImageLoadStatus());
@@ -393,7 +362,6 @@
         MyImageIcon icon = new MyImageIcon();
         assertEquals("load status", 0, icon.getImageLoadStatus());
         assertNull("image", icon.getImage());
-
         icon.loadImage(image1);
         assertEquals("load status", MediaTracker.COMPLETE, icon.getImageLoadStatus());
         assertNull("image", icon.getImage());
@@ -415,23 +383,18 @@
         int width = 111;
         int height = 235;
         icon = new ImageIcon(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
-
         assertEquals("width", width, icon.getIconWidth());
-
-        icon.setImage(new BufferedImage(7*width, 4*height, BufferedImage.TYPE_INT_RGB));
-        assertEquals("width", 7*width, icon.getIconWidth());
+        icon.setImage(new BufferedImage(7 * width, 4 * height, BufferedImage.TYPE_INT_RGB));
+        assertEquals("width", 7 * width, icon.getIconWidth());
     }
 
     public void testGetIconHeight() {
         int width = 111;
         int height = 235;
         icon = new ImageIcon(new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB));
-
         assertEquals("height", height, icon.getIconHeight());
-
-        icon.setImage(new BufferedImage(7*width, 4*height, BufferedImage.TYPE_INT_RGB));
-        assertEquals("height", 4*height, icon.getIconHeight());
-
+        icon.setImage(new BufferedImage(7 * width, 4 * height, BufferedImage.TYPE_INT_RGB));
+        assertEquals("height", 4 * height, icon.getIconHeight());
         icon = new ImageIcon("");
         assertEquals("height", -1, icon.getIconHeight());
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIcon_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIcon_MultithreadedTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIcon_MultithreadedTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ImageIcon_MultithreadedTest.java Sat Nov 25 16:04:10 2006
@@ -26,28 +26,28 @@
 import java.awt.Image;
 import java.awt.image.ImageObserver;
 import java.net.URL;
-
 import junit.framework.TestCase;
 
 public class ImageIcon_MultithreadedTest extends TestCase {
-
     class MyImageObserver implements ImageObserver {
         public boolean updated = false;
+
         public boolean installed = false;
+
         public Object lock = new Object();
 
-        public void reset () {
+        public void reset() {
             updated = false;
         }
 
-        public boolean imageUpdate(final Image img, final int infoflags, final int x, final int y, final int width, final int height) {
+        public boolean imageUpdate(final Image img, final int infoflags, final int x,
+                final int y, final int width, final int height) {
             updated = true;
             synchronized (lock) {
                 lock.notifyAll();
             }
             return true;
         }
-
     };
 
     protected ImageIcon icon = null;
@@ -61,6 +61,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -68,6 +69,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         if (frame != null) {
             frame.dispose();
@@ -77,36 +79,35 @@
     }
 
     public void testPaintIcon() {
-//      JFrame frame = new JFrame();
-//      String fileName1 = "images/animated.gif";
-//      URL url1 = getClass().getResource(fileName1);
-//      icon = new ImageIcon(url1);
-//      JButton button = new JButton(icon);
-//      frame.getContentPane().add(button);
-//      frame.pack();
-//      frame.show();
-//      InternalTests.isRealized(frame);
-//      MyImageObserver observer1 = new MyImageObserver();
-//      icon.setImageObserver(observer1);
-//      int timeToWait = 15000;
-//      while(timeToWait > 0) {
-//          try {
-//                Thread.sleep(10);
-//                timeToWait -= 10;
-//            } catch (InterruptedException e) {
-//                e.printStackTrace();
-//            }
-//      }
+        //      JFrame frame = new JFrame();
+        //      String fileName1 = "images/animated.gif";
+        //      URL url1 = getClass().getResource(fileName1);
+        //      icon = new ImageIcon(url1);
+        //      JButton button = new JButton(icon);
+        //      frame.getContentPane().add(button);
+        //      frame.pack();
+        //      frame.show();
+        //      InternalTests.isRealized(frame);
+        //      MyImageObserver observer1 = new MyImageObserver();
+        //      icon.setImageObserver(observer1);
+        //      int timeToWait = 15000;
+        //      while(timeToWait > 0) {
+        //          try {
+        //                Thread.sleep(10);
+        //                timeToWait -= 10;
+        //            } catch (InterruptedException e) {
+        //                e.printStackTrace();
+        //            }
+        //      }
     }
 
+    @SuppressWarnings("deprecation")
     public void testSetImageObserver() {
         final MyImageObserver observer1 = new MyImageObserver();
         String fileName1 = "images/animated.gif";
         final URL url = getClass().getResource(fileName1);
         assertTrue("file is found", url != null);
-
         assertFalse("observer is not notified", observer1.updated);
-
         frame = new JFrame();
         ImageIcon icon1 = new ImageIcon(url);
         JButton button = new JButton(icon1);
@@ -120,16 +121,12 @@
         frame.pack();
         frame.show();
         SwingWaitTestCase.isRealized(frame);
-
-
         waitTillObserverNotified(observer1, 3000);
         assertTrue("observer is notified", observer1.updated);
         observer1.reset();
-
         waitTillObserverNotified(observer1, 3000);
         assertTrue("observer is notified", observer1.updated);
         observer1.reset();
-
         waitTillObserverNotified(observer1, 3000);
         assertTrue("observer is notified", observer1.updated);
         observer1.reset();
@@ -152,7 +149,6 @@
             }
         }
         assertTrue("observer did manage to be installed", observer.installed);
-
         timeRemains = maxWaitTime;
         while (timeRemains > 0 && !observer.updated) {
             try {
@@ -165,5 +161,4 @@
             }
         }
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/InputMapRTest.java Sat Nov 25 16:04:10 2006
@@ -20,13 +20,14 @@
  */
 package javax.swing;
 
-
 public class InputMapRTest extends SwingTestCase {
-
     public void testGet() {
         InputMap map = new InputMap();
         final String key = "result";
-        map.setParent(new InputMap () {
+        map.setParent(new InputMap() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public Object get(KeyStroke ks) {
                 return key;
             }



Mime
View raw message