harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479240 [28/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/TimerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TimerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TimerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TimerTest.java Sat Nov 25 16:04:10 2006
@@ -27,17 +27,19 @@
 import java.util.EventListener;
 
 public class TimerTest extends SwingTestCase {
-
     Timer timer = null;
 
     static int counter = 0;
 
     class ConcreteActionListener implements ActionListener {
         public String name;
+
         public ActionEvent action = null;
+
         ConcreteActionListener(final String name) {
             this.name = name;
         }
+
         public void actionPerformed(final ActionEvent action) {
             this.action = action;
         }
@@ -46,7 +48,7 @@
     protected boolean find(final Object[] array, final Object value) {
         boolean found = false;
         if (array != null) {
-            for (int i = 0; i < array.length; i++ ){
+            for (int i = 0; i < array.length; i++) {
                 if (array[i].equals(value)) {
                     found = true;
                     break;
@@ -59,9 +61,10 @@
     /*
      * @see TestCase#setUp()
      */
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
-        timer = new Timer(100, new ActionListener(){
+        timer = new Timer(100, new ActionListener() {
             public void actionPerformed(final ActionEvent action) {
             }
         });
@@ -70,22 +73,19 @@
     public void testTimer() {
         ActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(100, listener1);
-
         ActionListener[] listeners = timer.getActionListeners();
-        assertTrue("Initially there's one listener ", listeners != null && listeners.length == 1);
+        assertTrue("Initially there's one listener ", listeners != null
+                && listeners.length == 1);
         assertTrue("Initially there's one listener ", listeners[0] == listener1);
-
         assertTrue("repeats ", timer.isRepeats());
         assertEquals("delay is ", 100, timer.getDelay());
         assertEquals("Initial delay is ", 100, timer.getInitialDelay());
         assertTrue("Coalesces ", timer.isCoalesce());
-
         timer = new Timer(-100, listener1);
-
         listeners = timer.getActionListeners();
-        assertTrue("Initially there's one listener ", listeners != null && listeners.length == 1);
+        assertTrue("Initially there's one listener ", listeners != null
+                && listeners.length == 1);
         assertTrue("Initially there's one listener ", listeners[0] == listener1);
-
         assertTrue("repeats ", timer.isRepeats());
         assertEquals("delay is ", -100, timer.getDelay());
         assertEquals("Initial delay is ", -100, timer.getInitialDelay());
@@ -97,7 +97,6 @@
         ActionListener listener2 = new ConcreteActionListener("2");
         ActionListener listener3 = new ConcreteActionListener("3");
         timer = new Timer(100, listener1);
-
         timer.addActionListener(listener2);
         timer.addActionListener(listener3);
         EventListener[] listeners = timer.getListeners(ActionListener.class);
@@ -105,7 +104,6 @@
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
         assertTrue("Listener 3 is found", find(listeners, listener3));
-
         listeners = timer.getListeners(ConcreteActionListener.class);
         assertTrue("No listeners found", listeners != null && listeners.length == 0);
     }
@@ -116,34 +114,29 @@
         ActionListener listener3 = new ConcreteActionListener("3");
         ActionListener listener4 = new ConcreteActionListener("3");
         timer = new Timer(100, listener1);
-
         ActionListener[] listeners = timer.getActionListeners();
-        assertTrue("Initially there's one listener ", listeners != null && listeners.length == 1);
+        assertTrue("Initially there's one listener ", listeners != null
+                && listeners.length == 1);
         assertTrue("Initially there's one listener ", listeners[0] == listener1);
-
         timer.removeActionListener(listener1);
         listeners = timer.getActionListeners();
         assertTrue("now there are no listeners ", listeners != null && listeners.length == 0);
-
         timer.addActionListener(listener2);
         timer.addActionListener(listener3);
         timer.addActionListener(listener4);
         timer.addActionListener(listener1);
-
         listeners = timer.getActionListeners();
         assertTrue("Now there are 4 listeners ", listeners != null && listeners.length == 4);
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
         assertTrue("Listener 3 is found", find(listeners, listener3));
         assertTrue("Listener 4 is found", find(listeners, listener4));
-
         timer.removeActionListener(listener4);
         listeners = timer.getActionListeners();
         assertTrue("Now there are 3 listeners ", listeners != null && listeners.length == 3);
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
         assertTrue("Listener 3 is found", find(listeners, listener3));
-
         timer.removeActionListener(listener2);
         listeners = timer.getActionListeners();
         assertTrue("Now there are 2 listeners ", listeners != null && listeners.length == 2);
@@ -157,24 +150,21 @@
         ActionListener listener3 = new ConcreteActionListener("3");
         ActionListener listener4 = new ConcreteActionListener("3");
         timer = new Timer(100, listener1);
-
         ActionListener[] listeners = timer.getActionListeners();
-        assertTrue("Initially there's only one listener ", listeners != null && listeners.length == 1);
+        assertTrue("Initially there's only one listener ", listeners != null
+                && listeners.length == 1);
         assertTrue("Initially there's only one listener ", listeners[0] == listener1);
-
         timer.addActionListener(listener2);
         listeners = timer.getActionListeners();
         assertTrue("Now there are 2 listeners ", listeners != null && listeners.length == 2);
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
-
         timer.addActionListener(listener3);
         listeners = timer.getActionListeners();
         assertTrue("Now there are 3 listeners ", listeners != null && listeners.length == 3);
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
         assertTrue("Listener 3 is found", find(listeners, listener3));
-
         timer.addActionListener(listener4);
         timer.addActionListener(null);
         timer.addActionListener(null);
@@ -191,11 +181,10 @@
         ActionListener listener2 = new ConcreteActionListener("2");
         ActionListener listener3 = new ConcreteActionListener("3");
         timer = new Timer(100, listener1);
-
         ActionListener[] listeners = timer.getActionListeners();
-        assertTrue("Initially there's only one listener ", listeners != null && listeners.length == 1);
+        assertTrue("Initially there's only one listener ", listeners != null
+                && listeners.length == 1);
         assertSame("Initially there's only one listener ", listener1, listeners[0]);
-
         timer.addActionListener(listener2);
         timer.addActionListener(listener3);
         listeners = timer.getActionListeners();
@@ -203,17 +192,14 @@
         assertTrue("Listener 1 is found", find(listeners, listener1));
         assertTrue("Listener 2 is found", find(listeners, listener2));
         assertTrue("Listener 3 is found", find(listeners, listener3));
-   }
+    }
 
     public void testIsRepeats() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         assertTrue("repeats ", timer.isRepeats());
-
         timer.setRepeats(false);
         assertFalse("doesn't repeat ", timer.isRepeats());
-
         timer.setRepeats(true);
         assertTrue("repeats ", timer.isRepeats());
     }
@@ -221,13 +207,10 @@
     public void testSetCoalesce() {
         ConcreteActionListener listener = new ConcreteActionListener("1");
         timer = new Timer(10, listener);
-
         timer.setCoalesce(true);
         assertTrue("Coalesces ", timer.isCoalesce());
-
         timer.setCoalesce(false);
         assertFalse("doesn't Coalesce ", timer.isCoalesce());
-
         timer.setCoalesce(true);
         assertTrue("Coalesce ", timer.isCoalesce());
     }
@@ -235,12 +218,9 @@
     public void testIsCoalesce() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         assertTrue("Coalesces ", timer.isCoalesce());
-
         timer.setCoalesce(false);
         assertFalse("doesn't Coalesce ", timer.isCoalesce());
-
         timer.setCoalesce(true);
         assertTrue("Coalesce ", timer.isCoalesce());
     }
@@ -248,27 +228,22 @@
     public void testGetInitialDelay() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         assertEquals("Initial delay ", 10, timer.getInitialDelay());
-
         timer.setInitialDelay(100);
         assertEquals("Initial delay ", 100, timer.getInitialDelay());
-
         timer.setInitialDelay(300);
         assertEquals("Initial delay ", 300, timer.getInitialDelay());
-
         boolean thrown = false;
         try {
             timer.setInitialDelay(-100);
-        } catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertTrue("exception has been thrown", thrown);
-
         thrown = false;
         try {
             timer.setInitialDelay(0);
-        } catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertEquals("Initial delay ", 0, timer.getInitialDelay());
@@ -277,27 +252,22 @@
     public void testGetDelay() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         assertEquals("delay ", 10, timer.getDelay());
-
         timer.setDelay(100);
         assertEquals("delay ", 100, timer.getDelay());
-
         timer.setDelay(300);
         assertEquals("delay ", 300, timer.getDelay());
-
         boolean thrown = false;
         try {
             timer.setDelay(-100);
-        } catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertTrue("exception has been thrown", thrown);
-
         thrown = false;
         try {
             timer.setDelay(0);
-        } catch (IllegalArgumentException e){
+        } catch (IllegalArgumentException e) {
             thrown = true;
         }
         assertEquals("delay ", 0, timer.getDelay());
@@ -305,12 +275,9 @@
 
     public void testGetLogTimers() {
         assertFalse("doesn't log timers ", Timer.getLogTimers());
-
         Timer.setLogTimers(true);
         assertTrue("logs timers ", Timer.getLogTimers());
-
         Timer.setLogTimers(false);
         assertFalse("doesn't log timers ", Timer.getLogTimers());
     }
-
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.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 Alexander T. Simbirtsev
  * @version $Revision$
@@ -27,7 +26,6 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintStream;
-
 import junit.framework.TestCase;
 
 public class Timer_MultithreadedTest extends TestCase {
@@ -60,12 +58,17 @@
             }
         }
 
-        private final Delay  delay = new Delay();
+        private final Delay delay = new Delay();
+
         private final String name;
-        private ActionEvent  action;
-        private boolean      performed;
-        private int          counter;
-        private boolean      debug;
+
+        private ActionEvent action;
+
+        private boolean performed;
+
+        private int counter;
+
+        private boolean debug;
 
         ConcreteActionListener() {
             name = "NoName";
@@ -100,8 +103,7 @@
             return counter;
         }
 
-        public boolean waitNumActions(final int maxWaitTime,
-                                      final int numActions) {
+        public boolean waitNumActions(final int maxWaitTime, final int numActions) {
             int startNumActions = counter;
             while (counter - startNumActions < numActions) {
                 delay.waitForDelay(maxWaitTime);
@@ -126,12 +128,12 @@
         runHare();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         if (timer != null) {
             timer.stop();
             timer = null;
         }
-
         super.tearDown();
     }
 
@@ -145,38 +147,30 @@
         timer.addActionListener(listener3);
         timer.addActionListener(listener4);
         timer.start();
-
         listener1.waitAction(500);
         timer.stop();
-        assertNotNull("[1] ActionListener's ActionPerformed invoked ",
-                      listener1.action);
-        assertSame("[2] ActionListener's ActionPerformed invoked ",
-                listener1.action, listener2.action);
-        assertSame("[3] ActionListener's ActionPerformed invoked ",
-                listener1.action, listener3.action);
-        assertSame("[4] ActionListener's ActionPerformed invoked ",
-                listener1.action, listener4.action);
+        assertNotNull("[1] ActionListener's ActionPerformed invoked ", listener1.action);
+        assertSame("[2] ActionListener's ActionPerformed invoked ", listener1.action,
+                listener2.action);
+        assertSame("[3] ActionListener's ActionPerformed invoked ", listener1.action,
+                listener3.action);
+        assertSame("[4] ActionListener's ActionPerformed invoked ", listener1.action,
+                listener4.action);
     }
 
     public void testSetRepeats() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         timer.setRepeats(true);
         assertTrue("repeats ", timer.isRepeats());
-
         timer.setRepeats(false);
         assertFalse("doesn't repeat ", timer.isRepeats());
-
         timer.setRepeats(true);
         assertTrue("repeats ", timer.isRepeats());
-
         timer.start();
         listener1.waitNumActions(500, 5);
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener1.action != null);
+        assertTrue("ActionListener's ActionPerformed invoked ", listener1.action != null);
         timer.stop();
-
         // checking does setRepeats actually affects the work of timer
         ConcreteActionListener listener2 = new ConcreteActionListener("2");
         timer = new Timer(10, listener2);
@@ -192,7 +186,6 @@
         listener2.reset();
         listener2.waitAction(100);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener2.action);
-
         timer.stop();
         ConcreteActionListener listener3 = new ConcreteActionListener("3");
         timer = new Timer(100, listener3);
@@ -204,7 +197,6 @@
         listener3.reset();
         listener3.waitAction(1500);
         assertNotNull("ActionListener's ActionPerformed did invoke ", listener3.action);
-
         timer.stop();
         ConcreteActionListener listener4 = new ConcreteActionListener("4");
         timer = new Timer(100, listener4);
@@ -223,92 +215,68 @@
     public void testSetInitialDelay() {
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         timer = new Timer(10, listener1);
-
         timer.setInitialDelay(100);
         assertEquals("Initial delay is ", 100, timer.getInitialDelay());
-
         timer.setInitialDelay(300);
         assertEquals("Initial delay is ", 300, timer.getInitialDelay());
-
         // checking does SetInitialDelay actually affects the work of timer
         ConcreteActionListener listener2 = new ConcreteActionListener("2");
         timer = new Timer(10, listener2);
         timer.setInitialDelay(700);
-
         timer.start();
         listener2.waitAction(500);
-
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener2.action);
-
         listener2.reset();
         listener2.waitAction(1000);
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener2.action != null);
-
+        assertTrue("ActionListener's ActionPerformed invoked ", listener2.action != null);
         timer.stop();
         timer = new Timer(10, listener2);
         timer.setInitialDelay(200);
         timer.start();
         timer.setInitialDelay(500);
         listener2.waitAction(500);
-
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener2.action != null);
+        assertTrue("ActionListener's ActionPerformed invoked ", listener2.action != null);
     }
 
     public void testSetDelay() {
         ConcreteActionListener listener = new ConcreteActionListener();
         timer = new Timer(10, listener);
-        ActionEvent event = null;
-
         timer.setDelay(100);
         assertEquals("delay is ", 100, timer.getDelay());
-
         timer.setDelay(300);
         assertEquals("delay is ", 300, timer.getDelay());
-
         // checking does SetDelay affects working timer
         listener = new ConcreteActionListener();
         timer = new Timer(4000, listener);
-
         timer.start();
         listener.waitAction(500);
         timer.setDelay(100);
         listener.waitAction(200);
-
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
         timer.stop();
-
         listener = new ConcreteActionListener();
         timer = new Timer(150, listener);
-
         timer.start();
         listener.waitAction(5);
         timer.setDelay(5000);
         listener.waitAction(500);
-
         assertNotNull("ActionListener's ActionPerformed invoked ", listener.action);
     }
 
     public void testIsRunning() {
         ConcreteActionListener listener = new ConcreteActionListener();
         timer = new Timer(10, listener);
-
         listener.waitAction(200);
         assertFalse("timer is not running ", timer.isRunning());
-
         timer.start();
         assertTrue("timer is running ", timer.isRunning());
         listener.waitAction(1500);
         assertTrue("timer is running ", timer.isRunning());
-
         timer.stop();
         assertFalse("timer is not running ", timer.isRunning());
-
         listener.reset();
         listener.waitAction(100);
         assertFalse("timer is not running ", timer.isRunning());
-
         timer.setRepeats(false);
         timer.setDelay(100);
         timer.start();
@@ -320,41 +288,31 @@
     public void testStop() {
         ConcreteActionListener listener = new ConcreteActionListener();
         timer = new Timer(10, listener);
-
         listener.waitAction(200);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
-
         timer.start();
         listener.waitAction(1500);
-
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener.action != null);
+        assertTrue("ActionListener's ActionPerformed invoked ", listener.action != null);
         timer.stop();
         listener.reset();
         listener.waitAction(100);
-
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
     }
 
     public void testStart() {
         ConcreteActionListener listener = new ConcreteActionListener("listener");
         timer = new Timer(10, listener);
-
         listener.waitAction(200);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
-
         timer.start();
         listener.waitAction(500);
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener.action != null);
-
+        assertTrue("ActionListener's ActionPerformed invoked ", listener.action != null);
         timer.stop();
         listener.action = null;
         timer.setInitialDelay(1000);
         timer.start();
         listener.waitAction(500);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
-
         // testing the right order of timers being triggered
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
         ConcreteActionListener listener2 = new ConcreteActionListener("2");
@@ -370,7 +328,6 @@
         timer5.start();
         timer6.start();
         timer7.start();
-
         try {
             timer1.setRepeats(false);
             timer2.setRepeats(false);
@@ -398,34 +355,30 @@
     public void testRestart() {
         ConcreteActionListener listener = new ConcreteActionListener();
         timer = new Timer(10, listener);
-
         listener.waitAction(200);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
-
         timer.start();
         listener.waitAction(1500);
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener.action != null);
-
+        assertTrue("ActionListener's ActionPerformed invoked ", listener.action != null);
         timer.setInitialDelay(500);
         timer.restart();
         listener.reset();
         listener.waitAction(250);
         assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
         listener.waitAction(500);
-        assertTrue("ActionListener's ActionPerformed invoked ",
-                   listener.action != null);
+        assertTrue("ActionListener's ActionPerformed invoked ", listener.action != null);
     }
 
     public void testSetLogTimers() {
         class LogOutputStream extends OutputStream {
             public boolean written = false;
 
+            @Override
             public void write(int b) throws IOException {
                 written = true;
             }
-        };
-
+        }
+        ;
         PrintStream oldOut = System.out;
         LogOutputStream logOut = new LogOutputStream();
         PrintStream newOut = new PrintStream(logOut);
@@ -439,7 +392,6 @@
             listener.waitAction(250);
             assertTrue("[1] action performed ", listener.performed);
             assertFalse("[1] log's not written", logOut.written);
-
             timer.stop();
             listener.reset();
             Timer.setLogTimers(true);
@@ -448,7 +400,6 @@
             assertTrue("[2] logs timers ", Timer.getLogTimers());
             assertTrue("[2] action performed", listener.performed);
             assertTrue("[2] log's written", logOut.written);
-
             timer.stop();
             listener.waitAction(200);
             listener.reset();

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerRTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerRTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerRTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerRTest.java Sat Nov 25 16:04:10 2006
@@ -20,10 +20,10 @@
  */
 package javax.swing;
 
-
 public class ToolTipManagerRTest extends BasicSwingTestCase {
     public void testUnregisterComponent() throws Exception {
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 ToolTipManager.sharedInstance().unregisterComponent(null);
             }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ToolTipManagerTest.java Sat Nov 25 16:04:10 2006
@@ -92,13 +92,14 @@
         JPanel panel = new JPanel();
         m.registerComponent(panel);
         m.unregisterComponent(panel);
-
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 m.registerComponent(null);
             }
         });
         testExceptionalCase(new NullPointerCase() {
+            @Override
             public void exceptionalAction() throws Exception {
                 m.unregisterComponent(null);
             }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TransferHandlerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TransferHandlerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TransferHandlerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/TransferHandlerTest.java Sat Nov 25 16:04:10 2006
@@ -21,56 +21,68 @@
 package javax.swing;
 
 import java.awt.Color;
-import java.awt.Toolkit;
 import java.awt.datatransfer.Clipboard;
 import java.awt.datatransfer.DataFlavor;
 import java.awt.datatransfer.StringSelection;
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
 import java.awt.event.MouseEvent;
 import java.io.IOException;
 
-
 public class TransferHandlerTest extends SwingTestCase {
     TransferHandler transferHandler;
+
     JButton button;
+
     SimpleTransferHandler trH;
+
     TransferHandler insetsTransferHandler;
 
     class SimpleTransferHandler extends TransferHandler {
+        private static final long serialVersionUID = 1L;
+
         public SimpleTransferHandler(final String s) {
             super(s);
         }
+
         boolean wasCallExportToClipBoard;
+
         int parameter = -3;
+
         boolean wasCallImportData;
+
         Clipboard clipboard;
+
         JComponent component;
+
         Transferable transferable;
 
-        public void exportToClipboard(final JComponent comp,
-                                      final Clipboard clip,
-                                      final int action) {
-            component  = comp;
+        @Override
+        public void exportToClipboard(final JComponent comp, final Clipboard clip,
+                final int action) {
+            component = comp;
             clipboard = clip;
             parameter = action;
-            wasCallExportToClipBoard =  true;
+            wasCallExportToClipBoard = true;
         }
-        public boolean importData(final JComponent comp,
-                                  final Transferable t) {
+
+        @Override
+        public boolean importData(final JComponent comp, final Transferable t) {
             component = comp;
             transferable = t;
             wasCallImportData = true;
             return super.importData(comp, t);
         }
 
+        @Override
         protected Transferable createTransferable(final JComponent c) {
             Transferable t = super.createTransferable(c);
             return t;
         }
     }
 
+    @Override
     protected void setUp() throws Exception {
         super.setUp();
         transferHandler = new TransferHandler("text");
@@ -80,6 +92,7 @@
         insetsTransferHandler = new TransferHandler("insets");
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
     }
@@ -104,11 +117,9 @@
     }
 
     public void testExportAsDrag() {
-        MouseEvent e = new MouseEvent(button, MouseEvent.MOUSE_PRESSED,
-                                      0, MouseEvent.BUTTON1_DOWN_MASK,
-                                      50, 50, 0, true);
+        MouseEvent e = new MouseEvent(button, MouseEvent.MOUSE_PRESSED, 0,
+                InputEvent.BUTTON1_DOWN_MASK, 50, 50, 0, true);
         trH.exportAsDrag(button, e, TransferHandler.COPY_OR_MOVE);
-
     }
 
     public void testImportData() {
@@ -117,14 +128,13 @@
         textArea.setBackground(Color.RED);
         Transferable transferable = handler.createTransferable(textArea);
         try {
-            assertEquals(Color.RED, transferable.getTransferData(
-                                     transferable.getTransferDataFlavors()[0]));
+            assertEquals(Color.RED, transferable.getTransferData(transferable
+                    .getTransferDataFlavors()[0]));
         } catch (UnsupportedFlavorException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         } catch (IOException e) {
             assertFalse("Unexpected exception: " + e.getMessage(), true);
         }
-
         JTextArea distArea = new JTextArea();
         distArea.setBackground(Color.GREEN);
         handler.importData(distArea, transferable);
@@ -132,13 +142,11 @@
     }
 
     public void testCreateTransferable() {
-        Transferable transferable = insetsTransferHandler
-           .createTransferable(button);
+        Transferable transferable = insetsTransferHandler.createTransferable(button);
         transferable.getTransferDataFlavors();
         DataFlavor[] flavors = transferable.getTransferDataFlavors();
         try {
-            assertEquals(button.getInsets(),
-                         transferable.getTransferData(flavors[0]));
+            assertEquals(button.getInsets(), transferable.getTransferData(flavors[0]));
         } catch (IOException e) {
             assertFalse("Unexpected exception :" + e.getMessage(), true);
         } catch (UnsupportedFlavorException e) {
@@ -146,25 +154,20 @@
         }
         assertEquals(1, flavors.length);
         DataFlavor flavor = flavors[0];
-        assertEquals(DataFlavor.javaJVMLocalObjectMimeType,
-                           flavor.getHumanPresentableName());
+        assertEquals(DataFlavor.javaJVMLocalObjectMimeType, flavor.getHumanPresentableName());
     }
 
     public void testCanImport() {
         //no text property
         assertFalse(transferHandler.canImport(new JPanel(), null));
-        DataFlavor[] flavors = new DataFlavor[] {
-        DataFlavor.imageFlavor,
-        DataFlavor.javaFileListFlavor,
-        DataFlavor.stringFlavor};
+        DataFlavor[] flavors = new DataFlavor[] { DataFlavor.imageFlavor,
+                DataFlavor.javaFileListFlavor, DataFlavor.stringFlavor };
         assertFalse(transferHandler.canImport(button, flavors));
         DataFlavor flavor;
         try {
             flavor = new DataFlavor("application/x-java-jvm-local-objectref;"
-                         + "class=java.lang.String");
-            assertTrue(transferHandler.canImport(button,
-                                 new DataFlavor[] {flavor}));
-
+                    + "class=java.lang.String");
+            assertTrue(transferHandler.canImport(button, new DataFlavor[] { flavor }));
         } catch (ClassNotFoundException e) {
             assertFalse("Unexpected exception : " + e.getMessage(), true);
         }
@@ -173,26 +176,20 @@
     public void testExportToClipboard_text() {
         JTextArea textArea = new JTextArea("ABCD");
         Clipboard clip = new Clipboard("non system");
-        transferHandler.exportToClipboard(textArea,
-                                          clip,
-                                          TransferHandler.COPY);
+        transferHandler.exportToClipboard(textArea, clip, TransferHandler.COPY);
         DataFlavor flavor = null;
         try {
             flavor = new DataFlavor("application/x-java-jvm-local-objectref;"
-                         + "class=java.lang.String");
-
+                    + "class=java.lang.String");
         } catch (ClassNotFoundException e) {
             assertFalse("Unexpected exception : " + e.getMessage(), true);
         }
-
         try {
             Transferable trans = clip.getContents(null);
             Object obj = trans.getTransferData(flavor);
             assertEquals("ABCD", obj);
         } catch (IOException e) {
-
         } catch (UnsupportedFlavorException e) {
-
         }
     }
 
@@ -201,81 +198,71 @@
         JTextArea textArea = new JTextArea("ABCD");
         textArea.setBackground(Color.RED);
         Clipboard clip = new Clipboard("non system");
-        handler.exportToClipboard(textArea,
-                                          clip,
-                                          TransferHandler.COPY);
+        handler.exportToClipboard(textArea, clip, TransferHandler.COPY);
         DataFlavor flavor = null;
         try {
             flavor = new DataFlavor("application/x-java-jvm-local-objectref;"
-                         + "class=java.awt.Color");
-
+                    + "class=java.awt.Color");
         } catch (ClassNotFoundException e) {
             assertFalse("Unexpected exception : " + e.getMessage(), true);
         }
-
         try {
             Transferable trans = clip.getContents(null);
             Object obj = trans.getTransferData(flavor);
             assertEquals(Color.RED, obj);
         } catch (IOException e) {
-
         } catch (UnsupportedFlavorException e) {
-
         }
     }
 
     public void testGetSourceActions() {
-        assertEquals(TransferHandler.COPY,
-                     transferHandler.getSourceActions(new JButton()));
-        assertEquals(TransferHandler.NONE,
-                     transferHandler.getSourceActions(new JPanel()));
-        assertEquals(TransferHandler.COPY,
-                     transferHandler.getSourceActions(new JLabel()));
-        assertEquals(TransferHandler.NONE,
-                     transferHandler.getSourceActions(new JLayeredPane()));
+        assertEquals(TransferHandler.COPY, transferHandler.getSourceActions(new JButton()));
+        assertEquals(TransferHandler.NONE, transferHandler.getSourceActions(new JPanel()));
+        assertEquals(TransferHandler.COPY, transferHandler.getSourceActions(new JLabel()));
+        assertEquals(TransferHandler.NONE, transferHandler.getSourceActions(new JLayeredPane()));
     }
 
     public void testGetPasteAction() {
         // TODO: uncomment when System clipboard is properly supported
-//        StringSelection data = new StringSelection("TEST");
-//        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(data, null);
-//        Action action = TransferHandler.getPasteAction();
-//        ActionEvent event = new ActionEvent(button,
-//                                            ActionEvent.ACTION_PERFORMED, "");
-//        action.actionPerformed(event);
-//        assertTrue(trH.wasCallImportData);
-//        assertEquals(button, trH.component);
-//        assertEquals("paste", action.getValue(Action.NAME));
-//        assertTrue(action == TransferHandler.getPasteAction());
+        //        StringSelection data = new StringSelection("TEST");
+        //        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(data, null);
+        //        Action action = TransferHandler.getPasteAction();
+        //        ActionEvent event = new ActionEvent(button,
+        //                                            ActionEvent.ACTION_PERFORMED, "");
+        //        action.actionPerformed(event);
+        //        assertTrue(trH.wasCallImportData);
+        //        assertEquals(button, trH.component);
+        //        assertEquals("paste", action.getValue(Action.NAME));
+        //        assertTrue(action == TransferHandler.getPasteAction());
     }
 
     public void testGetCutAction() {
         // TODO: uncomment when System clipboard is properly supported
-//        Action action = TransferHandler.getCutAction();
-//        ActionEvent event = new ActionEvent(button,
-//                                            ActionEvent.ACTION_PERFORMED, "");
-//        action.actionPerformed(event);
-//        assertTrue(trH.wasCallExportToClipBoard);
-//        assertEquals(TransferHandler.MOVE, trH.parameter);
-//        assertEquals(Toolkit.getDefaultToolkit().getSystemClipboard(),
-//                     trH.clipboard);
-//        assertEquals(button, trH.component);
-//        assertEquals("cut", action.getValue(Action.NAME));
-//        assertTrue(action == TransferHandler.getCutAction());
+        //        Action action = TransferHandler.getCutAction();
+        //        ActionEvent event = new ActionEvent(button,
+        //                                            ActionEvent.ACTION_PERFORMED, "");
+        //        action.actionPerformed(event);
+        //        assertTrue(trH.wasCallExportToClipBoard);
+        //        assertEquals(TransferHandler.MOVE, trH.parameter);
+        //        assertEquals(Toolkit.getDefaultToolkit().getSystemClipboard(),
+        //                     trH.clipboard);
+        //        assertEquals(button, trH.component);
+        //        assertEquals("cut", action.getValue(Action.NAME));
+        //        assertTrue(action == TransferHandler.getCutAction());
     }
 
     public void testGetCopyAction() {
         // TODO: uncomment when System clipboard is properly supported
-//        Action action = TransferHandler.getCopyAction();
-//        ActionEvent event = new ActionEvent(button,
-//                                            ActionEvent.ACTION_PERFORMED, "");
-//        action.actionPerformed(event);
-//        assertTrue(trH.wasCallExportToClipBoard);
-//        assertEquals(TransferHandler.COPY, trH.parameter);
-//        assertEquals(Toolkit.getDefaultToolkit().getSystemClipboard(),
-//                     trH.clipboard);
-//        assertEquals(button, trH.component);
-//        assertEquals("copy", action.getValue(Action.NAME));
-//        assertTrue(action == TransferHandler.getCopyAction());
+        //        Action action = TransferHandler.getCopyAction();
+        //        ActionEvent event = new ActionEvent(button,
+        //                                            ActionEvent.ACTION_PERFORMED, "");
+        //        action.actionPerformed(event);
+        //        assertTrue(trH.wasCallExportToClipBoard);
+        //        assertEquals(TransferHandler.COPY, trH.parameter);
+        //        assertEquals(Toolkit.getDefaultToolkit().getSystemClipboard(),
+        //                     trH.clipboard);
+        //        assertEquals(button, trH.component);
+        //        assertEquals("copy", action.getValue(Action.NAME));
+        //        assertTrue(action == TransferHandler.getCopyAction());
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java Sat Nov 25 16:04:10 2006
@@ -14,12 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Sergey Burlak
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.Color;
@@ -40,7 +38,6 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 import java.util.Vector;
-
 import javax.swing.border.Border;
 import javax.swing.plaf.ColorUIResource;
 import javax.swing.plaf.InputMapUIResource;
@@ -63,7 +60,6 @@
         uiDefaults.put("TRUE", Boolean.TRUE);
         assertEquals(1, uiDefaults.size());
         assertEquals(Boolean.TRUE.booleanValue(), uiDefaults.getBoolean("TRUE"));
-
         uiDefaults.put("TRUE", "a");
         uiDefaults.getBoolean("TRUE");
     }
@@ -73,7 +69,6 @@
         uiDefaults.put("1", num);
         assertEquals(1, uiDefaults.size());
         assertEquals(num.intValue(), uiDefaults.getInt("1"));
-
         uiDefaults.put("1", "a");
         uiDefaults.getInt("1");
     }
