# HG changeset patch # User luchsh # Date 1411626783 -28800 # Node ID edb2e379334694246fd985c3130349d8f576b1c9 # Parent 57d7b3b1463b902e02d1656046b7561e9fade3f1 8058930: GraphicsEnvironment.getHeadlessProperty() does not work for AIX platform Reviewed-by: serb diff -r 57d7b3b1463b -r edb2e3793346 jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java --- a/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java Wed Sep 24 15:36:11 2014 +0400 +++ b/jdk/src/java.desktop/share/classes/java/awt/GraphicsEnvironment.java Thu Sep 25 14:33:03 2014 +0800 @@ -182,7 +182,8 @@ "SunOS".equals(osName) || "FreeBSD".equals(osName) || "NetBSD".equals(osName) || - "OpenBSD".equals(osName)) && + "OpenBSD".equals(osName) || + "AIX".equals(osName)) && (System.getenv("DISPLAY") == null)); } } diff -r 57d7b3b1463b -r edb2e3793346 jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.java Thu Sep 25 14:33:03 2014 +0800 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Portions Copyright (c) 2014 IBM Corporation + */ + +public class TestDetectHeadless { + public static void main(String[] args) throws Exception { + Class.forName("javax.swing.plaf.basic.BasicInternalFrameTitlePane"); + } +} diff -r 57d7b3b1463b -r edb2e3793346 jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/test/java/awt/GraphicsEnvironment/TestDetectHeadless/TestDetectHeadless.sh Thu Sep 25 14:33:03 2014 +0800 @@ -0,0 +1,47 @@ +#!/bin/sh + +# +# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# +# Portions Copyright (c) 2014 IBM Corporation +# + +# @test +# @bug 8058930 +# @summary java.awt.GraphicsEnvironment.getHeadlessProperty() does not work for AIX +# +# @build TestDetectHeadless +# @run shell TestDetectHeadless.sh + +OS=`uname -s` +case "$OS" in + Windows* | CYGWIN* ) + echo "Passed"; exit 0 ;; + * ) unset DISPLAY ;; +esac + +${TESTJAVA}/bin/java ${TESTVMOPTS} \ + -cp ${TESTCLASSES} TestDetectHeadless + +exit $?