diff options
Diffstat (limited to 'TAO/performance-tests/Latency/java_client.java')
-rw-r--r-- | TAO/performance-tests/Latency/java_client.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/TAO/performance-tests/Latency/java_client.java b/TAO/performance-tests/Latency/java_client.java new file mode 100644 index 00000000000..09c55654d9d --- /dev/null +++ b/TAO/performance-tests/Latency/java_client.java @@ -0,0 +1,38 @@ +// +// $Id$ +// + +import java.io.*; + +public class java_client { + + public static void main(String[] args) { + // Initialize the ORB. + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null); + + // Read the AccountManager's IOR from a file + Test test = null; + try { + LineNumberReader input = + new LineNumberReader(new FileReader("test.ior")); + org.omg.CORBA.Object object = orb.string_to_object(input.readLine()); + test = TestHelper.narrow(object); + } + catch(java.io.IOException e) { + System.out.println("Exception: " + e); + System.exit(1); + } + + // use args[0] as the number of iterations. + Long value = new Long (args.length > 0 ? args[0] : "10000"); + + long iterations = value.longValue (); + + // Request the account manager to open a named account. + for (int i = 0; i != iterations; ++i) { + test.test_method (0); + } + test.shutdown (); + } + +} |