[jbosstools-commits] JBoss Tools SVN: r43238 - branches/jbosstools-3.3.x/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Aug 27 02:59:53 EDT 2012


Author: ljelinko
Date: 2012-08-27 02:59:53 -0400 (Mon, 27 Aug 2012)
New Revision: 43238

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 logging

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-27 06:37:18 UTC (rev 43237)
+++ 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-27 06:59:53 UTC (rev 43238)
@@ -6,6 +6,7 @@
 import java.awt.Robot;
 import java.awt.event.KeyEvent;
 
+import org.apache.log4j.Logger;
 import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
 import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
 import org.jboss.tools.portlet.ui.bot.entity.WorkspaceFile;
@@ -21,6 +22,8 @@
  */
 public class MarkFileAsDeployableTask extends AbstractSWTTask {
 
+	private static final Logger log = Logger.getLogger(MarkFileAsDeployableTask.class);
+	
 	private WorkspaceFile workspaceFile;
 
 	public MarkFileAsDeployableTask(WorkspaceFile file) {
@@ -29,16 +32,20 @@
 
 	@Override
 	public void perform() {
+		log.info("Marking " + workspaceFile.getFileName() + " as deployable");
 		performInnerTask(new FileContextMenuSelectingTask(workspaceFile, "Mark as Deployable"));
 
+		log.info("Waiting for confirmation shell to appear");
 		SWTBotFactory.getBot().waitUntil(shellIsActive("Really mark these resources as deployable?"));
 
 		// for the confirmation dialog select OK (the dialog is native and normal swtbot functions do now work)
 		try {
 			Robot robot = new Robot();
 			if (!isWindowsOS()){
+				log.info("Non Windows OS");
 				KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR, Keystrokes.LF);
 			} else {
+				log.info("Windows OS");
 				robot.keyPress(KeyEvent.VK_RIGHT);
 				robot.keyRelease(KeyEvent.VK_RIGHT);
 				robot.keyPress(KeyEvent.VK_LEFT);
@@ -49,6 +56,9 @@
 		} catch (AWTException e) {
 			throw new IllegalStateException("Cannot create instance of " + Robot.class + " in order to close native dialog", e);
 		}
+		
+		log.info("Waiting for confirmation shell to disappear");
+		SWTBotFactory.getBot().waitUntil(shellIsActive("Really mark these resources as deployable?"));
 	}
 
 	private boolean isWindowsOS(){



More information about the jbosstools-commits mailing list