Author: objectiser
Date: 2009-10-16 13:53:27 -0400 (Fri, 16 Oct 2009)
New Revision: 181
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/main/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/main/java/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/main/resources/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestHelper.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestSetup.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployer.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployerJBoss.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/hello_world/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/hello_world/QuickstartBPELHelloWorldTestCase.java
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.bpel
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.wsdl
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/bpel-deploy.xml
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/build.xml
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_request1.xml
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml
Log:
Initial integration test structure - still needs alot of work. AS server location needs to
be manually setup in the distributon/src/main/release/install/deployment.properties and
the system prop riftsaw.test.dir needs to be supplied as the parent folder containing the
AS and ESB environments. It currently deploys the build, starts the server, and then runs
a single test based on the hello world example, before stopping the server and undeploying
riftsaw. Need to also download the AS and ESB distributions before it all starts.
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTest.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.jboss.logging.Logger;
+
+/**
+ * Base class for RiftSaw test cases. Based on
+ * equivalent class in JBossWS written by
+ * Thomas Diesler and Richard Opalka.
+ *
+ */
+public abstract class RiftSawTest extends TestCase {
+
+ protected static Logger log = Logger.getLogger(RiftSawTest.class.getName());
+ private RiftSawTestHelper delegate = new RiftSawTestHelper();
+
+ private String m_testSuiteName=null;
+
+ public RiftSawTest(String name) {
+ super(name);
+
+ m_testSuiteName = name;
+ }
+
+ public String getTestSuiteName() {
+ return(m_testSuiteName);
+ }
+
+ public MBeanServerConnection getServer() throws NamingException {
+ return RiftSawTestHelper.getServer();
+ }
+
+ /** Deploy the given archive
+ */
+ public void deploy(String archive) throws Exception {
+ delegate.deploy(getTestSuiteName(), archive);
+ }
+
+ /** Undeploy the given archive
+ */
+ public void undeploy(String archive) throws Exception {
+ delegate.undeploy(getTestSuiteName(), archive);
+ }
+
+ public File getTestFile(String filename) {
+ return delegate.getTestFile(getTestSuiteName(), filename);
+ }
+
+ public URL getTestFileURL(String filename) throws MalformedURLException {
+ return delegate.getTestFileURL(getTestSuiteName(), filename);
+ }
+
+ protected void assertMessage(String message, String mesgFile) throws Exception {
+ String
mesgpath=System.getProperty("test.dir")+java.io.File.separator+getTestSuiteName()+
+ java.io.File.separator+mesgFile;
+
+ java.io.FileInputStream is=new java.io.FileInputStream(mesgpath);
+ byte[] b=new byte[is.available()];
+ is.read(b);
+ is.close();
+
+ String comparison=new String(b).trim();
+ message = message.trim();
+
+ if (!comparison.equals(message)) {
+ fail("Message in file '"+mesgFile+"' has content
["+comparison+
+ "] which is not the same as ["+message+"], lengths
"+comparison.length()+" to "+message.length());
+ }
+ }
+
+ protected String sendMessage(String mesgFile, String url) throws Exception {
+ String
mesgpath=System.getProperty("test.dir")+java.io.File.separator+getTestSuiteName()+
+ java.io.File.separator+mesgFile;
+
+ java.io.FileInputStream is=new java.io.FileInputStream(mesgpath);
+ byte[] b=new byte[is.available()];
+ is.read(b);
+ is.close();
+
+ java.net.URL u=new java.net.URL(url);
+ String soapAction="";
+ String request=new String(b);
+
+ HttpClient httpClient = new HttpClient();
+ PostMethod httpPostMethod = new PostMethod(u.toExternalForm());
+ httpPostMethod.setRequestHeader("SOAPAction", "\"" +
soapAction + "\"");
+ httpPostMethod.setRequestHeader("Content-Type", "text/xml");
+ httpPostMethod.setRequestEntity(new StringRequestEntity(request));
+ httpClient.executeMethod(httpPostMethod);
+ String result=httpPostMethod.getResponseBodyAsString();
+
+ return(result);
+ }
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestHelper.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestHelper.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestHelper.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Hashtable;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+/**
+ * A RiftSaw test helper that deals with test deployment/undeployment, etc.
+ * Based on JBossWS equivalent class by Thomas Diesler and Richard Opalka.
+ *
+ */
+public class RiftSawTestHelper {
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.dir";
+
+ private static MBeanServerConnection server;
+ private static String testArchiveDir;
+
+ /** Deploy the given archive
+ */
+ public void deploy(String testName, String archive) throws Exception {
+ URL archiveURL = getTestFile(testName, archive).toURL();
+ getDeployer().deploy(archiveURL);
+ }
+
+ /** Undeploy the given archive
+ */
+ public void undeploy(String testName, String archive) throws Exception {
+ URL archiveURL = getTestFile(testName, archive).toURL();
+ getDeployer().undeploy(archiveURL);
+ }
+
+ public void undeploy(String testName, URL archiveURL) throws Exception {
+ getDeployer().undeploy(archiveURL);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static MBeanServerConnection getServer() {
+ if (server == null)
+ {
+ Hashtable jndiEnv = null;
+ try
+ {
+ InitialContext iniCtx = new InitialContext();
+ jndiEnv = iniCtx.getEnvironment();
+ server =
(MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new RuntimeException("Cannot obtain MBeanServerConnection using
jndi props: " + jndiEnv, ex);
+ }
+ }
+ return server;
+ }
+
+ private TestDeployer getDeployer() {
+ return new TestDeployerJBoss(getServer());
+ }
+
+ /** Try to discover the URL for the deployment archive */
+ public URL getTestFileURL(String testName, String archive) throws
MalformedURLException
+ {
+ return getTestFile(testName, archive).toURL();
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public File getTestFile(String testName, String archive) {
+ File file = new File(getTestArchiveDir() + java.io.File.separator+
+ testName+ java.io.File.separator + archive);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestArchiveDir() == null ? " System property '" +
SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
+ throw new IllegalArgumentException("Cannot obtain '" +
getTestArchiveDir() + "/" + archive + "'." + notSet);
+ }
+
+ public static String getTestArchiveDir() {
+ if (testArchiveDir == null)
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY);
+
+ return testArchiveDir;
+ }
+
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestSetup.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestSetup.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/RiftSawTestSetup.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServerConnection;
+import javax.naming.NamingException;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A test setup that deploys/undeploys archives
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class RiftSawTestSetup extends TestSetup
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(RiftSawTestSetup.class);
+
+ private RiftSawTestHelper delegate = new RiftSawTestHelper();
+ private String[] archives = new String[0];
+ private ClassLoader originalClassLoader;
+ private String m_testName=null;
+
+ public RiftSawTestSetup(Class<?> testClass, String testName, String archiveList)
{
+ super(new TestSuite(testClass));
+ getArchiveArray(archiveList);
+ m_testName = testName;
+ }
+
+ public RiftSawTestSetup(Test test, String archiveList)
+ {
+ super(test);
+ getArchiveArray(archiveList);
+ }
+
+ public RiftSawTestSetup(Test test)
+ {
+ super(test);
+ }
+
+ public File getArchiveFile(String archive)
+ {
+ return delegate.getTestFile(m_testName, archive);
+ }
+
+ public URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getTestFile(m_testName, archive).toURL();
+ }
+
+ private void getArchiveArray(String archiveList)
+ {
+ if (archiveList != null)
+ {
+ StringTokenizer st = new StringTokenizer(archiveList, ", ");
+ archives = new String[st.countTokens()];
+
+ for (int i = 0; i < archives.length; i++)
+ archives[i] = st.nextToken();
+ }
+ }
+
+ protected void setUp() throws Exception {
+
+ List<URL> clientJars = new ArrayList<URL>();
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[i];
+ try
+ {
+ delegate.deploy(m_testName, archive);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ delegate.undeploy(m_testName, archive);
+ }
+
+ if (archive.endsWith("-client.jar"))
+ {
+ URL archiveURL = getArchiveURL(archive);
+ clientJars.add(archiveURL);
+ }
+ }
+
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ originalClassLoader = parent;
+ // add client jars to the class loader
+ if (!clientJars.isEmpty())
+ {
+ URL[] urls = new URL[clientJars.size()];
+ for (int i = 0; i < clientJars.size(); i++)
+ {
+ urls[i] = clientJars.get(i);
+ }
+ URLClassLoader cl = new URLClassLoader(urls, parent);
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+
+ // Temporary wait until able to sync detect deployed ok
+ try {
+ synchronized(this) {
+ wait(10000);
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ protected void tearDown() throws Exception
+ {
+
+ // Temporarily move the deployed files - this is to ensure the server actually
undeploys
+ // the archive
+ java.util.Map<java.io.File, java.io.File> mapping=new
java.util.HashMap<java.io.File, java.io.File>();
+
+ try
+ {
+ for (int i = 0; i < archives.length; i++)
+ {
+ String archive = archives[archives.length - i - 1];
+
+ java.io.File file=delegate.getTestFile(m_testName, archive);
+
+ URL archiveURL = file.toURL();
+
+ java.io.File newfile=new java.io.File(file.getParentFile(),
"_"+file.getName());
+ file.renameTo(newfile);
+
+ mapping.put(newfile, file);
+
+ delegate.undeploy(m_testName, archiveURL);
+
+ }
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+ }
+
+ // Temporary wait until able to sync detect deployed ok
+ try {
+ synchronized(this) {
+ wait(3000);
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ // Move files back to original location
+ for (java.io.File file : mapping.keySet()) {
+ java.io.File newfile=mapping.get(file);
+ file.renameTo(newfile);
+ }
+ }
+
+ public MBeanServerConnection getServer() throws NamingException
+ {
+ return RiftSawTestHelper.getServer();
+ }
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployer.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployer.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployer.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests;
+
+import java.net.URL;
+
+/**
+ * RiftSaw test deployer
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-May-2006
+ */
+public interface TestDeployer {
+
+ /** Deploy the given archive
+ */
+ void deploy(URL archive) throws Exception;
+
+ /** Undeploy the given archive
+ */
+ void undeploy(URL archive) throws Exception;
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployerJBoss.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployerJBoss.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/TestDeployerJBoss.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests;
+
+import java.io.Serializable;
+import java.net.URL;
+import java.security.Principal;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+/*
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+*/
+
+/**
+ * A JBossWS test helper that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class TestDeployerJBoss implements TestDeployer {
+ private static final String MAIN_DEPLOYER =
"jboss.system:service=MainDeployer";
+
+ private MBeanServerConnection server;
+
+ public TestDeployerJBoss(MBeanServerConnection server) {
+ this.server = server;
+ }
+
+ public void deploy(URL url) throws Exception
+ {
+ invokeMainDeployer("deploy", url);
+ }
+
+ public void undeploy(URL url) throws Exception
+ {
+ invokeMainDeployer("undeploy", url);
+ }
+
+ private void invokeMainDeployer(String methodName, URL url) throws Exception {
+ //System.out.println("INVOKE MAIN DEPLOYER: "+methodName+"
URL="+url);
+ server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url },
new String[] { "java.net.URL" });
+ }
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/hello_world/QuickstartBPELHelloWorldTestCase.java
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/hello_world/QuickstartBPELHelloWorldTestCase.java
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/java/org/jboss/soa/bpel/tests/hello_world/QuickstartBPELHelloWorldTestCase.java 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.soa.bpel.tests.hello_world;
+
+import org.jboss.soa.bpel.tests.RiftSawTest;
+import org.jboss.soa.bpel.tests.RiftSawTestSetup;
+
+import junit.framework.Test;
+
+/**
+ * Test case for running the Quickstart_bpel_hello_world sample.
+ */
+public class QuickstartBPELHelloWorldTestCase extends RiftSawTest {
+
+ private static final String TEST_NAME = "Quickstart_bpel_hello_world";
+
+ public QuickstartBPELHelloWorldTestCase() {
+ super(TEST_NAME);
+ }
+
+ public static Test suite() {
+ return(new RiftSawTestSetup(QuickstartBPELHelloWorldTestCase.class,
+ TEST_NAME, "Quickstart_bpel_hello_world-1.jar"));
+ }
+
+ public void testSendHello() throws Exception {
+ System.out.println("TEST SEND HELLO");
+
+ String result=sendMessage("hello_request1.xml",
+ "http://localhost:8080/bpel/processes/helloWorld");
+
+ assertMessage(result, "hello_response1.xml");
+
+ System.out.println("FINISHED TEST SEND HELLO="+result);
+ }
+}
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.bpel
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.bpel
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.bpel 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,68 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<process name="HelloWorld"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
+
+ <import location="HelloWorld.wsdl"
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <partnerLinks>
+ <partnerLink name="helloPartnerLink"
+ partnerLinkType="intf:HelloPartnerLinkType"
+ myRole="me" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="myVar" messageType="intf:HelloMessage"/>
+ <variable name="mesgVar" type="xsd:string"/>
+ </variables>
+
+ <sequence>
+ <receive
+ name="start"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"
+ createInstance="yes"/>
+
+ <assign name="assignHelloMesg">
+ <copy>
+ <from variable="myVar" part="TestPart"/>
+ <to variable="mesgVar"/>
+ </copy>
+ <copy>
+ <from>concat($mesgVar,' World')</from>
+ <to variable="myVar" part="TestPart"/>
+ </copy>
+ </assign>
+ <reply name="end"
+ partnerLink="helloPartnerLink"
+ portType="intf:HelloPortType"
+ operation="hello"
+ variable="myVar"/>
+ </sequence>
+</process>
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.wsdl
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.wsdl
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/HelloWorld.wsdl 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<wsdl:definitions
+
targetNamespace="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://www.jboss.org/bpel/examples/wsdl"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <wsdl:message name="HelloMessage">
+ <wsdl:part name="TestPart" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:portType name="HelloPortType">
+ <wsdl:operation name="hello">
+ <wsdl:input message="tns:HelloMessage"
name="TestIn"/>
+ <wsdl:output message="tns:HelloMessage"
name="TestOut"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="HelloSoapBinding"
type="tns:HelloPortType">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="hello">
+ <soap:operation soapAction="" style="rpc"/>
+ <wsdl:input>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body
+
namespace="http://www.jboss.org/bpel/examples/wsdl"
+ use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="HelloService">
+ <wsdl:port name="HelloPort"
binding="tns:HelloSoapBinding">
+ <soap:address
location="http://localhost:8080/bpel/processes/helloWorld"/>
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="HelloPartnerLinkType">
+ <plnk:role name="me" portType="tns:HelloPortType"/>
+ <plnk:role name="you" portType="tns:HelloPortType"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
+
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/bpel-deploy.xml
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/bpel-deploy.xml
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/bpel/bpel-deploy.xml 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,30 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~
http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+
xmlns:bpl="http://www.jboss.org/bpel/examples"
+
xmlns:intf="http://www.jboss.org/bpel/examples/wsdl">
+
+
+ <process name="bpl:HelloWorld">
+ <active>true</active>
+ <provide partnerLink="helloPartnerLink">
+ <service name="intf:HelloService" port="HelloPort"/>
+ </provide>
+ </process>
+</deploy>
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/build.xml
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/build.xml
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/build.xml 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,31 @@
+<project name="Quickstart_bpel_hello_world" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="version" value="1" />
+
+ <property name="deploy.dir" value="${basedir}/target/tests"/>
+ <property name="test.dir"
value="${basedir}/src/test/resources/samples/${ant.project.name}" />
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <mkdir dir="${deploy.dir}/${ant.project.name}" />
+ <jar basedir="${test.dir}/bpel"
destfile="${deploy.dir}/${ant.project.name}/${sample.jar.name}" />
+
+ <copy todir="${deploy.dir}/${ant.project.name}">
+ <fileset dir="${test.dir}/messages"/>
+ </copy>
+
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+</project>
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_request1.xml
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_request1.xml
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_request1.xml 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <wsdl:hello>
+ <TestPart>Hello</TestPart>
+ </wsdl:hello>
+ </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file
Added:
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml
===================================================================
---
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml
(rev 0)
+++
branches/IntegrationTests/RiftSaw-2.0-M1/integration-tests/src/test/resources/samples/Quickstart_bpel_hello_world/messages/hello_response1.xml 2009-10-16
17:53:27 UTC (rev 181)
@@ -0,0 +1 @@
+<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">&l...
xmlns:odens="http://www.jboss.org/bpel/examples/wsdl"><Te...
xmlns:wsdl="http://www.jboss.org/bpel/examples/wsdl">Hello
World</TestPart></odens:helloResponse></soapenv:Body></soapenv:Envelope>
\ No newline at end of file