[jbpm-commits] JBoss JBPM SVN: r1977 - in jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration: def and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Aug 22 00:44:53 EDT 2008


Author: alex.guizar at jboss.com
Date: 2008-08-22 00:44:52 -0400 (Fri, 22 Aug 2008)
New Revision: 1977

Modified:
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/client/SoapCallerTest.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/InvokeActionTest.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/ReplyActionTest.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/AbstractListenerTestCase.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/RequestListenerTest.java
   jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/server/SoapHandlerTest.java
Log:
incorporate jPDL 3.2.3 enterprise enhancements: BPEL-297

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/client/SoapCallerTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/client/SoapCallerTest.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/client/SoapCallerTest.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -40,7 +40,7 @@
 import org.jbpm.bpel.xml.util.XmlUtil;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/01/30 07:19:06 $
  */
 public class SoapCallerTest extends TestCase {

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/InvokeActionTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/InvokeActionTest.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/InvokeActionTest.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -17,15 +17,11 @@
 import java.util.Map;
 import java.util.Random;
 
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
 import javax.xml.namespace.QName;
 import javax.xml.transform.dom.DOMSource;
 
 import junit.framework.Test;
 
-import org.w3c.dom.Element;
-
 import org.jbpm.bpel.deploy.DeploymentDescriptor;
 import org.jbpm.bpel.deploy.PartnerLinkDescriptor;
 import org.jbpm.bpel.deploy.PartnerRoleDescriptor;
@@ -50,6 +46,7 @@
 import org.jbpm.bpel.xml.util.XmlUtil;
 import org.jbpm.graph.exe.ProcessInstance;
 import org.jbpm.graph.exe.Token;
+import org.w3c.dom.Element;
 
 /**
  * @author Alejandro Guizar
@@ -101,30 +98,17 @@
     deploymentDescriptor.setServiceCatalog(catalog);
     deploymentDescriptor.addPartnerLink(partnerLink);
 
-    // link jms administered objects
-    InitialContext initialContext = new InitialContext();
-    try {
-      initialContext.rebind("pl", new LinkRef("queue/testQueue"));
-      initialContext.rebind(IntegrationControl.CONNECTION_FACTORY_NAME, new LinkRef(
-          "ConnectionFactory"));
-
-      // configure relation service factory
-      integrationControl = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration)
-          .getIntegrationControl(processDefinition);
-      integrationControl.setDeploymentDescriptor(deploymentDescriptor);
-      IntegrationControlHelper.setUp(integrationControl, jbpmContext);
-
-      // unlink jms administered objects
-      initialContext.unbind("pl");
-      initialContext.unbind(IntegrationControl.CONNECTION_FACTORY_NAME);
-    }
-    finally {
-      initialContext.close();
-    }
+    // configure integration components
+    JmsIntegrationServiceFactory integrationServiceFactory = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration);
+    integrationServiceFactory.setConnectionFactoryName("ConnectionFactory");
+    integrationControl = integrationServiceFactory.getIntegrationControl(processDefinition);
+    integrationControl.setDeploymentDescriptor(deploymentDescriptor);
+    // bind port entries and lookup destinations
+    IntegrationControlHelper.setUp(integrationControl, jbpmContext);
   }
 
   protected void tearDown() throws Exception {
-    // finalize relation service factory
+    // unbind port entries
     IntegrationControlHelper.tearDown(integrationControl);
     // tear down db
     super.tearDown();
@@ -162,8 +146,8 @@
         token);
     messageValue.setPart("clientName", clientName);
     /*
-     * call status operation - quote is an one-way operation, so the status change might not be
-     * reflected immediately
+     * call status operation - quote is an one-way operation, so the status
+     * change might not be reflected immediately
      */
     Thread.sleep(500);
     ReceiveAction.getIntegrationService(jbpmContext).invoke(statusInvoker, token);

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/ReplyActionTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/ReplyActionTest.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/def/ReplyActionTest.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -21,14 +21,9 @@
 import javax.jms.MessageConsumer;
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
 
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
 import org.jbpm.bpel.deploy.DeploymentDescriptor;
 import org.jbpm.bpel.graph.basic.Receive;
 import org.jbpm.bpel.graph.basic.Reply;
@@ -52,9 +47,11 @@
 import org.jbpm.bpel.xml.util.XmlUtil;
 import org.jbpm.graph.exe.ProcessInstance;
 import org.jbpm.graph.exe.Token;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/06/12 08:18:54 $
  */
 public class ReplyActionTest extends AbstractDbTestCase {
@@ -180,30 +177,17 @@
     deploymentDescriptor.setName(processDefinition.getName());
     deploymentDescriptor.setTargetNamespace(processDefinition.getTargetNamespace());
 
-    InitialContext initialContext = new InitialContext();
-    try {
-      // link jms administered objects
-      initialContext.rebind(IntegrationControl.CONNECTION_FACTORY_NAME, new LinkRef(
-          "ConnectionFactory"));
-      initialContext.rebind("pl", new LinkRef("queue/testQueue"));
+    // configure integration components
+    JmsIntegrationServiceFactory integrationServiceFactory = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration);
+    integrationServiceFactory.setConnectionFactoryName("ConnectionFactory");
+    integrationServiceFactory.setRequestDestinationName("queue/A");
+    integrationServiceFactory.setResponseDestinationName("queue/B");
+    integrationControl = integrationServiceFactory.getIntegrationControl(processDefinition);
+    integrationControl.setDeploymentDescriptor(deploymentDescriptor);
+    IntegrationControlHelper.setUp(integrationControl, jbpmContext);
 
-      // configure relation context
-      integrationControl = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration)
-          .getIntegrationControl(processDefinition);
-      integrationControl.setDeploymentDescriptor(deploymentDescriptor);
-      IntegrationControlHelper.setUp(integrationControl, jbpmContext);
-
-      // unlink jms administered objects
-      initialContext.unbind(IntegrationControl.CONNECTION_FACTORY_NAME);
-      initialContext.unbind("pl");
-    }
-    finally {
-      initialContext.close();
-    }
-
     // retrieve the partner link destination
