summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-corba-runtime
diff options
context:
space:
mode:
authorscottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68>2011-02-15 14:52:26 +0000
committerscottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68>2011-02-15 14:52:26 +0000
commit5fa13700d2f3ffbdad03d772f2e2398bb3371a36 (patch)
tree9f82cc56a7e28a24ffa53f063022c2f7faf3c9bc /sca-java-2.x/trunk/modules/binding-corba-runtime
parentfa76bf91f5918d44c9d72c3d7ad8461210516e3d (diff)
Test fix needed for TUSCANY-3832 changes, plus cleanup and adjustment from recent multiple output support.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1070928 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-corba-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java3
-rw-r--r--sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java17
-rw-r--r--sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java53
-rw-r--r--sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java6
4 files changed, 48 insertions, 31 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java
index 0ad3b2240e..cd48d81b1a 100644
--- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java
+++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java
@@ -62,7 +62,8 @@ public class CorbaInvoker implements Invoker {
request.setOperationsMap(operationsMap);
if (msg.getOperation().getOutputType() != null) {
Annotation[] notes = operationMethodMapping.get(msg.getOperation()).getAnnotations();
- request.setOutputType(msg.getOperation().getOutputType().getPhysical(), notes);
+ DataType returnType = msg.getOperation().getOutputType().getLogical().get(0);
+ request.setOutputType(returnType.getPhysical(), notes);
}
java.lang.Object[] args = msg.getBody();
if (args != null) {
diff --git a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java
index 5babc25b07..923f9d7a7e 100644
--- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java
+++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java
@@ -71,12 +71,16 @@ public class ComponentInvocationProxy implements InvocationProxy {
OperationTypes operationTypes = new OperationTypes();
List<TypeTree> inputInstances = new ArrayList<TypeTree>();
// cache output type tree
- if (operation.getOutputType() != null && operation.getOutputType().getPhysical() != null
- && !operation.getOutputType().getPhysical().equals(void.class)) {
- Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
- TypeTree outputType =
- TypeTreeCreator.createTypeTree(operation.getOutputType().getPhysical(), notes);
- operationTypes.setOutputType(outputType);
+ if (operation.getOutputType() != null) {
+ // Should only be one output, since this was created when we only supported one output.
+ DataType returnType = operation.getOutputType().getLogical().get(0);
+ Class<?> returnClass = returnType.getPhysical();
+ if (returnClass != null && !returnClass.equals(void.class)) {
+ Annotation[] notes = operationMethodMapping.get(operation).getAnnotations();
+ TypeTree outputType =
+ TypeTreeCreator.createTypeTree(returnClass, notes);
+ operationTypes.setOutputType(outputType);
+ }
}
// cache input types trees
if (operation.getInputType() != null) {
@@ -89,7 +93,6 @@ public class ComponentInvocationProxy implements InvocationProxy {
inputInstances.add(inputType);
i++;
}
-
}
operationTypes.setInputType(inputInstances);
operationsCache.put(operation, operationTypes);
diff --git a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
index fe62d1babb..81bbcec3f6 100644
--- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
+++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
@@ -40,7 +40,7 @@ import org.apache.tuscany.sca.policy.PolicySet;
public class TestOperation implements Operation {
private DataType<List<DataType>> inputType;
- private DataType outputType;
+ private DataType<List<DataType>> outputType;
private String name;
public String getDataBinding() {
@@ -123,7 +123,7 @@ public class TestOperation implements Operation {
}
- public void setOutputType(DataType outputType) {
+ public void setOutputType(DataType<List<DataType>> outputType) {
this.outputType = outputType;
}
@@ -171,31 +171,40 @@ public class TestOperation implements Operation {
}
- public boolean isAsyncServer() {
- return false;
- }
+ public boolean isAsyncServer() {
+ return false;
+ }
- public List<ParameterMode> getParameterModes() {
- // TODO Auto-generated method stub
- return null;
- }
+ public List<ParameterMode> getParameterModes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
- public List<DataType> getOutputTypes() {
- // 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 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/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
index d31500c85a..175d81b7f0 100644
--- a/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
+++ b/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
@@ -58,7 +58,11 @@ public class TestRuntimeComponentService implements RuntimeComponentService {
&& !methods[i].getName().startsWith("_")) {
Operation operation = new TestOperation();
DataType returnType = new TestDataType(methods[i].getReturnType());
- operation.setOutputType(returnType);
+ 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++) {