You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrey Pavlenko (JIRA)" <ji...@apache.org> on 2006/12/14 13:45:27 UTC
[jira] Commented: (HARMONY-2458) [classlib][awt]
java.awt.Component.addNotify() throws different exceptions on RI and
Harmony
[ http://issues.apache.org/jira/browse/HARMONY-2458?page=comments#action_12458458 ]
Andrey Pavlenko commented on HARMONY-2458:
------------------------------------------
I think this is a non-bug difference. Moreover, according to the specification: "This method is called internally by the toolkit and should not be called directly by programs."
> [classlib][awt] java.awt.Component.addNotify() throws different exceptions on RI and Harmony
> --------------------------------------------------------------------------------------------
>
> Key: HARMONY-2458
> URL: http://issues.apache.org/jira/browse/HARMONY-2458
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Pavel Dolgov
> Priority: Minor
>
> Test case:
> ----------------
> import java.awt.Button;
> import java.awt.Canvas;
> import java.awt.Checkbox;
> import java.awt.Label;
> import java.awt.Menu;
> import java.awt.MenuBar;
> import java.awt.MenuItem;
> import java.awt.Panel;
> import java.awt.PopupMenu;
> import java.awt.ScrollPane;
> import java.awt.Scrollbar;
> import junit.framework.TestCase;
> public class TheTest extends TestCase {
> public static void main(String args[]) {
> junit.textui.TestRunner.run(TheTest.class);
> }
> public void testcase1() {
> MenuBar cmp = new MenuBar();
> cmp.addNotify();
> }
> public void testcase2() {
> Menu cmp = new Menu("0", false);
> try {
> cmp.addNotify();
> fail("IllegalArgumentException expected");
> } catch (IllegalArgumentException e) {
> }
> }
> public void testcase3() {
> PopupMenu cmp = new PopupMenu();
> try {
> cmp.addNotify();
> fail("IllegalArgumentException expected");
> } catch (IllegalArgumentException e) {
> }
> }
> public void testcase4() {
> PopupMenu cmp = new PopupMenu("j");
> try {
> cmp.addNotify();
> fail("IllegalArgumentException expected");
> } catch (IllegalArgumentException e) {
> }
> }
> public void testcase5() {
> Label cmp = new Label();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase6() {
> Button cmp = new Button("a");
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase7() {
> Checkbox cmp = new Checkbox();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase8() {
> ScrollPane cmp = new ScrollPane();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase9() {
> Scrollbar cmp = new Scrollbar();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase10() {
> Panel cmp = new Panel();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase11() {
> MenuItem cmp = new MenuItem();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> public void testcase12() {
> Canvas cmp = new Canvas();
> try {
> cmp.addNotify();
> fail("NPE expected");
> } catch (NullPointerException e) {
> }
> }
> }
> RI output:
> --------------------
> ............
> Time: 0,84
> OK (12 tests)
> Harmony output:
> --------------------
> .E.E.E.E.......F.
> Time: 0.734
> There were 4 errors:
> 1) testcase1(TheTest)java.lang.NullPointerException
> at java.awt.MenuBar$State.calculate(MenuBar.java:74)
> at java.awt.MenuBar.addNotify(MenuBar.java:213)
> at TheTest.testcase1(TheTest.java:22)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at TheTest.main(TheTest.java:18)
> 2) testcase2(TheTest)java.lang.NullPointerException
> at java.awt.Toolkit.createPopupNativeWindow(Toolkit.java:1139)
> at java.awt.PopupBox.addNotify(PopupBox.java:49)
> at java.awt.Menu.addNotify(Menu.java:249)
> at TheTest.testcase2(TheTest.java:27)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at TheTest.main(TheTest.java:18)
> 3) testcase3(TheTest)java.lang.NullPointerException
> at java.awt.Toolkit.createPopupNativeWindow(Toolkit.java:1139)
> at java.awt.PopupBox.addNotify(PopupBox.java:49)
> at java.awt.Menu.addNotify(Menu.java:249)
> at java.awt.PopupMenu.addNotify(PopupMenu.java:66)
> at TheTest.testcase3(TheTest.java:36)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at TheTest.main(TheTest.java:18)
> 4) testcase4(TheTest)java.lang.NullPointerException
> at java.awt.Toolkit.createPopupNativeWindow(Toolkit.java:1139)
> at java.awt.PopupBox.addNotify(PopupBox.java:49)
> at java.awt.Menu.addNotify(Menu.java:249)
> at java.awt.PopupMenu.addNotify(PopupMenu.java:66)
> at TheTest.testcase4(TheTest.java:45)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at TheTest.main(TheTest.java:18)
> There was 1 failure:
> 1) testcase11(TheTest)junit.framework.AssertionFailedError: NPE expected
> at TheTest.testcase11(TheTest.java:111)
> at java.lang.reflect.VMReflection.invokeMethod(Native Method)
> at TheTest.main(TheTest.java:18)
> FAILURES!!!
> Tests run: 12, Failures: 1, Errors: 4
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira