Author: alex.guizar(a)jboss.com
Date: 2006-10-13 22:04:09 -0400 (Fri, 13 Oct 2006)
New Revision: 1220
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
Modified:
branches/jbossws-1.0/src/ant/build-samples.xml
branches/jbossws-1.0/src/ant/build-thirdparty.xml
branches/jbossws-1.0/src/main/resources/samples/jaxrpc/wsbpel/build.xml
branches/jbossws-1.0/src/test/ant/build-jars-jaxrpc.xml
branches/jbossws-1.0/src/test/build.xml
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
Log:
JBWS-868
Modified: branches/jbossws-1.0/src/ant/build-samples.xml
===================================================================
--- branches/jbossws-1.0/src/ant/build-samples.xml 2006-10-13 22:21:16 UTC (rev 1219)
+++ branches/jbossws-1.0/src/ant/build-samples.xml 2006-10-14 02:04:09 UTC (rev 1220)
@@ -243,16 +243,12 @@
<mkdir dir="${build.src.samples.dir}/jaxrpc/wsbpel/resources"/>
<copy todir="${build.src.samples.dir}/jaxrpc/wsbpel/java">
- <fileset dir="${test.java.dir}">
- <include name="org/jboss/test/ws/jaxrpc/samples/wsbpel/**"/>
- </fileset>
+ <fileset dir="${test.java.dir}"
includes="org/jboss/test/ws/jaxrpc/samples/wsbpel/**"/>
</copy>
<copy todir="${build.src.samples.dir}/jaxrpc/wsbpel/resources">
<fileset dir="${test.resources.dir}/jaxrpc/samples/wsbpel" />
</copy>
- <get dest="${build.src.samples.dir}/lib/jbpm-bpel.sar"
- src="${jboss.repository}/jbpm/bpel/${jbpm-bpel}/lib/jbpm-bpel.sar"
- usetimestamp="true" verbose="true" />
+ <copy todir="${build.src.samples.dir}/lib"
file="${thirdparty.dir}/jbpm-bpel.sar" />
<!-- samples/wseventing -->
<mkdir dir="${build.src.samples.dir}/jaxrpc/wseventing/java"/>
Modified: branches/jbossws-1.0/src/ant/build-thirdparty.xml
===================================================================
--- branches/jbossws-1.0/src/ant/build-thirdparty.xml 2006-10-13 22:21:16 UTC (rev 1219)
+++ branches/jbossws-1.0/src/ant/build-thirdparty.xml 2006-10-14 02:04:09 UTC (rev 1220)
@@ -46,6 +46,7 @@
<get
src="${jboss.repository}/jboss/remoting/${jboss-remoting}/lib/jboss-remoting.jar"
dest="${thirdparty.dir}/jboss-remoting.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/jbossretro/${jboss-jbossretro}/lib/jbossretro.jar"
dest="${thirdparty.dir}/jbossretro.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/jboss/jbossxb/${jboss-jbossxb}/lib/jboss-xml-binding.jar"
dest="${thirdparty.dir}/jboss-xml-binding.jar" usetimestamp="true"
verbose="true"/>
+ <get src="${jboss.repository}/jbpm/bpel/${jbpm-bpel}/lib/jbpm-bpel.sar"
dest="${thirdparty.dir}/jbpm-bpel.sar" usetimestamp="true"
verbose="true" />
<get src="${jboss.repository}/junit/${junit}/lib/junit.jar"
dest="${thirdparty.dir}/junit.jar" usetimestamp="true"
verbose="true"/>
<get
src="${jboss.repository}/oswego-concurrent/${oswego-concurrent}/lib/concurrent.jar"
dest="${thirdparty.dir}/concurrent.jar" usetimestamp="true"
verbose="true"/>
<get src="${jboss.repository}/qdox/${qdox}/lib/qdox.jar"
dest="${thirdparty.dir}/qdox.jar" usetimestamp="true"
verbose="true"/>
Modified: branches/jbossws-1.0/src/main/resources/samples/jaxrpc/wsbpel/build.xml
===================================================================
--- branches/jbossws-1.0/src/main/resources/samples/jaxrpc/wsbpel/build.xml 2006-10-13
22:21:16 UTC (rev 1219)
+++ branches/jbossws-1.0/src/main/resources/samples/jaxrpc/wsbpel/build.xml 2006-10-14
02:04:09 UTC (rev 1220)
@@ -11,19 +11,15 @@
<import file="${basedir}/common/imported-build.xml" />
- <target name="zip-processes">
- <!-- Zip the BPEL process and related WSDL interfaces -->
- <zip
destfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip">
- <fileset
dir="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/bpel" />
- </zip>
- </target>
-
- <target name="check-jbpmbpel">
+ <target name="init-jbpmbpel">
+ <!-- Check that jBPM BPEL has been deployed -->
<property name="jboss.server.deploy.jbpmbpel"
value="${jboss.server.deploy}/jbpm-bpel.sar" />
<available property="jbpmbpel.available"
file="${jboss.server.deploy.jbpmbpel}" />
- <antcall target="install-jbpmbpel" />
+ <antcall target="deploy-jbpmbpel" />
+
+ <!-- The jBPM BPEL classpath -->
<path id="jbpmbpel.classpath">
<path refid="client.classpath" />
<fileset dir="${jboss.server.lib}">
@@ -40,16 +36,21 @@
</path>
</target>
- <target name="install-jbpmbpel" unless="jbpmbpel.available">
+ <target name="deploy-jbpmbpel" unless="jbpmbpel.available">
<mkdir dir="${jboss.server.deploy.jbpmbpel}" />
<unjar dest="${jboss.server.deploy.jbpmbpel}"
src="${basedir}/lib/jbpm-bpel.sar" />
</target>
<target name="generate-sources"
- depends="zip-processes,check-jbpmbpel"
+ depends="init-jbpmbpel"
description="Generate the deployment resources.">
+ <!-- Package the BPEL process and related WSDL interfaces -->
+ <zip
destfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip">
+ <fileset
dir="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/bpel" />
+ </zip>
+
<!-- Define the servicegen ant task -->
<taskdef name="servicegen"
classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
@@ -79,9 +80,7 @@
</move>
</target>
- <!--
- Build the test deployments
- -->
+ <!-- Build the test deployments -->
<target name="jars"
depends="compile,copy-resources,generate-sources,compile-generated,copy-generated"
description="build the deployments">
@@ -117,24 +116,10 @@
<include name="jaxrpc-mapping.xml" />
</metainf>
</jar>
-
</target>
- <target name="store-processes">
- <taskdef name="storeprocess"
- classname="org.jbpm.bpel.ant.DeployProcessTask">
- <classpath refid="jbpmbpel.classpath" />
- </taskdef>
- <!-- Store the process definition in the jBPM database -->
- <storeprocess
processfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip"
/>
- </target>
-
- <!--
- Run the testsuite
- -->
- <target name="tests"
- depends="jars,store-processes"
- description="run the testsuite">
+ <!-- Run the testsuite -->
+ <target name="tests" depends="jars" description="run the
testsuite">
<antcall target="test">
<param name="test" value="${sample.path}" />
</antcall>
Modified: branches/jbossws-1.0/src/test/ant/build-jars-jaxrpc.xml
===================================================================
--- branches/jbossws-1.0/src/test/ant/build-jars-jaxrpc.xml 2006-10-13 22:21:16 UTC (rev
1219)
+++ branches/jbossws-1.0/src/test/ant/build-jars-jaxrpc.xml 2006-10-14 02:04:09 UTC (rev
1220)
@@ -1345,6 +1345,37 @@
</metainf>
</jar>
+ <!-- jaxrpc-samples-wsbpel -->
+ <war warfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello.war"
+
webxml="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.class"
/>
+ <include
name="org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.class" />
+ <include
name="org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter_Impl.class" />
+ </classes>
+ <webinf
dir="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/WEB-INF">
+ <include name="webservices.xml" />
+ <include name="classes/bpel-application.xml" />
+ </webinf>
+ <webinf
dir="${build.test.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF">
+ <include name="jaxrpc-mapping.xml" />
+ <include name="wsdl/**" />
+ </webinf>
+ </war>
+ <jar
destfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-client.jar">
+ <fileset dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/HelloWorldService.class"
/>
+ <include
name="org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/Greeter.class" />
+ </fileset>
+ <metainf
dir="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/META-INF">
+ <include name="application-client.xml" />
+ <include name="jboss-client.xml" />
+ </metainf>
+ <metainf
dir="${build.test.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF">
+ <include name="jaxrpc-mapping.xml" />
+ </metainf>
+ </jar>
+
<!-- jaxrpc-samples-wseventing.war -->
<war warfile="${build.test.dir}/libs/jaxrpc-samples-wseventing.war"
webxml="${build.test.dir}/resources/jaxrpc/samples/wseventing/WEB-INF/web.xml">
<classes dir="${build.test.dir}/classes">
Modified: branches/jbossws-1.0/src/test/build.xml
===================================================================
--- branches/jbossws-1.0/src/test/build.xml 2006-10-13 22:21:16 UTC (rev 1219)
+++ branches/jbossws-1.0/src/test/build.xml 2006-10-14 02:04:09 UTC (rev 1220)
@@ -182,7 +182,33 @@
<pathelement location="${thirdparty.dir}/stax-api-1.0.jar"/>
</path>
+ <!-- Check that jBPM BPEL has been deployed -->
+ <property name="jboss.server.deploy.jbpmbpel"
value="${jboss.server.deploy}/jbpm-bpel.sar" />
+ <available property="jbpmbpel.available"
file="${jboss.server.deploy.jbpmbpel}" />
+ <antcall target="deploy-jbpmbpel" />
+
+ <!-- The jBPM BPEL classpath -->
+ <path id="jbpmbpel.classpath">
+ <path refid="jbossws.client.classpath" />
+ <fileset dir="${jboss.server.lib}">
+ <include name="dom4j.jar" />
+ <include name="commons-collections.jar" />
+ </fileset>
+ <fileset dir="${jboss.server.deploy.jbpmbpel}">
+ <include name="jbpm*.jar" />
+ <include name="commons-lang*.jar" />
+ <include name="jaxen*.jar" />
+ </fileset>
+ <path location="${jboss.server.deploy.jbpmbpel}" />
+ <path location="${test.etc.dir}" />
+ </path>
</target>
+
+ <target name="deploy-jbpmbpel" unless="jbpmbpel.available">
+ <mkdir dir="${jboss.server.deploy.jbpmbpel}" />
+ <unjar dest="${jboss.server.deploy.jbpmbpel}"
+ src="${thirdparty.dir}/jbpm-bpel.sar" />
+ </target>
<!-- ================================================================== -->
<!-- Compiling -->
@@ -259,9 +285,19 @@
Generate samples sources
-->
<target name="generate-sources" depends="compile"
description="Generate the deployment resources.">
+ <zip
destfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip">
+ <fileset
dir="${build.test.dir}/resources/jaxrpc/samples/wsbpel/hello/bpel" />
+ </zip>
+ <taskdef name="servicegen"
classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
+ <classpath refid="jbpmbpel.classpath" />
+ </taskdef>
+ <servicegen
processfile="${build.test.dir}/libs/jaxrpc-samples-wsbpel-hello-process.zip"
+
outputdir="${build.test.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF/wsdl"
/>
+
<taskdef name="wstools"
classname="org.jboss.ws.tools.ant.wstools">
<classpath refid="jbossws.client.classpath"/>
- <classpath path="${build.test.dir}/classes"/>
+ <classpath location="${build.test.dir}/classes"/>
+ <classpath location="${build.test.dir}"/>
</taskdef>
<mkdir dir="${build.test.dir}/wstools/java"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF"
config="${test.resources.dir}/jaxrpc/jbws718/wstools-config.xml"/>
@@ -281,13 +317,16 @@
<wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/samples/oneway/WEB-INF"
config="${test.resources.dir}/jaxrpc/samples/oneway/wstools-config.xml"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/samples/rpcstyle/WEB-INF"
config="${test.resources.dir}/jaxrpc/samples/rpcstyle/wstools-config.xml"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/samples/secureejb/META-INF"
config="${test.resources.dir}/jaxrpc/samples/secureejb/wstools-config.xml"/>
+ <wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF"
config="${test.resources.dir}/jaxrpc/samples/wsbpel/hello/wstools-config.xml"
/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxrpc/samples/wssecurity/WEB-INF"
config="${test.resources.dir}/jaxrpc/samples/wssecurity/wstools-config.xml"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxws/samples/jsr181ejb/META-INF"
config="${test.resources.dir}/jaxws/samples/jsr181ejb/wstools-config.xml"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxws/samples/jsr181pojo/META-INF"
config="${test.resources.dir}/jaxws/samples/jsr181pojo/wstools-config.xml"/>
<wstools
dest="${build.test.dir}/wstools/resources/jaxws/samples/wsaddressing/META-INF"
config="${test.resources.dir}/jaxws/samples/wsaddressing/wstools-config.xml"/>
+
<move todir="${build.test.dir}/wstools/java">
<fileset
dir="${build.test.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF"
includes="org/**"/>
<fileset
dir="${build.test.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF"
includes="org/**"/>
+ <fileset
dir="${build.test.dir}/wstools/resources/jaxrpc/samples/wsbpel/hello/WEB-INF"
includes="org/**" />
</move>
</target>
Added:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2006-10-13
22:21:16 UTC (rev 1219)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java 2006-10-14
02:04:09 UTC (rev 1220)
@@ -0,0 +1,94 @@
+/*
+ * 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;
+
+/**
+ * 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;
+
+ private String host = "localhost";
+ private int port = 8080;
+ private String context = "/jbpm-bpel/deploy";
+
+ 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);
+ }
+ }
+
+ protected void deploy(File processFile) throws IOException
+ {
+ // format file component
+ String file = context + "?processfile=" +
URLEncoder.encode(processFile.toURI().toString(), "UTF-8");
+
+ // create target URL
+ URL targetUrl = new URL("http", host, port, file);
+ log.debug("target url: " + targetUrl);
+
+ // create http connection
+ HttpURLConnection httpConnection = (HttpURLConnection)targetUrl.openConnection();
+ try
+ {
+ // contact host
+ httpConnection.connect();
+ // check the response
+ int responseCode = httpConnection.getResponseCode();
+ log.debug("got response code: " + responseCode);
+ if (responseCode != HttpURLConnection.HTTP_OK)
+ {
+ throw new IOException("could not deploy process: " + processFile);
+ }
+ }
+ finally
+ {
+ httpConnection.disconnect();
+ }
+ }
+}
Property changes on:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/JbpmBpelTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2006-10-13
22:21:16 UTC (rev 1219)
+++
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsbpel/hello/BpelHelloTestCase.java 2006-10-14
02:04:09 UTC (rev 1220)
@@ -22,6 +22,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.
@@ -35,7 +36,8 @@
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, new String[] {
"libs/jaxrpc-samples-wsbpel-hello-process.zip" });
}
protected void setUp() throws Exception