diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-20 17:57:47 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-20 17:57:47 +0000 |
commit | 80c2130923497ebb90a51e8c7839e9ac39c1febf (patch) | |
tree | ad54d6f6fd1a6648eba7d828411df903763826f2 /java/sca/modules/binding-corba-runtime/src/test | |
parent | fa66067486ac7fb8e141778b0f5c3de356069254 (diff) |
Apply the patch from Wojtek for TUSCANY-2357. Thanks.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@670012 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-corba-runtime/src/test')
18 files changed, 1083 insertions, 39 deletions
diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java index ed9d6dfc29..9bfcdaa5d1 100644 --- a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/CorbaTypesTestCase.java @@ -27,13 +27,21 @@ import org.apache.tuscany.sca.binding.corba.impl.exceptions.CorbaException; import org.apache.tuscany.sca.binding.corba.impl.exceptions.RequestConfigurationException; import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaRequest; import org.apache.tuscany.sca.binding.corba.impl.reference.DynaCorbaResponse; +import org.apache.tuscany.sca.binding.corba.testing.enums.Color; import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.DivByZero; import org.apache.tuscany.sca.binding.corba.testing.exceptions.CalcPackage.NotSupported; +import org.apache.tuscany.sca.binding.corba.testing.generated.SimpleStruct; +import org.apache.tuscany.sca.binding.corba.testing.generated.SomeStruct; import org.apache.tuscany.sca.binding.corba.testing.hierarchy.DummyObject; -import org.apache.tuscany.sca.binding.corba.testing.hierarchy.SimpleStruct; -import org.apache.tuscany.sca.binding.corba.testing.hierarchy.SomeStruct; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum1; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum2; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidEnum3; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct1; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct2; +import org.apache.tuscany.sca.binding.corba.testing.hierarchy.InvalidStruct3; import org.apache.tuscany.sca.binding.corba.testing.servants.ArraysSetterServant; import org.apache.tuscany.sca.binding.corba.testing.servants.CalcServant; +import org.apache.tuscany.sca.binding.corba.testing.servants.EnumManagerServant; import org.apache.tuscany.sca.binding.corba.testing.servants.ObjectManagerServant; import org.apache.tuscany.sca.binding.corba.testing.servants.PrimitivesSetterServant; import org.apache.tuscany.sca.binding.corba.testing.servants.TestObjectServant; @@ -56,6 +64,7 @@ public class CorbaTypesTestCase extends TestCase { private Object refTestObject; private Object refCalcObject; private Object refObjectManager; + private Object refEnumManager; /** * Spawns tnameserv process (must be in PATH). Initializes test servants and @@ -85,6 +94,7 @@ public class CorbaTypesTestCase extends TestCase { TestObjectServant complexObject = new TestObjectServant(); CalcServant calcObject = new CalcServant(); ObjectManagerServant objectManager = new ObjectManagerServant(); + EnumManagerServant enumManager = new EnumManagerServant(); orb.connect(singleSetter); orb.connect(arraysSetter); @@ -107,11 +117,15 @@ public class CorbaTypesTestCase extends TestCase { nc = new NameComponent("CalcObject", ""); path = new NameComponent[] { nc }; namingContext.rebind(path, calcObject); - + nc = new NameComponent("ObjectManager", ""); path = new NameComponent[] { nc }; namingContext.rebind(path, objectManager); + nc = new NameComponent("EnumManager", ""); + path = new NameComponent[] { nc }; + namingContext.rebind(path, enumManager); + NamingContextExt nce = NamingContextExtHelper.narrow(orb .resolve_initial_references("NameService")); @@ -120,6 +134,7 @@ public class CorbaTypesTestCase extends TestCase { refTestObject = nce.resolve(nce.to_name("TestObject")); refCalcObject = nce.resolve(nce.to_name("CalcObject")); refObjectManager = nce.resolve(nce.to_name("ObjectManager")); + refEnumManager = nce.resolve(nce.to_name("EnumManager")); } catch (Exception e) { e.printStackTrace(); @@ -270,10 +285,9 @@ public class CorbaTypesTestCase extends TestCase { struct.threeDimSeq = TestConstants.INT_ARRAY_3_DIM; struct.str = TestConstants.STR_1; - request.addArgument(struct); - request.setOutputType(SomeStruct.class); - try { + request.addArgument(struct); + request.setOutputType(SomeStruct.class); DynaCorbaResponse response = request.invoke(); SomeStruct result = (SomeStruct) response.getContent(); int sum = 0; @@ -314,9 +328,9 @@ public class CorbaTypesTestCase extends TestCase { struct.field2 = TestConstants.INT_1; DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setSimpleStruct"); - request.setOutputType(SimpleStruct.class); - request.addArgument(struct); try { + request.setOutputType(SimpleStruct.class); + request.addArgument(struct); DynaCorbaResponse response = request.invoke(); SimpleStruct retStruct = (SimpleStruct) response.getContent(); assertTrue(retStruct.field1.equals(struct.field1) @@ -339,9 +353,9 @@ public class CorbaTypesTestCase extends TestCase { } DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "setLongSeq2"); - request.setOutputType(arr1.getClass()); - request.addArgument(arr1); try { + request.setOutputType(arr1.getClass()); + request.addArgument(arr1); DynaCorbaResponse response = request.invoke(); int[][] arr2 = (int[][]) response.getContent(); for (int i = 0; i < 2; i++) { @@ -389,13 +403,13 @@ public class CorbaTypesTestCase extends TestCase { DynaCorbaRequest request = new DynaCorbaRequest(refTestObject, "pickStructFromArgs"); - request.setOutputType(SomeStruct.class); - request.addArgument(arg1); - request.addArgument(arg2); - request.addArgument(arg3); - request.addArgument(1); try { + request.setOutputType(SomeStruct.class); + request.addArgument(arg1); + request.addArgument(arg2); + request.addArgument(arg3); + request.addArgument(1); DynaCorbaResponse response = request.invoke(); SomeStruct result = (SomeStruct) response.getContent(); @@ -413,27 +427,28 @@ public class CorbaTypesTestCase extends TestCase { */ public void test_singleException() { DynaCorbaRequest request1 = new DynaCorbaRequest(refCalcObject, "div"); - request1.addArgument(2d); - request1.addArgument(2d); - request1.setOutputType(Double.class); - request1.addExceptionType(DivByZero.class); try { + request1.addArgument(2d); + request1.addArgument(2d); + request1.setOutputType(Double.class); + request1.addExceptionType(DivByZero.class); request1.invoke(); } catch (Exception e) { fail(); } DynaCorbaRequest request2 = new DynaCorbaRequest(refCalcObject, "div"); - request2.addArgument(2d); - request2.addArgument(0d); - request2.setOutputType(Double.class); - request2.addExceptionType(DivByZero.class); try { + request2.addArgument(2d); + request2.addArgument(0d); + request2.setOutputType(Double.class); + request2.addExceptionType(DivByZero.class); request2.invoke(); } catch (DivByZero e) { assertTrue(e.info != null && e.arguments != null && e.arguments.arg1 == 2 && e.arguments.arg2 == 0); } catch (Exception exc) { + exc.printStackTrace(); fail(); } } @@ -444,12 +459,12 @@ public class CorbaTypesTestCase extends TestCase { public void test_multipleExceptions() { DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "divForSmallArgs"); - request.addArgument(101d); - request.addArgument(101d); - request.setOutputType(Double.class); - request.addExceptionType(DivByZero.class); - request.addExceptionType(NotSupported.class); try { + request.addArgument(101d); + request.addArgument(101d); + request.setOutputType(Double.class); + request.addExceptionType(DivByZero.class); + request.addExceptionType(NotSupported.class); request.invoke(); } catch (Exception e) { assertTrue(e instanceof NotSupported); @@ -461,10 +476,10 @@ public class CorbaTypesTestCase extends TestCase { */ public void test_noExceptionsDeclared() { DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "div"); - request.addArgument(1d); - request.addArgument(0d); - request.setOutputType(Double.class); try { + request.addArgument(1d); + request.addArgument(0d); + request.setOutputType(Double.class); request.invoke(); fail(); } catch (Exception e) { @@ -477,18 +492,18 @@ public class CorbaTypesTestCase extends TestCase { */ public void test_noSuchExceptionDeclared() { DynaCorbaRequest request = new DynaCorbaRequest(refCalcObject, "div"); - request.addArgument(1d); - request.addArgument(0d); - request.addExceptionType(NotSupported.class); - request.setOutputType(Double.class); try { + request.addArgument(1d); + request.addArgument(0d); + request.addExceptionType(NotSupported.class); + request.setOutputType(Double.class); request.invoke(); fail(); } catch (Exception e) { assertTrue(e instanceof RequestConfigurationException); } } - + /** * Tests handling non existing operation situation */ @@ -502,19 +517,107 @@ public class CorbaTypesTestCase extends TestCase { assertTrue(e instanceof CorbaException); } } - + /** - * Tests obtaining references to other objects and using them with specified user interface + * Tests obtaining references to other objects and using them with specified + * user interface */ public void test_enchancedReferences() { try { - DynaCorbaRequest request = new DynaCorbaRequest(refObjectManager, "getDummyObject"); + DynaCorbaRequest request = new DynaCorbaRequest(refObjectManager, + "getDummyObject"); request.setOutputType(DummyObject.class); DynaCorbaResponse response = request.invoke(); DummyObject dummy = (DummyObject) response.getContent(); DummyObject dummy2 = dummy.cloneObject(); assertNotSame(dummy.getLong(), dummy2.getLong()); } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + + /** + * Test passing enums as arguments and retrieving them as a result + */ + public void test_enums() { + try { + DynaCorbaRequest request = new DynaCorbaRequest(refEnumManager, + "getColor"); + Color color = Color.green; + request.addArgument(color); + request.setOutputType(Color.class); + DynaCorbaResponse response = request.invoke(); + Color result = (Color) response.getContent(); + assertEquals(color.value(), result.value()); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + } + + /** + * Tests recognizing structures + */ + public void test_structValidation() { + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidStruct1.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidStruct2.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidStruct3.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(SomeStruct.class); + } catch (Exception e) { + fail(); + } + } + + /** + * Tests recognizing enums + */ + public void test_enumValidation() { + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidEnum1.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidEnum2.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(InvalidEnum3.class); + fail(); + } catch (Exception e) { + assertTrue(e instanceof RequestConfigurationException); + } + try { + DynaCorbaRequest request = new DynaCorbaRequest(refArraysSetter, "whatever"); + request.setOutputType(Color.class); + } catch (Exception e) { fail(); } } diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java new file mode 100644 index 0000000000..71f307be26 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/Color.java @@ -0,0 +1,61 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/Color.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public class Color implements org.omg.CORBA.portable.IDLEntity +{ + private int __value; + private static int __size = 3; + private static org.apache.tuscany.sca.binding.corba.testing.enums.Color[] __array = new org.apache.tuscany.sca.binding.corba.testing.enums.Color [__size]; + + public static final int _red = 0; + public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color red = new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_red); + public static final int _yellow = 1; + public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color yellow = new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_yellow); + public static final int _green = 2; + public static final org.apache.tuscany.sca.binding.corba.testing.enums.Color green = new org.apache.tuscany.sca.binding.corba.testing.enums.Color(_green); + + public int value () + { + return __value; + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.Color from_int (int value) + { + if (value >= 0 && value < __size) + return __array[value]; + else + throw new org.omg.CORBA.BAD_PARAM (); + } + + protected Color (int value) + { + __value = value; + __array[__value] = this; + } +} // class Color diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java new file mode 100644 index 0000000000..55409a1d92 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java @@ -0,0 +1,72 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/ColorHelper.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +abstract public class ColorHelper +{ + private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/Color:1.0"; + + public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.enums.Color that) + { + org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); + a.type (type ()); + write (out, that); + a.read_value (out.create_input_stream (), type ()); + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.Color extract (org.omg.CORBA.Any a) + { + return read (a.create_input_stream ()); + } + + private static org.omg.CORBA.TypeCode __typeCode = null; + synchronized public static org.omg.CORBA.TypeCode type () + { + if (__typeCode == null) + { + __typeCode = org.omg.CORBA.ORB.init ().create_enum_tc (org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.id (), "Color", new String[] { "red", "yellow", "green"} ); + } + return __typeCode; + } + + public static String id () + { + return _id; + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.Color read (org.omg.CORBA.portable.InputStream istream) + { + return org.apache.tuscany.sca.binding.corba.testing.enums.Color.from_int (istream.read_long ()); + } + + public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.enums.Color value) + { + ostream.write_long (value.value ()); + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java new file mode 100644 index 0000000000..3290d26397 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java @@ -0,0 +1,57 @@ +/* + * 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.enums; + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/ColorHolder.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public final class ColorHolder implements org.omg.CORBA.portable.Streamable +{ + public org.apache.tuscany.sca.binding.corba.testing.enums.Color value = null; + + public ColorHolder () + { + } + + public ColorHolder (org.apache.tuscany.sca.binding.corba.testing.enums.Color initialValue) + { + value = initialValue; + } + + public void _read (org.omg.CORBA.portable.InputStream i) + { + value = org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read (i); + } + + public void _write (org.omg.CORBA.portable.OutputStream o) + { + org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write (o, value); + } + + public org.omg.CORBA.TypeCode _type () + { + return org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.type (); + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java new file mode 100644 index 0000000000..5e2df26961 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java @@ -0,0 +1,32 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public interface EnumManager extends EnumManagerOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity +{ +} // interface EnumManager diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java new file mode 100644 index 0000000000..8ba4dc0729 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java @@ -0,0 +1,104 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHelper.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +abstract public class EnumManagerHelper +{ + private static String _id = "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"; + + public static void insert (org.omg.CORBA.Any a, org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager that) + { + org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); + a.type (type ()); + write (out, that); + a.read_value (out.create_input_stream (), type ()); + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager extract (org.omg.CORBA.Any a) + { + return read (a.create_input_stream ()); + } + + private static org.omg.CORBA.TypeCode __typeCode = null; + synchronized public static org.omg.CORBA.TypeCode type () + { + if (__typeCode == null) + { + __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.id (), "EnumManager"); + } + return __typeCode; + } + + public static String id () + { + return _id; + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager read (org.omg.CORBA.portable.InputStream istream) + { + return narrow (istream.read_Object (_EnumManagerStub.class)); + } + + public static void write (org.omg.CORBA.portable.OutputStream ostream, org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager value) + { + ostream.write_Object ((org.omg.CORBA.Object) value); + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager narrow (org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager) + return (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)obj; + else if (!obj._is_a (id ())) + throw new org.omg.CORBA.BAD_PARAM (); + else + { + org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); + org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub stub = new org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub (); + stub._set_delegate(delegate); + return stub; + } + } + + public static org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager unchecked_narrow (org.omg.CORBA.Object obj) + { + if (obj == null) + return null; + else if (obj instanceof org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager) + return (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager)obj; + else + { + org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate (); + org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub stub = new org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerStub (); + stub._set_delegate(delegate); + return stub; + } + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java new file mode 100644 index 0000000000..065287d547 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java @@ -0,0 +1,57 @@ +/* + * 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.enums; + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerHolder.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public final class EnumManagerHolder implements org.omg.CORBA.portable.Streamable +{ + public org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager value = null; + + public EnumManagerHolder () + { + } + + public EnumManagerHolder (org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager initialValue) + { + value = initialValue; + } + + public void _read (org.omg.CORBA.portable.InputStream i) + { + value = org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.read (i); + } + + public void _write (org.omg.CORBA.portable.OutputStream o) + { + org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.write (o, value); + } + + public org.omg.CORBA.TypeCode _type () + { + return org.apache.tuscany.sca.binding.corba.testing.enums.EnumManagerHelper.type (); + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java new file mode 100644 index 0000000000..6452d55db7 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java @@ -0,0 +1,34 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/EnumManagerOperations.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public interface EnumManagerOperations +{ + + org.apache.tuscany.sca.binding.corba.testing.enums.Color getColor (org.apache.tuscany.sca.binding.corba.testing.enums.Color color); +} // interface EnumManagerOperations diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java new file mode 100644 index 0000000000..6975a4d4f0 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java @@ -0,0 +1,83 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerImplBase.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public abstract class _EnumManagerImplBase extends org.omg.CORBA.portable.ObjectImpl + implements org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager, org.omg.CORBA.portable.InvokeHandler +{ + + // Constructors + public _EnumManagerImplBase () + { + } + + private static java.util.Hashtable _methods = new java.util.Hashtable (); + static + { + _methods.put ("getColor", new java.lang.Integer (0)); + } + + public org.omg.CORBA.portable.OutputStream _invoke (String $method, + org.omg.CORBA.portable.InputStream in, + org.omg.CORBA.portable.ResponseHandler $rh) + { + org.omg.CORBA.portable.OutputStream out = null; + java.lang.Integer __method = (java.lang.Integer)_methods.get ($method); + if (__method == null) + throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); + + switch (__method.intValue ()) + { + case 0: // org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager/getColor + { + org.apache.tuscany.sca.binding.corba.testing.enums.Color color = org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read (in); + org.apache.tuscany.sca.binding.corba.testing.enums.Color $result = null; + $result = this.getColor (color); + out = $rh.createReply(); + org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write (out, $result); + break; + } + + default: + throw new org.omg.CORBA.BAD_OPERATION (0, org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE); + } + + return out; + } // _invoke + + // Type-specific CORBA::Object operations + private static String[] __ids = { + "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"}; + + public String[] _ids () + { + return (String[])__ids.clone (); + } + + +} // class _EnumManagerImplBase diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java new file mode 100644 index 0000000000..77bfa7c6e9 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java @@ -0,0 +1,79 @@ +/* + * 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.enums; + + +/** +* org/apache/tuscany/sca/binding/corba/testing/enums/_EnumManagerStub.java . +* Generated by the IDL-to-Java compiler (portable), version "3.2" +* from enums.idl +* czwartek, 19 czerwiec 2008 15:46:10 CEST +*/ + +public class _EnumManagerStub extends org.omg.CORBA.portable.ObjectImpl implements org.apache.tuscany.sca.binding.corba.testing.enums.EnumManager +{ + + public org.apache.tuscany.sca.binding.corba.testing.enums.Color getColor (org.apache.tuscany.sca.binding.corba.testing.enums.Color color) + { + org.omg.CORBA.portable.InputStream $in = null; + try { + org.omg.CORBA.portable.OutputStream $out = _request ("getColor", true); + org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.write ($out, color); + $in = _invoke ($out); + org.apache.tuscany.sca.binding.corba.testing.enums.Color $result = org.apache.tuscany.sca.binding.corba.testing.enums.ColorHelper.read ($in); + return $result; + } catch (org.omg.CORBA.portable.ApplicationException $ex) { + $in = $ex.getInputStream (); + String _id = $ex.getId (); + throw new org.omg.CORBA.MARSHAL (_id); + } catch (org.omg.CORBA.portable.RemarshalException $rm) { + return getColor (color ); + } finally { + _releaseReply ($in); + } + } // getColor + + // Type-specific CORBA::Object operations + private static String[] __ids = { + "IDL:org/apache/tuscany/sca/binding/corba/testing/enums/EnumManager:1.0"}; + + public String[] _ids () + { + return (String[])__ids.clone (); + } + + private void readObject (java.io.ObjectInputStream s) throws java.io.IOException + { + String str = s.readUTF (); + String[] args = null; + java.util.Properties props = null; + org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str); + org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate (); + _set_delegate (delegate); + } + + private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException + { + String[] args = null; + java.util.Properties props = null; + String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this); + s.writeUTF (str); + } +} // class _EnumManagerStub diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java new file mode 100644 index 0000000000..0fb8a3ffab --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum1.java @@ -0,0 +1,36 @@ +/* + * 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; + +public class InvalidEnum1 { + + public static final InvalidEnum1 red = new InvalidEnum1(0); + + public int value() { + return 0; + } + + public static InvalidEnum1 from_int(int value) { + return null; + } + + protected InvalidEnum1(int value) { + } +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java new file mode 100644 index 0000000000..6c8f568bb4 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum2.java @@ -0,0 +1,33 @@ +/* + * 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; + +public class InvalidEnum2 { + + public static final int _red = 0; + public static final InvalidEnum2 red = new InvalidEnum2(_red); + + public static InvalidEnum2 from_int(int value) { + return null; + } + + protected InvalidEnum2(int value) { + } +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java new file mode 100644 index 0000000000..ca630e361e --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidEnum3.java @@ -0,0 +1,33 @@ +/* + * 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; + +public class InvalidEnum3 { + + public static final int _red = 0; + public static final InvalidEnum2 red = new InvalidEnum2(_red); + + public int value() { + return 0; + } + + protected InvalidEnum3(int value) { + } +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java new file mode 100644 index 0000000000..180211ecdc --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct1.java @@ -0,0 +1,28 @@ +/* + * 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; + +public final class InvalidStruct1 { + + public InvalidStruct1() { + + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java new file mode 100644 index 0000000000..34699111eb --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct2.java @@ -0,0 +1,31 @@ +/* + * 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; + +public final class InvalidStruct2 { + + public int f1; + public String f2; + + public InvalidStruct2(int f1, String f2) { + + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java new file mode 100644 index 0000000000..59c8c2d39c --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/hierarchy/InvalidStruct3.java @@ -0,0 +1,36 @@ +/* + * 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; + +public final class InvalidStruct3 { + + public int f1; + public String f2; + public static byte f3; + + public InvalidStruct3() { + + } + + public InvalidStruct3(int f1, String f2, byte f3) { + + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java new file mode 100644 index 0000000000..58cc370f10 --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/java/org/apache/tuscany/sca/binding/corba/testing/servants/EnumManagerServant.java @@ -0,0 +1,33 @@ +/* + * 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.servants; + +import org.apache.tuscany.sca.binding.corba.testing.enums.Color; +import org.apache.tuscany.sca.binding.corba.testing.enums._EnumManagerImplBase; + +public class EnumManagerServant extends _EnumManagerImplBase { + + private static final long serialVersionUID = 1L; + + public Color getColor(Color color) { + return color; + } + +} diff --git a/java/sca/modules/binding-corba-runtime/src/test/resources/enums.idl b/java/sca/modules/binding-corba-runtime/src/test/resources/enums.idl new file mode 100644 index 0000000000..053185e88f --- /dev/null +++ b/java/sca/modules/binding-corba-runtime/src/test/resources/enums.idl @@ -0,0 +1,132 @@ +/*
+ * 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.
+ */
+
+/*
+ * compile by
+ * idlj -fall -oldImplBase enums.idl
+ */
+
+module org {
+ module apache {
+ module tuscany {
+ module sca {
+ module binding {
+ module corba {
+ module testing {
+ module enums {
+ enum Color {red, yellow, green};
+ interface EnumManager {
+ Color getColor(in Color color);
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+};
+/*
+ * 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.
+ */
+
+/*
+ * compile by
+ * idlj -fall -oldImplBase enums.idl
+ */
+
+module org {
+ module apache {
+ module tuscany {
+ module sca {
+ module binding {
+ module corba {
+ module testing {
+ module enums {
+ enum Color {red, yellow, green};
+ interface EnumManager {
+ Color getColor(in Color color);
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+};
+/*
+ * 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.
+ */
+
+/*
+ * compile by
+ * idlj -fall -oldImplBase enums.idl
+ */
+
+module org {
+ module apache {
+ module tuscany {
+ module sca {
+ module binding {
+ module corba {
+ module testing {
+ module enums {
+ enum Color {red, yellow, green};
+ interface EnumManager {
+ Color getColor(in Color color);
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+};
|