Permalink
Browse files

initial import of swtbot

  • Loading branch information...
1 parent 74a5826 commit 95e2917d01ed218c59e6c902b18d20603e587124 @ketan ketan committed Dec 16, 2008
Showing 730 changed files with 73,708 additions and 0 deletions.
@@ -0,0 +1,7 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.rcpmail.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,7 @@
+#Wed Oct 08 11:18:38 IST 2008
+eclipse.preferences.version=1
+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.5
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Test Plug-in (incubation)
+Bundle-SymbolicName: org.rcpmail.test
+Bundle-Version: 1.0.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.rcpmail,
+ org.eclipse.swtbot.eclipse.finder,
+ org.eclipse.swtbot.swt.finder,
+ org.junit,
+ org.hamcrest
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2008 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.rcpmail;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.rcpmail");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(MessageCreateTest.class);
+ suite.addTestSuite(MyFirstTest.class);
+ suite.addTestSuite(MySecondTest.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.rcpmail;
+
+import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
+
+import java.util.List;
+
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Widget;
+import org.eclipse.swtbot.eclipse.finder.SWTBotEclipseTestCase;
+import org.eclipse.swtbot.swt.finder.finders.ChildrenControlFinder;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.eclipse.swtbot.swt.finder.widgets.WidgetNotFoundException;
+import org.hamcrest.Matcher;
+
+public class MessageCreateTest extends SWTBotEclipseTestCase {
+
+ public void testCreatesAnotherMessageWindow() throws Exception {
+ assertEquals(2, viewCount());
+ bot.menu("File").menu("Open Another Message View").click();
+
+ assertEquals(3, viewCount());
+ }
+
+ public void testClosesAllMessageWindows() throws Exception {
+ bot.view("Message").close();
+ bot.view("Message").close();
+
+ assertEquals(1, viewCount());
+ }
+
+ public void testMyMailBoxContainsDrafts() throws Exception {
+ SWTBotTree mailbox = mailBox();
+ SWTBotTreeItem myMailBox = mailbox.expandNode("me@this.com");
+ assertTrue(myMailBox.getNodes().contains("Drafts"));
+ }
+
+ // oops this fails
+ public void testOtherMailBoxContainsDrafts() throws Exception {
+ SWTBotTree mailbox = mailBox();
+ SWTBotTreeItem otherMailBox = mailbox.expandNode("other@aol.com");
+ assertTrue(otherMailBox.getNodes().contains("Drafts"));
+ }
+
+ private SWTBotTree mailBox() throws WidgetNotFoundException {
+ Widget widget = bot.view("Mailboxes").widget;
+ // find the tree
+ ChildrenControlFinder finder = new ChildrenControlFinder(widget);
+ List findControls = finder.findControls(treeMatcher());
+ return new SWTBotTree((Tree) findControls.get(0));
+ }
+
+ private Matcher treeMatcher() {
+ return widgetOfType(Tree.class);
+ }
+
+ private int viewCount() throws WidgetNotFoundException {
+ return bot.views().size();
+ }
+
+}
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.rcpmail;
+
+import org.eclipse.swtbot.eclipse.finder.SWTBotEclipseTestCase;
+
+
+public class MyFirstTest extends SWTBotEclipseTestCase {
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testThisPasses() throws Exception {
+ pass();
+ }
+
+ public void testThisFails() throws Exception {
+ fail();
+ }
+
+}
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.rcpmail;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swtbot.eclipse.finder.SWTBotEclipseTestCase;
+import org.eclipse.swtbot.swt.finder.utils.SWTUtils;
+
+public class MySecondTest extends SWTBotEclipseTestCase {
+
+ public void testThatSWTBotDoesNotRunOnTheUIThread() throws Exception {
+ assertNull(Display.getCurrent());
+ assertNotSame(Thread.currentThread(), SWTUtils.display().getThread());
+ }
+
+
+}
@@ -0,0 +1,7 @@
+<?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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.rcpmail</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,7 @@
+#Thu Nov 20 22:48:28 IST 2008
+eclipse.preferences.version=1
+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.5
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Rcpmail Plug-in (incubation)
+Bundle-SymbolicName: org.rcpmail; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.rcpmail.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2008 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ product_lg.gif,\
+ splash.bmp
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 95e2917

Please sign in to comment.