harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [5/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/Box_AccessibleBoxTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_AccessibleBoxTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_AccessibleBoxTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_AccessibleBoxTest.java
Sat Nov 25 16:04:10 2006
@@ -26,7 +26,6 @@
 import javax.accessibility.AccessibleRole;
 
 public class Box_AccessibleBoxTest extends SwingTestCase {
-
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(Box_AccessibleBoxTest.class);
     }
@@ -34,6 +33,7 @@
     public void testGetAccessibleRole() {
         Box box = new Box(BoxLayout.X_AXIS);
         AccessibleContext accessible = box.getAccessibleContext();
-        assertEquals("Accessible role is correct ", AccessibleRole.FILLER, accessible.getAccessibleRole());
+        assertEquals("Accessible role is correct ", AccessibleRole.FILLER, accessible
+                .getAccessibleRole());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_FillerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_FillerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_FillerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_FillerTest.java
Sat Nov 25 16:04:10 2006
@@ -24,11 +24,9 @@
 
 import java.awt.Component;
 import java.awt.Dimension;
-
 import javax.accessibility.AccessibleContext;
 
 public class Box_FillerTest extends SwingTestCase {
-
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(Box_FillerTest.class);
     }
@@ -36,6 +34,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -45,20 +44,17 @@
         Dimension preferredSize = new Dimension(200, 200);
         Dimension maximumSize = new Dimension(300, 300);
         Box.Filler filler = new Box.Filler(minimumSize, preferredSize, maximumSize);
-
-        assertEquals("Minimum size initialized correctly ", minimumSize, filler.getMinimumSize());
-        assertEquals("Preferred size initialized correctly ", preferredSize, filler.getPreferredSize());
-        assertEquals("Maximum size initialized correctly ", maximumSize, filler.getMaximumSize());
-
+        assertEquals("Minimum size initialized correctly ", minimumSize, filler
+                .getMinimumSize());
+        assertEquals("Preferred size initialized correctly ", preferredSize, filler
+                .getPreferredSize());
+        assertEquals("Maximum size initialized correctly ", maximumSize, filler
+                .getMaximumSize());
         assertFalse("Opaqueness initialized correctly", filler.isOpaque());
-
-
         filler = new Box.Filler(null, null, null);
-
         assertNull("Minimum size initialized correctly ", filler.getMinimumSize());
         assertNull("Preferred size initialized correctly ", filler.getPreferredSize());
         assertNull("Maximum size initialized correctly ", filler.getMaximumSize());
-
         assertFalse("Opaqueness initialized correctly", filler.isOpaque());
     }
 
@@ -70,14 +66,11 @@
         Dimension initPreferredSize = new Dimension(200, 200);
         Dimension initMaximumSize = new Dimension(300, 300);
         Box.Filler filler = new Box.Filler(initMinimumSize, initPreferredSize, initMaximumSize);
-
-        assertEquals("Minimum size initialized correctly ", initMinimumSize, filler.getMinimumSize());
-
+        assertEquals("Minimum size initialized correctly ", initMinimumSize, filler
+                .getMinimumSize());
         Dimension minimumSize = new Dimension(1000, 1000);
         filler.setMinimumSize(minimumSize);
-
         assertEquals("Minimum size is unchangeable", initMinimumSize, filler.getMinimumSize());
-
         filler.setMinimumSize(null);
         assertEquals("Minimum size is unchangeable ", initMinimumSize, filler.getMinimumSize());
     }
@@ -90,14 +83,11 @@
         Dimension initPreferredSize = new Dimension(200, 200);
         Dimension initMaximumSize = new Dimension(300, 300);
         Box.Filler filler = new Box.Filler(initMinimumSize, initPreferredSize, initMaximumSize);
-
-        assertEquals("Maximum size initialized correctly ", initMaximumSize, filler.getMaximumSize());
-
+        assertEquals("Maximum size initialized correctly ", initMaximumSize, filler
+                .getMaximumSize());
         Dimension maximumSize = new Dimension(1000, 1000);
         filler.setMaximumSize(maximumSize);
-
         assertEquals("Minimum size is unchangeable", initMaximumSize, filler.getMaximumSize());
