summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service')
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java88
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java205
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java71
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java226
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java235
-rw-r--r--sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java380
6 files changed, 1205 insertions, 0 deletions
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java
new file mode 100644
index 0000000000..7ebc3fce85
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestDataType.java
@@ -0,0 +1,88 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import java.lang.reflect.Type;
+
+import org.apache.tuscany.sca.interfacedef.DataType;
+
+/**
+ * Mock DataType implementation. Only few methods needs to be implemented.
+ */
+public class TestDataType<L> implements DataType<L> {
+
+ public Class<?> typeClass;
+ public L logical;
+
+ public TestDataType(Class<?> typeClass) {
+ this.typeClass = typeClass;
+ }
+
+ public TestDataType(Class<?> typeClass, L logical) {
+ this.typeClass = typeClass;
+ this.logical = logical;
+ }
+
+ public String getDataBinding() {
+ return null;
+ }
+
+ public Type getGenericType() {
+ return null;
+ }
+
+ public L getLogical() {
+ return logical;
+ }
+
+ public <T> T getMetaData(Class<T> arg0) {
+ return null;
+ }
+
+ public Class<?> getPhysical() {
+ return typeClass;
+ }
+
+ public void setDataBinding(String arg0) {
+
+ }
+
+ public void setGenericType(Type arg0) {
+
+ }
+
+ public void setLogical(L arg0) {
+
+ }
+
+ public <T> void setMetaData(Class<T> arg0, T arg1) {
+
+ }
+
+ public void setPhysical(Class<?> arg0) {
+
+ }
+
+ @Override
+ public Object clone() {
+ return null;
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
new file mode 100644
index 0000000000..ffee452643
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterface.java
@@ -0,0 +1,205 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterface;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Mock TestInterface implementation. Only few methods needs to be implemented.
+ */
+public class TestInterface implements JavaInterface {
+
+ private List<Operation> operations;
+ private Class<?> javaClass;
+
+ public TestInterface(List<Operation> opearations, Class<?> javaClass) {
+ this.operations = opearations;
+ this.javaClass = javaClass;
+ }
+
+ public List<Operation> getOperations() {
+ return operations;
+ }
+
+ public boolean isConversational() {
+ return false;
+ }
+
+ public boolean isDynamic() {
+ return false;
+ }
+
+ public boolean isRemotable() {
+ return false;
+ }
+
+ @Override
+ public void setRemotableSetFromSCDL() {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public boolean isRemotableSetFromSCDL() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void resetDataBinding(String dataBinding) {
+
+ }
+
+ public void setConversational(boolean conversational) {
+
+ }
+
+ public void setDefaultDataBinding(String dataBinding) {
+
+ }
+
+ public void setRemotable(boolean remotable) {
+
+ }
+
+ public List<PolicySet> getApplicablePolicySets() {
+ return null;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ return null;
+ }
+
+ public List<Intent> getRequiredIntents() {
+ return null;
+ }
+
+ @Override
+ public Object clone() {
+ return null;
+ }
+
+ public Class<?> getCallbackClass() {
+ return null;
+ }
+
+ public Class<?> getJavaClass() {
+ return javaClass;
+ }
+
+ public String getName() {
+ return null;
+ }
+
+ public QName getQName() {
+ return null;
+ }
+
+ public void setCallbackClass(Class<?> arg0) {
+ }
+
+ public void setJavaClass(Class<?> javaClass) {
+ this.javaClass = javaClass;
+ }
+
+ public void setName(String arg0) {
+ }
+
+ public void setQName(QName arg0) {
+
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public void setUnresolved(boolean arg0) {
+ }
+
+ public Map<Object, Object> getAttributes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isRemotableSet() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void resetInterfaceInputTypes(Interface newInterface) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void resetInterfaceOutputTypes(Interface newInterface) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public ExtensionType getExtensionType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setExtensionType(ExtensionType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getJAXWSJavaInterfaceName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setJAXWSJavaInterfaceName(String javaInterfaceName) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getJAXWSWSDLLocation() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setJAXWSWSDLLocation(String wsdlLocation) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Contribution getContributionContainingClass() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setContributionContainingClass(
+ Contribution contributionContainingClass) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java
new file mode 100644
index 0000000000..86610c14fc
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestInterfaceContract.java
@@ -0,0 +1,71 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+
+/**
+ * Mock InterfaceContract implementation. Only few methods needs to be
+ * implemented.
+ */
+public class TestInterfaceContract implements InterfaceContract {
+
+ private Interface iface;
+
+ public Interface getCallbackInterface() {
+ return null;
+ }
+
+ public Interface getInterface() {
+ return iface;
+ }
+
+ public InterfaceContract makeUnidirectional(boolean isCallback) {
+ return null;
+ }
+
+ public void setCallbackInterface(Interface callbackInterface) {
+
+ }
+
+ public void setInterface(Interface callInterface) {
+ this.iface = callInterface;
+ }
+
+ @Override
+ public Object clone() {
+ return null;
+ }
+
+ // By default there is no normalized contract
+ // as only Java needs it
+ public InterfaceContract getNormalizedWSDLContract() {
+ return null;
+ }
+
+ // By default there is no normalized contract
+ // as only Java needs it
+ public void setNormalizedWSDLContract(
+ InterfaceContract wsdlInterfaceContract) {
+ // do nothing
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
new file mode 100644
index 0000000000..50e40896fa
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
@@ -0,0 +1,226 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.Interface;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.interfacedef.ParameterMode;
+import org.apache.tuscany.sca.interfacedef.util.WrapperInfo;
+import org.apache.tuscany.sca.interfacedef.util.XMLType;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+
+/**
+ * Mock Operation implementation. Only few methods needs to be implemented.
+ */
+public class TestOperation implements Operation {
+
+ private DataType<List<DataType>> inputType;
+ private DataType<List<DataType>> outputType;
+ private String name;
+
+ public String getDataBinding() {
+ return null;
+ }
+
+ public Map<QName, List<DataType<XMLType>>> getFaultBeans() {
+ return null;
+ }
+
+ public List<DataType> getFaultTypes() {
+ return null;
+ }
+
+ public DataType<List<DataType>> getInputType() {
+ return inputType;
+ }
+
+ public Interface getInterface() {
+ return null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public DataType getOutputType() {
+ return outputType;
+ }
+
+ public WrapperInfo getInputWrapper() {
+ return null;
+ }
+
+ public WrapperInfo getOutputWrapper() {
+ return null;
+ }
+
+ public boolean isDynamic() {
+ return false;
+ }
+
+ public boolean isNonBlocking() {
+ return false;
+ }
+
+ public boolean isUnresolved() {
+ return false;
+ }
+
+ public boolean isInputWrapperStyle() {
+ return false;
+ }
+
+ public boolean isOutputWrapperStyle() {
+ return false;
+ }
+
+ public void setDataBinding(String dataBinding) {
+
+ }
+
+ public void setDynamic(boolean b) {
+
+ }
+
+ public void setFaultBeans(Map<QName, List<DataType<XMLType>>> faultBeans) {
+
+ }
+
+ public void setFaultTypes(List<DataType> faultTypes) {
+
+ }
+
+ public void setInputType(DataType<List<DataType>> inputType) {
+ this.inputType = inputType;
+ }
+
+ public void setInterface(Interface interfaze) {
+
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setNonBlocking(boolean nonBlocking) {
+
+ }
+
+ public void setOutputType(DataType<List<DataType>> outputType) {
+ this.outputType = outputType;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+
+ }
+
+ public void setInputWrapper(WrapperInfo wrapperInfo) {
+
+ }
+
+ public void setOutputWrapper(WrapperInfo wrapperInfo) {
+
+ }
+
+ public void setInputWrapperStyle(boolean wrapperStyle) {
+
+ }
+
+ public void setOutputWrapperStyle(boolean wrapperStyle) {
+
+ }
+
+ public List<PolicySet> getApplicablePolicySets() {
+ return null;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ return null;
+ }
+
+ @Override
+ public Object clone() {
+ return null;
+ }
+
+ public List<Intent> getRequiredIntents() {
+ return null;
+ }
+
+ public Map<Object, Object> getAttributes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ExtensionType getExtensionType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setExtensionType(ExtensionType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isAsyncServer() {
+ return false;
+ }
+
+ public List<ParameterMode> getParameterModes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<DataType> getOutputTypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public boolean hasArrayWrappedOutput() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setHasArrayWrappedOutput(boolean arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void setNotSubjectToWrapping(boolean notSubjectToWrapping) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isNotSubjectToWrapping() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
new file mode 100644
index 0000000000..e582ba0352
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
@@ -0,0 +1,235 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Callback;
+import org.apache.tuscany.sca.assembly.ComponentReference;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.Extension;
+import org.apache.tuscany.sca.assembly.Service;
+import org.apache.tuscany.sca.interfacedef.DataType;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.runtime.RuntimeComponentService;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+
+/**
+ * Mock RuntimeComponentService implementation. Only few methods needs to be
+ * implemented.
+ */
+public class TestRuntimeComponentService implements RuntimeComponentService {
+
+ private InterfaceContract interfaceContract;
+ private RuntimeEndpoint runtimeWire;
+
+ public TestRuntimeComponentService(Object invocationTarget) {
+ List<Operation> operations = new ArrayList<Operation>();
+ Method[] methods = invocationTarget.getClass().getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ int mod = methods[i].getModifiers();
+ if (methods[i].getDeclaringClass().equals(invocationTarget.getClass()) && Modifier.isPublic(mod)
+ && !methods[i].getName().startsWith("_")) {
+ Operation operation = new TestOperation();
+ DataType returnType = new TestDataType(methods[i].getReturnType());
+ List<DataType> outputDataTypes = new ArrayList<DataType>();
+ outputDataTypes.add(returnType);
+ TestDataType<List<DataType>> outputDataType = new TestDataType<List<DataType>>(null, outputDataTypes);
+ operation.setOutputType(outputDataType);
+
+ Class<?>[] argTypes = methods[i].getParameterTypes();
+ List<DataType> argDataTypes = new ArrayList<DataType>();
+ for (int j = 0; j < argTypes.length; j++) {
+ argDataTypes.add(new TestDataType(argTypes[j]));
+ }
+ TestDataType<List<DataType>> inputDataType = new TestDataType<List<DataType>>(null, argDataTypes);
+ operation.setInputType(inputDataType);
+ operations.add(operation);
+ operation.setName(methods[i].getName());
+ }
+ }
+ TestInterface iface = new TestInterface(operations, invocationTarget.getClass());
+ interfaceContract = new TestInterfaceContract();
+ interfaceContract.setInterface(iface);
+ runtimeWire = new TestRuntimeWire(interfaceContract, invocationTarget);
+ }
+
+ public ComponentReference getCallbackReference() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Service getService() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setCallbackReference(ComponentReference callbackReference) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setService(Service service) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public List<Endpoint> getEndpoints() {
+ // TODO Auto-generated method stub
+ return Arrays.asList((Endpoint)runtimeWire);
+ }
+
+ public <B> B getBinding(Class<B> bindingClass) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Binding getBinding(String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Binding> getBindings() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Callback getCallback() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public <B> B getCallbackBinding(Class<B> bindingClass) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public InterfaceContract getInterfaceContract(Binding binding) {
+ // TODO Auto-generated method stub
+ return interfaceContract;
+ }
+
+ public boolean isOverridingBindings() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setCallback(Callback callback) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setOverridingBindings(boolean overridingBindings) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public InterfaceContract getInterfaceContract() {
+ // TODO Auto-generated method stub
+ return interfaceContract;
+ }
+
+ public String getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isForCallback() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setForCallback(boolean isCallback) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setInterfaceContract(InterfaceContract interfaceContract) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setName(String name) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public List<Extension> getAttributeExtensions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Object> getExtensions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ // TODO Auto-generated method stub
+ return super.clone();
+ }
+
+ public ExtensionType getExtensionType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<PolicySet> getPolicySets() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<Intent> getRequiredIntents() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setExtensionType(ExtensionType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isJAXWSService() {
+ return false;
+ }
+
+ public void setJAXWSService(boolean isJAXWSService) {
+ }
+}
diff --git a/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
new file mode 100644
index 0000000000..39a13dcef5
--- /dev/null
+++ b/sca-java-2.x/tags/2.0.1-RC1/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeWire.java
@@ -0,0 +1,380 @@
+/*
+ * 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.tuscany.sca.binding.corba.testing.service.mocks;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Contract;
+import org.apache.tuscany.sca.assembly.EndpointReference;
+import org.apache.tuscany.sca.context.CompositeContext;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.invocation.InvocationChain;
+import org.apache.tuscany.sca.invocation.Message;
+import org.apache.tuscany.sca.policy.ExtensionType;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.provider.PolicyProvider;
+import org.apache.tuscany.sca.provider.ServiceBindingProvider;
+import org.apache.tuscany.sca.runtime.DomainRegistry;
+import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
+import org.apache.tuscany.sca.runtime.RuntimeEndpointReference;
+
+/**
+ * Mock RuntimeWire implementation. Only few methods needs to be implemented.
+ */
+public class TestRuntimeWire implements RuntimeEndpoint {
+ private Object invocationTarget;
+ private InterfaceContract interfaceContract;
+
+ public TestRuntimeWire(InterfaceContract interfaceContract, Object invocationTarget) {
+ this.interfaceContract = interfaceContract;
+ this.invocationTarget = invocationTarget;
+ }
+
+
+ public Object invoke(Operation operation, Object[] args) throws InvocationTargetException {
+ Class<?>[] types = new Class<?>[args.length];
+ for (int i = 0; i < args.length; i++) {
+ types[i] = args[i].getClass();
+ }
+ Object result = null;
+ try {
+ Method[] methods = invocationTarget.getClass().getMethods();
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(operation.getName())) {
+ result = methods[i].invoke(invocationTarget, args);
+ break;
+ }
+ }
+ } catch (InvocationTargetException e) {
+ throw e;
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ // TODO Auto-generated method stub
+ return super.clone();
+ }
+
+
+ public InterfaceContract getBindingInterfaceContract() {
+ // TODO Auto-generated method stub
+ return interfaceContract;
+ }
+
+
+ public ServiceBindingProvider getBindingProvider() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public InterfaceContract getComponentTypeServiceInterfaceContract() {
+ // TODO Auto-generated method stub
+ return interfaceContract;
+ }
+
+
+ public void setBindingProvider(ServiceBindingProvider provider) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public boolean isUnresolved() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ public void setUnresolved(boolean unresolved) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public ExtensionType getExtensionType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public List<PolicySet> getPolicySets() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public List<Intent> getRequiredIntents() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public void setExtensionType(ExtensionType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void bind(CompositeContext context) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void bind(ExtensionPointRegistry registry, DomainRegistry domainRegistry) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public InvocationChain getBindingInvocationChain() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public CompositeContext getCompositeContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public Contract getContract() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public InvocationChain getInvocationChain(Operation operation) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public List<InvocationChain> getInvocationChains() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public List<PolicyProvider> getPolicyProviders() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public Message invoke(Message msg) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public Message invoke(Operation operation, Message msg) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void invokeAsync(Operation operation, Message msg) {
+ }
+
+ public void invokeAsyncResponse(Message msg) {
+ }
+
+ public void unbind() {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public Binding getBinding() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public List<EndpointReference> getCallbackEndpointReferences() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public Component getComponent() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public InterfaceContract getComponentServiceInterfaceContract() {
+ // TODO Auto-generated method stub
+ return interfaceContract;
+ }
+
+
+ public ComponentService getService() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public String getURI() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public boolean isRemote() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ public boolean matches(String serviceURI) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ public void setBinding(Binding binding) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void setComponent(Component component) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void setRemote(boolean remote) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void setService(ComponentService service) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ public void setURI(String uri) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setGeneratedWSDLContract(InterfaceContract wsdlContract){
+
+ }
+
+ public InterfaceContract getGeneratedWSDLContract(){
+ return null;
+ }
+
+ public void validateServiceInterfaceCompatibility() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public InterfaceContract getGeneratedWSDLContract(
+ InterfaceContract interfaceContract) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isAsyncInvocation() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
+ @Override
+ public void invokeAsync(Message msg) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void createAsyncServerCallback() {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public RuntimeEndpointReference getAsyncServerCallback() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public String getDeployedURI() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public void setDeployedURI(String deployedURI) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public RuntimeEndpoint getDelegateEndpoint() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setDelegateEndpoint(RuntimeEndpoint delegateEndpoint) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getSpecVersion() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setSpecVersion(String specVersion) {
+ // TODO Auto-generated method stub
+
+ }
+}