diff options
Diffstat (limited to 'libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java')
-rw-r--r-- | libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java b/libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java index 977fb428287..9c908e520cc 100644 --- a/libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java +++ b/libjava/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/RequestTest.java @@ -1,3 +1,39 @@ +/* RequestTest.java -- + Copyright (C) 2005 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU Classpath is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. + + Linking this library statically or dynamically with other modules is + making a combined work based on this library. Thus, the terms and + conditions of the GNU General Public License cover the whole + combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent + modules, and to copy and distribute the resulting executable under + terms of your choice, provided that you also meet, for each linked + independent module, the terms and conditions of the license of that + module. An independent module is a module which is not derived from + or based on this library. If you modify this library, you may extend + this exception to your version of the library, but you are not + obligated to do so. If you do not wish to do so, delete this + exception statement from your version. */ package gnu.classpath.examples.CORBA.SimpleCommunication.communication; @@ -7,14 +43,10 @@ import java.io.FileReader; import java.io.IOException; import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.ByteHolder; -import org.omg.CORBA.DoubleHolder; import org.omg.CORBA.ExceptionList; import org.omg.CORBA.NVList; import org.omg.CORBA.ORB; import org.omg.CORBA.Request; -import org.omg.CORBA.ShortHolder; -import org.omg.CORBA.StringHolder; import org.omg.CORBA.TCKind; import org.omg.CORBA.UnknownUserException; @@ -25,7 +57,7 @@ import org.omg.CORBA.UnknownUserException; * where the program has been started. * * The IOR.txt file is written by the server - * {@link gnu.classpath.examples.CORBA.SimpleCommunication.comServer}. + * {@link gnu.classpath.examples.CORBA.SimpleCommunication.DemoServer}. * The server should be reachable over Internet, unless blocked by * security tools. * @@ -106,7 +138,6 @@ public class RequestTest throw new InternalError(); } testSystemException(); - testUserException(); testWideNarrowStrings(); } @@ -135,13 +166,6 @@ public class RequestTest Request r = object._create_request(null, "passSimple", orb.create_list(0), null); - ByteHolder a_byte = new ByteHolder((byte) 0); - ShortHolder a_short = new ShortHolder((short) 3); - StringHolder a_string = new StringHolder("[string 4]"); - - // This is an 'out' parameter; the value must not be passed to servant. - DoubleHolder a_double = new DoubleHolder(56.789); - r.add_inout_arg().insert_octet((byte) 0); r.add_in_arg().insert_long(2); r.add_inout_arg().insert_short((short) 3); @@ -188,7 +212,7 @@ public class RequestTest try { ExceptionList exList = orb.create_exception_list(); - exList.add(ourUserExceptionHelper.type()); + exList.add(WeThrowThisExceptionHelper.type()); Request rq = object._create_request(null, "throwException", orb.create_list(1), @@ -217,7 +241,7 @@ public class RequestTest System.out.println("**** Test user exception:"); ExceptionList exList = orb.create_exception_list(); - exList.add(ourUserExceptionHelper.type()); + exList.add(WeThrowThisExceptionHelper.type()); Request rq = object._create_request(null, "throwException", orb.create_list(1), null, @@ -228,7 +252,7 @@ public class RequestTest rq.invoke(); UnknownUserException uku = (UnknownUserException) rq.env().exception(); - ourUserException our_exception = ourUserExceptionHelper.extract(uku.except); + WeThrowThisException our_exception = WeThrowThisExceptionHelper.extract(uku.except); System.out.println(" Our user exception, field " + our_exception.ourField + ", has been thrown on remote side." |