You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2006/11/01 01:07:19 UTC

svn commit: r469715 - in /incubator/ode/trunk: bpel-test/ bpel-test/src/main/java/org/apache/ode/test/ bpel-test/src/test/java/org/apache/ode/test/ bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/ dao-memory/

Author: mriou
Date: Tue Oct 31 16:07:18 2006
New Revision: 469715

URL: http://svn.apache.org/viewvc?view=rev&rev=469715
Log:
ODE-75 Introduced the notion of process store that handles all configuration and deployment issues for a process. This keeps the runtime clean from all these nasty considerations.

Modified:
    incubator/ode/trunk/bpel-test/pom.xml
    incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java
    incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java
    incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BPELTest.java
    incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Tests.java
    incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel
    incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/test.properties
    incubator/ode/trunk/dao-memory/pom.xml

Modified: incubator/ode/trunk/bpel-test/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/pom.xml?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/pom.xml (original)
+++ incubator/ode/trunk/bpel-test/pom.xml Tue Oct 31 16:07:18 2006
@@ -18,26 +18,31 @@
   ~ under the License.
   -->
 <project>
-  <groupId>org.apache.ode</groupId>
-  <artifactId>ode-test</artifactId>
-  <name>ODE :: BPEL Tests</name>
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
     <groupId>org.apache.ode</groupId>
-    <artifactId>ode</artifactId>
+    <artifactId>ode-test</artifactId>
+    <name>ODE :: BPEL Tests</name>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.ode</groupId>
+        <artifactId>ode</artifactId>
+        <version>2.0-SNAPSHOT</version>
+    </parent>
     <version>2.0-SNAPSHOT</version>
-  </parent>
-  <version>2.0-SNAPSHOT</version>
-  <dependencies>
-   <dependency>
-    <groupId>junit</groupId>
-     <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-        <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.ode</groupId>
-      <artifactId>ode-bpel-runtime</artifactId>
-    </dependency>
-  </dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ode</groupId>
+            <artifactId>ode-bpel-runtime</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ode</groupId>
+            <artifactId>ode-bpel-store</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
 </project>