-    PartnerLinkDefinition partnerLink = processDefinition.getGlobalScope().getPartnerLink(
-        "pl");
+    PartnerLinkDefinition partnerLink = processDefinition.getGlobalScope().getPartnerLink("pl");
     portDestination = integrationControl.getPartnerLinkEntry(partnerLink).getDestination();
   }
 

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/AbstractListenerTestCase.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/AbstractListenerTestCase.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/AbstractListenerTestCase.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -23,14 +23,9 @@
 import javax.jms.Message;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
 import javax.wsdl.Definition;
 import javax.xml.namespace.QName;
 
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-
 import org.jbpm.bpel.deploy.DeploymentDescriptor;
 import org.jbpm.bpel.graph.basic.Receive;
 import org.jbpm.bpel.graph.def.BpelProcessDefinition;
@@ -52,9 +47,11 @@
 import org.jbpm.graph.exe.ExecutionContext;
 import org.jbpm.graph.exe.Token;
 import org.jbpm.instantiation.Delegation;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/06/12 08:18:54 $
  */
 public abstract class AbstractListenerTestCase extends AbstractDbTestCase {
@@ -163,27 +160,15 @@
     deploymentDescriptor.setName(processDefinition.getName());
     deploymentDescriptor.setTargetNamespace(processDefinition.getTargetNamespace());
 
-    InitialContext initialContext = new InitialContext();
-    try {
-      // link jms administered objects
-      initialContext.bind(IntegrationControl.CONNECTION_FACTORY_NAME, new LinkRef(
-          "ConnectionFactory"));
-      initialContext.rebind("pl", new LinkRef("queue/testQueue"));
+    // configure integration components
+    JmsIntegrationServiceFactory integrationServiceFactory = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration);
+    integrationServiceFactory.setConnectionFactoryName("ConnectionFactory");
+    integrationServiceFactory.setRequestDestinationName("queue/A");
+    integrationServiceFactory.setResponseDestinationName("queue/B");
+    integrationControl = integrationServiceFactory.getIntegrationControl(processDefinition);
+    integrationControl.setDeploymentDescriptor(deploymentDescriptor);
+    IntegrationControlHelper.setUp(integrationControl, jbpmContext);
 
-      // configure relation service factory
-      integrationControl = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration)
-          .getIntegrationControl(processDefinition);
-      integrationControl.setDeploymentDescriptor(deploymentDescriptor);
-      IntegrationControlHelper.setUp(integrationControl, jbpmContext);
-
-      // unlink jms administered objects
-      initialContext.unbind(IntegrationControl.CONNECTION_FACTORY_NAME);
-      initialContext.unbind("pl");
-    }
-    finally {
-      initialContext.close();
-    }
-
     jmsSession = integrationControl.getJmsConnection().createSession(false,
         Session.CLIENT_ACKNOWLEDGE);
   }

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/RequestListenerTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/RequestListenerTest.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/jms/RequestListenerTest.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -25,7 +25,7 @@
 import org.jbpm.graph.exe.Token;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2007/08/08 11:20:32 $
  */
 public class RequestListenerTest extends AbstractListenerTestCase {
@@ -62,6 +62,9 @@
   }
 
   protected void closeListener() throws JMSException {
-    // we created a one-shot request listener, no need to close it
+    RequestListener requestListener = integrationControl.removeRequestListener(receiveAction, token);
+    // request listener might have been executed and removed already
+    if (requestListener != null)
+      requestListener.close();
   }
 }
