diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/interop-tests | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/interop-tests')
-rw-r--r-- | TAO/interop-tests/Makefile.am | 13 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/Client.java | 332 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/Makefile.am | 100 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/README | 32 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/Server.java | 75 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/WCharReference.java | 103 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/WChar_PasserImpl.java | 192 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/build.xml | 42 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/client.cpp | 376 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/interop_wchar.idl | 67 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/interop_wchar.mpc | 33 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/interop_wchar_i.cpp | 280 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/interop_wchar_i.h | 132 | ||||
-rwxr-xr-x | TAO/interop-tests/wchar/run_test.pl | 42 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/server.cpp | 147 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/wchar_reference.cpp | 204 | ||||
-rw-r--r-- | TAO/interop-tests/wchar/wchar_reference.h | 55 |
17 files changed, 0 insertions, 2225 deletions
diff --git a/TAO/interop-tests/Makefile.am b/TAO/interop-tests/Makefile.am deleted file mode 100644 index ad94502f7dd..00000000000 --- a/TAO/interop-tests/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -SUBDIRS = \ - wchar - diff --git a/TAO/interop-tests/wchar/Client.java b/TAO/interop-tests/wchar/Client.java deleted file mode 100644 index 73bb469660e..00000000000 --- a/TAO/interop-tests/wchar/Client.java +++ /dev/null @@ -1,332 +0,0 @@ -package interop.wchar; - -import org.omg.CORBA.*; -import java.io.*; -import interop.*; - -/** - * Client.java - * - * Java implemention of the interoperability tests for wchars. - * - * @author Phil Mesnier - * @version $Id$ - */ - -public class Client -{ - private WCharReference ref; - private org.omg.CORBA.ORB orb; - - final private static int WCHAR_TO_SERVER = 0x00000001; - final private static int WSTRING_TO_SERVER = 0x00000002; - final private static int WARRAY_TO_SERVER = 0x00000004; - final private static int ANY_WCHAR_TO_SERVER = 0x00000008; - final private static int WSTRING_EXCEPTION = 0x00000010; - final private static int WCHAR_FROM_SERVER = 0x00000020; - final private static int WSTRING_FROM_SERVER = 0x00000040; - final private static int WARRAY_FROM_SERVER = 0x00000080; - final private static int ANY_WCHAR_FROM_SERVER = 0x00000100; - final private static int ANY_WSTRING_TO_SERVER = 0x00000200; - final private static int ANY_WSTRING_FROM_SERVER = 0x00000400; - final private static int ANY_WSTRING_ECHO = 0x00000800; - final private static int WSTRUCTSEQ_FROM_SERVER = 0x00001000; - final private static int WSTRUCTSEQ_TO_SERVER = 0x00002000; - final private static int NUL_WSTRING_TO_SERVER = 0x00004000; - final private static int TBD_16 = 0x00008000; // update ALL_TESTS if this is defined - final private static int TBD_15 = 0x00010000; // update ALL_TESTS if this is defined - final private static int TBD_14 = 0x00020000; // update ALL_TESTS if this is defined - final private static int TBD_13 = 0x00040000; // update ALL_TESTS if this is defined - final private static int TBD_12 = 0x00080000; // update ALL_TESTS if this is defined - final private static int TBD_11 = 0x00100000; // update ALL_TESTS if this is defined - final private static int TBD_10 = 0x00200000; // update ALL_TESTS if this is defined - final private static int TBD_9 = 0x00400000; // update ALL_TESTS if this is defined - final private static int TBD_8 = 0x00800000; // update ALL_TESTS if this is defined - final private static int TBD_7 = 0x01000000; // update ALL_TESTS if this is defined - final private static int TBD_6 = 0x02000000; // update ALL_TESTS if this is defined - final private static int TBD_5 = 0x04000000; // update ALL_TESTS if this is defined - final private static int TBD_4 = 0x08000000; // update ALL_TESTS if this is defined - final private static int TBD_3 = 0x10000000; // update ALL_TESTS if this is defined - final private static int TBD_2 = 0x20000000; // update ALL_TESTS if this is defined - final private static int TBD_1 = 0x40000000; // update ALL_TESTS if this is defined - final private static int TBD_0 = 0x80000000; // update ALL_TESTS if this is defined - - final private static int ALL_TESTS = 0x00007FFF; - - // for all tests, run each test named in this array - final private static String test_name[] = { - "wchar_to_server", - "wstring_to_server", - "warray_to_server", - "any(wchar)_to_server", - "wstring_exception", - "wchar_from_server", - "wstring_from_server", - "warray_from_server", - "any(wchar)_from_server", - "any(wstring)_to_server", - "any(wstring)_from_server", - "any(wstring)_echo", - "wstructseq_from_server", - "wstructseq_to_server", - "nul_wstring_to_server" - }; - - private int tests_to_run = 0; - private short data_set = 0; - private boolean verbose = false; - - private boolean runOneTest (WChar_Passer server, int test_num) - { - if (test_num > ALL_TESTS) - return false; - - switch (test_num) - { - case 0x00000001: //WCHAR_TO_SERVER: - { - return server.wchar_to_server (ref.get_wchar(data_set), - data_set); - } - case 0x00000002: //WSTRING_TO_SERVER: - { - return server.wstring_to_server (ref.get_wstring(data_set), - data_set); - } - case 0x00000004: //WARRAY_TO_SERVER: - { - return server.warray_to_server (ref.get_warray(data_set), - data_set); - } - case 0x00000008: //ANY_WCHAR_TO_SERVER: - { - Any a = orb.create_any(); - a.insert_wchar (ref.get_wchar(data_set)); - return server.any_to_server (a,data_set); - } - case 0x00000010: //WSTRING_EXCEPTION: - { - try - { - server.exception_test(data_set); - } - catch (interop.WChar_PasserPackage.WStringException ex) - { - return ref.match_except (data_set,ex.why); - } - break; - } - case 0x00000020: // WCHAR_FROM_SERVER: - { - char wc = server.wchar_from_server (data_set); - return ref.match_wchar (data_set,wc); - } - case 0x00000040: //WSTRING_FROM_SERVER: - { - String ws = server.wstring_from_server (data_set); - return ref.match_wstring (data_set,ws); - } - case 0x00000080: //WARRAY_FROM_SERVER: - { - char wa[] = server.warray_from_server (data_set); - return ref.match_warray (data_set,wa); - } - case 0x00000100: // ANY_WCHAR_FROM_SERVER: - { - if (verbose) - System.out.println (" not yet implemented"); - return true; - } - case 0x00000200: // ANY_WSTRING_TO_SERVER: - { - if (verbose) - System.out.println (" not yet implemented"); - return true; - } - case 0x00000400: // ANY_WSTRING_FROM_SERVER: - { - if (verbose) - System.out.println (" not yet implemented"); - return true; - } - case 0x00000800: // ANY_WSTRING_ECHO: - { - if (verbose) - System.out.println (" not yet implemented"); - return true; - } - case 0x00001000: // WSTRUCTSEQ_FROM_SERVER - { - wstruct wsList[] = - server.wstructseq_from_server(data_set); - boolean result = true; - for (int i = 0; i < wsList.length; i++) - result &= - ref.match_wstring (data_set, - wsList[i].st_string); - return result; - } - case 0x00002000: // WSTRUCTSEQ_TO_SERVER - { - wstruct wsList[] = new wstruct[5]; - for (int i = 0; i < wsList.length; ++i) - { - wsList[i] = get_wstruct(data_set); - if (verbose) - System.out.println ("initialized wsList[" + i + "] : " + wsList[i]); - } - return server.wstructseq_to_server(wsList, data_set); - } - - case 0x00004000: // NUL_WSTRING_TO_SERVER - { - return server.wstring_to_server ("", (short)-1); - } - - default: - { - if (verbose) - System.out.println (" not yet implemented"); - return false; - - } - } - return false; - } - - public boolean runTests (WChar_Passer server) - { - int successes = 0; - int numtests = 0; - ref.set_verbose (verbose); - int t = 1; - for (int i = 0; i < test_name.length; i++, t <<= 1) - if ((tests_to_run & t) == t) - { - if (verbose) - System.out.println ("test " + test_name[i]); - boolean result = runOneTest (server,t); - ++numtests; - if (result) ++successes; - if (verbose) - System.out.println (test_name[i] + - "[" + data_set + "] " + - (result ? "passed" : "failed")); - } - if (verbose) - System.out.println ("Total of " + successes + - " successes out of " + numtests + " tests"); - return successes == numtests; - } - - // TODO: this should have a home where it's accessable to both - // client & server, but it doesn't belong in WCharReference - public wstruct get_wstruct (short key) - { - wstruct result = new wstruct(); - - result.st_char = ref.get_wchar(key); - result.st_string = ref.get_wstring(key); - result.st_array = ref.get_warray(key); - result.st_any = orb.create_any(); - result.st_any.insert_wstring(ref.get_wstring(key)); - - return result; - } - - // TODO: this should have a home where it's accessable to both - // client & server, but it doesn't belong in WCharReference - public boolean match_wstruct (short key, wstruct test ) - { - boolean result = ref.match_wchar(key, test.st_char); - result &= ref.match_wstring(key, test.st_string); - result &= ref.match_warray(key, test.st_array); - // @@ todo result &= ref.match_wstring (key, test.st_any.extract_wstring()); - return result; - } - - - public void run(String[] args) - throws Exception - { - String iorfile = "IOR"; - boolean kill_server = false; - - for (int i = 0; i < args.length; i++) - { - if (args[i].equals ("-i")) - iorfile = args[++i]; - else if (args[i].equals ("-v")) - verbose = true; - else if (args[i].equals ("-x")) - kill_server = true; - else if (args[i].equals ("-t")) - { - int tnum = Integer.decode(args[++i]).intValue(); - if (tnum >= 0 && tnum < test_name.length) - tests_to_run |= (1 << tnum); - } - else - { - System.out.println( "Usage: jaco interop.wchar.Client " + - "-i <ior_file> " + - "-t <0 <= num < " + test_name.length + "> " + - "-v " + - "-x "); - System.out.println ("Available tests:"); - for (int j = 0; i < test_name.length; i++) - System.out.println (j + " - " + test_name[i]); - System.exit( 1 ); - } - } - if (tests_to_run == 0) - tests_to_run = ALL_TESTS; - - File f = new File(iorfile); - - //check if file exists - if( ! f.exists() ) - { - System.out.println("File " + iorfile + - " does not exist."); - System.exit( -1 ); - } - - //check if args[0] points to a directory - if( f.isDirectory() ) - { - System.out.println("File " + iorfile + - " is a directory."); - System.exit( -1 ); - } - - // initialize the ORB. - orb = org.omg.CORBA.ORB.init( args, null ); - ref = new WCharReference(verbose); - - BufferedReader br = - new BufferedReader( new FileReader( f )); - - // get object reference from command-line argument file - org.omg.CORBA.Object obj = - orb.string_to_object( br.readLine() ); - - br.close(); - - WChar_Passer wp = WChar_PasserHelper.narrow( obj ); - - boolean result = runTests (wp); - System.out.println ("wchar_interop test (Java client, " + - wp.orb_name() + " server) " + - (result ? "passed" : "failed")); - if (kill_server) - wp.shutdown(); - } - public static void main( String[] args ) - throws Exception - { - Client client = new Client(); - client.run(args); - } - -}// Client diff --git a/TAO/interop-tests/wchar/Makefile.am b/TAO/interop-tests/wchar/Makefile.am deleted file mode 100644 index 27d5313153f..00000000000 --- a/TAO/interop-tests/wchar/Makefile.am +++ /dev/null @@ -1,100 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.interop_wchar_IDL.am - -BUILT_SOURCES = \ - interop_wcharC.cpp \ - interop_wcharC.h \ - interop_wcharC.inl \ - interop_wcharS.cpp \ - interop_wcharS.h \ - interop_wcharS.inl - -CLEANFILES = \ - interop_wchar-stamp \ - interop_wcharC.cpp \ - interop_wcharC.h \ - interop_wcharC.inl \ - interop_wcharS.cpp \ - interop_wcharS.h \ - interop_wcharS.inl - -interop_wcharC.cpp interop_wcharC.h interop_wcharC.inl interop_wcharS.cpp interop_wcharS.h interop_wcharS.inl: interop_wchar-stamp - -interop_wchar-stamp: $(srcdir)/interop_wchar.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) $(srcdir)/interop_wchar.idl - @touch $@ - - -noinst_HEADERS = \ - interop_wchar.idl - -## Makefile.Interop_Wchar_Client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -client_SOURCES = \ - client.cpp \ - interop_wcharC.cpp \ - wchar_reference.cpp \ - wchar_reference.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.Interop_Wchar_Server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -server_SOURCES = \ - interop_wcharC.cpp \ - interop_wcharS.cpp \ - interop_wchar_i.cpp \ - server.cpp \ - wchar_reference.cpp \ - interop_wchar_i.h \ - wchar_reference.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/interop-tests/wchar/README b/TAO/interop-tests/wchar/README deleted file mode 100644 index 3e9e71d873c..00000000000 --- a/TAO/interop-tests/wchar/README +++ /dev/null @@ -1,32 +0,0 @@ -Test for passing wchar data between TAO and JacORB processes. -This test may also be run for tao-tao on different platforms. - -To build this test for JacORB requires a JacORB 2.0 installation, and the -ant build tool. The Java classpath must include $JACORB_HOME/lib/jacorb.jar -and $TAO_ROOT/interop-tests/classes. - -To build the tao test client and server, first run mwc.pl in the ordinary -way to generate makefiles or project files. Then to build the JacORB client -and server, use "ant" which assumes $JACORB_HOME is set to the JacORB home -directory. - -The TAO server command line is: - ./server [-o iorfile] [-v] -The default ior file for the server is "./IOR" -The -v option causes the server to output some details of its operation. - -The TAO client command line is: - ./client [-k ior] [[-t 0 < n <= 14]...] [-v] [-x] -The default ior is "file://IOR". Note that it is an IOR, not a filename. -The -t option selects individual tests, no selection implies all tests, - the -t option may be repeated to select a number of tests -The -v option make the test more verbose, not adding it only outputs final - pass/fail message. -The -x option makes the client send a shutdown request to the server. -Anything else, such as -?, will yield a list of options and test descriptions. - -To run the JacORB client or server, use the "jaco" utility, - -jaco -classpath ../classes interop.wchar.Server [-o iorfile] [-v] -jaco -classpath ../classes interop.wchar.Client [-i iorfile] [-t 0..14] [-v] [-x] -Note that Client takes -i iorfile, not -k ior. diff --git a/TAO/interop-tests/wchar/Server.java b/TAO/interop-tests/wchar/Server.java deleted file mode 100644 index 3fc1fb6d6d7..00000000000 --- a/TAO/interop-tests/wchar/Server.java +++ /dev/null @@ -1,75 +0,0 @@ -package interop.wchar; - -import java.io.*; - -import org.omg.CORBA.*; -import org.omg.PortableServer.*; -import interop.*; - -/** - * Server.java - * - * Java implemention of the interoperability tests for wchars. - * - * @author Phil Mesnier - * @version $Id$ - */ - -public class Server -{ - public static void main(String[] args) - { - String iorfile = "IOR"; - boolean verbose = false; - for (int i = 0; i < args.length; i++) - { - if (args[i].equals ("-o")) - iorfile = args[++i]; - else if (args[i].equals ("-v")) - verbose = true; - else - { - System.out.println( "Usage: jaco interop.wchar.Server " + - "-o <ior_file> " + - "-v "); - System.exit( 1 ); - } - } - - try - { - //init ORB - ORB orb = ORB.init( args, null ); - - //init POA - POA poa = - POAHelper.narrow( orb.resolve_initial_references( "RootPOA" )); - - poa.the_POAManager().activate(); - - // create a GoodDay object - WChar_PasserImpl servant = new WChar_PasserImpl(orb, verbose); - - // create the object reference - org.omg.CORBA.Object obj = - poa.servant_to_reference( servant ); - - PrintWriter pw = - new PrintWriter( new FileWriter( iorfile )); - - // print stringified object reference to file - pw.println( orb.object_to_string( obj )); - - pw.flush(); - pw.close(); - - // wait for requests - orb.run(); - } - catch( Exception e ) - { - System.out.println( e ); - e.printStackTrace(); - } - } -} diff --git a/TAO/interop-tests/wchar/WCharReference.java b/TAO/interop-tests/wchar/WCharReference.java deleted file mode 100644 index 0037c6ed5c9..00000000000 --- a/TAO/interop-tests/wchar/WCharReference.java +++ /dev/null @@ -1,103 +0,0 @@ -package interop.wchar; - - -/** - * Client.java - * - * Java implemention of the reference wchar data supplied to both - * clients and servers. This is independently maintained in parallel - * with the c++ version, wchar_reference.cpp - * - * @author Phil Mesnier - * @version $Id$ - */ - -public class WCharReference -{ - private char ref_wchar[] = {1234}; - private String ref_wstring[] = {"have a nice day"}; - private char ref_warray[][] = - { {'a','A','!','1','4','[','?','%','X','E'} }; - private String ref_except[] = {"TEST EXCEPTION"}; - - private boolean verbose = false; - - public WCharReference () - { - } - - public WCharReference (boolean v) - { - verbose = v; - } - - public void set_verbose (boolean v) - { - verbose = v; - } - - public char get_wchar (int key) { - return ref_wchar[key]; - } - - public String get_wstring (int key) { - return ref_wstring[key]; - } - - public char[] get_warray (int key) { - return ref_warray[key]; - } - - public String get_except (int key) { - return ref_except[key]; - } - - public boolean match_wchar (short key, char test) - { - if (verbose) - System.out.println ("match_wchar: expecting " + - ref_wchar[key] + " got " + - test + " for key " + key); - return ref_wchar[key] == test; - } - - public boolean match_wstring (short key, String test) - { - if (key == -1) { - if (verbose) - System.out.println ("match_wstring: expcting nul string, " + - "got string length " + test.length()); - return test.length() == 0; - } - if (verbose) - System.out.println ("match_wstring: expecting " + - ref_wstring[key] + " got " + - test + " for key " + key); - return test.equals(ref_wstring[key]); - } - - public boolean match_warray (short key, char test[]) - { - if (verbose) - System.out.println ("match_warray: key " + key); - for (int i = 0; i < test.length; i++) - { - if (verbose) - System.out.println (" expecting[" + i + "] " + - ref_warray[key][i] + ", got " + - test[i]); - if (ref_warray[key][i] != test[i]) - return false; - } - return true; - } - - public boolean match_except (short key, String test) - { - if (verbose) - System.out.println ("match_except: expecting " + - ref_except[key] + " got " + - test + " for key " + key); - return test.equals(ref_except[key]); - } -} diff --git a/TAO/interop-tests/wchar/WChar_PasserImpl.java b/TAO/interop-tests/wchar/WChar_PasserImpl.java deleted file mode 100644 index ee3086bfa1b..00000000000 --- a/TAO/interop-tests/wchar/WChar_PasserImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -package interop.wchar; - -import org.omg.CORBA.*; -import interop.*; - -/** - * WChar_PasserImpl.java - * - * Java implemention of the interoperability tests for wchars. - * - * @author Phil Mesnier - * @version $Id$ - */ - -public class WChar_PasserImpl - extends WChar_PasserPOA -{ - private ORB orb; - private WCharReference ref; - - public WChar_PasserImpl( ORB o, boolean v ) - { - this.orb = o; - this.ref = new WCharReference(v); - } - - public String orb_name () - { - // we don't really know, eh? - return "Java ORB"; - } - - public boolean wchar_to_server (char test, short key) - { - System.out.println ("wchar_to_server called, test = " + (int)test - + " key = " + key); - if (key != 0) - return false; - return ref.match_wchar(key,test); - } - - public char wchar_from_server (short key) - { - return ref.get_wchar(key); - } - - public boolean wstring_to_server (String test, short key) - { - return ref.match_wstring (key,test); - } - - public String wstring_from_server (short key) - { - return ref.get_wstring (key); - } - - public boolean warray_to_server (char test[], short key) - { - return ref.match_warray (key,test); - } - - public char[] warray_from_server (short key) - { - return ref.get_warray (key); - } - - public boolean wstruct_to_server (wstruct test, short key) - { - return match_wstruct (key, test); - } - - public wstruct wstruct_from_server (short key) - { - return new wstruct(); - } - - public boolean wstructseq_to_server (wstruct[] test, short key) - { - boolean result = true; - System.out.println ("wstructseq_to_server called, key = " + key); - for (int i = 0; i < test.length; i++) - { - if (wstruct_to_server(test[i],key)) - { - // System.out.println ("wstructseq_to_server passed entry " + i); - } - else - { - System.out.println ("wstructseq_to_server FAILED entry " + i); - result = false; - } - } - return result; - } - - public wstruct[] wstructseq_from_server (short key) - { - wstruct[] wsList = new wstruct[5]; - for (int i = 0; i < wsList.length; i++) - { - wsList[i] = get_wstruct(key); - } - return wsList; - } - - public boolean wunion_to_server (wunion test, short key) - { - return false; - } - - public wunion wunion_from_server (short key, wchar_types type) - { - return new wunion(); - } - - public boolean any_to_server (Any test, short key) - { - int kind = test.type().kind().value(); - switch( kind ) - { - case TCKind._tk_wchar: - return wchar_to_server(test.extract_wchar(),key); - case TCKind._tk_wstring: - return wstring_to_server(test.extract_wstring(),key); - default: - System.out.println ("WChar_PasserImpl.any_to_server " + - kind + " is not an implemented kind"); - } - return false; - } - - public Any any_from_server (short key, wchar_types type) - { - Any a = orb.create_any(); - switch (type.value()) { - case interop.wchar_types._is_wchar: - a.insert_wchar(ref.get_wchar(key)); - break; - case interop.wchar_types._is_wstring: - a.insert_wstring(ref.get_wstring(key)); - break; - case interop.wchar_types._is_warray: - break; - } - return a; - } - - public Any any_echo (Any test) - { - return test; - } - - public void exception_test(short key) - throws interop.WChar_PasserPackage.WStringException - { - throw new interop. - WChar_PasserPackage. - WStringException(ref.get_except(key),ref.get_wchar(key)); - } - - public void shutdown () - { - orb.shutdown(false); - } - - // TODO: this should have a home where it's accessable to both - // client & server, but it doesn't belong in WCharReference - public wstruct get_wstruct (short key) - { - wstruct result = new wstruct(); - - result.st_char = ref.get_wchar(key); - result.st_string = ref.get_wstring(key); - result.st_array = ref.get_warray(key); - result.st_any = orb.create_any(); - result.st_any.insert_wstring(ref.get_wstring(key)); - - return result; - } - - // TODO: this should have a home where it's accessable to both - // client & server, but it doesn't belong in WCharReference - public boolean match_wstruct (short key, wstruct test ) - { - boolean result = ref.match_wchar(key, test.st_char); - result &= ref.match_wstring(key, test.st_string); - result &= ref.match_warray(key, test.st_array); - // @@ todo result &= ref.match_wstring (key, test.st_any.extract_wstring()); - return result; - } - -} diff --git a/TAO/interop-tests/wchar/build.xml b/TAO/interop-tests/wchar/build.xml deleted file mode 100644 index f948d0a5939..00000000000 --- a/TAO/interop-tests/wchar/build.xml +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- -/* - * - */ ---> - -<project name="wc_test" default="compile" basedir="."> - <target name="init" > - <property environment="env" /> - <property name="jacorb.home" value="${env.JACORB_HOME}" /> - <property name="debug" value="on" /> - - <!-- generated source --> - <mkdir dir="gensrc" /> - <!-- compiled java --> - <mkdir dir="../classes" /> - <taskdef name="jacidl" classname="org.jacorb.idl.JacIDL"> - <classpath> - <fileset dir="${jacorb.home}/lib"> - <include name="*.jar"/> - </fileset> - </classpath> - </taskdef> - </target> - - <target name="compile" depends="init"> - <jacidl srcdir="." destdir="gensrc" /> - <javac debug="${debug}" - debuglevel="${debuglevel}" - srcdir="." - destdir="../classes" > - <classpath> - <fileset dir="${jacorb.home}/lib"> - <include name="*.jar"/> - </fileset> - </classpath> - </javac> - </target> - -</project> diff --git a/TAO/interop-tests/wchar/client.cpp b/TAO/interop-tests/wchar/client.cpp deleted file mode 100644 index c7ebabb7368..00000000000 --- a/TAO/interop-tests/wchar/client.cpp +++ /dev/null @@ -1,376 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// interop_test/wchar -// -// = FILENAME -// client.cpp -// -// = DESCRIPTION -// C++ client side for testing interoperability with wchar data. -// -// = AUTHOR -// Phil Mesnier <mesnier_p@ociweb.com> -// -// ============================================================================ - -#include "interop_wcharC.h" -#include "wchar_reference.h" - -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" - -const int WCHAR_TO_SERVER = 0x00000001; -const int WSTRING_TO_SERVER = 0x00000002; -const int WARRAY_TO_SERVER = 0x00000004; -const int ANY_WCHAR_TO_SERVER = 0x00000008; -const int WSTRING_EXCEPTION = 0x00000010; -const int WCHAR_FROM_SERVER = 0x00000020; -const int WSTRING_FROM_SERVER = 0x00000040; -const int WARRAY_FROM_SERVER = 0x00000080; -const int ANY_WCHAR_FROM_SERVER = 0x00000100; -const int ANY_WSTRING_TO_SERVER = 0x00000200; -const int ANY_WSTRING_FROM_SERVER = 0x00000400; -const int ANY_WSTRING_ECHO = 0x00000800; -const int WSTRUCTSEQ_FROM_SERVER = 0x00001000; -const int WSTRUCTSEQ_TO_SERVER = 0x00002000; -const int NUL_WSTRING_TO_SERVER = 0x00004000; -const int TBD_16 = 0x00008000; // update ALL_TESTS if this is defined -const int TBD_15 = 0x00010000; // update ALL_TESTS if this is defined -const int TBD_14 = 0x00020000; // update ALL_TESTS if this is defined -const int TBD_13 = 0x00040000; // update ALL_TESTS if this is defined -const int TBD_12 = 0x00080000; // update ALL_TESTS if this is defined -const int TBD_11 = 0x00100000; // update ALL_TESTS if this is defined -const int TBD_10 = 0x00200000; // update ALL_TESTS if this is defined -const int TBD_9 = 0x00400000; // update ALL_TESTS if this is defined -const int TBD_8 = 0x00800000; // update ALL_TESTS if this is defined -const int TBD_7 = 0x01000000; // update ALL_TESTS if this is defined -const int TBD_6 = 0x02000000; // update ALL_TESTS if this is defined -const int TBD_5 = 0x04000000; // update ALL_TESTS if this is defined -const int TBD_4 = 0x08000000; // update ALL_TESTS if this is defined -const int TBD_3 = 0x10000000; // update ALL_TESTS if this is defined -const int TBD_2 = 0x20000000; // update ALL_TESTS if this is defined -const int TBD_1 = 0x40000000; // update ALL_TESTS if this is defined -const int TBD_0 = 0x80000000; // update ALL_TESTS if this is defined - -const int ALL_TESTS = 0x00007FFF; - -// The length of this array determines which tests are run for "all tests" -const char * test_name[] = - { - "wchar_to_server", - "wstring_to_server", - "warray_to_server", - "any(wchar)_to_server", - "wstring_exception", - "wchar_from_server", - "wstring_from_server", - "warray_from_server", - "any(wchar)_from_server", - "any(wstring)_to_server", - "any(wstring)_from_server", - "any(wstring)_echo", - "wstructseq_from_server", - "wstructseq_to_server", - "nul_wstring_to_server" - }; - -const int LAST_TEST = sizeof (test_name) / sizeof (test_name[0]); -const ACE_TCHAR *ior = ACE_TEXT("file://IOR"); -int tests_to_run = 0; -int verbose = 0; -int kill_server = 0; -int data_set = 0; - -#if defined (ACE_HAS_WCHAR) || defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) - -wchar_reference ref; - -void -assign_wstruct (short key, interop::wstruct & ws) -{ - ws.st_char = ref.get_wchar(key); - ws.st_string = CORBA::wstring_dup(ref.get_wstring(key)); - ref.assign_warray(key, ws.st_array); - ws.st_any <<= CORBA::wstring_dup(ref.get_wstring(key)); -} - - -CORBA::Boolean -run_one_test (interop::WChar_Passer_ptr server, - int test_num ACE_ENV_ARG_DECL) -{ - switch (test_num) - { - case WCHAR_TO_SERVER: - return server->wchar_to_server (ref.get_wchar(data_set), - data_set - ACE_ENV_ARG_PARAMETER); - case WSTRING_TO_SERVER: - return server->wstring_to_server (ref.get_wstring(data_set), - data_set - ACE_ENV_ARG_PARAMETER); - case WARRAY_TO_SERVER: - return server->warray_to_server (ref.get_warray(data_set), - data_set - ACE_ENV_ARG_PARAMETER); - case ANY_WCHAR_TO_SERVER: - { - CORBA::Any a; - a <<= CORBA::Any::from_wchar(ref.get_wchar(data_set)); - return server->any_to_server (a,data_set ACE_ENV_ARG_PARAMETER); - } - case WSTRING_EXCEPTION: - { - ACE_TRY_NEW_ENV - { - server->exception_test(data_set ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (interop::WChar_Passer::WStringException, e) - { - return ref.match_except (data_set,e.why.in()); - } - ACE_ENDTRY; - break; - } - case WCHAR_FROM_SERVER: - { - CORBA::WChar wc = server->wchar_from_server (data_set - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - return ref.match_wchar (data_set,wc); - } - case WSTRING_FROM_SERVER: - { - CORBA::WString_var ws = - server->wstring_from_server (data_set - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - return ref.match_wstring (data_set,ws.in()); - } - case WARRAY_FROM_SERVER: - { - interop::warray_var wa = - server->warray_from_server (data_set - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - return ref.match_warray (data_set,wa.in()); - } - case ANY_WCHAR_FROM_SERVER: - { - CORBA::WChar wc; - CORBA::Any_var test = server->any_from_server (data_set, - interop::is_wchar - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - if (test >>= CORBA::Any::to_wchar(wc)) - { - return ref.match_wchar (data_set,wc); - } - return 0; - } - case ANY_WSTRING_TO_SERVER: - { - CORBA::Any a; - a <<= ref.get_wstring(data_set); - return server->any_to_server (a,data_set - ACE_ENV_ARG_PARAMETER); - } - case ANY_WSTRING_FROM_SERVER: - { - const CORBA::WChar *ws; - CORBA::Any_var test = server->any_from_server (data_set, - interop::is_wstring - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - if (test >>= ws) - { - return ref.match_wstring (data_set,ws); - } - return 0; - } - case ANY_WSTRING_ECHO: - { - CORBA::Any a; - a <<= ref.get_wstring(data_set); - const CORBA::WChar *ws; - CORBA::Any_var test = server->any_echo (a ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - if (test >>= ws) - { - return ref.match_wstring (data_set,ws); - } - return 0; - } - case WSTRUCTSEQ_FROM_SERVER: - { - interop::wstructseq_var wsList = - server->wstructseq_from_server(data_set ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - int result = 1; - - for (CORBA::ULong i = 0; i < wsList->length(); i++) - result &= ref.match_wstring (data_set, - wsList[i].st_string.in()); - - return result; - } - case WSTRUCTSEQ_TO_SERVER: - { - interop::wstructseq_var wsList = new interop::wstructseq; - wsList->length(5); - for (CORBA::ULong i = 0; i < wsList->length(); ++i) - { - assign_wstruct(data_set, (*wsList)[i]); - } - return server->wstructseq_to_server(wsList.in(), data_set - ACE_ENV_ARG_PARAMETER); - } - case NUL_WSTRING_TO_SERVER: - return server->wstring_to_server (L"", - -1 - ACE_ENV_ARG_PARAMETER); - default: - break; - } - return 0; -} - -short -run_tests (interop::WChar_Passer_ptr server ACE_ENV_ARG_DECL) -{ - short successes = 0; - short numtests = 0; - ref.set_verbose (verbose); - int t = 1; - for (int i = 0; i < LAST_TEST; i++, t <<= 1) - if ((tests_to_run & t) == t) - { - CORBA::Boolean result = run_one_test (server,t ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(0); - ++numtests; - if (result) ++successes; - if (verbose) - ACE_DEBUG ((LM_DEBUG, "%s[%d] %s\n", - test_name[i],data_set, - (result ? "passed" : "failed"))); - } - if (verbose) - ACE_DEBUG ((LM_DEBUG, "Total of %d successes out of %d tests\n", - successes, numtests)); - return successes == numtests; -} -#endif // ACE_HAS_WCHAR || ACE_HAS_XPG4_MULTIBYTE_CHAR - -int -parse_args (int argc, ACE_TCHAR *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:t:vx")); - int c; - while ((c = get_opts ()) != -1) - switch (c) - { - case 'k': - ior = get_opts.opt_arg (); - break; - case 't': - { - int tnum = ACE_OS::atoi(get_opts.opt_arg()); - if (tnum >= 0 && tnum < LAST_TEST) - tests_to_run |= (1 << tnum); - else - ACE_ERROR_RETURN ((LM_ERROR,"test %d is out of range\n",tnum),-1); - break; - } - case 'v': - verbose = 1; - break; - case 'x': - kill_server = 1; - break; - case '?': - default: - { - ACE_ERROR ((LM_ERROR, - "usage: %s " - "-k <ior> " - "[-t <0 <= test_num < %d>][ -t ...] " - "[-v] " - "[-x] " - "\n", - argv [0], LAST_TEST)); - ACE_ERROR ((LM_ERROR, "Available tests:\n")); - for (int i = 0; i < LAST_TEST; i++) - ACE_ERROR ((LM_ERROR, " %d - %s\n",i, test_name[i])); - return -1; - } - } - - if (tests_to_run == 0) - tests_to_run = ALL_TESTS; - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN( int argc, ACE_TCHAR *argv[] ) -{ -#if (!defined ACE_HAS_WCHAR) && (!defined ACE_HAS_XPG4_MULTIBYTE_CHAR) - ACE_UNUSED_ARG (argc); - ACE_UNUSED_ARG (argv); - ACE_ERROR_RETURN ((LM_ERROR,ACE_TEXT ("This test requires wchar support\n")),0); -#else - ACE_TRY_NEW_ENV - { - ACE_Argv_Type_Converter command_line(argc, argv); - // Initialize orb - CORBA::ORB_var orb = CORBA::ORB_init( command_line.get_argc(), command_line.get_ASCII_argv() ); - if (parse_args(argc, argv) == -1) - return 0; - - // Destringify ior - CORBA::Object_var obj = orb->string_to_object( ACE_TEXT_ALWAYS_CHAR(ior) ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if( CORBA::is_nil( obj.in() ) ) - ACE_ERROR_RETURN ((LM_ERROR, - "arg is not a valid ior sting"), - -1); - - // Narrow - interop::WChar_Passer_var server = - interop::WChar_Passer::_narrow( obj.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if( CORBA::is_nil( server.in() )) - ACE_ERROR_RETURN ((LM_ERROR, - "arg is not a interop::WChar_Passer reference\n"), - -1); - - short result = run_tests (server.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - CORBA::String_var server_orb = - server->orb_name(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - ACE_ERROR ((LM_ERROR, - "wchar_interop test (TAO client, %s server) %s \n", - server_orb.in(), - (result ? "passed" : "failed"))); - if (kill_server) - { - server->shutdown(ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCH(CORBA::Exception, ex) - { - ACE_PRINT_EXCEPTION(ex, "Uncaught CORBA exception: "); - return 1; - } - ACE_ENDTRY; - return 0; -#endif -} diff --git a/TAO/interop-tests/wchar/interop_wchar.idl b/TAO/interop-tests/wchar/interop_wchar.idl deleted file mode 100644 index 8b8a7ca3b56..00000000000 --- a/TAO/interop-tests/wchar/interop_wchar.idl +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ - -// Tests for interoperability between TAO and JacORB for sending wchar data -// The CDR defines separate serialization functions for reading and writing -// wchar, wchar[] and wstring data. Encapsulated wchar data is also tested. - -module interop { - typedef wchar warray[10]; - - struct wstruct { - wchar st_char; - wstring st_string; - warray st_array; - any st_any; - }; - - typedef sequence< wstruct > wstructseq; - - enum wchar_types {is_wchar, is_wstring, is_warray}; - - union wunion switch (wchar_types) { - case is_wchar: wchar u_char; - case is_wstring: wstring u_string; - case is_warray: warray u_array; - }; - - interface WChar_Passer { - // The server and client for this test should both use a well known test - // data to allow individual string comparisons against reference strings. - // The separate test key value allows the tester to devise several strings, - // arrays, or wchar values that may be tested separately. - - readonly attribute string orb_name; - - boolean wchar_to_server (in wchar test, in short key); - wchar wchar_from_server (in short key); - - boolean wstring_to_server (in wstring test, in short key); - wstring wstring_from_server (in short key); - - boolean warray_to_server (in warray test, in short key); - warray warray_from_server (in short key); - - boolean wstruct_to_server (in wstruct test, in short key); - wstruct wstruct_from_server (in short key); - - boolean wstructseq_to_server (in wstructseq test, in short key); - wstructseq wstructseq_from_server (in short key); - - boolean wunion_to_server (in wunion test, in short key); - wunion wunion_from_server (in short key, in wchar_types type); - - boolean any_to_server (in any test, in short key); - any any_from_server (in short key, in wchar_types type); - - any any_echo (in any test); - - exception WStringException { wstring why; wchar whynot;}; - void exception_test(in short key) raises (WStringException); - - /// A method to shutdown the ORB - /** - * This method is used to simplify the test shutdown process - */ - oneway void shutdown (); - }; -}; diff --git a/TAO/interop-tests/wchar/interop_wchar.mpc b/TAO/interop-tests/wchar/interop_wchar.mpc deleted file mode 100644 index 1e82e0edc94..00000000000 --- a/TAO/interop-tests/wchar/interop_wchar.mpc +++ /dev/null @@ -1,33 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults, anytypecode { - IDL_Files { - interop_wchar.idl - } - custom_only = 1 -} - -project(*Server): taoserver { - after += *IDL - Source_Files { - interop_wchar_i.cpp - wchar_reference.cpp - server.cpp - interop_wcharS.cpp - interop_wcharC.cpp - } - IDL_Files { - } -} - -project(*Client): taoclient, anytypecode { - after += *IDL - Source_Files { - interop_wcharC.cpp - wchar_reference.cpp - client.cpp - } - IDL_Files { - } -} diff --git a/TAO/interop-tests/wchar/interop_wchar_i.cpp b/TAO/interop-tests/wchar/interop_wchar_i.cpp deleted file mode 100644 index 88aa05387ca..00000000000 --- a/TAO/interop-tests/wchar/interop_wchar_i.cpp +++ /dev/null @@ -1,280 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be/be_codegen.cpp:986 - -#include "interop_wchar_i.h" - -// Implementation skeleton constructor -interop_WChar_Passer_i::interop_WChar_Passer_i (CORBA::ORB_ptr o, - int verbose) - : orb_(CORBA::ORB::_duplicate (o)), - ref_ (verbose) -{ -} - -// Implementation skeleton destructor -interop_WChar_Passer_i::~interop_WChar_Passer_i (void) -{ -} - -char * -interop_WChar_Passer_i::orb_name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return CORBA::string_dup ("TAO"); -} - -CORBA::Boolean -interop_WChar_Passer_i::wchar_to_server (CORBA::WChar test, - CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return ref_.match_wchar (key,test); -} - -CORBA::WChar -interop_WChar_Passer_i::wchar_from_server (CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return ref_.get_wchar (key); -} - -CORBA::Boolean -interop_WChar_Passer_i::wstring_to_server (const CORBA::WChar * test, - CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return ref_.match_wstring(key,test); -} - -CORBA::WChar * -interop_WChar_Passer_i::wstring_from_server (CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return CORBA::wstring_dup (ref_.get_wstring(key)); -} - -CORBA::Boolean -interop_WChar_Passer_i::warray_to_server (const interop::warray test, - CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return ref_.match_warray(key,test); -} - -interop::warray_slice * -interop_WChar_Passer_i::warray_from_server (CORBA::Short key - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return interop::warray_dup (ref_.get_warray(key)); -} - -CORBA::Boolean -interop_WChar_Passer_i::wstruct_to_server (const interop::wstruct & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return - ref_.match_wchar (key,test.st_char) && - ref_.match_wstring (key,test.st_string) && - ref_.match_warray (key,test.st_array) && - this->any_to_server (test.st_any,key ACE_ENV_ARG_PARAMETER); -} - -interop::wstruct * -interop_WChar_Passer_i::wstruct_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - interop::wstruct_var ws = new interop::wstruct (); - ws->st_char = this->wchar_from_server(key ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - ws->st_string = this->wstring_from_server(key ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - ref_.assign_warray (key, ws->st_array); - ws->st_any <<= ref_.get_wstring(key); - return ws._retn (); -} - -CORBA::Boolean -interop_WChar_Passer_i::wstructseq_to_server (const interop::wstructseq & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - CORBA::Boolean result = 1; - for (CORBA::ULong i = 0; result && i < test.length(); i++) - { - result = this->wstruct_to_server(test[i], key ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - return result; -} - -interop::wstructseq * -interop_WChar_Passer_i::wstructseq_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - interop::wstructseq_var wsListI = new interop::wstructseq(); - wsListI->length(5); - - for (CORBA::ULong i = 0; i < wsListI->length(); i++) - { - wsListI[i].st_char = this->wchar_from_server(key ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - wsListI[i].st_string = this->wstring_from_server(key ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - ref_.assign_warray (key, wsListI[i].st_array); - // this is to keep Cxx on TRUE64 happy - // it won't cast a wide character literal (i.e. L"") - // to a CORBA::WChar *. + - // {I wonder if sizeof(wchar_t) != sizeof (CORBA::WChar)?} - const CORBA::WChar empty_wstring[] = {0}; - wsListI[i].st_any <<= CORBA::wstring_dup(empty_wstring); - } - return wsListI._retn(); -} - -CORBA::Boolean -interop_WChar_Passer_i::wunion_to_server (const interop::wunion & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - switch (test._d()) { - case interop::is_wchar : - return this->wchar_to_server (test.u_char(),key ACE_ENV_ARG_PARAMETER); - case interop::is_wstring : - return this->wstring_to_server (test.u_string(),key ACE_ENV_ARG_PARAMETER); - case interop::is_warray : - return this->warray_to_server (test.u_array(),key ACE_ENV_ARG_PARAMETER); - default: - /*return 0*/; - } - return 0; -} - -interop::wunion * -interop_WChar_Passer_i::wunion_from_server (CORBA::Short key, - interop::wchar_types type - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - interop::wunion *wu = new interop::wunion (); - switch (type) { - case interop::is_wchar : - wu->u_char (ref_.get_wchar(key)); - break; - case interop::is_wstring : - wu->u_string (ref_.get_wstring(key)); - break; - case interop::is_warray : - wu->u_array (ref_.get_warray(key)); - break; - } - return wu; -} - - -CORBA::Boolean -interop_WChar_Passer_i::any_to_server (const CORBA::Any &test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - CORBA::WChar wc; - const CORBA::WChar *ws; - CORBA::WString_var wstr; - interop::warray_forany forany; - - if (test >>= CORBA::Any::to_wchar(wc)) - { - return this->wchar_to_server(wc,key ACE_ENV_ARG_PARAMETER); - } - else if (test >>= ws) - { - return this->wstring_to_server (ws,key ACE_ENV_ARG_PARAMETER); - } - else if (test >>= forany) - { - return this->warray_to_server (forany.in(),key ACE_ENV_ARG_PARAMETER); - } - return 0; -} - -CORBA::Any* -interop_WChar_Passer_i::any_from_server (CORBA::Short key, - interop::wchar_types type - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - CORBA::Any *any = new CORBA::Any; - switch (type) { - case interop::is_wchar : - (*any) <<= CORBA::Any::from_wchar(ref_.get_wchar(key)); - break; - case interop::is_wstring : - (*any) <<= ref_.get_wstring(key); - break; - case interop::is_warray : - { - interop::warray_forany forany(ref_.get_warray(key)); - (*any) <<= forany.in(); - break; - } - } - return any; -} - -CORBA::Any * -interop_WChar_Passer_i::any_echo (const CORBA::Any &test - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - return new CORBA::Any (test); -} - -void -interop_WChar_Passer_i::exception_test ( CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - interop::WChar_Passer::WStringException)) -{ - ACE_THROW (interop::WChar_Passer::WStringException(ref_.get_except(key), - this->wchar_from_server(key ACE_ENV_ARG_PARAMETER))); -} - -void -interop_WChar_Passer_i::shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )) -{ - this->orb_->shutdown(0 ACE_ENV_ARG_PARAMETER); -} diff --git a/TAO/interop-tests/wchar/interop_wchar_i.h b/TAO/interop-tests/wchar/interop_wchar_i.h deleted file mode 100644 index 395d1a89607..00000000000 --- a/TAO/interop-tests/wchar/interop_wchar_i.h +++ /dev/null @@ -1,132 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be/be_codegen.cpp:923 - -#ifndef INTEROP_WCHAR_I_H_ -#define INTEROP_WCHAR_I_H_ - -#include "interop_wcharS.h" -#include "wchar_reference.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -//Class interop_WChar_Passer_i -class interop_WChar_Passer_i : public virtual POA_interop::WChar_Passer -{ -public: - //Constructor - interop_WChar_Passer_i (CORBA::ORB_ptr o, int verbose); - - //Destructor - virtual ~interop_WChar_Passer_i (void); - - virtual char * orb_name (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean wchar_to_server (CORBA::WChar test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::WChar wchar_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean wstring_to_server (const CORBA::WChar * test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::WChar * wstring_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean warray_to_server (const interop::warray test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual interop::warray_slice * warray_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean wstruct_to_server (const interop::wstruct & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual interop::wstruct * wstruct_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean wstructseq_to_server (const interop::wstructseq & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual interop::wstructseq * wstructseq_from_server (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean wunion_to_server (const interop::wunion & test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual interop::wunion * wunion_from_server (CORBA::Short key, - interop::wchar_types type - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Boolean any_to_server (const CORBA::Any &test, - CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Any* any_from_server (CORBA::Short key, - interop::wchar_types type - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual CORBA::Any* any_echo (const CORBA::Any &test - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - -virtual void exception_test (CORBA::Short key - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException, - interop::WChar_Passer::WStringException )); - -virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC (( CORBA::SystemException )); - -private: - CORBA::ORB_var orb_; - wchar_reference ref_; - -}; - - -#endif /* INTEROP_WCHAR_I_H_ */ diff --git a/TAO/interop-tests/wchar/run_test.pl b/TAO/interop-tests/wchar/run_test.pl deleted file mode 100755 index 337821792e8..00000000000 --- a/TAO/interop-tests/wchar/run_test.pl +++ /dev/null @@ -1,42 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../bin'; -use PerlACE::Run_Test; - -$iorfile = PerlACE::LocalFile ("server.ior"); -unlink $iorfile; -$status = 0; - -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-k file://$iorfile -x"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$client = $CL->SpawnWaitKill (300); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (10); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/interop-tests/wchar/server.cpp b/TAO/interop-tests/wchar/server.cpp deleted file mode 100644 index 8b464c4cbd5..00000000000 --- a/TAO/interop-tests/wchar/server.cpp +++ /dev/null @@ -1,147 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// interop_test/wchar -// -// = FILENAME -// server.cpp -// -// = DESCRIPTION -// C++ server side for testing interoperability with wchar data. -// -// = AUTHOR -// Phil Mesnier <mesnier_p@ociweb.com> -// -// ============================================================================ -#include "interop_wchar_i.h" -#include "ace/Get_Opt.h" -#include "ace/Argv_Type_Converter.h" - -const ACE_TCHAR *ior_output_file = ACE_TEXT("IOR"); -int verbose = 0; - -int -parse_args (int argc, ACE_TCHAR* argv[]) -{ - - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("o:v")); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': - ior_output_file = get_opts.opt_arg (); - break; - case 'v': - verbose = 1; - break; - case '?': - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s " - "-o <iorfile> " - "-v " - "\n", - argv [0]), - -1); - } - // Indicates sucessful parsing of the command line - return 0; -} - -int -ACE_TMAIN( int argc, ACE_TCHAR *argv[] ) -{ - ACE_Argv_Type_Converter command_line(argc, argv); - - if (parse_args(command_line.get_argc(), command_line.get_TCHAR_argv())) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("failed to parse args")), - 1); - } - -#if (!defined ACE_HAS_WCHAR) && (!defined ACE_HAS_XPG4_MULTIBYTE_CHAR) - // the run_test script looks for the ior file. By touching it here, the - // script can run at full speed, rather than timing out waiting for a - // file that will never come. - FILE *output_file = ACE_OS::fopen (ior_output_file, ACE_TEXT("w")); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT("Cannot open output file ") - ACE_TEXT("for writing IOR: %s"), - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "no ior\n"); - ACE_OS::fclose (output_file); - ACE_ERROR_RETURN ((LM_ERROR,"This test requires wchar support\n"),0); -#else - ACE_DECLARE_NEW_ENV; - ACE_TRY - { - // Initialize orb - CORBA::ORB_var orb = CORBA::ORB_init( command_line.get_argc(), command_line.get_ASCII_argv() ); - - //Get reference to Root POA - CORBA::Object_var obj = - orb->resolve_initial_references( "RootPOA" - ACE_ENV_ARG_PARAMETER ); - ACE_TRY_CHECK; - - PortableServer::POA_var poa = - PortableServer::POA::_narrow( obj.in() - ACE_ENV_ARG_PARAMETER ); - ACE_TRY_CHECK; - - PortableServer::POAManager_var mgr = - poa->the_POAManager( ACE_ENV_SINGLE_ARG_PARAMETER ); - ACE_TRY_CHECK; - - // Activate POA Manager - mgr->activate( ACE_ENV_SINGLE_ARG_PARAMETER ); - ACE_TRY_CHECK; - - // Create an object - interop_WChar_Passer_i servant(orb.in(), verbose); - - // Register the servant with the RootPOA, obtain its object - // reference, stringify it, and write it to a file. - obj = poa->servant_to_reference( &servant - ACE_ENV_ARG_PARAMETER ); - ACE_TRY_CHECK; - - CORBA::String_var str = - orb->object_to_string( obj.in() - ACE_ENV_ARG_PARAMETER ); - ACE_TRY_CHECK; - - FILE *output_file = ACE_OS::fopen (ior_output_file, ACE_TEXT("w")); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT("Cannot open output file ") - ACE_TEXT("for writing IOR: %s"), - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", str.in ()); - ACE_OS::fclose (output_file); - - // Accept requests - orb->run( ACE_ENV_SINGLE_ARG_PARAMETER ); - ACE_TRY_CHECK; - orb->destroy( ACE_ENV_SINGLE_ARG_PARAMETER ); - ACE_TRY_CHECK; - } - ACE_CATCH(CORBA::Exception, ex) - { - ACE_PRINT_EXCEPTION(ex, "uncaught exception"); - return 1; - } - ACE_ENDTRY; - - return 0; -#endif /* ACE_HAS_WCHAR */ -} diff --git a/TAO/interop-tests/wchar/wchar_reference.cpp b/TAO/interop-tests/wchar/wchar_reference.cpp deleted file mode 100644 index 0ca0384c81b..00000000000 --- a/TAO/interop-tests/wchar/wchar_reference.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// interop_test/wchar -// -// = FILENAME -// wchar_reference.cpp -// -// = DESCRIPTION -// C++ reference data for testing interoperability with wchars. This is -// linked into both clients and servers so that both sides have common -// values for testing what is received or sent. -// -// = AUTHOR -// Phil Mesnier <mesnier_p@ociweb.com> -// -// ============================================================================ -#include "wchar_reference.h" -#include "ace/Log_Msg.h" - -#if defined (ACE_HAS_WCHAR) || defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) - -ACE_OS::WChar -wchar_reference::ref_wchar[NUM_KEYS] = - {1234}; - -const ACE_OS::WChar * -wchar_reference::ref_wstring[NUM_KEYS] = - {L"have a nice day"}; - -ACE_OS::WChar -wchar_reference::ref_warray[NUM_KEYS][10] = - { {L'a',L'A',L'!',L'1',L'4',L'[',L'?',L'%',L'X',L'E'} }; - -const ACE_OS::WChar * -wchar_reference::ref_except[NUM_KEYS] = - {L"TEST EXCEPTION"}; - -wchar_reference::wchar_reference(int v) - : verbose_ (v) -{ -} - -void -wchar_reference::set_verbose(int v) -{ - this->verbose_ = v; -} - -ACE_OS::WChar -wchar_reference::get_wchar (short key) -{ - return wchar_reference::ref_wchar[key]; -} - -const ACE_OS::WChar * -wchar_reference::get_wstring (short key) -{ - return wchar_reference::ref_wstring[key]; -} - -ACE_OS::WChar * -wchar_reference::get_warray (short key) -{ - return wchar_reference::ref_warray[key]; -} - -void -wchar_reference::assign_warray (short key, - ACE_OS::WChar *warray) -{ - ACE_OS::memcpy(warray, - wchar_reference::ref_warray[key], - 10*(sizeof(ACE_OS::WChar)) - ); -} - -const ACE_OS::WChar * -wchar_reference::get_except (short key) -{ - return wchar_reference::ref_except[key]; -} - -int -wchar_reference::match_wchar (short key, ACE_OS::WChar test) -{ - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("match_wchar, expecting %x, got %x for key %d\n"), - wchar_reference::ref_wchar[key],test,key)); - return wchar_reference::ref_wchar[key] == test; -} - -int -wchar_reference::match_wstring (short key, const ACE_OS::WChar *test) -{ - if (key == -1) - { - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("match_wstring: expecting nul string, ") - ACE_TEXT("got string length %d\n"), - ACE_OS::strlen (test))); - return (ACE_OS::strlen (test) == 0); - } - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("match_wstring: expecting %W, got %W for key %d\n"), - wchar_reference::ref_wstring[key],test,key)); - return ACE_OS::strcmp(wchar_reference::ref_wstring[key],test) == 0; -} - -int -wchar_reference::match_warray (short key, const ACE_OS::WChar *test) -{ - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("match_warray: key %d\n"),key)); - for (int i = 0; i < 10; i++) - { - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT(" expecting[%d] %x, got %x\n"), - i, wchar_reference::ref_warray[key][i], - test[i])); - if (wchar_reference::ref_warray[key][i] != test[i]) - return 0; - } - return 1; -} - -int -wchar_reference::match_except(short key, const ACE_OS::WChar *test) -{ - if (verbose_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("match_except: expecting %W, got %W for key %d\n"), - wchar_reference::ref_except[key],test,key)); - return ACE_OS::strcmp(wchar_reference::ref_except[key],test) == 0; -} -#else // ACE_HAS_WCHAR -wchar_reference::wchar_reference(int v) - : verbose_ (v) -{ -} - -void -wchar_reference::set_verbose(int v) -{ - this->verbose_ = v; -} - -ACE_OS::WChar -wchar_reference::get_wchar (short ) -{ - return 0; -} - -const ACE_OS::WChar * -wchar_reference::get_wstring (short ) -{ - return 0; -} - -ACE_OS::WChar * -wchar_reference::get_warray (short ) -{ - return 0; -} - -void -wchar_reference::assign_warray (short , - ACE_OS::WChar *) -{ -} - -const ACE_OS::WChar * -wchar_reference::get_except (short ) -{ - return 0; -} - -int -wchar_reference::match_wchar (short , ACE_OS::WChar ) -{ - return 0; -} - -int -wchar_reference::match_wstring (short , const ACE_OS::WChar *) -{ - return 0; -} - -int -wchar_reference::match_warray (short , const ACE_OS::WChar *) -{ - return 0; -} - -#endif // ACE_HAS_WCHAR diff --git a/TAO/interop-tests/wchar/wchar_reference.h b/TAO/interop-tests/wchar/wchar_reference.h deleted file mode 100644 index 735eb81563f..00000000000 --- a/TAO/interop-tests/wchar/wchar_reference.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// interop_test/wchar -// -// = FILENAME -// wchar_reference.cpp -// -// = DESCRIPTION -// C++ reference data for testing interoperability with wchars. This is -// linked into both clients and servers so that both sides have common -// values for testing what is received or sent. -// -// = AUTHOR -// Phil Mesnier <mesnier_p@ociweb.com> -// -// ============================================================================ -#ifndef WCHAR_REFERENCE_H -#define WCHAR_REFERENCE_H - -#include "ace/OS.h" - -#define NUM_KEYS 1 - -class wchar_reference -{ - public: - wchar_reference (int v = 0); - void set_verbose (int v); - ACE_OS::WChar get_wchar (short key); - const ACE_OS::WChar *get_wstring (short key); - ACE_OS::WChar *get_warray (short key); - void assign_warray (short key, ACE_OS::WChar *warray); - - const ACE_OS::WChar *get_except (short key); - - int match_wchar (short key, ACE_OS::WChar test); - int match_wstring (short key, const ACE_OS::WChar* test); - int match_warray (short key, const ACE_OS::WChar *test); - int match_except (short key, const ACE_OS::WChar *test); - - private: -#if defined (ACE_HAS_WCHAR) || defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) - static ACE_OS::WChar ref_wchar[NUM_KEYS]; - static const ACE_OS::WChar *ref_wstring[NUM_KEYS]; - static ACE_OS::WChar ref_warray[NUM_KEYS][10]; - static const ACE_OS::WChar *ref_except[NUM_KEYS]; -#endif // ACE_HAS_WCHAR - int verbose_; -}; - -#endif // WCHAR_REFERENCE_H |