Modified: incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java (original)
+++ incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java Tue Oct 31 16:07:18 2006
@@ -52,15 +52,12 @@
 public class BindingContextImpl implements BindingContext {
 	
 
-	public EndpointReference activateMyRoleEndpoint(QName processId,
-			DeploymentUnit deploymentUnit, Endpoint myRoleEndpoint,
+	public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint,
 			PortType portType) {
 		final Document doc = DOMUtils.newDocument();
 		Element serviceref = doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
                 EndpointReference.SERVICE_REF_QNAME.getLocalPart());
-        serviceref.setNodeValue(deploymentUnit.getDefinitionForService(myRoleEndpoint.serviceName) +":" +
-                myRoleEndpoint.serviceName +":" +
-                myRoleEndpoint.portName);
+        serviceref.setNodeValue(myRoleEndpoint.serviceName +":" +myRoleEndpoint.portName);
         doc.appendChild(serviceref);
         return new EndpointReference() {
             public Document toXML() {
@@ -73,8 +70,7 @@
 
 	}
 
-	public PartnerRoleChannel createPartnerRoleChannel(QName processId,
-			DeploymentUnit deploymentUnit, PortType portType,
+	public PartnerRoleChannel createPartnerRoleChannel(QName processId, PortType portType,
 			Endpoint initialPartnerEndpoint) {
 		return new PartnerRoleChannelImpl();
 	}

Modified: incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java (original)
+++ incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java Tue Oct 31 16:07:18 2006
@@ -37,8 +37,8 @@
  */
 package org.apache.ode.test;
 
-import org.apache.ode.bpel.deploy.DeploymentManager;
-import org.apache.ode.bpel.deploy.DeploymentUnitImpl;
+import org.apache.ode.store.deploy.DeploymentManager;
+import org.apache.ode.store.deploy.DeploymentUnitImpl;
 
 import java.io.File;
 import java.util.ArrayList;

Modified: incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BPELTest.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BPELTest.java?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BPELTest.java (original)
+++ incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/BPELTest.java Tue Oct 31 16:07:18 2006
@@ -27,18 +27,19 @@
 import junit.framework.TestCase;
 
 import org.apache.ode.bpel.engine.BpelServerImpl;
-import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.iapi.Message;
-import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
+import org.apache.ode.bpel.iapi.*;
 import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
 import org.apache.ode.test.scheduler.TestScheduler;
 import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.store.ProcessStoreImpl;
 import org.w3c.dom.Element;
 
+import java.util.Collection;
+
 public abstract class BPELTest extends TestCase {
 
 	private BpelServerImpl server;
-
+    private ProcessStore store;
 	private MessageExchangeContextImpl mexContext;
 
 	@Override
@@ -49,8 +50,9 @@
 		server.setScheduler(new TestScheduler());
 		server.setBindingContext(new BindingContextImpl());
 		server.setMessageExchangeContext(mexContext);
-		server.setDeploymentManager(new DeploymentManagerImpl());
-		server.init();
+        store = new ProcessStoreImpl(null, null, new DeploymentManagerImpl());
+        server.setProcessStore(store);
+        server.init();
 		server.start();
 	}
 
@@ -73,14 +75,14 @@
 		/**
 		 * The deploy directory must contain at least one "test.properties"
 		 * file.
-		 * 
+		 *
 		 * The test.properties file identifies the service, operation and
 		 * messages to be sent to the BPEL engine.
-		 * 
+		 *
 		 * The deploy directory may contain more than one file in the form of
 		 * "testN.properties" where N represents a monotonic integer beginning
 		 * with 1.
-		 * 
+		 *
 		 */
 
 		int propsFileCnt = 0;
@@ -96,8 +98,12 @@
 		}
 
 		try {
-			server.getDeploymentService().deploy(new File(deployDir));
-		} catch (BpelEngineException bpelE) {
+			Collection<QName> procs =  store.deploy(new File(deployDir));
+            for (QName procName : procs) {
+                server.load(procName, true);
+            }
+
+        } catch (BpelEngineException bpelE) {
 			Properties testProps = new Properties();
 			testProps.load(testPropsFile.toURL().openStream());
 			String responsePattern = testProps.getProperty("response1");
@@ -120,17 +126,17 @@
 			/**
 			 * Each property file must contain at least one request/response
 			 * property tuple.
-			 * 
+			 *
 			 * The request/response tuple should be in the form
-			 * 
+			 *
 			 * requestN=<message>some XML input message</message>
 			 * responseN=.*some response message.*
-			 * 
+			 *
 			 * Where N is a monotonic integer beginning with 1.
-			 * 
+			 *
 			 * If a specific MEP is expected in lieu of a response message use:
 			 * responseN=ASYNC responseN=ONE_WAY responseN=COMPLETED_OK
-			 * 
+			 *
 			 */
 
 			for (int i = 1; testProps.getProperty("request" + i) != null; i++) {
@@ -205,7 +211,7 @@
 		}
 	}
 
-	private void testResponsePattern(Message response, String responsePattern) {
+    private void testResponsePattern(Message response, String responsePattern) {
 		String resp = (response == null) ? "null" : DOMUtils
 				.domToString(response.getMessage());
 		testResponsePattern(resp, responsePattern);

Modified: incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Tests.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Tests.java?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Tests.java (original)
+++ incubator/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/DataHandling20Tests.java Tue Oct 31 16:07:18 2006
@@ -12,10 +12,10 @@
 		go("target/test-classes/bpel/2.0/TestSubTreeAssign");
 	}
     public void testAssignActivity1() throws Exception {
-        go("target/test-classes/bpel/2.0/TestAssignActivity1");
+        go("src/test/resources/bpel/2.0/TestAssignActivity1");
     }
     public void testAssignActivity2() throws Exception {
-        go("target/test-classes/bpel/2.0/TestAssignActivity2");
+        go("src/test/resources/bpel/2.0/TestAssignActivity2");
     }
     public void testSimpleTypeParts() throws Exception {
     	go("target/test-classes/bpel/2.0/TestSimpleTypeParts");

Modified: incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel (original)
+++ incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/TestAssign.bpel Tue Oct 31 16:07:18 2006
@@ -51,6 +51,14 @@
 
         <assign name="assign1">
             <copy>
+                <from>$myVar.TestPart</from>
+                <to>$strVar</to>
+            </copy>
+            <copy>
+                <from>$strVar</from>
+                <to>$myVar.TestPart</to>
+            </copy>
+            <copy>
                 <from>"blah"</from>
                 <to>$strVar</to>
             </copy>
@@ -65,6 +73,10 @@
             <copy>
                 <from>$intVar</from>
                 <to>$intVar2</to>
+            </copy>
+            <copy>
+                <from>$intVar + 1</from>
+                <to>$intVar</to>
             </copy>
             <copy>
                 <from>$intVar + 1</from>

Modified: incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/test.properties
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/test.properties?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/test.properties (original)
+++ incubator/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestAssignActivity1/test.properties Tue Oct 31 16:07:18 2006
@@ -2,4 +2,4 @@
 service=TestAssignService
 operation=testAssign
 request1=<message><TestPart>Hello</TestPart></message>
-response1=.*Hello World6true3.*
\ No newline at end of file
+response1=.*Hello World7true3.*
\ No newline at end of file

Modified: incubator/ode/trunk/dao-memory/pom.xml
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/dao-memory/pom.xml?view=diff&rev=469715&r1=469714&r2=469715
==============================================================================
--- incubator/ode/trunk/dao-memory/pom.xml (original)
+++ incubator/ode/trunk/dao-memory/pom.xml Tue Oct 31 16:07:18 2006
@@ -18,10 +18,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.ode</groupId>
-            <artifactId>ode-sfwk-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ode</groupId>
             <artifactId>ode-utils</artifactId>
         </dependency>
     </dependencies>