-
         filler.setMaximumSize(null);
         assertEquals("Minimum size is unchangeable ", initMaximumSize, filler.getMaximumSize());
     }
@@ -110,16 +100,15 @@
         Dimension initPreferredSize = new Dimension(200, 200);
         Dimension initMaximumSize = new Dimension(300, 300);
         Box.Filler filler = new Box.Filler(initMinimumSize, initPreferredSize, initMaximumSize);
-
-        assertEquals("Preferred size initialized correctly ", initPreferredSize, filler.getPreferredSize());
-
+        assertEquals("Preferred size initialized correctly ", initPreferredSize, filler
+                .getPreferredSize());
         Dimension preferredSize = new Dimension(1000, 1000);
         filler.setPreferredSize(preferredSize);
-
-        assertEquals("Minimum size is unchangeable", initPreferredSize, filler.getPreferredSize());
-
+        assertEquals("Minimum size is unchangeable", initPreferredSize, filler
+                .getPreferredSize());
         filler.setPreferredSize(null);
-        assertEquals("Minimum size is unchangeable ", initPreferredSize, filler.getPreferredSize());
+        assertEquals("Minimum size is unchangeable ", initPreferredSize, filler
+                .getPreferredSize());
     }
 
     /*
@@ -128,7 +117,8 @@
     public void testGetAccessibleContext() {
         Component filler = Box.createVerticalGlue();
         AccessibleContext accessible = filler.getAccessibleContext();
-        assertEquals("Accessible context is correct ", Box.Filler.AccessibleBoxFiller.class,
accessible.getClass());
+        assertEquals("Accessible context is correct ", Box.Filler.AccessibleBoxFiller.class,
+                accessible.getClass());
     }
 
     public void testChangeShape() {
@@ -136,19 +126,19 @@
         Dimension preferredSize = new Dimension(200, 200);
         Dimension maximumSize = new Dimension(300, 300);
         Box.Filler filler = new Box.Filler(minimumSize, preferredSize, maximumSize);
-
-        assertEquals("Minimum size initialized correctly ", minimumSize, filler.getMinimumSize());
-        assertEquals("Preferred size initialized correctly ", preferredSize, filler.getPreferredSize());
-        assertEquals("Maximum size initialized correctly ", maximumSize, filler.getMaximumSize());
-
+        assertEquals("Minimum size initialized correctly ", minimumSize, filler
+                .getMinimumSize());
+        assertEquals("Preferred size initialized correctly ", preferredSize, filler
+                .getPreferredSize());
+        assertEquals("Maximum size initialized correctly ", maximumSize, filler
+                .getMaximumSize());
         minimumSize = new Dimension(110, 110);
         preferredSize = new Dimension(220, 220);
         maximumSize = new Dimension(330, 330);
         filler.changeShape(minimumSize, preferredSize, maximumSize);
-
         assertEquals("Minimum size's changed correctly ", minimumSize, filler.getMinimumSize());
-        assertEquals("Preferred size's changed correctly ", preferredSize, filler.getPreferredSize());
+        assertEquals("Preferred size's changed correctly ", preferredSize, filler
+                .getPreferredSize());
         assertEquals("Maximum size's changed correctly ", maximumSize, filler.getMaximumSize());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_Filler_AccessibleBoxFillerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_Filler_AccessibleBoxFillerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_Filler_AccessibleBoxFillerTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Box_Filler_AccessibleBoxFillerTest.java
Sat Nov 25 16:04:10 2006
@@ -23,12 +23,10 @@
 package javax.swing;
 
 import java.awt.Component;
-
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleRole;
 
 public class Box_Filler_AccessibleBoxFillerTest extends SwingTestCase {
-
     public static void main(final String[] args) {
         junit.textui.TestRunner.run(Box_Filler_AccessibleBoxFillerTest.class);
     }
@@ -39,7 +37,7 @@
     public void testGetAccessibleRole() {
         Component box = Box.createVerticalGlue();
         AccessibleContext accessible = box.getAccessibleContext();
-        assertEquals("Accessible role is correct ", AccessibleRole.FILLER, accessible.getAccessibleRole());
+        assertEquals("Accessible role is correct ", AccessibleRole.FILLER, accessible
+                .getAccessibleRole());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ButtonGroupTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ButtonGroupTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ButtonGroupTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ButtonGroupTest.java
Sat Nov 25 16:04:10 2006
@@ -23,20 +23,16 @@
 package javax.swing;
 
 import java.util.Enumeration;
-
 import junit.framework.TestCase;
 
 public class ButtonGroupTest extends TestCase {
-
     protected ButtonGroup group;
+
     protected AbstractButton[] buttons;
 
-    /*
-     * @see TestCase#setUp()
-     */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         group = new ButtonGroup();
         buttons = new AbstractButton[5];
         buttons[0] = new JCheckBox();
