harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r463638 [2/2] - in /incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api: java.injected/javax/swing/ java/common/javax/swing/
Date Fri, 13 Oct 2006 10:45:01 GMT
Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesTest.java?view=diff&rev=463638&r1=463637&r2=463638
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/SwingUtilitiesTest.java
Fri Oct 13 03:44:58 2006
@@ -363,7 +363,7 @@
         result = SwingUtilities.notifyAction(action, KeyStroke.getKeyStroke('a'), event,
this, modifiers);
         assertFalse(result);
         assertFalse(event.isConsumed());
-        assertTrue(action.eventHappened == null);
+        assertNull(action.eventHappened);
 
         action.setEnabled(true);
         result = SwingUtilities.notifyAction(action, KeyStroke.getKeyStroke('a'), event,
this, modifiers);
@@ -385,7 +385,7 @@
         assertTrue(result);
         assertFalse(event.isConsumed());
         assertTrue(action.eventHappened != null);
-        assertTrue(action.eventHappened.getActionCommand() == null);
+        assertNull(action.eventHappened.getActionCommand());
 
         event = new KeyEvent(source, 0, 0, modifiers, KeyEvent.VK_UNDEFINED, KeyEvent.CHAR_UNDEFINED);
         action.setEnabled(false);
@@ -393,7 +393,7 @@
         assertFalse(result);
         assertFalse(event.isConsumed());
         assertTrue(action.eventHappened != null);
-        assertTrue(action.eventHappened.getActionCommand() == null);
+        assertNull(action.eventHappened.getActionCommand());
     }
 
     public void testConvertMouseEvent() {
@@ -843,9 +843,9 @@
         Component component3 = new JPanel();
         JPanel panel4 = new JPanel();
 
-        assertTrue(SwingUtilities.getAncestorNamed(name1, null) == null);
-        assertTrue(SwingUtilities.getAncestorNamed(null, component3) == null);
-        assertTrue(SwingUtilities.getAncestorNamed(null, null) == null);
+        assertNull(SwingUtilities.getAncestorNamed(name1, null));
+        assertNull(SwingUtilities.getAncestorNamed(null, component3));
+        assertNull(SwingUtilities.getAncestorNamed(null, null));
 
         panel4.add(panel1);
         panel1.add(panel2);
@@ -855,13 +855,13 @@
         window.add(component2);
 
         assertTrue(SwingUtilities.getAncestorNamed(name3, component1) == panel1);
-        assertTrue(SwingUtilities.getAncestorNamed(name6, component1) == null);
+        assertNull(SwingUtilities.getAncestorNamed(name6, component1));
         assertTrue(SwingUtilities.getAncestorNamed(name2, component1) == window);
-        assertTrue(SwingUtilities.getAncestorNamed(name5, component1) == null);
+        assertNull(SwingUtilities.getAncestorNamed(name5, component1));
         assertTrue(SwingUtilities.getAncestorNamed(name2, panel1) == window);
         assertTrue(SwingUtilities.getAncestorNamed(name2, component2) == window);
         assertTrue(SwingUtilities.getAncestorNamed(name5, component3) == panel3);
-        assertTrue(SwingUtilities.getAncestorNamed(null, component1) == null);
+        assertNull(SwingUtilities.getAncestorNamed(null, component1));
     }
 
     public void testGetAncestorOfClass() {
@@ -873,9 +873,9 @@
         Component component2 = new Panel();
         Component component3 = new Panel();
 
-        assertTrue(SwingUtilities.getAncestorOfClass(JPanel.class, null) == null);
-        assertTrue(SwingUtilities.getAncestorOfClass(null, component3) == null);
-        assertTrue(SwingUtilities.getAncestorOfClass(null, null) == null);
+        assertNull(SwingUtilities.getAncestorOfClass(JPanel.class, null));
+        assertNull(SwingUtilities.getAncestorOfClass(null, component3));
+        assertNull(SwingUtilities.getAncestorOfClass(null, null));
 
         panel1.add(panel2);
         panel2.add(component1);
@@ -887,7 +887,7 @@
         assertTrue(SwingUtilities.getAncestorOfClass(JPanel.class, component1) == panel2);
         assertTrue(SwingUtilities.getAncestorOfClass(JPanel.class, panel2) == panel1);
         assertTrue(SwingUtilities.getAncestorOfClass(Window.class, component2) == window);
-        assertTrue(SwingUtilities.getAncestorOfClass(Window.class, component3) == null);
+        assertNull(SwingUtilities.getAncestorOfClass(Window.class, component3));
         assertTrue(SwingUtilities.getAncestorOfClass(JPanel.class, component3) == panel3);
 
         class CustomPanel extends JPanel {
@@ -946,7 +946,7 @@
         window.getContentPane().add(component2);
 
         assertEquals(window.getRootPane(), SwingUtilities.getRootPane(component1));
-        assertEquals(null, SwingUtilities.getRootPane(component3));
+        assertNull(SwingUtilities.getRootPane(component3));
         assertEquals(window.getRootPane(), SwingUtilities.getRootPane(component2));
         assertEquals(window.getRootPane(), SwingUtilities.getRootPane(window));
         assertSame(pane, SwingUtilities.getRootPane(pane));
@@ -961,11 +961,11 @@
 
         component.setInputMap(JComponent.WHEN_FOCUSED, null);
         component.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, null);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
         SwingUtilities.replaceUIInputMap(component, JComponent.WHEN_FOCUSED, uiInputMap1);
         SwingUtilities.replaceUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
uiInputMap2);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
== null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT));
 
         component.setInputMap(JComponent.WHEN_FOCUSED, initialMap);
         component.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, anotherMap);
