< prev index next >

test/jdk/java/awt/Desktop/8064934/bug8064934.java

Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke

*** 25,52 **** * @bug 8064934 * @key headful * @requires (os.family == "windows") * @summary Incorrect Exception message from java.awt.Desktop.open() * @author Dmitry Markov ! * @library ../../../../lib/testlibrary * @modules java.desktop/sun.awt ! * @build jdk.testlibrary.OSInfo * @run main bug8064934 */ ! import jdk.testlibrary.OSInfo; import java.awt.*; import java.io.File; import java.io.IOException; import java.security.AccessController; public class bug8064934 { private static final String NO_ASSOCIATION_ERROR_MESSAGE = "Error message: No application is associated with" + " the specified file for this operation."; public static void main(String[] args) { // This test is intended only for Windows ! if (AccessController.doPrivileged(OSInfo.getOSTypeAction()) != OSInfo.OSType.WINDOWS) { System.out.println("The test is for Windows platform only"); return; } // Test whether Desktop is supported of not --- 25,53 ---- * @bug 8064934 * @key headful * @requires (os.family == "windows") * @summary Incorrect Exception message from java.awt.Desktop.open() * @author Dmitry Markov ! * @library /test/lib * @modules java.desktop/sun.awt ! * @build jdk.test.lib.Platform * @run main bug8064934 */ ! import jdk.test.lib.Platform; import java.awt.*; import java.io.File; import java.io.IOException; import java.security.AccessController; + import java.security.PrivilegedAction; public class bug8064934 { private static final String NO_ASSOCIATION_ERROR_MESSAGE = "Error message: No application is associated with" + " the specified file for this operation."; public static void main(String[] args) { // This test is intended only for Windows ! if (!AccessController.doPrivileged((PrivilegedAction<Boolean>) Platform::isWindows)) { System.out.println("The test is for Windows platform only"); return; } // Test whether Desktop is supported of not
< prev index next >