Author: jjankovi
Date: 2011-11-23 04:22:17 -0500 (Wed, 23 Nov 2011)
New Revision: 36562
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/jsf/JSFTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/StereotypeValidationQuickFixTest.java
Log:
New QuickFix Dialog Wizard + editing quickfixbase to use the new wizard
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/jsf/JSFTestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/jsf/JSFTestBase.java 2011-11-23
07:10:31 UTC (rev 36561)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/jsf/JSFTestBase.java 2011-11-23
09:22:17 UTC (rev 36562)
@@ -45,7 +45,7 @@
new NewJSFProjectWizard().run().
setName(getProjectName()).
setEnvironment(env).
- setJSFTemplate(JSFTemplate.BLANK).finish();
+ setJSFTemplate(JSFTemplate.KICKSTART).finish();
util.waitForNonIgnoredJobs();
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java 2011-11-23
07:10:31 UTC (rev 36561)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java 2011-11-23
09:22:17 UTC (rev 36562)
@@ -14,6 +14,7 @@
import java.util.ArrayList;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.jboss.tools.cdi.bot.test.annotations.CDIAnnotationsType;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
@@ -26,6 +27,7 @@
import org.jboss.tools.cdi.bot.test.quickfix.validators.ScopeValidationProvider;
import org.jboss.tools.cdi.bot.test.quickfix.validators.StereotypeValidationProvider;
import org.jboss.tools.cdi.bot.test.uiutils.QuickFixHelper;
+import org.jboss.tools.cdi.bot.test.uiutils.wizards.QuickFixDialogWizard;
import org.jboss.tools.ui.bot.ext.Timing;
import org.junit.BeforeClass;
@@ -126,10 +128,14 @@
*/
private void resolveQuickFix(SWTBotTreeItem ti) {
openQuickFix(ti);
- bot.table(0).click(0, 0);
- bot.table(1).getTableItem(0).check();
- bot.clickButton("Finish");
- bot.sleep(Timing.time1S());
+
+ QuickFixDialogWizard qfWizard = new QuickFixDialogWizard();
+
+ SWTBotTableItem firstFix = qfWizard.getFixes()[0];
+ SWTBotTableItem firstResource = qfWizard.getResources()[0];
+
+ qfWizard.setFix(firstFix).setResource(firstResource).finish();
+
util.waitForNonIgnoredJobs();
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/StereotypeValidationQuickFixTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/StereotypeValidationQuickFixTest.java 2011-11-23
07:10:31 UTC (rev 36561)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/StereotypeValidationQuickFixTest.java 2011-11-23
09:22:17 UTC (rev 36562)
@@ -89,7 +89,7 @@
checkQuickFix(CDIAnnotationsType.NAMED, CDIWizardType.STEREOTYPE);
}
-
+
//
https://issues.jboss.org/browse/JBIDE-7640
@Test
public void testTypedAnnotation() {
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java 2011-11-23
09:22:17 UTC (rev 36562)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.wizards;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
+
+public class QuickFixDialogWizard extends Wizard {
+
+ public QuickFixDialogWizard() {
+ super(new SWTBot().activeShell().widget);
+ assert ("Quick Fix").equals(getText());
+ }
+
+ public QuickFixDialogWizard setFix(SWTBotTableItem fix) {
+ fix.select();
+ return this;
+ }
+
+ public SWTBotTableItem[] getFixes() {
+ SWTBotTable fixTable = bot().table(0);
+ SWTBotTableItem[] fixes = new SWTBotTableItem[fixTable.rowCount()];
+ for (int i = 0; i < fixTable.rowCount(); i++) {
+ fixes[i] = fixTable.getTableItem(i);
+ }
+ return fixes;
+ }
+
+ public QuickFixDialogWizard setResource(SWTBotTableItem resource) {
+ resource.check();
+ return this;
+ }
+
+ public SWTBotTableItem[] getResources() {
+ SWTBotTable resourceTable = bot().table(1);
+ SWTBotTableItem[] resources = new SWTBotTableItem[resourceTable.rowCount()];
+ for (int i = 0; i < resourceTable.rowCount(); i++) {
+ resources[i] = resourceTable.getTableItem(i);
+ }
+ return resources;
+ }
+
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/SpecifyBeanDialogWizard.java 2011-11-23
09:22:17 UTC (rev 36562)
@@ -0,0 +1,23 @@
+package org.jboss.tools.cdi.bot.test.uiutils.wizards;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+public class SpecifyBeanDialogWizard extends Wizard {
+
+ public SpecifyBeanDialogWizard() {
+ super(new SWTBot().activeShell().widget);
+ assert ("Specify CDI Bean for the Injection Point").equals(getText());
+ }
+
+
+ /**
+ * not finished yet, what should be implemented:
+ *
+ * 1. gets all qualifier
+ * 2. select proper qualifier
+ * 3. add qualifier
+ * 4. remove qualifier
+ * 5. create a new qualifier
+ *
+ */
+}