@@ -978,7 +978,7 @@
 
         anotherMap.setParent(null);
         initialMap.setParent(anotherMap);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
         SwingUtilities.replaceUIInputMap(component, JComponent.WHEN_FOCUSED, uiInputMap2);
         assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == uiInputMap2);
     }
@@ -991,15 +991,15 @@
         InputMap anotherMap = new InputMap();
 
         component.setInputMap(JComponent.WHEN_FOCUSED, null);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
== null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT));
         component.setInputMap(JComponent.WHEN_FOCUSED, uiInputMap1);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
         component.setInputMap(JComponent.WHEN_FOCUSED, anotherMap);
         component.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, anotherMap);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
         anotherMap.setParent(initialMap);
-        assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == null);
+        assertNull(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED));
         anotherMap.setParent(uiInputMap1);
         assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_FOCUSED) == uiInputMap1);
         assertTrue(SwingUtilities.getUIInputMap(component, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
== uiInputMap1);
@@ -1022,9 +1022,9 @@
         ActionMap anotherMap = new ActionMap();
 
         component.setActionMap(null);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         SwingUtilities.replaceUIActionMap(component, uiActionMap1);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
 
         component.setActionMap(initialMap);
         SwingUtilities.replaceUIActionMap(component, uiActionMap1);
@@ -1033,7 +1033,7 @@
         assertTrue(SwingUtilities.getUIActionMap(component) == uiActionMap2);
 
         initialMap.setParent(anotherMap);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         SwingUtilities.replaceUIActionMap(component, uiActionMap2);
         assertTrue(SwingUtilities.getUIActionMap(component) == uiActionMap2);
     }
@@ -1046,13 +1046,13 @@
         ActionMap anotherMap = new ActionMap();
 
         component.setActionMap(null);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         component.setActionMap(uiActionMap1);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         component.setActionMap(anotherMap);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         anotherMap.setParent(initialMap);
-        assertTrue(SwingUtilities.getUIActionMap(component) == null);
+        assertNull(SwingUtilities.getUIActionMap(component));
         anotherMap.setParent(uiActionMap1);
         assertTrue(SwingUtilities.getUIActionMap(component) == uiActionMap1);
         uiActionMap1.setParent(uiActionMap2);
@@ -1094,8 +1094,8 @@
 
         Component component2 = new Container();
         panel.add(component2);
-        assertTrue("inAccessible component not found in parent",
-                SwingUtilities.getAccessibleChild(panel, 1) == null);
+        assertNull("inAccessible component not found in parent",
+                SwingUtilities.getAccessibleChild(panel, 1));
 
         Component component3  = new JPanel();
         panel.add(component3);
@@ -1142,7 +1142,7 @@
         Component component2 = new JButton();
         Component component3 = new JButton();
 
-        assertTrue(SwingUtilities.windowForComponent(component1) == null);
+        assertNull(SwingUtilities.windowForComponent(component1));
 
         panel1.add(panel2);
         panel2.add(component1);