@@ -46,13 +42,6 @@
         buttons[4] = new JButton();
     }
 
-    /*
-     * @see TestCase#tearDown()
-     */
-    protected void tearDown() throws Exception {
-        super.tearDown();
-    }
-
     public void testButtonGroup() {
         assertEquals("initial number of buttons", 0, group.getButtonCount());
         assertNull("initial selection", group.getSelection());
@@ -62,26 +51,23 @@
 
     public void testAdd() {
         buttons[0].setSelected(true);
-        final DefaultButtonModel model = (DefaultButtonModel)buttons[0].getModel();
+        final DefaultButtonModel model = (DefaultButtonModel) buttons[0].getModel();
         assertNull(model.getGroup());
         group.add(buttons[0]);
         assertSame(group, model.getGroup());
         assertEquals("number of buttons", 1, group.getButtonCount());
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
-
         group.add(buttons[0]);
         assertEquals("number of buttons", 2, group.getButtonCount());
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
-
         buttons[3].setSelected(true);
         group.add(buttons[3]);
         assertEquals("number of buttons", 3, group.getButtonCount());
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
-
         buttons[4].setSelected(true);
         group.add(buttons[4]);
         assertEquals("number of buttons", 4, group.getButtonCount());
@@ -89,7 +75,6 @@
         assertTrue("selected model", buttons[0].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
-        
         group.add(null);
     }
 
@@ -98,33 +83,25 @@
         group.add(buttons[0]);
         group.add(buttons[3]);
         group.add(buttons[4]);
-
-        final DefaultButtonModel model = (DefaultButtonModel)buttons[0].getModel();
+        final DefaultButtonModel model = (DefaultButtonModel) buttons[0].getModel();
         assertSame(group, model.getGroup());
         assertEquals("number of buttons", 4, group.getButtonCount());
-
         buttons[0].setSelected(true);
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
-
         group.remove(buttons[0]);
         assertEquals("number of buttons", 3, group.getButtonCount());
         assertNull("selection", group.getSelection());
-
         buttons[0].setSelected(true);
         assertNull("selection", group.getSelection());
-
         group.remove(buttons[0]);
         assertEquals("number of buttons", 2, group.getButtonCount());
         assertNull(model.getGroup());
-
         group.remove(buttons[2]);
         assertEquals("number of buttons", 2, group.getButtonCount());
-
         group.remove(buttons[3]);
         assertNull("selection", group.getSelection());
         group.remove(buttons[4]);
         assertEquals("number of buttons", 0, group.getButtonCount());
-        
         group.remove(null);
     }
 
@@ -139,8 +116,7 @@
         group.add(buttons[0]);
         group.add(buttons[3]);
         group.add(buttons[4]);
-
-        Enumeration i = group.getElements();
+        Enumeration<AbstractButton> i = group.getElements();
         assertEquals("button", buttons[0], i.nextElement());
         assertEquals("button", buttons[0], i.nextElement());
         assertEquals("button", buttons[3], i.nextElement());
@@ -154,10 +130,8 @@
         group.add(buttons[3]);
         group.add(buttons[4]);
         assertNull("initial selection", group.getSelection());
-
         group.setSelected(buttons[0].getModel(), false);
         assertNull("selection", group.getSelection());
-
         group.setSelected(buttons[4].getModel(), true);
         assertEquals("selection", buttons[4].getModel(), group.getSelection());
         assertFalse("unselected model", buttons[0].getModel().isSelected());
@@ -165,7 +139,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertTrue("selected model", buttons[4].getModel().isSelected());
-
         group.setSelected(buttons[0].getModel(), true);
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
@@ -173,7 +146,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         group.setSelected(buttons[0].getModel(), false);
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
@@ -181,7 +153,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         buttons[0].setSelected(false);
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
@@ -189,7 +160,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         group.setSelected(buttons[3].getModel(), true);
         assertEquals("selection", buttons[3].getModel(), group.getSelection());
         assertFalse("unselected model", buttons[0].getModel().isSelected());
@@ -197,7 +167,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertTrue("selected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         group.setSelected(buttons[2].getModel(), true);
         assertEquals("selection", buttons[2].getModel(), group.getSelection());
         assertFalse("unselected model", buttons[0].getModel().isSelected());
@@ -205,7 +174,6 @@
         assertTrue("selected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         buttons[1].setSelected(true);
         assertEquals("selection", buttons[1].getModel(), group.getSelection());
         assertFalse("unselected model", buttons[0].getModel().isSelected());
@@ -213,7 +181,6 @@
         assertFalse("unselected model", buttons[2].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
         assertFalse("unselected model", buttons[4].getModel().isSelected());
-
         buttons[4].setSelected(true);
         assertEquals("selection", buttons[1].getModel(), group.getSelection());
         assertFalse("unselected model", buttons[0].getModel().isSelected());
@@ -233,12 +200,10 @@
         assertEquals("selection", buttons[0].getModel(), group.getSelection());
         assertTrue("selected model", buttons[0].getModel().isSelected());
         assertFalse("unselected model", buttons[3].getModel().isSelected());
-
         buttons[1].setSelected(true);
         buttons[2].setSelected(true);
         assertFalse("selected model", group.isSelected(buttons[1].getModel()));
         assertFalse("selected model", group.isSelected(buttons[2].getModel()));
-
     }
 
     public void testSetSelected() {
@@ -247,5 +212,4 @@
         group.setSelected(null, false);
         group.setSelected(null, true);
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/CellRendererPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/CellRendererPaneTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/CellRendererPaneTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/CellRendererPaneTest.java
Sat Nov 25 16:04:10 2006
@@ -32,15 +32,16 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         pane = new CellRendererPane();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         pane = null;
     }
 
-
     public void testCellRendererPane() throws Exception {
         assertNull(pane.accessibleContext);
     }
@@ -49,24 +50,19 @@
         JComponent c1 = new JPanel();
         JComponent c2 = new JPanel();
         JComponent c3 = new JPanel();
-
         assertEquals(0, pane.getComponentCount());
-
         pane.add(c1);
         assertEquals(1, pane.getComponentCount());
         assertSame(c1, pane.getComponent(0));
-
         pane.add(c2);
         assertEquals(2, pane.getComponentCount());
         assertSame(c1, pane.getComponent(0));
         assertSame(c2, pane.getComponent(1));
-
         pane.add(c3);
         assertEquals(3, pane.getComponentCount());
         assertSame(c1, pane.getComponent(0));
         assertSame(c2, pane.getComponent(1));
         assertSame(c3, pane.getComponent(2));
-
         pane.add(c1);
         assertEquals(3, pane.getComponentCount());
         assertSame(c1, pane.getComponent(0));
@@ -83,47 +79,54 @@
     public void testInvalidate() throws Exception {
         final Marker parentInvalidation = new Marker();
         JPanel parent = new JPanel() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public void invalidate() {
                 super.invalidate();
                 parentInvalidation.setOccurred();
             }
         };
-
         final Marker childInvalidation = new Marker();
         JPanel child = new JPanel() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public void invalidate() {
                 super.invalidate();
                 childInvalidation.setOccurred();
             }
         };
-
         parent.add(pane);
         pane.add(child);
-
         parent.validate();
         parentInvalidation.setOccurred(false);
         childInvalidation.setOccurred(false);
-
         child.invalidate();
         assertTrue(childInvalidation.isOccurred());
         assertFalse(parentInvalidation.isOccurred());
     }
 
     public void testPaintComponent() throws Exception {
-        final List boundsChanges = new ArrayList();
+        final List<Rectangle> boundsChanges = new ArrayList<Rectangle>();
         final Marker dbMarker = new Marker();
         final Marker validationMarker = new Marker();
         JPanel component = new JPanel() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public void setBounds(final int x, final int y, final int w, final int h) {
                 boundsChanges.add(new Rectangle(x, y, w, h));
                 super.setBounds(x, y, w, h);
             }
 
+            @Override
             public void validate() {
                 validationMarker.setOccurred();
                 super.validate();
             }
 
+            @Override
             public void paint(final Graphics g) {
                 super.paint(g);
                 dbMarker.setOccurred(isDoubleBuffered());
@@ -131,20 +134,17 @@
         };
         component.setDoubleBuffered(true);
         component.invalidate();
-
         Graphics g = createTestGraphics();
         g.setClip(0, 0, 100, 100);
         pane.paintComponent(g, component, new JPanel(), 20, 30, 40, 50);
         assertEquals(pane, component.getParent());
         assertFalse(dbMarker.isOccurred());
         assertTrue(component.isDoubleBuffered());
-
         assertEquals(2, boundsChanges.size());
         assertEquals(new Rectangle(20, 30, 40, 50), boundsChanges.get(0));
         assertEquals(new Rectangle(-40, -50, 0, 0), boundsChanges.get(1));
         assertEquals(new Rectangle(-40, -50, 0, 0), component.getBounds());
         assertFalse(validationMarker.isOccurred());
-
         pane.paintComponent(g, component, new JPanel(), 20, 30, 40, 50, true);
         assertTrue(validationMarker.isOccurred());
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ComponentInputMapTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ComponentInputMapTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ComponentInputMapTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ComponentInputMapTest.java
Sat Nov 25 16:04:10 2006
@@ -25,7 +25,6 @@
 import java.io.IOException;
 
 public class ComponentInputMapTest extends InputMapTest {
-
     protected JComponent component = null;
 
     public static void main(final String[] args) {
@@ -35,30 +34,30 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         component = new JPanel();
         map = new ComponentInputMap(component);
         parent = new ComponentInputMap(component);
     }
 
+    @Override
     public void testSetGetParent() {
         parent = new ComponentInputMap(component);
         map.setParent(parent);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 map.setParent(new InputMap());
             }
         });
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 map.setParent(new ComponentInputMap(new JPanel()));
             }
         });
