harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479418 [8/43] - in /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common: javax/swing/ javax/swing/border/ javax/swing/colorchooser/ javax/swing/event/ javax/swing/filechooser/ javax/swing/plaf/ javax/swing/plaf/basic/ ja...
Date Sun, 26 Nov 2006 20:15:55 GMT
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicMenuUI_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicMenuUI_MultithreadedTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicMenuUI_MultithreadedTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicMenuUI_MultithreadedTest.java Sun Nov 26 12:15:43 2006
@@ -15,13 +15,12 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing.plaf.basic;
 
 import java.lang.reflect.InvocationTargetException;
-
 import javax.swing.BasicSwingTestCase;
 import javax.swing.JButton;
 import javax.swing.JFrame;
@@ -36,7 +35,6 @@
 import javax.swing.event.PopupMenuListener;
 
 public class BasicMenuUI_MultithreadedTest extends BasicSwingTestCase {
-
     protected BasicMenuUI menuUI;
 
     private class ConcretePopupListener implements PopupMenuListener {
@@ -44,20 +42,25 @@
 
         public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
             visible = true;
-            synchronized(this) {
+            synchronized (this) {
                 notify();
             }
         }
 
-        public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
-        public void popupMenuCanceled(PopupMenuEvent e) {}
+        public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+        }
+
+        public void popupMenuCanceled(PopupMenuEvent e) {
+        }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         menuUI = new BasicMenuUI();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         menuUI = null;
         super.tearDown();
@@ -66,45 +69,40 @@
     /*
      * Test method for 'javax.swing.plaf.basic.BasicMenuUI.setupPostTimer(JMenu)'
      */
+    @SuppressWarnings("deprecation")
     public void testSetupPostTimer() throws InterruptedException, InvocationTargetException {
         final MenuSelectionManager manager = MenuSelectionManager.defaultManager();
-
         JFrame frame = new JFrame();
         JMenuBar menuBar = new JMenuBar();
         final JMenu menu = new JMenu("menu");
         menu.setUI(menuUI);
-
         ConcretePopupListener listener = new ConcretePopupListener();
         menu.getPopupMenu().addPopupMenuListener(listener);
         menu.add(new JMenuItem("item"));
-
         frame.setJMenuBar(menuBar);
         menuBar.add(menu);
         final JButton button = new JButton();
         frame.getContentPane().add(button);
         frame.pack();
         frame.show();
-
         SwingWaitTestCase.requestFocusInWindowForComponent(button);
-
-
-        manager.setSelectedPath(new MenuElement[] {menuBar});
+        manager.setSelectedPath(new MenuElement[] { menuBar });
         menu.setDelay(100);
         setupTimerAntWait(menu, menuUI, listener);
         assertFalse(listener.visible);
-
-        manager.setSelectedPath(new MenuElement[] {menuBar, menu});
+        manager.setSelectedPath(new MenuElement[] { menuBar, menu });
         setupTimerAntWait(menu, menuUI, listener);
         assertTrue(listener.visible);
-
-        manager.setSelectedPath(new MenuElement[] {menuBar});
-        manager.setSelectedPath(new MenuElement[] {menuBar, menu});
+        manager.setSelectedPath(new MenuElement[] { menuBar });
+        manager.setSelectedPath(new MenuElement[] { menuBar, menu });
         menu.setDelay(10000);
         setupTimerAntWait(menu, menuUI, listener);
         assertFalse(listener.visible);
     }
 
-    private void setupTimerAntWait(final JMenu menu, final BasicMenuUI ui, final ConcretePopupListener listener) throws InterruptedException, InvocationTargetException {
+    private void setupTimerAntWait(final JMenu menu, final BasicMenuUI ui,
+            final ConcretePopupListener listener) throws InterruptedException,
+            InvocationTargetException {
         synchronized (listener) {
             listener.visible = false;
         }
@@ -117,5 +115,4 @@
             listener.wait(1000);
         }
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUITest.java Sun Nov 26 12:15:43 2006
@@ -33,7 +33,6 @@
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.awt.image.BufferedImage;
-
 import javax.swing.BorderFactory;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
@@ -61,15 +60,14 @@
 import javax.swing.plaf.basic.BasicOptionPaneUI.ButtonAreaLayout;
 
 public class BasicOptionPaneUITest extends SwingTestCase {
-
     protected BasicOptionPaneUI paneUI;
 
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-
         paneUI = new BasicOptionPaneUI() {
             public FontMetrics getFontMetrics(Font font) {
                 return BasicOptionPaneUITest.this.getFontMetrics(font);
@@ -104,11 +102,15 @@
 
     public void testGetPreferredSize() {
         JOptionPane pane = new JOptionPane() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public FontMetrics getFontMetrics(Font font) {
                 return BasicOptionPaneUITest.this.getFontMetrics(font);
             }
         };
-        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3, 3, 3));
+        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3,
+                3, 3));
         UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
         messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(4, 4, 4, 4));
         UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
@@ -122,19 +124,15 @@
         assertNotNull(preferredSize);
         assertTrue(preferredSize.width > 0);
         assertTrue(preferredSize.height > 0);
-
         LayoutManager layout = new MyLayoutManager(new Dimension(200, 500));
         pane.setLayout(layout);
         assertEquals(new Dimension(200, 500), paneUI.getPreferredSize(pane));
-
         layout = new MyLayoutManager(new Dimension(200, 300));
         pane.setLayout(layout);
         assertEquals(new Dimension(200, 456), paneUI.getPreferredSize(pane));
-
         layout = new MyLayoutManager(new Dimension(100, 500));
         pane.setLayout(layout);
         assertEquals(new Dimension(123, 500), paneUI.getPreferredSize(pane));
-
         layout = new MyLayoutManager(new Dimension(10, 10));
         pane.setLayout(layout);
         assertEquals(new Dimension(123, 456), paneUI.getPreferredSize(pane));
@@ -161,9 +159,12 @@
     }
 
     public void testCreateUI() {
-        assertTrue("created UI is not null", null != BasicOptionPaneUI.createUI(new JOptionPane()));
-        assertTrue("created UI is of the proper class", BasicOptionPaneUI.createUI(null) instanceof BasicOptionPaneUI);
-        assertNotSame("created UIs are unique", BasicOptionPaneUI.createUI(null), BasicOptionPaneUI.createUI(null));
+        assertTrue("created UI is not null", null != BasicOptionPaneUI
+                .createUI(new JOptionPane()));
+        assertTrue("created UI is of the proper class",
+                BasicOptionPaneUI.createUI(null) instanceof BasicOptionPaneUI);
+        assertNotSame("created UIs are unique", BasicOptionPaneUI.createUI(null),
+                BasicOptionPaneUI.createUI(null));
     }
 
     public void testSelectInitialValue() {
@@ -173,32 +174,27 @@
     public void testContainsCustomComponents() {
         OptionPaneUI ui = null;
         JOptionPane optionPane = null;
-
         optionPane = new JOptionPane();
         assertFalse(paneUI.containsCustomComponents(optionPane));
         assertFalse(paneUI.containsCustomComponents(null));
         paneUI.hasCustomComponents = true;
         assertTrue(paneUI.containsCustomComponents(optionPane));
         assertTrue(paneUI.containsCustomComponents(null));
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE);
         ui = optionPane.getUI();
         assertFalse(ui.containsCustomComponents(optionPane));
         assertFalse(ui.containsCustomComponents(null));
-
         optionPane = new JOptionPane(new JButton("Message"), JOptionPane.ERROR_MESSAGE);
         ui = optionPane.getUI();
         assertTrue(ui.containsCustomComponents(optionPane));
         assertTrue(ui.containsCustomComponents(null));
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2"});
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2" });
         ui = optionPane.getUI();
         assertFalse(ui.containsCustomComponents(optionPane));
         assertFalse(ui.containsCustomComponents(null));
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {new Button("1"), "2"});
+                JOptionPane.CLOSED_OPTION, null, new Object[] { new Button("1"), "2" });
         ui = optionPane.getUI();
         assertTrue(ui.containsCustomComponents(optionPane));
         assertTrue(ui.containsCustomComponents(null));
