[jbosstools-commits] JBoss Tools SVN: r41771 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test: wizard and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Jun 7 11:30:55 EDT 2012


Author: jjankovi
Date: 2012-06-07 11:30:53 -0400 (Thu, 07 Jun 2012)
New Revision: 41771

Removed:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/NodeContextUtil.java
Modified:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java
Log:
replacing NodeContextUtil class with ContextHelper from ui.bot.ext

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java	2012-06-07 13:45:32 UTC (rev 41770)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java	2012-06-07 15:30:53 UTC (rev 41771)
@@ -156,8 +156,11 @@
 		SWTBotTree tree = projectExplorer.bot().tree();
 		SWTBotTreeItem item = tree.getTreeItem(projectName);
 		item.expand();
-		NodeContextUtil.nodeContextMenu(tree, item, CDIConstants.CONFIGURE, 
-				CDIConstants.ADD_CDI_SUPPORT).click();
+		ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+		SWTBotMenu menu = new SWTBotMenu(
+				ContextMenuHelper.getContextMenu(
+				tree, IDELabel.Menu.PACKAGE_EXPLORER_CONFIGURE, false));
+		menu.menu(CDIConstants.ADD_CDI_SUPPORT).click();
 		bot.button(IDELabel.Button.OK).click();
 		bot.waitWhile(new ProgressInformationShellIsActiveCondition(), TaskDuration.LONG.getTimeout());
 	}

Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/NodeContextUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/NodeContextUtil.java	2012-06-07 13:45:32 UTC (rev 41770)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/NodeContextUtil.java	2012-06-07 15:30:53 UTC (rev 41771)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.cdi.bot.test.uiutils;
-
-import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
-import org.eclipse.swtbot.swt.finder.results.Result;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-
-public class NodeContextUtil {
-	
-	private NodeContextUtil() {
-		throw new AssertionError();
-	}
-	
-	public static SWTBotMenu nodeContextMenu(final SWTBotTree tree,
-			SWTBotTreeItem item, final String... menu) {
-		assert menu.length > 0;
-		ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
-		return UIThreadRunnable.syncExec(new Result<SWTBotMenu>() {
-
-			public SWTBotMenu run() {
-				SWTBotMenu m = new SWTBotMenu(ContextMenuHelper.getContextMenu(
-						tree, menu[0], false));
-				for (int i = 1; i < menu.length; i++) {
-					m = m.menu(menu[i]);
-				}
-				return m;
-			}
-		});
-	}	
-	
-}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java	2012-06-07 13:45:32 UTC (rev 41770)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java	2012-06-07 15:30:53 UTC (rev 41771)
@@ -10,6 +10,8 @@
  ******************************************************************************/
 package org.jboss.tools.cdi.bot.test.uiutils;
 
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.jboss.tools.cdi.bot.test.CDIConstants;
 import org.jboss.tools.cdi.bot.test.CDITestBase;
@@ -18,6 +20,7 @@
 import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
 import org.jboss.tools.ui.bot.ext.SWTJBTExt;
 import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
 import org.jboss.tools.ui.bot.ext.types.IDELabel;
 import org.jboss.tools.ui.bot.ext.types.ViewType;
 import org.jboss.tools.ui.bot.ext.view.ProblemsView;
@@ -45,7 +48,12 @@
 	 * @param item
 	 */
 	public void openQuickFix(SWTBotTreeItem item) {
-		NodeContextUtil.nodeContextMenu(bot.tree(), item, CDIConstants.QUICK_FIX).click();
+		SWTBotTree problemsTree = bot.viewByTitle(
+				ViewType.PROBLEMS.getViewLabel()).bot().tree();
+		ContextMenuHelper.prepareTreeItemForContextMenu(
+				problemsTree, item);
+		new SWTBotMenu(ContextMenuHelper.getContextMenu(problemsTree, 
+				CDIConstants.QUICK_FIX, false)).click();
 	}
 	
 	/**

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java	2012-06-07 13:45:32 UTC (rev 41770)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/PerspectiveTest.java	2012-06-07 15:30:53 UTC (rev 41771)
@@ -13,14 +13,16 @@
 
 
 import org.eclipse.swt.SWTException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
 import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
 import org.jboss.tools.cdi.bot.test.CDITestBase;
 import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
-import org.jboss.tools.cdi.bot.test.uiutils.NodeContextUtil;
 import org.jboss.tools.ui.bot.ext.Timing;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
 import org.jboss.tools.ui.bot.ext.types.PerspectiveType;
 import org.junit.Test;
 import org.junit.runners.Suite.SuiteClasses;
@@ -98,9 +100,13 @@
 		item.expand();
 		boolean artifactWizardExists = true;
 		try {
-			NodeContextUtil.nodeContextMenu(tree, item, "New", wizardType.getAnnotationType()).click();
+			ContextMenuHelper.prepareTreeItemForContextMenu(tree, item);
+			SWTBotMenu menu = new SWTBotMenu(
+					ContextMenuHelper.getContextMenu(
+					tree, IDELabel.Menu.NEW, false));
+			menu.menu(wizardType.getAnnotationType()).click();
 			bot.sleep(Timing.time500MS());
-			bot.activeShell().bot().button("Cancel").click();
+			bot.activeShell().bot().button(IDELabel.Button.CANCEL).click();
 	
 		} catch (SWTException exc) {			
 			artifactWizardExists = false;



More information about the jbosstools-commits mailing list