--- old/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java 2015-08-06 06:20:48.622877171 -0700 +++ new/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java 2015-08-06 06:20:48.420866973 -0700 @@ -25,15 +25,15 @@ * @test * @bug 8007267 * @summary [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working + * @requires (os.family == "mac") * @author leonid.romanov@oracle.com - * @modules java.desktop/sun.awt + * @modules java.desktop/com.apple.eawt * @run main DefaultMenuBarTest */ import java.awt.*; import java.awt.event.*; import javax.swing.*; -import sun.awt.*; import java.lang.reflect.Method; @@ -42,7 +42,7 @@ static volatile int listenerCallCounter = 0; public static void main(String[] args) throws Exception { - if (sun.awt.OSInfo.getOSType() != sun.awt.OSInfo.OSType.MACOSX) { + if (!System.getProperty("os.name").contains("OS X")) { System.out.println("This test is for MacOS only. Automatically passed on other platforms."); return; } @@ -54,7 +54,6 @@ } }); - SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); Robot robot = new Robot(); robot.setAutoDelay(100); @@ -63,7 +62,7 @@ robot.keyRelease(ks.getKeyCode()); robot.keyRelease(KeyEvent.VK_META); - toolkit.realSync(); + robot.waitForIdle(); if (listenerCallCounter != 1) { throw new Exception("Test failed: ActionListener either wasn't called or was called more than once");