@@ -206,7 +202,6 @@
 
     public void testInstallDefaults() {
         JOptionPane pane = new JOptionPane();
-
         UIManager.put("OptionPane.background", new ColorUIResource(Color.red));
         UIManager.put("OptionPane.foreground", new ColorUIResource(Color.yellow));
         UIManager.put("OptionPane.messageForeground", new ColorUIResource(Color.green));
@@ -216,9 +211,8 @@
         UIManager.put("OptionPane.border", border);
         Dimension minimumSize = new DimensionUIResource(123, 456);
         UIManager.put("OptionPane.minimumSize", minimumSize);
-
         pane.setUI(paneUI);
-        pane.setOptions(new Object[]{"button"});
+        pane.setOptions(new Object[] { "button" });
         paneUI.installDefaults();
         assertEquals(Color.red, pane.getBackground());
         assertEquals(Color.yellow, pane.getForeground());
@@ -249,15 +243,13 @@
         paneUI.optionPane = pane;
         JCheckBox fake = new JCheckBox();
         paneUI.inputComponent = fake;
-
         paneUI.installComponents();
         assertEquals(2, pane.getComponentCount());
         assertTrue(pane.getComponent(0) instanceof JPanel);
         assertTrue(pane.getComponent(1) instanceof JPanel);
-        assertTrue(((JPanel)pane.getComponent(0)).getComponent(0) instanceof JPanel);
-        assertTrue(((JPanel)pane.getComponent(1)).getComponent(0) instanceof JButton);
+        assertTrue(((JPanel) pane.getComponent(0)).getComponent(0) instanceof JPanel);
+        assertTrue(((JPanel) pane.getComponent(1)).getComponent(0) instanceof JButton);
         assertNull(paneUI.inputComponent);
-
         paneUI.inputComponent = fake;
         paneUI.optionPane.setWantsInput(true);
         paneUI.installComponents();
@@ -270,7 +262,6 @@
         paneUI.optionPane = pane;
         pane.add(new JCheckBox());
         paneUI.inputComponent = new JCheckBox();
-
         paneUI.uninstallComponents();
         assertEquals(0, pane.getComponentCount());
         assertNotNull(paneUI.optionPane);
@@ -281,23 +272,21 @@
         LayoutManager layout1 = paneUI.createLayoutManager();
         LayoutManager layout2 = paneUI.createLayoutManager();
         assertTrue("LayoutManager is not null", layout1 != null);
-        assertEquals("LayoutManager's class ", "javax.swing.BoxLayout", layout1.getClass().getName());
+        assertEquals("LayoutManager's class ", "javax.swing.BoxLayout", layout1.getClass()
+                .getName());
         assertFalse("layout2 is not shared", layout1 == layout2);
     }
 
     public void testInstallListeners() {
         paneUI.optionPane = new JOptionPane();
-
         assertEquals(1, paneUI.optionPane.getPropertyChangeListeners().length);
     }
 
     public void testUninstallListeners() {
         paneUI.optionPane = new JOptionPane();
         paneUI.optionPane.setUI(paneUI);
-
         assertEquals(1, paneUI.optionPane.getPropertyChangeListeners().length);
         assertNotNull(paneUI.propertyChangeListener);
-
         paneUI.uninstallListeners();
         assertEquals(0, paneUI.optionPane.getPropertyChangeListeners().length);
         assertNull(paneUI.propertyChangeListener);
@@ -311,7 +300,8 @@
         paneUI.optionPane = new JOptionPane();
         Object[] keys = null;
         paneUI.uninstallKeyboardActions();
-        keys = paneUI.optionPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).allKeys();
+        keys = paneUI.optionPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
+                .allKeys();
         assertTrue(keys == null || keys.length == 0);
         keys = paneUI.optionPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).allKeys();
         assertTrue(keys == null || keys.length == 0);
@@ -320,9 +310,9 @@
         keys = paneUI.optionPane.getActionMap().allKeys();
         assertTrue(keys == null || keys.length == 0);
         assertNull(paneUI.optionPane.getActionMap().getParent());
-
         paneUI.installKeyboardActions();
-        keys = paneUI.optionPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).allKeys();
+        keys = paneUI.optionPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
+                .allKeys();
         assertTrue(keys == null || keys.length == 0);
         keys = paneUI.optionPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).allKeys();
         assertNotNull(keys);
@@ -348,58 +338,53 @@
         pane.setUI(paneUI);
         pane.setMessageType(JOptionPane.ERROR_MESSAGE);
         pane.setMessage(message);
-        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3, 3, 3));
+        Border messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(3, 3,
+                3, 3));
         UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
         paneUI.installDefaults();
-        assertEquals(messageAreaBorder, ((JComponent)paneUI.createMessageArea()).getBorder());
+        assertEquals(messageAreaBorder, ((JComponent) paneUI.createMessageArea()).getBorder());
         messageAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(4, 4, 4, 4));
         UIManager.put("OptionPane.messageAreaBorder", messageAreaBorder);
         paneUI.installDefaults();
-        assertEquals(messageAreaBorder, ((JComponent)paneUI.createMessageArea()).getBorder());
-
-        JComponent messageArea = (JComponent)paneUI.createMessageArea();
+        assertEquals(messageAreaBorder, ((JComponent) paneUI.createMessageArea()).getBorder());
+        JComponent messageArea = (JComponent) paneUI.createMessageArea();
         assertTrue(messageArea instanceof JPanel);
-
         assertTrue(messageArea.getComponent(0) instanceof JPanel);
-        JPanel panel = (JPanel)messageArea.getComponent(0);
+        JPanel panel = (JPanel) messageArea.getComponent(0);
         assertTrue(panel.getComponent(0) instanceof JPanel);
-        assertEquals(0, ((JPanel)panel.getComponent(0)).getComponentCount());
-        assertEquals(new Dimension(15, 1), ((JPanel)panel.getComponent(0)).getPreferredSize());
+        assertEquals(0, ((JPanel) panel.getComponent(0)).getComponentCount());
+        assertEquals(new Dimension(15, 1), ((JPanel) panel.getComponent(0)).getPreferredSize());
         assertTrue(panel.getComponent(1) instanceof JPanel);
-        assertEquals(1, ((JPanel)panel.getComponent(1)).getComponentCount());
-        assertTrue(((JPanel)panel.getComponent(1)).getComponent(0) instanceof JLabel);
-        JLabel label = (JLabel)((JPanel)panel.getComponent(1)).getComponent(0);
+        assertEquals(1, ((JPanel) panel.getComponent(1)).getComponentCount());
+        assertTrue(((JPanel) panel.getComponent(1)).getComponent(0) instanceof JLabel);
+        JLabel label = (JLabel) ((JPanel) panel.getComponent(1)).getComponent(0);
         assertEquals("message", message, label.getText());
-
         assertTrue(messageArea.getComponent(1) instanceof JLabel);
-        JLabel iconLabel = (JLabel)messageArea.getComponent(1);
+        JLabel iconLabel = (JLabel) messageArea.getComponent(1);
         assertEquals(paneUI.getIconForType(JOptionPane.ERROR_MESSAGE), iconLabel.getIcon());
-
         pane = new JOptionPane();
         pane.setUI(paneUI);
         pane.setInitialValue(message + message);
         pane.setWantsInput(true);
         pane.setMessageType(JOptionPane.ERROR_MESSAGE);
         pane.setMessage(message);
-        messageArea = (JComponent)paneUI.createMessageArea();
+        messageArea = (JComponent) paneUI.createMessageArea();
         assertTrue(messageArea instanceof JPanel);
-
         assertTrue(messageArea.getComponent(0) instanceof JPanel);
-        panel = (JPanel)messageArea.getComponent(0);
+        panel = (JPanel) messageArea.getComponent(0);
         assertTrue(panel.getComponent(0) instanceof JPanel);
-        assertEquals(0, ((JPanel)panel.getComponent(0)).getComponentCount());
-        assertEquals(new Dimension(15, 1), ((JPanel)panel.getComponent(0)).getPreferredSize());
+        assertEquals(0, ((JPanel) panel.getComponent(0)).getComponentCount());
+        assertEquals(new Dimension(15, 1), ((JPanel) panel.getComponent(0)).getPreferredSize());
         assertTrue(panel.getComponent(1) instanceof JPanel);
-        assertEquals(2, ((JPanel)panel.getComponent(1)).getComponentCount());
-        assertTrue(((JPanel)panel.getComponent(1)).getComponent(0) instanceof JLabel);
-        label = (JLabel)((JPanel)panel.getComponent(1)).getComponent(0);
+        assertEquals(2, ((JPanel) panel.getComponent(1)).getComponentCount());
+        assertTrue(((JPanel) panel.getComponent(1)).getComponent(0) instanceof JLabel);
+        label = (JLabel) ((JPanel) panel.getComponent(1)).getComponent(0);
         assertEquals("message", message, label.getText());
-        assertTrue(((JPanel)panel.getComponent(1)).getComponent(1) instanceof JTextField);
-        JTextField text = (JTextField)((JPanel)panel.getComponent(1)).getComponent(1);
+        assertTrue(((JPanel) panel.getComponent(1)).getComponent(1) instanceof JTextField);
+        JTextField text = (JTextField) ((JPanel) panel.getComponent(1)).getComponent(1);
         assertEquals("message", "", text.getText());
-
         assertTrue(messageArea.getComponent(1) instanceof JLabel);
-        iconLabel = (JLabel)messageArea.getComponent(1);
+        iconLabel = (JLabel) messageArea.getComponent(1);
         assertEquals(paneUI.getIconForType(JOptionPane.ERROR_MESSAGE), iconLabel.getIcon());
     }
 
@@ -407,88 +392,77 @@
         Container messageContainer = new JPanel();
         paneUI.optionPane = new JOptionPane();
         Component child = null, parent = null;
-
         Object message1 = new JButton("Tarara");
         Object message2 = new ImageIcon();
         Object message3 = "Wu Tang";
         Object message4 = new Integer(111);
-        Object[] message5 = new Object[] {"1", "2", "3"};
+        Object[] message5 = new Object[] { "1", "2", "3" };
         GridBagConstraints constrains = new GridBagConstraints(100, 200, 300, 400, 1.0, 1.0,
-                                                               GridBagConstraints.CENTER,
-                                                               GridBagConstraints.NONE,
-                                                               new Insets(0, 0, 0, 0),
-                                                               111, 222);
+                GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),
+                111, 222);
         paneUI.addMessageComponents(messageContainer, constrains, message1, -1, true);
         assertEquals("number of children", 1, messageContainer.getComponentCount());
         child = messageContainer.getComponent(0);
         assertEquals(message1, child);
         assertEquals(201, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, message2, -1, true);
         assertEquals("number of children", 2, messageContainer.getComponentCount());
         child = messageContainer.getComponent(1);
         assertTrue(child instanceof JLabel);
-        assertSame(message2, ((JLabel)child).getIcon());
+        assertSame(message2, ((JLabel) child).getIcon());
         assertEquals(202, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, message3, 10000, true);
         assertEquals("number of children", 3, messageContainer.getComponentCount());
         child = messageContainer.getComponent(2);
         assertTrue(child instanceof JLabel);
