Author: Grid.Qian
Date: 2010-05-21 03:19:17 -0400 (Fri, 21 May 2010)
New Revision: 22232
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.classpath
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.project
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.settings/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/Activator.class
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/wizard/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.class
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/build.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/pom.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/Activator.java
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/wizard/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.java
Log:
JBIDE-6154: add the swtbot test for this issue
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.classpath
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.classpath
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.classpath 2010-05-21 07:19:17 UTC
(rev 22232)
@@ -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>
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.project
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.project
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.project 2010-05-21 07:19:17 UTC
(rev 22232)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.bpel.ui.bot.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>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/.settings/org.eclipse.jdt.core.prefs 2010-05-21
07:19:17 UTC (rev 22232)
@@ -0,0 +1,8 @@
+#Tue May 18 12:03:11 CST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+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
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF 2010-05-21
07:19:17 UTC (rev 22232)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.jboss.tools.bpel.ui.bot.test
+Bundle-SymbolicName: org.jboss.tools.bpel.ui.bot.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.bpel.ui.bot.test.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.swtbot.eclipse.core,
+ org.eclipse.swtbot.eclipse.finder,
+ org.eclipse.swtbot.swt.finder,
+ org.junit,
+ org.eclipse.core.resources
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: JBoss by Red Hat
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/Activator.class
===================================================================
(Binary files differ)
Property changes on:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/Activator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.class
===================================================================
(Binary files differ)
Property changes on:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/bin/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/build.properties
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/build.properties
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/build.properties 2010-05-21 07:19:17
UTC (rev 22232)
@@ -0,0 +1,7 @@
+output.. = bin/
+bin.includes = .,\
+ META-INF/
+source.. = src/
+src.includes = META-INF/,\
+ .,\
+ build.properties
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/pom.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/pom.xml (rev
0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/pom.xml 2010-05-21 07:19:17 UTC (rev
22232)
@@ -0,0 +1,14 @@
+<project
+xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <relativePath>../../../parent-pom.xml</relativePath>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.parent.pom</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>org.jboss.tools.bpel.ui.bot.test</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+</project>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/Activator.java
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/Activator.java
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/Activator.java 2010-05-21
07:19:17 UTC (rev 22232)
@@ -0,0 +1,50 @@
+package org.jboss.tools.bpel.ui.bot.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.bpel.ui.bot.test";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.java
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.java
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/wizard/NewWizardTest.java 2010-05-21
07:19:17 UTC (rev 22232)
@@ -0,0 +1,85 @@
+package org.jboss.tools.bpel.ui.bot.test.wizard;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+
+public class NewWizardTest extends TestCase{
+private static SWTWorkbenchBot bot;
+private IProject project;
+protected void setUp() throws Exception {
+ bot = new SWTWorkbenchBot();
+ bot.viewByTitle("Welcome").close();
+}
+public void testNewWizard() throws IOException, CoreException{
+ createBPELProject();
+ createBPELFile();
+}
+
+private void createBPELFile() throws IOException, CoreException {
+ bot.menu("File").menu("New").menu("Other...").click();
+ bot.shell("New").activate();
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("BPEL 2.0").expandNode("New BPEL Process
File").select();
+ assertTrue(bot.button("Next >").isEnabled());
+ bot.button("Next >").click();
+
+ assertFalse(bot.button("Next >").isEnabled());
+
+ bot.textWithLabel("BPEL Process Name:").setText("a");
+
bot.comboBoxWithLabel("Namespace:").setText("http://eclips...;
+ bot.comboBoxWithLabel("Template:").setSelection(2);
+ assertTrue(bot.button("Next >").isEnabled());
+ bot.button("Next >").click();
+ assertEquals("a", bot.textWithLabel("Service Name").getText());
+ bot.button("Finish").click();
+ bot.sleep(10000);
+
+ IFile bpelFile = project.getFile( new Path("bpelContent/a.bpel"));
+ assertNotNull(bpelFile);
+ IFile wsdlFile = project.getFile( new
Path("bpelContent/aArtifacts.wsdl"));
+ assertNotNull(wsdlFile);
+
+ String con = getContents(wsdlFile.getContents(),wsdlFile);
+ assertTrue(con.contains("tns:aBinding"));
+}
+private void createBPELProject() {
+ bot.menu("File").menu("New").menu("Project...").click();
+ bot.shell("New Project").activate();
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("BPEL 2.0").expandNode("BPEL Project").select();
+ assertTrue(bot.button("Next >").isEnabled());
+ bot.button("Next >").click();
+ bot.shell("New BPEL Project").activate();
+ assertFalse(bot.button("Finish").isEnabled());
+
+ bot.textWithLabel("Project name:").setText("A");
+ assertTrue(bot.button("Finish").isEnabled());
+ bot.button("Finish").click();
+ bot.sleep(10000);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject("A");
+ assertNotNull(project);
+}
+protected void tearDown() throws Exception {
+ bot = null;
+}
+
+protected String getContents(InputStream is, IFile file) throws IOException {
+ BufferedInputStream bis = new BufferedInputStream(is);
+ int l = (int)file.getLocation().toFile().length();
+ byte[] bs = new byte[l];
+ l = bis.read(bs, 0, l);
+ bis.close();
+ return new String(bs);
+}
+}