jdk/test/java/awt/Menu/NullMenuLabelTest/NullMenuLabelTest.java
author mfang
Wed, 17 Aug 2011 14:18:26 -0700
changeset 10294 8fcdae2a7ec7
parent 6485 5e6b2f2666ae
child 21596 0e3a39f29dbc
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6485
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     1
/*      @test 1.5 98/07/23
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     2
        @bug 4064202 4253466
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     3
        @summary Test for Win32 NPE when MenuItem with null label added.
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     4
        @author fred.ecks
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     5
        @run main/othervm NullMenuLabelTest
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     6
*/
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     7
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     8
import java.awt.*;
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
     9
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    10
public class NullMenuLabelTest {
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    11
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    12
    public static void main(String[] args) {
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    13
        Frame frame = new Frame("Test Frame");
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    14
        frame.pack();
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    15
        frame.setVisible(true);
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    16
        MenuBar menuBar = new MenuBar();
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    17
        frame.setMenuBar(menuBar);
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    18
        Menu menu = new Menu(null);
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    19
        menuBar.add(menu);
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    20
        menu.add(new MenuItem(null));
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    21
        // If we got this far, the test succeeded
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    22
        frame.setVisible(false);
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    23
        frame.dispose();
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    24
    }
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    25
5e6b2f2666ae 6480547: REG: bug 4118621 which got Integrated in 1.1.8 fails in mustang from b25 onwards.
dav
parents:
diff changeset
    26
} // class NullMenuLabelTest