-        assertSame(message3, ((JLabel)child).getText());
+        assertSame(message3, ((JLabel) child).getText());
         assertEquals(203, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, message3, 1, true);
         assertEquals("number of children", 4, messageContainer.getComponentCount());
         parent = messageContainer.getComponent(3);
         assertTrue(parent instanceof Box);
-        assertEquals(2, ((Box)parent).getComponentCount());
-        child = ((Box)parent).getComponent(0);
+        assertEquals(2, ((Box) parent).getComponentCount());
+        child = ((Box) parent).getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals("Wu", ((JLabel)child).getText());
-        child = ((Box)parent).getComponent(1);
+        assertEquals("Wu", ((JLabel) child).getText());
+        child = ((Box) parent).getComponent(1);
         assertTrue(child instanceof JLabel);
-        assertEquals("Tang", ((JLabel)child).getText());
+        assertEquals("Tang", ((JLabel) child).getText());
         assertEquals(204, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, message4, -1, true);
         assertEquals("number of children", 5, messageContainer.getComponentCount());
         child = messageContainer.getComponent(4);
         assertTrue(child instanceof Box);
-        child = ((Box)child).getComponent(0);
+        child = ((Box) child).getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals(message4.toString(), ((JLabel)child).getText());
+        assertEquals(message4.toString(), ((JLabel) child).getText());
         assertEquals(205, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, message5, -1, true);
         assertEquals("number of children", 8, messageContainer.getComponentCount());
         child = messageContainer.getComponent(5);
         assertTrue(child instanceof Box);
-        child = ((Box)child).getComponent(0);
+        child = ((Box) child).getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals("1", ((JLabel)child).getText());
+        assertEquals("1", ((JLabel) child).getText());
         child = messageContainer.getComponent(6);
         assertTrue(child instanceof Box);
-        child = ((Box)child).getComponent(0);
+        child = ((Box) child).getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals("2", ((JLabel)child).getText());
+        assertEquals("2", ((JLabel) child).getText());
         child = messageContainer.getComponent(7);
         assertTrue(child instanceof Box);
-        child = ((Box)child).getComponent(0);
+        child = ((Box) child).getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals("3", ((JLabel)child).getText());
+        assertEquals("3", ((JLabel) child).getText());
         assertEquals(208, constrains.gridy);
-
         messageContainer = new JPanel();
         constrains.gridy = 0;
         paneUI.addMessageComponents(messageContainer, constrains, "", 1000, false);
         assertEquals(0, messageContainer.getComponentCount());
         assertEquals(0, constrains.gridy);
-
         paneUI.addMessageComponents(messageContainer, constrains, "\n\n", 1000, false);
         assertEquals(2, messageContainer.getComponentCount());
         assertEquals(2, constrains.gridy);
-
         messageContainer = new JPanel();
         constrains.gridy = 0;
         paneUI.addMessageComponents(messageContainer, constrains, "1\n2\n\n3\n", 1000, false);
@@ -496,14 +470,13 @@
         assertEquals(4, messageContainer.getComponentCount());
         child = messageContainer.getComponent(0);
         assertTrue(child instanceof JLabel);
-        assertEquals("1", ((JLabel)child).getText());
+        assertEquals("1", ((JLabel) child).getText());
         child = messageContainer.getComponent(1);
         assertTrue(child instanceof JLabel);
-        assertEquals("2", ((JLabel)child).getText());
+        assertEquals("2", ((JLabel) child).getText());
         child = messageContainer.getComponent(3);
         assertTrue(child instanceof JLabel);
-        assertEquals("3", ((JLabel)child).getText());
-
+        assertEquals("3", ((JLabel) child).getText());
         messageContainer = new JPanel();
         constrains.gridy = 0;
         paneUI.addMessageComponents(messageContainer, constrains, "123", 1, false);
@@ -514,7 +487,6 @@
     public void testGetMessage() {
         Object message = new JButton();
         paneUI.optionPane = new JOptionPane();
-
         paneUI.optionPane.setMessage(message);
         assertEquals(message, paneUI.getMessage());
     }
@@ -524,80 +496,80 @@
         paneUI.optionPane = new JOptionPane();
         paneUI.optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
         paneUI.addIcon(panel);
-
-        JComponent label = (JComponent)panel.getComponent(0);
+        JComponent label = (JComponent) panel.getComponent(0);
         assertTrue(label instanceof JLabel);
-        assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), ((JLabel)label).getIcon());
-        assertEquals(SwingConstants.TOP, ((JLabel)label).getVerticalAlignment());
-        assertEquals(SwingConstants.CENTER, ((JLabel)label).getHorizontalAlignment());
-        assertEquals(SwingConstants.CENTER, ((JLabel)label).getVerticalTextPosition());
-        assertEquals(SwingConstants.TRAILING, ((JLabel)label).getHorizontalTextPosition());
-
+        assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), ((JLabel) label)
+                .getIcon());
+        assertEquals(SwingConstants.TOP, ((JLabel) label).getVerticalAlignment());
+        assertEquals(SwingConstants.CENTER, ((JLabel) label).getHorizontalAlignment());
+        assertEquals(SwingConstants.CENTER, ((JLabel) label).getVerticalTextPosition());
+        assertEquals(SwingConstants.TRAILING, ((JLabel) label).getHorizontalTextPosition());
         paneUI.optionPane.setMessageType(JOptionPane.ERROR_MESSAGE);
         paneUI.addIcon(panel);
-        label = (JComponent)panel.getComponent(0);
+        label = (JComponent) panel.getComponent(0);
         assertTrue(label instanceof JLabel);
-        assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), ((JLabel)label).getIcon());
-        label = (JComponent)panel.getComponent(1);
+        assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), ((JLabel) label)
+                .getIcon());
+        label = (JComponent) panel.getComponent(1);
         assertTrue(label instanceof JLabel);
-        assertEquals(paneUI.getIconForType(JOptionPane.ERROR_MESSAGE), ((JLabel)label).getIcon());
-        assertEquals(SwingConstants.TOP, ((JLabel)label).getVerticalAlignment());
-        assertEquals(SwingConstants.CENTER, ((JLabel)label).getHorizontalAlignment());
-        assertEquals(SwingConstants.CENTER, ((JLabel)label).getVerticalTextPosition());
-        assertEquals(SwingConstants.TRAILING, ((JLabel)label).getHorizontalTextPosition());
+        assertEquals(paneUI.getIconForType(JOptionPane.ERROR_MESSAGE), ((JLabel) label)
+                .getIcon());
+        assertEquals(SwingConstants.TOP, ((JLabel) label).getVerticalAlignment());
+        assertEquals(SwingConstants.CENTER, ((JLabel) label).getHorizontalAlignment());
+        assertEquals(SwingConstants.CENTER, ((JLabel) label).getVerticalTextPosition());
+        assertEquals(SwingConstants.TRAILING, ((JLabel) label).getHorizontalTextPosition());
     }
 
     public void testGetIcon() {
         Icon icon = null;
         assertNull(paneUI.getIcon());
-
         JOptionPane optionPane = new JOptionPane();
         paneUI.installUI(optionPane);
         optionPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
         assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), paneUI.getIcon());
-
         optionPane.setIcon(null);
         assertEquals(paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE), paneUI.getIcon());
-
         icon = new ImageIcon();
         optionPane.setIcon(icon);
         assertEquals(icon, paneUI.getIcon());
-
         optionPane.setMessageType(JOptionPane.PLAIN_MESSAGE);
         assertEquals(icon, paneUI.getIcon());
-
         optionPane.setIcon(null);
         assertNull(paneUI.getIcon());
     }
 
     public void testGetIconForType() throws InterruptedException {
-        Icon icon11 = new IconUIResource(new ImageIcon(new BufferedImage(10, 20, BufferedImage.TYPE_INT_RGB)));
-        Icon icon21 = new IconUIResource(new ImageIcon(new BufferedImage(30, 40, BufferedImage.TYPE_INT_RGB)));
-        Icon icon31 = new IconUIResource(new ImageIcon(new BufferedImage(50, 60, BufferedImage.TYPE_INT_RGB)));
-        Icon icon41 = new IconUIResource(new ImageIcon(new BufferedImage(70, 80, BufferedImage.TYPE_INT_RGB)));
+        Icon icon11 = new IconUIResource(new ImageIcon(new BufferedImage(10, 20,
+                BufferedImage.TYPE_INT_RGB)));
+        Icon icon21 = new IconUIResource(new ImageIcon(new BufferedImage(30, 40,
+                BufferedImage.TYPE_INT_RGB)));
+        Icon icon31 = new IconUIResource(new ImageIcon(new BufferedImage(50, 60,
+                BufferedImage.TYPE_INT_RGB)));
+        Icon icon41 = new IconUIResource(new ImageIcon(new BufferedImage(70, 80,
+                BufferedImage.TYPE_INT_RGB)));
         UIManager.put("OptionPane.errorIcon", icon11);
         UIManager.put("OptionPane.informationIcon", icon21);
         UIManager.put("OptionPane.questionIcon", icon31);
         UIManager.put("OptionPane.warningIcon", icon41);
-
         Icon icon12 = paneUI.getIconForType(JOptionPane.ERROR_MESSAGE);
         Icon icon22 = paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE);
         Icon icon32 = paneUI.getIconForType(JOptionPane.QUESTION_MESSAGE);
         Icon icon42 = paneUI.getIconForType(JOptionPane.WARNING_MESSAGE);
         Icon icon52 = paneUI.getIconForType(JOptionPane.PLAIN_MESSAGE);
         Icon icon62 = paneUI.getIconForType(100);
