harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [17/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/JScrollPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollPaneTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollPaneTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JScrollPaneTest.java Sat Nov 25 16:04:10 2006
@@ -20,13 +20,13 @@
  */
 package javax.swing;
 
+import java.awt.Adjustable;
 import java.awt.Component;
 import java.awt.ComponentOrientation;
 import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.LayoutManager;
 import java.awt.Rectangle;
-
 import javax.swing.border.Border;
 import javax.swing.plaf.ScrollPaneUI;
 import javax.swing.plaf.basic.BasicScrollPaneUI;
@@ -38,62 +38,72 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         pane = new JScrollPane();
         propertyChangeController = new PropertyChangeController();
         pane.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         pane = null;
     }
 
     public void testJScrollPane() throws Exception {
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, pane.verticalScrollBarPolicy);
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED, pane.horizontalScrollBarPolicy);
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
+                pane.verticalScrollBarPolicy);
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED,
+                pane.horizontalScrollBarPolicy);
         assertNotNull(pane.viewport);
         assertNull(pane.viewport.getView());
         assertTrue(pane.verticalScrollBar instanceof JScrollPane.ScrollBar);
-        assertEquals(JScrollBar.VERTICAL, pane.verticalScrollBar.getOrientation());
+        assertEquals(Adjustable.VERTICAL, pane.verticalScrollBar.getOrientation());
         assertTrue(pane.horizontalScrollBar instanceof JScrollPane.ScrollBar);
-        assertEquals(JScrollBar.HORIZONTAL, pane.horizontalScrollBar.getOrientation());
+        assertEquals(Adjustable.HORIZONTAL, pane.horizontalScrollBar.getOrientation());
         assertNull(pane.rowHeader);
         assertNull(pane.columnHeader);
         assertNull(pane.lowerLeft);
         assertNull(pane.lowerRight);
         assertNull(pane.upperLeft);
         assertNull(pane.upperRight);
-
         assertEquals(3, pane.getComponentCount());
         assertEquals(pane.viewport, pane.getComponent(0));
         assertEquals(pane.verticalScrollBar, pane.getComponent(1));
         assertEquals(pane.horizontalScrollBar, pane.getComponent(2));
-
         Component view = new JButton();
-        pane = new JScrollPane(view, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+        pane = new JScrollPane(view, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER,
+                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         assertEquals(view, pane.viewport.getView());
         assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, pane.verticalScrollBarPolicy);
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS, pane.horizontalScrollBarPolicy);
-
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS,
+                pane.horizontalScrollBarPolicy);
         view = new JButton();
         pane = new JScrollPane(view);
         assertEquals(view, pane.viewport.getView());
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, pane.verticalScrollBarPolicy);
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED, pane.horizontalScrollBarPolicy);
-
-        pane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
+                pane.verticalScrollBarPolicy);
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED,
+                pane.horizontalScrollBarPolicy);
+        pane = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
         assertNull(pane.viewport.getView());
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, pane.verticalScrollBarPolicy);
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER, pane.horizontalScrollBarPolicy);
-
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                pane.verticalScrollBarPolicy);
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER,
+                pane.horizontalScrollBarPolicy);
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
-                new JScrollPane(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+                new JScrollPane(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS,
+                        ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
-                new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+                new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                        ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
             }
         });
     }
@@ -113,33 +123,36 @@
 
     public void testSetLayout() throws Exception {
         assertTrue(pane.getLayout() instanceof ScrollPaneLayout);
-
         TestLayout layout = new TestLayout();
         pane.setLayout(layout);
         assertEquals(layout, pane.getLayout());
         assertEquals(pane, layout.getSyncScrollPane());
-
         pane.setLayout(null);
-
         testExceptionalCase(new ExceptionalCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setLayout(new LayoutManager() {
                     public void addLayoutComponent(final String name, final Component comp) {
                     }
+
                     public void layoutContainer(final Container parent) {
                     }
+
                     public Dimension minimumLayoutSize(final Container parent) {
                         return null;
                     }
+
                     public Dimension preferredLayoutSize(final Container parent) {
                         return null;
                     }
+
                     public void removeLayoutComponent(final Component comp) {
                     }
                 });
             }
 
-            public Class expectedExceptionClass() {
+            @Override
+            public Class<ClassCastException> expectedExceptionClass() {
                 return ClassCastException.class;
             }
         });
@@ -150,15 +163,17 @@
     }
 
     public void testGetSetVerticalScrollBarPolicy() throws Exception {
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, pane.getVerticalScrollBarPolicy());
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, pane
+                .getVerticalScrollBarPolicy());
         pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         assertTrue(propertyChangeController.isChanged("verticalScrollBarPolicy"));
-
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, pane.getVerticalScrollBarPolicy());
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, pane
+                .getVerticalScrollBarPolicy());
         pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
-        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, pane.getVerticalScrollBarPolicy());
-
+        assertEquals(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, pane
+                .getVerticalScrollBarPolicy());
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setVerticalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
             }
@@ -166,15 +181,17 @@
     }
 
     public void testGetSetHorizontalScrollBarPolicy() throws Exception {
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED, pane.getHorizontalScrollBarPolicy());
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED, pane
+                .getHorizontalScrollBarPolicy());
         pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
         assertTrue(propertyChangeController.isChanged("horizontalScrollBarPolicy"));
-
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS, pane.getHorizontalScrollBarPolicy());
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS, pane
+                .getHorizontalScrollBarPolicy());
         pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER, pane.getHorizontalScrollBarPolicy());
-
+        assertEquals(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER, pane
+                .getHorizontalScrollBarPolicy());
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
             }
@@ -192,51 +209,52 @@
     public void testGetViewportBorderBounds() throws Exception {
         pane.setBorder(BorderFactory.createEmptyBorder(5, 10, 15, 20));
         pane.setBounds(200, 200, 40, 60);
-        assertEquals(new Rectangle(10, 5, 40 - 10 - 20, 60 - 5 - 15), pane.getViewportBorderBounds());
-
+        assertEquals(new Rectangle(10, 5, 40 - 10 - 20, 60 - 5 - 15), pane
+                .getViewportBorderBounds());
         pane.setColumnHeader(new JViewport());
         pane.getColumnHeader().setBounds(10, 20, 20, 50);
-        assertEquals(new Rectangle(10, 5 + 50, 40 - 10 - 20, 60 - 5 - 15 - 50), pane.getViewportBorderBounds());
-
+        assertEquals(new Rectangle(10, 5 + 50, 40 - 10 - 20, 60 - 5 - 15 - 50), pane
+                .getViewportBorderBounds());
         pane.setRowHeader(new JViewport());
         pane.getRowHeader().setBounds(10, 20, 20, 30);
-        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20, 60 - 5 - 15 - 50), pane.getViewportBorderBounds());
-
+        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20, 60 - 5 - 15 - 50), pane
+                .getViewportBorderBounds());
         pane.getVerticalScrollBar().setBounds(20, 10, 30, 10);