-
         map.setParent(null);
         assertNull(map.getParent());
     }
@@ -67,59 +66,59 @@
         boolean thrown = false;
         try {
             map = new ComponentInputMap(component);
-        } catch(IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertFalse(thrown);
-
         component = null;
         try {
             map = new ComponentInputMap(component);
-        } catch(IllegalArgumentException e) {
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertTrue(thrown);
     }
 
     public void testGetComponent() {
-        assertTrue(((ComponentInputMap)map).getComponent() == component);
+        assertTrue(((ComponentInputMap) map).getComponent() == component);
     }
 
+    @Override
     public void testWriteObject() throws IOException {
         //super.testWriteObject();
     }
 
+    @Override
     public void testReadObject() {
         /*
-        KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_1, 0);
-        KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_2, 0);
-        Object object1 = "object1";
-        Object object2 = "object2";
-        ComponentInputMap parent = new ComponentInputMap(component);
-        map.setParent(parent);
-        map.put(keyStroke1, object1);
-        map.put(keyStroke2, object2);
-        try {
-            FileOutputStream fo = new FileOutputStream("tmp");
-            ObjectOutputStream so = new ObjectOutputStream(fo);
-            so.writeObject(map);
-            so.flush();
-        } catch (Exception e) {
-            assertFalse(true);
-        }
-        try {
-            FileInputStream fi = new FileInputStream("tmp");
-            ObjectInputStream si = new ObjectInputStream(fi);
-            ComponentInputMap ressurectedMap = (ComponentInputMap)si.readObject();
-            assertTrue(ressurectedMap.getParent() != null);
-            assertTrue(ressurectedMap.getComponent() != null);
-            assertTrue(ressurectedMap.get(keyStroke1).equals(object1));
-            assertTrue(ressurectedMap.get(keyStroke2).equals(object2));
-        } catch (Exception e) {
-            System.out.println(e);
-            assertFalse(true);
-        }
-        */
+         KeyStroke keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_1, 0);
+         KeyStroke keyStroke2 = KeyStroke.getKeyStroke(KeyEvent.VK_2, 0);
+         Object object1 = "object1";
+         Object object2 = "object2";
+         ComponentInputMap parent = new ComponentInputMap(component);
+         map.setParent(parent);
+         map.put(keyStroke1, object1);
+         map.put(keyStroke2, object2);
+         try {
+         FileOutputStream fo = new FileOutputStream("tmp");
+         ObjectOutputStream so = new ObjectOutputStream(fo);
+         so.writeObject(map);
+         so.flush();
+         } catch (Exception e) {
+         assertFalse(true);
+         }
+         try {
+         FileInputStream fi = new FileInputStream("tmp");
+         ObjectInputStream si = new ObjectInputStream(fi);
+         ComponentInputMap ressurectedMap = (ComponentInputMap)si.readObject();
+         assertTrue(ressurectedMap.getParent() != null);
+         assertTrue(ressurectedMap.getComponent() != null);
+         assertTrue(ressurectedMap.get(keyStroke1).equals(object1));
+         assertTrue(ressurectedMap.get(keyStroke2).equals(object2));
+         } catch (Exception e) {
+         System.out.println(e);
+         assertFalse(true);
+         }
+         */
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DebugGraphicsTest.java
Sat Nov 25 16:04:10 2006
@@ -24,12 +24,14 @@
 
 public class DebugGraphicsTest extends BasicSwingTestCase {
     private DebugGraphics debugGraphics;
-    
+
+    @Override
     public void setUp() throws Exception {
         super.setUp();
-        debugGraphics = new DebugGraphics(new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB).getGraphics());
       
+        debugGraphics = new DebugGraphics(new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB)
+                .getGraphics());
     }