@@ -1152,7 +1152,7 @@
 
         assertTrue(SwingUtilities.windowForComponent(component1) == window);
         assertTrue(SwingUtilities.windowForComponent(component2) == window);
-        assertTrue(SwingUtilities.windowForComponent(component3) == null);
+        assertNull(SwingUtilities.windowForComponent(component3));
         assertTrue(SwingUtilities.windowForComponent(window) != window);
     }
 
@@ -1173,7 +1173,7 @@
         }
         assertTrue(thrown);
         */
-        assertTrue(SwingUtilities.getWindowAncestor(component1) == null);
+        assertNull(SwingUtilities.getWindowAncestor(component1));
 
         panel1.add(panel2);
         panel2.add(component1);
@@ -1183,7 +1183,7 @@
 
         assertTrue(SwingUtilities.getWindowAncestor(component1) == window);
         assertTrue(SwingUtilities.getWindowAncestor(component2) == window);
-        assertTrue(SwingUtilities.getWindowAncestor(component3) == null);
+        assertNull(SwingUtilities.getWindowAncestor(component3));
         assertTrue(SwingUtilities.getWindowAncestor(window) != window);
     }
 
@@ -1381,7 +1381,7 @@
         assertTrue(SwingUtilities.getDeepestComponentAt(window.getContentPane(), 10, 10)
== component1);
         assertTrue(SwingUtilities.getDeepestComponentAt(window.getContentPane(), 100, 20)
== component3);
         assertTrue(SwingUtilities.getDeepestComponentAt(window.getContentPane(), 110, 20)
== component2);
-        assertTrue(SwingUtilities.getDeepestComponentAt(window.getContentPane(), 210, 20)
== null);
+        assertNull(SwingUtilities.getDeepestComponentAt(window.getContentPane(), 210, 20));
         assertTrue(SwingUtilities.getDeepestComponentAt(window, 100, 20) == window);
     }
 
@@ -1417,7 +1417,7 @@
 
         assertEquals(window1, SwingUtilities.getRoot(panel1));
         assertEquals(window1, SwingUtilities.getRoot(panel2));
-        assertEquals(null, SwingUtilities.getRoot(panel3));
+        assertNull(SwingUtilities.getRoot(panel3));
         assertEquals(window2, SwingUtilities.getRoot(panel4));
         assertEquals(window1, SwingUtilities.getRoot(window1));
         assertEquals(window2, SwingUtilities.getRoot(window2));
@@ -1527,32 +1527,32 @@
         action1.event = null;
         result = SwingUtilities.processKeyBindings(event2);
         assertTrue(result);
-        assertTrue("event2: wrong actionPerformed called for parent", action1.event == null);
+        assertNull("event2: wrong actionPerformed called for parent", action1.event);
         assertTrue("event2: right actionPerformed called for parent", action2.event != null);
         assertFalse(event2.isConsumed());
 
         action2.event = null;
         result = SwingUtilities.processKeyBindings(event3);
         assertTrue(result);
-        assertTrue("event3: actionPerformed called for parent", action1.event == null);
-        assertTrue("event3: actionPerformed called for brother", action2.event == null);
+        assertNull("event3: actionPerformed called for parent", action1.event);
+        assertNull("event3: actionPerformed called for brother", action2.event);
         assertTrue("event3: actionPerformed called for component", action3.event != null);
         assertFalse(event3.isConsumed());
 
         action3.event = null;
         result = SwingUtilities.processKeyBindings(event4);
         assertTrue(result);
-        assertTrue("event4: actionPerformed called for parent", action1.event == null);
-        assertTrue("event4: actionPerformed called for brother", action2.event == null);
-        assertTrue("event4: actionPerformed called for component", action3.event == null);
+        assertNull("event4: actionPerformed called for parent", action1.event);
+        assertNull("event4: actionPerformed called for brother", action2.event);
+        assertNull("event4: actionPerformed called for component", action3.event);
         assertTrue("event4: actionPerformed called for brother", action41.event != null);
-        assertTrue("event4: actionPerformed called for brother", action42.event == null);
+        assertNull("event4: actionPerformed called for brother", action42.event);
         assertFalse(event4.isConsumed());
 
         result = SwingUtilities.processKeyBindings(event5);
         assertTrue(result);
         assertTrue("event5: actionPerformed called for parent", action51.event != null);