-        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20 - 30, 60 - 5 - 15 - 50), pane.getViewportBorderBounds());
-
+        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20 - 30, 60 - 5 - 15 - 50),
+                pane.getViewportBorderBounds());
         pane.getHorizontalScrollBar().setBounds(20, 10, 30, 50);
-        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20 - 30, 60 - 5 - 15 - 50 - 50), pane.getViewportBorderBounds());
+        assertEquals(new Rectangle(10 + 20, 5 + 50, 40 - 10 - 20 - 20 - 30, 60 - 5 - 15 - 50
+                - 50), pane.getViewportBorderBounds());
     }
 
     public void testCreateHorizontalScrollBar() throws Exception {
         JScrollBar scrollBar = pane.createHorizontalScrollBar();
         assertTrue(scrollBar instanceof JScrollPane.ScrollBar);
-        assertEquals(JScrollBar.HORIZONTAL, scrollBar.getOrientation());
+        assertEquals(Adjustable.HORIZONTAL, scrollBar.getOrientation());
     }
 
     public void testCreateVerticalScrollBar() throws Exception {
         JScrollBar scrollBar = pane.createVerticalScrollBar();
         assertTrue(scrollBar instanceof JScrollPane.ScrollBar);
-        assertEquals(JScrollBar.VERTICAL, scrollBar.getOrientation());
+        assertEquals(Adjustable.VERTICAL, scrollBar.getOrientation());
     }
 
     public void testGetSetHorizontalScrollBar() throws Exception {
         assertTrue(pane.getHorizontalScrollBar() instanceof JScrollPane.ScrollBar);
-        JScrollBar sb = new JScrollBar(JScrollBar.VERTICAL);
+        JScrollBar sb = new JScrollBar(Adjustable.VERTICAL);
         pane.setHorizontalScrollBar(sb);
         assertEquals(sb, pane.getHorizontalScrollBar());
         assertTrue(propertyChangeController.isChanged("horizontalScrollBar"));
-        assertEquals(JScrollBar.VERTICAL, sb.getOrientation());
+        assertEquals(Adjustable.VERTICAL, sb.getOrientation());
     }
 
     public void testGetSetVerticalScrollBar() throws Exception {
         assertTrue(pane.getVerticalScrollBar() instanceof JScrollPane.ScrollBar);
-        JScrollBar sb = new JScrollBar(JScrollBar.HORIZONTAL);
+        JScrollBar sb = new JScrollBar(Adjustable.HORIZONTAL);
         pane.setVerticalScrollBar(sb);
         assertEquals(sb, pane.getVerticalScrollBar());
         assertTrue(propertyChangeController.isChanged("verticalScrollBar"));
-        assertEquals(JScrollBar.HORIZONTAL, sb.getOrientation());
+        assertEquals(Adjustable.HORIZONTAL, sb.getOrientation());
     }
 
     public void testCreateViewport() throws Exception {
@@ -250,30 +268,25 @@
         assertEquals(viewport, pane.getViewport());
         assertEquals(3, pane.getComponentCount());
         assertEquals(viewport, pane.getComponent(2));
-
         JViewport newViewport = new JViewport();
         pane.setViewport(newViewport);
         assertEquals(newViewport, pane.getViewport());
         assertEquals(3, pane.getComponentCount());
         assertEquals(newViewport, pane.getComponent(2));
         assertTrue(propertyChangeController.isChanged("viewport"));
-
         pane.setViewport(null);
         assertNull(pane.getViewport());
         assertEquals(2, pane.getComponentCount());
         assertTrue(propertyChangeController.isChanged("viewport"));
-
         propertyChangeController.reset();
         pane.setViewport(null);
         assertNull(pane.getViewport());
         assertEquals(2, pane.getComponentCount());
         assertTrue(propertyChangeController.isChanged("viewport"));
-
         propertyChangeController.reset();
         pane.setViewport(newViewport);
         assertEquals(3, pane.getComponentCount());
         assertTrue(propertyChangeController.isChanged("viewport"));
-
         pane.remove(newViewport);
         propertyChangeController.reset();
         pane.setViewport(newViewport);
@@ -286,7 +299,6 @@
         Component c = new JButton();
         pane.setViewportView(c);
         assertEquals(c, pane.getViewport().getView());
-
         pane.setViewport(null);
         pane.setViewportView(c);
         assertEquals(c, pane.getViewport().getView());
@@ -301,13 +313,11 @@
         assertTrue(propertyChangeController.isChanged("rowHeader"));
         assertEquals(4, pane.getComponentCount());
         assertEquals(rowHeader, pane.getComponent(3));
-
         JViewport newRowHeader = new JViewport();
         pane.setRowHeader(newRowHeader);
         assertEquals(newRowHeader, pane.getRowHeader());
         assertEquals(4, pane.getComponentCount());
         assertEquals(newRowHeader, pane.getComponent(3));
-
         pane.setRowHeader(null);
         assertNull(pane.getRowHeader());
         assertEquals(3, pane.getComponentCount());
@@ -329,13 +339,11 @@
         assertTrue(propertyChangeController.isChanged("columnHeader"));
         assertEquals(4, pane.getComponentCount());
         assertEquals(columnHeader, pane.getComponent(3));
-
         JViewport newColumnHeader = new JViewport();
         pane.setColumnHeader(newColumnHeader);
         assertEquals(newColumnHeader, pane.getColumnHeader());
         assertEquals(4, pane.getComponentCount());
         assertEquals(newColumnHeader, pane.getComponent(3));
-
         pane.setColumnHeader(null);
         assertNull(pane.getColumnHeader());
         assertEquals(3, pane.getComponentCount());
@@ -350,16 +358,15 @@
     }
 
     public void testGetSetCorner() throws Exception {
-        assertNull(pane.getCorner(JScrollPane.LOWER_LEFT_CORNER));
-        assertNull(pane.getCorner(JScrollPane.LOWER_RIGHT_CORNER));
-        assertNull(pane.getCorner(JScrollPane.UPPER_LEFT_CORNER));
-        assertNull(pane.getCorner(JScrollPane.UPPER_RIGHT_CORNER));
-        assertNull(pane.getCorner(JScrollPane.LOWER_LEADING_CORNER));
-        assertNull(pane.getCorner(JScrollPane.LOWER_TRAILING_CORNER));
-        assertNull(pane.getCorner(JScrollPane.UPPER_LEADING_CORNER));
-        assertNull(pane.getCorner(JScrollPane.UPPER_TRAILING_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.LOWER_LEFT_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.UPPER_LEFT_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.LOWER_LEADING_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.LOWER_TRAILING_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.UPPER_LEADING_CORNER));
+        assertNull(pane.getCorner(ScrollPaneConstants.UPPER_TRAILING_CORNER));
         assertEquals(3, pane.getComponentCount());
-
         Component lowerLeft = new JButton();
         Component lowerRight = new JButton();
         Component upperLeft = new JButton();
@@ -368,83 +375,68 @@
         Component lowerTrailing = new JButton();
         Component upperLeading = new JButton();
         Component upperTrailing = new JButton();
-
-        pane.setCorner(JScrollPane.LOWER_LEFT_CORNER, lowerLeft);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.LOWER_LEFT_CORNER));
+        pane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, lowerLeft);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.LOWER_LEFT_CORNER));
         assertEquals(4, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.LOWER_RIGHT_CORNER, lowerRight);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.LOWER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, lowerRight);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.LOWER_RIGHT_CORNER));
         assertEquals(5, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_LEFT_CORNER, upperLeft);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.UPPER_LEFT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, upperLeft);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_LEFT_CORNER));
         assertEquals(6, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, upperRight);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.UPPER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, upperRight);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
