Author: alex.guizar(a)jboss.com
Date: 2007-01-29 11:47:42 -0500 (Mon, 29 Jan 2007)
New Revision: 2179
Added:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
Modified:
branches/jbossws-1.2.0/jbossws-tests/build.xml
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter_Impl.java
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/web.xml
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/webservices.xml
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/wstools-config.xml
Log:
JBWS-1496
Modified: branches/jbossws-1.2.0/jbossws-tests/build.xml
===================================================================
--- branches/jbossws-1.2.0/jbossws-tests/build.xml 2007-01-29 15:52:14 UTC (rev 2178)
+++ branches/jbossws-1.2.0/jbossws-tests/build.xml 2007-01-29 16:47:42 UTC (rev 2179)
@@ -208,16 +208,15 @@
<!-- The jBPM BPEL classpath -->
<path id="jbpm.bpel.classpath">
<path refid="jbossws.jars.classpath"/>
- <fileset dir="${thirdparty.dir}/jbpm-bpel">
- <include name="jbpm*.jar" />
- <include name="commons-lang*.jar" />
- <include name="jaxen*.jar" />
- </fileset>
+ <pathelement location="${thirdparty.dir}/jbpm-bpel" />
+ <pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-bpel.jar" />
+ <pathelement location="${thirdparty.dir}/jbpm-bpel/jbpm-jpdl.jar" />
+ <pathelement location="${thirdparty.dir}/jbpm-bpel/commons-lang.jar"
/>
+ <pathelement location="${thirdparty.dir}/jbpm-bpel/jaxen.jar" />
<pathelement
location="${thirdparty.dir}/commons-collections.jar"/>
<pathelement location="${thirdparty.dir}/commons-logging.jar"/>
<pathelement location="${thirdparty.dir}/dom4j.jar"/>
<pathelement location="${thirdparty.dir}/wsdl4j.jar"/>
- <pathelement location="${thirdparty.dir}/jbpm-bpel"/>
</path>
</target>
@@ -303,10 +302,21 @@
Generate samples sources
-->
<target name="generate-sources" depends="compile"
description="Generate the deployment resources.">
-
+ <!-- create jbpm process archives -->
+ <mkdir dir="${tests.output.dir}/libs"/>
+ <zip
destfile="${tests.output.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip">
+ <fileset dir="${tests.resources.dir}/jaxrpc/samples/wsbpel/hello/bpel"
/>
+ </zip>
+
+ <!-- generate wsdl binding and service definitions for bpel processes -->
<taskdef name="servicegen"
classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
<classpath refid="jbpm.bpel.classpath"/>
</taskdef>
+ <servicegen
processfile="${tests.output.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip"
+
outputdir="${tests.output.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/wsdl"
+ bindingfile="hello-binding-.wsdl"
servicefile="hello-service.wsdl" />
+
+ <!-- generate mapping artifacts -->
<taskdef name="wstools"
classname="org.jboss.ws.tools.ant.wstools">
<classpath refid="core.classpath"/>
<classpath location="${jbossws.client.jar}"/>
@@ -315,16 +325,8 @@
<classpath location="${thirdparty.dir}/concurrent.jar"/>
<classpath location="${tests.output.dir}/classes"/>
<classpath location="${tests.output.dir}"/>
- </taskdef>
-
+ </taskdef>
<mkdir dir="${tests.output.dir}/libs"/>
- <zip
destfile="${tests.output.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip">
- <fileset dir="${tests.resources.dir}/jaxrpc/samples/wsbpel/hello/bpel"
/>
- </zip>
-
- <servicegen
processfile="${tests.output.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip"
-
outputdir="${tests.output.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/wsdl"
/>
-
<mkdir dir="${tests.output.dir}/wstools/java"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF"
config="${tests.resources.dir}/jaxrpc/samples/docstyle/wrapped/wstools-config.xml"/>
<wstools
dest="${tests.output.dir}/wstools/resources/jaxrpc/samples/docstyle/bare/WEB-INF"
config="${tests.resources.dir}/jaxrpc/samples/docstyle/bare/wstools-config.xml"/>
Added:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
(rev 0)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2007-01-29
16:47:42 UTC (rev 2179)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the JBPM BPEL PUBLIC LICENSE AGREEMENT as
+ * published by JBoss Inc.; either version 1.0 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.
+ */
+package org.jboss.test.ws.jaxrpc.samples.wsbpel;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLEncoder;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.ws.JBossWSTestHelper;
+
+/**
+ * A test setup that deploys process files.
+ *
+ * @author <a href="mailto:alex.guizar@jboss.com">Alejandro
Guizar</a>
+ * @version $Revision$
+ */
+public class JbpmBpelTestSetup extends TestSetup
+{
+ private final String[] processFiles;
+
+ protected static final Logger log = Logger.getLogger(JbpmBpelTestSetup.class);
+
+ public JbpmBpelTestSetup(Test test, String... processFiles)
+ {
+ super(test);
+ this.processFiles = processFiles;
+ }
+
+ protected void setUp() throws Exception
+ {
+ for (int i = 0; i < processFiles.length; i++)
+ {
+ String processFileName = processFiles[i];
+
+ // check file exists before dispatching to server
+ File processFile = new File(processFileName);
+ if (!processFile.exists())
+ throw new FileNotFoundException(processFileName);
+
+ deploy(processFile);
+ }
+ }
+
+ public static void deploy(File processFile) throws Exception
+ {
+ // format file component
+ String file = getJbpmBpelDeployContext() + "?processfile=" +
URLEncoder.encode(processFile.toURI().toString(), "UTF-8");
+
+ // create target URL
+ URL targetUrl = new URL("http", JBossWSTestHelper.getServerHost(),
getServerHttpPort(), file);
+
+ // submit process deploy request
+ int responseCode = submitRequest(targetUrl);
+
+ if (responseCode != HttpURLConnection.HTTP_OK)
+ throw new IOException("could not deploy process: " + processFile);
+ }
+
+ private static int submitRequest(URL targetUrl) throws IOException
+ {
+ // create http connection
+ HttpURLConnection httpConnection = (HttpURLConnection)targetUrl.openConnection();
+
+ try
+ {
+ log.debug("submitting request: " + targetUrl);
+ httpConnection.connect();
+
+ int responseCode = httpConnection.getResponseCode();
+ log.debug("got response code: " + responseCode);
+
+ return responseCode;
+ }
+ finally
+ {
+ httpConnection.disconnect();
+ }
+ }
+
+ public static int getServerHttpPort()
+ {
+ return Integer.getInteger("jbpm.bpel.http.port", 8080);
+ }
+
+ public static String getJbpmBpelDeployContext()
+ {
+ return System.getProperty("jbpm.bpel.deploy.context",
"/jbpm-bpel/deploy");
+ }
+}
Property changes on:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2007-01-29
15:52:14 UTC (rev 2178)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2007-01-29
16:47:42 UTC (rev 2179)
@@ -1,16 +1,23 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
+ * by the @authors tag. See the copyright.txt 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 JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 of the License, or
- * (at your option) any later version.
+ * 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.
+ * 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.test.ws.jaxrpc.samples.wsbpel.hello;
@@ -22,6 +29,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.test.ws.jaxrpc.samples.wsbpel.JbpmBpelTestSetup;
/**
* Test business process behavior based on web services.
@@ -31,54 +39,44 @@
*/
public class BpelHelloTestCase extends JBossWSTest
{
- private HelloWorldService service;
+ private HelloWorldService helloService;
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(BpelHelloTestCase.class,
"jaxrpc-samples-wsbpel-hello.war, jaxrpc-samples-wsbpel-hello-client.jar");
+ JBossWSTestSetup testSetup = JBossWSTestSetup.newTestSetup(BpelHelloTestCase.class,
"jaxrpc-samples-wsbpel-hello.war, jaxrpc-samples-wsbpel-hello-client.jar");
+ return new JbpmBpelTestSetup(testSetup,
"libs/jaxrpc-samples-wsbpel-hello-process.zip");
}
protected void setUp() throws Exception
{
- if (true)
+ if (helloService == null)
{
- System.out.println("FIXME: [JBWS-1496] BPEL in jbossws-samples");
- return;
+ if (isTargetJBoss())
+ {
+ InitialContext iniCtx = getInitialContext();
+ helloService =
(HelloWorldService)iniCtx.lookup("java:comp/env/service/BpelHello");
+ }
+ else
+ {
+ throw new IllegalStateException("Unsupported target server");
+ }
}
-
- if (service == null)
- {
- InitialContext iniCtx = getInitialContext();
- service =
(HelloWorldService)iniCtx.lookup("java:comp/env/service/BpelHello");
- }
}
public void testSayHelloProxy() throws Exception
{
- if (true)
- {
- System.out.println("FIXME: [JBWS-1496] BPEL in jbossws-samples");
- return;
- }
+ Greeter proxy = helloService.getGreeterPort();
- Greeter proxy = service.getGreeterPort();
-
String greeting = proxy.sayHello("Popeye");
assertEquals("Hello, Popeye!", greeting);
}
public void testSayHelloDII() throws Exception
{
- if (true)
- {
- System.out.println("FIXME: [JBWS-1496] BPEL in jbossws-samples");
- return;
- }
+ String helloServiceNS = "http://jbpm.org/examples/hello";
+ Call call = helloService.createCall(new QName(helloServiceNS,
"GreeterPort"));
+ call.setOperationName(new QName(helloServiceNS, "sayHello"));
- String portTypeNS = "http://jbpm.org/examples/hello";
- Call call = service.createCall(new QName(portTypeNS, "GreeterPort"));
- call.setOperationName(new QName(portTypeNS, "sayHello"));
-
String greeting = (String)call.invoke(new Object[] { "Olive" });
assertEquals("Hello, Olive!", greeting);
}
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter_Impl.java
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter_Impl.java 2007-01-29
15:52:14 UTC (rev 2178)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter_Impl.java 2007-01-29
16:47:42 UTC (rev 2179)
@@ -1,16 +1,23 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag.
+ * by the @authors tag. See the copyright.txt 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 JBPM BPEL PUBLIC LICENSE AGREEMENT as
- * published by JBoss Inc.; either version 1.0 of the License, or
- * (at your option) any later version.
+ * 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.
+ * 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.test.ws.jaxrpc.samples.wsbpel.hello;
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/web.xml
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/web.xml 2007-01-29
15:52:14 UTC (rev 2178)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/web.xml 2007-01-29
16:47:42 UTC (rev 2179)
@@ -13,15 +13,9 @@
<url-pattern>/greeter</url-pattern>
</servlet-mapping>
- <!-- jBPM BPEL Partner Integration -->
- <servlet>
- <servlet-name>integrationServlet</servlet-name>
-
<servlet-class>org.jbpm.bpel.integration.jms.IntegrationServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>integrationServlet</servlet-name>
- <url-pattern>/integration</url-pattern>
- </servlet-mapping>
+ <!-- Partner Integration Configurator -->
+ <listener>
+
<listener-class>org.jbpm.bpel.integration.server.IntegrationConfigurator</listener-class>
+ </listener>
</web-app>
\ No newline at end of file
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/webservices.xml
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/webservices.xml 2007-01-29
15:52:14 UTC (rev 2178)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/webservices.xml 2007-01-29
16:47:42 UTC (rev 2179)
@@ -8,7 +8,7 @@
<!-- descriptive name for the service -->
<webservice-description-name>Hello World</webservice-description-name>
<!-- WSDL service file -->
- <wsdl-file>WEB-INF/wsdl/service.wsdl</wsdl-file>
+ <wsdl-file>WEB-INF/wsdl/hello-service.wsdl</wsdl-file>
<!-- Java<->XML mapping file -->
<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
Modified:
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/wstools-config.xml
===================================================================
---
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/wstools-config.xml 2007-01-29
15:52:14 UTC (rev 2178)
+++
branches/jbossws-1.2.0/jbossws-tests/src/main/resources/jaxrpc/samples/wsbpel/hello/wstools-config.xml 2007-01-29
16:47:42 UTC (rev 2179)
@@ -4,7 +4,7 @@
<package-namespace
package="org.jboss.test.ws.jaxrpc.samples.wsbpel.hello"
namespace="http://jbpm.org/examples/hello" />
</global>
- <wsdl-java
location="wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/wsdl/service.wsdl">
+ <wsdl-java
location="wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/wsdl/hello-service.wsdl">
<mapping file="jaxrpc-mapping.xml" />
</wsdl-java>
</configuration>
\ No newline at end of file