Author: ljelinko
Date: 2011-11-24 03:15:15 -0500 (Thu, 24 Nov 2011)
New Revision: 36592
Added:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/AbstractSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/CompositeSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTBotAware.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/console/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageDefaultsFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectCreationTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/
Removed:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/console/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/server/
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/console/ConsoleClearingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/AssociatedPerspectiveDialogClosingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogCloseTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogOpenTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/AbstractFacetTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/FacetsSelectionTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossJSFPortletCapabilitiesWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletCreationTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletWizardPageFillingTask.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/RunJavaPortletOnServer.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
Log:
changed package of tasks
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/AbstractSWTTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/AbstractSWTTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/AbstractSWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,29 @@
+package org.jboss.tools.portlet.ui.bot.task;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+/**
+ * Common ancestor of all UI tasks.
+ *
+ * @author ljelinko
+ *
+ */
+public abstract class AbstractSWTTask implements SWTTask, SWTBotAware {
+
+ private SWTBot bot;
+
+ protected void performInnerTask(SWTTask task){
+ if (task instanceof SWTBotAware){
+ ((SWTBotAware) task).setBot(getBot());
+ }
+ task.perform();
+ }
+
+ public SWTBot getBot() {
+ return bot;
+ }
+
+ public void setBot(SWTBot bot) {
+ this.bot = bot;
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/CompositeSWTTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/CompositeSWTTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/CompositeSWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,46 @@
+package org.jboss.tools.portlet.ui.bot.task;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Performs a set of tasks and enables subclasses to define actions before and after
+ * each of the tasks is performed.
+ *
+ * @author ljelinko
+ *
+ */
+public class CompositeSWTTask<T extends SWTTask> extends AbstractSWTTask {
+
+ private List<T> tasks;
+
+ public CompositeSWTTask() {
+ super();
+ tasks = new ArrayList<T>();
+ }
+
+ @Override
+ public void perform() {
+ for (T task : tasks){
+ beforeTask(task);
+ performInnerTask(task);
+ afterTask(task);
+ }
+ }
+
+ protected void beforeTask(T task) {
+ // hook up method
+ }
+
+ protected void afterTask(T task) {
+ // hook up method
+ }
+
+ public void setTasks(List<T> tasks) {
+ this.tasks = tasks;
+ }
+
+ public List<T> getTasks() {
+ return tasks;
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTBotAware.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTBotAware.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTBotAware.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.task;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+
+/**
+ * Marking that the class should be aware of SWT bot.
+ *
+ * @author ljelinko
+ *
+ */
+public interface SWTBotAware {
+
+ void setBot(SWTBot bot);
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/SWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,13 @@
+package org.jboss.tools.portlet.ui.bot.task;
+
+/**
+ * Encapsulates all the information needed to perform a task on the UI.
+ *
+ * @author ljelinko
+ *
+ */
+public interface SWTTask {
+
+ void perform();
+
+}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/console/ConsoleClearingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/console/ConsoleClearingTask.java 2011-11-22
16:43:35 UTC (rev 36535)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/console/ConsoleClearingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,8 +1,8 @@
-package org.jboss.tools.portlet.ui.bot.test.task.console;
+package org.jboss.tools.portlet.ui.bot.task.console;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotToolbarButton;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/AssociatedPerspectiveDialogClosingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/AssociatedPerspectiveDialogClosingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/AssociatedPerspectiveDialogClosingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,11 +1,11 @@
-package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+package org.jboss.tools.portlet.ui.bot.task.dialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
import org.eclipse.swtbot.swt.finder.results.VoidResult;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
/**
* Checks if there is a dialog asking if the associated perspective
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogCloseTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogCloseTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogCloseTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,6 +1,6 @@
-package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+package org.jboss.tools.portlet.ui.bot.task.dialog;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
public class ProjectPropertyDialogCloseTask extends AbstractSWTTask {
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogOpenTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/dialog/ProjectPropertyDialogOpenTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/dialog/ProjectPropertyDialogOpenTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,6 +1,6 @@
-package org.jboss.tools.portlet.ui.bot.test.task.dialog;
+package org.jboss.tools.portlet.ui.bot.task.dialog;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/AbstractFacetTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/AbstractFacetTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/AbstractFacetTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,4 +1,4 @@
-package org.jboss.tools.portlet.ui.bot.test.task.facet;
+package org.jboss.tools.portlet.ui.bot.task.facet;
import java.util.ArrayList;
import java.util.List;
@@ -8,8 +8,8 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
/**
* Common ancestor for facet handling tasks that can locate the facet node
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/FacetsSelectionTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/facet/FacetsSelectionTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/facet/FacetsSelectionTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,4 +1,4 @@
-package org.jboss.tools.portlet.ui.bot.test.task.facet;
+package org.jboss.tools.portlet.ui.bot.task.facet;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/server/RunninngProjectOnServerTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/server/RunninngProjectOnServerTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,6 +1,6 @@
-package org.jboss.tools.portlet.ui.bot.test.task.server;
+package org.jboss.tools.portlet.ui.bot.task.server;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
import org.jboss.tools.ui.bot.ext.SWTBotFactory;
/**
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardFillingTask.java
(from rev 36569,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardFillingTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,53 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.portlet.ui.bot.task.CompositeSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+
+/**
+ *
+ * Provides the functionality of navigating between wizard pages. The data
+ * should fill every wizard page itself.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardFillingTask extends CompositeSWTTask<WizardPageFillingTask>{
+
+ private List<WizardPageFillingTask> wizardPages;
+
+ public WizardFillingTask() {
+ super();
+ wizardPages = new ArrayList<WizardPageFillingTask>();
+ }
+
+ @Override
+ public void perform() {
+ super.setTasks(wizardPages);
+ super.perform();
+ getBot().button("Finish").click();
+
+ SWTBotFactory.getUtil().waitForAll();
+ }
+
+ public void addWizardPage(WizardPageFillingTask task){
+ wizardPages.add(task);
+ }
+
+ public void addAllWizardPages(List<WizardPageFillingTask> tasks){
+ wizardPages.addAll(tasks);
+ }
+
+ @Override
+ protected void beforeTask(WizardPageFillingTask task) {
+ if (!isFirst(task)){
+ getBot().button("Next >").click();
+ }
+ }
+
+ private boolean isFirst(WizardPageFillingTask task){
+ return getTasks().indexOf(task) == 0;
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardOpeningTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,58 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
+import org.jboss.tools.ui.bot.ext.gen.INewObject;
+
+/**
+ * Opens a specified wizard.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardOpeningTask extends AbstractSWTTask {
+
+ private String category;
+
+ private String name;
+
+ public WizardOpeningTask(String name) {
+ super();
+ this.name = name;
+ }
+
+ /**
+ *
+ * @param name Name of the wizard to open
+ * @param categoryPath path to the wizard (categories separated by '/')
+ */
+ public WizardOpeningTask(String name, String categoryPath) {
+ this(name);
+ this.category = categoryPath;
+ }
+
+ @Override
+ public void perform() {
+ INewObject wizardPath = new INewObject() {
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public List<String> getGroupPath() {
+ if (category == null){
+ return Collections.emptyList();
+ }
+
+ return Arrays.asList(category.split("/"));
+ }
+ };
+ SWTBotFactory.getOpen().newObject(wizardPath);
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageDefaultsFillingTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageDefaultsFillingTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageDefaultsFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,18 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard;
+
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+
+/**
+ * Leaves the defaults on the wizard page.
+ *
+ * @author ljelinko
+ *
+ */
+public class WizardPageDefaultsFillingTask extends AbstractSWTTask implements
+ WizardPageFillingTask {
+
+ @Override
+ public void perform() {
+ // leave defaults
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageFillingTask.java
(from rev 36504,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageFillingTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/WizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,14 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard;
+
+import org.jboss.tools.portlet.ui.bot.task.SWTTask;
+
+/**
+ * Common ancestor for tasks filling in information into the wizard page.
+ * Currently just the marking interface.
+ *
+ * @author ljelinko
+ *
+ */
+public interface WizardPageFillingTask extends SWTTask {
+
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectCreationTask.java
(from rev 36591,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectCreationTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectCreationTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectCreationTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,46 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard.web;
+
+import
org.jboss.tools.portlet.ui.bot.task.dialog.AssociatedPerspectiveDialogClosingTask;
+import org.jboss.tools.portlet.ui.bot.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardOpeningTask;
+
+/**
+ * Creates a new dynamic web project using the wizard.
+ *
+ * @author ljelinko
+ *
+ */
+public class DynamicWebProjectCreationTask extends WizardFillingTask {
+
+ private DynamicWebProjectWizardPageFillingTask firstPage;
+
+ public DynamicWebProjectCreationTask() {
+ super();
+ firstPage = new DynamicWebProjectWizardPageFillingTask();
+ addWizardPage(firstPage);
+ }
+
+ @Override
+ public void perform() {
+ performInnerTask(new WizardOpeningTask("Dynamic Web Project",
"Web"));
+ super.perform();
+ performInnerTask(new AssociatedPerspectiveDialogClosingTask(false));
+ }
+
+ public void setProjectName(String projectName) {
+ firstPage.setProjectName(projectName);
+ }
+
+ public void setWebModuleVersion(String webModuleVersion) {
+ firstPage.setWebModuleVersion(webModuleVersion);
+ }
+
+ public void setServerName(String serverName) {
+ firstPage.setServerName(serverName);
+ }
+
+ public void setSelectFacetsTask(FacetsSelectionTask selectFacetsTask) {
+ firstPage.setSelectFacetsTask(selectFacetsTask);
+ }
+}
Copied:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java
(from rev 36591,
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java)
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java
(rev 0)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/DynamicWebProjectWizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -0,0 +1,57 @@
+package org.jboss.tools.portlet.ui.bot.task.wizard.web;
+
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+
+/**
+ * Fills in the information of the first page of Dynamic Web Project Wizard.
+ * @author ljelinko
+ *
+ */
+public class DynamicWebProjectWizardPageFillingTask extends AbstractSWTTask
+ implements WizardPageFillingTask {
+
+ private String projectName;
+
+ private String webModuleVersion;
+
+ private String serverName;
+
+ private FacetsSelectionTask selectFacetsTask;
+
+ @Override
+ public void perform() {
+ getBot().textWithLabel("Project name:").typeText(projectName);
+
+ if (webModuleVersion != null){
+ getBot().comboBoxInGroup("Dynamic web module
version").setSelection(webModuleVersion);
+ }
+
+ if (serverName != null){
+ getBot().comboBoxInGroup("Target runtime").setSelection(serverName);
+ }
+
+ if (selectFacetsTask != null){
+ getBot().button("Modify...").click();
+ performInnerTask(selectFacetsTask);
+ getBot().button("OK").click();
+ }
+ }
+
+ public void setProjectName(String projectName) {
+ this.projectName = projectName;
+ }
+
+ public void setWebModuleVersion(String webModuleVersion) {
+ this.webModuleVersion = webModuleVersion;
+ }
+
+ public void setServerName(String serverName) {
+ this.serverName = serverName;
+ }
+
+ public void setSelectFacetsTask(FacetsSelectionTask selectFacetsTask) {
+ this.selectFacetsTask = selectFacetsTask;
+ }
+}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossJSFPortletCapabilitiesWizardPageFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossJSFPortletCapabilitiesWizardPageFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossJSFPortletCapabilitiesWizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,7 +1,7 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss;
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
/**
* Fills the JBoss JSF portlet specific wizard page (for selection of
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/JBossPortletCapabilitiesWizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,7 +1,7 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss;
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
/**
* Fills the JBoss portlet specific wizard page (for selection of
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletCreationTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/PortletCreationTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletCreationTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,7 +1,7 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss;
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardFillingTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardOpeningTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardOpeningTask;
/**
* Creates a new portlet using a JBoss wizard.
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletWizardPageFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/web/jboss/PortletWizardPageFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/task/wizard/web/jboss/PortletWizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,7 +1,7 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss;
+package org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
public class PortletWizardPageFillingTask extends AbstractSWTTask implements
WizardPageFillingTask {
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortlet.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -6,9 +6,9 @@
import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.containsNodes;
import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.WorkspaceMatchersFactory.exists;
+import org.jboss.tools.portlet.ui.bot.task.SWTTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.PortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.entity.XMLNode;
-import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.PortletCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.junit.Test;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/CreateJavaPortletProject.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -3,10 +3,10 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageDefaultsFillingTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
-import
org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.test.template.CreatePortletProjectTemplate;
/**
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/RunJavaPortletOnServer.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/RunJavaPortletOnServer.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/core/RunJavaPortletOnServer.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -5,8 +5,8 @@
import static org.hamcrest.Matchers.not;
import static
org.jboss.tools.portlet.ui.bot.test.matcher.factory.DefaultMatchersFactory.inConsoleOutput;
-import org.jboss.tools.portlet.ui.bot.test.task.console.ConsoleClearingTask;
-import org.jboss.tools.portlet.ui.bot.test.task.server.RunninngProjectOnServerTask;
+import org.jboss.tools.portlet.ui.bot.task.console.ConsoleClearingTask;
+import org.jboss.tools.portlet.ui.bot.task.server.RunninngProjectOnServerTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/jsf/CreateJSFPortletProject.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -3,11 +3,11 @@
import java.util.ArrayList;
import java.util.List;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageDefaultsFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossJSFPortletCapabilitiesWizardPageFillingTask;
+import
org.jboss.tools.portlet.ui.bot.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageDefaultsFillingTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
-import
org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.JBossJSFPortletCapabilitiesWizardPageFillingTask;
-import
org.jboss.tools.portlet.ui.bot.test.task.wizard.web.jboss.JBossPortletCapabilitiesWizardPageFillingTask;
import org.jboss.tools.portlet.ui.bot.test.template.CreatePortletProjectTemplate;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/AbstractSWTMatcher.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -2,8 +2,8 @@
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.hamcrest.TypeSafeMatcher;
-import org.jboss.tools.portlet.ui.bot.test.task.SWTBotAware;
-import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
+import org.jboss.tools.portlet.ui.bot.task.SWTBotAware;
+import org.jboss.tools.portlet.ui.bot.task.SWTTask;
/**
* Common ancestor of all SWT based matchers.
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/matcher/workspace/ProjectFacetsMatcher.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -5,11 +5,11 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Description;
+import org.jboss.tools.portlet.ui.bot.task.dialog.ProjectPropertyDialogCloseTask;
+import org.jboss.tools.portlet.ui.bot.task.dialog.ProjectPropertyDialogOpenTask;
+import org.jboss.tools.portlet.ui.bot.task.facet.AbstractFacetTask;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
import org.jboss.tools.portlet.ui.bot.test.matcher.AbstractSWTMatcher;
-import org.jboss.tools.portlet.ui.bot.test.task.dialog.ProjectPropertyDialogCloseTask;
-import org.jboss.tools.portlet.ui.bot.test.task.dialog.ProjectPropertyDialogOpenTask;
-import org.jboss.tools.portlet.ui.bot.test.task.facet.AbstractFacetTask;
/**
* Checks if the project has the specified facets.
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/AbstractSWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,29 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-
-/**
- * Common ancestor of all UI tasks.
- *
- * @author ljelinko
- *
- */
-public abstract class AbstractSWTTask implements SWTTask, SWTBotAware {
-
- private SWTBot bot;
-
- protected void performInnerTask(SWTTask task){
- if (task instanceof SWTBotAware){
- ((SWTBotAware) task).setBot(getBot());
- }
- task.perform();
- }
-
- public SWTBot getBot() {
- return bot;
- }
-
- public void setBot(SWTBot bot) {
- this.bot = bot;
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/CompositeSWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,46 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Performs a set of tasks and enables subclasses to define actions before and after
- * each of the tasks is performed.
- *
- * @author ljelinko
- *
- */
-public class CompositeSWTTask<T extends SWTTask> extends AbstractSWTTask {
-
- private List<T> tasks;
-
- public CompositeSWTTask() {
- super();
- tasks = new ArrayList<T>();
- }
-
- @Override
- public void perform() {
- for (T task : tasks){
- beforeTask(task);
- performInnerTask(task);
- afterTask(task);
- }
- }
-
- protected void beforeTask(T task) {
- // hook up method
- }
-
- protected void afterTask(T task) {
- // hook up method
- }
-
- public void setTasks(List<T> tasks) {
- this.tasks = tasks;
- }
-
- public List<T> getTasks() {
- return tasks;
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTBotAware.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,14 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-
-/**
- * Marking that the class should be aware of SWT bot.
- *
- * @author ljelinko
- *
- */
-public interface SWTBotAware {
-
- void setBot(SWTBot bot);
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/SWTTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,13 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task;
-
-/**
- * Encapsulates all the information needed to perform a task on the UI.
- *
- * @author ljelinko
- *
- */
-public interface SWTTask {
-
- void perform();
-
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,53 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.tools.portlet.ui.bot.test.task.CompositeSWTTask;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-
-/**
- *
- * Provides the functionality of navigating between wizard pages. The data
- * should fill every wizard page itself.
- *
- * @author ljelinko
- *
- */
-public class WizardFillingTask extends CompositeSWTTask<WizardPageFillingTask>{
-
- private List<WizardPageFillingTask> wizardPages;
-
- public WizardFillingTask() {
- super();
- wizardPages = new ArrayList<WizardPageFillingTask>();
- }
-
- @Override
- public void perform() {
- super.setTasks(wizardPages);
- super.perform();
- getBot().button("Finish").click();
-
- SWTBotFactory.getUtil().waitForAll();
- }
-
- public void addWizardPage(WizardPageFillingTask task){
- wizardPages.add(task);
- }
-
- public void addAllWizardPages(List<WizardPageFillingTask> tasks){
- wizardPages.addAll(tasks);
- }
-
- @Override
- protected void beforeTask(WizardPageFillingTask task) {
- if (!isFirst(task)){
- getBot().button("Next >").click();
- }
- }
-
- private boolean isFirst(WizardPageFillingTask task){
- return getTasks().indexOf(task) == 0;
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardOpeningTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,58 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.gen.INewObject;
-
-/**
- * Opens a specified wizard.
- *
- * @author ljelinko
- *
- */
-public class WizardOpeningTask extends AbstractSWTTask {
-
- private String category;
-
- private String name;
-
- public WizardOpeningTask(String name) {
- super();
- this.name = name;
- }
-
- /**
- *
- * @param name Name of the wizard to open
- * @param categoryPath path to the wizard (categories separated by '/')
- */
- public WizardOpeningTask(String name, String categoryPath) {
- this(name);
- this.category = categoryPath;
- }
-
- @Override
- public void perform() {
- INewObject wizardPath = new INewObject() {
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public List<String> getGroupPath() {
- if (category == null){
- return Collections.emptyList();
- }
-
- return Arrays.asList(category.split("/"));
- }
- };
- SWTBotFactory.getOpen().newObject(wizardPath);
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageDefaultsFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,18 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard;
-
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-
-/**
- * Leaves the defaults on the wizard page.
- *
- * @author ljelinko
- *
- */
-public class WizardPageDefaultsFillingTask extends AbstractSWTTask implements
- WizardPageFillingTask {
-
- @Override
- public void perform() {
- // leave defaults
- }
-}
Deleted:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/task/wizard/WizardPageFillingTask.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -1,14 +0,0 @@
-package org.jboss.tools.portlet.ui.bot.test.task.wizard;
-
-import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
-
-/**
- * Common ancestor for tasks filling in information into the wizard page.
- * Currently just the marking interface.
- *
- * @author ljelinko
- *
- */
-public interface WizardPageFillingTask extends SWTTask {
-
-}
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/template/CreatePortletProjectTemplate.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -8,11 +8,11 @@
import java.util.List;
+import org.jboss.tools.portlet.ui.bot.task.AbstractSWTTask;
+import org.jboss.tools.portlet.ui.bot.task.facet.FacetsSelectionTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.WizardPageFillingTask;
+import org.jboss.tools.portlet.ui.bot.task.wizard.web.DynamicWebProjectCreationTask;
import org.jboss.tools.portlet.ui.bot.test.entity.FacetDefinition;
-import org.jboss.tools.portlet.ui.bot.test.task.AbstractSWTTask;
-import org.jboss.tools.portlet.ui.bot.test.task.facet.FacetsSelectionTask;
-import org.jboss.tools.portlet.ui.bot.test.task.wizard.WizardPageFillingTask;
-import
org.jboss.tools.portlet.ui.bot.test.task.wizard.web.DynamicWebProjectCreationTask;
import org.jboss.tools.portlet.ui.bot.test.testcase.SWTTaskBasedTestCase;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
Modified:
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java
===================================================================
---
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-24
07:41:04 UTC (rev 36591)
+++
trunk/portlet/tests/org.jboss.tools.portlet.ui.bot.test/src/org/jboss/tools/portlet/ui/bot/test/testcase/SWTTaskBasedTestCase.java 2011-11-24
08:15:15 UTC (rev 36592)
@@ -2,9 +2,9 @@
import static org.junit.Assert.assertThat;
+import org.jboss.tools.portlet.ui.bot.task.SWTBotAware;
+import org.jboss.tools.portlet.ui.bot.task.SWTTask;
import org.jboss.tools.portlet.ui.bot.test.matcher.SWTMatcher;
-import org.jboss.tools.portlet.ui.bot.test.task.SWTBotAware;
-import org.jboss.tools.portlet.ui.bot.test.task.SWTTask;
import org.jboss.tools.ui.bot.ext.SWTTestExt;
/**