--- old/test/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 2015-10-13 14:01:50.112252153 +0300 +++ new/test/java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 2015-10-13 14:01:50.012252156 +0300 @@ -51,6 +51,7 @@ boolean mouseReleased = false; boolean mouseClicked = false; boolean mouseMoved = false; + static boolean isOEL7; static final int[] buttonTypes = { InputEvent.BUTTON1_MASK, @@ -69,6 +70,9 @@ System.out.println("SystemTray not supported on the platform under test. " + "Marking the test passed"); } else { + isOEL7 = System.getProperty("os.name").toLowerCase() + .contains("linux") && System.getProperty("os.version") + .toLowerCase().contains("el7"); new FunctionalityCheck().doTest(); } } @@ -188,31 +192,44 @@ Point iconPosition = SystemTrayIconHelper.getTrayIconLocation(icon); if (iconPosition == null) throw new RuntimeException("Unable to find the icon location!"); + if (isOEL7) { + // close tray + robot.mouseMove(100,100); + robot.click(InputEvent.BUTTON1_MASK); + robot.waitForIdle(2000); + } robot.mouseMove(iconPosition.x, iconPosition.y); - robot.waitForIdle(2000); - - SystemTrayIconHelper.doubleClick(robot); + robot.waitForIdle(); + if(!isOEL7) { + SystemTrayIconHelper.doubleClick(robot); - if (! actionPerformed) { - synchronized (actionLock) { - try { - actionLock.wait(3000); - } catch (Exception e) { + if (!actionPerformed) { + synchronized (actionLock) { + try { + actionLock.wait(3000); + } catch (Exception e) { + } } } + if (!actionPerformed) + throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is double clicked"); } - if (! actionPerformed) - throw new RuntimeException("FAIL: ActionEvent not triggered when TrayIcon is double clicked"); for (int i = 0; i < buttonTypes.length; i++) { mousePressed = false; - robot.mousePress(buttonTypes[i]); + if(isOEL7) { + SystemTrayIconHelper.openTrayIfNeeded(robot); + robot.mouseMove(iconPosition.x, iconPosition.y); + robot.click(buttonTypes[i]); + } else { + robot.mousePress(buttonTypes[i]); + } if (! mousePressed) { synchronized (pressLock) { try { - pressLock.wait(3000); + pressLock.wait(6000); } catch (Exception e) { } } @@ -224,12 +241,17 @@ mouseReleased = false; mouseClicked = false; - robot.mouseRelease(buttonTypes[i]); - + if(isOEL7) { + SystemTrayIconHelper.openTrayIfNeeded(robot); + robot.mouseMove(iconPosition.x, iconPosition.y); + robot.click(buttonTypes[i]); + } else { + robot.mouseRelease(buttonTypes[i]); + } if (! mouseReleased) { synchronized (releaseLock) { try { - releaseLock.wait(3000); + releaseLock.wait(6000); } catch (Exception e) { } } @@ -242,7 +264,7 @@ if (! mouseClicked) { synchronized (clickLock) { try { - clickLock.wait(3000); + clickLock.wait(6000); } catch (Exception e) { } } @@ -251,13 +273,14 @@ throw new RuntimeException("FAIL: mouseClicked not triggered when " + buttonNames[i] + " pressed & released"); } - - mouseMoved = false; - robot.mouseMove(iconPosition.x + 100, iconPosition.y); - robot.glide(iconPosition.x, iconPosition.y); - - if (! mouseMoved) - if (! SystemTrayIconHelper.skip(0) ) - throw new RuntimeException("FAIL: mouseMoved not triggered even when mouse moved over the icon"); + if(!isOEL7) { + mouseMoved = false; + robot.mouseMove(iconPosition.x + 100, iconPosition.y); + robot.glide(iconPosition.x, iconPosition.y); + + if (!mouseMoved) + if (!SystemTrayIconHelper.skip(0)) + throw new RuntimeException("FAIL: mouseMoved not triggered even when mouse moved over the icon"); + } } }