tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjaniszew...@apache.org
Subject svn commit: r686643 [2/2] - in /tuscany/java/sca/modules/binding-corba-runtime/src: main/java/org/apache/tuscany/sca/binding/corba/impl/ main/java/org/apache/tuscany/sca/binding/corba/impl/service/ main/java/org/apache/tuscany/sca/binding/corba/impl/ty...
Date Sun, 17 Aug 2008 21:26:27 GMT
Added: tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java?rev=686643&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java
(added)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidUnion5.java
Sun Aug 17 14:26:26 2008
@@ -0,0 +1,42 @@
+/*
+ * 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.hierarchy;
+
+import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
+import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
+
+/**
+ * Reused option id
+ */
+public final class InvalidUnion5 {
+
+    @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
+    @SuppressWarnings("unused")
+    private int a;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
+    @SuppressWarnings("unused")
+    private int b;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
+    @SuppressWarnings("unused")
+    private int c;
+
+}

Added: tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java?rev=686643&view=auto
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java
(added)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/RichUnion.java
Sun Aug 17 14:26:26 2008
@@ -0,0 +1,91 @@
+/*
+ * 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.hierarchy;
+
+import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement;
+import org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElementType;
+
+public final class RichUnion {
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 1)
+    private int x;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 2)
+    private float y;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 3)
+    private String z;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.option, optionNumber = 4)
+    private InnerUnion iu;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.defaultOption)
+    private boolean def;
+
+    @CorbaUnionElement(type = CorbaUnionElementType.discriminator)
+    @SuppressWarnings("unused")
+    private int discriminator = -1;
+
+    public int getX() {
+        return x;
+    }
+
+    public void setX(int x) {
+        this.discriminator = 1;
+        this.x = x;
+    }
+
+    public float getY() {
+        return y;
+    }
+
+    public void setY(float y) {
+        this.discriminator = 2;
+        this.y = y;
+    }
+
+    public String getZ() {
+        return z;
+    }
+
+    public void setZ(String z) {
+        this.discriminator = 3;
+        this.z = z;
+    }
+
+    public boolean isDef() {
+        return def;
+    }
+
+    public void setDef(boolean def) {
+        this.discriminator = -1;
+        this.def = def;
+    }
+
+    public InnerUnion getIu() {
+        return iu;
+    }
+
+    public void setIu(InnerUnion iu) {
+        this.discriminator = 4;
+        this.iu = iu;
+    }
+
+}

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java?rev=686643&r1=686642&r2=686643&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java
(original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsServant.java
Sun Aug 17 14:26:26 2008
@@ -19,6 +19,7 @@
 
 package org.apache.tuscany.sca.binding.corba.testing.servants;
 
+import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.RichUnion;
 import org.apache.tuscany.sca.binding.corba.testing.arrays_unions.TestStruct;
 import org.apache.tuscany.sca.binding.corba.testing.arrays_unions._ArraysUnionsTestsImplBase;
 
@@ -34,4 +35,8 @@
         return arg;
     }
 
+    public RichUnion passRichUnion(RichUnion arg) {
+        return arg;
+    }
+
 }

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java?rev=686643&r1=686642&r2=686643&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java
(original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/ArraysUnionsTuscanyServant.java
Sun Aug 17 14:26:26 2008
@@ -21,6 +21,7 @@
 
 import org.apache.tuscany.sca.binding.corba.meta.CorbaArray;
 import org.apache.tuscany.sca.binding.corba.testing.hierarchy.ArraysTestStruct;
+import org.apache.tuscany.sca.binding.corba.testing.hierarchy.RichUnion;
 
 public class ArraysUnionsTuscanyServant {
 
@@ -34,5 +35,9 @@
     public String[][] passStringArray(@CorbaArray( {2, 2})String[][] arg) {
         return arg;
     }
+    
+    public RichUnion passRichUnion(RichUnion arg) { 
+        return arg;
+    }
 
 }

Modified: tuscany/java/sca/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl?rev=686643&r1=686642&r2=686643&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl (original)
+++ tuscany/java/sca/modules/binding-corba-runtime/src/test/resources/arrays_unions.idl Sun
Aug 17 14:26:26 2008
@@ -39,9 +39,23 @@
 								
 								typedef string StringArray[2][2];
 								
+								union InnerUnion switch (long) {
+									case 1: long x;
+									case 2: float y;
+								};
+								
+								union RichUnion switch (long) {
+								    case 1: long x;
+									case 2: float y;
+								    case 3: string z;
+								    case 4: InnerUnion iu;
+								    default: boolean a;
+								};
+								
 								interface ArraysUnionsTests {
 									TestStruct passTestStruct(in TestStruct arg);
 									StringArray passStringArray(in StringArray arg);
+									RichUnion passRichUnion(in RichUnion arg);
 								};
 								
 							};



Mime
View raw message