-
         assertEquals(icon11, icon12);
         assertEquals(icon21, icon22);
         assertEquals(icon31, icon32);
         assertEquals(icon41, icon42);
         assertNull(icon52);
         assertNull(icon62);
-
         assertSame("icons are shared", icon12, paneUI.getIconForType(JOptionPane.ERROR_MESSAGE));
-        assertSame("icons are shared", icon22, paneUI.getIconForType(JOptionPane.INFORMATION_MESSAGE));
-        assertSame("icons are shared", icon32, paneUI.getIconForType(JOptionPane.QUESTION_MESSAGE));
-        assertSame("icons are shared", icon42, paneUI.getIconForType(JOptionPane.WARNING_MESSAGE));
+        assertSame("icons are shared", icon22, paneUI
+                .getIconForType(JOptionPane.INFORMATION_MESSAGE));
+        assertSame("icons are shared", icon32, paneUI
+                .getIconForType(JOptionPane.QUESTION_MESSAGE));
+        assertSame("icons are shared", icon42, paneUI
+                .getIconForType(JOptionPane.WARNING_MESSAGE));
     }
 
     public void testGetMaxCharactersPerLineCount() {
@@ -611,22 +583,18 @@
         JPanel panel = new JPanel();
         paneUI.burstStringInto(panel, message, 2);
         assertEquals(1, panel.getComponentCount());
-        assertEquals("message", ((JLabel)panel.getComponent(0)).getText());
-
+        assertEquals("message", ((JLabel) panel.getComponent(0)).getText());
         message = "message \n\n  message";
         panel = new JPanel();
         paneUI.burstStringInto(panel, message, 2);
         assertEquals(3, panel.getComponentCount());
-        assertEquals("message", ((JLabel)panel.getComponent(0)).getText());
-        assertEquals("\n\n", ((JLabel)panel.getComponent(1)).getText());
-        assertEquals(" message", ((JLabel)panel.getComponent(2)).getText());
-
+        assertEquals("message", ((JLabel) panel.getComponent(0)).getText());
+        assertEquals("\n\n", ((JLabel) panel.getComponent(1)).getText());
+        assertEquals(" message", ((JLabel) panel.getComponent(2)).getText());
         panel = new JPanel();
         paneUI.burstStringInto(panel, message, 20);
         assertEquals(1, panel.getComponentCount());
-        assertEquals(message, ((JLabel)panel.getComponent(0)).getText());
-
-
+        assertEquals(message, ((JLabel) panel.getComponent(0)).getText());
         panel = new JPanel();
         message = "";
         for (int i = 0; i < 4; i++) {
@@ -634,121 +602,111 @@
         }
         paneUI.burstStringInto(panel, message, 50);
         assertEquals(2, panel.getComponentCount());
-        assertEquals("messagemessage   \nmessagemessage   \nmessagemessage", ((JLabel)panel.getComponent(0)).getText());
-        assertEquals("  \nmessagemessage   \n", ((JLabel)panel.getComponent(1)).getText());
+        assertEquals("messagemessage   \nmessagemessage   \nmessagemessage", ((JLabel) panel
+                .getComponent(0)).getText());
+        assertEquals("  \nmessagemessage   \n", ((JLabel) panel.getComponent(1)).getText());
     }
 
     public void testCreateSeparator() {
         assertNull(paneUI.createSeparator());
     }
 
-    private void checkButton(final JButton button, final String text,
-                             final long threshold, final int mnemonic,
-                             final int numListeners, final Insets margin) {
+    private void checkButton(final JButton button, final String text, final long threshold,
+            final int mnemonic, final int numListeners, final Insets margin) {
         assertEquals("button text", text, button.getText());
         assertEquals("Threshold", threshold, button.getMultiClickThreshhold());
         assertEquals("button mnemonic", mnemonic, button.getMnemonic());
         assertEquals("listener", numListeners, button.getActionListeners().length);
         assertEquals("margin", margin, button.getMargin());
-}
+    }
 
     public void testCreateButtonArea() {
         Container buttonArea = null;
         paneUI.optionPane = new JOptionPane();
         JButton button;
-
         paneUI.optionPane.setOptionType(JOptionPane.YES_NO_OPTION);
         int threshold = 111;
         UIManager.put("OptionPane.buttonClickThreshhold", new Integer(threshold));
-        Border buttonAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(2, 2, 2, 2));
+        Border buttonAreaBorder = new BorderUIResource(BorderFactory.createEmptyBorder(2, 2, 2,
+                2));
         UIManager.put("OptionPane.buttonAreaBorder", buttonAreaBorder);
         paneUI.installDefaults();
         buttonArea = paneUI.createButtonArea();
         assertEquals("class", JPanel.class, buttonArea.getClass());
-        assertEquals("layout", BasicOptionPaneUI.ButtonAreaLayout.class, buttonArea.getLayout().getClass());
-        assertEquals("layout padding", 6, ((BasicOptionPaneUI.ButtonAreaLayout)buttonArea.getLayout()).getPadding());
-        assertEquals("border", buttonAreaBorder, ((JComponent)buttonArea).getBorder());
-        assertEquals("border insets", new Insets(2, 2, 2, 2), ((JPanel)buttonArea).getBorder().getBorderInsets(buttonArea));
+        assertEquals("layout", BasicOptionPaneUI.ButtonAreaLayout.class, buttonArea.getLayout()
+                .getClass());
+        assertEquals("layout padding", 6, ((BasicOptionPaneUI.ButtonAreaLayout) buttonArea
+                .getLayout()).getPadding());
+        assertEquals("border", buttonAreaBorder, ((JComponent) buttonArea).getBorder());
+        assertEquals("border insets", new Insets(2, 2, 2, 2), ((JPanel) buttonArea).getBorder()
+                .getBorderInsets(buttonArea));
         assertEquals("number of buttons", 2, buttonArea.getComponentCount());
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(0).getClass());
-        button = (JButton)buttonArea.getComponent(0);
+        button = (JButton) buttonArea.getComponent(0);
         checkButton(button, "Yes", threshold, KeyEvent.VK_Y, 1, new Insets(2, 8, 2, 8));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(1).getClass());
-        button = (JButton)buttonArea.getComponent(1);
+        button = (JButton) buttonArea.getComponent(1);
         checkButton(button, "No", threshold, KeyEvent.VK_N, 1, new Insets(2, 8, 2, 8));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         paneUI.optionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
         buttonArea = paneUI.createButtonArea();
         assertEquals("number of buttons", 3, buttonArea.getComponentCount());
         assertEquals("button class", JButton.class, buttonArea.getComponent(0).getClass());
-        button = (JButton)buttonArea.getComponent(0);
+        button = (JButton) buttonArea.getComponent(0);
         checkButton(button, "Yes", threshold, KeyEvent.VK_Y, 1, new Insets(2, 4, 2, 4));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(1).getClass());
-        button = (JButton)buttonArea.getComponent(1);
+        button = (JButton) buttonArea.getComponent(1);
         checkButton(button, "No", threshold, KeyEvent.VK_N, 1, new Insets(2, 4, 2, 4));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(2).getClass());
-        button = (JButton)buttonArea.getComponent(2);
+        button = (JButton) buttonArea.getComponent(2);
         checkButton(button, "Cancel", threshold, 0, 1, new Insets(2, 4, 2, 4));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         paneUI.optionPane.setOptionType(JOptionPane.CANCEL_OPTION);
         buttonArea = paneUI.createButtonArea();
         assertEquals("number of buttons", 2, buttonArea.getComponentCount());
         assertEquals("button class", JButton.class, buttonArea.getComponent(0).getClass());
-        button = (JButton)(buttonArea.getComponent(0));
+        button = (JButton) (buttonArea.getComponent(0));
         checkButton(button, "OK", threshold, 0, 1, new Insets(2, 8, 2, 8));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(1).getClass());
-        button = (JButton)(buttonArea.getComponent(1));
-        button = (JButton)buttonArea.getComponent(1);
+        button = (JButton) (buttonArea.getComponent(1));
+        button = (JButton) buttonArea.getComponent(1);
         checkButton(button, "Cancel", threshold, 0, 1, new Insets(2, 8, 2, 8));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
-
         paneUI.optionPane.setOptionType(JOptionPane.CLOSED_OPTION);
         buttonArea = paneUI.createButtonArea();
         assertEquals("number of buttons", 1, buttonArea.getComponentCount());
         assertEquals("button class", JButton.class, buttonArea.getComponent(0).getClass());
-        button = (JButton)(buttonArea.getComponent(0));
+        button = (JButton) (buttonArea.getComponent(0));
         checkButton(button, "OK", threshold, 0, 1, new Insets(2, 8, 2, 8));
         assertFalse("custom", paneUI.containsCustomComponents(null));
-
         Object option1 = new JButton("Tarara");
         Object option2 = new Integer(100);
         Object option3 = "Eminem must tsum menimE";
         Object option4 = new Button("Tarara");
         Object option5 = new ImageIcon();
-        paneUI.optionPane.setOptions(new Object[] {option1, option2, option3, option4, option5});
+        paneUI.optionPane
+                .setOptions(new Object[] { option1, option2, option3, option4, option5 });
         buttonArea = paneUI.createButtonArea();
         assertEquals("number of buttons", 5, buttonArea.getComponentCount());
         assertTrue("custom", paneUI.containsCustomComponents(null));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(0).getClass());
-        button = (JButton)(buttonArea.getComponent(0));
-        checkButton(button, "Tarara", 0, 0, 0, ((JButton)option1).getMargin());
-
+        button = (JButton) (buttonArea.getComponent(0));
+        checkButton(button, "Tarara", 0, 0, 0, ((JButton) option1).getMargin());
         assertEquals("button class", JButton.class, buttonArea.getComponent(1).getClass());
