[jboss-svn-commits] JBossWS SVN: r889 - in branches/jbossws-1.0: docs/user-guide/project/en/modules/wsbpel src/main/resources/samples/wsbpel src/test/java/org/jboss/test/ws/samples/wsbpel/hello src/test/resources/samples/wsbpel/hello/META-INF src/test/resources/samples/wsbpel/hello/WEB-INF src/test/resources/samples/wsbpel/hello/WEB-INF/classes src/test/resources/samples/wsbpel/hello/bpel src/test/resources/samples/wsbpel/hello/bpel/META-INF

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Sep 1 21:47:27 EDT 2006


Author: alex.guizar at jboss.com
Date: 2006-09-01 21:47:21 -0400 (Fri, 01 Sep 2006)
New Revision: 889

Added:
   branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter.java
   branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.java
Removed:
   branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/HelloPT.java
Modified:
   branches/jbossws-1.0/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml
   branches/jbossws-1.0/src/main/resources/samples/wsbpel/build.xml
   branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/BpelHelloTestCase.java
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/application-client.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/jboss-client.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/classes/bpel-application.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/web.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/webservices.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/META-INF/bpel-definition.xml
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.bpel
   branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.wsdl
Log:
JBWS-868

Modified: branches/jbossws-1.0/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml
===================================================================
--- branches/jbossws-1.0/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/docs/user-guide/project/en/modules/wsbpel/wsbpel.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -34,13 +34,13 @@
   
   <section id="wsbpel.definition">
   
-    <title>Defining a business process</title>
+    <title id="wsbpel.definition.title">Defining a business process</title>
     
     <para>Business processes model the stateful behavior of a participant in a business interaction.
-      In WS-BPEL, a process exports and imports functionality to/from participants using web
+      In BPEL, a process exports and imports functionality to/from participants using web
       service interfaces exclusively.</para>
       
-    <para>At its simplest, WS-BPEL can be used as a scripting language for web services. Consider
+    <para>At its simplest, BPEL can be used as a scripting language for web services. Consider
       a trivial endpoint that receives a person name, composes a greeting phrase and then replies
       with the greeting.</para>
       
@@ -54,7 +54,7 @@
     </figure>      
       
     <para>The interface our endpoint presents to the world appears in the following WSDL document.
-      Observe no binding or service elements are present. A WS-BPEL process is defined in terms
+      Observe no binding or service elements are present. A BPEL process is defined in terms
       of the interfaces (message and port type elements) of the participants, not their possible 
       deployments.</para>
       
@@ -62,7 +62,6 @@
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:tns="http://jbpm.org/examples/hello" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-    
 
   <!-- carries the name of a person -->
   <message name="NameMessage">
@@ -75,29 +74,29 @@
   </message>
 
   <!-- describes the interface presented to callers -->
-  <portType name="HelloPT">
+  <portType name="Greeter">
     <operation name="sayHello">
       <input message="tns:NameMessage"/>
       <output message="tns:GreetingMessage"/>
     </operation>
   </portType>
 
-
 </definitions>]]></programlisting>
 
-    <para>You already know how to implement this in Java. Let's jump to the BPEL way. The document 
+    <para>You already know how to implement this in Java. Let's jump to the BPEL way. The document
       that defines our business process appears next. There are three major sections in it.</para>
       
     <itemizedlist>
     
-      <listitem><para>The &lt;partnerLinks&gt; section lists the parties that interact with the
-        process in the course of greeting the world. The single partner link shown here
-        corresponds to the agent sending the person name (caller).</para></listitem>
+      <listitem><para>The <literal>&lt;partnerLinks&gt;</literal> section lists the parties that
+        interact with the process in the course of greeting the world. The sole partner link shown
+        here corresponds to the agent sending the person name (the <emphasis>caller</emphasis>).
+        </para></listitem>
         
-      <listitem><para>The &lt;variables&gt; section defines the data items held by the process 
-        between message exchanges. The ability to mantain data effectively makes the service 
-        provided by the process stateful. The state includes received and sent messages as well as
-        intermediate data used in business logic.</para></listitem>
+      <listitem><para>The <literal>&lt;variables&gt;</literal> section defines the data items held
+        by the process between message exchanges. The ability to mantain data effectively makes the
+        service provided by the process stateful. The state includes received and sent messages as
+        well as intermediate data used in business logic.</para></listitem>
         
       <listitem><para>The rest of the document describes the normal activities for handling a 
         greeting request. BPEL also provides the means to perform activities in response to faults.
