Author: ljelinko
Date: 2012-08-22 10:01:40 -0400 (Wed, 22 Aug 2012)
New Revision: 43164
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
Log:
Added special treatment for Windows.
Modified:
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java
===================================================================
---
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-22
13:39:59 UTC (rev 43163)
+++
branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/MarkFileAsDeployableTask.java 2012-08-22
14:01:40 UTC (rev 43164)
@@ -28,12 +28,18 @@
// for the confirmation dialog select OK (the dialog is native and normal swtbot
functions do now work)
try {
Robot robot = new Robot();
- robot.keyPress(KeyEvent.VK_RIGHT);
- robot.keyRelease(KeyEvent.VK_RIGHT);
+ if (!isWindowsOS()){
+ robot.keyPress(KeyEvent.VK_RIGHT);
+ robot.keyRelease(KeyEvent.VK_RIGHT);
+ }
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
} catch (AWTException e) {
throw new IllegalStateException("Cannot create instance of " + Robot.class +
" in order to close native dialog", e);
}
}
+
+ private boolean isWindowsOS(){
+ return
System.getProperty("os.name").toLowerCase().contains("win");
+ }
}