@@ -90,9 +85,11 @@
             public int getIconHeight() {
                 return 0;
             }
+
             public int getIconWidth() {
                 return 0;
             }
+
             public void paintIcon(final Component c, final Graphics g, final int x, final int y) {
             }
         };
@@ -103,11 +100,14 @@
 
     public void testGetBorder() {
         Border b = new Border() {
-            public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
+            public void paintBorder(final Component c, final Graphics g, final int x,
+                    final int y, final int w, final int h) {
             }
+
             public Insets getBorderInsets(final Component c) {
                 return null;
             }
+
             public boolean isBorderOpaque() {
                 return false;
             }
@@ -146,27 +146,26 @@
     }
 
     public void testProxyLazyValue() {
-        uiDefaults.put("1", new UIDefaults.ProxyLazyValue("java.lang.String", new Object[] { "aaa" }));
+        uiDefaults.put("1", new UIDefaults.ProxyLazyValue("java.lang.String",
+                new Object[] { "aaa" }));
         propertyChangeController = new PropertyChangeController();
         uiDefaults.addPropertyChangeListener(propertyChangeController);
         assertEquals(1, uiDefaults.size());
         assertEquals("aaa", uiDefaults.get("1"));
         assertEquals(1, uiDefaults.size());
         assertFalse(propertyChangeController.isChanged());
-
         uiDefaults.put("2", new UIDefaults.ProxyLazyValue("java.lang.String"));
         assertEquals(2, uiDefaults.size());
         assertEquals("aaa", uiDefaults.get("1"));
         assertEquals("", uiDefaults.get("2"));
         assertNull(uiDefaults.getIcon("2"));
-
-        uiDefaults.put("3", new UIDefaults.ProxyLazyValue("java.lang.Integer", "decode", new String[] { "43" }));
+        uiDefaults.put("3", new UIDefaults.ProxyLazyValue("java.lang.Integer", "decode",
+                new String[] { "43" }));
         assertEquals(3, uiDefaults.size());
         assertEquals("aaa", uiDefaults.get("1"));
         assertEquals("", uiDefaults.get("2"));
         assertEquals(new Integer("43"), uiDefaults.get("3"));
         assertEquals(43, uiDefaults.getInt("3"));
-
         uiDefaults.put("4", new UIDefaults.ProxyLazyValue("java.lang.String", "toUpperCase"));
         assertEquals(4, uiDefaults.size());
         assertEquals("aaa", uiDefaults.get("1"));
@@ -178,14 +177,10 @@
     public void testGetUI() {
         setBasicLF();
         final String uiClassName = "javax.swing.plaf.basic.BasicButtonUI";
-
         uiDefaults.put("ButtonUI", uiClassName);
-
         assertNull(uiDefaults.get(uiClassName));
-
         JButton button = new JButton();
         assertTrue(uiDefaults.getUI(button).getClass().getName().equals(uiClassName));
-
         Object classObj = uiDefaults.get(uiClassName);
         assertNotNull(classObj);
         Object methodObj = uiDefaults.get(classObj);
@@ -195,24 +190,20 @@
     public void testGetUIClass() throws ClassNotFoundException {
         setBasicLF();
         final String uiClassName = "javax.swing.plaf.basic.BasicButtonUI";
-
         uiDefaults.put("ButtonUI", uiClassName);
-        assertEquals(Class.forName(uiClassName),
-                uiDefaults.getUIClass("ButtonUI"));
+        assertEquals(Class.forName(uiClassName), uiDefaults.getUIClass("ButtonUI"));
     }
 
     public void testGetUIClassWithClassLoader() throws Exception {
         setBasicLF();
         final String uiClassName = "javax.swing.plaf.basic.BasicButtonUI";
-
         uiDefaults.put("ButtonUI", uiClassName);
         assertEquals(Class.forName(uiClassName), uiDefaults.getUIClass("ButtonUI", null));
-
         AccessController.doPrivileged(new PrivilegedAction() {
             public Object run() {
                 try {
-                    assertEquals(Class.forName(uiClassName),
-                                 uiDefaults.getUIClass("ButtonUI", new URLClassLoader(new URL[0])));
+                    assertEquals(Class.forName(uiClassName), uiDefaults.getUIClass("ButtonUI",
+                            new URLClassLoader(new URL[0])));
                 } catch (ClassNotFoundException e) {
                 }
                 return null;
@@ -222,43 +213,34 @@
 
     public void testGetValueFromResourceBundle() {
         String bundleName = "javax.swing.TestBundle";
-        
         assertNull(uiDefaults.get("OptionPane.okButtonText"));
-
         propertyChangeController = new PropertyChangeController();
         uiDefaults.addPropertyChangeListener(propertyChangeController);
-
         uiDefaults.addResourceBundle(bundleName);
         assertFalse(propertyChangeController.isChanged());
-
         ResourceBundle bundle = ResourceBundle.getBundle(bundleName);
-        assertEquals(bundle.getString("OptionPane.okButtonText"), uiDefaults.get("OptionPane.okButtonText"));
-
+        assertEquals(bundle.getString("OptionPane.okButtonText"), uiDefaults
+                .get("OptionPane.okButtonText"));
         propertyChangeController.reset();
         uiDefaults.removeResourceBundle(bundleName);
         assertFalse(propertyChangeController.isChanged());
     }
 
     public void testInputMap() {
-        uiDefaults.put("1", new UIDefaults.LazyInputMap(new Object[] { "1", "11",
-                "2", "22",
-                "3", "33",
-                "4", "44"}));
+        uiDefaults.put("1", new UIDefaults.LazyInputMap(new Object[] { "1", "11", "2", "22",
+                "3", "33", "4", "44" }));
         assertTrue(uiDefaults.get("1") instanceof InputMapUIResource);
-        InputMapUIResource map = (InputMapUIResource)uiDefaults.get("1");
+        InputMapUIResource map = (InputMapUIResource) uiDefaults.get("1");
         assertEquals(4, map.allKeys().length);
     }
 
     public void testCreateUIDefaultsTable() {
         assertEquals(0, uiDefaults.size());
-        UIDefaults uid = new UIDefaults(new Object[] { "1", "1v",
-                "2", "2v",
-                "3", "3v",
-                "4", "4v"});
+        UIDefaults uid = new UIDefaults(new Object[] { "1", "1v", "2", "2v", "3", "3v", "4",
+                "4v" });
         assertEquals(4, uid.size());
         assertEquals("1v", uid.get("1"));
         assertEquals("3v", uid.getString("3"));
-
         uiDefaults.put("key", null);
         assertNull(uiDefaults.get("key"));
     }
@@ -273,11 +255,9 @@
                 return null;
             }
         });
-
         uiDefaults.put("ButtonUI", "plaf.windows.WWWWWinButtonUI");
         JButton button = new JButton();
         uiDefaults.getUI(button);
-
         String error = byteStream.toString();
         assertTrue(error.indexOf("failed") > 0);
         AccessController.doPrivileged(new PrivilegedAction() {
@@ -294,17 +274,18 @@
         uiDefaults.addPropertyChangeListener(propertyChangeController);
         uiDefaults.setDefaultLocale(Locale.UK);
         assertFalse(propertyChangeController.isChanged());
-
         String bundleName = "javax.swing.TestBundle";
-
         assertNull(uiDefaults.get("OptionPane.titleText"));
         uiDefaults.addResourceBundle(bundleName);
-        assertEquals(ResourceBundle.getBundle(bundleName, Locale.GERMAN).getString("OptionPane.titleText"),
-                uiDefaults.getString("OptionPane.titleText", Locale.GERMAN));
-        assertEquals(ResourceBundle.getBundle(bundleName, Locale.ITALIAN).getString("OptionPane.titleText"),
-                uiDefaults.getString("OptionPane.titleText", Locale.ITALIAN));
-        assertEquals(ResourceBundle.getBundle(bundleName, Locale.KOREAN).getString("OptionPane.titleText"),
-                uiDefaults.getString("OptionPane.titleText", Locale.KOREAN));
+        assertEquals(ResourceBundle.getBundle(bundleName, Locale.GERMAN).getString(
+                "OptionPane.titleText"), uiDefaults.getString("OptionPane.titleText",
+                Locale.GERMAN));
+        assertEquals(ResourceBundle.getBundle(bundleName, Locale.ITALIAN).getString(
+                "OptionPane.titleText"), uiDefaults.getString("OptionPane.titleText",
+                Locale.ITALIAN));
+        assertEquals(ResourceBundle.getBundle(bundleName, Locale.KOREAN).getString(
+                "OptionPane.titleText"), uiDefaults.getString("OptionPane.titleText",
+                Locale.KOREAN));
     }
 
     public void testPropertyListeners() {
@@ -314,36 +295,30 @@
                 count.add(new Object());
             }
         };
-
         uiDefaults.put("1", "1v");
-
         assertEquals(0, uiDefaults.getPropertyChangeListeners().length);
         uiDefaults.addPropertyChangeListener(listener);
         assertEquals(1, uiDefaults.getPropertyChangeListeners().length);
-
         assertEquals(0, count.size());
         uiDefaults.put("2", "2v");
         assertEquals(1, count.size());
         uiDefaults.put("2", "2v");
         assertEquals(1, count.size());
-
         uiDefaults.removePropertyChangeListener(listener);
         assertEquals(0, uiDefaults.getPropertyChangeListeners().length);
     }
 
     public void testPutDefaultsChangeEvent() {
         propertyChangeController = new PropertyChangeController();
-
         uiDefaults.addPropertyChangeListener(propertyChangeController);
-        uiDefaults.putDefaults(new Object[] {"1", "11",
-                "2", "22",
-                "3", "33",
-                "4", "44"});
+        uiDefaults.putDefaults(new Object[] { "1", "11", "2", "22", "3", "33", "4", "44" });
         assertTrue(propertyChangeController.isChanged("UIDefaults"));
     }
 
     public void testCreateProxyLazyValueWithUIResourceAsParameter() {
-        uiDefaults.put("1", new UIDefaults.ProxyLazyValue("javax.swing.plaf.BorderUIResource$LineBorderUIResource", new Object[] {new ColorUIResource(255, 255, 0)}));
+        uiDefaults.put("1", new UIDefaults.ProxyLazyValue(
+                "javax.swing.plaf.BorderUIResource$LineBorderUIResource",
+                new Object[] { new ColorUIResource(255, 255, 0) }));
         assertEquals(1, uiDefaults.size());
         assertNotNull(uiDefaults.get("1"));
         assertTrue(uiDefaults.get("1") instanceof Border);
@@ -356,22 +331,18 @@
         assertEquals(1, uiDefaults.size());
         assertTrue(propertyChangeController.isChanged("1"));
         propertyChangeController.reset();
-
         assertNull(uiDefaults.put("2", "val2"));
         assertEquals(2, uiDefaults.size());
         assertTrue(propertyChangeController.isChanged("2"));
         propertyChangeController.reset();
-
         assertEquals("val2", uiDefaults.put("2", "val2"));
         assertEquals(2, uiDefaults.size());
         assertFalse(propertyChangeController.isChanged("2"));
         propertyChangeController.reset();
-
         assertEquals("val2", uiDefaults.put("2", null));
         assertTrue(propertyChangeController.isChanged("2"));
         assertEquals(1, uiDefaults.size());
         propertyChangeController.reset();
-
         uiDefaults.put("nokey", null);
         assertTrue(propertyChangeController.isChanged("nokey"));
         assertEquals(1, uiDefaults.size());
@@ -383,15 +354,19 @@
                 public boolean isNativeLookAndFeel() {
                     return true;
                 }
+
                 public boolean isSupportedLookAndFeel() {
                     return true;
                 }
+
                 public String getDescription() {
                     return null;
                 }
+
                 public String getID() {
                     return null;
                 }
+
                 public String getName() {
                     return null;
                 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIManagerTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIManagerTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIManagerTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIManagerTest.java Sat Nov 25 16:04:10 2006
@@ -14,12 +14,10 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Sergey Burlak
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.Color;
@@ -28,7 +26,6 @@
 import java.awt.Insets;
 import java.beans.PropertyChangeListener;
 import java.util.Locale;
-
 import javax.swing.UIManager.LookAndFeelInfo;
 import javax.swing.border.Border;
 import javax.swing.plaf.ComponentUI;
@@ -38,6 +35,7 @@
 public class UIManagerTest extends SwingTestCase {
     Locale locale = Locale.US;
 
+    @Override
     public void setUp() throws Exception {
         super.setUp();
         removePropertyChangeListeners();
@@ -45,7 +43,6 @@
 
     public void testPut() {
         UIManager.put("1", "1v");
-
         assertEquals("1v", UIManager.get("1"));
         assertEquals("1v", UIManager.getDefaults().get("1"));
         assertNull(UIManager.getLookAndFeelDefaults().get("1"));
@@ -110,7 +107,7 @@
         boolean b = UIManager.getBoolean("MenuItem.borderPainted");
         assertTrue(b);
         assertTrue(UIManager.getBoolean("MenuItem.borderPainted", locale));
-   }
+    }
 
     public void testGetString() {
         Object result = UIManager.get("TabbedPaneUI");
@@ -128,7 +125,7 @@
         result = UIManager.getDimension("Spinner.arrowButtonSize");
         assertNotNull(result);
         assertNotNull(UIManager.getDimension("Spinner.arrowButtonSize", locale));
-}
+    }
 
     public void testGetIcon() {
         Object result = UIManager.get("Menu.arrowIcon");
@@ -142,6 +139,9 @@
     public void testGetUI() throws Exception {
         UIManager.setLookAndFeel(new MetalLookAndFeel());
         JComponent c = new JComponent() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
             public String getUIClassID() {
                 return "ButtonUI";
             }
@@ -151,12 +151,15 @@
     }
 
     public void testGetCrossPlatformLookAndFeelClassName() {
-        assertEquals("javax.swing.plaf.metal.MetalLookAndFeel", UIManager.getCrossPlatformLookAndFeelClassName());
+        assertEquals("javax.swing.plaf.metal.MetalLookAndFeel", UIManager
+                .getCrossPlatformLookAndFeelClassName());
     }
 
     public void testGetSystemLookAndFeelClassName() {
-        if (System.getProperty("os.name").indexOf("Linux") > 0)
-            assertEquals("javax.swing.plaf.metal.MetalLookAndFeel", UIManager.getSystemLookAndFeelClassName());
+        if (System.getProperty("os.name").indexOf("Linux") > 0) {
+            assertEquals("javax.swing.plaf.metal.MetalLookAndFeel", UIManager
+                    .getSystemLookAndFeelClassName());
+        }
     }
 
     public void testGetDefaults() {
@@ -174,7 +177,6 @@
         } catch (UnsupportedLookAndFeelException e) {
             assertTrue(e.getMessage().indexOf("not supported on this platform") > 0);
         }
-
         UIManager.setLookAndFeel(laf);
     }
 
@@ -190,10 +192,13 @@
     }
 
     public void testLookAndFeelInfo() {
-        LookAndFeelInfo lfInfo = new LookAndFeelInfo("Metal", "javax.swing.plaf.metal.MetalLookAndFeel");
+        LookAndFeelInfo lfInfo = new LookAndFeelInfo("Metal",
+                "javax.swing.plaf.metal.MetalLookAndFeel");
         assertEquals("Metal", lfInfo.getName());
         assertEquals("javax.swing.plaf.metal.MetalLookAndFeel", lfInfo.getClassName());
-        assertEquals("javax.swing.UIManager$LookAndFeelInfo[Metal javax.swing.plaf.metal.MetalLookAndFeel]", lfInfo.toString());
+        assertEquals(
+                "javax.swing.UIManager$LookAndFeelInfo[Metal javax.swing.plaf.metal.MetalLookAndFeel]",
+                lfInfo.toString());
     }
 
     public void testPropertyChangeListeners() throws Exception {
@@ -209,14 +214,12 @@
         assertFalse(propertyChangeController.isChanged());
         UIManager.put("1", "1v");
         assertFalse(propertyChangeController.isChanged());
-
         MetalLookAndFeel metalLookAndFeel = new MetalLookAndFeel();
         UIManager.setLookAndFeel(metalLookAndFeel);
         assertTrue(propertyChangeController.isChanged("lookAndFeel"));
         propertyChangeController.reset();
         UIManager.setLookAndFeel(metalLookAndFeel);
         assertFalse(propertyChangeController.isChanged());
-
         UIManager.removePropertyChangeListener(propertyChangeController);
         assertEquals(0, UIManager.getPropertyChangeListeners().length);
         UIManager.setLookAndFeel(laf);
@@ -225,25 +228,21 @@
     public void testSetInstalledLFs() {
         LookAndFeelInfo[] previousValues = UIManager.getInstalledLookAndFeels();
         UIManager.setInstalledLookAndFeels(new LookAndFeelInfo[] {});
-
         UIManager.installLookAndFeel("new", "newClass");
         assertEquals(1, UIManager.getInstalledLookAndFeels().length);
         assertEquals("new", UIManager.getInstalledLookAndFeels()[0].getName());
         assertEquals("newClass", UIManager.getInstalledLookAndFeels()[0].getClassName());
-
         UIManager.setInstalledLookAndFeels(new LookAndFeelInfo[] {});
-
-        LookAndFeelInfo lfInfo0 = new LookAndFeelInfo("Metal", "javax.swing.plaf.metal.MetalLookAndFeel");
+        LookAndFeelInfo lfInfo0 = new LookAndFeelInfo("Metal",
+                "javax.swing.plaf.metal.MetalLookAndFeel");
         LookAndFeelInfo lfInfo1 = new LookAndFeelInfo("-", "1");
-
         UIManager.installLookAndFeel(lfInfo0);
         assertEquals(1, UIManager.getInstalledLookAndFeels().length);
         assertEquals(lfInfo0.getName(), UIManager.getInstalledLookAndFeels()[0].getName());
-        assertEquals(lfInfo0.getClassName(), UIManager.getInstalledLookAndFeels()[0].getClassName());
-
-        UIManager.setInstalledLookAndFeels(new LookAndFeelInfo[] {lfInfo0, lfInfo1});
+        assertEquals(lfInfo0.getClassName(), UIManager.getInstalledLookAndFeels()[0]
+                .getClassName());
+        UIManager.setInstalledLookAndFeels(new LookAndFeelInfo[] { lfInfo0, lfInfo1 });
         assertEquals(2, UIManager.getInstalledLookAndFeels().length);
-
         UIManager.setInstalledLookAndFeels(previousValues);
     }
 
@@ -254,7 +253,6 @@
         } else {
             assertEquals(3, installedLookAndFeels.length);
         }
-
         boolean foundMetalLF = false;
         for (int i = 0; i < installedLookAndFeels.length; i++) {
             if ("Metal".equals(installedLookAndFeels[i].getName())) {
@@ -266,18 +264,27 @@
 
     private LookAndFeel createUnsupportedLF() {
         return new LookAndFeel() {
+            @Override
             public String getDescription() {
                 return null;
             }
+
+            @Override
             public String getID() {
                 return null;
             }
+
+            @Override
             public String getName() {
                 return null;
             }
+
+            @Override
             public boolean isNativeLookAndFeel() {
                 return false;
             }
+
+            @Override
             public boolean isSupportedLookAndFeel() {
                 return false;
             }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ViewportLayoutTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ViewportLayoutTest.java?view=diff&rev=479240&r1=479239&r2=479240
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ViewportLayoutTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/ViewportLayoutTest.java Sat Nov 25 16:04:10 2006
@@ -14,22 +14,22 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-
 /**
  * @author Sergey Burlak
  * @version $Revision$
  */
-
 package javax.swing;
 
 import java.awt.Dimension;
 
 public class ViewportLayoutTest extends SwingTestCase {
-
     private ViewportLayout layout;
+
     private JViewport viewport;
+
     private JLabel label;
 
+    @Override
     public void setUp() {
         label = new JLabel();
         StringBuffer b = new StringBuffer();
@@ -37,12 +37,12 @@
             b.append("w" + i);
         }
         label.setText(b.toString());
-
         viewport = new JViewport();
         viewport.add(label);
-        layout = (ViewportLayout)viewport.getLayout();
+        layout = (ViewportLayout) viewport.getLayout();
     }
 
+    @Override
     public void tearDown() {
         layout = null;
         viewport = null;



Mime
View raw message