diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
commit | 943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch) | |
tree | 421cfedbc60603d02e0b314d9204e9f85dd781c5 /java | |
parent | minor fix to IcePHP getLogger (diff) | |
download | ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2 ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip |
python 3 support
Diffstat (limited to 'java')
79 files changed, 349 insertions, 367 deletions
diff --git a/java/allDemos.py b/java/allDemos.py index 2bde22c1d2a..c932bd4da5f 100755 --- a/java/allDemos.py +++ b/java/allDemos.py @@ -15,7 +15,7 @@ for toplevel in [".", "..", "../..", "../../..", "../../../.."]: if os.path.exists(os.path.join(toplevel, "demoscript")): break else: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(os.path.join(toplevel)) from demoscript import Util diff --git a/java/allTests.py b/java/allTests.py index bbc75544a32..4fcfb00b868 100755 --- a/java/allTests.py +++ b/java/allTests.py @@ -10,15 +10,16 @@ import os, sys, re, getopt -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.abspath(toplevel) - if os.path.exists(os.path.join(toplevel, "scripts", "TestUtil.py")): - break -else: - raise "can't find toplevel directory!" +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: + raise RuntimeError("can't find toplevel directory!") -sys.path.append(os.path.join(toplevel)) -from scripts import * +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil # # List of all basic tests. diff --git a/java/demo/Freeze/bench/expect.py b/java/demo/Freeze/bench/expect.py index af460028ecd..a1ab4eddd16 100755 --- a/java/demo/Freeze/bench/expect.py +++ b/java/demo/Freeze/bench/expect.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Freeze import bench -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") client = Util.spawn('java Client') bench.run(client, True) diff --git a/java/demo/Freeze/casino/expect.py b/java/demo/Freeze/casino/expect.py index 5d8c0264931..ad65259c972 100755 --- a/java/demo/Freeze/casino/expect.py +++ b/java/demo/Freeze/casino/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Freeze import casino casino.run('java Client', 'java Server') diff --git a/java/demo/Freeze/library/expect.py b/java/demo/Freeze/library/expect.py index 57d07e821b0..fe616da7bcd 100755 --- a/java/demo/Freeze/library/expect.py +++ b/java/demo/Freeze/library/expect.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Freeze import library -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Server --Ice.PrintAdapterReady --Freeze.Trace.Evictor=0 --Freeze.Trace.DbEnv=0') server.expect('.* ready') @@ -34,12 +34,12 @@ client.expect('>>> ') library.run(client, server) -print "running with collocated server" +print("running with collocated server") -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Collocated --Freeze.Trace.Evictor=0 --Freeze.Trace.DbEnv=0') server.expect('>>> ') diff --git a/java/demo/Freeze/phonebook/expect.py b/java/demo/Freeze/phonebook/expect.py index c46b4cbc722..59bf8a58404 100755 --- a/java/demo/Freeze/phonebook/expect.py +++ b/java/demo/Freeze/phonebook/expect.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Freeze import phonebook -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Server --Ice.PrintAdapterReady --Freeze.Trace.Evictor=0 --Freeze.Trace.DbEnv=0') server.expect('.* ready') @@ -34,12 +34,12 @@ client.expect('>>> ') phonebook.run(client, server) -print "running with collocated server" +print("running with collocated server") -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Collocated --Freeze.Trace.Evictor=0 --Freeze.Trace.DbEnv=0') server.expect('>>> ') diff --git a/java/demo/Freeze/transform/expect.py b/java/demo/Freeze/transform/expect.py index 14d725b68a1..939c7746303 100755 --- a/java/demo/Freeze/transform/expect.py +++ b/java/demo/Freeze/transform/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Freeze import transform transform.run('java Create', 'java Recreate', 'java Read', 'java ReadNew') diff --git a/java/demo/Glacier2/callback/expect.py b/java/demo/Glacier2/callback/expect.py index 382fc8ec31f..2d68bec8e59 100755 --- a/java/demo/Glacier2/callback/expect.py +++ b/java/demo/Glacier2/callback/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Glacier2 import callback server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/async/expect.py b/java/demo/Ice/async/expect.py index baa0ae25a0c..c5e4cf3357f 100755 --- a/java/demo/Ice/async/expect.py +++ b/java/demo/Ice/async/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import async server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/bidir/expect.py b/java/demo/Ice/bidir/expect.py index 16d8b8e9590..f5731570c69 100755 --- a/java/demo/Ice/bidir/expect.py +++ b/java/demo/Ice/bidir/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import bidir server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/callback/expect.py b/java/demo/Ice/callback/expect.py index 9ec3eb9aadf..a6d649e99b2 100755 --- a/java/demo/Ice/callback/expect.py +++ b/java/demo/Ice/callback/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import callback server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/hello/expect.py b/java/demo/Ice/hello/expect.py index 9530e557b43..739538c7aeb 100755 --- a/java/demo/Ice/hello/expect.py +++ b/java/demo/Ice/hello/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import hello server = Util.spawn('java Server --Ice.PrintAdapterReady --Ice.Warn.Connections=0') diff --git a/java/demo/Ice/invoke/expect.py b/java/demo/Ice/invoke/expect.py index e589427f420..18b75b32a0f 100755 --- a/java/demo/Ice/invoke/expect.py +++ b/java/demo/Ice/invoke/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import invoke server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/latency/expect.py b/java/demo/Ice/latency/expect.py index 95d316a5028..27e6a47e11d 100755 --- a/java/demo/Ice/latency/expect.py +++ b/java/demo/Ice/latency/expect.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import sys, os +import sys, os, signal path = [ ".", "..", "../..", "../../..", "../../../.." ] head = os.path.dirname(sys.argv[0]) @@ -16,22 +16,21 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') -print "testing ping... ", +sys.stdout.write("testing ping... ") sys.stdout.flush() client = Util.spawn('java Client') client.waitTestSuccess(timeout=100) -print "ok" +print("ok") -import signal server.kill(signal.SIGINT) server.waitTestSuccess() -print client.before +print(client.before) diff --git a/java/demo/Ice/minimal/expect.py b/java/demo/Ice/minimal/expect.py index 2b4ed140c3f..87516d98575 100755 --- a/java/demo/Ice/minimal/expect.py +++ b/java/demo/Ice/minimal/expect.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import sys, os +import sys, os, signal path = [ ".", "..", "../..", "../../..", "../../../.." ] head = os.path.dirname(sys.argv[0]) @@ -16,21 +16,20 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') -print "testing...", +sys.stdout.write("testing... ") sys.stdout.flush() client = Util.spawn('java Client') client.waitTestSuccess() server.expect('Hello World!') -print "ok" +print("ok") -import signal server.kill(signal.SIGINT) server.waitTestSuccess(-signal.SIGINT) diff --git a/java/demo/Ice/multicast/expect.py b/java/demo/Ice/multicast/expect.py index 8ea5eeefc5c..9d110c5bbee 100755 --- a/java/demo/Ice/multicast/expect.py +++ b/java/demo/Ice/multicast/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import multicast multicast.run('java Client', 'java Server') diff --git a/java/demo/Ice/nested/expect.py b/java/demo/Ice/nested/expect.py index db61db0dc5f..aa794c47bfa 100755 --- a/java/demo/Ice/nested/expect.py +++ b/java/demo/Ice/nested/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import nested server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/plugin/expect.py b/java/demo/Ice/plugin/expect.py index 13bc3e25fd0..c3aec76b956 100755 --- a/java/demo/Ice/plugin/expect.py +++ b/java/demo/Ice/plugin/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import plugin server = Util.spawn('java Server --Ice.PrintAdapterReady --Ice.Warn.Connections=0') diff --git a/java/demo/Ice/serialize/expect.py b/java/demo/Ice/serialize/expect.py index 78c9d42e285..76f88ed2885 100755 --- a/java/demo/Ice/serialize/expect.py +++ b/java/demo/Ice/serialize/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import serialize server = Util.spawn('java Server --Ice.PrintAdapterReady --Ice.Warn.Connections=0') diff --git a/java/demo/Ice/session/expect.py b/java/demo/Ice/session/expect.py index 778788f74c9..f1a6d02f024 100755 --- a/java/demo/Ice/session/expect.py +++ b/java/demo/Ice/session/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import session server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/throughput/expect.py b/java/demo/Ice/throughput/expect.py index 067af651d57..6bc12313685 100755 --- a/java/demo/Ice/throughput/expect.py +++ b/java/demo/Ice/throughput/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import throughput server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/Ice/value/expect.py b/java/demo/Ice/value/expect.py index 964dbb0f66e..2c7292af39d 100755 --- a/java/demo/Ice/value/expect.py +++ b/java/demo/Ice/value/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.Ice import value server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/IceBox/hello/expect.py b/java/demo/IceBox/hello/expect.py index cb6a4638b24..318c713b864 100755 --- a/java/demo/IceBox/hello/expect.py +++ b/java/demo/IceBox/hello/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.IceBox import hello # Override the service load line. diff --git a/java/demo/IceGrid/icebox/expect.py b/java/demo/IceGrid/icebox/expect.py index c08b13a77bc..19a74ca2f47 100755 --- a/java/demo/IceGrid/icebox/expect.py +++ b/java/demo/IceGrid/icebox/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.IceGrid import icebox icebox.run('java Client') diff --git a/java/demo/IceGrid/simple/expect.py b/java/demo/IceGrid/simple/expect.py index 2b990944d05..4390cf4a0e0 100755 --- a/java/demo/IceGrid/simple/expect.py +++ b/java/demo/IceGrid/simple/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.IceGrid import simple simple.run('java Client') diff --git a/java/demo/IceStorm/clock/expect.py b/java/demo/IceStorm/clock/expect.py index 98cfc0f978c..8fd1422d20a 100755 --- a/java/demo/IceStorm/clock/expect.py +++ b/java/demo/IceStorm/clock/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.IceStorm import clock clock.run('java Subscriber', 'java Publisher') diff --git a/java/demo/book/evictor_filesystem/expect.py b/java/demo/book/evictor_filesystem/expect.py index 5915b407b27..4a6dcd0af06 100755 --- a/java/demo/book/evictor_filesystem/expect.py +++ b/java/demo/book/evictor_filesystem/expect.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.book import evictor_filesystem -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') diff --git a/java/demo/book/lifecycle/expect.py b/java/demo/book/lifecycle/expect.py index 832dadac6ee..9bd197db805 100755 --- a/java/demo/book/lifecycle/expect.py +++ b/java/demo/book/lifecycle/expect.py @@ -16,10 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.book import lifecycle server = Util.spawn('java Server --Ice.PrintAdapterReady') diff --git a/java/demo/book/map_filesystem/expect.py b/java/demo/book/map_filesystem/expect.py index c78a186d65c..ed3e13a0a65 100755 --- a/java/demo/book/map_filesystem/expect.py +++ b/java/demo/book/map_filesystem/expect.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * +from demoscript import Util from demoscript.book import map_filesystem -print "cleaning databases...", +sys.stdout.write("cleaning databases... ") sys.stdout.flush() Util.cleanDbDir("db") -print "ok" +print("ok") server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') diff --git a/java/demo/book/printer/expect.py b/java/demo/book/printer/expect.py index d08e5413ca5..987016ddc2f 100755 --- a/java/demo/book/printer/expect.py +++ b/java/demo/book/printer/expect.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import sys, os +import sys, os, signal path = [ ".", "..", "../..", "../../..", "../../../.." ] head = os.path.dirname(sys.argv[0]) @@ -16,20 +16,19 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * -import signal +from demoscript import Util server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') -print "testing...", +sys.stdout.write("testing... ") sys.stdout.flush() client = Util.spawn('java Client') client.waitTestSuccess() server.expect('Hello World!') server.kill(signal.SIGINT) server.waitTestSuccess() -print "ok" +print("ok") diff --git a/java/demo/book/simple_filesystem/expect.py b/java/demo/book/simple_filesystem/expect.py index 0465e2a8d9e..21e631c420a 100755 --- a/java/demo/book/simple_filesystem/expect.py +++ b/java/demo/book/simple_filesystem/expect.py @@ -8,7 +8,7 @@ # # ********************************************************************** -import sys, os +import sys, os, signal path = [ ".", "..", "../..", "../../..", "../../../.." ] head = os.path.dirname(sys.argv[0]) @@ -16,20 +16,19 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "demoscript")) ] if len(path) == 0: - raise "can't find toplevel directory!" + raise RuntimeError("can't find toplevel directory!") sys.path.append(path[0]) -from demoscript import * -import signal +from demoscript import Util server = Util.spawn('java Server --Ice.PrintAdapterReady') server.expect('.* ready') -print "testing...", +sys.stdout.write("testing... ") sys.stdout.flush() client = Util.spawn('java Client') client.expect('Contents of root directory:\n.*Down to a sunless sea.') client.waitTestSuccess() server.kill(signal.SIGINT) server.waitTestSuccess() -print "ok" +print("ok") diff --git a/java/test/Freeze/complex/run.py b/java/test/Freeze/complex/run.py index 672da20e992..d06d6dbc98b 100755 --- a/java/test/Freeze/complex/run.py +++ b/java/test/Freeze/complex/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil # # Clean the contents of the database directory. @@ -26,17 +26,19 @@ from scripts import * dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -print "starting populate...", +sys.stdout.write("starting populate... ") +sys.stdout.flush() populateProc = TestUtil.startClient("test.Freeze.complex.Client", ' --dbdir "%s" populate' % os.getcwd(), startReader=False) -print "ok" +print("ok") populateProc.startReader() populateProc.waitTestSuccess() -print "starting verification client...", +sys.stdout.write("starting verification client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Freeze.complex.Client", ' --dbdir "%s" validate' % os.getcwd(), startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() diff --git a/java/test/Freeze/dbmap/run.py b/java/test/Freeze/dbmap/run.py index 8e5806fef86..57180532419 100755 --- a/java/test/Freeze/dbmap/run.py +++ b/java/test/Freeze/dbmap/run.py @@ -16,16 +16,16 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Freeze.dbmap.Client", '"' + os.getcwd() + '"', startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Freeze/evictor/run.py b/java/test/Freeze/evictor/run.py index 4813d2a4c49..0cb0f32d190 100755 --- a/java/test/Freeze/evictor/run.py +++ b/java/test/Freeze/evictor/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) @@ -26,4 +26,3 @@ TestUtil.cleanDbDir(dbdir) testOptions = ' --Freeze.Warn.Deadlocks=0 --Freeze.DbEnv.db.DbHome="%s/db" --Ice.Config="%s/config" ' % (os.getcwd(), os.getcwd()) TestUtil.clientServerTest(testOptions, testOptions) - diff --git a/java/test/Freeze/fileLock/run.py b/java/test/Freeze/fileLock/run.py index 8448cc3c6d0..0121ec0c704 100755 --- a/java/test/Freeze/fileLock/run.py +++ b/java/test/Freeze/fileLock/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -print "testing Freeze file lock...", +sys.stdout.write("testing Freeze file lock... ") sys.stdout.flush() client = os.path.join("test.Freeze.fileLock.Client") @@ -47,4 +47,4 @@ clientExe.expect('File lock acquired.\.*') clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.wait() -print "ok" +print("ok") diff --git a/java/test/Glacier2/router/run.py b/java/test/Glacier2/router/run.py index df341eb8ffd..ce9a539e07d 100755 --- a/java/test/Glacier2/router/run.py +++ b/java/test/Glacier2/router/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") @@ -33,15 +33,15 @@ args = ' --Ice.Warn.Dispatch=0' + \ ' --Ice.Admin.InstanceName=Glacier2' + \ ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() routerConfig = TestUtil.DriverConfig("server") routerConfig.lang = "cpp" starterProc = TestUtil.startServer(router, args, count=2, config=routerConfig) -print "ok" +print("ok") TestUtil.clientServerTest() TestUtil.clientServerTest(additionalClientOptions=" --shutdown") starterProc.waitTestSuccess() - diff --git a/java/test/Glacier2/sessionHelper/run.py b/java/test/Glacier2/sessionHelper/run.py index 14f5444fa0a..2c78cc668c4 100755 --- a/java/test/Glacier2/sessionHelper/run.py +++ b/java/test/Glacier2/sessionHelper/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") @@ -31,15 +31,13 @@ args = ' --Ice.Warn.Dispatch=0' + \ ' --Ice.Admin.InstanceName=Glacier2' + \ ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() routerConfig = TestUtil.DriverConfig("server") routerConfig.lang = "cpp" starterProc = TestUtil.startServer(router, args, count=2, config=routerConfig) -print "ok" - - +print("ok") TestUtil.clientServerTest(additionalClientOptions=" --shutdown") starterProc.waitTestSuccess() - diff --git a/java/test/Ice/adapterDeactivation/run.py b/java/test/Ice/adapterDeactivation/run.py index 099ce110107..db68ff30b9a 100755 --- a/java/test/Ice/adapterDeactivation/run.py +++ b/java/test/Ice/adapterDeactivation/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/java/test/Ice/ami/run.py b/java/test/Ice/ami/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/ami/run.py +++ b/java/test/Ice/ami/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/background/run.py b/java/test/Ice/background/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/background/run.py +++ b/java/test/Ice/background/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/binding/run.py b/java/test/Ice/binding/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/binding/run.py +++ b/java/test/Ice/binding/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/checksum/run.py b/java/test/Ice/checksum/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/checksum/run.py +++ b/java/test/Ice/checksum/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/classLoader/run.py b/java/test/Ice/classLoader/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/classLoader/run.py +++ b/java/test/Ice/classLoader/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/custom/run.py b/java/test/Ice/custom/run.py index 099ce110107..db68ff30b9a 100755 --- a/java/test/Ice/custom/run.py +++ b/java/test/Ice/custom/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/java/test/Ice/defaultServant/run.py b/java/test/Ice/defaultServant/run.py index 78c568f8ddd..72d65e04f4a 100755 --- a/java/test/Ice/defaultServant/run.py +++ b/java/test/Ice/defaultServant/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.defaultServant.Client", "--Ice.Warn.Dispatch=0",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Ice/defaultValue/run.py b/java/test/Ice/defaultValue/run.py index 71cec9ec06a..c073e0a10f0 100755 --- a/java/test/Ice/defaultValue/run.py +++ b/java/test/Ice/defaultValue/run.py @@ -16,13 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.defaultValue.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Ice/dispatcher/run.py b/java/test/Ice/dispatcher/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/dispatcher/run.py +++ b/java/test/Ice/dispatcher/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/exceptions/run.py b/java/test/Ice/exceptions/run.py index 0aa6485e573..080cf30b986 100755 --- a/java/test/Ice/exceptions/run.py +++ b/java/test/Ice/exceptions/run.py @@ -16,16 +16,15 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.exceptions.AMDServer") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/java/test/Ice/facets/run.py b/java/test/Ice/facets/run.py index 099ce110107..db68ff30b9a 100755 --- a/java/test/Ice/facets/run.py +++ b/java/test/Ice/facets/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/java/test/Ice/faultTolerance/run.py b/java/test/Ice/faultTolerance/run.py index 06457bf6fe0..a81a2c3e939 100755 --- a/java/test/Ice/faultTolerance/run.py +++ b/java/test/Ice/faultTolerance/run.py @@ -16,28 +16,29 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil num = 12 base = 12340 serverProc = [] for i in range(0, num): - print "starting server #%d..." % (i + 1), + sys.stdout.write("starting server #%d... " % (i + 1)) + sys.stdout.flush() serverProc.append(TestUtil.startServer("test.Ice.faultTolerance.Server", " %d" % (base + i))) - print "ok" + print("ok") ports = "" for i in range(0, num): ports = "%s %d" % (ports, base + i) -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.faultTolerance.Client", ports, startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() for p in serverProc: p.waitTestSuccess() - diff --git a/java/test/Ice/hold/run.py b/java/test/Ice/hold/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/hold/run.py +++ b/java/test/Ice/hold/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/info/run.py b/java/test/Ice/info/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/info/run.py +++ b/java/test/Ice/info/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/inheritance/run.py b/java/test/Ice/inheritance/run.py index 099ce110107..db68ff30b9a 100755 --- a/java/test/Ice/inheritance/run.py +++ b/java/test/Ice/inheritance/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/java/test/Ice/interceptor/run.py b/java/test/Ice/interceptor/run.py index cf3f6470343..4b5670757ee 100755 --- a/java/test/Ice/interceptor/run.py +++ b/java/test/Ice/interceptor/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.interceptor.Client", "--Ice.Warn.Dispatch=0",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Ice/invoke/run.py b/java/test/Ice/invoke/run.py index bcb78f3c4f3..caf7ed893df 100755 --- a/java/test/Ice/invoke/run.py +++ b/java/test/Ice/invoke/run.py @@ -16,13 +16,12 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with Blobject server." +print("tests with Blobject server.") TestUtil.clientServerTest() -print "tests with BlobjectAsync server." +print("tests with BlobjectAsync server.") TestUtil.clientServerTest(additionalServerOptions = "--async") - diff --git a/java/test/Ice/location/run.py b/java/test/Ice/location/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/location/run.py +++ b/java/test/Ice/location/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/objects/run.py b/java/test/Ice/objects/run.py index 099ce110107..db68ff30b9a 100755 --- a/java/test/Ice/objects/run.py +++ b/java/test/Ice/objects/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/java/test/Ice/operations/run.py b/java/test/Ice/operations/run.py index 10c33f9c66b..3f51c03c0de 100755 --- a/java/test/Ice/operations/run.py +++ b/java/test/Ice/operations/run.py @@ -16,22 +16,21 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0") -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0", server="test.Ice.operations.AMDServer") -print "tests with TIE server." +print("tests with TIE server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0", server="test.Ice.operations.TieServer") -print "tests with AMD TIE server." +print("tests with AMD TIE server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0", server="test.Ice.operations.AMDTieServer") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/java/test/Ice/packagemd/run.py b/java/test/Ice/packagemd/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/packagemd/run.py +++ b/java/test/Ice/packagemd/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/properties/run.py b/java/test/Ice/properties/run.py index 22f2a9903a9..92ff1bec700 100755 --- a/java/test/Ice/properties/run.py +++ b/java/test/Ice/properties/run.py @@ -17,25 +17,35 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil # # Write config # -configPath = u"./config/中国_client.config" +if sys.version_info[0] == 2: + configPath = "./config/\xe4\xb8\xad\xe5\x9b\xbd_client.config".decode("utf-8") + TestUtil.createConfig(configPath, + ["# Automatically generated by Ice test driver.", + "Ice.Trace.Protocol=1", + "Ice.Trace.Network=1", + "Ice.ProgramName=PropertiesClient", + "Config.Path=./config/中国_client.config"]) +else: + configPath = "./config/\u4e2d\u56fd_client.config" + TestUtil.createConfig(configPath, + ["# Automatically generated by Ice test driver.", + "Ice.Trace.Protocol=1", + "Ice.Trace.Network=1", + "Ice.ProgramName=PropertiesClient", + "Config.Path=" + configPath], + "utf-8") -TestUtil.createConfig(configPath, - ["# Automatically generated by Ice test driver.", - "Ice.Trace.Protocol=1", - "Ice.Trace.Network=1", - "Ice.ProgramName=PropertiesClient", - "Config.Path=./config/中国_client.config"]) - -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.properties.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() diff --git a/java/test/Ice/proxy/run.py b/java/test/Ice/proxy/run.py index 742a256e68c..a4da3548a63 100755 --- a/java/test/Ice/proxy/run.py +++ b/java/test/Ice/proxy/run.py @@ -16,16 +16,15 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.proxy.AMDServer") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/java/test/Ice/retry/run.py b/java/test/Ice/retry/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/retry/run.py +++ b/java/test/Ice/retry/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/seqMapping/run.py b/java/test/Ice/seqMapping/run.py index a9017505f52..9d2dbfdf699 100755 --- a/java/test/Ice/seqMapping/run.py +++ b/java/test/Ice/seqMapping/run.py @@ -16,16 +16,15 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.seqMapping.AMDServer") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/java/test/Ice/serialize/run.py b/java/test/Ice/serialize/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/serialize/run.py +++ b/java/test/Ice/serialize/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/servantLocator/run.py b/java/test/Ice/servantLocator/run.py index 9bf24af74b3..aa2889a3e6b 100755 --- a/java/test/Ice/servantLocator/run.py +++ b/java/test/Ice/servantLocator/run.py @@ -16,16 +16,15 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.servantLocator.AMDServer") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/java/test/Ice/slicing/exceptions/run.py b/java/test/Ice/slicing/exceptions/run.py index 0409073e4fb..3d91ae5b336 100755 --- a/java/test/Ice/slicing/exceptions/run.py +++ b/java/test/Ice/slicing/exceptions/run.py @@ -16,13 +16,12 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.slicing.exceptions.AMDServer") - diff --git a/java/test/Ice/slicing/objects/run.py b/java/test/Ice/slicing/objects/run.py index 85faac8212b..dd4af53b34f 100755 --- a/java/test/Ice/slicing/objects/run.py +++ b/java/test/Ice/slicing/objects/run.py @@ -16,13 +16,12 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server="test.Ice.slicing.objects.AMDServer") - diff --git a/java/test/Ice/stream/run.py b/java/test/Ice/stream/run.py index 46f0307572a..e8d941801d9 100755 --- a/java/test/Ice/stream/run.py +++ b/java/test/Ice/stream/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting test...", +sys.stdout.write("starting test... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.stream.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Ice/threadPoolPriority/run.py b/java/test/Ice/threadPoolPriority/run.py index 17cfc7c7b27..0c8b131318e 100755 --- a/java/test/Ice/threadPoolPriority/run.py +++ b/java/test/Ice/threadPoolPriority/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() - diff --git a/java/test/Ice/timeout/run.py b/java/test/Ice/timeout/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/java/test/Ice/timeout/run.py +++ b/java/test/Ice/timeout/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/java/test/Ice/udp/run.py b/java/test/Ice/udp/run.py index 8c1170071ad..f6db622ae1e 100755 --- a/java/test/Ice/udp/run.py +++ b/java/test/Ice/udp/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) @@ -26,16 +26,17 @@ num = 5 serverProc = [] for i in range(0, num): - print "starting server #%d..." % (i + 1), + sys.stdout.write("starting server #%d... " % (i + 1)) + sys.stdout.flush() serverProc.append(TestUtil.startServer("test.Ice.udp.Server", "%d" % i , adapter="McastTestAdapter")) - print "ok" + print("ok") -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Ice.udp.Client", "%d" % num, startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() for p in serverProc: p.waitTestSuccess() - diff --git a/java/test/IceBox/configuration/run.py b/java/test/IceBox/configuration/run.py index 7d638eb15c6..3786f2add8a 100755 --- a/java/test/IceBox/configuration/run.py +++ b/java/test/IceBox/configuration/run.py @@ -16,12 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest(additionalServerOptions='--Ice.Config="%s"' % os.path.join(os.getcwd(), "config.icebox"), server=TestUtil.getIceBox()) TestUtil.clientServerTest(additionalServerOptions='--Ice.Config="%s"' % os.path.join(os.getcwd(), "config.icebox2"), server=TestUtil.getIceBox()) - diff --git a/java/test/IceGrid/simple/run.py b/java/test/IceGrid/simple/run.py index 568bbe5fa53..c0e31578fda 100755 --- a/java/test/IceGrid/simple/run.py +++ b/java/test/IceGrid/simple/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin # # Test client/server without on demand activation. @@ -29,4 +29,3 @@ IceGridAdmin.iceGridClientServerTest("", "--TestAdapter.Endpoints=default --Test # Test client/server with on demand activation. # IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy") - diff --git a/java/test/IceSSL/configuration/run.py b/java/test/IceSSL/configuration/run.py index 81b828550ca..2af641e3027 100755 --- a/java/test/IceSSL/configuration/run.py +++ b/java/test/IceSSL/configuration/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil testdir = '"%s"' % os.getcwd() TestUtil.clientServerTest(additionalClientOptions=testdir) - diff --git a/java/test/IceUtil/fileLock/run.py b/java/test/IceUtil/fileLock/run.py index 0066678ae60..05ac6b54492 100755 --- a/java/test/IceUtil/fileLock/run.py +++ b/java/test/IceUtil/fileLock/run.py @@ -16,12 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil - -print "testing process file lock...", +sys.stdout.write("testing process file lock... ") sys.stdout.flush() client = os.path.join("test.IceUtil.fileLock.Client") @@ -56,5 +55,4 @@ clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.wait() -print "ok" - +print("ok") diff --git a/java/test/IceUtil/inputUtil/run.py b/java/test/IceUtil/inputUtil/run.py index 6042580714e..ab22ebfef67 100755 --- a/java/test/IceUtil/inputUtil/run.py +++ b/java/test/IceUtil/inputUtil/run.py @@ -16,13 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.IceUtil.inputUtil.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Slice/generation/run.py b/java/test/Slice/generation/run.py index d7cf9c52d2d..4d77c036b02 100755 --- a/java/test/Slice/generation/run.py +++ b/java/test/Slice/generation/run.py @@ -16,11 +16,12 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel os.getcwd()!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel os.getcwd()!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "testing list-generated...", +sys.stdout.write("testing list-generated... ") +sys.stdout.flush() slice2java = os.path.join(TestUtil.getCppBinDir(), "slice2java") if not os.path.exists("classes"): @@ -28,23 +29,27 @@ if not os.path.exists("classes"): command = '"' + slice2java + '" --list-generated --output-dir classes File1.ice File2.ice' if TestUtil.debug: - print "(%s)" % command, + sys.stdout.write("(%s) " % command) p = TestUtil.runCommand(command) lines1 = p.stdout.readlines() lines2 = open(os.path.join(os.getcwd(), "list-generated.out"), "r").readlines() if len(lines1) != len(lines2): - print "failed!" + print("failed!") sys.exit(1) i = 0 while i < len(lines1): - line1 = lines1[i].strip() - line2 = lines2[i].strip() + if sys.version_info[0] == 2: + line1 = lines1[i].strip() + line2 = lines2[i].strip() + else: + line1 = lines1[i].decode("utf-8").strip() + line2 = lines2[i].strip() if line1 != line2: - print "failed!" + print("failed!") sys.exit(1) i = i + 1 else: - print "ok" + print("ok") sys.exit(0) diff --git a/java/test/Slice/keyword/run.py b/java/test/Slice/keyword/run.py index 74cd2954e11..1ea2a4eb6c1 100755 --- a/java/test/Slice/keyword/run.py +++ b/java/test/Slice/keyword/run.py @@ -16,13 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Slice.keyword.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() - diff --git a/java/test/Slice/structure/run.py b/java/test/Slice/structure/run.py index 4844d7a436c..99027de6ecf 100755 --- a/java/test/Slice/structure/run.py +++ b/java/test/Slice/structure/run.py @@ -16,12 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient("test.Slice.structure.Client",startReader=False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() |