563N/A/*
2362N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
563N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
563N/A *
563N/A * This code is free software; you can redistribute it and/or modify it
563N/A * under the terms of the GNU General Public License version 2 only, as
563N/A * published by the Free Software Foundation.
563N/A *
563N/A * This code is distributed in the hope that it will be useful, but WITHOUT
563N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
563N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
563N/A * version 2 for more details (a copy is included in the LICENSE file that
563N/A * accompanied this code).
563N/A *
563N/A * You should have received a copy of the GNU General Public License version
563N/A * 2 along with this work; if not, write to the Free Software Foundation,
563N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
563N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
563N/A */
563N/A
563N/A/*
563N/A @test
563N/A @bug 6737722
563N/A @summary no tray support in headless mode
563N/A @author dmitry.cherepanov: area=awt.headless
563N/A @run main HeadlessTray
563N/A*/
563N/A
563N/Aimport java.awt.*;
563N/A
563N/Apublic class HeadlessTray
563N/A{
563N/A public static void main (String args[]) {
563N/A
563N/A System.setProperty("java.awt.headless", "true");
563N/A
563N/A // We expect the method returns false and no exception thrown
563N/A boolean isSupported = SystemTray.isSupported();
563N/A
563N/A if (isSupported) {
563N/A throw new RuntimeException("Tray shouldn't be supported in headless mode ");
563N/A }
563N/A
563N/A }
563N/A
563N/A}