-        assertEquals(lowerLeft, pane.getCorner(JScrollPane.LOWER_LEFT_CORNER));
-        assertEquals(lowerRight, pane.getCorner(JScrollPane.LOWER_RIGHT_CORNER));
-        assertEquals(upperLeft, pane.getCorner(JScrollPane.UPPER_LEFT_CORNER));
-        assertEquals(upperRight, pane.getCorner(JScrollPane.UPPER_RIGHT_CORNER));
-
+        assertEquals(lowerLeft, pane.getCorner(ScrollPaneConstants.LOWER_LEFT_CORNER));
+        assertEquals(lowerRight, pane.getCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER));
+        assertEquals(upperLeft, pane.getCorner(ScrollPaneConstants.UPPER_LEFT_CORNER));
+        assertEquals(upperRight, pane.getCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.LOWER_LEADING_CORNER, lowerLeading);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.LOWER_LEFT_CORNER));
+        pane.setCorner(ScrollPaneConstants.LOWER_LEADING_CORNER, lowerLeading);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.LOWER_LEFT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.LOWER_TRAILING_CORNER, lowerTrailing);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.LOWER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.LOWER_TRAILING_CORNER, lowerTrailing);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.LOWER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_LEADING_CORNER, upperLeading);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.UPPER_LEFT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_LEADING_CORNER, upperLeading);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_LEFT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_TRAILING_CORNER, upperTrailing);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.UPPER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_TRAILING_CORNER, upperTrailing);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
-        assertEquals(lowerLeading, pane.getCorner(JScrollPane.LOWER_LEFT_CORNER));
-        assertEquals(lowerTrailing, pane.getCorner(JScrollPane.LOWER_RIGHT_CORNER));
-        assertEquals(upperLeading, pane.getCorner(JScrollPane.UPPER_LEFT_CORNER));
-        assertEquals(upperTrailing, pane.getCorner(JScrollPane.UPPER_RIGHT_CORNER));
-
+        assertEquals(lowerLeading, pane.getCorner(ScrollPaneConstants.LOWER_LEFT_CORNER));
+        assertEquals(lowerTrailing, pane.getCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER));
+        assertEquals(upperLeading, pane.getCorner(ScrollPaneConstants.UPPER_LEFT_CORNER));
+        assertEquals(upperTrailing, pane.getCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setCorner("anything", null);
             }
         });
-
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, new JButton());
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, new JButton());
         assertEquals(7, pane.getComponentCount());
-
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, null);
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, null);
         assertEquals(6, pane.getComponentCount());
-
         JButton b = new JButton();
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, b);
-        assertTrue(propertyChangeController.isChanged(JScrollPane.UPPER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, b);
+        assertTrue(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
         propertyChangeController.reset();
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, b);
-        assertFalse(propertyChangeController.isChanged(JScrollPane.UPPER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, b);
+        assertFalse(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
-
         propertyChangeController.reset();
         pane.remove(6);
-        pane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, b);
-        assertFalse(propertyChangeController.isChanged(JScrollPane.UPPER_RIGHT_CORNER));
+        pane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, b);
+        assertFalse(propertyChangeController.isChanged(ScrollPaneConstants.UPPER_RIGHT_CORNER));
         assertEquals(7, pane.getComponentCount());
     }
 
@@ -452,7 +444,6 @@
         assertTrue(pane.getComponentOrientation().isLeftToRight());
         assertTrue(pane.getVerticalScrollBar().getComponentOrientation().isLeftToRight());
         assertTrue(pane.getHorizontalScrollBar().getComponentOrientation().isLeftToRight());
-
         pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
         assertFalse(pane.getComponentOrientation().isLeftToRight());
         assertFalse(pane.getVerticalScrollBar().getComponentOrientation().isLeftToRight());
