dain        2005/06/20 21:22:14

  Added:       modules/core/src/test/org/openejb/corba/compiler
                        BooException.java Foo.java
                        PortableStubCompilerTest.java Simple.java
                        Special.java
  Log:

  Moved portable stub compiler from geronimo interop
  
  Revision  Changes    Path
  1.1                  
openejb/modules/core/src/test/org/openejb/corba/compiler/BooException.java
  
  Index: BooException.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.sf.net/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2005 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: BooException.java,v 1.1 2005/06/21 01:22:14 dain Exp $
   */
  package org.openejb.corba.compiler;
  
  /**
   * @version $Rev$ $Date: 2005/06/21 01:22:14 $
   */
  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);
      }
  }
  
  
  
  1.1                  
openejb/modules/core/src/test/org/openejb/corba/compiler/Foo.java
  
  Index: Foo.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.sf.net/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2005 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: Foo.java,v 1.1 2005/06/21 01:22:14 dain Exp $
   */
  package org.openejb.corba.compiler;
  
  import java.math.BigDecimal;
  import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  import org.openejb.corba.compiler.other.BlahEx;
  import org.openejb.corba.compiler.other.CheeseIDLEntity;
  import org.openejb.corba.compiler.other.Donkey;
  import org.openejb.corba.compiler.other.DonkeyEx;
  import org.openejb.corba.compiler.other.Generic$Interface;
  import org.openejb.corba.compiler.BooException;
  import org.openejb.corba.compiler.other.BlahEx;
  import org.openejb.corba.compiler.other.CheeseIDLEntity;
  import org.openejb.corba.compiler.other.Donkey;
  import org.openejb.corba.compiler.other.DonkeyEx;
  import org.openejb.corba.compiler.other.Generic$Interface;
  
  /**
   * @version $Rev$ $Date: 2005/06/21 01:22:14 $
   */
  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;
  }
  
  
  
  1.1                  
openejb/modules/core/src/test/org/openejb/corba/compiler/PortableStubCompilerTest.java
  
  Index: PortableStubCompilerTest.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.sf.net/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2005 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: PortableStubCompilerTest.java,v 1.1 2005/06/21 01:22:14 dain Exp $
   */
  package org.openejb.corba.compiler;
  
  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: 2005/06/21 01:22:14 $
   */
  public class PortableStubCompilerTest extends TestCase {
      private static final File basedir = new 
File(System.getProperty("basedir", System.getProperty("user.dir")));
  
      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[]{Simple.class.getName(), 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();
          File file = new File(basedir, 
"src/test-resources/nameMangler.properties");
          nameManglerProperties.load(new FileInputStream(file));
  
          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();
          File file = new File(basedir, 
"src/test-resources/specialNameMangler.properties");
          nameManglerProperties.load(new FileInputStream(file));
  
          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);
      }
  }
  
  
  
  1.1                  
openejb/modules/core/src/test/org/openejb/corba/compiler/Simple.java
  
  Index: Simple.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.sf.net/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2005 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: Simple.java,v 1.1 2005/06/21 01:22:14 dain Exp $
   */
  package org.openejb.corba.compiler;
  
  import java.math.BigDecimal;
  import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  import org.openejb.corba.compiler.other.BlahEx;
  import org.openejb.corba.compiler.other.CheeseIDLEntity;
  import org.openejb.corba.compiler.other.Generic$Interface;
  import org.openejb.corba.compiler.other.DonkeyEx;
  import org.openejb.corba.compiler.other.Donkey;
  import org.openejb.corba.compiler.BooException;
  import org.openejb.corba.compiler.Foo;
  import org.openejb.corba.compiler.other.BlahEx;
  import org.openejb.corba.compiler.other.CheeseIDLEntity;
  import org.openejb.corba.compiler.other.Donkey;
  import org.openejb.corba.compiler.other.DonkeyEx;
  import org.openejb.corba.compiler.other.Generic$Interface;
  
  /**
   * @version $Rev$ $Date: 2005/06/21 01:22:14 $
   */
  public interface Simple extends Remote {
      public void invoke(boolean x0,
              char x1,
              byte x2,
              int x3,
              long x4,
              float x5,
              double x6,
              BigDecimal x7,
              Class x8,
              org.omg.CORBA.Object x9,
              org.omg.CORBA.Any x10,
              org.omg.CORBA.TypeCode x11,
              CheeseIDLEntity x12,
              Generic$Interface x13,
              BlahEx x14,
              BooException x15) throws RemoteException, RemoteException, 
BlahEx, BooException, DonkeyEx, Donkey;
  
      public int invokeInt() throws RemoteException;
      public String invokeString() throws RemoteException;
      public Generic$Interface invokeGeneric$Interface() throws RemoteException;
      public Foo invokeFoo() throws RemoteException;
  
  }
  
  
  
  1.1                  
openejb/modules/core/src/test/org/openejb/corba/compiler/Special.java
  
  Index: Special.java
  ===================================================================
  /**
   * Redistribution and use of this software and associated documentation
   * ("Software"), with or without modification, are permitted provided
   * that the following conditions are met:
   *
   * 1. Redistributions of source code must retain copyright
   *    statements and notices.  Redistributions must also contain a
   *    copy of this document.
   *
   * 2. Redistributions in binary form must reproduce the
   *    above copyright notice, this list of conditions and the
   *    following disclaimer in the documentation and/or other
   *    materials provided with the distribution.
   *
   * 3. The name "OpenEJB" must not be used to endorse or promote
   *    products derived from this Software without prior written
   *    permission of The OpenEJB Group.  For written permission,
   *    please contact [EMAIL PROTECTED]
   *
   * 4. Products derived from this Software may not be called "OpenEJB"
   *    nor may "OpenEJB" appear in their names without prior written
   *    permission of The OpenEJB Group. OpenEJB is a registered
   *    trademark of The OpenEJB Group.
   *
   * 5. Due credit should be given to the OpenEJB Project
   *    (http://openejb.sf.net/).
   *
   * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
   * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
   * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   * OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * Copyright 2005 (C) The OpenEJB Group. All Rights Reserved.
   *
   * $Id: Special.java,v 1.1 2005/06/21 01:22:14 dain Exp $
   */
  package org.openejb.corba.compiler;
  
  import java.rmi.Remote;
  import java.rmi.RemoteException;
  
  import org.openejb.corba.compiler.other.Generic$Interface;
  import org.openejb.corba.compiler.other._Something;
  import org.openejb.corba.compiler.other.inout;
  import org.openejb.corba.compiler.other._Something;
  
  /**
   * @version $Rev$ $Date: 2005/06/21 01:22:14 $
   */
  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;
  }
  
  
  

Reply via email to