@@ -108,14 +107,11 @@
     <programlisting><![CDATA[<process name="HelloWorld" targetNamespace="http://jbpm.org/examples/hello"
   xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
   xmlns:tns="http://jbpm.org/examples/hello"
-  xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://schemas.xmlsoap.org/ws/2003/03/business-process/
-                      http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+  xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
 
   <partnerLinks>
     <!-- establishes the relationship with the caller agent -->
-    <partnerLink name="Caller" partnerLinkType="tns:HelloPLT" myRole="service" />
+    <partnerLink name="caller" partnerLinkType="tns:Greeter-Caller" myRole="Greeter" />
   </partnerLinks>
 
   <variables>
@@ -128,7 +124,7 @@
   <sequence>
     
     <!-- receive the name of a person -->
-    <receive operation="sayHello" partnerLink="Caller" portType="tns:HelloPT"
+    <receive operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="request" createInstance="yes" />
       
     <!-- compose a greeting phrase -->
@@ -142,7 +138,7 @@
     </assign>
     
     <!-- reply with the greeting -->
-    <reply operation="sayHello" partnerLink="Caller" portType="tns:HelloPT"
+    <reply operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="response" />
   </sequence>
 
@@ -153,24 +149,26 @@
       that represent the relationship between two services. WS-BPEL uses them as the glue between
       the process and its partner services.</para>
       
-    <para>In order for the process definition to be complete, we must add the partner link type to
-      the WSDL document presented earlier.</para>
+    <para>For the process definition to be complete, we add the partner link type to the WSDL
+      document presented earlier.</para>
       
     <programlisting><![CDATA[<definitions targetNamespace="http://jbpm.org/examples/hello"
   ...
   xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
 
-  <!-- characterizes the relationship between the greeting process and its caller -->
-  <plt:partnerLinkType name="HelloPLT">
-    <plt:role name="service">
-      <plt:portType name="tns:HelloPT"/>
+  <!-- characterizes the relationship between the greeter and its caller -->
+  <plt:partnerLinkType name="Greeter-Caller">
+    <plt:role name="Greeter">
+      <plt:portType name="tns:Greeter"/>
     </plt:role>
+    <!-- the Caller does not provide services to the Greeter,
+         this is why we omit the "Caller" role -->    
   </plt:partnerLinkType>
   
 </definitions>]]></programlisting>
   
-  </section>
-  
+  </section>  
+
   <section id="wsbpel.database">
   
     <title>Storing the process definition in the jBPM database</title>
@@ -181,29 +179,29 @@
       
     <para>To provide these features, the JBoss BPEL implementation builds on <ulink 
       url="http://www.jboss.com/products/jbpm">JBoss jBPM</ulink>. The Graph Oriented Programming
-      (<ulink url="http://jbpm.org/gop">GOP</ulink>) foundation in jBPM allows for storing past 
-      and present graph state in a database.</para>
+      (<ulink url="http://jbpm.org/gop">GOP</ulink>) foundation in jBPM maintains past and present
+      graph state in a database.</para>
       
     <para>Installing the jBPM service in JBoss AS is a prerrequisite. Refer to the jBPM BPEL 
       <ulink url="http://docs.jboss.com/jbpm/bpel/getstarted.html#getstarted.setup">user guide
-      </ulink> for details.</para>
+      </ulink> for details. Make sure you install jBPM BPEL 1.1.Beta2 or above.</para>
 
     <note><para>The jBPM service comes with a preconfigured Hypersonic database, useful for 
       development purposes. In production, you can switch to the database of your choice.</para>
       </note>
 
-    <para>Before the process can be enacted, its definition must be stored in the jBPM database.
-      To do so, zip your BPEL process and related WSDL interfaces. Afterwards, submit the resulting
-      archive to the jBPM service.</para>
+    <para>Before the process can serve requests, its definition must be stored in the jBPM database.
+      jBPM BPEL supplies an ant task, <literal>deployprocess</literal>, to assist here. The input of
+      <literal>deployprocess</literal> is a zip file containing your BPEL process and related WSDL
+      interfaces. The task submits the zip file to the jBPM service for storage.</para>
       
-    <programlisting><![CDATA[<!-- Package the BPEL process and related WSDL interfaces -->
+    <programlisting><![CDATA[<!-- Zip the BPEL process and related WSDL interfaces -->
 <zip destfile="${build.test.dir}/libs/jbossws-samples-wsbpel-hello-process.zip">
   <fileset dir="${build.test.dir}/resources/samples/wsbpel/hello/bpel" />
 </zip>
 
-<!-- Submit the process archive to the jBPM service -->
-<get dest="${build.dir}/deploy-def.html"
-     src="http://localhost:8080/jbpm/deploy?archive=file://${build.dir}/${app.name}.par" />]]></programlisting>
+<!-- Store the process definition in the jBPM database -->
+<storeprocess processfile="${build.test.dir}/libs/jbossws-samples-wsbpel-hello-process.zip" />]]></programlisting>
       
     <para>The file <literal>bpel-definition.xml</literal> tells the location of the BPEL and WSDL
       documents inside the archive.</para>
@@ -225,25 +223,34 @@
   
     <title id="wsbpel.artifacts.title">Generating the required artifacts</title>
     
-    <para>After the process definition is stored in the database, deploying a WS-BPEL process is
-      similar to deploying a JSR-109 endpoint starting with WSDL.</para>
+    <para>Deploying a BPEL process is similar to deploying a JSR-109 endpoint starting with WSDL.
+      </para>
                 
-    <para>The definition of a WS-BPEL process only includes the port types of the participants, as
-      mentioned in the previous section. On the other hand, a JSR-109 deployment requires the 
-      presence of binding and service elements. JBoss BPEL supplies a tool that generates the SOAP
-      1.1 binding and service elements required for deploying the web service provided by the 
-      process.</para>
+    <para>The definition of a BPEL process only includes the port types of the participants, as
+      mentioned in <link linkend="wsbpel.definition" endterm="wsbpel.definition.title" />. On the 
+      other hand, a JSR-109 deployment requires the presence of binding and service elements. JBoss
+      BPEL supplies a tool that generates SOAP 1.1 binding and service elements required for
+      deploying the web service provided by the process.</para>
     
-    <programlisting><![CDATA[<taskdef name="servicegen" classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
+    <programlisting><![CDATA[<!-- Define the servicegen ant task -->
+<taskdef resource="org/jbpm/bpel/ant/tasks.properties" format="properties">
   <classpath>
-    <pathelement location="${template.dir}/config" />
-    <pathelement location="${jbpm.bpel.home}/build/jbpm-bpel-${jbpm.bpel.version}.jar" />
-    <fileset dir="${jbpm.bpel.home}/lib" includes="**/*.jar" />
+    <path location="${common.resources}" />
+    <path refid="client.classpath" />
+    <path location="${jboss.lib}/dom4j.jar" />
+    <path location="${jboss.server.lib}/commons-collections.jar" />
+    <path location="${jboss.server.deploy.jbpmbpel}" />
+    <fileset dir="${jboss.server.deploy.jbpmbpel}">
+      <include name="jbpm*.jar" />
+      <include name="commons-lang*.jar" />
+      <include name="jaxen*.jar" />
+    </fileset>
   </classpath>
 </taskdef>
 
-<!-- generate binding and service elements -->
-<servicegen processfile="${build.dir}/${app.name}.par" outputdir="${web.dir}/wsdl" />]]></programlisting>
+<!-- Generate binding and service elements -->
+<servicegen processfile="${build.test.dir}/libs/jbossws-samples-wsbpel-hello-process.zip"
+            outputdir="${build.test.dir}/wstools/resources/samples/wsbpel/hello/WEB-INF/wsdl" />]]></programlisting>
             
     <para>The generated WSDL can be passed to <literal>wstools</literal>. Use the following 
       configuration.</para>
@@ -260,13 +267,14 @@
 
     <note>
     
-      <para>JBoss BPEL is agnostic to the Java mapping artifacts that <literal>wstools</literal>
+      <para>JBoss BPEL does not use the Java mapping artifacts that <literal>wstools</literal>
         produces. Keep in mind that variables in a BPEL process are defined in terms of XML types
-        and WSDL messages. JBoss BPEL extracts XML content from SOAP messages and puts it in process
-        variables. No need to perform expensive Java binding.</para>
+        and WSDL messages. JBoss BPEL extracts XML content from SOAP messages and places it in the
+        process variables directly.</para>
       
       <para>Nevertheless, the Java mapping artifacts still must be present for the JSR-109 
-        deployment to be valid.</para>
+        deployment to be valid. Note that the supplied service implementation bean has empty methods
+        only. The BPEL process specifies the behavior instead.</para>
       
     </note>
     
@@ -276,16 +284,16 @@
   
     <title>Configuring the port component</title>
     
-    <para>Similar to the Addressing and Security components, JBoss BPEL uses <link 
-      linkend="handlers">JAX-RPC handlers</link> to extract XML content from SOAP messages.</para>
+    <para>Similar to the Addressing and Security components, JBoss BPEL uses a <link 
+      linkend="handlers">JAX-RPC handler</link> to extract XML content from SOAP messages.</para>
   
     <programlisting><![CDATA[<handler>
 
-  <handler-name>callerHandler</handler-name>
+  <handler-name>GreeterSoapHandler</handler-name>
   <handler-class>org.jbpm.bpel.integration.server.SoapHandler</handler-class>
   
   <init-param>
-    <description>partner link associated to the enclosing port</description>
+    <description>name of the partner link served by this port</description>
     <param-name>partnerLinkHandle</param-name>
     <param-value>caller</param-value>
   </init-param>
@@ -293,12 +301,14 @@
 </handler>]]></programlisting>
 
     <para>A separate descriptor, <literal>bpel-application.xml</literal>, specifies the name of
-      the process definition previously stored in the jBPM database.</para>
+      the process definition.</para>
       
-    <programlisting>&lt;bpelApplication name=&quot;helloWorld&quot; xmlns=&quot;http://jbpm.org/bpel&quot; /&gt;</programlisting>
+    <programlisting>&lt;bpelApplication name=&quot;HelloWorld&quot; xmlns=&quot;http://jbpm.org/bpel&quot; /&gt;</programlisting>
+    
+    <note><para>This name will be used to retrieve the process definition from the jBPM database.</para></note>    
   
   </section>
-  
+    
   <section id="wsbpel.client">
   
     <title>Consuming the published web service</title>
@@ -310,15 +320,11 @@
       endterm="wsbpel.artifacts.title" /> to develop a <link linkend="jsr109-clients">JSR-109 client
       </link>.</para>
       
-    <programlisting><![CDATA[InitialContext ctx = getInitialContext();
-// lookup service interface in environment context
-service = (HelloWorldService) ctx.lookup("java:comp/env/service/Hello");
+    <programlisting><![CDATA[InitialContext iniCtx = getInitialContext();
+service = (HelloWorldService)iniCtx.lookup("java:comp/env/service/BpelHello");
 
-// obtain dynamic proxy for web service port
-HelloPT proxy = service.getCallerPort();    
-// use proxy as local java object
+Greeter proxy = service.getGreeterPort();
 String greeting = proxy.sayHello("Popeye");
-// check popeye is greeted properly
 assertEquals("Hello, Popeye!", greeting);]]></programlisting>
   
   </section>

Modified: branches/jbossws-1.0/src/main/resources/samples/wsbpel/build.xml
===================================================================
--- branches/jbossws-1.0/src/main/resources/samples/wsbpel/build.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/main/resources/samples/wsbpel/build.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -10,8 +10,8 @@
 
   <import file="${basedir}/common/imported-build.xml" />
 
-  <target name="process-zips">
-    <!-- Package the BPEL process and related WSDL interfaces -->
+  <target name="zip-processes">
+    <!-- Zip the BPEL process and related WSDL interfaces -->
     <zip destfile="${build.test.dir}/libs/jbossws-samples-wsbpel-hello-process.zip">
       <fileset dir="${build.test.dir}/resources/samples/wsbpel/hello/bpel" />
     </zip>
@@ -22,28 +22,30 @@
               value="${jboss.server.deploy}/jbpm-bpel.sar" />
     <available property="jbpmbpel.available"
                file="${jboss.server.deploy.jbpmbpel}" />
+
+    <path id="jbpmbpel.classpath">
+      <path refid="client.classpath" />
+      <path location="${jboss.lib}/dom4j.jar" />
+      <path location="${jboss.server.lib}/commons-collections.jar" />
+      <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="${common.resources}" />
+    </path>
   </target>
 
   <target name="generate-sources"
-          depends="process-zips,check-jbpmbpel"
+          depends="zip-processes,check-jbpmbpel"
           if="jbpmbpel.available"
           description="Generate the deployment resources.">
 
     <!-- Define the servicegen ant task -->
     <taskdef name="servicegen"
              classname="org.jbpm.bpel.ant.ServiceGeneratorTask">
-      <classpath>
-        <path location="${common.resources}" />
-        <path refid="client.classpath" />
-        <path location="${jboss.lib}/dom4j.jar" />
-        <path location="${jboss.server.lib}/commons-collections.jar" />
-        <path location="${jboss.server.deploy.jbpmbpel}" />
-        <fileset dir="${jboss.server.deploy.jbpmbpel}">
-          <include name="jbpm*.jar" />
-          <include name="commons-lang*.jar" />
-          <include name="jaxen*.jar" />
-        </fileset>
-      </classpath>
+      <classpath refid="jbpmbpel.classpath" />
     </taskdef>
 
     <!-- Generate binding and service elements -->
@@ -52,9 +54,11 @@
 
     <!-- Define the wstools ant task -->
     <taskdef name="wstools" classname="org.jboss.ws.tools.ant.wstools">
-      <classpath location="${common.resources}" />
-      <classpath refid="client.classpath" />
-      <classpath path="${build.test.dir}"/>      
+      <classpath>
+        <path refid="client.classpath" />
+        <path location="${build.test.dir}" />
+        <path location="${common.resources}" />
+      </classpath>
     </taskdef>
 
     <!-- samples/wsbpel -->
@@ -80,8 +84,8 @@
          webxml="${build.test.dir}/resources/samples/wsbpel/hello/WEB-INF/web.xml">
       <classes dir="${build.test.dir}/classes">
         <include name="org/jboss/test/ws/samples/wsbpel/hello/HelloWorldService.class" />
-        <include name="org/jboss/test/ws/samples/wsbpel/hello/HelloPT.class" />
-        <include name="org/jboss/test/ws/samples/wsbpel/hello/HelloPT_Impl.class" />
+        <include name="org/jboss/test/ws/samples/wsbpel/hello/Greeter.class" />
+        <include name="org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.class" />
       </classes>
       <webinf dir="${build.test.dir}/resources/samples/wsbpel/hello/WEB-INF">
         <include name="webservices.xml" />
@@ -96,7 +100,7 @@
     <jar destfile="${build.test.dir}/libs/jbossws-samples-wsbpel-hello-client.jar">
       <fileset dir="${build.test.dir}/classes">
         <include name="org/jboss/test/ws/samples/wsbpel/hello/HelloWorldService.class" />
-        <include name="org/jboss/test/ws/samples/wsbpel/hello/HelloPT.class" />
+        <include name="org/jboss/test/ws/samples/wsbpel/hello/Greeter.class" />
       </fileset>
       <metainf dir="${build.test.dir}/resources/samples/wsbpel/hello/META-INF">
         <include name="application-client.xml" />
@@ -104,17 +108,25 @@
       </metainf>
       <metainf dir="${build.test.dir}/wstools/resources/samples/wsbpel/hello/WEB-INF">
         <include name="jaxrpc-mapping.xml" />
-        <include name="wsdl/**" />
       </metainf>
     </jar>
 
   </target>
 
+  <target name="store-processes" if="jbpmbpel.available">
+    <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/jbossws-samples-wsbpel-hello-process.zip" />
+  </target>
+
   <!--
   Run the testsuite
   -->
   <target name="tests"
-          depends="jars"
+          depends="jars,store-processes"
           description="run the testsuite"
           if="jbpmbpel.available">
     <antcall target="test">

Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/BpelHelloTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/BpelHelloTestCase.java	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/BpelHelloTestCase.java	2006-09-02 01:47:21 UTC (rev 889)
@@ -14,60 +14,61 @@
  */
 package org.jboss.test.ws.samples.wsbpel.hello;
 
-import java.util.Properties;
 import javax.naming.InitialContext;
-import javax.naming.NamingException;
 import javax.xml.namespace.QName;
 import javax.xml.rpc.Call;
 
-import junit.framework.TestCase;
+import junit.framework.Test;
 
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+
 /**
- * @author Alejandro Guízar
- * @version $Revision$ $Date: 2006/08/21 01:06:10 $
+ * Test business process behavior based on web services.
+ * 
+ * @author <a href="mailto:alex.guizar at jboss.com">Alejandro Guizar</a>
+ * @version $Revision$
  */
-public class BpelHelloTestCase extends TestCase {
+public class BpelHelloTestCase extends JBossWSTest
+{
+   private HelloWorldService service;
 
-  private HelloWorldService service;
+   public static Test suite()
+   {
+      return JBossWSTestSetup.newTestSetup(BpelHelloTestCase.class, "jbossws-samples-wsbpel-hello.war, jbossws-samples-wsbpel-hello-client.jar");
+   }
 
-  public BpelHelloTestCase(String name) {
-    super(name);
-  }
-  
-  protected void setUp() throws Exception {
-    InitialContext ctx = getInitialContext();
-    // JNDI name of service interface (in application-client.xml)
-    String serviceRefName = "service/Hello";
-    // lookup service interface in environment context
-    service = (HelloWorldService) ctx.lookup("java:comp/env/" + serviceRefName);
-  }
+   protected void setUp() throws Exception
+   {
+      if (service == null)
+      {
+         if (isTargetServerJBoss())
+         {
+            InitialContext iniCtx = getInitialContext();
+            service = (HelloWorldService)iniCtx.lookup("java:comp/env/service/BpelHello");
+         }
+         else
+         {
+            throw new IllegalStateException("Unsupported target server");
+         }
+      }
+   }
 
-  protected InitialContext getInitialContext() throws NamingException {
-    // prepare enviroment
-    Properties env = new Properties();
-    // JNDI name of client environment context (in jboss-client.xml)
-    env.setProperty("j2ee.clientName", "hello-client");
-    // initial context contains property above, plus those in jndi.properties 
-    return new InitialContext(env);
-  }
-  
-  public void testSayHello_proxy() throws Exception {
-    // obtain dynamic proxy for web service port
-    HelloPT proxy = service.getCallerPort();    
-    // use proxy as local java object
-    String greeting = proxy.sayHello("Popeye");
-    // check proper greeting
-    assertEquals("Hello, Popeye!", greeting);
-  }
-  
-  public void testSayHello_dii() throws Exception {
-    // obtain port type namespace; it MAY differ from service
-    String portTypeNS = service.getServiceName().getNamespaceURI();
-    // obtain dynamic invocation instance 
-    Call call = service.createCall(new QName(portTypeNS, "callerPort"), "sayHello");
-    // invoke operation using request/response interaction mode
-    String greeting = (String) call.invoke(new Object[] { "Olive" });
-    // check proper greeting
-    assertEquals("Hello, Olive!", greeting);
-  }
+   public void testSayHello_proxy() throws Exception
+   {
+      Greeter proxy = service.getGreeterPort();
+
+      String greeting = proxy.sayHello("Popeye");
+      assertEquals("Hello, Popeye!", greeting);
+   }
+
+   public void testSayHello_dii() throws Exception
+   {
+      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);
+   }
 }
\ No newline at end of file

Added: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter.java	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter.java	2006-09-02 01:47:21 UTC (rev 889)
@@ -0,0 +1,15 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Fri Sep 01 15:37:35 CDT 2006
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+package org.jboss.test.ws.samples.wsbpel.hello;
+public interface  Greeter extends java.rmi.Remote
+{
+
+  public java.lang.String  sayHello(java.lang.String name) throws  java.rmi.RemoteException;
+}


Property changes on: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.java	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.java	2006-09-02 01:47:21 UTC (rev 889)
@@ -0,0 +1,37 @@
+/*
+ * 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.samples.wsbpel.hello;
+
+import java.rmi.RemoteException;
+
+/*
+ * Method bodies in this class were intentionally left empty.
+ * The BPEL process {http://jbpm.org/examples/hello}HelloWorld 
+ * specifies the behavior instead.
+ */
+
+/**
+ * Service implementation bean of the Greeter endpoint.
+ *  
+ * @author <a href="mailto:alex.guizar at jboss.com">Alejandro Guizar</a>
+ * @version $Revision$
+ */
+public class Greeter_Impl implements Greeter
+{
+   public String sayHello(String name) throws RemoteException
+   {
+      return null;
+   }
+}
\ No newline at end of file


Property changes on: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/Greeter_Impl.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/HelloPT.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/HelloPT.java	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/samples/wsbpel/hello/HelloPT.java	2006-09-02 01:47:21 UTC (rev 889)
@@ -1,15 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Wed Aug 30 20:35:42 CDT 2006
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- */
-package org.jboss.test.ws.samples.wsbpel.hello;
-public interface  HelloPT extends java.rmi.Remote
-{
-
-  public java.lang.String  sayHello(java.lang.String name) throws  java.rmi.RemoteException;
-}

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/application-client.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/application-client.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/application-client.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -8,9 +8,9 @@
   <service-ref>
 
     <!-- JNDI name of service interface in client environment context -->
-    <service-ref-name>service/Hello</service-ref-name>
+    <service-ref-name>service/BpelHello</service-ref-name>
     <!-- service interface class -->
-    <service-interface>org.jbpm.bpel.tutorial.hello.HelloWorldService</service-interface>
+    <service-interface>org.jboss.test.ws.samples.wsbpel.hello.HelloWorldService</service-interface>
     <!-- placeholder for published WSDL document -->
     <wsdl-file>USE_JBOSS_CLIENT_XML_OVERRIDE</wsdl-file>
     <!-- Java<->XML mapping file -->
@@ -18,7 +18,7 @@
 
     <port-component-ref>
       <!-- service endpoint interface class -->
-      <service-endpoint-interface>org.jbpm.bpel.tutorial.hello.HelloPT</service-endpoint-interface>
+      <service-endpoint-interface>org.jboss.test.ws.samples.wsbpel.hello.Greeter</service-endpoint-interface>
     </port-component-ref>
 
   </service-ref>

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/jboss-client.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/jboss-client.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/META-INF/jboss-client.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -4,13 +4,13 @@
 <jboss-client>
 
   <!-- JNDI name of client environment context -->
-  <jndi-name>hello-client</jndi-name>
+  <jndi-name>jbossws-client</jndi-name>
 
   <service-ref>
     <!-- service-ref element to configure -->
-    <service-ref-name>service/Hello</service-ref-name>
+    <service-ref-name>service/BpelHello</service-ref-name>
     <!-- published WSDL document -->
-    <wsdl-override>http://localhost:8080/hello/caller?wsdl</wsdl-override>
+    <wsdl-override>http://@jbosstest.host.name@:8080/jbossws-samples-wsbpel-hello/greeter?wsdl</wsdl-override>
   </service-ref>
   
 </jboss-client>
\ No newline at end of file

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/classes/bpel-application.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/classes/bpel-application.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/classes/bpel-application.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<bpelApplication name="helloWorld" xmlns="http://jbpm.org/bpel"
+<bpelApplication name="HelloWorld" xmlns="http://jbpm.org/bpel"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://jbpm.org/bpel
                       http://jbpm.org/bpel/bpel_application_1_0.xsd" />
\ No newline at end of file

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/web.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/web.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/web.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -3,16 +3,14 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
   
-  <!-- Hello World -->
+  <!-- Greeter Service Endpoint -->
   <servlet>
-    <servlet-name>callerServlet</servlet-name>
-    <!-- service implementation bean class -->
-    <servlet-class>org.jbpm.bpel.tutorial.hello.HelloPT_Impl</servlet-class>
+    <servlet-name>greeterServlet</servlet-name>
+    <servlet-class>org.jboss.test.ws.samples.wsbpel.hello.Greeter_Impl</servlet-class>
   </servlet>  
   <servlet-mapping>
-    <servlet-name>callerServlet</servlet-name>
-    <!-- endpoint location -->
-    <url-pattern>/caller</url-pattern>
+    <servlet-name>greeterServlet</servlet-name>
+    <url-pattern>/greeter</url-pattern>
   </servlet-mapping>  
   
   <!-- jBPM BPEL Partner Integration -->

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/webservices.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/webservices.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/WEB-INF/webservices.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -15,27 +15,27 @@
     <port-component>
 
       <!-- logical name for the port (unique within the module) -->
-      <port-component-name>callerPort</port-component-name>
-      <!-- WSDL port element (in WSDL implementation file) -->
-      <wsdl-port xmlns:portNS="http://jbpm.org/examples/hello">portNS:callerPort</wsdl-port>
+      <port-component-name>GreeterPort</port-component-name>
+      <!-- WSDL port element (in service.wsdl) -->
+      <wsdl-port xmlns:portNS="http://jbpm.org/examples/hello">portNS:GreeterPort</wsdl-port>
       <!-- service endpoint interface class -->
       <service-endpoint-interface>
-        org.jbpm.bpel.tutorial.hello.HelloPT
+        org.jboss.test.ws.samples.wsbpel.hello.Greeter
       </service-endpoint-interface>
-      <!-- associated servlet (in web-app descriptor) -->
+      <!-- associated servlet (in web-app.xml) -->
       <service-impl-bean>
-        <servlet-link>callerServlet</servlet-link>
+        <servlet-link>greeterServlet</servlet-link>
       </service-impl-bean>
 
       <handler>
 
         <!-- logical name for the handler (unique within the module) -->
-        <handler-name>callerHandler</handler-name>
-        <!-- handler class (in jBPM BPEL library) -->
+        <handler-name>GreeterSoapHandler</handler-name>
+        <!-- handler class (in jbpm-bpel.jar) -->
         <handler-class>org.jbpm.bpel.integration.server.SoapHandler</handler-class>
         
         <init-param>
-          <description>name of the associated partner link</description>
+          <description>name of the partner link served by this port</description>
           <param-name>partnerLinkHandle</param-name>
           <param-value>caller</param-value>
         </init-param>

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/META-INF/bpel-definition.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/META-INF/bpel-definition.xml	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/META-INF/bpel-definition.xml	2006-09-02 01:47:21 UTC (rev 889)
@@ -7,7 +7,7 @@
 
   <!-- makes WSDL interface elements available to the process -->
   <imports>
-    <wsdl namespace="http://jbpm.org/examples/hello" location="hello.wsdl" />
+    <wsdl location="hello.wsdl" />
   </imports>
 
 </bpelDefinition>
\ No newline at end of file

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.bpel
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.bpel	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.bpel	2006-09-02 01:47:21 UTC (rev 889)
@@ -9,7 +9,7 @@
 
   <partnerLinks>
     <!-- establishes the relationship with the caller agent -->
-    <partnerLink name="Caller" partnerLinkType="tns:HelloPLT" myRole="service" />
+    <partnerLink name="caller" partnerLinkType="tns:Greeter-Caller" myRole="Greeter" />
   </partnerLinks>
 
   <variables>
@@ -22,7 +22,7 @@
   <sequence>
     
     <!-- receive the name of a person -->
-    <receive operation="sayHello" partnerLink="Caller" portType="tns:HelloPT"
+    <receive operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="request" createInstance="yes" />
       
     <!-- compose a greeting phrase -->
@@ -36,7 +36,7 @@
     </assign>
     
     <!-- reply with the greeting -->
-    <reply operation="sayHello" partnerLink="Caller" portType="tns:HelloPT"
+    <reply operation="sayHello" partnerLink="caller" portType="tns:Greeter"
       variable="response" />
   </sequence>
 

Modified: branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.wsdl
===================================================================
--- branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.wsdl	2006-09-02 00:37:13 UTC (rev 888)
+++ branches/jbossws-1.0/src/test/resources/samples/wsbpel/hello/bpel/hello.wsdl	2006-09-02 01:47:21 UTC (rev 889)
@@ -10,11 +10,13 @@
                       http://schemas.xmlsoap.org/ws/2003/05/partner-link/ 
                       http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
   
-  <!-- characterizes the relationship between the greeting process and its caller -->
-  <plt:partnerLinkType name="HelloPLT">
-    <plt:role name="service">
-      <plt:portType name="tns:HelloPT"/>
+  <!-- characterizes the relationship between the greeter and its caller -->
+  <plt:partnerLinkType name="Greeter-Caller">
+    <plt:role name="Greeter">
+      <plt:portType name="tns:Greeter"/>
     </plt:role>
+    <!-- the Caller does not provide services to the Greeter,
+         this is why we omit the "Caller" role -->
   </plt:partnerLinkType>
 
   <!-- carries the name of a person -->
@@ -28,7 +30,7 @@
   </message>
 
   <!-- describes the interface presented to callers -->
-  <portType name="HelloPT">
+  <portType name="Greeter">
     <operation name="sayHello">
       <input message="tns:NameMessage"/>
       <output message="tns:GreetingMessage"/>




More information about the jboss-svn-commits mailing list