Author: lwaterman
Date: Wed Sep 13 21:55:34 2006
New Revision: 443230

URL: http://svn.apache.org/viewvc?view=rev&rev=443230
Log:
Changes to get unit test working - see [JIRA ODE-9]

Added:
    
incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java
Modified:
    
incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/BindingContextImpl.java

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=443230&r1=443229&r2=443230
==============================================================================
--- 
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
 Wed Sep 13 21:55:34 2006
@@ -13,12 +13,12 @@
 import org.w3c.dom.Element;
 
 public class BindingContextImpl implements BindingContext {
+       
 
-       public Element activateMyRoleEndpoint(QName processId,
+       public EndpointReference activateMyRoleEndpoint(QName processId,
                        DeploymentUnit deploymentUnit, Endpoint myRoleEndpoint,
                        PortType portType) {
-               
-               Document doc = DOMUtils.newDocument();
+               final Document doc = DOMUtils.newDocument();
                Element serviceref = 
doc.createElementNS(EndpointReference.SERVICE_REF_QNAME.getNamespaceURI(),
                 EndpointReference.SERVICE_REF_QNAME.getLocalPart());
         
serviceref.setNodeValue(deploymentUnit.getDefinitionForNamespace(myRoleEndpoint.serviceName
@@ -26,7 +26,11 @@
                 myRoleEndpoint.serviceName +":" +
                 myRoleEndpoint.portName);
         doc.appendChild(serviceref);
-               return doc.getDocumentElement();
+        return new EndpointReference() {
+            public Document toXML() {
+              return doc;
+            }
+        };
        }
 
        public void deactivateMyRoleEndpoint(Endpoint myRoleEndpoint) {

Added: 
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=auto&rev=443230
==============================================================================
--- 
incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java
 (added)
+++ 
incubator/ode/trunk/bpel-test/src/main/java/org/apache/ode/test/DeploymentManagerImpl.java
 Wed Sep 13 21:55:34 2006
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.test;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.deploy.DeploymentManager;
+import org.apache.ode.bpel.deploy.DeploymentUnitImpl;
+
+/**
+ * A non-persistent implementation of the
+ * [EMAIL PROTECTED] org.apache.ode.bpel.deploy.DeploymentManager} interface.
+ */
+
+public class DeploymentManagerImpl implements DeploymentManager {
+       
+    private static final Log __log = 
LogFactory.getLog(DeploymentManagerImpl.class);
+    private ArrayList<DeploymentUnitImpl> _knownDeployments = new 
ArrayList<DeploymentUnitImpl>();
+
+    
+       public DeploymentUnitImpl createDeploymentUnit(String location) {
+        return createDeploymentUnit(new File(location));
+       }
+
+       public DeploymentUnitImpl createDeploymentUnit(File 
deploymentUnitDirectory) {
+        DeploymentUnitImpl du = new 
DeploymentUnitImpl(deploymentUnitDirectory);
+        _knownDeployments.add(du);
+        return du;
+       }
+
+       public Collection<DeploymentUnitImpl> getDeploymentUnits() {
+        return new ArrayList<DeploymentUnitImpl>(_knownDeployments);
+       }
+
+       public void remove(DeploymentUnitImpl du) {
+        _knownDeployments.remove(du);
+
+       }
+
+}


Reply via email to