changeset 6095:1c16f069e9e0

8014721: TEST_BUG: java/awt/TrayIcon/DragEventSource/DragEventSource.java fails with java.lang.UnsupportedOperationException Reviewed-by: serb, anthony
author kshefov
date Wed, 22 May 2013 13:18:35 +0400
parents cbdea5da546b
children 7376234e354a
files test/java/awt/TrayIcon/DragEventSource/DragEventSource.java
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Mon May 20 18:21:33 2013 +0400
+++ b/test/java/awt/TrayIcon/DragEventSource/DragEventSource.java	Wed May 22 13:18:35 2013 +0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2013, 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
@@ -64,6 +64,21 @@
     }
 
     private static void init() {
+
+        boolean isSupported = tray.isSupported();
+        System.out.println("is SysTray Supported: " + isSupported);
+
+        if (!isSupported) {
+            String[] instructions =
+            {
+              "The test cannot be run because SystemTray is not supported.",
+              "Simply press PASS button."
+            };
+            Sysout.createDialog( );
+            Sysout.printInstructions( instructions );
+            return;
+        }
+
         String[] instructions =
         {
             "Use see a Frame with a button in it.",
@@ -79,8 +94,8 @@
 
         frame.setLayout(new FlowLayout());
         tray = SystemTray.getSystemTray();
-        boolean isSupported = tray.isSupported();
-        System.out.println("is SysTray Supported: " + isSupported);
+
+
         TrayIcon icons[] = tray.getTrayIcons();
         System.out.println(icons.length);