Author: apodhrad
Date: 2012-05-07 12:06:16 -0400 (Mon, 07 May 2012)
New Revision: 40820
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java
Log:
BPEL Bot Tests: adapted for JBT 3.3
Modified: 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 2012-05-07
13:20:14 UTC (rev 40819)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/META-INF/MANIFEST.MF 2012-05-07
16:06:16 UTC (rev 40820)
@@ -17,7 +17,8 @@
org.eclipse.wst.wsdl;bundle-version="1.2.103",
org.eclipse.emf.ecore;bundle-version="2.6.1",
org.jboss.tools.ui.bot.ext;bundle-version="3.2.0",
- org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.3"
+ org.eclipse.swtbot.eclipse.gef.finder;bundle-version="2.0.3",
+ org.custommonkey.xmlunit;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties 2012-05-07
13:20:14 UTC (rev 40819)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/org.jboss.tools.bpel.ui.bot.test.properties 2012-05-07
16:06:16 UTC (rev 40820)
@@ -6,6 +6,7 @@
# note : when server is type of SOA, version is version of SOA (not the bundled EAP)
#SERVER=JBOSS_AS,5.0,1.6,/home/psrna/data/jboss/jboss/jboss-as
SERVER=SOA,5.2,1.6,/home/apodhrad/Software/jboss-soa-p-5.2.0/jboss-as
+#SERVER=AS,5.1,1.6,/home/apodhrad/Software/jboss-5.1.0.GA
#<seam version>,<seam runtime home>
#SEAM=2.2,/home/psrna/data/jboss/soa-5.1.0.ER6-eds/seam
#<esb versoin>,<esb runtime home>
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java 2012-05-07
13:20:14 UTC (rev 40819)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/OdeDeployTest.java 2012-05-07
16:06:16 UTC (rev 40820)
@@ -1,9 +1,9 @@
package org.jboss.tools.bpel.ui.bot.test;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
import org.eclipse.core.resources.IFile;
import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
@@ -14,16 +14,13 @@
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
import org.jboss.tools.ui.bot.ext.config.Annotations.ServerType;
-import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
-import org.jboss.tools.ui.bot.ext.types.IDELabel;
-import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
import org.jboss.tools.ui.bot.ext.view.ServersView;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
- * @author psrna
+ * @author psrna, apodhrad
*
*/
@Require(server = @Server(type = ServerType.SOA, state = ServerState.Running, version =
"5.2"), perspective="BPEL")
@@ -43,8 +40,16 @@
" </q0:SayHelloRequest>" +
" </soapenv:Body>" +
"</soapenv:Envelope>";
+
+ final static String EXPECTED_RESPONSE = "<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <SayHelloResponse
xmlns=\"http://www.jboss.org/bpel/examples\">"
+ + " <tns:result
xmlns:tns=\"http://www.jboss.org/bpel/examples\">Hello
JBDS</tns:result>"
+ + " </SayHelloResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
-
ServersView sView = new ServersView();
@@ -104,7 +109,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started,
Synchronized]").select();
server.expand();
bot.sleep(TIME_5S);
- assertTrue(server.getNode("say_hello [Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("say_hello"));
}
@Test
@@ -112,17 +117,11 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
-
- Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...;
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<SayHelloResponse
xmlns=\"http://www.jboss.org/bpel/examples\">"));
- Assert.assertTrue(response.contains("<tns:result
xmlns:tns=\"http://www.jboss.org/bpel/examples\">Hello
JBDS</tns:result>"));
- Assert.assertTrue(response.contains("</SayHelloResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+ XMLUnit.setIgnoreWhitespace(true);
+ Diff diff = new Diff(response, EXPECTED_RESPONSE);
+
+ assertTrue(diff.similar());
}
}
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java 2012-05-07
13:20:14 UTC (rev 40819)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/ToolingCompatibilityTest.java 2012-05-07
16:06:16 UTC (rev 40820)
@@ -3,6 +3,8 @@
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
import java.util.List;
+import org.custommonkey.xmlunit.Diff;
+import org.custommonkey.xmlunit.XMLUnit;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditor;
@@ -78,7 +80,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started,
Synchronized]").select();
server.expand();
bot.sleep(TIME_5S);
- assertTrue(server.getNode("eclipse_tooling_proj
[Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("eclipse_tooling_proj"));
}
@Test
@@ -86,16 +88,22 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
+
+ Assert.assertTrue(response != null);
- Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...;
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<HelloWorldResponse
xmlns=\"http://helloWorld\">"));
- Assert.assertTrue(response.contains("<tns:result
xmlns:tns=\"http://helloWorld\">Kitty</tns:result>"));
- Assert.assertTrue(response.contains("</HelloWorldResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+ String expectedResponse = "<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <HelloWorldResponse xmlns=\"http://helloWorld\">"
+ + " <tns:result
xmlns:tns=\"http://helloWorld\">Kitty</tns:result>"
+ + " </HelloWorldResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
+ XMLUnit.setIgnoreWhitespace(true);
+
+ Diff diff = new Diff(response, expectedResponse);
+
+ assertTrue(diff.similar());
}
@@ -149,7 +157,7 @@
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started,
Synchronized]").select();
server.expand();
bot.sleep(TIME_20S);
- assertTrue(server.getNode("eclipse_tooling_proj
[Synchronized]").isVisible());
+ assertTrue(isProjectDeployed("eclipse_tooling_proj"));
}
@Test
@@ -157,16 +165,24 @@
// Test the process
String response = SendSoapMessage.sendMessage(ENDPOINT, MESSAGE, "simple");
+
+ Assert.assertTrue(response != null);
+ String expectedResponse = "<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...
+ + " <SOAP-ENV:Header />"
+ + " <SOAP-ENV:Body>"
+ + " <HelloWorldResponse xmlns=\"http://helloWorld\">"
+ + " <tns:result xmlns:tns=\"http://helloWorld\">Hello
Kitty</tns:result>"
+ + " </HelloWorldResponse>"
+ + " </SOAP-ENV:Body>"
+ + "</SOAP-ENV:Envelope>";
+
Assert.assertTrue(response != null);
- Assert.assertTrue(response.contains("<SOAP-ENV:Envelope
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">...;
- Assert.assertTrue(response.contains("<SOAP-ENV:Header />"));
- Assert.assertTrue(response.contains("<SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("<HelloWorldResponse
xmlns=\"http://helloWorld\">"));
- Assert.assertTrue(response.contains("<tns:result
xmlns:tns=\"http://helloWorld\">Hello Kitty</tns:result>"));
- Assert.assertTrue(response.contains("</HelloWorldResponse>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Body>"));
- Assert.assertTrue(response.contains("</SOAP-ENV:Envelope>"));
+
+ XMLUnit.setIgnoreWhitespace(true);
+ Diff diff = new Diff(response, expectedResponse);
+
+ assertTrue("Expected response is\n" + expectedResponse + "\nbut received
message is as follows\n" + response, diff.similar());
}
@Test
Modified:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java 2012-05-07
13:20:14 UTC (rev 40819)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test/src/org/jboss/tools/bpel/ui/bot/test/suite/BPELTest.java 2012-05-07
16:06:16 UTC (rev 40820)
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
import org.eclipse.swtbot.swt.finder.SWTBot;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
@@ -20,193 +21,218 @@
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.PackageExplorer;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+import org.osgi.framework.Version;
public class BPELTest extends SWTTestExt {
public static void prepare() {
log.info("BPEL All Test started...");
-
-// jbt.closeReportUsageWindowIfOpened(true);
-// eclipse.maximizeActiveShell();
-// eclipse.closeView(IDELabel.View.WELCOME);
-// bot.closeAllEditors();
+
+ // jbt.closeReportUsageWindowIfOpened(true);
+ // eclipse.maximizeActiveShell();
+ // eclipse.closeView(IDELabel.View.WELCOME);
+ // bot.closeAllEditors();
}
public static void clean() {
util.waitForNonIgnoredJobs();
bot.sleep(TIME_5S, "BPEL All Tests Finished!");
}
-
+
protected PackageExplorer pExplorer = new PackageExplorer();
- protected ProjectExplorer projExplorer = new ProjectExplorer(){
-
+ protected ProjectExplorer projExplorer = new ProjectExplorer() {
+
@Override
public void runOnServer(String projectName) {
String serverName = BPELTest.configuredState.getServer().name;
- //serverName = "SOA-5.1";
+ // serverName = "SOA-5.1";
bot.viewByTitle("Servers").show();
bot.viewByTitle("Servers").setFocus();
-
- SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
+
+ SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
bot.sleep(TIME_5S);
SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started,
Synchronized]").select();
-
+
ContextMenuHelper.prepareTreeItemForContextMenu(tree, server);
new SWTBotMenu(ContextMenuHelper.getContextMenu(tree, IDELabel.Menu.ADD_AND_REMOVE,
false)).click();
-
+
SWTBotShell shell = OdeDeployTest.bot.shell("Add and Remove...");
shell.activate();
-
+
SWTBot viewBot = shell.bot();
viewBot.tree().setFocus();
viewBot.tree().select(projectName);
viewBot.button("Add >").click();
viewBot.button("Finish").click();
}
-
};
-
-
/**
* Creates a new process in a project identified by it's name.
*
* TODO: extend WSDL validation
*
- * @param project project name in which to create the new process
- * @param name process name
- * @param type process type (sync, async, empty)
- * @param isAbstract is the process supposed to be abstract?
+ * @param project
+ * project name in which to create the new process
+ * @param name
+ * process name
+ * @param type
+ * process type (sync, async, empty)
+ * @param isAbstract
+ * is the process supposed to be abstract?
*
- * @return process file
+ * @return process file
*/
protected IFile createNewProcess(String project, String name, String type, boolean
isAbstract) {
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
SWTBot viewBot = view.bot();
SWTBotTreeItem item =
viewBot.tree().expandNode(project).expandNode("bpelContent");
item.select();
-
+
bot.menu("File").menu("New").menu("Other...").click();
bot.shell("New").activate();
+
+ SWTBotTree tree = bot.tree();
+ tree.expandNode("BPEL 2.0").expandNode("BPEL Process
File").select();
+ // 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());
- SWTBotTree tree = bot.tree();
- tree.expandNode("BPEL 2.0").expandNode("BPEL Process
File").select();
- //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(name);
-
bot.comboBoxWithLabel("Namespace:").setText("http://eclips...;
- bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL
Process");
- if(isAbstract) {
- bot.checkBox().select();
- } else {
- bot.checkBox().deselect();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
- assertEquals(name, bot.textWithLabel("Service Name").getText());
- }
-
- bot.button("Finish").click();
- bot.sleep(TIME_5S);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- IFile bpelFile = iproject.getFile(new Path("bpelContent/" + name +
".bpel"));
- assertTrue(bpelFile.exists());
- //assertTrue(iproject.getFile(new Path("bpelContent/" + name +
".bpelex")).exists());
- assertTrue(iproject.getFile(new Path("bpelContent/" + name +
"Artifacts.wsdl")).exists());
-
- return bpelFile;
+ createNewBpelProcess(project, name, type, isAbstract, getBpelUiVersion());
+
+ bot.button("Next >").click();
+ bot.button("Finish").click();
+ bot.sleep(TIME_5S);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ IFile bpelFile = iproject.getFile(new Path("bpelContent/" + name +
".bpel"));
+ assertTrue(bpelFile.exists());
+ // assertTrue(iproject.getFile(new Path("bpelContent/" + name +
+ // ".bpelex")).exists());
+ assertTrue(iproject.getFile(new Path("bpelContent/" + name +
"Artifacts.wsdl")).exists());
+
+ return bpelFile;
}
-
+
+ protected void createNewBpelProcess(String project, String name, String type, boolean
isAbstract, Version version) {
+ if (version.toString().startsWith("0.8.0")) {
+ bot.textWithLabel("Process Name:").setText(name);
+
bot.comboBoxWithLabel("Namespace:").setText("http://eclips...;
+ if (isAbstract) {
+ bot.checkBox().select();
+ } else {
+ bot.checkBox().deselect();
+ }
+ assertTrue(bot.button("Next >").isEnabled());
+ bot.button("Next >").click();
+ bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL
Process");
+ } else {
+ bot.textWithLabel("BPEL Process Name:").setText(name);
+
bot.comboBoxWithLabel("Namespace:").setText("http://eclips...;
+ bot.comboBoxWithLabel("Template:").setSelection(type + " BPEL
Process");
+ if (isAbstract) {
+ bot.checkBox().select();
+ } else {
+ bot.checkBox().deselect();
+ assertTrue(bot.button("Next >").isEnabled());
+
+ bot.button("Next >").click();
+ assertEquals(name, bot.textWithLabel("Service Name").getText());
+ }
+ }
+ }
+
/**
- * Creates a new ODE deployment descriptor in a project identified by it's name.
+ * Creates a new ODE deployment descriptor in a project identified by it's
+ * name.
*
* @author psrna
*
- * @param project project name in which to create the new ODE deployment descriptor
- * @return deployment descriptor file
+ * @param project
+ * project name in which to create the new ODE deployment
+ * descriptor
+ * @return deployment descriptor file
*/
- protected IFile createNewDeployDescriptor(String project){
-
+ protected IFile createNewDeployDescriptor(String project) {
+
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
SWTBot viewBot = view.bot();
SWTBotTreeItem item =
viewBot.tree().expandNode(project).expandNode("bpelContent");
item.select();
-
+
bot.menu("File").menu("New").menu("Other...").click();
bot.shell("New").activate();
-
- SWTBotTree tree = bot.tree();
+
+ SWTBotTree tree = bot.tree();
tree.expandNode("BPEL 2.0").expandNode("BPEL Deployment
Descriptor").select();
- //tree.expandNode("BPEL 2.0").expandNode("Apache ODE Deployment
Descriptor").select();
- assertTrue(bot.button("Next >").isEnabled());
-
- bot.button("Next >").click();
+ // tree.expandNode("BPEL 2.0").expandNode("Apache ODE Deployment
Descriptor").select();
+ assertTrue(bot.button("Next >").isEnabled());
- assertTrue(bot.textWithLabel("BPEL
Project:").getText().equals("/" + project + "/bpelContent"));
- assertTrue(bot.textWithLabel("File
name:").getText().equals("deploy.xml"));
-
- bot.button("Finish").click();
- bot.sleep(5000);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- IFile deployFile = iproject.getFile(new Path("bpelContent/deploy.xml"));
- assertTrue(deployFile.exists());
+ bot.button("Next >").click();
+ assertTrue(bot.textWithLabel("BPEL Project:").getText().equals("/"
+ project + "/bpelContent"));
+ assertTrue(bot.textWithLabel("File
name:").getText().equals("deploy.xml"));
+
+ bot.button("Finish").click();
+ bot.sleep(5000);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ IFile deployFile = iproject.getFile(new Path("bpelContent/deploy.xml"));
+ assertTrue(deployFile.exists());
+
return deployFile;
}
-
-
+
/**
* Create a new BPEL project
- * @param name project name
- * @return project reference
+ *
+ * @param name
+ * project name
+ * @return project reference
*/
protected IProject createNewProject(String name) {
SWTBotView view = bot.viewByTitle("Project Explorer");
view.show();
view.setFocus();
-
+
bot.menu("File").menu("New").menu("Project...").click();
bot.shell("New Project").activate();
-
- SWTBotTree tree = bot.tree();
+
+ 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(name);
- assertTrue(bot.button("Finish").isEnabled());
-
- bot.button("Finish").click();
- bot.sleep(3000);
-
- IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- assertNotNull(iproject);
-
- return iproject;
+ 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(name);
+ assertTrue(bot.button("Finish").isEnabled());
+
+ bot.button("Finish").click();
+ bot.sleep(3000);
+
+ IProject iproject = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ assertNotNull(iproject);
+
+ return iproject;
}
-
+
public String loadFile(IFile file) throws Exception {
- if(file.getType() != IFile.FILE) {
+ if (file.getType() != IFile.FILE) {
throw new IllegalArgumentException("File: " + file.getFullPath().toString()
+ " is a directory!");
}
-
+
InputStream in = null;
StringBuffer out;
try {
@@ -214,11 +240,11 @@
out = new StringBuffer();
byte[] buffer = new byte[4 * 1024];
int c = 0;
- while((c = in.read(buffer)) > -1) {
+ while ((c = in.read(buffer)) > -1) {
out.append(new String(buffer, 0, c));
}
} finally {
- if(in != null) {
+ if (in != null) {
try {
in.close();
} catch (IOException e) {
@@ -228,10 +254,37 @@
}
return out.length() == 0 ? null : out.toString();
}
-
+
protected void openFile(String projectName, String... path) throws Exception {
log.info("Opening file: " + path[path.length - 1] + " ...");
pExplorer.openFile(projectName, path);
}
+ public Version getServerToolsVersion() {
+ return Platform.getBundle("org.eclipse.wst.server.ui").getVersion();
+ }
+
+ public Version getBpelUiVersion() {
+ return Platform.getBundle("org.eclipse.bpel.ui").getVersion();
+ }
+
+ public boolean isProjectDeployed(String projectName) {
+ String serverName = OdeDeployTest.configuredState.getServer().name;
+
+ bot.viewByTitle("Servers").show();
+ bot.viewByTitle("Servers").setFocus();
+
+ SWTBotTree tree = bot.viewByTitle("Servers").bot().tree();
+ SWTBotTreeItem server = tree.getTreeItem(serverName + " [Started,
Synchronized]").select();
+ server.expand();
+ bot.sleep(TIME_5S);
+
+ String status = "[Synchronized]";
+ // TODO: the version comparison should be better
+ if (getServerToolsVersion().toString().startsWith("1.3")) {
+ status = "[Started, Synchronized]";
+ }
+
+ return server.getNode(projectName + " " + status).isVisible();
+ }
}
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.project 2012-05-07 16:06:16 UTC
(rev 40820)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>libs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/.settings/org.eclipse.m2e.core.prefs 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.classpath 2012-05-07
16:06:16 UTC (rev 40820)
@@ -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/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib"
path="xmlunit-1.3.jar"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.project 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.custommonkey.xmlunit</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>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <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.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.jdt.core.prefs 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,7 @@
+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.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/.settings/org.eclipse.m2e.core.prefs 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/META-INF/MANIFEST.MF 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: XMLUnit
+Bundle-SymbolicName: org.custommonkey.xmlunit
+Bundle-Version: 1.0.0
+Bundle-ClassPath: xmlunit-1.3.jar
+Export-Package: org.custommonkey.xmlunit,
+ org.custommonkey.xmlunit.examples,
+ org.custommonkey.xmlunit.exceptions,
+ org.custommonkey.xmlunit.jaxp13,
+ org.custommonkey.xmlunit.util
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/build.properties 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,2 @@
+bin.includes = META-INF/,\
+ xmlunit-1.3.jar
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/pom.xml 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+ <groupId>org.jboss.tools.bpel</groupId>
+ <artifactId>tests</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <groupId>org.custommonkey.xmlunit</groupId>
+ <artifactId>org.custommonkey.xmlunit</artifactId>
+ <version>1.0.0</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/MANIFEST.MF 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Export-Package: org.custommonkey.xmlunit,org.custommonkey.xmlunit.exam
+ ples,org.custommonkey.xmlunit.exceptions,org.custommonkey.xmlunit.jax
+ p13,org.custommonkey.xmlunit.util
+Bundle-ClassPath: xmlunit-1.3.jar
+Bundle-Version: 1.0.0
+Bundle-Name: XMLUnit
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.custommonkey.xmlunit
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/local-artifacts.properties 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,4 @@
+#Mon May 07 15:09:07 CEST 2012
+artifact.attached.p2metadata=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
+artifact.main=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
+artifact.attached.p2artifacts=/home/apodhrad/Repos/svn/jbosstools/trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/maven-archiver/pom.properties 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Mon May 07 15:09:07 CEST 2012
+version=1.0.0
+groupId=org.custommonkey.xmlunit
+artifactId=org.custommonkey.xmlunit
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/org.custommonkey.xmlunit-1.0.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2artifacts.xml 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository version='1.1.0'?>
+<artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='org.custommonkey.xmlunit'
version='1.0.0'>
+ <properties size='5'>
+ <property name='artifact.size' value='89520'/>
+ <property name='download.size' value='89520'/>
+ <property name='maven-groupId'
value='org.custommonkey.xmlunit'/>
+ <property name='maven-artifactId'
value='org.custommonkey.xmlunit'/>
+ <property name='maven-version' value='1.0.0'/>
+ </properties>
+ </artifact>
+</artifacts>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
===================================================================
---
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml
(rev 0)
+++
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/target/p2content.xml 2012-05-07
16:06:16 UTC (rev 40820)
@@ -0,0 +1,33 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<units size='1'>
+ <unit id='org.custommonkey.xmlunit' version='1.0.0'
singleton='false'>
+ <update id='org.custommonkey.xmlunit' range='[0.0.0,1.0.0)'
severity='0'/>
+ <properties size='4'>
+ <property name='org.eclipse.equinox.p2.name'
value='XMLUnit'/>
+ <property name='maven-groupId'
value='org.custommonkey.xmlunit'/>
+ <property name='maven-artifactId'
value='org.custommonkey.xmlunit'/>
+ <property name='maven-version' value='1.0.0'/>
+ </properties>
+ <provides size='8'>
+ <provided namespace='org.eclipse.equinox.p2.iu'
name='org.custommonkey.xmlunit' version='1.0.0'/>
+ <provided namespace='osgi.bundle'
name='org.custommonkey.xmlunit' version='1.0.0'/>
+ <provided namespace='java.package'
name='org.custommonkey.xmlunit' version='0.0.0'/>
+ <provided namespace='java.package'
name='org.custommonkey.xmlunit.examples' version='0.0.0'/>
+ <provided namespace='java.package'
name='org.custommonkey.xmlunit.exceptions' version='0.0.0'/>
+ <provided namespace='java.package'
name='org.custommonkey.xmlunit.jaxp13' version='0.0.0'/>
+ <provided namespace='java.package'
name='org.custommonkey.xmlunit.util' version='0.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type'
name='bundle' version='1.0.0'/>
+ </provides>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='org.custommonkey.xmlunit'
version='1.0.0'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Bundle-SymbolicName: org.custommonkey.xmlunit
Bundle-Version:
1.0.0

+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+</units>
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
===================================================================
(Binary files differ)
Property changes on:
trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/org.custommonkey.xmlunit/xmlunit-1.3.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml
===================================================================
--- trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml
(rev 0)
+++ trunk/bpel/tests/org.jboss.tools.bpel.ui.bot.test.lib/pom.xml 2012-05-07 16:06:16 UTC
(rev 40820)
@@ -0,0 +1,12 @@
+<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>
+ <groupId>org.jboss.tools.bpel</groupId>
+ <artifactId>libs</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <modules>
+ <module>org.custommonkey.xmlunit</module>
+ </modules>
+</project>
+