Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKetan Padegaonkar2011-03-02 06:25:31 +0000
committerKetan Padegaonkar2011-03-02 06:25:31 +0000
commite147c1892763e3ac4b61c3146140b60fa9518f19 (patch)
tree719acd6702b1308c338a80ee940e144dc5ad4500
parentc154e48d049b9d39bf6597410c52003bc1374430 (diff)
downloadorg.eclipse.swtbot-e147c1892763e3ac4b61c3146140b60fa9518f19.tar.gz
org.eclipse.swtbot-e147c1892763e3ac4b61c3146140b60fa9518f19.tar.xz
org.eclipse.swtbot-e147c1892763e3ac4b61c3146140b60fa9518f19.zip
Get the code to build. Make the tests use a full eclipse instance to begin with.
-rw-r--r--org.eclipse.swtbot.forms.finder.test/.classpath2
-rw-r--r--org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java67
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java57
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java6
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java3
-rw-r--r--org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java3
13 files changed, 73 insertions, 89 deletions
diff --git a/org.eclipse.swtbot.forms.finder.test/.classpath b/org.eclipse.swtbot.forms.finder.test/.classpath
index ad32c83a..64c5e31b 100644
--- a/org.eclipse.swtbot.forms.finder.test/.classpath
+++ b/org.eclipse.swtbot.forms.finder.test/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
index 98a2deaa..ff6e5253 100644
--- a/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.swtbot.forms.finder.test/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,8 @@
-#Mon May 03 06:25:00 CDT 2010
+#Tue Mar 01 22:21:58 PST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF b/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
index 0f9a263c..aeab4860 100644
--- a/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.swtbot.forms.finder.test/META-INF/MANIFEST.MF
@@ -17,5 +17,4 @@ Require-Bundle: org.eclipse.swt,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.swtbot.eclipse.finder
-Import-Package: com.ibm.icu.text
Bundle-Vendor: Eclipse SWTBot
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java
deleted file mode 100644
index ffea4527..00000000
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/AbstractSWTBotFormsTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Chris Aniszczyk and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * Chris Aniszczyk <caniszczyk@gmail.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swtbot.forms.finder.test;
-
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swtbot.forms.finder.finders.SWTFormsBot;
-import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable;
-import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
-import org.eclipse.swtbot.swt.finder.results.WidgetResult;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-
-
-@RunWith(SWTBotJunit4ClassRunner.class)
-public abstract class AbstractSWTBotFormsTestCase {
-
- public static Display display;
- public static SWTFormsBot bot;
- public static FormView view;
- public static Thread thread;
-
- protected Shell createShell(final String text) {
- return UIThreadRunnable.syncExec(new WidgetResult<Shell>() {
- public Shell run() {
- Shell shell = new Shell(display);
- shell.setText(text);
- shell.setLayout(new GridLayout());
- return shell;
- }
- });
- }
-
- @Before
- public void setUp() {
- display = new Display();
- bot = new SWTFormsBot();
- thread = new Thread("UI Thread") {
- public void run() {
- while ((display != null) && !display.isDisposed())
- if (!display.readAndDispatch())
- display.sleep();
- }
- };
- thread.start();
- Shell shell = createShell("Forms Test");
- view = new FormView(shell);
- shell.open();
- }
-
- @After
- public void tearDown() {
- // TODO
- }
-
-
-}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java
new file mode 100644
index 00000000..5bbc0ffe
--- /dev/null
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/AbstractSWTBotFormsTest.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Ketan Padegaonkar and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * Ketan Padegaonkar - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swtbot.forms.finder.test.widgets;
+
+import java.util.List;
+
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.forms.finder.finders.SWTFormsBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.junit.After;
+import org.junit.BeforeClass;
+
+public abstract class AbstractSWTBotFormsTest {
+
+ protected static SWTFormsBot bot = new SWTFormsBot();
+ protected static SWTWorkbenchBot workbench = new SWTWorkbenchBot();
+
+ @BeforeClass
+ public static void beforeClass() {
+ closeWelcomePage();
+ }
+
+ private static void closeWelcomePage() {
+ try {
+ System.setProperty("org.eclipse.swtbot.search.timeout", "0");
+ workbench.viewByTitle("Welcome").close();
+ } catch (WidgetNotFoundException e) {
+ // do nothing
+ } finally {
+ System.setProperty("org.eclipse.swtbot.search.timeout", "5000");
+ }
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ saveAndCloseAllEditors();
+ }
+
+ /**
+ * @throws WidgetNotFoundException
+ */
+ private void saveAndCloseAllEditors() {
+ List<? extends SWTBotEditor> editors = workbench.editors();
+ for (SWTBotEditor editor : editors) {
+ editor.saveAndClose();
+ }
+ }
+}
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java
index 69712469..6d734caa 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotExpandableCompositeTest.java
@@ -13,11 +13,13 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotExpandableComposite;
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.Test;
+import org.junit.runner.RunWith;
-public class SWTBotExpandableCompositeTest extends AbstractSWTBotFormsTestCase {
+@RunWith(SWTBotJunit4ClassRunner.class)
+public class SWTBotExpandableCompositeTest extends AbstractSWTBotFormsTest {
@Test
public void findExpandableComposite() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java
index 11ba0008..a2f3e286 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotFormTextTest.java
@@ -12,11 +12,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotFormText;
import org.junit.Test;
-public class SWTBotFormTextTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotFormTextTest extends AbstractSWTBotFormsTest {
@Test
public void findsFormText() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
index 25a59ffd..1c193a98 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotHyperlinkTest.java
@@ -13,11 +13,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotHyperlink;
import org.junit.Test;
-public class SWTBotHyperlinkTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotHyperlinkTest extends AbstractSWTBotFormsTest {
@Test
public void findHyperlink() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
index 1e1e2d30..bff520bf 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotImageHyperlinkTest.java
@@ -13,11 +13,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotImageHyperlink;
import org.junit.Test;
-public class SWTBotImageHyperlinkTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotImageHyperlinkTest extends AbstractSWTBotFormsTest {
@Test
public void findImageHyperlink() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java
index 6c4651d2..2f796729 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotScrolledFormTextTest.java
@@ -12,11 +12,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotScrolledFormText;
import org.junit.Test;
-public class SWTBotScrolledFormTextTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotScrolledFormTextTest extends AbstractSWTBotFormsTest {
@Test
public void findsScrolledFormText() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java
index 9c8fbbea..93439e68 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotSectionTest.java
@@ -13,11 +13,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotSection;
import org.junit.Test;
-public class SWTBotSectionTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotSectionTest extends AbstractSWTBotFormsTest {
@Test
public void findSection() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java
index 1e2bbf7c..c77e0b1f 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTreeNodeTest.java
@@ -12,11 +12,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotTreeNode;
import org.junit.Test;
-public class SWTBotTreeNodeTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotTreeNodeTest extends AbstractSWTBotFormsTest {
@Test
public void findTreeNode() throws Exception {
diff --git a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java
index 311894e9..1d597b0d 100644
--- a/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java
+++ b/org.eclipse.swtbot.forms.finder.test/src/org/eclipse/swtbot/forms/finder/test/widgets/SWTBotTwistieTest.java
@@ -12,11 +12,10 @@ package org.eclipse.swtbot.forms.finder.test.widgets;
import static org.junit.Assert.assertNotNull;
-import org.eclipse.swtbot.forms.finder.test.AbstractSWTBotFormsTestCase;
import org.eclipse.swtbot.forms.finder.widgets.SWTBotTwistie;
import org.junit.Test;
-public class SWTBotTwistieTest extends AbstractSWTBotFormsTestCase {
+public class SWTBotTwistieTest extends AbstractSWTBotFormsTest {
@Test
public void findTwistie() throws Exception {

Back to the top