-        assertTrue("event5: actionPerformed called for parent", action53.event == null);
+        assertNull("event5: actionPerformed called for parent", action53.event);
         assertFalse(event5.isConsumed());
 
         JComponent panel1 = new JPanel();
@@ -1566,7 +1566,7 @@
         result = SwingUtilities.processKeyBindings(event6);
         assertTrue(result);
         assertTrue("event5: actionPerformed called for parent", action52.event != null);
-        assertTrue("event5: actionPerformed called for parent", action54.event == null);
+        assertNull("event5: actionPerformed called for parent", action54.event);
         assertFalse(event5.isConsumed());
     }
 

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java?view=diff&rev=463638&r1=463637&r2=463638
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
Fri Oct 13 03:44:58 2006
@@ -238,8 +238,7 @@
         timer.start();
         listener2.waitAction(500);
 
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener2.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener2.action);
 
         listener2.reset();
         listener2.waitAction(1000);
@@ -323,8 +322,7 @@
         timer = new Timer(10, listener);
 
         listener.waitAction(200);
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
 
         timer.start();
         listener.waitAction(1500);
@@ -335,8 +333,7 @@
         listener.reset();
         listener.waitAction(100);
 
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
     }
 
     public void testStart() {
@@ -344,8 +341,7 @@
         timer = new Timer(10, listener);
 
         listener.waitAction(200);
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
 
         timer.start();
         listener.waitAction(500);
@@ -357,8 +353,7 @@
         timer.setInitialDelay(1000);
         timer.start();
         listener.waitAction(500);
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
 
         // testing the right order of timers being triggered
         ConcreteActionListener listener1 = new ConcreteActionListener("1");
@@ -405,8 +400,7 @@
         timer = new Timer(10, listener);
 
         listener.waitAction(200);
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
 
         timer.start();
         listener.waitAction(1500);
@@ -417,8 +411,7 @@
         timer.restart();
         listener.reset();
         listener.waitAction(250);
-        assertEquals("ActionListener's ActionPerformed didn't invoke ", null,
-                     listener.action);
+        assertNull("ActionListener's ActionPerformed didn't invoke ", listener.action);
         listener.waitAction(500);
         assertTrue("ActionListener's ActionPerformed invoked ",
                    listener.action != null);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java?view=diff&rev=463638&r1=463637&r2=463638
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/UIDefaultsTest.java
Fri Oct 13 03:44:58 2006
@@ -158,7 +158,7 @@
         assertEquals(2, uiDefaults.size());
         assertEquals("aaa", uiDefaults.get("1"));
         assertEquals("", uiDefaults.get("2"));
-        assertEquals(null, uiDefaults.getIcon("2"));
+        assertNull(uiDefaults.getIcon("2"));
 
         uiDefaults.put("3", new UIDefaults.ProxyLazyValue("java.lang.Integer", "decode",
new String[] { "43" }));
         assertEquals(3, uiDefaults.size());
@@ -223,7 +223,7 @@
     public void testGetValueFromResourceBundle() {
         String bundleName = "javax.swing.TestBundle";
         
-        assertEquals(null, uiDefaults.get("OptionPane.okButtonText"));
+        assertNull(uiDefaults.get("OptionPane.okButtonText"));
 
         propertyChangeController = new PropertyChangeController();
         uiDefaults.addPropertyChangeListener(propertyChangeController);
@@ -260,7 +260,7 @@
         assertEquals("3v", uid.getString("3"));
 
         uiDefaults.put("key", null);
-        assertEquals(null, uiDefaults.get("key"));
+        assertNull(uiDefaults.get("key"));
     }
 
     public void testErrorGetUI() {
@@ -297,7 +297,7 @@
 
         String bundleName = "javax.swing.TestBundle";
 
-        assertEquals(null, uiDefaults.get("OptionPane.titleText"));
+        assertNull(uiDefaults.get("OptionPane.titleText"));
         uiDefaults.addResourceBundle(bundleName);
         assertEquals(ResourceBundle.getBundle(bundleName, Locale.GERMAN).getString("OptionPane.titleText"),
                 uiDefaults.getString("OptionPane.titleText", Locale.GERMAN));



Mime
View raw message