-    
+
     public void testGetSetDebugOptions() {
         assertEquals(0, debugGraphics.getDebugOptions());
         debugGraphics.setDebugOptions(DebugGraphics.BUFFERED_OPTION);
@@ -40,9 +42,9 @@
         debugGraphics.setDebugOptions(DebugGraphics.NONE_OPTION);
         assertEquals(0, debugGraphics.getDebugOptions());
     }
-    
+
     public void testCreate() {
-        DebugGraphics result = (DebugGraphics)debugGraphics.create();
+        DebugGraphics result = (DebugGraphics) debugGraphics.create();
         assertEquals(debugGraphics.getDebugOptions(), result.getDebugOptions());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModel2Test.java
Sat Nov 25 16:04:10 2006
@@ -25,7 +25,6 @@
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -46,6 +45,7 @@
 
     final boolean IS_ADJUSTING = false;
 
+    @Override
     protected void setUp() throws Exception {
         brm = new DefaultBoundedRangeModel(VALUE, EXTENT, MIN, MAX);
         brm.addChangeListener(listener);
@@ -53,6 +53,7 @@
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -78,61 +79,53 @@
         SimpleChangeListener listener2 = new SimpleChangeListener("second");
         SimpleChangeListener listener3 = new SimpleChangeListener("third");
         ChangeListener changeListsners[] = brm.getChangeListeners();
-        ChangeListener listeners[] = (ChangeListener[]) brm
-                .getListeners(ChangeListener.class);
+        ChangeListener listeners[] = brm.getListeners(ChangeListener.class);
         assertNotNull(changeListsners);
         assertNotNull(listeners);
         assertEquals(0, changeListsners.length);
         assertEquals(0, listeners.length);
-
         brm.addChangeListener(listener1);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(1, changeListsners.length);
         assertEquals(1, listeners.length);
         assertEquals(changeListsners[0], listener1);
-
         brm.addChangeListener(listener2);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(2, changeListsners.length);
         assertEquals(2, listeners.length);
         assertEquals(changeListsners[0], listener2);
         assertEquals(changeListsners[1], listener1);
-
         brm.addChangeListener(listener3);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(3, changeListsners.length);
         assertEquals(3, listeners.length);
         assertEquals(changeListsners[0], listener3);
         assertEquals(changeListsners[1], listener2);
         assertEquals(changeListsners[2], listener1);
-        listeners = (ChangeListener[]) brm.listenerList
-                .getListeners(ChangeListener.class);
+        listeners = brm.listenerList.getListeners(ChangeListener.class);
         assertEquals(3, listeners.length);
         assertEquals(listeners[0], listener3);
         assertEquals(listeners[1], listener2);
         assertEquals(listeners[2], listener1);
-
         brm.removeChangeListener(listener3);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(2, changeListsners.length);
         assertEquals(2, listeners.length);
         assertEquals(changeListsners[0], listener2);
         assertEquals(changeListsners[1], listener1);
-
         brm.removeChangeListener(listener1);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(1, changeListsners.length);
         assertEquals(1, listeners.length);
         assertEquals(changeListsners[0], listener2);
-
         brm.removeChangeListener(listener2);
         changeListsners = brm.getChangeListeners();
-        listeners = (ChangeListener[]) brm.getListeners(ChangeListener.class);
+        listeners = brm.getListeners(ChangeListener.class);
         assertEquals(0, changeListsners.length);
         assertEquals(0, listeners.length);
     }
@@ -143,23 +136,22 @@
     }
 
     public void testDefaultBoundedRangeModelintintintint() {
-        DefaultBoundedRangeModel brm1 = new DefaultBoundedRangeModel(4, 5, -2,
-                49);
+        DefaultBoundedRangeModel brm1 = new DefaultBoundedRangeModel(4, 5, -2, 49);
         checkValues(brm1, 4, 5, -2, 49, false);
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new DefaultBoundedRangeModel(4, 6, 5, 39);
             }
         });
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new DefaultBoundedRangeModel(3, 5, 1, 2);
             }
         });
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new DefaultBoundedRangeModel(1, -1, 1, 2);
             }