-        button = (JButton)(buttonArea.getComponent(1));
+        button = (JButton) (buttonArea.getComponent(1));
         checkButton(button, "100", threshold, 0, 1, new Insets(2, 14, 2, 14));
-
         assertEquals("button class", JButton.class, buttonArea.getComponent(2).getClass());
-        button = (JButton)(buttonArea.getComponent(2));
+        button = (JButton) (buttonArea.getComponent(2));
         checkButton(button, option3.toString(), threshold, 0, 1, new Insets(2, 14, 2, 14));
-
         assertEquals("button class", Button.class, buttonArea.getComponent(3).getClass());
-        assertEquals("button text", "Tarara", ((Button)(buttonArea.getComponent(3))).getLabel());
-
+        assertEquals("button text", "Tarara", ((Button) (buttonArea.getComponent(3)))
+                .getLabel());
         assertEquals("button class", JButton.class, buttonArea.getComponent(4).getClass());
-        button = (JButton)(buttonArea.getComponent(4));
+        button = (JButton) (buttonArea.getComponent(4));
         assertEquals("button Icon", option5, button.getIcon());
         checkButton(button, "", threshold, 0, 1, new Insets(2, 14, 2, 14));
     }
@@ -758,19 +716,21 @@
         Object option2 = new Integer(100);
         Object option3 = "Eminem must tsum menimE";
         Object option4 = new Button("Tarara");
-
         Container buttonArea = new JPanel();
         buttonArea.setLayout(new ButtonAreaLayout(true, 6));
-        paneUI.addButtonComponents(buttonArea, new Object[] {option1, option2, option3, option4}, 0);
+        paneUI.addButtonComponents(buttonArea, new Object[] { option1, option2, option3,
+                option4 }, 0);
         assertEquals("number of buttons", 4, buttonArea.getComponentCount());
         assertEquals("button class", JRadioButton.class, buttonArea.getComponent(0).getClass());
-        assertEquals("button text", "Tarara", ((JRadioButton)(buttonArea.getComponent(0))).getText());
+        assertEquals("button text", "Tarara", ((JRadioButton) (buttonArea.getComponent(0)))
+                .getText());
         assertEquals("button class", JButton.class, buttonArea.getComponent(1).getClass());
-        assertEquals("button text", "100", ((JButton)(buttonArea.getComponent(1))).getText());
+        assertEquals("button text", "100", ((JButton) (buttonArea.getComponent(1))).getText());
         assertEquals("button class", JButton.class, buttonArea.getComponent(2).getClass());
-        assertEquals("button text", option3, ((JButton)(buttonArea.getComponent(2))).getText());
+        assertEquals("button text", option3, ((JButton) (buttonArea.getComponent(2))).getText());
         assertEquals("button class", Button.class, buttonArea.getComponent(3).getClass());
-        assertEquals("button text", "Tarara", ((Button)(buttonArea.getComponent(3))).getLabel());
+        assertEquals("button text", "Tarara", ((Button) (buttonArea.getComponent(3)))
+                .getLabel());
     }
 
     public void testCreateButtonActionListener() {
@@ -778,43 +738,40 @@
         ActionListener listener2 = paneUI.createButtonActionListener(1);
         assertTrue("listener is not null", listener1 != null);
         assertTrue("listener is not null", listener2 != null);
-        assertEquals("listener's class ", "javax.swing.plaf.basic.BasicOptionPaneUI$ButtonActionListener", listener1.getClass().getName());
+        assertEquals("listener's class ",
+                "javax.swing.plaf.basic.BasicOptionPaneUI$ButtonActionListener", listener1
+                        .getClass().getName());
         assertTrue("listener is not shared", listener1 != listener2);
     }
 
     public void testGetButtons() {
         Object[] buttons = null;
         paneUI.optionPane = new JOptionPane();
-
         paneUI.installDefaults();
         paneUI.optionPane.setOptionType(JOptionPane.YES_NO_OPTION);
         buttons = paneUI.getButtons();
         assertEquals("number of buttons", 2, buttons.length);
         assertEquals("button text", "Yes", buttons[0].toString());
         assertEquals("button text", "No", buttons[1].toString());
-
         paneUI.optionPane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
         buttons = paneUI.getButtons();
         assertEquals("number of buttons", 3, buttons.length);
         assertEquals("button text", "Yes", buttons[0].toString());
         assertEquals("button text", "No", buttons[1].toString());
         assertEquals("button text", "Cancel", buttons[2].toString());
-
         paneUI.optionPane.setOptionType(JOptionPane.CANCEL_OPTION);
         buttons = paneUI.getButtons();
         assertEquals("number of buttons", 2, buttons.length);
         assertEquals("button text", "OK", buttons[0].toString());
         assertEquals("button text", "Cancel", buttons[1].toString());
-
         paneUI.optionPane.setOptionType(JOptionPane.CLOSED_OPTION);
         buttons = paneUI.getButtons();
         assertEquals("number of buttons", 1, buttons.length);
         assertEquals("button text", "OK", buttons[0].toString());
-
         Object option1 = new JButton("Tarara");
         Object option2 = new Integer(100);
         Object option3 = "Eminem must tsum menimE";
-        paneUI.optionPane.setOptions(new Object[] {option1, option2, option3});
+        paneUI.optionPane.setOptions(new Object[] { option1, option2, option3 });
         buttons = paneUI.getButtons();
         assertEquals("number of buttons", 3, buttons.length);
         assertEquals("button ", option1, buttons[0]);
@@ -828,33 +785,28 @@
 
     public void testGetInitialValueIndex() {
         JOptionPane optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2", "3"}, "1");
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2", "3" }, "1");
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(0, paneUI.getInitialValueIndex());
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2", "3", "2"}, "3");
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2", "3", "2" }, "3");
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(2, paneUI.getInitialValueIndex());
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2", "3", "2", "2"}, "2");
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2", "3", "2", "2" }, "2");
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(4, paneUI.getInitialValueIndex());
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2", "3", "2"}, null);
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2", "3", "2" }, null);
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(-1, paneUI.getInitialValueIndex());
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, new Object[] {"1", "2", "3", "2"}, "4");
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, new Object[] { "1", "2", "3", "2" }, "4");
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(-1, paneUI.getInitialValueIndex());
-
         optionPane = new JOptionPane("Message", JOptionPane.ERROR_MESSAGE,
-                                     JOptionPane.CLOSED_OPTION, null, null, null);
-        paneUI = (BasicOptionPaneUI)optionPane.getUI();
+                JOptionPane.CLOSED_OPTION, null, null, null);
+        paneUI = (BasicOptionPaneUI) optionPane.getUI();
         assertEquals(0, paneUI.getInitialValueIndex());
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUI_ButtonAreaLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUI_ButtonAreaLayoutTest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUI_ButtonAreaLayoutTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicOptionPaneUI_ButtonAreaLayoutTest.java Sun Nov 26 12:15:43 2006
@@ -23,7 +23,6 @@
 import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Point;
-
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JDialog;
@@ -32,7 +31,6 @@
 import javax.swing.border.EmptyBorder;
 
 public class BasicOptionPaneUI_ButtonAreaLayoutTest extends SwingTestCase {
-
     protected BasicOptionPaneUI.ButtonAreaLayout layout;
 
     public static void main(String[] args) {
@@ -42,6 +40,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
     }
@@ -51,12 +50,10 @@
         int padding2 = 200;
         boolean syncAll1 = true;
         boolean syncAll2 = false;
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(syncAll1, padding1);
         assertEquals("syncAll", syncAll1, layout.getSyncAllWidths());
         assertEquals("padding", padding1, layout.getPadding());
         assertTrue("CentersChildren", layout.getCentersChildren());
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(syncAll2, padding2);
         assertEquals("syncAll", syncAll2, layout.getSyncAllWidths());
         assertEquals("padding", padding2, layout.getPadding());
@@ -66,10 +63,8 @@
     public void testSetGetSyncAllWidths() {
         boolean syncAll1 = true;
         boolean syncAll2 = false;
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(syncAll1, 0);
         assertEquals("syncAll", syncAll1, layout.getSyncAllWidths());
-
         layout.setSyncAllWidths(syncAll2);
         assertEquals("syncAll", syncAll2, layout.getSyncAllWidths());
     }
@@ -77,10 +72,8 @@
     public void testSetGetPadding() {
         int padding1 = 100;
         int padding2 = 200;
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(true, padding1);
         assertEquals("padding", padding1, layout.getPadding());
-
         layout.setPadding(padding2);
         assertEquals("padding", padding2, layout.getPadding());
     }
@@ -88,13 +81,10 @@
     public void testSetGetCentersChildren() {
         boolean centersChildren1 = true;
         boolean centersChildren2 = false;
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 0);
         assertTrue("CentersChildren", layout.getCentersChildren());
-
         layout.setCentersChildren(centersChildren1);
         assertEquals("CentersChildren", centersChildren1, layout.getCentersChildren());
-
         layout.setCentersChildren(centersChildren2);
         assertEquals("CentersChildren", centersChildren2, layout.getCentersChildren());
     }
@@ -105,7 +95,7 @@
         JComponent component2 = new JPanel();
         JComponent component3 = new JPanel();
         JComponent component4 = new JPanel();
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 10);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 10);
         container.add(component1);
         container.add(component2);
         layout.addLayoutComponent("aaa", component1);
@@ -114,14 +104,11 @@
         component2.setMinimumSize(new Dimension(70, 80));
         component3.setMinimumSize(new Dimension(90, 70));
         component4.setMinimumSize(new Dimension(80, 120));
