You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sc...@apache.org on 2011/02/15 15:52:27 UTC

svn commit: r1070928 - in /tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src: main/java/org/apache/tuscany/sca/binding/corba/provider/ main/java/org/apache/tuscany/sca/binding/corba/provider/service/ test/java/org/apache/tuscany/sca/binding/...

Author: scottkurz
Date: Tue Feb 15 14:52:26 2011
New Revision: 1070928

URL: http://svn.apache.org/viewvc?rev=1070928&view=rev
Log:
Test fix needed for TUSCANY-3832 changes, plus cleanup and adjustment from recent multiple output support.

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
    tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java?rev=1070928&r1=1070927&r2=1070928&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/CorbaInvoker.java Tue Feb 15 14:52:26 2011
@@ -62,7 +62,8 @@ public class CorbaInvoker implements Inv
             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) {

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java?rev=1070928&r1=1070927&r2=1070928&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/main/java/org/apache/tuscany/sca/binding/corba/provider/service/ComponentInvocationProxy.java Tue Feb 15 14:52:26 2011
@@ -71,12 +71,16 @@ public class ComponentInvocationProxy im
                 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 im
                         inputInstances.add(inputType);
                         i++;
                     }
-
                 }
                 operationTypes.setInputType(inputInstances);
                 operationsCache.put(operation, operationTypes);

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java?rev=1070928&r1=1070927&r2=1070928&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestOperation.java Tue Feb 15 14:52:26 2011
@@ -40,7 +40,7 @@ import org.apache.tuscany.sca.policy.Pol
 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 Op
 
     }
 
-    public void setOutputType(DataType outputType) {
+    public void setOutputType(DataType<List<DataType>>  outputType) {
         this.outputType = outputType;
     }
 
@@ -171,31 +171,40 @@ public class TestOperation implements Op
         
     }
 
-	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 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;
+    }
 
 }

Modified: tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java?rev=1070928&r1=1070927&r2=1070928&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/service/mocks/TestRuntimeComponentService.java Tue Feb 15 14:52:26 2011
@@ -58,7 +58,11 @@ public class TestRuntimeComponentService
                 && !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++) {