From scm-return-6854-apmail-geronimo-scm-archive=geronimo.apache.org@geronimo.apache.org Mon Jun 20 07:17:12 2005 Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 44032 invoked from network); 20 Jun 2005 07:17:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Jun 2005 07:17:11 -0000 Received: (qmail 29474 invoked by uid 500); 20 Jun 2005 07:17:11 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 29443 invoked by uid 500); 20 Jun 2005 07:17:10 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 29430 invoked by uid 99); 20 Jun 2005 07:17:09 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 20 Jun 2005 00:17:02 -0700 Received: (qmail 43778 invoked by uid 65534); 20 Jun 2005 07:16:44 -0000 Message-ID: <20050620071644.43777.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r191412 - in /geronimo/trunk/modules/interop/src: java/org/apache/geronimo/interop/generator/ java/org/apache/geronimo/interop/rmi/iiop/portable/ test-data/ test/org/apache/geronimo/interop/rmi/ test/org/apache/geronimo/interop/rmi/iiop/ te... Date: Mon, 20 Jun 2005 07:16:40 -0000 To: scm@geronimo.apache.org From: dain@apache.org X-Mailer: svnmailer-1.0.2 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: dain Date: Mon Jun 20 00:16:38 2005 New Revision: 191412 URL: http://svn.apache.org/viewcvs?rev=191412&view=rev Log: Added handling for all of the special name mangling rules Added all tests for name mangling Added: geronimo/trunk/modules/interop/src/test-data/specialNameMangler.properties geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/BooException.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Foo.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompilerTest.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Special.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/BlahEx.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/CheeseIDLEntity.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Donkey.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/DonkeyEx.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Generic$Interface.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/_Something.java geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/inout.java Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JType.java geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompiler.java geronimo/trunk/modules/interop/src/test-data/nameMangler.properties Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JType.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JType.java?rev=191412&r1=191411&r2=191412&view=diff ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JType.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/generator/JType.java Mon Jun 20 00:16:38 2005 @@ -21,7 +21,7 @@ public class JType extends JEntity { - private static HashMap typeMap = new HashMap(60); + private static HashMap typeCache = new HashMap(60); private Class type; private String typeDecl; @@ -32,7 +32,7 @@ public void setType(Class type) { this.type = type; - calculateTypeDecl(); + this.typeDecl = calculateTypeDecl(type); } public Class getType() { @@ -61,64 +61,32 @@ return rc; } - protected void calculateTypeDecl() { - if (type == null) { - return; - } - - typeDecl = (String) typeMap.get(type); - - if (typeDecl == null) { - synchronized (typeMap) { - typeDecl = type.getName(); + private static String calculateTypeDecl(Class type) { + String typeName = type.getName(); + synchronized (typeCache) { + String typeDecl= (String) typeCache.get(typeName); + if (typeDecl != null) { + return typeDecl; + } - if (type.isArray()) { - typeDecl = convertToTypeDecl(typeDecl); - } + StringBuffer typeString = new StringBuffer(); - typeMap.put(type, typeDecl); + while (type.isArray()) { + typeString.append("[]"); + type = type.getComponentType(); } - } - } - protected String convertToTypeDecl(String typeName) { - String rc = ""; - char charAt = 0; - int i; - - if (typeName != null && typeName.length() > 0) { - for (i = 0; i < typeName.length(); i++) { - charAt = typeName.charAt(i); - - if (charAt == '[') { - rc = rc + "[]"; - } else if (charAt == 'Z') { - rc = "boolean" + rc; - } else if (charAt == 'B') { - rc = "byte" + rc; - } else if (charAt == 'C') { - rc = "char" + rc; - } else if (charAt == 'L') { - int semiIndex = typeName.indexOf(";"); - rc = typeName.substring(i + 1, semiIndex) + rc; - i = semiIndex; - } else if (charAt == 'D') { - rc = "double" + rc; - } else if (charAt == 'F') { - rc = "float" + rc; - } else if (charAt == 'I') { - rc = "int" + rc; - } else if (charAt == 'J') { - rc = "long" + rc; - } else if (charAt == 'S') { - rc = "short" + rc; - } else { - System.out.println("Error: Invalid signature. typeName = " + typeName + ", charAt = " + charAt + ", i = " + i); - } + typeString.insert(0, type.getName()); + if (type.getDeclaringClass() != null) { + String declaringClassName = calculateTypeDecl(type.getDeclaringClass()); + assert type.getName().startsWith(declaringClassName + "$"); + typeString.setCharAt(declaringClassName.length(), '.'); } - } - return rc; + typeDecl = typeString.toString(); + typeCache.put(typeName, typeDecl); + return typeDecl; + } } protected void showTypeInfo() { Modified: geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompiler.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompiler.java?rev=191412&r1=191411&r2=191412&view=diff ============================================================================== --- geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompiler.java (original) +++ geronimo/trunk/modules/interop/src/java/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompiler.java Mon Jun 20 00:16:38 2005 @@ -90,7 +90,7 @@ // build the basic class object - String className = "_" + getClassName(interfaceName) + "_Stub_DAIN"; + String className = "_" + getClassName(interfaceClass) + "_Stub"; JClass jclass = jpackage.newClass(className); jclass.addImport("javax.rmi.CORBA", "Stub"); jclass.setExtends("Stub"); @@ -114,12 +114,18 @@ } } - private static String getClassName(String interfaceName) { - int endIndex = interfaceName.lastIndexOf('.'); + private static String getClassName(Class type) { + if (type.isArray()) { + throw new IllegalArgumentException("type is an array: " + type); + } + + // get the classname + String typeName = type.getName(); + int endIndex = typeName.lastIndexOf('.'); if (endIndex < 0) { - return interfaceName; + return typeName; } - return interfaceName.substring(endIndex + 1); + return typeName.substring(endIndex + 1); } private static String getPackageName(String interfaceName) { @@ -157,46 +163,109 @@ public static IiopOperation[] createIiopOperations(Class intfClass) { Method[] methods = getAllMethods(intfClass); - // index the methods by name - HashMap methodsByName = new HashMap(methods.length); + // index the methods by name... used to determine which methods are overloaded + HashMap overloadedMethods = new HashMap(methods.length); for (int i = 0; i < methods.length; i++) { - List methodList = (ArrayList) methodsByName.get(methods[i].getName()); + String methodName = methods[i].getName(); + List methodList = (List) overloadedMethods.get(methodName); if (methodList == null) { - methodList = new ArrayList(methods.length); - methodsByName.put(methods[i].getName(), methodList); + methodList = new LinkedList(); + overloadedMethods.put(methodName, methodList); } methodList.add(methods[i]); } - List overloadList = new ArrayList(methodsByName.size()); + // index the methods by lower case name... used to determine which methods differ only by case + HashMap caseCollisionMethods = new HashMap(methods.length); + for (int i = 0; i < methods.length; i++) { + String lowerCaseMethodName = methods[i].getName().toLowerCase(); + Set methodSet = (Set) caseCollisionMethods.get(lowerCaseMethodName); + if (methodSet == null) { + methodSet = new HashSet(); + caseCollisionMethods.put(lowerCaseMethodName, methodSet); + } + methodSet.add(methods[i].getName()); + } + + String className = getClassName(intfClass); + List overloadList = new ArrayList(methods.length); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; + String iiopName = method.getName(); - if (((List) methodsByName.get(method.getName())).size() > 1) { - iiopName = buildOverloadMethodName(method); + + if (((Set) caseCollisionMethods.get(method.getName().toLowerCase())).size() > 1) { + iiopName += upperCaseIndexString(iiopName); + } + + // if we have a leading underscore prepend with J + if (iiopName.charAt(0) == '_') { + iiopName = "J" + iiopName; } + + // if this is an overloaded method append the parameter string + if (((List) overloadedMethods.get(method.getName())).size() > 1) { + iiopName += buildOverloadParameterString(method.getParameterTypes()); + } + + // if we have a leading underscore prepend with J + iiopName = replace(iiopName, '$', "U0024"); + + // if we have matched a keyword prepend with an underscore + if (keywords.contains(iiopName.toLowerCase())) { + iiopName = "_" + iiopName; + } + + // if the name is the same as the class name, append an underscore + if (iiopName.equalsIgnoreCase(className)) { + iiopName += "_"; + } + overloadList.add(new IiopOperation(iiopName, method)); } return (IiopOperation[]) overloadList.toArray(new IiopOperation[overloadList.size()]); } - public static String buildOverloadMethodName(Method method) { - Class parameterTypes[] = method.getParameterTypes(); - String name = method.getName() + "_"; + private static String upperCaseIndexString(String iiopName) { + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < iiopName.length(); i++) { + char c = iiopName.charAt(i); + if (Character.isUpperCase(c)) { + stringBuffer.append('_').append(i); + } + } + return stringBuffer.toString(); + } + + public static String replace(String source, char oldChar, String newString) { + StringBuffer stringBuffer = new StringBuffer(source.length()); + for (int i = 0; i < source.length(); i++) { + char c = source.charAt(i); + if (c == oldChar) { + stringBuffer.append(newString); + } else { + stringBuffer.append(c); + } + } + return stringBuffer.toString(); + } + + public static String buildOverloadParameterString(Class[] parameterTypes) { + String name = ""; if (parameterTypes.length ==0) { - name += "_"; + name += "__"; } else { for (int i = 0; i < parameterTypes.length; i++) { Class parameterType = parameterTypes[i]; - name += buildOverloadParameterName(parameterType); + name += buildOverloadParameterString(parameterType); } } return name.replace('.', '_'); } - public static String buildOverloadParameterName(Class parameterType) { - String name = ""; + public static String buildOverloadParameterString(Class parameterType) { + String name = "_"; int arrayDimensions = 0; while (parameterType.isArray()) { @@ -214,14 +283,11 @@ name += "_org_omg_boxedIDL"; } - // determine the parameterType name... this is overriden for special corba types - String parameterTypeName = (String) overloadTypes.get(parameterType.getName()); - if (parameterTypeName == null) { - parameterTypeName = parameterType.getName(); + // add package... some types have special mappings in corba + String packageName = (String) specialTypePackages.get(parameterType.getName()); + if (packageName == null) { + packageName = getPackageName(parameterType.getName()); } - - // add package - String packageName = getPackageName(parameterTypeName); if (packageName.length() > 0) { name += "_" + packageName; } @@ -232,11 +298,43 @@ } // add the class name - name += "_" + getClassName(parameterTypeName); + String className = (String) specialTypeNames.get(parameterType.getName()); + if (className == null) { + className = buildClassName(parameterType); + } + name += "_" + className; return name; } + private static String buildClassName(Class type) { + if (type.isArray()) { + throw new IllegalArgumentException("type is an array: " + type); + } + + // get the classname + String typeName = type.getName(); + int endIndex = typeName.lastIndexOf('.'); + if (endIndex < 0) { + return typeName; + } + StringBuffer className = new StringBuffer(typeName.substring(endIndex + 1)); + + // for innerclasses replace the $ separator with two underscores + // we can't just blindly replace all $ characters since class names can contain the $ character + if (type.getDeclaringClass() != null) { + String declaringClassName = getClassName(type.getDeclaringClass()); + assert className.toString().startsWith(declaringClassName + "$"); + className.replace(declaringClassName.length(), declaringClassName.length() + 1, "__"); + } + + // if we have a leading underscore prepend with J + if (className.charAt(0) == '_') { + className.insert(0, "J"); + } + return className.toString(); + } + private void addMethod(JClass jclass, String iiopMethodName, JReturnType jreturnType, String name, JParameter[] jparameters, Class[] exceptions) { // // Method Template: @@ -478,9 +576,11 @@ // } // } - private static HashMap readMethods; - private static HashMap writeMethods; - private static HashMap overloadTypes; + private static final Map readMethods; + private static final Map writeMethods; + private static final Map specialTypeNames; + private static final Map specialTypePackages; + private static final Set keywords; static { readMethods = new HashMap(); @@ -505,18 +605,80 @@ writeMethods.put("double", "write_double"); writeMethods.put("org.omg.CORBA.Object", "write_Object"); - overloadTypes = new HashMap(); - overloadTypes.put("boolean", "boolean"); - overloadTypes.put("char", "wchar"); - overloadTypes.put("byte", "octet"); - overloadTypes.put("short", "short"); - overloadTypes.put("int", "long"); - overloadTypes.put("long", "long_long"); - overloadTypes.put("float", "float"); - overloadTypes.put("double", "double"); - overloadTypes.put("java.lang.Class", "javax.rmi.CORBA.ClassDesc"); - overloadTypes.put("java.lang.String", "CORBA.WStringValue"); - overloadTypes.put("org.omg.CORBA.Object", "Object"); + specialTypeNames = new HashMap(); + specialTypeNames.put("boolean", "boolean"); + specialTypeNames.put("char", "wchar"); + specialTypeNames.put("byte", "octet"); + specialTypeNames.put("short", "short"); + specialTypeNames.put("int", "long"); + specialTypeNames.put("long", "long_long"); + specialTypeNames.put("float", "float"); + specialTypeNames.put("double", "double"); + specialTypeNames.put("java.lang.Class", "ClassDesc"); + specialTypeNames.put("java.lang.String", "WStringValue"); + specialTypeNames.put("org.omg.CORBA.Object", "Object"); + + specialTypePackages = new HashMap(); + specialTypePackages.put("boolean", ""); + specialTypePackages.put("char", ""); + specialTypePackages.put("byte", ""); + specialTypePackages.put("short", ""); + specialTypePackages.put("int", ""); + specialTypePackages.put("long", ""); + specialTypePackages.put("float", ""); + specialTypePackages.put("double", ""); + specialTypePackages.put("java.lang.Class", "javax.rmi.CORBA"); + specialTypePackages.put("java.lang.String", "CORBA"); + specialTypePackages.put("org.omg.CORBA.Object", ""); + + keywords = new HashSet(); + keywords.add("abstract"); + keywords.add("any"); + keywords.add("attribute"); + keywords.add("boolean"); + keywords.add("case"); + keywords.add("char"); + keywords.add("const"); + keywords.add("context"); + keywords.add("custom"); + keywords.add("default"); + keywords.add("double"); + keywords.add("enum"); + keywords.add("exception"); + keywords.add("factory"); + keywords.add("false"); + keywords.add("fixed"); + keywords.add("float"); + keywords.add("in"); + keywords.add("inout"); + keywords.add("interface"); + keywords.add("long"); + keywords.add("module"); + keywords.add("native"); + keywords.add("object"); + keywords.add("octet"); + keywords.add("oneway"); + keywords.add("out"); + keywords.add("private"); + keywords.add("public"); + keywords.add("raises"); + keywords.add("readonly"); + keywords.add("sequence"); + keywords.add("short"); + keywords.add("string"); + keywords.add("struct"); + keywords.add("supports"); + keywords.add("switch"); + keywords.add("true"); + keywords.add("truncatable"); + keywords.add("typedef"); + keywords.add("union"); + keywords.add("unsigned"); + keywords.add("valuebase"); + keywords.add("valuetype"); + keywords.add("void"); + keywords.add("wchar"); + keywords.add("wstring"); } protected String getWriteMethod(JVariable jvariable) { Modified: geronimo/trunk/modules/interop/src/test-data/nameMangler.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test-data/nameMangler.properties?rev=191412&r1=191411&r2=191412&view=diff ============================================================================== --- geronimo/trunk/modules/interop/src/test-data/nameMangler.properties (original) +++ geronimo/trunk/modules/interop/src/test-data/nameMangler.properties Mon Jun 20 00:16:38 2005 @@ -12,7 +12,7 @@ abcdefg_pass_CORBA_Any(org.omg.CORBA.Any) = abcdefg_pass_CORBA_Any abcdefg_pass_CORBA_TypeCode(org.omg.CORBA.TypeCode) = abcdefg_pass_CORBA_TypeCode abcdefg_pass_CheeseIDLEntity(org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity) = abcdefg_pass_CheeseIDLEntity -abcdefg_pass_GenericInterface(org.apache.geronimo.interop.rmi.iiop.portable.other.GenericInterface) = abcdefg_pass_GenericInterface +abcdefg_pass_GenericInterface(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface) = abcdefg_pass_GenericInterface abcdefg_pass_BlahException(org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx) = abcdefg_pass_BlahException abcdefg_pass_BooException(org.apache.geronimo.interop.rmi.iiop.portable.BooException) = abcdefg_pass_BooException abcdefg_return_boolean() = abcdefg_return_boolean @@ -57,7 +57,7 @@ abcdefg_pass_CORBA_Any_arr(org.omg.CORBA.Any[]) = abcdefg_pass_CORBA_Any_arr abcdefg_pass_CORBA_TypeCode_arr(org.omg.CORBA.TypeCode[]) = abcdefg_pass_CORBA_TypeCode_arr abcdefg_pass_CheeseIDLEntity_arr(org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity[]) = abcdefg_pass_CheeseIDLEntity_arr -abcdefg_pass_GenericInterface_arr(org.apache.geronimo.interop.rmi.iiop.portable.other.GenericInterface[]) = abcdefg_pass_GenericInterface_arr +abcdefg_pass_GenericInterface_arr(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface[]) = abcdefg_pass_GenericInterface_arr abcdefg_pass_BlahException_arr(org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx[]) = abcdefg_pass_BlahException_arr abcdefg_pass_BooException_arr(org.apache.geronimo.interop.rmi.iiop.portable.BooException[]) = abcdefg_pass_BooException_arr abcdefg_return_boolean_arr() = abcdefg_return_boolean_arr @@ -92,7 +92,7 @@ abcdefg_overload(org.omg.CORBA.Any) = abcdefg_overload__org_omg_boxedIDL_org_omg_CORBA_Any abcdefg_overload(org.omg.CORBA.TypeCode) = abcdefg_overload__org_omg_boxedIDL_org_omg_CORBA_TypeCode abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity) = abcdefg_overload__org_omg_boxedIDL_org_apache_geronimo_interop_rmi_iiop_portable_other_CheeseIDLEntity -abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.GenericInterface) = abcdefg_overload__org_apache_geronimo_interop_rmi_iiop_portable_other_GenericInterface +abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface) = abcdefg_overload__org_apache_geronimo_interop_rmi_iiop_portable_other_GenericU0024Interface abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx) = abcdefg_overload__org_apache_geronimo_interop_rmi_iiop_portable_other_BlahEx abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.BooException) = abcdefg_overload__org_apache_geronimo_interop_rmi_iiop_portable_BooException abcdefg_overload(boolean[]) = abcdefg_overload__org_omg_boxedRMI_seq1_boolean @@ -110,7 +110,7 @@ abcdefg_overload(org.omg.CORBA.Any[]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_omg_CORBA_seq1_Any abcdefg_overload(org.omg.CORBA.TypeCode[]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_omg_CORBA_seq1_TypeCode abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity[]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_CheeseIDLEntity -abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.GenericInterface[]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_GenericInterface +abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface[]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_GenericU0024Interface abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx[]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_BlahEx abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.BooException[]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_seq1_BooException abcdefg_overload(boolean[][]) = abcdefg_overload__org_omg_boxedRMI_seq2_boolean @@ -128,7 +128,7 @@ abcdefg_overload(org.omg.CORBA.Any[][]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_omg_CORBA_seq2_Any abcdefg_overload(org.omg.CORBA.TypeCode[][]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_omg_CORBA_seq2_TypeCode abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity[][]) = abcdefg_overload__org_omg_boxedRMI_org_omg_boxedIDL_org_apache_geronimo_interop_rmi_iiop_portable_other_seq2_CheeseIDLEntity -abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.GenericInterface[][]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq2_GenericInterface +abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface[][]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq2_GenericU0024Interface abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx[][]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq2_BlahEx abcdefg_overload(org.apache.geronimo.interop.rmi.iiop.portable.BooException[][]) = abcdefg_overload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_seq2_BooException abcdefg_throw_exception() = abcdefg_throw_exception Added: geronimo/trunk/modules/interop/src/test-data/specialNameMangler.properties URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test-data/specialNameMangler.properties?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test-data/specialNameMangler.properties (added) +++ geronimo/trunk/modules/interop/src/test-data/specialNameMangler.properties Mon Jun 20 00:16:38 2005 @@ -0,0 +1,66 @@ +_underscore() = J_underscore +_underscoreOverload() = J_underscoreOverload__ +_underscoreOverload(org.apache.geronimo.interop.rmi.iiop.portable.other._Something) = J_underscoreOverload__org_apache_geronimo_interop_rmi_iiop_portable_other_J_Something +_underscoreOverload(org.apache.geronimo.interop.rmi.iiop.portable.other._Something[]) = J_underscoreOverload__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_J_Something +dollar$() = dollarU0024 +$dollar() = U0024dollar +#unicode_¿Ï´¹Œ§Ä½µ() = unicode_??U0153U00A5U03C0??U0192U03A9?U00B5 +innerClass(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface$Generic$InnerClassint) = innerClass__org_apache_geronimo_interop_rmi_iiop_portable_other_GenericU0024Interface__GenericU0024InnerClass__long +innerClass(org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface$Generic$InnerClass[]int) = innerClass__org_omg_boxedRMI_org_apache_geronimo_interop_rmi_iiop_portable_other_seq1_GenericU0024Interface__GenericU0024InnerClass__long +special() = special_ +differByCase() = differByCase_6_8 +differByCASE() = differByCASE_6_8_9_10_11 +differByCaseOverload() = differByCaseOverload_6_8_12 +differByCASEOverload() = differByCASEOverload_6_8_9_10_11_12__ +differByCASEOverload(int) = differByCASEOverload_6_8_9_10_11_12__long +keyword() = keyword__ +keyword(org.apache.geronimo.interop.rmi.iiop.portable.other.inout) = keyword__org_apache_geronimo_interop_rmi_iiop_portable_other_inout +ABSTRACT() = ABSTRACT__ +ABSTRACT(int) = ABSTRACT__long +any() = _any +attribute() = _attribute +BOOLEAN() = _BOOLEAN +CASE() = _CASE +CHAR() = _CHAR +CONST() = _CONST +context() = _context +custom() = _custom +DEFAULT() = _DEFAULT +DOUBLE() = _DOUBLE +enum() = _enum +exception() = _exception +factory() = _factory +FALSE() = _FALSE +fixed() = _fixed +FLOAT() = _FLOAT +in() = _in +inout() = _inout +INTERFACE() = _INTERFACE +LONG() = _LONG +module() = _module +NATIVE() = _NATIVE +OBJECT() = _OBJECT +octet() = _octet +oneway() = _oneway +out() = _out +PRIVATE() = _PRIVATE +PUBLIC() = _PUBLIC +raises() = _raises +readonly() = _readonly +sequence() = _sequence +SHORT() = _SHORT +string() = _string +struct() = _struct +supports() = _supports +SWITCH() = _SWITCH +TRUE() = _TRUE +truncatable() = _truncatable +typedef() = _typedef +union() = _union +unsigned() = _unsigned +ValueBase() = _ValueBase +valuetype() = _valuetype +VOID() = _VOID +wchar() = _wchar +wstring() = _wstring + Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/BooException.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/BooException.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/BooException.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/BooException.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,37 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable; + +/** + * @version $Rev$ $Date$ + */ +public class BooException extends Exception { + public BooException() { + } + + public BooException(String message) { + super(message); + } + + public BooException(String message, Throwable cause) { + super(message, cause); + } + + public BooException(Throwable cause) { + super(cause); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Foo.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Foo.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Foo.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Foo.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,181 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable; + +import java.math.BigDecimal; +import java.rmi.Remote; +import java.rmi.RemoteException; + +import org.apache.geronimo.interop.rmi.iiop.portable.other.BlahEx; +import org.apache.geronimo.interop.rmi.iiop.portable.other.CheeseIDLEntity; +import org.apache.geronimo.interop.rmi.iiop.portable.other.Donkey; +import org.apache.geronimo.interop.rmi.iiop.portable.other.DonkeyEx; +import org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface; + +/** + * @version $Rev$ $Date$ + */ +public interface Foo extends Remote { + + public void abcdefg_nothing() throws RemoteException; + + public void abcdefg_pass_boolean(boolean x) throws RemoteException; + public void abcdefg_pass_char(char x) throws RemoteException; + public void abcdefg_pass_byte(byte x) throws RemoteException; + public void abcdefg_pass_int(int x) throws RemoteException; + public void abcdefg_pass_long(long x) throws RemoteException; + public void abcdefg_pass_float(float x) throws RemoteException; + public void abcdefg_pass_double(double x) throws RemoteException; + public void abcdefg_pass_BigDecimal(BigDecimal x) throws RemoteException; + public void abcdefg_pass_Class(Class x) throws RemoteException; + public void abcdefg_pass_CORBA_Object(org.omg.CORBA.Object x) throws RemoteException; + public void abcdefg_pass_CORBA_Any(org.omg.CORBA.Any x) throws RemoteException; + public void abcdefg_pass_CORBA_TypeCode(org.omg.CORBA.TypeCode x) throws RemoteException; + public void abcdefg_pass_CheeseIDLEntity(CheeseIDLEntity x) throws RemoteException; + public void abcdefg_pass_GenericInterface(Generic$Interface x) throws RemoteException; + public void abcdefg_pass_BlahException(BlahEx x) throws RemoteException; + public void abcdefg_pass_BooException(BooException x) throws RemoteException; + + public boolean abcdefg_return_boolean() throws RemoteException; + public char abcdefg_return_char() throws RemoteException; + public byte abcdefg_return_byte() throws RemoteException; + public int abcdefg_return_int() throws RemoteException; + public long abcdefg_return_long() throws RemoteException; + public float abcdefg_return_float() throws RemoteException; + public double abcdefg_return_double() throws RemoteException; + public BigDecimal abcdefg_return_BigDecimal() throws RemoteException; + public Class abcdefg_return_Class() throws RemoteException; + public org.omg.CORBA.Object abcdefg_return_CORBA_Object() throws RemoteException; + public org.omg.CORBA.Any abcdefg_return_CORBA_Any() throws RemoteException; + public org.omg.CORBA.TypeCode abcdefg_return_CORBA_TypeCode() throws RemoteException; + public CheeseIDLEntity abcdefg_return_CheeseIDLEntity() throws RemoteException; + public Generic$Interface abcdefg_return_GenericInterface() throws RemoteException; + public BlahEx abcdefg_return_BlahException() throws RemoteException; + public BooException abcdefg_return_BooException() throws RemoteException; + + public boolean abcdefg_pass_return_boolean(boolean x) throws RemoteException; + public char abcdefg_pass_return_char(char x) throws RemoteException; + public byte abcdefg_pass_return_byte(byte x) throws RemoteException; + public int abcdefg_pass_return_int(int x) throws RemoteException; + public long abcdefg_pass_return_long(long x) throws RemoteException; + public float abcdefg_pass_return_float(float x) throws RemoteException; + public double abcdefg_pass_return_double(double x) throws RemoteException; + public BigDecimal abcdefg_pass_return_BigDecimal(BigDecimal x) throws RemoteException; + public Class abcdefg_pass_return_Class(Class x) throws RemoteException; + public org.omg.CORBA.Object abcdefg_pass_return_CORBA_Object(org.omg.CORBA.Object x) throws RemoteException; + public org.omg.CORBA.Any abcdefg_pass_return_CORBA_Any(org.omg.CORBA.Any x) throws RemoteException; + public org.omg.CORBA.TypeCode abcdefg_pass_return_CORBA_TypeCode(org.omg.CORBA.TypeCode x) throws RemoteException; + public CheeseIDLEntity abcdefg_pass_return_CheeseIDLEntity(CheeseIDLEntity x) throws RemoteException; + + public void abcdefg_pass_boolean_arr(boolean[] x) throws RemoteException; + public void abcdefg_pass_char_arr(char[] x) throws RemoteException; + public void abcdefg_pass_byte_arr(byte[] x) throws RemoteException; + public void abcdefg_pass_int_arr(int[] x) throws RemoteException; + public void abcdefg_pass_long_arr(long[] x) throws RemoteException; + public void abcdefg_pass_float_arr(float[] x) throws RemoteException; + public void abcdefg_pass_double_arr(double[] x) throws RemoteException; + public void abcdefg_pass_BigDecimal_arr(BigDecimal[] x) throws RemoteException; + public void abcdefg_pass_Class_arr(Class[] x) throws RemoteException; + public void abcdefg_pass_CORBA_Object_arr(org.omg.CORBA.Object[] x) throws RemoteException; + public void abcdefg_pass_CORBA_Any_arr(org.omg.CORBA.Any[] x) throws RemoteException; + public void abcdefg_pass_CORBA_TypeCode_arr(org.omg.CORBA.TypeCode[] x) throws RemoteException; + public void abcdefg_pass_CheeseIDLEntity_arr(CheeseIDLEntity[] x) throws RemoteException; + public void abcdefg_pass_GenericInterface_arr(Generic$Interface[] x) throws RemoteException; + public void abcdefg_pass_BlahException_arr(BlahEx[] x) throws RemoteException; + public void abcdefg_pass_BooException_arr(BooException[] x) throws RemoteException; + + public boolean[] abcdefg_return_boolean_arr() throws RemoteException; + public char[] abcdefg_return_char_arr() throws RemoteException; + public byte[] abcdefg_return_byte_arr() throws RemoteException; + public int[] abcdefg_return_int_arr() throws RemoteException; + public long[] abcdefg_return_long_arr() throws RemoteException; + public float[] abcdefg_return_float_arr() throws RemoteException; + public double[] abcdefg_return_double_arr() throws RemoteException; + public BigDecimal[] abcdefg_return_BigDecimal_arr() throws RemoteException; + public Class[] abcdefg_return_Class_arr() throws RemoteException; + public org.omg.CORBA.Object[] abcdefg_return_CORBA_Object_arr() throws RemoteException; + public org.omg.CORBA.Any[] abcdefg_return_CORBA_Any_arr() throws RemoteException; + public org.omg.CORBA.TypeCode[] abcdefg_return_CORBA_TypeCode_arr() throws RemoteException; + public CheeseIDLEntity[] abcdefg_return_CheeseIDLEntity_arr() throws RemoteException; + public Generic$Interface[] abcdefg_return_GenericInterface_arr() throws RemoteException; + public BlahEx[] abcdefg_return_BlahException_arr() throws RemoteException; + public BooException[] abcdefg_return_BooException_arr() throws RemoteException; + + public void abcdefg_overload() throws RemoteException; + + public void abcdefg_overload(boolean x) throws RemoteException; + public void abcdefg_overload(char x) throws RemoteException; + public void abcdefg_overload(byte x) throws RemoteException; + public void abcdefg_overload(int x) throws RemoteException; + public void abcdefg_overload(long x) throws RemoteException; + public void abcdefg_overload(float x) throws RemoteException; + public void abcdefg_overload(double x) throws RemoteException; + public void abcdefg_overload(String x) throws RemoteException; + public void abcdefg_overload(BigDecimal x) throws RemoteException; + public void abcdefg_overload(Class x) throws RemoteException; + public void abcdefg_overload(Object x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Object x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Any x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.TypeCode x) throws RemoteException; + public void abcdefg_overload(CheeseIDLEntity x) throws RemoteException; + public void abcdefg_overload(Generic$Interface x) throws RemoteException; + public void abcdefg_overload(BlahEx x) throws RemoteException; + public void abcdefg_overload(BooException x) throws RemoteException; + + public void abcdefg_overload(boolean[] x) throws RemoteException; + public void abcdefg_overload(char[] x) throws RemoteException; + public void abcdefg_overload(byte[] x) throws RemoteException; + public void abcdefg_overload(int[] x) throws RemoteException; + public void abcdefg_overload(long[] x) throws RemoteException; + public void abcdefg_overload(float[] x) throws RemoteException; + public void abcdefg_overload(double[] x) throws RemoteException; + public void abcdefg_overload(String[] x) throws RemoteException; + public void abcdefg_overload(BigDecimal[] x) throws RemoteException; + public void abcdefg_overload(Class[] x) throws RemoteException; + public void abcdefg_overload(Object[] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Object[] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Any[] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.TypeCode[] x) throws RemoteException; + public void abcdefg_overload(CheeseIDLEntity[] x) throws RemoteException; + public void abcdefg_overload(Generic$Interface[] x) throws RemoteException; + public void abcdefg_overload(BlahEx[] x) throws RemoteException; + public void abcdefg_overload(BooException[] x) throws RemoteException; + + public void abcdefg_overload(boolean[][] x) throws RemoteException; + public void abcdefg_overload(char[][] x) throws RemoteException; + public void abcdefg_overload(byte[][] x) throws RemoteException; + public void abcdefg_overload(int[][] x) throws RemoteException; + public void abcdefg_overload(long[][] x) throws RemoteException; + public void abcdefg_overload(float[][] x) throws RemoteException; + public void abcdefg_overload(double[][] x) throws RemoteException; + public void abcdefg_overload(String[][] x) throws RemoteException; + public void abcdefg_overload(BigDecimal[][] x) throws RemoteException; + public void abcdefg_overload(Class[][] x) throws RemoteException; + public void abcdefg_overload(Object[][] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Object[][] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.Any[][] x) throws RemoteException; + public void abcdefg_overload(org.omg.CORBA.TypeCode[][] x) throws RemoteException; + public void abcdefg_overload(CheeseIDLEntity[][] x) throws RemoteException; + public void abcdefg_overload(Generic$Interface[][] x) throws RemoteException; + public void abcdefg_overload(BlahEx[][] x) throws RemoteException; + public void abcdefg_overload(BooException[][] x) throws RemoteException; + + public void abcdefg_throw_exception() throws RemoteException, BlahEx, BooException, DonkeyEx, Donkey; + public void abcdefg_pass_throw_exception(String x) throws RemoteException, BlahEx, BooException, DonkeyEx, Donkey; + public String abcdefg_return_throw_exception() throws RemoteException, BlahEx, BooException, DonkeyEx, Donkey; + public String abcdefg_pass_return_throw_exception(String x) throws RemoteException, BlahEx, BooException, DonkeyEx, Donkey; +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompilerTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompilerTest.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompilerTest.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/PortableStubCompilerTest.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,114 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable; + +import java.io.File; +import java.io.FileInputStream; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; + +import junit.framework.TestCase; +import org.apache.geronimo.interop.generator.GenOptions; + +/** + * @version $Rev$ $Date$ + */ +public class PortableStubCompilerTest extends TestCase { + public void testStubCompiler() throws Exception { + GenOptions genOptions = new GenOptions(); + new File("target/stubs").mkdirs(); + genOptions.setClasspath("target/classes"); + genOptions.setCompile(false); + genOptions.setGenSrcDir("target/stubs"); + genOptions.setGenerate(true); + genOptions.setInterfaces(Arrays.asList(new String[]{Foo.class.getName(), Special.class.getName()})); + genOptions.setLoadclass(true); + genOptions.setOverwrite(true); + genOptions.setSimpleIdl(false); + genOptions.setVerbose(true); + + ClassLoader classLoader = getClass().getClassLoader(); + PortableStubCompiler stubCompiler = new PortableStubCompiler(genOptions, classLoader); + + stubCompiler.generate(); + } + + public void testBasicNameMangler() throws Exception { + Properties nameManglerProperties = new Properties(); + nameManglerProperties.load(new FileInputStream("src/test-data/nameMangler.properties")); + + Set methodSignatures = new HashSet(); + IiopOperation[] iiopOperations = PortableStubCompiler.createIiopOperations(Foo.class); + for (int i = 0; i < iiopOperations.length; i++) { + IiopOperation iiopOperation = iiopOperations[i]; + Method method = iiopOperation.getMethod(); + String methodSignature = method.getName() + "("; + + Class[] parameterTypes = method.getParameterTypes(); + for (int j = 0; j < parameterTypes.length; j++) { + Class parameterType = parameterTypes[j]; + String arrayBrackets = ""; + while (parameterType.isArray()) { + arrayBrackets += "[]"; + parameterType = parameterType.getComponentType(); + } + methodSignature += parameterType.getName() + arrayBrackets; + } + methodSignature += ")"; + methodSignatures.add(methodSignature); + + assertTrue("Method not present in name mangler properties: " + methodSignature, nameManglerProperties.containsKey(methodSignature)); + assertEquals(nameManglerProperties.getProperty(methodSignature), iiopOperation.getName()); + } + + assertEquals("Did not match all methods", nameManglerProperties.keySet(), methodSignatures); + } + + public void testSpecialNameMangler() throws Exception { + Properties nameManglerProperties = new Properties(); + nameManglerProperties.load(new FileInputStream("src/test-data/specialNameMangler.properties")); + + Set methodSignatures = new HashSet(); + IiopOperation[] iiopOperations = PortableStubCompiler.createIiopOperations(Special.class); + for (int i = 0; i < iiopOperations.length; i++) { + IiopOperation iiopOperation = iiopOperations[i]; + Method method = iiopOperation.getMethod(); + String methodSignature = method.getName() + "("; + + Class[] parameterTypes = method.getParameterTypes(); + for (int j = 0; j < parameterTypes.length; j++) { + Class parameterType = parameterTypes[j]; + String arrayBrackets = ""; + while (parameterType.isArray()) { + arrayBrackets += "[]"; + parameterType = parameterType.getComponentType(); + } + methodSignature += parameterType.getName() + arrayBrackets; + } + methodSignature += ")"; + methodSignatures.add(methodSignature); + + assertTrue("Method not present in name mangler properties: " + methodSignature, nameManglerProperties.containsKey(methodSignature)); + assertEquals(nameManglerProperties.getProperty(methodSignature), iiopOperation.getName()); + } + + assertEquals("Did not match all methods", nameManglerProperties.keySet(), methodSignatures); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Special.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Special.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Special.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/Special.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,110 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +import org.apache.geronimo.interop.rmi.iiop.portable.other.Generic$Interface; +import org.apache.geronimo.interop.rmi.iiop.portable.other._Something; +import org.apache.geronimo.interop.rmi.iiop.portable.other.inout; + +/** + * @version $Rev$ $Date$ + */ +public interface Special extends Remote { + // J_underscore + public void _underscore() throws RemoteException; + + public void _underscoreOverload() throws RemoteException; + public void _underscoreOverload(_Something x) throws RemoteException; + public void _underscoreOverload(_Something[] x) throws RemoteException; + + // special characters + public void dollar$() throws RemoteException; + public void $dollar() throws RemoteException; + + // this doesn't work in rmic either although the spec says it's legal +// public void unicode_¿Ï´¹Œ§Ä½µ() throws RemoteException; + + // innerclass + public void innerClass(Generic$Interface.Generic$InnerClass x, int y) throws RemoteException; + public void innerClass(Generic$Interface.Generic$InnerClass x[], int y) throws RemoteException; + + // class collision + public void special() throws RemoteException; + + // difer by case only + public void differByCase() throws RemoteException; + public void differByCASE() throws RemoteException; + public void differByCaseOverload() throws RemoteException; + public void differByCASEOverload() throws RemoteException; + public void differByCASEOverload(int x) throws RemoteException; + + // keywords + public void keyword() throws RemoteException; + public void keyword(inout x) throws RemoteException; + public void ABSTRACT() throws RemoteException; + public void ABSTRACT(int x) throws RemoteException; + + public void any() throws RemoteException; + public void attribute() throws RemoteException; + public void BOOLEAN() throws RemoteException; + public void CASE() throws RemoteException; + public void CHAR() throws RemoteException; + public void CONST() throws RemoteException; + public void context() throws RemoteException; + public void custom() throws RemoteException; + public void DEFAULT() throws RemoteException; + public void DOUBLE() throws RemoteException; + public void enum() throws RemoteException; + public void exception() throws RemoteException; + public void factory() throws RemoteException; + public void FALSE() throws RemoteException; + public void fixed() throws RemoteException; + public void FLOAT() throws RemoteException; + public void in() throws RemoteException; + public void inout() throws RemoteException; + public void INTERFACE() throws RemoteException; + public void LONG() throws RemoteException; + public void module() throws RemoteException; + public void NATIVE() throws RemoteException; + public void OBJECT() throws RemoteException; + public void octet() throws RemoteException; + public void oneway() throws RemoteException; + public void out() throws RemoteException; + public void PRIVATE() throws RemoteException; + public void PUBLIC() throws RemoteException; + public void raises() throws RemoteException; + public void readonly() throws RemoteException; + public void sequence() throws RemoteException; + public void SHORT() throws RemoteException; + public void string() throws RemoteException; + public void struct() throws RemoteException; + public void supports() throws RemoteException; + public void SWITCH() throws RemoteException; + public void TRUE() throws RemoteException; + public void truncatable() throws RemoteException; + public void typedef() throws RemoteException; + public void union() throws RemoteException; + public void unsigned() throws RemoteException; + public void ValueBase() throws RemoteException; + public void valuetype() throws RemoteException; + public void VOID() throws RemoteException; + public void wchar() throws RemoteException; + public void wstring() throws RemoteException; +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/BlahEx.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/BlahEx.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/BlahEx.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/BlahEx.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,37 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public class BlahEx extends Exception { + public BlahEx() { + } + + public BlahEx(String message) { + super(message); + } + + public BlahEx(String message, Throwable cause) { + super(message, cause); + } + + public BlahEx(Throwable cause) { + super(cause); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/CheeseIDLEntity.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/CheeseIDLEntity.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/CheeseIDLEntity.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/CheeseIDLEntity.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,33 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * @version $Rev$ $Date$ + */ +public class CheeseIDLEntity implements IDLEntity { + public short cheese = (short) 0; + + public CheeseIDLEntity() { + } + + public CheeseIDLEntity(short cheese) { + this.cheese = cheese; + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Donkey.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Donkey.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Donkey.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Donkey.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,37 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public class Donkey extends Exception { + public Donkey() { + } + + public Donkey(String message) { + super(message); + } + + public Donkey(String message, Throwable cause) { + super(message, cause); + } + + public Donkey(Throwable cause) { + super(cause); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/DonkeyEx.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/DonkeyEx.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/DonkeyEx.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/DonkeyEx.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,37 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public class DonkeyEx extends Exception { + public DonkeyEx() { + } + + public DonkeyEx(String message) { + super(message); + } + + public DonkeyEx(String message, Throwable cause) { + super(message, cause); + } + + public DonkeyEx(Throwable cause) { + super(cause); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Generic$Interface.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Generic%24Interface.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Generic$Interface.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/Generic$Interface.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,28 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public interface Generic$Interface { + public void stuff(); + + public interface Generic$InnerClass { + public void stuff(); + } +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/_Something.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/_Something.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/_Something.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/_Something.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,23 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public interface _Something { +} Added: geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/inout.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/inout.java?rev=191412&view=auto ============================================================================== --- geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/inout.java (added) +++ geronimo/trunk/modules/interop/src/test/org/apache/geronimo/interop/rmi/iiop/portable/other/inout.java Mon Jun 20 00:16:38 2005 @@ -0,0 +1,23 @@ +/** + * + * Copyright 2005 The Apache Software Foundation + * + * Licensed 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.geronimo.interop.rmi.iiop.portable.other; + +/** + * @version $Rev$ $Date$ + */ +public interface inout { +}