\ No newline at end of file

Modified: jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/server/SoapHandlerTest.java
===================================================================
--- jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/server/SoapHandlerTest.java	2008-08-22 04:36:35 UTC (rev 1976)
+++ jbpm3/branches/jpdl-3.2.3.CP/bpel/library/src/test/java/org/jbpm/bpel/integration/server/SoapHandlerTest.java	2008-08-22 04:44:52 UTC (rev 1977)
@@ -27,8 +27,6 @@
 import javax.jms.MessageProducer;
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.xml.namespace.QName;
@@ -67,7 +65,7 @@
 import org.jbpm.bpel.xml.util.XmlUtil;
 
 /**
- * @author Alejandro Guízar
+ * @author Alejandro Guizar
  * @version $Revision$ $Date: 2008/06/12 08:18:55 $
  */
 public class SoapHandlerTest extends AbstractDbTestCase {
@@ -194,7 +192,8 @@
     super.setUp();
 
     // create bpel definition
-    BpelProcessDefinition processDefinition = new BpelProcessDefinition("testProcess", BpelConstants.NS_EXAMPLES);
+    BpelProcessDefinition processDefinition = new BpelProcessDefinition("testProcess",
+        BpelConstants.NS_EXAMPLES);
 
     definition = WsdlUtil.getFactory()
         .newWSDLReader()
@@ -235,29 +234,15 @@
     DeploymentDescriptor deploymentDescriptor = new DeploymentDescriptor();
     deploymentDescriptor.setName(processDefinition.getName());
 
-    InitialContext initialContext = new InitialContext();
-    try {
-      // link jms administered objects
-      initialContext.rebind(IntegrationControl.CONNECTION_FACTORY_NAME, new LinkRef(
-          "ConnectionFactory"));
-      initialContext.rebind("rpcPl", new LinkRef("queue/testQueue"));
-      initialContext.rebind("docPl", new LinkRef("queue/testQueue"));
-
-      // configure relation context
-      integrationControl = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration)
-          .getIntegrationControl(processDefinition);
-      integrationControl.setDeploymentDescriptor(deploymentDescriptor);
-      // bind port entries and lookup destinations
-      IntegrationControlHelper.setUp(integrationControl, jbpmContext);
-
-      // unlink jms administered objects
-      initialContext.unbind(IntegrationControl.CONNECTION_FACTORY_NAME);
-      initialContext.unbind("rpcPl");
-      initialContext.unbind("docPl");
-    }
-    finally {
-      initialContext.close();
-    }
+    // configure integration components
+    JmsIntegrationServiceFactory integrationServiceFactory = JmsIntegrationServiceFactory.getConfigurationInstance(jbpmConfiguration);
+    integrationServiceFactory.setConnectionFactoryName("ConnectionFactory");
+    integrationServiceFactory.setRequestDestinationName("queue/A");
+    integrationServiceFactory.setResponseDestinationName("queue/B");
+    integrationControl = integrationServiceFactory.getIntegrationControl(processDefinition);
+    integrationControl.setDeploymentDescriptor(deploymentDescriptor);
+    // bind port entries and lookup destinations
+    IntegrationControlHelper.setUp(integrationControl, jbpmContext);
   }
 
   protected void tearDown() throws Exception {
@@ -493,7 +478,8 @@
     Connection connection = integrationControl.getJmsConnection();
     Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
     try {
-      Destination replyTo = integrationControl.getIntegrationServiceFactory().getResponseDestination();
+      Destination replyTo = integrationControl.getIntegrationServiceFactory()
+          .getResponseDestination();
       MessageProducer producer = session.createProducer(replyTo);
       // create parts map
       Map responseParts = createOutputRpcParts();
@@ -555,7 +541,8 @@
     Connection connection = integrationControl.getJmsConnection();
     Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
     try {
-      Destination replyTo = integrationControl.getIntegrationServiceFactory().getResponseDestination();
+      Destination replyTo = integrationControl.getIntegrationServiceFactory()
+          .getResponseDestination();
       MessageProducer producer = session.createProducer(replyTo);
       // create parts map
       Map responseParts = createOutputDocParts();




More information about the jbpm-commits mailing list