Index: awt/src/test/api/java/common/java/awt/ContainerRTest.java =================================================================== --- awt/src/test/api/java/common/java/awt/ContainerRTest.java (revision 485572) +++ awt/src/test/api/java/common/java/awt/ContainerRTest.java (working copy) @@ -26,7 +26,20 @@ public class ContainerRTest extends TestCase { + public static void main(final String[] args) { + junit.textui.TestRunner.run(ContainerRTest.class); + } + public final void testRemoveComponent() { + // Regression test for HARMONY-1476 + try { + new Container().remove((Component) null); + fail("NPE was not thrown"); + } catch (NullPointerException ex) { + // passed + } + } + public final void testSetFocusTraversalKeys() { try { Button btn = new Button(); @@ -53,17 +66,4 @@ assertTrue(c1.isDisplayable()); assertTrue(c2.isDisplayable()); } - -// public final void testRemoveComponent() { -// Button b = new Button(); -// boolean npeThrown = false; -// Container c = new Container(); -// c.remove(b); // no exception is thrown -// try { -// c.remove(b = null); -// } catch (NullPointerException npe) { -// npeThrown = true; -// } -// assertTrue("remove(null) throws NPE", npeThrown); -// } }