-
         assertEquals("Sizes ", new Dimension(30, 10), layout.minimumLayoutSize(container));
-
         container.add(component3);
         assertEquals("Sizes ", new Dimension(50, 10), layout.minimumLayoutSize(container));
         layout.addLayoutComponent("asd", component3);
         assertEquals("Sizes ", new Dimension(50, 10), layout.minimumLayoutSize(container));
-
         container.add(component4);
         assertEquals("Sizes ", new Dimension(70, 10), layout.minimumLayoutSize(container));
         layout.addLayoutComponent("dsa", component4);
@@ -146,23 +133,20 @@
         component3.setMaximumSize(new Dimension(48, 26));
         component2.setMaximumSize(new Dimension(55, 26));
         component1.setMaximumSize(new Dimension(62, 26));
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 10);
         container.setLayout(layout);
-
         container.setBorder(new EmptyBorder(20, 20, 20, 20));
         container.add(component1);
         container.add(component2);
         container.add(component3);
         container.add(component4);
-
         JDialog window = new JDialog();
         window.getContentPane().add(container);
         window.pack();
-
-        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout.minimumLayoutSize(container));
-        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout.preferredLayoutSize(container));
-
+        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout
+                .minimumLayoutSize(container));
+        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout
+                .preferredLayoutSize(container));
         assertEquals("Component1 location ", new Point(20, 20), component1.getLocation());
         assertEquals("Component1 size ", new Dimension(62, 26), component1.getSize());
         assertEquals("Component2 location ", new Point(92, 20), component2.getLocation());
@@ -171,13 +155,12 @@
         assertEquals("Component3 size ", new Dimension(48, 26), component3.getSize());
         assertEquals("Component4 location ", new Point(215, 20), component4.getLocation());
         assertEquals("Component4 size ", new Dimension(41, 26), component4.getSize());
-
         container.setPreferredSize(new Dimension(1000, 100));
         window.pack();
-
-        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout.minimumLayoutSize(container));
-        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout.preferredLayoutSize(container));
-
+        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout
+                .minimumLayoutSize(container));
+        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout
+                .preferredLayoutSize(container));
         assertEquals("Component1 location ", new Point(382, 20), component1.getLocation());
         assertEquals("Component1 size ", new Dimension(62, 26), component1.getSize());
         assertEquals("Component2 location ", new Point(454, 20), component2.getLocation());
@@ -186,14 +169,13 @@
         assertEquals("Component3 size ", new Dimension(48, 26), component3.getSize());
         assertEquals("Component4 location ", new Point(577, 20), component4.getLocation());
         assertEquals("Component4 size ", new Dimension(41, 26), component4.getSize());
-
         layout.setCentersChildren(false);
         container.setPreferredSize(new Dimension(1200, 100));
         window.pack();
-
-        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout.minimumLayoutSize(container));
-        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout.preferredLayoutSize(container));
-
+        assertEquals("Container's minimum requirements", new Dimension(276, 66), layout
+                .minimumLayoutSize(container));
+        assertEquals("Container's preferred requirements", new Dimension(276, 66), layout
+                .preferredLayoutSize(container));
         assertEquals("Component1 location ", new Point(20, 20), component1.getLocation());
         assertEquals("Component1 size ", new Dimension(62, 26), component1.getSize());
         assertEquals("Component2 location ", new Point(390, 20), component2.getLocation());
@@ -202,24 +184,27 @@
         assertEquals("Component3 size ", new Dimension(48, 26), component3.getSize());
         assertEquals("Component4 location ", new Point(1109, 20), component4.getLocation());
         assertEquals("Component4 size ", new Dimension(41, 26), component4.getSize());
-
         layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 30);
         container.setLayout(layout);
         container.setBorder(new EmptyBorder(20, 20, 20, 20));
         container.setPreferredSize(null);
         window.pack();
-
-        assertEquals("Container's minimum requirements", new Dimension(378, 66), layout.minimumLayoutSize(container));
-        assertEquals("Container's preferred requirements", new Dimension(378, 66), layout.preferredLayoutSize(container));
-
+        assertEquals("Container's minimum requirements", new Dimension(378, 66), layout
+                .minimumLayoutSize(container));
+        assertEquals("Container's preferred requirements", new Dimension(378, 66), layout
+                .preferredLayoutSize(container));
         int offset = isHarmony() ? 20 : 0;
-        assertEquals("Component1 location ", new Point(offset + 0, 20), component1.getLocation());
+        assertEquals("Component1 location ", new Point(offset + 0, 20), component1
+                .getLocation());
         assertEquals("Component1 size ", new Dimension(62, 26), component1.getSize());
-        assertEquals("Component2 location ", new Point(offset + 92, 20), component2.getLocation());
+        assertEquals("Component2 location ", new Point(offset + 92, 20), component2
+                .getLocation());
         assertEquals("Component2 size ", new Dimension(62, 26), component1.getSize());
-        assertEquals("Component3 location ", new Point(offset + 184, 20), component3.getLocation());
+        assertEquals("Component3 location ", new Point(offset + 184, 20), component3
+                .getLocation());
         assertEquals("Component3 size ", new Dimension(62, 26), component1.getSize());
-        assertEquals("Component4 location ", new Point(offset + 276, 20), component4.getLocation());
+        assertEquals("Component4 location ", new Point(offset + 276, 20), component4
+                .getLocation());
         assertEquals("Component4 size ", new Dimension(62, 26), component1.getSize());
     }
 
@@ -233,29 +218,28 @@
         component2.setMinimumSize(new Dimension(48, 26));
         component3.setMinimumSize(new Dimension(55, 26));
         component4.setMinimumSize(new Dimension(62, 26));
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 25);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 25);
         container.add(component1);
         container.add(component2);
-
-        assertEquals("Minimum size: ", new Dimension(45, 10), layout.minimumLayoutSize(container));
-        assertEquals("Minimum size: ", new Dimension(45, 10), layout.preferredLayoutSize(container));
-
+        assertEquals("Minimum size: ", new Dimension(45, 10), layout
+                .minimumLayoutSize(container));
+        assertEquals("Minimum size: ", new Dimension(45, 10), layout
+                .preferredLayoutSize(container));
         component1.setMinimumSize(new Dimension(50, 50));
         component2.setMinimumSize(new Dimension(70, 120));
         component3.setMinimumSize(new Dimension(90, 150));
         component4.setMinimumSize(new Dimension(80, 90));
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 30);
-        assertEquals("Minimum size: ", new Dimension(50, 10), layout.minimumLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 30);
+        assertEquals("Minimum size: ", new Dimension(50, 10), layout
+                .minimumLayoutSize(container));
         container.add(component3);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 40);
-        assertEquals("Minimum size: ", new Dimension(110, 10), layout.minimumLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 40);
+        assertEquals("Minimum size: ", new Dimension(110, 10), layout
+                .minimumLayoutSize(container));
         container.add(component4);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 60);
-        assertEquals("Minimum size: ", new Dimension(220, 10), layout.minimumLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 60);
+        assertEquals("Minimum size: ", new Dimension(220, 10), layout
+                .minimumLayoutSize(container));
         container = new JPanel();
         container.add(component1);
         container.add(component2);
@@ -263,18 +247,18 @@
         component2.setAlignmentY(0.75f);
         component3.setAlignmentX(0.25f);
         component4.setAlignmentY(0.25f);
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 10);
-        assertEquals("Minimum size: ", new Dimension(30, 10), layout.minimumLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 10);
+        assertEquals("Minimum size: ", new Dimension(30, 10), layout
+                .minimumLayoutSize(container));
         container.add(component3);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 0);
-        assertEquals("Minimum size: ", new Dimension(30, 10), layout.minimumLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 0);
+        assertEquals("Minimum size: ", new Dimension(30, 10), layout
+                .minimumLayoutSize(container));
         container.add(component4);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 0);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 0);
         container.setBorder(new EmptyBorder(20, 20, 20, 20));
-        assertEquals("Minimum size: ", new Dimension(80, 50), layout.minimumLayoutSize(container));
+        assertEquals("Minimum size: ", new Dimension(80, 50), layout
+                .minimumLayoutSize(container));
     }
 
     public void testPreferredLayoutSize() {
@@ -287,35 +271,34 @@
         component2.setPreferredSize(new Dimension(48, 26));
         component3.setPreferredSize(new Dimension(55, 26));
         component4.setPreferredSize(new Dimension(62, 26));
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 30);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 30);
         container.add(component1);
         container.add(component2);
-
-        assertEquals("Preferred size: ", new Dimension(119, 26), layout.preferredLayoutSize(container));
-        assertEquals("Preferred size: ", new Dimension(119, 26), layout.minimumLayoutSize(container));
-
+        assertEquals("Preferred size: ", new Dimension(119, 26), layout
+                .preferredLayoutSize(container));
+        assertEquals("Preferred size: ", new Dimension(119, 26), layout
+                .minimumLayoutSize(container));
         component1.setPreferredSize(new Dimension(50, 50));
         component2.setPreferredSize(new Dimension(70, 120));
         component3.setPreferredSize(new Dimension(90, 150));
         component4.setPreferredSize(new Dimension(80, 90));
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 40);
-        assertEquals("Preferred size: ", new Dimension(180, 120), layout.preferredLayoutSize(container));
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 40);
-        assertEquals("Preferred size: ", new Dimension(160, 120), layout.preferredLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 40);
+        assertEquals("Preferred size: ", new Dimension(180, 120), layout
+                .preferredLayoutSize(container));
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 40);
+        assertEquals("Preferred size: ", new Dimension(160, 120), layout
+                .preferredLayoutSize(container));
         container.add(component3);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 25);
