Author: ljelinko
Date: 2012-10-04 08:02:19 -0400 (Thu, 04 Oct 2012)
New Revision: 44290
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/JBTSuite.java
Removed:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/entity/Runtime.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java
Log:
Started to use Red Deer
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/META-INF/MANIFEST.MF 2012-10-04
12:02:19 UTC (rev 44290)
@@ -9,15 +9,17 @@
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.swtbot.eclipse.core;bundle-version="2.0.0",
- org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
+ org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
org.apache.log4j;bundle-version="1.2.13",
org.junit;bundle-version="4.8.1",
- org.jboss.tools.ui.bot.ext;bundle-version="1.0.0",
org.hamcrest;bundle-version="1.1.0",
org.jboss.tools.runtime.core,
- org.jboss.tools.runtime.ui;bundle-version="1.3.0",
- org.jboss.tools.common
-
+ org.jboss.tools.runtime.ui,
+ org.jboss.tools.common,
+ org.jboss.reddeer.jface,
+ org.jboss.reddeer.swt,
+ org.jboss.reddeer.eclipse,
+ org.jboss.reddeer.workbench,
+ org.jboss.reddeer.junit;bundle-version="0.0.1"
Modified: trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml
===================================================================
--- trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml 2012-10-04 12:01:24
UTC (rev 44289)
+++ trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/pom.xml 2012-10-04 12:02:19
UTC (rev 44290)
@@ -45,6 +45,20 @@
</pluginRepository>
</pluginRepositories>
+ <repositories>
+ <repository>
+ <id>red_deer</id>
+ <url>http://p2-reddeer.rhcloud.com</url>
+ <layout>p2</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
<build>
<plugins>
<plugin>
@@ -112,7 +126,6 @@
<useUIThread>false</useUIThread>
<testSuite>org.jboss.tools.runtime.as.ui.bot.test</testSuite>
<testClass>${test.class}</testClass>
- <skip>${swtbot.test.skip}</skip>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/AllTestsSuite.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -30,11 +30,10 @@
import org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.OperateSOAP5;
import
org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.standalone.DetectSOAPStandalone5;
import
org.jboss.tools.runtime.as.ui.bot.test.detector.server.soap5.standalone.OperateSOAPStandalone5;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
-(a)RunWith(RequirementAwareSuite.class)
+(a)RunWith(JBTSuite.class)
@Suite.SuiteClasses({
RuntimeDuplications.class,
ServerWithSeam.class,
Added:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/JBTSuite.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/JBTSuite.java
(rev 0)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/JBTSuite.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -0,0 +1,24 @@
+package org.jboss.tools.runtime.as.ui.bot.test;
+
+import org.jboss.reddeer.junit.runner.RedDeerSuite;
+import org.jboss.tools.ui.bot.ext.MacSpecifics;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.RunnerBuilder;
+
+public class JBTSuite extends RedDeerSuite {
+
+ public JBTSuite(Class<?> clazz, RunnerBuilder builder)
+ throws InitializationError {
+ super(clazz, builder);
+ }
+
+ @Override
+ public void run(RunNotifier arg0) {
+ MacSpecifics.setupToolkit();
+ SWTJBTExt.manageBlockingWidows(false, false);
+ MacSpecifics.setupJava();
+ super.run(arg0);
+ }
+}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/ProjectTestsSuite.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,18 +1,15 @@
package org.jboss.tools.runtime.as.ui.bot.test;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.RuntimeDuplications;
-import org.jboss.tools.runtime.as.ui.bot.test.detector.ServerWithSeam;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.CheckSeam22;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam22.DetectSeam22;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam23.CheckSeam23;
import org.jboss.tools.runtime.as.ui.bot.test.detector.seam.seam23.DetectSeam23;
import org.jboss.tools.runtime.as.ui.bot.test.detector.server.jboss7.DetectJBoss7;
import org.jboss.tools.runtime.as.ui.bot.test.detector.server.jboss7.OperateJBoss7;
-import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-(a)RunWith(RequirementAwareSuite.class)
+(a)RunWith(JBTSuite.class)
@SuiteClasses({
DetectJBoss7.class,
OperateJBoss7.class,
Deleted:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/PreferencesDialog.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,31 +0,0 @@
-package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
-
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.jboss.tools.ui.bot.ext.SWTBotExt;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.condition.NonSystemJobRunsCondition;
-import org.jboss.tools.ui.bot.ext.gen.ActionItem.Preference;
-import org.jboss.tools.ui.bot.ext.gen.IPreference;
-
-public class PreferencesDialog {
-
- protected void open(String... path){
- SWTBotExt bot = SWTBotFactory.getBot();
- try {
- bot.shell("Preferences");
- ok();
- } catch (WidgetNotFoundException e){
- // ok
- }
- IPreference preference = Preference.create(path);
- SWTBotFactory.getOpen().preferenceOpen(preference);
- }
-
- public void ok(){
- SWTBotShell preferencesShell = SWTBotFactory.getBot().shell("Preferences");
- preferencesShell.activate();
- SWTBotFactory.getBot().waitWhile(new NonSystemJobRunsCondition());
- SWTBotFactory.getBot().button("OK").click();
- }
-}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/RuntimeDetectionPreferencesDialog.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,78 +1,71 @@
package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
-import static org.eclipse.swtbot.swt.finder.waits.Conditions.tableHasRows;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.waits.ICondition;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.reddeer.eclipse.jface.preference.PreferencePage;
+import org.jboss.reddeer.swt.api.Table;
+import org.jboss.reddeer.swt.condition.JobIsRunning;
+import org.jboss.reddeer.swt.condition.WaitCondition;
+import org.jboss.reddeer.swt.exception.WidgetNotAvailableException;
+import org.jboss.reddeer.swt.impl.button.PushButton;
+import org.jboss.reddeer.swt.impl.label.DefaultLabel;
+import org.jboss.reddeer.swt.impl.shell.DefaultShell;
+import org.jboss.reddeer.swt.impl.table.DefaultTable;
+import org.jboss.reddeer.swt.wait.TimePeriod;
+import org.jboss.reddeer.swt.wait.WaitUntil;
+import org.jboss.reddeer.swt.wait.WaitWhile;
import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.ui.RuntimeUIActivator;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.condition.TaskDuration;
-public class RuntimeDetectionPreferencesDialog extends PreferencesDialog{
+public class RuntimeDetectionPreferencesDialog extends PreferencePage {
- public void open(){
- open("JBoss Tools", "JBoss Tools Runtime Detection");
+ public RuntimeDetectionPreferencesDialog() {
+ super("JBoss Tools", "JBoss Tools Runtime Detection");
}
-
+
+ @Override
+ public void ok(){
+ new WaitWhile(new JobIsRunning());
+ super.ok();
+ }
+
public SearchingForRuntimesDialog addPath(final String path){
RuntimeUIActivator.getDefault().getModel().addRuntimePath(new RuntimePath(path));
- SWTBotFactory.getBot().button("Cancel").click();
+ cancel();
open();
return new SearchingForRuntimesDialog();
}
- public void removePath(final String path){
- SWTBotFactory.getBot().table().click(0, 0);
- SWTBotFactory.getBot().button("Remove").click();
- }
-
public void removeAllPaths(){
- SWTBot bot = SWTBotFactory.getBot();
- SWTBotTable table = bot.table();
+ Table table = new DefaultTable();
int pathsNumber = table.rowCount();
for (int i = 0; i < pathsNumber; i++){
- table.click(0, 0);
- bot.button("Remove").click();
+ table.select(0);
+ new PushButton("Remove").click();
}
- bot.waitUntil(tableHasRows(table, 0), TaskDuration.NORMAL.getTimeout());
}
public SearchingForRuntimesDialog search(){
- SWTBotFactory.getBot().button("Search...").click();
- SWTBot bot = SWTBotFactory.getBot().shell("Searching for
runtimes...").bot();
- bot.waitUntil(new RuntimeSearchedFinished(bot), TaskDuration.LONG.getTimeout());
+ new PushButton("Search...").click();
+ new DefaultShell("Searching for runtimes...");
+ new WaitUntil(new RuntimeSearchedFinished(), TimePeriod.LONG);
return new SearchingForRuntimesDialog();
}
- private static class RuntimeSearchedFinished implements ICondition {
+ private static class RuntimeSearchedFinished implements WaitCondition {
- private SWTBot bot;
-
- public RuntimeSearchedFinished(SWTBot bot) {
- this.bot = bot;
- }
-
@Override
- public void init(SWTBot bot) {
- }
-
- @Override
- public boolean test() throws Exception {
+ public boolean test() {
try {
- bot.label("Searching runtimes is finished.");
+ new DefaultLabel("Searching runtimes is finished.");
return true;
- } catch (WidgetNotFoundException e){
+ } catch (WidgetNotAvailableException e){
return false;
}
}
@Override
- public String getFailureMessage() {
+ public String description() {
return "The runtime search has not finished in the specified amount of
time";
}
}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SeamPreferencesDialog.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -6,25 +6,22 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
-import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
-import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
+import org.jboss.reddeer.eclipse.jface.preference.PreferencePage;
+import org.jboss.reddeer.swt.api.Table;
+import org.jboss.reddeer.swt.impl.button.PushButton;
+import org.jboss.reddeer.swt.impl.table.DefaultTable;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-public class SeamPreferencesDialog extends PreferencesDialog {
+public class SeamPreferencesDialog extends PreferencePage {
- public void open(){
- open("JBoss Tools", "Web", "Seam");
+ public SeamPreferencesDialog(){
+ super("JBoss Tools", "Web", "Seam");
}
public List<Runtime> getRuntimes(){
List<Runtime> runtimes = new ArrayList<Runtime>();
- SWTBotTable table = SWTBotFactory.getBot().table();
+ Table table = new DefaultTable();
for (int i = 0; i < table.rowCount(); i++){
Runtime runtime = new Runtime();
@@ -37,26 +34,23 @@
}
public void removeAllRuntimes(){
- SWTBot bot = SWTBotFactory.getBot();
- SWTBotTable table = bot.table();
+ Table table = new DefaultTable();
int runtimesNumber = table.rowCount();
for (int i = 0; i < runtimesNumber; i++){
- table.click(0, 0);
- bot.button("Remove").click();
- Robot robot = null;
+ table.select(0);
+ new PushButton("Remove").click();
+
try {
- robot = new Robot();
+ Robot robot = new Robot();
+ robot.setAutoWaitForIdle(true);
+ robot.keyPress(KeyEvent.VK_ENTER);
+ robot.keyRelease(KeyEvent.VK_ENTER);
} catch (AWTException e) {
- e.printStackTrace();
+ throw new RuntimeException("Cannot press shortcut during removing of Seam
runtimes", e);
}
- robot.setAutoWaitForIdle(true);
- //robot.keyPress(KeyEvent.VK_RIGHT);
- //robot.keyRelease(KeyEvent.VK_RIGHT);
- robot.keyPress(KeyEvent.VK_ENTER);
- robot.keyRelease(KeyEvent.VK_ENTER);
- //KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR,
Keystrokes.LF);
- bot.shell("Preferences").activate();
+
+ open();
}
}
}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/SearchingForRuntimesDialog.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,57 +1,57 @@
package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
-import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
-
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.reddeer.swt.api.Shell;
+import org.jboss.reddeer.swt.api.TreeItem;
+import org.jboss.reddeer.swt.condition.ShellWithTextIsActive;
+import org.jboss.reddeer.swt.impl.button.CheckBox;
+import org.jboss.reddeer.swt.impl.button.PushButton;
+import org.jboss.reddeer.swt.impl.shell.DefaultShell;
+import org.jboss.reddeer.swt.impl.tree.DefaultTree;
+import org.jboss.reddeer.swt.wait.WaitWhile;
import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-import org.jboss.tools.ui.bot.ext.SWTEclipseExt;
public class SearchingForRuntimesDialog {
public List<Runtime> getRuntimes(){
List<Runtime> runtimes = new ArrayList<Runtime>();
- for (SWTBotTreeItem treeItem : getRuntimesTreeItems()) {
+ for (TreeItem treeItem : getRuntimesTreeItems()) {
Runtime runtime = new Runtime();
- runtime.setName(treeItem.cell(0));
- runtime.setVersion(treeItem.cell(1));
- runtime.setType(treeItem.cell(2));
- runtime.setLocation(treeItem.cell(3));
+ runtime.setName(treeItem.getCell(0));
+ runtime.setVersion(treeItem.getCell(1));
+ runtime.setType(treeItem.getCell(2));
+ runtime.setLocation(treeItem.getCell(3));
runtimes.add(runtime);
}
return runtimes;
}
public void ok(){
- SWTBotShell shell = SWTBotFactory.getBot().activeShell();
- SWTBotFactory.getBot().button("OK").click();
- SWTBotFactory.getBot().waitUntil(shellCloses(shell));
+ Shell shell = new DefaultShell();
+ new PushButton("OK").click();
+ new WaitWhile(new ShellWithTextIsActive(shell.getText()));
}
public void cancel(){
- SWTBotFactory.getBot().button("Cancel").click();
+ new PushButton("Cancel").click();
}
public void hideAlreadyCreatedRuntimes() {
- SWTBotFactory.getBot().checkBox("Hide already created runtimes").select();
+ new CheckBox("Hide already created runtimes").toggle(true);
}
public void deselect(String runtimeName){
- for (SWTBotTreeItem treeItem : getRuntimesTreeItems()) {
- if (treeItem.cell(0).equals(runtimeName)){
- treeItem.uncheck();
+ for (TreeItem treeItem : getRuntimesTreeItems()) {
+ if (treeItem.getCell(0).equals(runtimeName)){
+ treeItem.setChecked(false);
}
}
}
- private List<SWTBotTreeItem> getRuntimesTreeItems(){
- SWTBotTree tree = SWTBotFactory.getBot().tree();
- return SWTEclipseExt.getAllTreeItemsRecursive(SWTBotFactory.getBot(), tree, true);
+ private List<TreeItem> getRuntimesTreeItems(){
+ return new DefaultTree().getAllItems();
}
}
Deleted:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/dialog/preferences/ServerRuntimesPreferencesDialog.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,45 +0,0 @@
-package org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.keyboard.KeyboardFactory;
-import org.eclipse.swtbot.swt.finder.keyboard.Keystrokes;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
-import org.jboss.tools.runtime.as.ui.bot.test.entity.Runtime;
-import org.jboss.tools.ui.bot.ext.SWTBotFactory;
-
-public class ServerRuntimesPreferencesDialog extends PreferencesDialog {
-
- public void open(){
- open("Server", "Runtime Environments");
- }
-
- public List<Runtime> getRuntimes(){
- List<Runtime> runtimes = new ArrayList<Runtime>();
-
- SWTBotTable table = SWTBotFactory.getBot().table();
-
- for (int i = 0; i < table.rowCount(); i++){
- Runtime runtime = new Runtime();
- runtime.setName(table.cell(i, 0));
- runtime.setType(table.cell(i, 1));
- runtimes.add(runtime);
- }
- return runtimes;
- }
-
- public void removeAllRuntimes(){
- SWTBot bot = SWTBotFactory.getBot();
- SWTBotTable table = bot.table();
-
- int runtimesNumber = table.rowCount();
- for (int i = 0; i < runtimesNumber; i++){
- table.click(0, 0);
- bot.button("Remove").click();
- KeyboardFactory.getAWTKeyboard().pressShortcut(Keystrokes.RIGHT, Keystrokes.CR,
Keystrokes.LF);
- bot.shell("Preferences").activate();
- }
- }
-}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/entity/Runtime.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/entity/Runtime.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/entity/Runtime.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,5 +1,7 @@
package org.jboss.tools.runtime.as.ui.bot.test.entity;
+import java.io.File;
+
public class Runtime {
private String name;
@@ -8,7 +10,7 @@
private String type;
- private String location;
+ private File location;
public String getName() {
return name;
@@ -35,11 +37,11 @@
}
public String getLocation() {
- return location;
+ return location.getAbsolutePath();
}
public void setLocation(String location) {
- this.location = location;
+ this.location = new File(location);
}
@Override
@@ -85,7 +87,7 @@
return false;
return true;
}
-
+
@Override
public String toString() {
return "Runtime [name=" + name + ", version=" + version + ",
type="
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/OperateServerTemplate.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -1,12 +1,12 @@
package org.jboss.tools.runtime.as.ui.bot.test.template;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
-import org.jboss.tools.ui.bot.ext.matcher.console.ConsoleOutputMatcher;
-import org.jboss.tools.ui.bot.ext.view.ServersView;
+import org.jboss.reddeer.eclipse.ui.console.ConsoleView;
+import org.jboss.reddeer.eclipse.wst.server.ui.view.ServersView;
import org.junit.Test;
/**
@@ -16,7 +16,7 @@
* @author Lucia Jelinkova
*
*/
-public abstract class OperateServerTemplate extends SWTTestExt{
+public abstract class OperateServerTemplate {
private ServersView serversView = new ServersView();
@@ -31,7 +31,7 @@
}
public void startServer(){
- serversView.startServer(getServerName());
+ serversView.getServer(getServerName()).start();
assertNoException("Starting server");
assertServerState("Starting server", "Started");
@@ -39,30 +39,29 @@
}
public void restartServer(){
- serversView.restartServer(getServerName());
+ serversView.getServer(getServerName()).restart();
assertNoException("Restarting server");
assertServerState("Restarting server", "Started");
}
public void stopServer(){
- serversView.stopServer(getServerName());
+ serversView.getServer(getServerName()).stop();
assertNoException("Stopping server");
assertServerState("Stopping server", "Stopped");
}
public void deleteServer(){
- serversView.deleteServer(getServerName());
-
- assertFalse("Deleting server", serversView.serverExists(getServerName()));
+ serversView.getServer(getServerName()).delete();
}
protected void assertNoException(String message) {
- assertThat(message, "Exception:", not(new ConsoleOutputMatcher()));
+ ConsoleView console = new ConsoleView();
+ assertThat(message, console.getConsoleText(),
not(containsString("Exception")));
}
protected void assertServerState(String message, String state) {
- assertThat(message, serversView.getServerStatus(getServerName()), is(state));
+ assertThat(message,
serversView.getServer(getServerName()).getLabel().getState().getText(), is(state));
}
}
Modified:
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java
===================================================================
---
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java 2012-10-04
12:01:24 UTC (rev 44289)
+++
trunk/runtime/tests/org.jboss.tools.runtime.as.ui.bot.test/src/org/jboss/tools/runtime/as/ui/bot/test/template/RuntimeDetectionTestCase.java 2012-10-04
12:02:19 UTC (rev 44290)
@@ -3,11 +3,10 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
+import org.jboss.reddeer.eclipse.wst.server.ui.RuntimePreferencePage;
import
org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.RuntimeDetectionPreferencesDialog;
import org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SeamPreferencesDialog;
import
org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.SearchingForRuntimesDialog;
-import
org.jboss.tools.runtime.as.ui.bot.test.dialog.preferences.ServerRuntimesPreferencesDialog;
-import org.jboss.tools.ui.bot.ext.SWTTestExt;
/**
* Provides useful methods that can be used by its descendants.
@@ -15,13 +14,13 @@
* @author Lucia Jelinkova
*
*/
-public abstract class RuntimeDetectionTestCase extends SWTTestExt {
+public abstract class RuntimeDetectionTestCase {
protected RuntimeDetectionPreferencesDialog runtimeDetectionPreferences = new
RuntimeDetectionPreferencesDialog();
protected SeamPreferencesDialog seamPreferences = new SeamPreferencesDialog();
- protected ServerRuntimesPreferencesDialog serverRuntimesPreferences = new
ServerRuntimesPreferencesDialog();
+ protected RuntimePreferencePage serverRuntimesPreferences = new
RuntimePreferencePage();
protected SearchingForRuntimesDialog addPath(String path){
runtimeDetectionPreferences = new RuntimeDetectionPreferencesDialog();
@@ -62,7 +61,7 @@
protected void assertServerRuntimesNumber(int expected) {
serverRuntimesPreferences.open();
- assertThat(serverRuntimesPreferences.getRuntimes().size(), is(expected));
+ assertThat(serverRuntimesPreferences.getServerRuntimes().size(), is(expected));
serverRuntimesPreferences.ok();
}
}