@@ -475,8 +466,11 @@
     }
 
     private class TestLayout extends ScrollPaneLayout {
+        private static final long serialVersionUID = 1L;
+
         private JScrollPane syncScrollPane;
 
+        @Override
         public void syncWithScrollPane(final JScrollPane sp) {
             super.syncWithScrollPane(sp);
             syncScrollPane = sp;

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSeparatorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSeparatorTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSeparatorTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSeparatorTest.java Sat Nov 25 16:04:10 2006
@@ -15,25 +15,26 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing;
 
 import javax.accessibility.AccessibleRole;
 import javax.swing.plaf.SeparatorUI;
 import javax.swing.plaf.basic.BasicSeparatorUI;
-
 import junit.framework.TestCase;
 
 public class JSeparatorTest extends TestCase {
-
     protected JSeparator separator;
+
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         separator = new JSeparator();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         separator = null;
         super.tearDown();
@@ -50,27 +51,27 @@
      * Test method for 'javax.swing.JSeparator.JSeparator(int)'
      */
     public void testJSeparatorInt() {
-        separator =  new JSeparator(SwingConstants.HORIZONTAL);
+        separator = new JSeparator(SwingConstants.HORIZONTAL);
         assertEquals(SwingConstants.HORIZONTAL, separator.getOrientation());
-
-        separator =  new JSeparator(SwingConstants.VERTICAL);
+        separator = new JSeparator(SwingConstants.VERTICAL);
         assertEquals(SwingConstants.VERTICAL, separator.getOrientation());
-
         try {
-            separator =  new JSeparator(1000);
+            separator = new JSeparator(1000);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
     }
 
     /*
      * Test method for 'javax.swing.JSeparator.getAccessibleContext()'
      */
     public void testGetAccessibleContext() {
-        boolean assertedValue = (separator.getAccessibleContext() != null &&
-                separator.getAccessibleContext().getClass().getName().equals("javax.swing.JSeparator$AccessibleJSeparator"));
-
-        assertTrue("AccessibleContext created properly ",  assertedValue);
-        assertEquals("AccessibleRole", AccessibleRole.SEPARATOR, separator.getAccessibleContext().getAccessibleRole());
+        boolean assertedValue = (separator.getAccessibleContext() != null && separator
+                .getAccessibleContext().getClass().getName().equals(
+                        "javax.swing.JSeparator$AccessibleJSeparator"));
+        assertTrue("AccessibleContext created properly ", assertedValue);
+        assertEquals("AccessibleRole", AccessibleRole.SEPARATOR, separator
+                .getAccessibleContext().getAccessibleRole());
     }
 
     /*
@@ -93,11 +94,9 @@
     public void testSetUISeparatorUI() {
         SeparatorUI ui1 = new BasicSeparatorUI();
         SeparatorUI ui2 = new BasicSeparatorUI();
-
         separator.setUI(ui1);
         assertEquals(ui1, separator.ui);
         assertEquals(ui1, separator.getUI());
-
         separator.setUI(ui2);
         assertEquals(ui2, separator.ui);
         assertEquals(ui2, separator.getUI());
@@ -109,14 +108,12 @@
     public void testGetSetOrientation() {
         separator.setOrientation(SwingConstants.HORIZONTAL);
         assertEquals(SwingConstants.HORIZONTAL, separator.getOrientation());
-
         separator.setOrientation(SwingConstants.VERTICAL);
         assertEquals(SwingConstants.VERTICAL, separator.getOrientation());
-
         try {
             separator.setOrientation(1000);
             fail("no exception has been thrown");
-        } catch (IllegalArgumentException e) {}
+        } catch (IllegalArgumentException e) {
+        }
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSliderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSliderTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSliderTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSliderTest.java Sat Nov 25 16:04:10 2006
@@ -14,27 +14,25 @@
  *  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.Dictionary;
 import java.util.Enumeration;
 import java.util.Hashtable;
 
-import javax.swing.plaf.SliderUI;
-
 public class JSliderTest extends SwingTestCase {
     private JSlider slider;
 
+    @Override
     protected void setUp() throws Exception {
         slider = new JSlider();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         slider = null;
     }
@@ -53,7 +51,7 @@
 
     public void testSetGetLabelTable() throws Exception {
         assertNull(slider.getLabelTable());
-        Dictionary labelTable = new Hashtable();
+        Dictionary<String, String> labelTable = new Hashtable<String, String>();
         labelTable.put("a", "b");
         propertyChangeController = new PropertyChangeController();
         slider.addPropertyChangeListener(propertyChangeController);
@@ -145,19 +143,16 @@
             fail("IllegalArgumentException shall be thrown");
         } catch (IllegalArgumentException e) {
         }
-
-        assertEquals(JSlider.HORIZONTAL, slider.getOrientation());
-
+        assertEquals(SwingConstants.HORIZONTAL, slider.getOrientation());
         propertyChangeController = new PropertyChangeController();
         slider.addPropertyChangeListener(propertyChangeController);
-        slider.setOrientation(JSlider.VERTICAL);
+        slider.setOrientation(SwingConstants.VERTICAL);
         assertTrue(propertyChangeController.isChanged("orientation"));
-        assertEquals(JSlider.VERTICAL, slider.getOrientation());
+        assertEquals(SwingConstants.VERTICAL, slider.getOrientation());
     }
 
     public void testSetGetModel() throws Exception {
         assertNotNull(slider.getModel());
-
         propertyChangeController = new PropertyChangeController();
         slider.addPropertyChangeListener(propertyChangeController);
         slider.setModel(new DefaultBoundedRangeModel());
@@ -175,7 +170,7 @@
         propertyChangeController.reset();
         slider.setPaintLabels(true);
         assertFalse(propertyChangeController.isChanged("paintLabels"));
-}
+    }
 
     public void testCreateStandardLabels() throws Exception {
         try {
@@ -193,20 +188,18 @@
             fail("IllegalArgumentException shall be thrown");
         } catch (IllegalArgumentException e) {
         }
-
-        Hashtable t = slider.createStandardLabels(2, 0);
+        Hashtable<?, ?> t = slider.createStandardLabels(2, 0);
         assertNotNull(t);
-        Enumeration enumeration = t.keys();
+        Enumeration<?> enumeration = t.keys();
         while (enumeration.hasMoreElements()) {
-            Integer key = (Integer)enumeration.nextElement();
-            String text = ((JLabel)t.get(key)).getText();
+            Integer key = (Integer) enumeration.nextElement();
+            String text = ((JLabel) t.get(key)).getText();
             assertEquals(key.toString(), text);
         }
     }
 
     public void testGetUI() throws Exception {
         assertNotNull(slider.getUI());
-        assertTrue(slider.getUI() instanceof SliderUI);
         assertTrue(slider.getUI() == slider.getUI());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSpinnerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSpinnerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSpinnerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSpinnerTest.java Sat Nov 25 16:04:10 2006
@@ -18,7 +18,6 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.beans.PropertyChangeEvent;
@@ -26,7 +25,6 @@
 import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Date;
-
 import javax.swing.JFormattedTextField.AbstractFormatter;
 import javax.swing.JSpinner.DateEditor;
 import javax.swing.JSpinner.DefaultEditor;
@@ -38,16 +36,17 @@
 import javax.swing.text.DateFormatter;
 import javax.swing.text.DefaultFormatterFactory;
 import javax.swing.text.NumberFormatter;
-
 import org.apache.harmony.x.swing.StringConstants;
 import org.apache.harmony.x.swing.Utilities;
 
 public class JSpinnerTest extends BasicSwingTestCase {
-
     private JSpinner spinner;
+
     private SpinnerModel abstractModel;
+
     private ChangeController chl;
 
+    @Override
     public void setUp() {
         spinner = new JSpinner();
         propertyChangeController = new PropertyChangeController();
@@ -55,15 +54,30 @@
         chl = new ChangeController();
         spinner.addChangeListener(chl);
         abstractModel = new SpinnerModel() {
-            public void addChangeListener(ChangeListener l) {}
-            public Object getNextValue() {return null;}
-            public Object getPreviousValue() {return null;}
-            public Object getValue() {return null;}
-            public void removeChangeListener(ChangeListener l) {}
-            public void setValue(Object value) {}
+            public void addChangeListener(ChangeListener l) {
+            }
+
+            public Object getNextValue() {
+                return null;
+            }
+
+            public Object getPreviousValue() {
+                return null;
+            }
+
+            public Object getValue() {
+                return null;
+            }
+
+            public void removeChangeListener(ChangeListener l) {
+            }
+
+            public void setValue(Object value) {
+            }
         };
     }
 
+    @Override
     public void tearDown() {
         spinner = null;
         abstractModel = null;
@@ -79,16 +93,14 @@
 
     public void testSetGetUpdateUI() {
         assertEquals(spinner.getUIClassID(), "SpinnerUI");
-
         SpinnerUI defaultUI = spinner.getUI();
         assertNotNull(defaultUI);
-
-        SpinnerUI ui = new SpinnerUI() {};
+        SpinnerUI ui = new SpinnerUI() {
+        };
         spinner.setUI(ui);
         assertEquals(ui, spinner.getUI());
         assertTrue(propertyChangeController.isChanged("UI"));
         propertyChangeController.reset();
-
         spinner.updateUI();
         assertNotSame(ui, spinner.getUI());
         assertTrue(propertyChangeController.isChanged("UI"));
@@ -101,20 +113,18 @@
         assertTrue(propertyChangeController.isChanged(StringConstants.MODEL_PROPERTY_CHANGED));
         assertTrue(propertyChangeController.isChanged(StringConstants.EDITOR_PROPERTY_CHANGED));
         assertEquals(1, newModel.getChangeListeners().length);
-
         spinner.setEditor(new JButton());
         propertyChangeController.reset();
         spinner.setModel(new SpinnerNumberModel(0, -2, 2, 1));
         assertFalse(propertyChangeController.isChanged(StringConstants.EDITOR_PROPERTY_CHANGED));
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 spinner.setModel(null);
             }
         });
-
         if (isHarmony()) {
-            SpinnerNumberModel old = (SpinnerNumberModel)spinner.getModel();
+            SpinnerNumberModel old = (SpinnerNumberModel) spinner.getModel();
             spinner.setModel(new SpinnerDateModel());
             assertEquals(old.getChangeListeners().length, 0);
         }
@@ -134,17 +144,15 @@
     public void testAddRemoveGetChangeListener() {
         assertEquals(2, spinner.getChangeListeners().length);
         assertTrue(Arrays.asList(spinner.getChangeListeners()).contains(chl));
-
         ChangeListener listener = new ChangeListener() {
-            public void stateChanged(ChangeEvent e) {}
+            public void stateChanged(ChangeEvent e) {
+            }
         };
         spinner.addChangeListener(listener);
         assertTrue(Arrays.asList(spinner.getChangeListeners()).contains(listener));
-
         spinner.removeChangeListener(chl);
         spinner.removeChangeListener(listener);
         assertEquals(1, spinner.getChangeListeners().length);
-
     }
 
     public void testFireStateChanged() {
@@ -155,35 +163,30 @@
     public void testSetGetEditor() throws Exception {
         JComponent oldEditor = spinner.getEditor();
         assertNotNull(oldEditor);
-
         JComponent editor = new JProgressBar();
         spinner.setEditor(editor);
         assertFalse(Arrays.asList(spinner.getChangeListeners()).contains(editor));
         assertTrue(propertyChangeController.isChanged(StringConstants.EDITOR_PROPERTY_CHANGED));
         assertSame(editor, spinner.getEditor());
-
         editor = new JSpinner.NumberEditor(spinner);
         spinner.setEditor(editor);
         assertTrue(Arrays.asList(spinner.getChangeListeners()).contains(editor));
         assertTrue(propertyChangeController.isChanged(StringConstants.EDITOR_PROPERTY_CHANGED));
         assertSame(editor, spinner.getEditor());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 spinner.setEditor(null);
             }
         });
-
         spinner = new JSpinner();
         spinner.setEditor(oldEditor);
         assertFalse(Arrays.asList(spinner.getChangeListeners()).contains(oldEditor));
-
         spinner = new JSpinner();
         oldEditor = spinner.getEditor();
         spinner.setEditor(oldEditor);
         spinner.setModel(new SpinnerDateModel());
         assertNotSame(spinner.getEditor(), oldEditor);
-
         spinner = new JSpinner();
         oldEditor = spinner.getEditor();
         spinner.setEditor(oldEditor);
@@ -195,15 +198,12 @@
         SpinnerModel model = new SpinnerNumberModel();
         spinner.setModel(model);
         assertTrue(spinner.createEditor(model) instanceof JSpinner.NumberEditor);
-
         model = new SpinnerDateModel();
         spinner.setModel(model);
         assertTrue(spinner.createEditor(model) instanceof JSpinner.DateEditor);
-
         model = new SpinnerListModel();
         spinner.setModel(model);
         assertTrue(spinner.createEditor(model) instanceof JSpinner.ListEditor);
-
         assertTrue(spinner.createEditor(abstractModel) instanceof JSpinner.DefaultEditor);
     }
 
@@ -211,122 +211,116 @@
     }
 
     public void testDefaultEditor_DefaultEditor() {
-       DefaultEditor defaultEditor = (DefaultEditor)spinner.createEditor(abstractModel);
-       spinner.setEditor(defaultEditor);
-       assertTrue(Arrays.asList(defaultEditor.getTextField().getPropertyChangeListeners()).contains(defaultEditor));
-       assertFalse(defaultEditor.getTextField().isEditable());
-       assertSame(defaultEditor.getTextField(), defaultEditor.getComponent(0));
-
-       JFormattedTextField textField = ((DefaultEditor)spinner.getEditor()).getTextField();
-       assertSame(textField.getActionForKeyStroke(KeyStroke.getKeyStroke("DOWN")), textField.getActionForKeyStroke(KeyStroke.getKeyStroke("UP")));
-       textField.setFormatterFactory(new DefaultFormatterFactory(null));
-       textField.setValue("TEST");
-       assertEquals(new Integer(0), textField.getValue());
-
+        DefaultEditor defaultEditor = (DefaultEditor) spinner.createEditor(abstractModel);
+        spinner.setEditor(defaultEditor);
+        assertTrue(Arrays.asList(defaultEditor.getTextField().getPropertyChangeListeners())
+                .contains(defaultEditor));
+        assertFalse(defaultEditor.getTextField().isEditable());
+        assertSame(defaultEditor.getTextField(), defaultEditor.getComponent(0));
+        JFormattedTextField textField = ((DefaultEditor) spinner.getEditor()).getTextField();
+        assertSame(textField.getActionForKeyStroke(KeyStroke.getKeyStroke("DOWN")), textField
+                .getActionForKeyStroke(KeyStroke.getKeyStroke("UP")));
+        textField.setFormatterFactory(new DefaultFormatterFactory(null));
+        textField.setValue("TEST");
+        assertEquals(new Integer(0), textField.getValue());
     }
 
     public void testDefaultEditor_propertyChange() throws Exception {
-        DefaultEditor defaultEditor = (DefaultEditor)spinner.getEditor();
+        DefaultEditor defaultEditor = (DefaultEditor) spinner.getEditor();
         PropertyChangeController pcc = new PropertyChangeController();
         ChangeController modelController = new ChangeController();
         defaultEditor.getTextField().addPropertyChangeListener(pcc);
         spinner.getModel().addChangeListener(modelController);
-
         defaultEditor.getTextField().setText("15");
         defaultEditor.commitEdit();
         assertTrue(pcc.isChanged());
         assertTrue(modelController.isChanged());
-
         modelController.reset();
         defaultEditor.getTextField().removePropertyChangeListener(defaultEditor);
         defaultEditor.getTextField().setText("18");
         defaultEditor.commitEdit();
         defaultEditor.getTextField().addPropertyChangeListener(defaultEditor);
-        defaultEditor.propertyChange(new PropertyChangeEvent(defaultEditor.getTextField(), "value",
-                                                             defaultEditor.getTextField().getValue(), new Integer(10)));
+        defaultEditor.propertyChange(new PropertyChangeEvent(defaultEditor.getTextField(),
+                "value", defaultEditor.getTextField().getValue(), new Integer(10)));
         assertTrue(modelController.isChanged());
-
-
         modelController.reset();
         defaultEditor.getTextField().removePropertyChangeListener(defaultEditor);
         defaultEditor.getTextField().setText("58");
         defaultEditor.commitEdit();
         defaultEditor.getTextField().addPropertyChangeListener(defaultEditor);
         defaultEditor.propertyChange(new PropertyChangeEvent(new Integer(10), "value",
-                                                             new Integer(13), new Integer(10)));
+                new Integer(13), new Integer(10)));
         assertFalse(modelController.isChanged());
     }
 
     public void testDefaultEditor_stateChange() {
-        DefaultEditor defaultEditor = (DefaultEditor)spinner.getEditor();
+        DefaultEditor defaultEditor = (DefaultEditor) spinner.getEditor();
         PropertyChangeController pcc = new PropertyChangeController();
         defaultEditor.getTextField().addPropertyChangeListener(pcc);
-
         spinner.setValue(new Integer(159));
         assertTrue(pcc.isChanged());
     }
 
     public void testDefaultEditor_LayoutSizes() {
-        DefaultEditor defaultEditor = (DefaultEditor)spinner.createEditor(abstractModel);
+        DefaultEditor defaultEditor = (DefaultEditor) spinner.createEditor(abstractModel);
         spinner.setEditor(defaultEditor);
-        assertEquals(defaultEditor.minimumLayoutSize(spinner), Utilities.addInsets(defaultEditor.getTextField().getMinimumSize(), spinner.getInsets()));
-        assertEquals(defaultEditor.preferredLayoutSize(spinner), Utilities.addInsets(defaultEditor.getTextField().getPreferredSize(), spinner.getInsets()));
+        assertEquals(defaultEditor.minimumLayoutSize(spinner), Utilities.addInsets(
+                defaultEditor.getTextField().getMinimumSize(), spinner.getInsets()));
+        assertEquals(defaultEditor.preferredLayoutSize(spinner), Utilities.addInsets(
+                defaultEditor.getTextField().getPreferredSize(), spinner.getInsets()));
     }
 
     public void testNumberEditor_NumberEditor() {
         spinner.getModel().setValue(new Integer(5));
         NumberEditor numEditor = new NumberEditor(spinner);
         spinner.setEditor(numEditor);
-
         assertTrue(numEditor.getTextField().isEditable());
-
         assertTrue(numEditor.getTextField().getFormatter() instanceof NumberFormatter);
         assertEquals(numEditor.getTextField().getValue(), new Integer(5));
-        assertSame(((NumberFormatter)numEditor.getTextField().getFormatter()).getValueClass(), Integer.class);
-        assertNull(((NumberFormatter)numEditor.getTextField().getFormatter()).getMinimum());
-        assertNull(((NumberFormatter)numEditor.getTextField().getFormatter()).getMaximum());
+        assertSame(((NumberFormatter) numEditor.getTextField().getFormatter()).getValueClass(),
+                Integer.class);
+        assertNull(((NumberFormatter) numEditor.getTextField().getFormatter()).getMinimum());
+        assertNull(((NumberFormatter) numEditor.getTextField().getFormatter()).getMaximum());
         assertTrue(numEditor.getFormat().equals(new DecimalFormat()));
-
         spinner.setModel(abstractModel);
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSpinner.NumberEditor(spinner);
             }
         });
-
     }
 
     public void testNumberEditor_formatter() {
         NumberEditor numEditor = new NumberEditor(spinner);
         spinner.setEditor(numEditor);
-
         final Integer max1 = new Integer(777);
-        NumberFormatter numberFormatter = ((NumberFormatter)numEditor.getTextField().getFormatter());
+        NumberFormatter numberFormatter = ((NumberFormatter) numEditor.getTextField()
+                .getFormatter());
         numberFormatter.setMaximum(max1);
         assertSame(numberFormatter.getMaximum(), max1);
         assertSame(numEditor.getModel().getMaximum(), max1);
-
         final Integer max2 = new Integer(555);
         numEditor.getModel().setMaximum(max2);
         assertSame(numberFormatter.getMaximum(), max2);
         assertSame(numEditor.getModel().getMaximum(), max2);
-
-        SpinnerNumberModel old = (SpinnerNumberModel)spinner.getModel();
+        SpinnerNumberModel old = (SpinnerNumberModel) spinner.getModel();
         spinner.setModel(abstractModel);
         final Integer max3 = new Integer(333);
         old.setMaximum(max3);
-        assertSame(((NumberFormatter)((NumberEditor)spinner.getEditor()).getTextField().getFormatter()).getMaximum(), max3);
+        assertSame(((NumberFormatter) ((NumberEditor) spinner.getEditor()).getTextField()
+                .getFormatter()).getMaximum(), max3);
     }
 
     public void testNumberEditor_getModel() {
         NumberEditor numEditor = new NumberEditor(spinner);
         spinner.setEditor(numEditor);
-
         assertSame(numEditor.getModel(), spinner.getModel());
         spinner.setModel(abstractModel);
         testExceptionalCase(new ExceptionalCase(null, ClassCastException.class) {
+            @Override
             public void exceptionalAction() throws Exception {
-                    ((NumberEditor)spinner.getEditor()).getModel();
+                ((NumberEditor) spinner.getEditor()).getModel();
             }
         });
     }
@@ -335,16 +329,14 @@
         spinner.setModel(new SpinnerDateModel());
         DateEditor dateEditor = (DateEditor) spinner.getEditor();
         spinner.setEditor(dateEditor);
-
         assertTrue(dateEditor.getTextField().isEditable());
-
         assertTrue(dateEditor.getTextField().getFormatter() instanceof DateFormatter);
-        assertNull(((DateFormatter)dateEditor.getTextField().getFormatter()).getMinimum());
-        assertNull(((DateFormatter)dateEditor.getTextField().getFormatter()).getMaximum());
+        assertNull(((DateFormatter) dateEditor.getTextField().getFormatter()).getMinimum());
+        assertNull(((DateFormatter) dateEditor.getTextField().getFormatter()).getMaximum());
         assertTrue(dateEditor.getFormat().equals(new SimpleDateFormat()));
-
         spinner.setModel(abstractModel);
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSpinner.DateEditor(spinner);
             }
@@ -355,35 +347,32 @@
         spinner.setModel(new SpinnerDateModel());
         DateEditor dateEditor = new DateEditor(spinner);
         spinner.setEditor(dateEditor);
-
         final Date date1 = new Date(777);
-        DateFormatter dateFormatter = ((DateFormatter)dateEditor.getTextField().getFormatter());
+        DateFormatter dateFormatter = ((DateFormatter) dateEditor.getTextField().getFormatter());
         dateFormatter.setMaximum(date1);
         assertSame(dateFormatter.getMaximum(), date1);
         assertSame(dateEditor.getModel().getEnd(), date1);
-
         final Date date2 = new Date(555);
         dateEditor.getModel().setEnd(date2);
         assertSame(dateFormatter.getMaximum(), date2);
         assertSame(dateEditor.getModel().getEnd(), date2);
-
-        SpinnerDateModel old = (SpinnerDateModel)spinner.getModel();
+        SpinnerDateModel old = (SpinnerDateModel) spinner.getModel();
         spinner.setModel(abstractModel);
         final Date date3 = new Date(555);
         old.setEnd(date3);
-        assertEquals(((DateFormatter)((DateEditor)spinner.getEditor()).getTextField().getFormatter()).getMaximum(), date3);
+        assertEquals(((DateFormatter) ((DateEditor) spinner.getEditor()).getTextField()
+                .getFormatter()).getMaximum(), date3);
     }
 
     public void testListEditor_ListEditor() {
-        Object[] values = {"arrline1", "arrline2", "text", new Integer(33), spinner};
+        Object[] values = { "arrline1", "arrline2", "text", new Integer(33), spinner };
         spinner.setModel(new SpinnerListModel(values));
         ListEditor listEditor = new ListEditor(spinner);
         spinner.setEditor(listEditor);
-
         assertTrue(listEditor.getTextField().isEditable());
-
         spinner.setModel(abstractModel);
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSpinner.ListEditor(spinner);
             }
@@ -392,16 +381,14 @@
 
     public void testListEditor_formatter() throws Exception {
         JComponent comp = new JButton();
-        Object[] values = {"arrline1", "arrline2", "text", new Integer(33), comp};
+        Object[] values = { "arrline1", "arrline2", "text", new Integer(33), comp };
         spinner.setModel(new SpinnerListModel(values));
         ListEditor listEditor = new ListEditor(spinner);
         spinner.setEditor(listEditor);
-
-        AbstractFormatter formatter = ((ListEditor)spinner.getEditor()).getTextField().getFormatter();
+        AbstractFormatter formatter = ((ListEditor) spinner.getEditor()).getTextField()
+                .getFormatter();
         assertEquals(formatter.valueToString(null), "");
         assertEquals(formatter.valueToString(new Integer(33)), "33");
-
         assertEquals(formatter.stringToValue("text"), "text");
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSplitPaneTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSplitPaneTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSplitPaneTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JSplitPaneTest.java Sat Nov 25 16:04:10 2006
@@ -14,7 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Anton Avtamonov
  * @version $Revision$
@@ -24,7 +23,6 @@
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Graphics;
-
 import javax.swing.plaf.SplitPaneUI;
 import javax.swing.plaf.basic.BasicSplitPaneUI;
 import javax.swing.plaf.metal.MetalSplitPaneUI;
@@ -36,12 +34,14 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         pane = new JSplitPane();
         propertyChangeController = new PropertyChangeController();
         pane.addPropertyChangeListener(propertyChangeController);
     }
 
+    @Override
     protected void tearDown() throws Exception {
         pane = null;
     }
@@ -53,8 +53,6 @@
         assertEquals(0, pane.getLastDividerLocation());
         assertEquals(-1, pane.getDividerLocation());
         assertEquals(JSplitPane.HORIZONTAL_SPLIT, pane.getOrientation());
-
-
         pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
         assertNull(pane.getLeftComponent());
         assertNull(pane.getRightComponent());
@@ -62,32 +60,26 @@
         assertEquals(0, pane.getLastDividerLocation());
         assertEquals(-1, pane.getDividerLocation());
         assertEquals(JSplitPane.VERTICAL_SPLIT, pane.getOrientation());
-
         pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
         assertEquals(JSplitPane.HORIZONTAL_SPLIT, pane.getOrientation());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSplitPane(2);
             }
         });
-
-
         pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
         assertTrue(pane.isContinuousLayout());
         assertEquals(JSplitPane.HORIZONTAL_SPLIT, pane.getOrientation());
-
         pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, false);
         assertFalse(pane.isContinuousLayout());
         assertEquals(JSplitPane.VERTICAL_SPLIT, pane.getOrientation());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSplitPane(-1, true);
             }
         });
-
-
         Component left = new JButton();
         Component right = new JButton();
         pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, left, right);
@@ -95,15 +87,13 @@
         assertEquals(right, pane.getRightComponent());
         assertFalse(pane.isContinuousLayout());
         assertEquals(JSplitPane.VERTICAL_SPLIT, pane.getOrientation());
-
-
         pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, left, right);
         assertEquals(left, pane.getLeftComponent());
         assertEquals(right, pane.getRightComponent());
         assertTrue(pane.isContinuousLayout());
         assertEquals(JSplitPane.VERTICAL_SPLIT, pane.getOrientation());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 new JSplitPane(2, true, new JButton(), new JButton());
             }
@@ -137,7 +127,6 @@
         assertEquals(left, pane.getLeftComponent());
         assertEquals(left, pane.getTopComponent());
         assertEquals(left, pane.getComponent(2));
-
         Component top = new JPanel();
         pane.setTopComponent(top);
         assertEquals(top, pane.getLeftComponent());
@@ -152,7 +141,6 @@
         assertEquals(right, pane.getRightComponent());
         assertEquals(right, pane.getBottomComponent());
         assertEquals(right, pane.getComponent(2));
-
         Component bottom = new JPanel();
         pane.setBottomComponent(bottom);
         assertEquals(bottom, pane.getRightComponent());
@@ -194,11 +182,13 @@
         assertEquals(0, 0.4, pane.getResizeWeight());
         assertTrue(propertyChangeController.isChanged("resizeWeight"));
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setResizeWeight(-1);
             }
         });
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.setResizeWeight(1.5);
             }
@@ -207,12 +197,11 @@
 
     public void testResetToPreferredSizes() throws Exception {
         if (isHarmony()) {
-            ((JComponent)pane.getLeftComponent()).setPreferredSize(new Dimension(100, 50));
-            ((JComponent)pane.getRightComponent()).setPreferredSize(new Dimension(100, 50));
+            ((JComponent) pane.getLeftComponent()).setPreferredSize(new Dimension(100, 50));
+            ((JComponent) pane.getRightComponent()).setPreferredSize(new Dimension(100, 50));
             pane.setSize(300, 100);
             pane.setBorder(BorderFactory.createEmptyBorder(10, 20, 30, 40));
             pane.setDividerLocation(40);
-
             assertEquals(40, pane.getDividerLocation());
             pane.resetToPreferredSizes();
             assertEquals(120, pane.getDividerLocation());
@@ -221,8 +210,8 @@
 
     public void testGetSetDividerLocation() throws Exception {
         assertEquals(-1, pane.getDividerLocation());
-        ((JComponent)pane.getLeftComponent()).setPreferredSize(new Dimension(100, 50));
-        ((JComponent)pane.getRightComponent()).setPreferredSize(new Dimension(100, 50));
+        ((JComponent) pane.getLeftComponent()).setPreferredSize(new Dimension(100, 50));
+        ((JComponent) pane.getRightComponent()).setPreferredSize(new Dimension(100, 50));
         pane.setSize(300, 100);
         pane.setBorder(BorderFactory.createEmptyBorder(10, 20, 30, 40));
         pane.setDividerLocation(40);
@@ -230,30 +219,28 @@
         assertTrue(propertyChangeController.isChanged("lastDividerLocation"));
         assertEquals(40, pane.getDividerLocation());
         assertEquals(0, pane.getUI().getDividerLocation(pane));
-
         pane.getUI().setDividerLocation(pane, 50);
         assertEquals(0, pane.getUI().getDividerLocation(pane));
         assertEquals(40, pane.getDividerLocation());
         pane.getLayout().layoutContainer(pane);
         assertEquals(40, pane.getDividerLocation());
         assertEquals(40, pane.getUI().getDividerLocation(pane));
-
         pane.setDividerLocation(0.3);
         assertEquals((300 - 10) * 0.3, pane.getDividerLocation(), 0);
-
         pane.setDividerLocation(0.5);
         assertEquals((300 - 10) * 0.5, pane.getDividerLocation(), 0);
-
         pane.setDividerLocation(0.6);
         assertEquals((300 - 10) * 0.6, pane.getDividerLocation(), 0);
     }
 
     public void testGetMinimumMaximumDividerLocation() throws Exception {
         SplitPaneUI ui = new BasicSplitPaneUI() {
+            @Override
             public int getMinimumDividerLocation(final JSplitPane sp) {
                 return 20;
             }
 
+            @Override
             public int getMaximumDividerLocation(final JSplitPane sp) {
                 return 40;
             }
@@ -267,22 +254,16 @@
         assertNotNull(pane.getLeftComponent());
         pane.remove(pane.getLeftComponent());
         assertNull(pane.getLeftComponent());
-
         assertNotNull(pane.getRightComponent());
         pane.remove(pane.getRightComponent());
         assertNull(pane.getRightComponent());
-
-
         pane = new JSplitPane();
         assertNotNull(pane.getRightComponent());
         pane.remove(1);
         assertNull(pane.getRightComponent());
-
         assertNotNull(pane.getLeftComponent());
         pane.remove(0);
         assertNull(pane.getLeftComponent());
-
-
         pane = new JSplitPane();
         assertNotNull(pane.getLeftComponent());
         assertNotNull(pane.getRightComponent());
@@ -298,36 +279,29 @@
     public void testAddImpl() throws Exception {
         pane.removeAll();
         assertEquals(0, pane.getComponentCount());
-
         Component left = new JButton();
         pane.add(left, JSplitPane.LEFT);
         assertEquals(1, pane.getComponentCount());
         assertEquals(left, pane.getLeftComponent());
         assertEquals(left, pane.getTopComponent());
-
         Component top = new JButton();
         pane.add(top, JSplitPane.TOP);
         assertEquals(1, pane.getComponentCount());
         assertEquals(top, pane.getLeftComponent());
         assertEquals(top, pane.getTopComponent());
-
         Component right = new JButton();
         pane.add(right, JSplitPane.RIGHT);
         assertEquals(2, pane.getComponentCount());
         assertEquals(right, pane.getRightComponent());
         assertEquals(right, pane.getBottomComponent());
-
         Component bottom = new JButton();
         pane.add(bottom, JSplitPane.BOTTOM);
         assertEquals(2, pane.getComponentCount());
         assertEquals(bottom, pane.getRightComponent());
         assertEquals(bottom, pane.getBottomComponent());
-
         Component divider = new JButton();
         pane.add(divider, JSplitPane.DIVIDER);
         assertEquals(3, pane.getComponentCount());
-
-
         pane.removeAll();
         left = new JButton();
         right = new JButton();
@@ -335,25 +309,21 @@
         pane.addImpl(left, JSplitPane.LEFT, 0);
         assertSame(right, pane.getComponent(0));
         assertSame(left, pane.getComponent(1));
-
-
         pane.removeAll();
         left = new JButton();
         pane.add(left);
         assertEquals(left, pane.getLeftComponent());
-
         right = new JButton();
         pane.add(right);
         assertEquals(right, pane.getRightComponent());
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.add(new JButton());
             }
         });
-
-
         testExceptionalCase(new IllegalArgumentCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 pane.add(new JButton(), "wrong");
             }
@@ -363,12 +333,12 @@
     public void testPaintChildren() throws Exception {
         final Marker m = new Marker();
         SplitPaneUI ui = new BasicSplitPaneUI() {
+            @Override
             public void finishedPaintingChildren(final JSplitPane sp, final Graphics g) {
                 m.mark();
             }
         };
         pane.setUI(ui);
-
         pane.paintChildren(createTestGraphics());
         assertTrue(m.isMarked());
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/JTabbedPaneRTest.java Sat Nov 25 16:04:10 2006
@@ -27,12 +27,13 @@
         super(name);
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         pane = new JTabbedPane();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -43,7 +44,6 @@
         pane.add("tab1", comp1);
         pane.add("tab2", null);
         pane.add("tab3", comp3);
-
         assertEquals(2, pane.getComponentCount());
         assertSame(comp1, pane.getComponentAt(0));
         assertNull(pane.getComponentAt(1));



Mime
View raw message