-        assertEquals("Preferred size: ", new Dimension(260, 150), layout.preferredLayoutSize(container));
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 25);
+        assertEquals("Preferred size: ", new Dimension(260, 150), layout
+                .preferredLayoutSize(container));
         layout.setCentersChildren(true);
-        assertEquals("Preferred size: ", new Dimension(260, 150), layout.preferredLayoutSize(container));
-
+        assertEquals("Preferred size: ", new Dimension(260, 150), layout
+                .preferredLayoutSize(container));
         container.add(component4);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
-        assertEquals("Preferred size: ", new Dimension(350, 150), layout.preferredLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
+        assertEquals("Preferred size: ", new Dimension(350, 150), layout
+                .preferredLayoutSize(container));
         container = new JPanel();
         container.add(component1);
         container.add(component2);
@@ -323,18 +306,18 @@
         component2.setAlignmentY(0.75f);
         component3.setAlignmentX(0.25f);
         component4.setAlignmentY(0.25f);
-
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
-        assertEquals("Preferred size: ", new Dimension(140, 120), layout.preferredLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
+        assertEquals("Preferred size: ", new Dimension(140, 120), layout
+                .preferredLayoutSize(container));
         container.add(component3);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
-        assertEquals("Preferred size: ", new Dimension(250, 150), layout.preferredLayoutSize(container));
-
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
+        assertEquals("Preferred size: ", new Dimension(250, 150), layout
+                .preferredLayoutSize(container));
         container.add(component4);
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(false, 20);
         container.setBorder(new EmptyBorder(20, 20, 20, 20));
-        assertEquals("Preferred size: ", new Dimension(390, 190), layout.preferredLayoutSize(container));
+        assertEquals("Preferred size: ", new Dimension(390, 190), layout
+                .preferredLayoutSize(container));
     }
 
     public void testRemoveLayoutComponent() {
@@ -343,7 +326,7 @@
         JComponent component2 = new JPanel();
         JComponent component3 = new JPanel();
         JComponent component4 = new JPanel();
-        layout =  new BasicOptionPaneUI.ButtonAreaLayout(true, 20);
+        layout = new BasicOptionPaneUI.ButtonAreaLayout(true, 20);
         container.add(component1);
         container.add(component2);
         container.add(component3);
@@ -352,23 +335,17 @@
         component2.setMinimumSize(new Dimension(70, 80));
         component3.setMinimumSize(new Dimension(90, 70));
         component4.setMinimumSize(new Dimension(80, 120));
-
         assertEquals("Sizes ", new Dimension(100, 10), layout.minimumLayoutSize(container));
-
         container.remove(component4);
         assertEquals("Sizes ", new Dimension(70, 10), layout.minimumLayoutSize(container));
-
         container.add(component4);
         layout.removeLayoutComponent(component4);
         container.remove(component4);
         assertEquals("Sizes ", new Dimension(70, 10), layout.minimumLayoutSize(container));
-
         container.remove(component3);
         assertEquals("Sizes ", new Dimension(40, 10), layout.minimumLayoutSize(container));
-
         container.add(component3);
         layout.removeLayoutComponent(component3);
         assertEquals("Sizes ", new Dimension(70, 10), layout.minimumLayoutSize(container));
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPanelUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPanelUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPanelUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPanelUITest.java Sun Nov 26 12:15:43 2006
@@ -23,7 +23,6 @@
 package javax.swing.plaf.basic;
 
 import java.awt.Color;
-
 import javax.swing.BorderFactory;
 import javax.swing.JButton;
 import javax.swing.JComponent;
@@ -35,11 +34,9 @@
 import javax.swing.plaf.ColorUIResource;
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.PanelUI;
-
 import junit.framework.TestCase;
 
 public class BasicPanelUITest extends TestCase {
-
     protected BasicPanelUI panelUI = null;
 
     public static void main(final String[] args) {
@@ -49,6 +46,7 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         panelUI = new BasicPanelUI();
@@ -57,6 +55,7 @@
     /*
      * @see TestCase#tearDown()
      */
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -70,7 +69,6 @@
         assertNotNull(panel.getBackground());
         assertNotNull(panel.getForeground());
         assertNotNull(panel.getBorder());
-
         UIManager.put("Panel.background", Color.red);
         Border border2 = new BorderUIResource(BorderFactory.createEmptyBorder());
         UIManager.put("Panel.border", border2);
@@ -89,14 +87,12 @@
         Border border2 = new BorderUIResource(BorderFactory.createEmptyBorder());
         UIManager.put("Panel.border", border2);
         panel.setOpaque(false);
-
         panel.setUI(panelUI);
         panelUI.installUI(panel);
         assertEquals(Color.red, panel.getBackground());
         assertEquals(Color.yellow, panel.getForeground());
         assertEquals(border2, panel.getBorder());
         assertFalse("opaque", panel.isOpaque());
-
         Border border1 = BorderFactory.createEmptyBorder();
         panel.setBorder(border1);
         panel.setUI(panelUI);
@@ -108,10 +104,8 @@
         JComponent component = new JPanel();
         ComponentUI ui = BasicPanelUI.createUI(component);
         assertTrue(ui != null && (ui instanceof PanelUI));
-
         component = new JButton();
         ui = BasicPanelUI.createUI(component);
         assertTrue(ui != null);
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPasswordFieldUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPasswordFieldUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPasswordFieldUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPasswordFieldUITest.java Sun Nov 26 12:15:43 2006
@@ -29,6 +29,7 @@
 public class BasicPasswordFieldUITest extends SwingTestCase {
     BasicPasswordFieldUI ui;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         ui = new BasicPasswordFieldUI();
@@ -40,11 +41,8 @@
     }
 
     public void testCreateUIJComponent() {
-        assertTrue(BasicPasswordFieldUI.createUI(null)
-                   instanceof BasicPasswordFieldUI);
-        assertTrue(BasicPasswordFieldUI.createUI(new JPasswordField())
-                   instanceof BasicPasswordFieldUI);
-
+        assertTrue(BasicPasswordFieldUI.createUI(null) instanceof BasicPasswordFieldUI);
+        assertTrue(BasicPasswordFieldUI.createUI(new JPasswordField()) instanceof BasicPasswordFieldUI);
     }
 
     public void testGetPropertyPrefix() {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuSeparatorUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuSeparatorUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuSeparatorUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuSeparatorUITest.java Sun Nov 26 12:15:43 2006
@@ -15,24 +15,24 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing.plaf.basic;
 
 import java.awt.Dimension;
-
 import javax.swing.JButton;
 import javax.swing.JSeparator;
 import javax.swing.SwingConstants;
 
 public class BasicPopupMenuSeparatorUITest extends BasicSeparatorUITest {
-
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         ui = new BasicPopupMenuSeparatorUI();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -40,6 +40,7 @@
     /*
      * Test method for 'javax.swing.plaf.basic.BasicSeparatorUI.getPreferredSize(JComponent)'
      */
+    @Override
     public void testGetSizes() {
         JSeparator separator1 = new JSeparator(SwingConstants.HORIZONTAL);
         JSeparator separator2 = new JSeparator(SwingConstants.VERTICAL);
@@ -54,10 +55,13 @@
     /*
      * Test method for 'javax.swing.plaf.basic.BasicPopupMenuSeparatorUI.createUI(JComponent)'
      */
+    @Override
     public void testCreateUI() {
-        assertNotNull("created UI is not null", BasicPopupMenuSeparatorUI.createUI(new JButton()));
-        assertTrue("created UI is of the proper class", BasicPopupMenuSeparatorUI.createUI(null) instanceof BasicPopupMenuSeparatorUI);
-        assertNotSame("created UI is of unique", BasicPopupMenuSeparatorUI.createUI(null), BasicPopupMenuSeparatorUI.createUI(null));
+        assertNotNull("created UI is not null", BasicPopupMenuSeparatorUI
+                .createUI(new JButton()));
+        assertTrue("created UI is of the proper class", BasicPopupMenuSeparatorUI
+                .createUI(null) instanceof BasicPopupMenuSeparatorUI);
+        assertNotSame("created UI is of unique", BasicPopupMenuSeparatorUI.createUI(null),
+                BasicPopupMenuSeparatorUI.createUI(null));
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java Sun Nov 26 12:15:43 2006
@@ -15,9 +15,9 @@
  *  limitations under the License.
  */
 /**
-* @author Alexander T. Simbirtsev
-* @version $Revision$
-*/
+ * @author Alexander T. Simbirtsev
+ * @version $Revision$
+ */
 package javax.swing.plaf.basic;
 
 import java.awt.Color;
@@ -26,8 +26,8 @@
 import java.awt.EventQueue;
 import java.awt.Font;
 import java.awt.LayoutManager;
+import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
-
 import javax.swing.BorderFactory;
 import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
@@ -41,15 +41,16 @@
 import javax.swing.plaf.PopupMenuUITest;
 
 public class BasicPopupMenuUITest extends PopupMenuUITest {
-
     protected BasicPopupMenuUI basicPopupUI;
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         basicPopupUI = new BasicPopupMenuUI();
         popupUI = basicPopupUI;
     }
 
+    @Override
     protected void tearDown() throws Exception {
         basicPopupUI = null;
         super.tearDown();
@@ -61,8 +62,7 @@
     public void testCreateUI() {
         JPanel panel = new JPanel();
         ComponentUI ui1 = BasicPopupMenuUI.createUI(null);
-        BasicPopupMenuUI ui2 = (BasicPopupMenuUI)BasicPopupMenuUI.createUI(panel);
-
+        BasicPopupMenuUI ui2 = (BasicPopupMenuUI) BasicPopupMenuUI.createUI(panel);
         assertTrue(ui1 instanceof BasicPopupMenuUI);
         assertNotSame(ui1, ui2);
     }
@@ -70,13 +70,18 @@
     /*
      * Test method for 'javax.swing.plaf.PopupMenuUI.isPopupTrigger(MouseEvent)'
      */
+    @Override
     public void testIsPopupTrigger() {
         Component source1 = new JPanel();
         JPopupMenu source2 = new JPopupMenu();
-        MouseEvent event1 = new MouseEvent(source1, MouseEvent.MOUSE_ENTERED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0, false);
-        MouseEvent event2 = new MouseEvent(source1, MouseEvent.MOUSE_WHEEL, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0, true);
-        MouseEvent event3 = new MouseEvent(source1, MouseEvent.MOUSE_PRESSED, EventQueue.getMostRecentEventTime(), 0, 5, 5, 0, true);
-        MouseEvent event4 = new MouseEvent(source2, MouseEvent.MOUSE_RELEASED, EventQueue.getMostRecentEventTime(), MouseEvent.BUTTON1_DOWN_MASK, 1, 1, 1, true);
+        MouseEvent event1 = new MouseEvent(source1, MouseEvent.MOUSE_ENTERED, EventQueue
+                .getMostRecentEventTime(), 0, 5, 5, 0, false);
+        MouseEvent event2 = new MouseEvent(source1, MouseEvent.MOUSE_WHEEL, EventQueue
+                .getMostRecentEventTime(), 0, 5, 5, 0, true);
+        MouseEvent event3 = new MouseEvent(source1, MouseEvent.MOUSE_PRESSED, EventQueue
+                .getMostRecentEventTime(), 0, 5, 5, 0, true);
+        MouseEvent event4 = new MouseEvent(source2, MouseEvent.MOUSE_RELEASED, EventQueue
+                .getMostRecentEventTime(), InputEvent.BUTTON1_DOWN_MASK, 1, 1, 1, true);
         source2.setUI(popupUI);
         assertFalse(popupUI.isPopupTrigger(event1));
         assertFalse(popupUI.isPopupTrigger(event2));
@@ -92,11 +97,9 @@
         menu.setUI(basicPopupUI);
         LayoutManager oldManager = menu.getLayout();
         basicPopupUI.uninstallUI(menu);
-
         basicPopupUI.installUI(menu);
         assertNotNull(menu.getLayout());
         assertNotSame(oldManager, menu.getLayout());
-
         basicPopupUI.uninstallUI(menu);
         oldManager = new OverlayLayout(menu);
         menu.setLayout(oldManager);
@@ -115,7 +118,6 @@
         UIManager.getDefaults().put("PopupMenu.font", font);
         Border border = new BorderUIResource(BorderFactory.createEmptyBorder(0, 0, 0, 0));
         UIManager.getDefaults().put("PopupMenu.border", border);
-
         menu.setUI(basicPopupUI);
         basicPopupUI.installDefaults();
         assertEquals(Color.red, menu.getBackground());
@@ -123,7 +125,6 @@
         assertEquals(font, menu.getFont());
         assertEquals(border, menu.getBorder());
         assertTrue(menu.isOpaque());
-
         basicPopupUI.uninstallDefaults();
         assertNull(menu.getBackground());
         assertNull(menu.getForeground());
@@ -138,21 +139,17 @@
         if (!isHarmony()) {
             return;
         }
-
         JPopupMenu menu = new JPopupMenu();
         menu.setUI(null);
         basicPopupUI.popupMenu = menu;
-
         menu.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
         basicPopupUI.installKeyboardActions();
         assertEquals(0, menu.getInputMap().keys().length);
         assertNotNull(menu.getInputMap().getParent());
         assertEquals(11, menu.getInputMap().getParent().keys().length);
         assertNull(menu.getInputMap().getParent().getParent());
-
         basicPopupUI.uninstallKeyboardActions();
         assertEquals(0, menu.getInputMap().allKeys().length);
-
         menu.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
         basicPopupUI.installKeyboardActions();
         assertEquals(0, menu.getInputMap().keys().length);
@@ -170,16 +167,13 @@
         JPopupMenu menu = new JPopupMenu();
         menu.setUI(null);
         basicPopupUI.popupMenu = menu;
-
         basicPopupUI.installListeners();
         if (!isHarmony()) {
             assertEquals(1, menu.getPopupMenuListeners().length);
         }
-
         basicPopupUI.uninstallListeners();
         if (!isHarmony()) {
             assertEquals(0, menu.getPopupMenuListeners().length);
         }
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java?view=diff&rev=479418&r1=479417&r2=479418
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicProgressBarUITest.java Sun Nov 26 12:15:43 2006
@@ -18,20 +18,20 @@
  * @author Dennis Ushakov
  * @version $Revision$
  */
-
 package javax.swing.plaf.basic;
 
 import java.awt.Dimension;
 import java.util.Arrays;
-
 import javax.swing.BasicSwingTestCase;
 import javax.swing.JProgressBar;
 import javax.swing.UIManager;
 
 public class BasicProgressBarUITest extends BasicSwingTestCase {
     private BasicProgressBarUI ui;
+
     private JProgressBar progressBar;
 
+    @Override
     public void setUp() throws Exception {
         super.setUp();
         ui = new BasicProgressBarUI();
@@ -41,6 +41,7 @@
         progressBar.getUI().uninstallUI(progressBar);
     }
 
+    @Override
     public void tearDown() throws Exception {
         progressBar = null;
         ui = null;
@@ -49,7 +50,7 @@
     }
 
     public void testCreateUI() {
-        BasicProgressBarUI ui = (BasicProgressBarUI)BasicProgressBarUI.createUI(progressBar);
+        BasicProgressBarUI ui = (BasicProgressBarUI) BasicProgressBarUI.createUI(progressBar);
         assertNotNull(ui);
         assertNull(ui.changeListener);
         assertNull(ui.progressBar);
@@ -57,7 +58,6 @@
 
     public void testInstallUninstallUI() {
         assertNull(progressBar.getBorder());
-
         ui.installUI(progressBar);
         assertSame(ui.progressBar, progressBar);
         assertNotNull(ui.changeListener);
@@ -66,8 +66,6 @@
         assertNotNull(progressBar.getBorder());
         assertEquals(UIManager.getInt("ProgressBar.cellLength"), ui.getCellLength());
         assertEquals(UIManager.getInt("ProgressBar.cellSpacing"), ui.getCellSpacing());
-
-
         propertyChangeController.reset();
         ui.uninstallUI(progressBar);
         assertEquals(0, progressBar.getChangeListeners().length);
@@ -81,28 +79,26 @@
         ui.installListeners();
         assertTrue(Arrays.asList(progressBar.getChangeListeners()).contains(ui.changeListener));
         assertEquals(2, progressBar.getPropertyChangeListeners().length);
-
         ui.uninstallListeners();
         assertEquals(1, progressBar.getPropertyChangeListeners().length);
     }
 
-
     public void testGetSelectionBackForeGround() {
         ui.installUI(progressBar);
-        assertEquals(UIManager.getColor("ProgressBar.selectionBackground"), ui.getSelectionBackground());
-        assertEquals(UIManager.getColor("ProgressBar.selectionForeground"), ui.getSelectionForeground());
+        assertEquals(UIManager.getColor("ProgressBar.selectionBackground"), ui
+                .getSelectionBackground());
+        assertEquals(UIManager.getColor("ProgressBar.selectionForeground"), ui
+                .getSelectionForeground());
     }
 
     public void testSetGetCellLengthSpacing() {
         ui.installUI(progressBar);
         assertEquals(UIManager.getInt("ProgressBar.cellLength"), ui.getCellLength());
         assertEquals(UIManager.getInt("ProgressBar.cellSpacing"), ui.getCellSpacing());
-
         ui.setCellLength(11);
         assertEquals(11, ui.getCellLength());
         ui.setCellLength(-1);
         assertEquals(-1, ui.getCellLength());
-
         progressBar.setStringPainted(true);
         int length = ui.getCellLength();
         if (isHarmony()) {
@@ -110,7 +106,6 @@
         }
         ui.setCellLength(11);
         assertEquals(length, ui.getCellLength());
-
         ui.setCellSpacing(11111);
         if (isHarmony()) {
             assertEquals(2, ui.getCellSpacing());
@@ -121,27 +116,21 @@
 
     public void testGetPreferredSizes() {
         ui.installUI(progressBar);
-
         Dimension inner = ui.getPreferredInnerHorizontal();
         assertSame(inner, ui.getPreferredInnerHorizontal());
         assertEquals(ui.getPreferredSize(progressBar).width, inner.width + 2);
         assertEquals(ui.getPreferredSize(progressBar).height, inner.height + 2);
-
-        UIManager.put("ProgressBar.verticalSize", new Dimension(inner.width + 2, inner.height + 2));
+        UIManager.put("ProgressBar.verticalSize", new Dimension(inner.width + 2,
+                inner.height + 2));
         assertEquals(ui.getPreferredSize(progressBar).width, inner.width + 2);
         assertEquals(ui.getPreferredSize(progressBar).height, inner.height + 2);
         assertEquals(ui.getPreferredInnerHorizontal().width, inner.width);
         assertEquals(ui.getPreferredInnerHorizontal().height, inner.height);
-
-
-
     }
 
     public void testAnimation() {
         ui.installUI(progressBar);
-
         progressBar.setIndeterminate(true);
         assertEquals(0, ui.getAnimationIndex());
     }
 }
-



Mime
View raw message