@@ -186,28 +178,26 @@
             int oldMin = brm.getMinimum();
             int oldMax = brm.getMaximum();
             int oldExtent = brm.getExtent();
-
             brm.setExtent(i);
             int newExtent = Math.min(Math.max(i, 0), oldMax - oldValue);
             assertEquals(oldMin, brm.getMinimum());
             assertEquals(oldValue, brm.getValue());
             assertEquals(newExtent, brm.getExtent());
             assertEquals(oldMax, brm.getMaximum());
-            if (oldExtent != newExtent)
+            if (oldExtent != newExtent) {
                 assertEquals("initial", fireOrder);
+            }
         }
     }
 
     public void testSetGetMaximum() {
         brm.setMaximum(brm.getMaximum());
         assertEquals("", fireOrder);
-
         for (int i = -3; i < 100; i++) {
             fireOrder = "";
             int oldValue = brm.getValue();
             int oldExtent = brm.getExtent();
             int oldMin = brm.getMinimum();
-
             brm.setMaximum(i);
             int newValue = Math.min(oldValue, i);
             int newMin = Math.min(i, oldMin);
@@ -224,19 +214,18 @@
     public void testSetGetMinimum() {
         brm.setMinimum(brm.getMinimum());
         assertEquals("", fireOrder);
-
         for (int i = -3; i < 100; i++) {
             fireOrder = "";
             int oldValue = brm.getValue();
             int oldMax = brm.getMaximum();
             int oldExtent = brm.getExtent();
-
             brm.setMinimum(i);
             int newValue = Math.max(i, oldValue);
             int newMin = i;
             int newMax = Math.max(i, oldMax);
-            int newExtent = (brm.getMaximum() >= brm.getValue() + oldExtent) ? oldExtent
-                    : brm.getMaximum() - brm.getValue();
+            int newExtent = (brm.getMaximum() >= brm.getValue() + oldExtent) ? oldExtent
: brm
+                    .getMaximum()
+                    - brm.getValue();
             assertEquals(newMin, brm.getMinimum());
             assertEquals(newValue, brm.getValue());
             assertEquals(newExtent, brm.getExtent());
@@ -252,45 +241,40 @@
             int oldMax = brm.getMaximum();
             int oldExtent = brm.getExtent();
             int oldValue = brm.getValue();
-
             brm.setValue(i);
             int newValue = Math.min(Math.max(i, oldMin), oldMax - oldExtent);
-
             assertEquals(oldMin, brm.getMinimum());
             assertEquals(newValue, brm.getValue());
             assertEquals(oldExtent, brm.getExtent());
             assertEquals(oldMax, brm.getMaximum());
-            if (oldValue != newValue)
+            if (oldValue != newValue) {
                 assertEquals("initial", fireOrder);
+            }
         }
     }
 
     public void testSetRangeProperties() {
         brm.setRangeProperties(VALUE, EXTENT, MIN, MAX, IS_ADJUSTING);
         assertEquals("", fireOrder);
-
         brm.setRangeProperties(6, 7, -4, 200, true);
         checkValues(6, 7, -4, 200, true);
         assertEquals("initial", fireOrder);
         fireOrder = "";
-
         brm.setRangeProperties(5, 7, 6, 200, true);
-        checkValues(5,7,5,200, true);
+        checkValues(5, 7, 5, 200, true);
         assertEquals("initial", fireOrder);
         fireOrder = "";
-
         brm.setRangeProperties(5, 7, 4, 0, true);
-        assertEquals(5,brm.getValue());
+        assertEquals(5, brm.getValue());
         assertTrue(brm.getMinimum() <= brm.getValue());
         assertTrue(brm.getExtent() >= 0);
         assertTrue(brm.getValue() + brm.getExtent() <= brm.getMaximum());
         assertEquals("initial", fireOrder);
         fireOrder = "";
-
     }
 
-    void checkValues(final BoundedRangeModel model, final int value, final int extent, final
int min,
-            final int max, final boolean isAdjusting) {
+    void checkValues(final BoundedRangeModel model, final int value, final int extent,
+            final int min, final int max, final boolean isAdjusting) {
         assertEquals(value, model.getValue());
         assertEquals(extent, model.getExtent());
         assertEquals(min, model.getMinimum());
@@ -327,19 +311,16 @@
     public void testSerializable() throws Exception {
         brm.addChangeListener(listener);
         brm.setValueIsAdjusting(true);
-
         DefaultBoundedRangeModel brm1 = new DefaultBoundedRangeModel();
         ByteArrayOutputStream fo = new ByteArrayOutputStream();
         ObjectOutputStream so = new ObjectOutputStream(fo);
         so.writeObject(brm);
         so.flush();
         so.close();
-
         InputStream fi = new ByteArrayInputStream(fo.toByteArray());
         ObjectInputStream si = new ObjectInputStream(fi);
         brm1 = (DefaultBoundedRangeModel) si.readObject();
         si.close();
-
         assertEquals(brm.getMinimum(), brm1.getMinimum());
         assertEquals(brm.getValue(), brm1.getValue());
         assertEquals(brm.getExtent(), brm1.getExtent());

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModelTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/DefaultBoundedRangeModelTest.java
Sat Nov 25 16:04:10 2006
@@ -14,28 +14,26 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Sergey Burlak
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.util.EventListener;
 import java.util.List;
 import java.util.Vector;
-
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
 public class DefaultBoundedRangeModelTest extends SwingTestCase {
-
     private DefaultBoundedRangeModel model;
-    private List testList;
 
+    private List<String> testList;
+
+    @Override
     public void setUp() throws Exception {
-        testList = new Vector();
+        testList = new Vector<String>();
         model = new DefaultBoundedRangeModel();
         model.addChangeListener(new ChangeListener() {
             public void stateChanged(final ChangeEvent e) {
@@ -44,6 +42,7 @@
         });
     }
 
+    @Override
     public void tearDown() throws Exception {
         model = null;
         testList = null;
@@ -144,11 +143,11 @@
         model.removeChangeListener(l);
         assertEquals(1, model.getChangeListeners().length);
         assertEquals(1, model.getListeners(ChangeListener.class).length);
-
         assertEquals(0, model.getListeners(EventListener.class).length);
     }
 
-    private void checkValues(final int value, final int extent, final int min, final int
max, final int eventNumber) {
+    private void checkValues(final int value, final int extent, final int min, final int
max,
+            final int eventNumber) {
         assertEquals(value, model.getValue());
         assertEquals(extent, model.getExtent());
         assertEquals(min, model.getMinimum());



Mime
View raw message