diff options
author | Bernard Normier <bernard@zeroc.com> | 2009-01-23 17:07:21 -0500 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2009-01-23 17:07:21 -0500 |
commit | 2380e089401d048490da23bc6d71e5687bafbe47 (patch) | |
tree | 6d97052d1f93bc2bafcd7fd1a9ebe103544b6cad /java/test | |
parent | Fixed permissions (diff) | |
parent | 3.3.1 third-party updates (diff) | |
download | ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.bz2 ice-2380e089401d048490da23bc6d71e5687bafbe47.tar.xz ice-2380e089401d048490da23bc6d71e5687bafbe47.zip |
Merge branch 'R3_3_branch' of cvs:/home/git/ice into R3_3_branch
Conflicts:
java/resources/IceGridAdmin/icegridadmin_content_dyn.html
java/resources/IceGridAdmin/icegridadmin_content_static.html
Diffstat (limited to 'java/test')
383 files changed, 1565 insertions, 1422 deletions
diff --git a/java/test/Freeze/build.xml b/java/test/Freeze/build.xml index d14567fa734..465c645d89b 100644 --- a/java/test/Freeze/build.xml +++ b/java/test/Freeze/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Client.java b/java/test/Freeze/complex/Client.java index c571877c359..e6dc2d363bd 100644 --- a/java/test/Freeze/complex/Client.java +++ b/java/test/Freeze/complex/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Complex.ice b/java/test/Freeze/complex/Complex.ice index 3e811305647..9e2592d8d4d 100644 --- a/java/test/Freeze/complex/Complex.ice +++ b/java/test/Freeze/complex/Complex.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Complex/AddNodeI.java b/java/test/Freeze/complex/Complex/AddNodeI.java index 095a4a781e1..c46e8e09d51 100644 --- a/java/test/Freeze/complex/Complex/AddNodeI.java +++ b/java/test/Freeze/complex/Complex/AddNodeI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Complex/MultiplyNodeI.java b/java/test/Freeze/complex/Complex/MultiplyNodeI.java index 0614b5cb9ea..4092cbc61ee 100644 --- a/java/test/Freeze/complex/Complex/MultiplyNodeI.java +++ b/java/test/Freeze/complex/Complex/MultiplyNodeI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Complex/NumberNodeI.java b/java/test/Freeze/complex/Complex/NumberNodeI.java index 3b4943773c5..32066758795 100644 --- a/java/test/Freeze/complex/Complex/NumberNodeI.java +++ b/java/test/Freeze/complex/Complex/NumberNodeI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Complex/ObjectFactoryI.java b/java/test/Freeze/complex/Complex/ObjectFactoryI.java index 769fe66517d..549d758f644 100644 --- a/java/test/Freeze/complex/Complex/ObjectFactoryI.java +++ b/java/test/Freeze/complex/Complex/ObjectFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/ParseError.java b/java/test/Freeze/complex/ParseError.java index 77b3cb2a4b9..c0778e429d4 100644 --- a/java/test/Freeze/complex/ParseError.java +++ b/java/test/Freeze/complex/ParseError.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/Parser.java b/java/test/Freeze/complex/Parser.java index f88ae646847..c654fa371e6 100644 --- a/java/test/Freeze/complex/Parser.java +++ b/java/test/Freeze/complex/Parser.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/complex/build.xml b/java/test/Freeze/complex/build.xml index 30134d17c4d..08f23a97390 100644 --- a/java/test/Freeze/complex/build.xml +++ b/java/test/Freeze/complex/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -51,6 +51,7 @@ <delete> <fileset dir="db" includes="log.*"/> <fileset dir="db" includes="test"/> + <fileset dir="db" includes="__catalog*"/> </delete> </target> diff --git a/java/test/Freeze/complex/run.py b/java/test/Freeze/complex/run.py index bcb9ba442dd..f293046a8fb 100755 --- a/java/test/Freeze/complex/run.py +++ b/java/test/Freeze/complex/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,49 +10,32 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Freeze", "complex") -testdir = os.path.join(toplevel, "test", name) -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) # # Clean the contents of the database directory. # -dbdir = os.path.join(testdir, "db") +dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) - print "starting populate...", -populatePipe = TestUtil.startClient("Client", " --dbdir " + testdir + " populate" + " 2>&1") +populateProc = TestUtil.startClient("Client", " --dbdir %s populate" % os.getcwd()) print "ok" -TestUtil.printOutputFromPipe(populatePipe) - -populateStatus = TestUtil.closePipe(populatePipe) - -if populateStatus: - sys.exit(1) +populateProc.waitTestSuccess() print "starting verification client...", -clientPipe = TestUtil.startClient("Client", " --dbdir " + testdir + " validate" + " 2>&1") -print "ok" +clientProc = TestUtil.startClient("Client", " --dbdir %s validate" % os.getcwd()) -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +print "ok" +clientProc.waitTestSuccess() diff --git a/java/test/Freeze/dbmap/Client.java b/java/test/Freeze/dbmap/Client.java index 35d67fd7a91..203e14cf2a8 100644 --- a/java/test/Freeze/dbmap/Client.java +++ b/java/test/Freeze/dbmap/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/dbmap/build.xml b/java/test/Freeze/dbmap/build.xml index 1f74e17f5d8..70870f6f315 100644 --- a/java/test/Freeze/dbmap/build.xml +++ b/java/test/Freeze/dbmap/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -72,7 +72,8 @@ <delete dir="${generated.dir}"/> <delete> <fileset dir="db" includes="log.*"/> - <fileset dir="db" includes="__catalog"/> + <fileset dir="db" includes="__catalog*"/> + <fileset dir="db" includes="sortedMap,sortedMap.category"/> <fileset dir="db" includes="binary,binary.index"/> <fileset dir="db" includes="intIdentity,intIdentity.category"/> </delete> diff --git a/java/test/Freeze/dbmap/run.py b/java/test/Freeze/dbmap/run.py index a304c10eac4..9b242c82d04 100755 --- a/java/test/Freeze/dbmap/run.py +++ b/java/test/Freeze/dbmap/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,34 +10,22 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) -name = os.path.join("Freeze", "dbmap") -testdir = os.path.join(toplevel, "test", name) -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -dbdir = os.path.join(testdir, "db") +dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) print "starting client...", -clientPipe = TestUtil.startClient("Client", testdir + " 2>&1") +clientProc = TestUtil.startClient("Client", os.getcwd()) print "ok" - -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() diff --git a/java/test/Freeze/evictor/AccountI.java b/java/test/Freeze/evictor/AccountI.java index 8df7057eeaa..7ec38f04d4a 100644 --- a/java/test/Freeze/evictor/AccountI.java +++ b/java/test/Freeze/evictor/AccountI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -81,7 +81,6 @@ public class AccountI extends Test.Account notify(); } - public synchronized void run() { if(_response == false && _exception == null) @@ -129,8 +128,7 @@ public class AccountI extends Test.Account ResponseThread thread = new ResponseThread(); thread.setDaemon(true); - thread.start(); - + test(_evictor.getCurrentTransaction() != null); try @@ -140,6 +138,9 @@ public class AccountI extends Test.Account } catch(Ice.UserException e) { + thread.start(); + Thread.yield(); + // // Need to rollback here -- "rollback on user exception" does not work // when the dispatch commits before it gets any response! @@ -150,6 +151,8 @@ public class AccountI extends Test.Account return; } + thread.start(); + Thread.yield(); thread.response(); } diff --git a/java/test/Freeze/evictor/Client.java b/java/test/Freeze/evictor/Client.java index 81099d6ac79..462da193412 100644 --- a/java/test/Freeze/evictor/Client.java +++ b/java/test/Freeze/evictor/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/FacetI.java b/java/test/Freeze/evictor/FacetI.java index 68de5663351..dbc87262a28 100644 --- a/java/test/Freeze/evictor/FacetI.java +++ b/java/test/Freeze/evictor/FacetI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/RemoteEvictorFactoryI.java b/java/test/Freeze/evictor/RemoteEvictorFactoryI.java index 5b4fef846fc..c9008bad700 100644 --- a/java/test/Freeze/evictor/RemoteEvictorFactoryI.java +++ b/java/test/Freeze/evictor/RemoteEvictorFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/RemoteEvictorI.java b/java/test/Freeze/evictor/RemoteEvictorI.java index 008bc2725bb..e5278012c16 100644 --- a/java/test/Freeze/evictor/RemoteEvictorI.java +++ b/java/test/Freeze/evictor/RemoteEvictorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/ServantI.java b/java/test/Freeze/evictor/ServantI.java index 9bdd8d11be0..b21afb4038d 100644 --- a/java/test/Freeze/evictor/ServantI.java +++ b/java/test/Freeze/evictor/ServantI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/Server.java b/java/test/Freeze/evictor/Server.java index 601f9a13d9c..4c020875b27 100644 --- a/java/test/Freeze/evictor/Server.java +++ b/java/test/Freeze/evictor/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/Test.ice b/java/test/Freeze/evictor/Test.ice index cf9dacd443f..2b72a5b70c9 100644 --- a/java/test/Freeze/evictor/Test.ice +++ b/java/test/Freeze/evictor/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/evictor/build.xml b/java/test/Freeze/evictor/build.xml index b6d41b0cc24..10713da3f3b 100644 --- a/java/test/Freeze/evictor/build.xml +++ b/java/test/Freeze/evictor/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -48,6 +48,7 @@ <delete dir="${class.dir}"/> <delete> <fileset dir="db" includes="log.*"/> + <fileset dir="db" includes="__catalog*"/> <fileset dir="db" includes="Test,__catalog"/> </delete> </target> diff --git a/java/test/Freeze/evictor/run.py b/java/test/Freeze/evictor/run.py index ad872902b86..eb2ec82742a 100755 --- a/java/test/Freeze/evictor/run.py +++ b/java/test/Freeze/evictor/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,25 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Freeze", "evictor") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -dbdir = os.path.join(testdir, "db") +dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -testOptions = " --Freeze.Warn.Deadlocks=0 --Freeze.DbEnv.db.DbHome=" + testdir + "/db" + " --Ice.Config=" + testdir + "/config "; +testOptions = " --Freeze.Warn.Deadlocks=0 --Freeze.DbEnv.db.DbHome=%s/db --Ice.Config=%s/config " % (os.getcwd(), os.getcwd()) -TestUtil.clientServerTestWithOptions(testdir, testOptions, testOptions) -sys.exit(0) +TestUtil.clientServerTest(testOptions, testOptions) diff --git a/java/test/Freeze/oldevictor/Client.java b/java/test/Freeze/oldevictor/Client.java index c52145d07c3..2b083967c2d 100644 --- a/java/test/Freeze/oldevictor/Client.java +++ b/java/test/Freeze/oldevictor/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/FacetI.java b/java/test/Freeze/oldevictor/FacetI.java index 8d4b4faa155..b2acd7214fd 100644 --- a/java/test/Freeze/oldevictor/FacetI.java +++ b/java/test/Freeze/oldevictor/FacetI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java b/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java index 5932103b2bb..75481d2bebb 100644 --- a/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java +++ b/java/test/Freeze/oldevictor/RemoteEvictorFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/RemoteEvictorI.java b/java/test/Freeze/oldevictor/RemoteEvictorI.java index 4c71bd6c5f8..075e3bdb08c 100644 --- a/java/test/Freeze/oldevictor/RemoteEvictorI.java +++ b/java/test/Freeze/oldevictor/RemoteEvictorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/ServantI.java b/java/test/Freeze/oldevictor/ServantI.java index 2a1dc270597..feeead8dcac 100644 --- a/java/test/Freeze/oldevictor/ServantI.java +++ b/java/test/Freeze/oldevictor/ServantI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/Server.java b/java/test/Freeze/oldevictor/Server.java index 5b01e64ef7a..02b52afb564 100644 --- a/java/test/Freeze/oldevictor/Server.java +++ b/java/test/Freeze/oldevictor/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/Test.ice b/java/test/Freeze/oldevictor/Test.ice index d43b8d3fb0e..0c667d9b678 100644 --- a/java/test/Freeze/oldevictor/Test.ice +++ b/java/test/Freeze/oldevictor/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Freeze/oldevictor/build.xml b/java/test/Freeze/oldevictor/build.xml index c5cb5bbe55f..38aae918d72 100644 --- a/java/test/Freeze/oldevictor/build.xml +++ b/java/test/Freeze/oldevictor/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -45,6 +45,7 @@ <delete dir="${class.dir}"/> <delete> <fileset dir="db" includes="log.*"/> + <fileset dir="db" includes="__catalog*"/> <fileset dir="db" includes="Test"/> </delete> </target> diff --git a/java/test/Freeze/oldevictor/run.py b/java/test/Freeze/oldevictor/run.py index daa73970fd6..b17366f6069 100755 --- a/java/test/Freeze/oldevictor/run.py +++ b/java/test/Freeze/oldevictor/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,25 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Freeze", "oldevictor") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -dbdir = os.path.join(testdir, "db") +dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) -testOptions = " --Freeze.DbEnv.db.DbHome=" + testdir + "/db" + " --Ice.Config=" + testdir + "/config "; +testOptions = " --Freeze.DbEnv.db.DbHome=%s --Ice.Config=%s" % (dbdir, os.path.join(os.getcwd(), "config")) -TestUtil.clientServerTestWithOptions(testdir, testOptions, testOptions) -sys.exit(0) +TestUtil.clientServerTest(testOptions, testOptions) diff --git a/java/test/Glacier2/attack/AttackClient.java b/java/test/Glacier2/attack/AttackClient.java deleted file mode 100644 index 1a93f058ae4..00000000000 --- a/java/test/Glacier2/attack/AttackClient.java +++ /dev/null @@ -1,138 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -import Test.*; - -class AttackClient extends Ice.Application -{ - public int - run(String[] args) - { - System.out.print("getting router... "); - System.out.flush(); - Ice.ObjectPrx routerBase = communicator().stringToProxy("Glacier2/router:default -p 12347 -t 10000"); - Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.checkedCast(routerBase); - test(router != null); - System.out.println("ok"); - - System.out.print("creating session... "); - System.out.flush(); - try - { - Glacier2.SessionPrx session = router.createSession("userid", "abc123"); - } - catch(Glacier2.PermissionDeniedException ex) - { - assert(false); - } - catch(Glacier2.CannotCreateSessionException ex) - { - assert(false); - } - communicator().setDefaultRouter(router); - System.out.println("ok"); - - System.out.print("making thousands of invocations on proxies... "); - System.out.flush(); - Ice.ObjectPrx backendBase = communicator().stringToProxy("dummy:tcp -p 12010 -t 10000"); - BackendPrx backend = BackendPrxHelper.uncheckedCast(backendBase); - backend.ice_ping(); - - java.util.Map<BackendPrx, BackendPrx> backends = new java.util.HashMap<BackendPrx, BackendPrx>(); - java.util.Random rand = new java.util.Random(); - - String msg = ""; - for(int i = 1; i <= 10000; ++i) - { - if(i % 100 == 0) - { - for(int j = 0; j < msg.length(); ++j) - { - System.out.print('\b'); - } - - msg = "" + i; - System.out.print(i); - System.out.flush(); - } - - Ice.Identity ident = new Ice.Identity(); - - StringBuffer name = new StringBuffer(); - name.append((char)('A' + rand.nextInt(26))); - ident.name = name.toString(); - - StringBuffer category = new StringBuffer(); - int len = rand.nextInt(2); - for(int j = 0; j < len; ++j) - { - category.append((char)('a' + rand.nextInt(26))); - } - ident.category = category.toString(); - - BackendPrx newBackend = BackendPrxHelper.uncheckedCast(backendBase.ice_identity(ident)); - - if(!backends.containsKey(newBackend)) - { - backends.put(newBackend, newBackend); - backend = newBackend; - } - else - { - backend = backends.get(newBackend); - } - - backend.ice_ping(); - } - - for(int j = 0; j < msg.length(); ++j) - { - System.out.print('\b'); - } - for(int j = 0; j < msg.length(); ++j) - { - System.out.print(' '); - } - for(int j = 0; j < msg.length(); ++j) - { - System.out.print('\b'); - } - System.out.println("ok"); - - System.out.print("testing server and router shutdown... "); - System.out.flush(); - backend.shutdown(); - communicator().setDefaultRouter(null); - Ice.ObjectPrx processBase = - communicator().stringToProxy("Glacier2/admin -f Process:tcp -h 127.0.0.1 -p 12348 -t 10000"); - Ice.ProcessPrx process = Ice.ProcessPrxHelper.checkedCast(processBase); - test(process != null); - process.shutdown(); - try - { - process.ice_ping(); - test(false); - } - catch(Ice.LocalException ex) - { - System.out.println("ok"); - } - - return 0; - } - - private static void - test(boolean b) - { - if(!b) - { - throw new RuntimeException(); - } - } -} diff --git a/java/test/Glacier2/attack/BackendI.java b/java/test/Glacier2/attack/BackendI.java deleted file mode 100644 index d0830936069..00000000000 --- a/java/test/Glacier2/attack/BackendI.java +++ /dev/null @@ -1,23 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -import Test.*; - -final class BackendI extends _BackendDisp -{ - BackendI() - { - } - - public void - shutdown(Ice.Current current) - { - current.adapter.getCommunicator().shutdown(); - } -} diff --git a/java/test/Glacier2/attack/BackendServer.java b/java/test/Glacier2/attack/BackendServer.java deleted file mode 100644 index 8e839bcdec6..00000000000 --- a/java/test/Glacier2/attack/BackendServer.java +++ /dev/null @@ -1,24 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -import Test.*; - -class BackendServer extends Ice.Application -{ - public int - run(String[] args) - { - communicator().getProperties().setProperty("BackendAdapter.Endpoints", "tcp -p 12010 -t 10000"); - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("BackendAdapter"); - adapter.addServantLocator(new ServantLocatorI(), ""); - adapter.activate(); - communicator().waitForShutdown(); - return 0; - } -} diff --git a/java/test/Glacier2/attack/Client.java b/java/test/Glacier2/attack/Client.java deleted file mode 100644 index bc876194eb3..00000000000 --- a/java/test/Glacier2/attack/Client.java +++ /dev/null @@ -1,29 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -public class Client -{ - public static void - main(String[] args) - { - // - // We want to check whether the client retries for evicted - // proxies, even with regular retries disabled. - // - Ice.StringSeqHolder argsH = new Ice.StringSeqHolder(args); - Ice.InitializationData initData = new Ice.InitializationData(); - initData.properties = Ice.Util.createProperties(argsH); - initData.properties.setProperty("Ice.RetryIntervals", "-1"); - - AttackClient app = new AttackClient(); - int status = app.main("Client", argsH.value, initData); - System.gc(); - System.exit(status); - } -} diff --git a/java/test/Glacier2/attack/ServantLocatorI.java b/java/test/Glacier2/attack/ServantLocatorI.java deleted file mode 100644 index 5661f24428f..00000000000 --- a/java/test/Glacier2/attack/ServantLocatorI.java +++ /dev/null @@ -1,33 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -import Test.*; - -public final class ServantLocatorI implements Ice.ServantLocator -{ - ServantLocatorI() - { - _backend = new BackendI(); - } - - public Ice.Object locate(Ice.Current curr, Ice.LocalObjectHolder cookie) - { - return _backend; - } - - public void finished(Ice.Current curr, Ice.Object servant, java.lang.Object cookie) - { - } - - public void deactivate(String category) - { - } - - private Backend _backend; -} diff --git a/java/test/Glacier2/attack/Server.java b/java/test/Glacier2/attack/Server.java deleted file mode 100644 index a6ccfd7c61c..00000000000 --- a/java/test/Glacier2/attack/Server.java +++ /dev/null @@ -1,20 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -public class Server -{ - public static void - main(String[] args) - { - BackendServer app = new BackendServer(); - int status = app.main("Server", args); - System.gc(); - System.exit(status); - } -} diff --git a/java/test/Glacier2/attack/passwords b/java/test/Glacier2/attack/passwords deleted file mode 100644 index a1527dec2b9..00000000000 --- a/java/test/Glacier2/attack/passwords +++ /dev/null @@ -1 +0,0 @@ -userid xxMqsnnDcK8tw
\ No newline at end of file diff --git a/java/test/Glacier2/attack/run.py b/java/test/Glacier2/attack/run.py deleted file mode 100755 index c12be9e5baf..00000000000 --- a/java/test/Glacier2/attack/run.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -import os, sys - -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: - raise "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -testdir = os.path.dirname(os.path.abspath(__file__)) - -router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") - -args = r' --Ice.PrintProcessId' \ - r' --Glacier2.RoutingTable.MaxSize=10' + \ - r' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \ - r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \ - r' --Ice.Admin.InstanceName=Glacier2' + \ - r' --Glacier2.CryptPasswords="' + os.path.join(testdir, "passwords") + '"' - -print "starting router...", -routerConfig = TestUtil.DriverConfig("server") -routerConfig.lang = "cpp" -starterPipe = TestUtil.startServer(router, args + " 2>&1", routerConfig) -TestUtil.getServerPid(starterPipe) -TestUtil.getAdapterReady(starterPipe, True, 2) -print "ok" - -name = os.path.join("Glacier2", "attack") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) - -if TestUtil.serverStatus(): - sys.exit(1) - -sys.exit(0) diff --git a/java/test/Glacier2/build.xml b/java/test/Glacier2/build.xml index b670c262eff..907462c8d33 100644 --- a/java/test/Glacier2/build.xml +++ b/java/test/Glacier2/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -12,12 +12,10 @@ <project name="test_Glacier2" default="all" basedir="."> <target name="all"> - <ant dir="attack"/> <ant dir="router"/> </target> <target name="clean"> - <ant dir="attack" target="clean"/> <ant dir="router" target="clean"/> </target> diff --git a/java/test/Glacier2/router/Callback.ice b/java/test/Glacier2/router/Callback.ice index c35b67ec95d..8df703ebedc 100644 --- a/java/test/Glacier2/router/Callback.ice +++ b/java/test/Glacier2/router/Callback.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/CallbackClient.java b/java/test/Glacier2/router/CallbackClient.java index 723eabd0c10..7f53891d986 100644 --- a/java/test/Glacier2/router/CallbackClient.java +++ b/java/test/Glacier2/router/CallbackClient.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/CallbackI.java b/java/test/Glacier2/router/CallbackI.java index 1bad0ee3e64..71709335553 100644 --- a/java/test/Glacier2/router/CallbackI.java +++ b/java/test/Glacier2/router/CallbackI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/CallbackReceiverI.java b/java/test/Glacier2/router/CallbackReceiverI.java index d1a2c337b1d..2948675d024 100644 --- a/java/test/Glacier2/router/CallbackReceiverI.java +++ b/java/test/Glacier2/router/CallbackReceiverI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/CallbackServer.java b/java/test/Glacier2/router/CallbackServer.java index bd03d787e71..01a077589e6 100644 --- a/java/test/Glacier2/router/CallbackServer.java +++ b/java/test/Glacier2/router/CallbackServer.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/Client.java b/java/test/Glacier2/router/Client.java index fac5f6529f1..f936057ffcd 100644 --- a/java/test/Glacier2/router/Client.java +++ b/java/test/Glacier2/router/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/Server.java b/java/test/Glacier2/router/Server.java index dffca206e19..67ac0e8ab32 100644 --- a/java/test/Glacier2/router/Server.java +++ b/java/test/Glacier2/router/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/build.xml b/java/test/Glacier2/router/build.xml index 2cdebe07b0e..f343d4034dc 100644 --- a/java/test/Glacier2/router/build.xml +++ b/java/test/Glacier2/router/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Glacier2/router/run.py b/java/test/Glacier2/router/run.py index 7da23613f11..976a222bee1 100755 --- a/java/test/Glacier2/router/run.py +++ b/java/test/Glacier2/router/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,62 +10,37 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -testdir = os.path.dirname(os.path.abspath(__file__)) +sys.path.append(os.path.join(path[0])) +from scripts import * router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") -args = r' --Ice.Warn.Dispatch=0' + \ - r' --Ice.Warn.Connections=0' + \ - r' --Glacier2.Filter.Category.Accept="c1 c2"' + \ - r' --Glacier2.Filter.Category.AcceptUser="2"' + \ - r' --Glacier2.SessionTimeout="30"' + \ - r' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \ - r' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \ - r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \ - r' --Ice.Admin.InstanceName=Glacier2' + \ - r' --Glacier2.CryptPasswords="' + os.path.join(testdir, "passwords") + '"' +args = ' --Ice.Warn.Dispatch=0' + \ + ' --Ice.Warn.Connections=0' + \ + ' --Glacier2.Filter.Category.Accept="c1 c2"' + \ + ' --Glacier2.Filter.Category.AcceptUser="2"' + \ + ' --Glacier2.SessionTimeout="30"' + \ + ' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \ + ' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \ + ' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \ + ' --Ice.Admin.InstanceName=Glacier2' + \ + ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"' print "starting router...", routerConfig = TestUtil.DriverConfig("server") routerConfig.lang = "cpp" -starterPipe = TestUtil.startServer(router, args + " 2>&1", routerConfig) -TestUtil.getServerPid(starterPipe) -# -# For this test we don't want to add the router to the server threads -# since we want the the router to run over two calls to -# mixedClientServerTest -# -TestUtil.getAdapterReady(starterPipe, False, 2) +starterProc = TestUtil.startServer(router, args, count=2, config=routerConfig) print "ok" -starterThread = TestUtil.ReaderThread(starterPipe); -starterThread.start() - -name = os.path.join("Glacier2", "router") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.mixedClientServerTest(name) - -# -# We run the test again, to check whether the glacier router can -# handle multiple clients. Also, when we run for the second time, we -# want the client to shutdown the router after running the tests. -# -TestUtil.mixedClientServerTestWithOptions(name, "", " --shutdown") +TestUtil.clientServerTest() -starterThread.join() -if starterThread.getStatus(): - sys.exit(1) +TestUtil.clientServerTest(additionalClientOptions=" --shutdown") -sys.exit(0) +starterProc.waitTestSuccess() diff --git a/java/test/Ice/adapterDeactivation/AllTests.java b/java/test/Ice/adapterDeactivation/AllTests.java index cd219e9fbdc..ae26e279b06 100644 --- a/java/test/Ice/adapterDeactivation/AllTests.java +++ b/java/test/Ice/adapterDeactivation/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/Client.java b/java/test/Ice/adapterDeactivation/Client.java index 288bdd5b22f..6c24edce08c 100644 --- a/java/test/Ice/adapterDeactivation/Client.java +++ b/java/test/Ice/adapterDeactivation/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/Collocated.java b/java/test/Ice/adapterDeactivation/Collocated.java index 0c7cc5adc1e..fd621ee2f54 100644 --- a/java/test/Ice/adapterDeactivation/Collocated.java +++ b/java/test/Ice/adapterDeactivation/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/CookieI.java b/java/test/Ice/adapterDeactivation/CookieI.java index 8e051f40033..46b4fac6e28 100644 --- a/java/test/Ice/adapterDeactivation/CookieI.java +++ b/java/test/Ice/adapterDeactivation/CookieI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/ServantLocatorI.java b/java/test/Ice/adapterDeactivation/ServantLocatorI.java index e6b04cd9226..3cf53e6440c 100644 --- a/java/test/Ice/adapterDeactivation/ServantLocatorI.java +++ b/java/test/Ice/adapterDeactivation/ServantLocatorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/Server.java b/java/test/Ice/adapterDeactivation/Server.java index 0b3e3dbf284..95b06996897 100644 --- a/java/test/Ice/adapterDeactivation/Server.java +++ b/java/test/Ice/adapterDeactivation/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/Test.ice b/java/test/Ice/adapterDeactivation/Test.ice index f2d31eb2a9f..d8ad4c7f1f2 100644 --- a/java/test/Ice/adapterDeactivation/Test.ice +++ b/java/test/Ice/adapterDeactivation/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/TestI.java b/java/test/Ice/adapterDeactivation/TestI.java index b3dc4bb9582..cb373ea5b44 100644 --- a/java/test/Ice/adapterDeactivation/TestI.java +++ b/java/test/Ice/adapterDeactivation/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/build.xml b/java/test/Ice/adapterDeactivation/build.xml index ce2183f7f69..0fe79983631 100644 --- a/java/test/Ice/adapterDeactivation/build.xml +++ b/java/test/Ice/adapterDeactivation/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/adapterDeactivation/run.py b/java/test/Ice/adapterDeactivation/run.py index 2846cef184e..545214a74c7 100755 --- a/java/test/Ice/adapterDeactivation/run.py +++ b/java/test/Ice/adapterDeactivation/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,26 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "adapterDeactivation") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -# -# We need to use mixedClientServerTest so that, when using SSL, the -# server-side SSL configuration properties are defined. This is -# necessary because the client creates object adapters. -# -TestUtil.mixedClientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/java/test/Ice/background/Acceptor.java b/java/test/Ice/background/Acceptor.java index a4034b872a6..df6ddddd8e6 100644 --- a/java/test/Ice/background/Acceptor.java +++ b/java/test/Ice/background/Acceptor.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/AllTests.java b/java/test/Ice/background/AllTests.java index 9d24b2e64e2..737f792c8d0 100644 --- a/java/test/Ice/background/AllTests.java +++ b/java/test/Ice/background/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/BackgroundControllerI.java b/java/test/Ice/background/BackgroundControllerI.java index 828ef9cf47e..1444b2e9849 100644 --- a/java/test/Ice/background/BackgroundControllerI.java +++ b/java/test/Ice/background/BackgroundControllerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/BackgroundI.java b/java/test/Ice/background/BackgroundI.java index 0b59a974f11..6a4d4553b28 100644 --- a/java/test/Ice/background/BackgroundI.java +++ b/java/test/Ice/background/BackgroundI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/Client.java b/java/test/Ice/background/Client.java index ee7c89ca2b1..91a4be7dbe8 100644 --- a/java/test/Ice/background/Client.java +++ b/java/test/Ice/background/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -40,7 +40,7 @@ public class Client initData.properties.setProperty("Ice.Warn.Connections", "0"); // - // Setup the test transport plugin. + // Setup the test transport plug-in. // initData.properties.setProperty("Ice.Plugin.Test", "PluginFactory"); String defaultProtocol = initData.properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp"); diff --git a/java/test/Ice/background/Configuration.java b/java/test/Ice/background/Configuration.java index f7162861b72..97aeefa60c4 100644 --- a/java/test/Ice/background/Configuration.java +++ b/java/test/Ice/background/Configuration.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/Connector.java b/java/test/Ice/background/Connector.java index bbca28dcb1c..242d45ea7e4 100644 --- a/java/test/Ice/background/Connector.java +++ b/java/test/Ice/background/Connector.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/EndpointFactory.java b/java/test/Ice/background/EndpointFactory.java index 647aae06e9f..54ecd46023d 100644 --- a/java/test/Ice/background/EndpointFactory.java +++ b/java/test/Ice/background/EndpointFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/EndpointI.java b/java/test/Ice/background/EndpointI.java index 4286c0d9365..35147578498 100644 --- a/java/test/Ice/background/EndpointI.java +++ b/java/test/Ice/background/EndpointI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/PluginFactory.java b/java/test/Ice/background/PluginFactory.java index 71748f4efe3..67e954d5de5 100644 --- a/java/test/Ice/background/PluginFactory.java +++ b/java/test/Ice/background/PluginFactory.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/Server.java b/java/test/Ice/background/Server.java index 37cb617d4ac..7e5cdb7d513 100644 --- a/java/test/Ice/background/Server.java +++ b/java/test/Ice/background/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -133,7 +133,7 @@ public class Server initData.properties.setProperty("Ice.Warn.Connections", "0"); // - // Setup the test transport plugin. + // Setup the test transport plug-in. // initData.properties.setProperty("Ice.Plugin.Test", "PluginFactory"); String defaultProtocol = initData.properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp"); diff --git a/java/test/Ice/background/Test.ice b/java/test/Ice/background/Test.ice index 11ef1c5a63a..e4707ef2706 100644 --- a/java/test/Ice/background/Test.ice +++ b/java/test/Ice/background/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/Transceiver.java b/java/test/Ice/background/Transceiver.java index 8459d64db52..c1b869e3e8a 100644 --- a/java/test/Ice/background/Transceiver.java +++ b/java/test/Ice/background/Transceiver.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/build.xml b/java/test/Ice/background/build.xml index 07ef3bae04b..0655e6ae7a6 100644 --- a/java/test/Ice/background/build.xml +++ b/java/test/Ice/background/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/background/run.py b/java/test/Ice/background/run.py index bc7d8cec1a6..bb34e7d35b7 100755 --- a/java/test/Ice/background/run.py +++ b/java/test/Ice/background/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "background") -testdir = os.path.dirname(os.path.abspath(__file__)) - -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/binding/AllTests.java b/java/test/Ice/binding/AllTests.java index 9ff8feb7644..242c25093f4 100644 --- a/java/test/Ice/binding/AllTests.java +++ b/java/test/Ice/binding/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/Client.java b/java/test/Ice/binding/Client.java index c79f7dc4991..da27b62dccd 100644 --- a/java/test/Ice/binding/Client.java +++ b/java/test/Ice/binding/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/RemoteCommunicatorI.java b/java/test/Ice/binding/RemoteCommunicatorI.java index 9d7531d6263..8b0bf22617f 100644 --- a/java/test/Ice/binding/RemoteCommunicatorI.java +++ b/java/test/Ice/binding/RemoteCommunicatorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/RemoteObjectAdapterI.java b/java/test/Ice/binding/RemoteObjectAdapterI.java index bc03622d3b1..7828efba913 100644 --- a/java/test/Ice/binding/RemoteObjectAdapterI.java +++ b/java/test/Ice/binding/RemoteObjectAdapterI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/Server.java b/java/test/Ice/binding/Server.java index 81729a18e6c..ab5228fe620 100644 --- a/java/test/Ice/binding/Server.java +++ b/java/test/Ice/binding/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/Test.ice b/java/test/Ice/binding/Test.ice index 5baef2fb7d4..40783e4535c 100644 --- a/java/test/Ice/binding/Test.ice +++ b/java/test/Ice/binding/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/TestI.java b/java/test/Ice/binding/TestI.java index 5c36897de3f..a403d501067 100644 --- a/java/test/Ice/binding/TestI.java +++ b/java/test/Ice/binding/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/build.xml b/java/test/Ice/binding/build.xml index a03f235d310..7038b5516c0 100644 --- a/java/test/Ice/binding/build.xml +++ b/java/test/Ice/binding/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/binding/run.py b/java/test/Ice/binding/run.py index a6692f5fb4f..bb34e7d35b7 100755 --- a/java/test/Ice/binding/run.py +++ b/java/test/Ice/binding/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,20 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "binding") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/build.xml b/java/test/Ice/build.xml index 7b9fc1f7585..af5f5fb57bb 100644 --- a/java/test/Ice/build.xml +++ b/java/test/Ice/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -38,6 +38,7 @@ <ant dir="servantLocator"/> <ant dir="servantLocatorAMD"/> <ant dir="interceptor"/> + <ant dir="udp"/> </target> <target name="clean"> @@ -67,6 +68,7 @@ <ant dir="servantLocator" target="clean"/> <ant dir="servantLocatorAMD" target="clean"/> <ant dir="interceptor" target="clean"/> + <ant dir="udp" target="clean"/> </target> </project> diff --git a/java/test/Ice/checksum/client/AllTests.java b/java/test/Ice/checksum/AllTests.java index a3eba83c210..7d2497f26a4 100644 --- a/java/test/Ice/checksum/client/AllTests.java +++ b/java/test/Ice/checksum/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/client/Client.java b/java/test/Ice/checksum/Client.java index b3a0bf1d99d..b0bc9e0032f 100644 --- a/java/test/Ice/checksum/client/Client.java +++ b/java/test/Ice/checksum/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/client/Test.ice b/java/test/Ice/checksum/Test.ice index 24e8f7c957b..cf9b2a4d554 100644 --- a/java/test/Ice/checksum/client/Test.ice +++ b/java/test/Ice/checksum/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/client/Types.ice b/java/test/Ice/checksum/Types.ice index ea5e644a755..f9f05a43e4c 100644 --- a/java/test/Ice/checksum/client/Types.ice +++ b/java/test/Ice/checksum/Types.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/build.xml b/java/test/Ice/checksum/build.xml index ea17875ab09..119d8879e5a 100644 --- a/java/test/Ice/checksum/build.xml +++ b/java/test/Ice/checksum/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -11,14 +11,44 @@ <project name="test_Ice_checksum" default="all" basedir="."> - <target name="all"> - <ant dir="client"/> - <ant dir="server"/> + <!-- set global properties for this build --> + <property name="top.dir" value="../../.."/> + + <!-- import common definitions --> + <import file="${top.dir}/config/common.xml"/> + + <target name="generate" depends="init"> + <!-- Create the output directory for generated code --> + <mkdir dir="${generated.dir}"/> + <slice2java outputdir="${generated.dir}" checksum="SliceChecksums"> + <meta value="${java2metadata}"/> + <fileset dir="." includes="Test.ice Types.ice"/> + <includepath> + <pathelement path="${slice.dir}" /> + </includepath> + </slice2java> + </target> + + <target name="compile" depends="generate"> + <mkdir dir="${class.dir}"/> + <javac srcdir="${generated.dir}" destdir="${class.dir}" classpathref="ice.classpath" + debug="${debug}"> + <compilerarg value="${javac.lint}"/> + </javac> + <javac srcdir="." destdir="${class.dir}" classpathref="ice.classpath" excludes="generated/**,server/**" + debug="${debug}"> + <compilerarg value="${javac.lint}"/> + </javac> + </target> + + <target name="all" depends="compile"> + <ant dir="server" inheritAll="false"/> </target> <target name="clean"> - <ant dir="client" target="clean"/> - <ant dir="server" target="clean"/> + <delete dir="${generated.dir}"/> + <delete dir="${class.dir}"/> + <ant dir="server" target="clean" inheritAll="false"/> </target> </project> diff --git a/java/test/Ice/checksum/client/build.xml b/java/test/Ice/checksum/client/build.xml deleted file mode 100644 index b7364c8cc52..00000000000 --- a/java/test/Ice/checksum/client/build.xml +++ /dev/null @@ -1,51 +0,0 @@ -<!-- - ********************************************************************** - - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. - - This copy of Ice is licensed to you under the terms described in the - ICE_LICENSE file included in this distribution. - - ********************************************************************** ---> - -<project name="test_Ice_checksum_client" default="all" basedir="."> - - <!-- set global properties for this build --> - <property name="top.dir" value="../../../.."/> - - <!-- import common definitions --> - <import file="${top.dir}/config/common.xml"/> - - <target name="generate" depends="init"> - <!-- Create the output directory for generated code --> - <mkdir dir="${generated.dir}"/> - <slice2java outputdir="${generated.dir}" checksum="SliceChecksums"> - <meta value="${java2metadata}"/> - <fileset dir="." includes="Test.ice Types.ice"/> - <includepath> - <pathelement path="${slice.dir}" /> - </includepath> - </slice2java> - </target> - - <target name="compile" depends="generate"> - <mkdir dir="${class.dir}"/> - <javac srcdir="${generated.dir}" destdir="${class.dir}" classpathref="ice.classpath" - debug="${debug}"> - <compilerarg value="${javac.lint}"/> - </javac> - <javac srcdir="." destdir="${class.dir}" classpathref="ice.classpath" excludes="generated/**" - debug="${debug}"> - <compilerarg value="${javac.lint}"/> - </javac> - </target> - - <target name="all" depends="compile"/> - - <target name="clean"> - <delete dir="${generated.dir}"/> - <delete dir="${class.dir}"/> - </target> - -</project> diff --git a/java/test/Ice/checksum/run.py b/java/test/Ice/checksum/run.py index b3506b44cfa..6435164948b 100755 --- a/java/test/Ice/checksum/run.py +++ b/java/test/Ice/checksum/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,22 +10,18 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() +import copy +serverenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "server", "classes"), serverenv) -name = os.path.join("Ice", "checksum") -testdir = os.path.dirname(os.path.abspath(__file__)) - -TestUtil.clientServerTestWithClasspath(name, - os.path.join(testdir, "server", "classes"), - os.path.join(testdir, "client", "classes")) - -sys.exit(0) +TestUtil.clientServerTest(serverenv = serverenv) diff --git a/java/test/Ice/checksum/server/ChecksumI.java b/java/test/Ice/checksum/server/ChecksumI.java index 4197a225702..61aa3f68036 100644 --- a/java/test/Ice/checksum/server/ChecksumI.java +++ b/java/test/Ice/checksum/server/ChecksumI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/server/Server.java b/java/test/Ice/checksum/server/Server.java index 5cc748487fe..d59b05be36a 100644 --- a/java/test/Ice/checksum/server/Server.java +++ b/java/test/Ice/checksum/server/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/server/Test.ice b/java/test/Ice/checksum/server/Test.ice index 24e8f7c957b..cf9b2a4d554 100644 --- a/java/test/Ice/checksum/server/Test.ice +++ b/java/test/Ice/checksum/server/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/server/Types.ice b/java/test/Ice/checksum/server/Types.ice index e85192aef7e..27bac1ecdd4 100644 --- a/java/test/Ice/checksum/server/Types.ice +++ b/java/test/Ice/checksum/server/Types.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/checksum/server/build.xml b/java/test/Ice/checksum/server/build.xml index f8417764116..65ac57ff9d4 100644 --- a/java/test/Ice/checksum/server/build.xml +++ b/java/test/Ice/checksum/server/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/Client.java b/java/test/Ice/custom/Client.java index 880689040f4..6a42a5e43cb 100644 --- a/java/test/Ice/custom/Client.java +++ b/java/test/Ice/custom/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/Collocated.java b/java/test/Ice/custom/Collocated.java index 947128d4b95..96d3ab4a245 100644 --- a/java/test/Ice/custom/Collocated.java +++ b/java/test/Ice/custom/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/Server.java b/java/test/Ice/custom/Server.java index 22686f0dbc3..7a19cfb1324 100644 --- a/java/test/Ice/custom/Server.java +++ b/java/test/Ice/custom/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/build.xml b/java/test/Ice/custom/build.xml index 81861d95c47..31513f17d6c 100644 --- a/java/test/Ice/custom/build.xml +++ b/java/test/Ice/custom/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.4/AllTests.java b/java/test/Ice/custom/jdk1.4/AllTests.java index 2200879129e..7fdd7d88235 100644 --- a/java/test/Ice/custom/jdk1.4/AllTests.java +++ b/java/test/Ice/custom/jdk1.4/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.4/Test.ice b/java/test/Ice/custom/jdk1.4/Test.ice index e966746acde..749aa594ae3 100644 --- a/java/test/Ice/custom/jdk1.4/Test.ice +++ b/java/test/Ice/custom/jdk1.4/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.4/TestI.java b/java/test/Ice/custom/jdk1.4/TestI.java index 42cc1a93411..09c28f2acfc 100644 --- a/java/test/Ice/custom/jdk1.4/TestI.java +++ b/java/test/Ice/custom/jdk1.4/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.5/AllTests.java b/java/test/Ice/custom/jdk1.5/AllTests.java index 9f3d495fd95..9bf5d3bc79d 100644 --- a/java/test/Ice/custom/jdk1.5/AllTests.java +++ b/java/test/Ice/custom/jdk1.5/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.5/Test.ice b/java/test/Ice/custom/jdk1.5/Test.ice index 7dad6213b77..5f442a55200 100644 --- a/java/test/Ice/custom/jdk1.5/Test.ice +++ b/java/test/Ice/custom/jdk1.5/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/jdk1.5/TestI.java b/java/test/Ice/custom/jdk1.5/TestI.java index bbc3e787978..32920feee7b 100644 --- a/java/test/Ice/custom/jdk1.5/TestI.java +++ b/java/test/Ice/custom/jdk1.5/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/custom/run.py b/java/test/Ice/custom/run.py index 6f12a4ff810..545214a74c7 100755 --- a/java/test/Ice/custom/run.py +++ b/java/test/Ice/custom/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "custom") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java index e609f9a3c09..bcce84b603f 100644 --- a/java/test/Ice/exceptions/AllTests.java +++ b/java/test/Ice/exceptions/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/Client.java b/java/test/Ice/exceptions/Client.java index 6ebffe3b8a7..1959d49711a 100644 --- a/java/test/Ice/exceptions/Client.java +++ b/java/test/Ice/exceptions/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/Collocated.java b/java/test/Ice/exceptions/Collocated.java index 6fefaa852a6..cf4295f44b2 100644 --- a/java/test/Ice/exceptions/Collocated.java +++ b/java/test/Ice/exceptions/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/DummyLogger.java b/java/test/Ice/exceptions/DummyLogger.java index 36aadd1eb22..520e304c0bd 100644 --- a/java/test/Ice/exceptions/DummyLogger.java +++ b/java/test/Ice/exceptions/DummyLogger.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/EmptyI.java b/java/test/Ice/exceptions/EmptyI.java index 5e808104d78..9b218e6e3a6 100644 --- a/java/test/Ice/exceptions/EmptyI.java +++ b/java/test/Ice/exceptions/EmptyI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/ObjectFactoryI.java b/java/test/Ice/exceptions/ObjectFactoryI.java index c44aaedfc83..6fc0b0b3737 100644 --- a/java/test/Ice/exceptions/ObjectFactoryI.java +++ b/java/test/Ice/exceptions/ObjectFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/ServantLocatorI.java b/java/test/Ice/exceptions/ServantLocatorI.java index c46e637599b..42721e4b39b 100644 --- a/java/test/Ice/exceptions/ServantLocatorI.java +++ b/java/test/Ice/exceptions/ServantLocatorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/Server.java b/java/test/Ice/exceptions/Server.java index 26eba295622..2f2d93e9561 100644 --- a/java/test/Ice/exceptions/Server.java +++ b/java/test/Ice/exceptions/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/Test.ice b/java/test/Ice/exceptions/Test.ice index 10f98f7b5f4..6009b2e6759 100644 --- a/java/test/Ice/exceptions/Test.ice +++ b/java/test/Ice/exceptions/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/ThrowerI.java b/java/test/Ice/exceptions/ThrowerI.java index 7c42ff8b10c..96c8b4dfb97 100644 --- a/java/test/Ice/exceptions/ThrowerI.java +++ b/java/test/Ice/exceptions/ThrowerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/build.xml b/java/test/Ice/exceptions/build.xml index 2079b368eb5..a3395e33a0a 100644 --- a/java/test/Ice/exceptions/build.xml +++ b/java/test/Ice/exceptions/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptions/run.py b/java/test/Ice/exceptions/run.py index e346442d91f..a4f6803f183 100755 --- a/java/test/Ice/exceptions/run.py +++ b/java/test/Ice/exceptions/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,32 +10,24 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "exceptions") -testdir = os.path.dirname(os.path.abspath(__file__)) -nameAMD = os.path.join("Ice", "exceptionsAMD") -testdirAMD = testdir + "AMD" +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name,\ - os.path.join(testdirAMD, "classes") + os.pathsep + classpath, \ - os.path.join(testdir, "classes") + os.pathsep + classpath) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "exceptionsAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) print "tests with collocated server." -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.collocatedTest() diff --git a/java/test/Ice/exceptionsAMD/DummyLogger.java b/java/test/Ice/exceptionsAMD/DummyLogger.java index 36aadd1eb22..520e304c0bd 100644 --- a/java/test/Ice/exceptionsAMD/DummyLogger.java +++ b/java/test/Ice/exceptionsAMD/DummyLogger.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptionsAMD/Server.java b/java/test/Ice/exceptionsAMD/Server.java index 26eba295622..2f2d93e9561 100644 --- a/java/test/Ice/exceptionsAMD/Server.java +++ b/java/test/Ice/exceptionsAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptionsAMD/TestAMD.ice b/java/test/Ice/exceptionsAMD/TestAMD.ice index 80343d6a8a0..4e09cd9702a 100644 --- a/java/test/Ice/exceptionsAMD/TestAMD.ice +++ b/java/test/Ice/exceptionsAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptionsAMD/ThrowerI.java b/java/test/Ice/exceptionsAMD/ThrowerI.java index f4f2f9a1f95..1d301cb6fa7 100644 --- a/java/test/Ice/exceptionsAMD/ThrowerI.java +++ b/java/test/Ice/exceptionsAMD/ThrowerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/exceptionsAMD/build.xml b/java/test/Ice/exceptionsAMD/build.xml index eae0975c4c7..0ef6ec18d95 100644 --- a/java/test/Ice/exceptionsAMD/build.xml +++ b/java/test/Ice/exceptionsAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/AI.java b/java/test/Ice/facets/AI.java index 892ed08de5c..b2257b1f157 100644 --- a/java/test/Ice/facets/AI.java +++ b/java/test/Ice/facets/AI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/AllTests.java b/java/test/Ice/facets/AllTests.java index 8f7ac1ae49e..8cbde31275c 100644 --- a/java/test/Ice/facets/AllTests.java +++ b/java/test/Ice/facets/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/BI.java b/java/test/Ice/facets/BI.java index 3e5c3a903c7..8856d27b8a5 100644 --- a/java/test/Ice/facets/BI.java +++ b/java/test/Ice/facets/BI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/CI.java b/java/test/Ice/facets/CI.java index 861c8d02470..c3adef35457 100644 --- a/java/test/Ice/facets/CI.java +++ b/java/test/Ice/facets/CI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/Client.java b/java/test/Ice/facets/Client.java index b687781fc16..9d3aa8b0dbe 100644 --- a/java/test/Ice/facets/Client.java +++ b/java/test/Ice/facets/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/Collocated.java b/java/test/Ice/facets/Collocated.java index db1d30d8eec..e8c67da936b 100644 --- a/java/test/Ice/facets/Collocated.java +++ b/java/test/Ice/facets/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/DI.java b/java/test/Ice/facets/DI.java index c99b04d236f..023c5381e17 100644 --- a/java/test/Ice/facets/DI.java +++ b/java/test/Ice/facets/DI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/EI.java b/java/test/Ice/facets/EI.java index acdebf738d5..781f7e17e70 100644 --- a/java/test/Ice/facets/EI.java +++ b/java/test/Ice/facets/EI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/EmptyI.java b/java/test/Ice/facets/EmptyI.java index 5e808104d78..9b218e6e3a6 100644 --- a/java/test/Ice/facets/EmptyI.java +++ b/java/test/Ice/facets/EmptyI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/FI.java b/java/test/Ice/facets/FI.java index 5c4bad11ee4..75e76b62d32 100644 --- a/java/test/Ice/facets/FI.java +++ b/java/test/Ice/facets/FI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/GI.java b/java/test/Ice/facets/GI.java index 803df94b004..182a141e4f6 100644 --- a/java/test/Ice/facets/GI.java +++ b/java/test/Ice/facets/GI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/HI.java b/java/test/Ice/facets/HI.java index 0eb923293c5..9aac3f47f98 100644 --- a/java/test/Ice/facets/HI.java +++ b/java/test/Ice/facets/HI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/Server.java b/java/test/Ice/facets/Server.java index 19f771f3642..f4921b1ee5e 100644 --- a/java/test/Ice/facets/Server.java +++ b/java/test/Ice/facets/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/Test.ice b/java/test/Ice/facets/Test.ice index d02ab6c8503..8d3739dac91 100644 --- a/java/test/Ice/facets/Test.ice +++ b/java/test/Ice/facets/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/build.xml b/java/test/Ice/facets/build.xml index 8a71c17e579..ae3dc75a67b 100644 --- a/java/test/Ice/facets/build.xml +++ b/java/test/Ice/facets/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/facets/run.py b/java/test/Ice/facets/run.py index 2e620209daf..545214a74c7 100755 --- a/java/test/Ice/facets/run.py +++ b/java/test/Ice/facets/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "facets") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/java/test/Ice/faultTolerance/AllTests.java b/java/test/Ice/faultTolerance/AllTests.java index a59dc510b2f..164291eaa38 100644 --- a/java/test/Ice/faultTolerance/AllTests.java +++ b/java/test/Ice/faultTolerance/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/Client.java b/java/test/Ice/faultTolerance/Client.java index 5c92ce9ee93..1f23a773477 100644 --- a/java/test/Ice/faultTolerance/Client.java +++ b/java/test/Ice/faultTolerance/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/Server.java b/java/test/Ice/faultTolerance/Server.java index 3adb4439fe7..9c02303346c 100644 --- a/java/test/Ice/faultTolerance/Server.java +++ b/java/test/Ice/faultTolerance/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/Test.ice b/java/test/Ice/faultTolerance/Test.ice index 2b22a369bb5..fc1881aaf43 100644 --- a/java/test/Ice/faultTolerance/Test.ice +++ b/java/test/Ice/faultTolerance/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/TestI.java b/java/test/Ice/faultTolerance/TestI.java index b1eeb493b6b..3c705235c49 100644 --- a/java/test/Ice/faultTolerance/TestI.java +++ b/java/test/Ice/faultTolerance/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/build.xml b/java/test/Ice/faultTolerance/build.xml index db33c14c070..5c538d60212 100644 --- a/java/test/Ice/faultTolerance/build.xml +++ b/java/test/Ice/faultTolerance/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/faultTolerance/run.py b/java/test/Ice/faultTolerance/run.py index dc00f62f71e..19eae076894 100755 --- a/java/test/Ice/faultTolerance/run.py +++ b/java/test/Ice/faultTolerance/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,42 +10,34 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "faultTolerance") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) num = 12 base = 12340 +serverProc = [] for i in range(0, num): print "starting server #%d..." % (i + 1), - serverPipe = TestUtil.startServer("Server", " %d" % (base + i) + " 2>&1") - TestUtil.getAdapterReady(serverPipe) + serverProc.append(TestUtil.startServer("Server", " %d" % (base + i))) print "ok" ports = "" for i in range(0, num): ports = "%s %d" % (ports, base + i) print "starting client...", -clientPipe = TestUtil.startClient("Client", ports + " 2>&1") +clientProc = TestUtil.startClient("Client", ports) print "ok" -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus or TestUtil.serverStatus(): - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() +for p in serverProc: + p.waitTestSuccess() diff --git a/java/test/Ice/hold/AllTests.java b/java/test/Ice/hold/AllTests.java index 6688d9a37b9..cf13c6d2899 100644 --- a/java/test/Ice/hold/AllTests.java +++ b/java/test/Ice/hold/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/Client.java b/java/test/Ice/hold/Client.java index 9d3ce43b832..d3d83f8fe8c 100644 --- a/java/test/Ice/hold/Client.java +++ b/java/test/Ice/hold/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/HoldI.java b/java/test/Ice/hold/HoldI.java index d4fd14c3a6a..2e60e309c5c 100644 --- a/java/test/Ice/hold/HoldI.java +++ b/java/test/Ice/hold/HoldI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/Server.java b/java/test/Ice/hold/Server.java index 8f5e88cdd6c..650321b68ae 100644 --- a/java/test/Ice/hold/Server.java +++ b/java/test/Ice/hold/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/Test.ice b/java/test/Ice/hold/Test.ice index f5f84f390e8..153c5c6d0e8 100644 --- a/java/test/Ice/hold/Test.ice +++ b/java/test/Ice/hold/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/build.xml b/java/test/Ice/hold/build.xml index e4fe3405e55..44d27afd443 100644 --- a/java/test/Ice/hold/build.xml +++ b/java/test/Ice/hold/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/hold/run.py b/java/test/Ice/hold/run.py index 3aad16bf8fe..bb34e7d35b7 100755 --- a/java/test/Ice/hold/run.py +++ b/java/test/Ice/hold/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,20 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "hold") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/inheritance/AllTests.java b/java/test/Ice/inheritance/AllTests.java index b917995b153..fac185f4919 100644 --- a/java/test/Ice/inheritance/AllTests.java +++ b/java/test/Ice/inheritance/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/CAI.java b/java/test/Ice/inheritance/CAI.java index ab8031c4b8a..0015cceb632 100644 --- a/java/test/Ice/inheritance/CAI.java +++ b/java/test/Ice/inheritance/CAI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/CBI.java b/java/test/Ice/inheritance/CBI.java index 6ba5119a056..aad89291609 100644 --- a/java/test/Ice/inheritance/CBI.java +++ b/java/test/Ice/inheritance/CBI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/CCI.java b/java/test/Ice/inheritance/CCI.java index 769fbf229d5..6845f844095 100644 --- a/java/test/Ice/inheritance/CCI.java +++ b/java/test/Ice/inheritance/CCI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/CDI.java b/java/test/Ice/inheritance/CDI.java index 7f1e5412328..e3280bc6676 100644 --- a/java/test/Ice/inheritance/CDI.java +++ b/java/test/Ice/inheritance/CDI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/Client.java b/java/test/Ice/inheritance/Client.java index b3eb0bb1e5f..533d9bf673d 100644 --- a/java/test/Ice/inheritance/Client.java +++ b/java/test/Ice/inheritance/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/Collocated.java b/java/test/Ice/inheritance/Collocated.java index f11dfb03ff5..83dffe112d3 100644 --- a/java/test/Ice/inheritance/Collocated.java +++ b/java/test/Ice/inheritance/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/IAI.java b/java/test/Ice/inheritance/IAI.java index f0e28266d57..328b0340a60 100644 --- a/java/test/Ice/inheritance/IAI.java +++ b/java/test/Ice/inheritance/IAI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/IB1I.java b/java/test/Ice/inheritance/IB1I.java index 419d79fbc57..40c5bbe1074 100644 --- a/java/test/Ice/inheritance/IB1I.java +++ b/java/test/Ice/inheritance/IB1I.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/IB2I.java b/java/test/Ice/inheritance/IB2I.java index 0245376c58b..88b0aa89291 100644 --- a/java/test/Ice/inheritance/IB2I.java +++ b/java/test/Ice/inheritance/IB2I.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/ICI.java b/java/test/Ice/inheritance/ICI.java index ce08108ec51..b940ee6719b 100644 --- a/java/test/Ice/inheritance/ICI.java +++ b/java/test/Ice/inheritance/ICI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/InitialI.java b/java/test/Ice/inheritance/InitialI.java index 86453613e28..5a64df870af 100644 --- a/java/test/Ice/inheritance/InitialI.java +++ b/java/test/Ice/inheritance/InitialI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/Server.java b/java/test/Ice/inheritance/Server.java index 5a4a8629a4b..dddf46b6296 100644 --- a/java/test/Ice/inheritance/Server.java +++ b/java/test/Ice/inheritance/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/Test.ice b/java/test/Ice/inheritance/Test.ice index e4dc78a89f5..a93a2bfb330 100644 --- a/java/test/Ice/inheritance/Test.ice +++ b/java/test/Ice/inheritance/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/build.xml b/java/test/Ice/inheritance/build.xml index 4d6ff79cdcc..a21fb17af29 100644 --- a/java/test/Ice/inheritance/build.xml +++ b/java/test/Ice/inheritance/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/inheritance/run.py b/java/test/Ice/inheritance/run.py index 9ec103a4045..545214a74c7 100755 --- a/java/test/Ice/inheritance/run.py +++ b/java/test/Ice/inheritance/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "inheritance") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/java/test/Ice/interceptor/AMDInterceptorI.java b/java/test/Ice/interceptor/AMDInterceptorI.java index 42575602b7b..1a084088a0e 100644 --- a/java/test/Ice/interceptor/AMDInterceptorI.java +++ b/java/test/Ice/interceptor/AMDInterceptorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/Client.java b/java/test/Ice/interceptor/Client.java index c2544d51fcc..c8147e586f5 100644 --- a/java/test/Ice/interceptor/Client.java +++ b/java/test/Ice/interceptor/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/InterceptorI.java b/java/test/Ice/interceptor/InterceptorI.java index 29829c0d4cc..4485c176f41 100644 --- a/java/test/Ice/interceptor/InterceptorI.java +++ b/java/test/Ice/interceptor/InterceptorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/MyObjectI.java b/java/test/Ice/interceptor/MyObjectI.java index a4d59b0d5a6..5423e0837fd 100644 --- a/java/test/Ice/interceptor/MyObjectI.java +++ b/java/test/Ice/interceptor/MyObjectI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/Test.ice b/java/test/Ice/interceptor/Test.ice index 129779d5470..6d6873a9df4 100644 --- a/java/test/Ice/interceptor/Test.ice +++ b/java/test/Ice/interceptor/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/build.xml b/java/test/Ice/interceptor/build.xml index b3a17492919..a59357586d0 100644 --- a/java/test/Ice/interceptor/build.xml +++ b/java/test/Ice/interceptor/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/interceptor/run.py b/java/test/Ice/interceptor/run.py index 432b50875e2..bd197e05b8f 100755 --- a/java/test/Ice/interceptor/run.py +++ b/java/test/Ice/interceptor/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,30 +10,20 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "interceptor") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) print "starting client...", -clientPipe = TestUtil.startClient("Client", "--Ice.Warn.Dispatch=0") +clientProc = TestUtil.startClient("Client", "--Ice.Warn.Dispatch=0") print "ok" -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() diff --git a/java/test/Ice/location/AllTests.java b/java/test/Ice/location/AllTests.java index a6c6f5e948c..89541829ab9 100644 --- a/java/test/Ice/location/AllTests.java +++ b/java/test/Ice/location/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -26,9 +26,13 @@ public class AllTests ServerManagerPrx manager = ServerManagerPrxHelper.checkedCast( communicator.stringToProxy("ServerManager :default -t 10000 -p 12010")); test(manager != null); + TestLocatorPrx locator = TestLocatorPrxHelper.uncheckedCast(communicator.getDefaultLocator()); test(locator != null); + TestLocatorRegistryPrx registry = TestLocatorRegistryPrxHelper.checkedCast(locator.getRegistry()); + test(registry != null); + System.out.print("testing stringToProxy... "); System.out.flush(); Ice.ObjectPrx base = communicator.stringToProxy("test @ TestAdapter"); @@ -285,6 +289,7 @@ public class AllTests System.out.print("testing proxy from server... "); System.out.flush(); + obj = TestIntfPrxHelper.checkedCast(communicator.stringToProxy("test@TestAdapter")); HelloPrx hello = obj.getHello(); test(hello.ice_getAdapterId().equals("TestAdapter")); hello = obj.getReplicatedHello(); @@ -292,8 +297,342 @@ public class AllTests hello.sayHello(); System.out.println("ok"); + System.out.print("testing locator request queuing... "); + System.out.flush(); + hello = (HelloPrx)obj.getReplicatedHello().ice_locatorCacheTimeout(0).ice_connectionCached(false); + count = locator.getRequestCount(); + hello.ice_ping(); + test(++count == locator.getRequestCount()); + for(int i = 0; i < 1000; i++) + { + class AMICallback extends Test.AMI_Hello_sayHello + { + public void + ice_exception(Ice.LocalException ex) + { + test(false); + } + + public void + ice_response() + { + } + }; + hello.sayHello_async(new AMICallback()); + } + test(locator.getRequestCount() > count && locator.getRequestCount() < count + 500); + count = locator.getRequestCount(); + hello = (HelloPrx)hello.ice_adapterId("unknown"); + for(int i = 0; i < 1000; i++) + { + class AMICallback extends Test.AMI_Hello_sayHello + { + public void + ice_exception(Ice.LocalException ex) + { + test(ex instanceof Ice.NotRegisteredException); + } + + public void + ice_response() + { + test(false); + } + }; + hello.sayHello_async(new AMICallback()); + } + test(locator.getRequestCount() > count && locator.getRequestCount() < count + 500); + System.out.println("ok"); + + System.out.print("testing adapter locator cache... "); + System.out.flush(); + try + { + communicator.stringToProxy("test@TestAdapter3").ice_ping(); + test(false); + } + catch(Ice.NotRegisteredException ex) + { + test(ex.kindOfObject == "object adapter"); + test(ex.id.equals("TestAdapter3")); + } + try + { + registry.setAdapterDirectProxy("TestAdapter3", locator.findAdapterById("TestAdapter")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + try + { + communicator.stringToProxy("test@TestAdapter3").ice_ping(); + try + { + registry.setAdapterDirectProxy("TestAdapter3", communicator.stringToProxy("dummy:tcp")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + communicator.stringToProxy("test@TestAdapter3").ice_ping(); + } + catch(Ice.LocalException ex) + { + test(false); + } + + try + { + communicator.stringToProxy("test@TestAdapter3").ice_locatorCacheTimeout(0).ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + try + { + communicator.stringToProxy("test@TestAdapter3").ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + try + { + registry.setAdapterDirectProxy("TestAdapter3", locator.findAdapterById("TestAdapter")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + try + { + communicator.stringToProxy("test@TestAdapter3").ice_ping(); + } + catch(Ice.LocalException ex) + { + test(false); + } + System.out.println("ok"); + + System.out.print("testing well-known object locator cache... "); + System.out.flush(); + registry.addObject(communicator.stringToProxy("test3@TestUnknown")); + try + { + communicator.stringToProxy("test3").ice_ping(); + test(false); + } + catch(Ice.NotRegisteredException ex) + { + test(ex.kindOfObject == "object adapter"); + test(ex.id.equals("TestUnknown")); + } + registry.addObject(communicator.stringToProxy("test3@TestAdapter4")); // Update + try + { + registry.setAdapterDirectProxy("TestAdapter4", communicator.stringToProxy("dummy:tcp")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + + try + { + communicator.stringToProxy("test3").ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + try + { + registry.setAdapterDirectProxy("TestAdapter4", locator.findAdapterById("TestAdapter")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + try + { + communicator.stringToProxy("test3").ice_ping(); + } + catch(Ice.LocalException ex) + { + test(false); + } + + try + { + registry.setAdapterDirectProxy("TestAdapter4", communicator.stringToProxy("dummy:tcp")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + try + { + communicator.stringToProxy("test3").ice_ping(); + } + catch(Ice.LocalException ex) + { + test(false); + } + + try + { + communicator.stringToProxy("test@TestAdapter4").ice_locatorCacheTimeout(0).ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + try + { + communicator.stringToProxy("test@TestAdapter4").ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + try + { + communicator.stringToProxy("test3").ice_ping(); + test(false); + } + catch(Ice.LocalException ex) + { + } + registry.addObject(communicator.stringToProxy("test3@TestAdapter")); + try + { + communicator.stringToProxy("test3").ice_ping(); + } + catch(Ice.LocalException ex) + { + test(false); + } + + registry.addObject(communicator.stringToProxy("test4")); + try + { + communicator.stringToProxy("test4").ice_ping(); + test(false); + } + catch(Ice.NoEndpointException ex) + { + } + System.out.println("ok"); + + System.out.print("testing locator cache background updates... "); + System.out.flush(); + { + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = communicator.getProperties()._clone(); + initData.properties.setProperty("Ice.BackgroundLocatorCacheUpdates", "1"); + Ice.Communicator ic = Ice.Util.initialize(initData); + + try + { + registry.setAdapterDirectProxy("TestAdapter5", locator.findAdapterById("TestAdapter")); + registry.addObject(communicator.stringToProxy("test3@TestAdapter")); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + + count = locator.getRequestCount(); + ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache. + ic.stringToProxy("test3").ice_locatorCacheTimeout(0).ice_ping(); // No locator cache. + count += 3; + test(count == locator.getRequestCount()); + try + { + registry.setAdapterDirectProxy("TestAdapter5", null); + } + catch(Ice.AdapterAlreadyActiveException ex) + { + } + catch(Ice.AdapterNotFoundException ex) + { + } + registry.addObject(communicator.stringToProxy("test3:tcp")); + ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + ic.stringToProxy("test3").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + test(count == locator.getRequestCount()); + try + { + Thread.sleep(1200); + } + catch(InterruptedException ex) + { + } + + // The following requets should trigger the background updates but still use the cached endpoints + // and therefore succeed. + ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + ic.stringToProxy("test3").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + + try + { + while(true) + { + ic.stringToProxy("test@TestAdapter5").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + try + { + Thread.sleep(10); + } + catch(InterruptedException ex) + { + } + } + } + catch(Ice.LocalException ex) + { + // Expected to fail once they endpoints have been updated in the background. + } + try + { + while(true) + { + ic.stringToProxy("test3").ice_locatorCacheTimeout(1).ice_ping(); // 1s timeout. + try + { + Thread.sleep(10); + } + catch(InterruptedException ex) + { + } + } + } + catch(Ice.LocalException ex) + { + // Expected to fail once they endpoints have been updated in the background. + } + ic.destroy(); + } + System.out.println("ok"); + System.out.print("testing proxy from server after shutdown... "); System.out.flush(); + hello = obj.getReplicatedHello(); obj.shutdown(); manager.startServer(); hello.sayHello(); @@ -328,8 +667,6 @@ public class AllTests properties.setProperty("Ice.PrintAdapterReady", "0"); Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("Hello", "default"); adapter.setLocator(locator); - TestLocatorRegistryPrx registry = TestLocatorRegistryPrxHelper.checkedCast(locator.getRegistry()); - test(registry != null); Ice.Identity id = new Ice.Identity(); id.name = Ice.Util.generateUUID(); diff --git a/java/test/Ice/location/Client.java b/java/test/Ice/location/Client.java index 1f8a0ce8caa..48bfac8df5a 100644 --- a/java/test/Ice/location/Client.java +++ b/java/test/Ice/location/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/HelloI.java b/java/test/Ice/location/HelloI.java index 6b6a5384c0d..e0609bee468 100644 --- a/java/test/Ice/location/HelloI.java +++ b/java/test/Ice/location/HelloI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/Server.java b/java/test/Ice/location/Server.java index c4f6a30f3ac..125bb514487 100644 --- a/java/test/Ice/location/Server.java +++ b/java/test/Ice/location/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/ServerLocator.java b/java/test/Ice/location/ServerLocator.java index ad339a135cd..644af6227dc 100644 --- a/java/test/Ice/location/ServerLocator.java +++ b/java/test/Ice/location/ServerLocator.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/ServerLocatorRegistry.java b/java/test/Ice/location/ServerLocatorRegistry.java index a8c99fd02a2..7430c319a76 100644 --- a/java/test/Ice/location/ServerLocatorRegistry.java +++ b/java/test/Ice/location/ServerLocatorRegistry.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -13,7 +13,14 @@ public class ServerLocatorRegistry extends Test._TestLocatorRegistryDisp setAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setAdapterDirectProxy cb, String adapter, Ice.ObjectPrx object, Ice.Current current) { - _adapters.put(adapter, object); + if(object != null) + { + _adapters.put(adapter, object); + } + else + { + _adapters.remove(adapter); + } cb.ice_response(); } @@ -21,8 +28,16 @@ public class ServerLocatorRegistry extends Test._TestLocatorRegistryDisp setReplicatedAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb, String adapter, String replica, Ice.ObjectPrx object, Ice.Current current) { - _adapters.put(adapter, object); - _adapters.put(replica, object); + if(object != null) + { + _adapters.put(adapter, object); + _adapters.put(replica, object); + } + else + { + _adapters.remove(adapter); + _adapters.remove(replica); + } cb.ice_response(); } diff --git a/java/test/Ice/location/ServerManagerI.java b/java/test/Ice/location/ServerManagerI.java index d863de85876..197b8abbe42 100644 --- a/java/test/Ice/location/ServerManagerI.java +++ b/java/test/Ice/location/ServerManagerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -59,7 +59,8 @@ public class ServerManagerI extends _ServerManagerDisp Ice.Object object = new TestI(adapter, adapter2, _registry); _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test"))); _registry.addObject(adapter.add(object, serverCommunicator.stringToIdentity("test2"))); - + adapter.add(object, serverCommunicator.stringToIdentity("test3")); + adapter.activate(); adapter2.activate(); } diff --git a/java/test/Ice/location/Test.ice b/java/test/Ice/location/Test.ice index 7c5b19c9097..4291d0a7f81 100644 --- a/java/test/Ice/location/Test.ice +++ b/java/test/Ice/location/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -39,7 +39,7 @@ interface ServerManager interface Hello { - void sayHello(); + ["ami"] void sayHello(); }; interface TestIntf diff --git a/java/test/Ice/location/TestI.java b/java/test/Ice/location/TestI.java index 423ab9517da..7b3580627d3 100644 --- a/java/test/Ice/location/TestI.java +++ b/java/test/Ice/location/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/build.xml b/java/test/Ice/location/build.xml index 8cf31c0fe39..c69bd3da1ec 100644 --- a/java/test/Ice/location/build.xml +++ b/java/test/Ice/location/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/location/run.py b/java/test/Ice/location/run.py index b2271b88770..bb34e7d35b7 100755 --- a/java/test/Ice/location/run.py +++ b/java/test/Ice/location/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,20 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "location") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.mixedClientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/objects/AllTests.java b/java/test/Ice/objects/AllTests.java index b82ec2fccd7..57adfb6358a 100644 --- a/java/test/Ice/objects/AllTests.java +++ b/java/test/Ice/objects/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/BI.java b/java/test/Ice/objects/BI.java index 4506aeb2e40..b436cb27022 100644 --- a/java/test/Ice/objects/BI.java +++ b/java/test/Ice/objects/BI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/CI.java b/java/test/Ice/objects/CI.java index f033bc32e2d..f97aed7a5d6 100644 --- a/java/test/Ice/objects/CI.java +++ b/java/test/Ice/objects/CI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/Client.java b/java/test/Ice/objects/Client.java index 82d97f51d69..3c7bc1cd9f8 100644 --- a/java/test/Ice/objects/Client.java +++ b/java/test/Ice/objects/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/Collocated.java b/java/test/Ice/objects/Collocated.java index db6beba2f89..2a9180c20b8 100644 --- a/java/test/Ice/objects/Collocated.java +++ b/java/test/Ice/objects/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/DI.java b/java/test/Ice/objects/DI.java index 59fdb6becfb..0baa4a1cb41 100644 --- a/java/test/Ice/objects/DI.java +++ b/java/test/Ice/objects/DI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/EI.java b/java/test/Ice/objects/EI.java index f71f4036ff7..909db53275b 100644 --- a/java/test/Ice/objects/EI.java +++ b/java/test/Ice/objects/EI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/FI.java b/java/test/Ice/objects/FI.java index f2f183c1c3d..9e9a8cd8ecc 100644 --- a/java/test/Ice/objects/FI.java +++ b/java/test/Ice/objects/FI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/HI.java b/java/test/Ice/objects/HI.java index 4a3866fb067..489245ba105 100644 --- a/java/test/Ice/objects/HI.java +++ b/java/test/Ice/objects/HI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/II.java b/java/test/Ice/objects/II.java index 52c0aaac6c2..c1f51a857a7 100644 --- a/java/test/Ice/objects/II.java +++ b/java/test/Ice/objects/II.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/InitialI.java b/java/test/Ice/objects/InitialI.java index 7a7a30ae30a..212eaa8ba12 100644 --- a/java/test/Ice/objects/InitialI.java +++ b/java/test/Ice/objects/InitialI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/JI.java b/java/test/Ice/objects/JI.java index f770ad4d57d..58226b30812 100644 --- a/java/test/Ice/objects/JI.java +++ b/java/test/Ice/objects/JI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/Server.java b/java/test/Ice/objects/Server.java index d2166ed456b..9cd53d0bf12 100644 --- a/java/test/Ice/objects/Server.java +++ b/java/test/Ice/objects/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/Test.ice b/java/test/Ice/objects/Test.ice index 93f3be79909..8c31358574c 100644 --- a/java/test/Ice/objects/Test.ice +++ b/java/test/Ice/objects/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java index 08d8f59e7f0..bdb54b6867e 100644 --- a/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java +++ b/java/test/Ice/objects/UnexpectedObjectExceptionTestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/build.xml b/java/test/Ice/objects/build.xml index 8a2080c3b67..1e4d16935c6 100644 --- a/java/test/Ice/objects/build.xml +++ b/java/test/Ice/objects/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/objects/run.py b/java/test/Ice/objects/run.py index ec17ac79ecf..545214a74c7 100755 --- a/java/test/Ice/objects/run.py +++ b/java/test/Ice/objects/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,15 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "objects") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -TestUtil.collocatedTest(name) -sys.exit(0) +TestUtil.clientServerTest() +TestUtil.collocatedTest() diff --git a/java/test/Ice/operations/AllTests.java b/java/test/Ice/operations/AllTests.java index 4297a4b839b..8cc57b7f92b 100644 --- a/java/test/Ice/operations/AllTests.java +++ b/java/test/Ice/operations/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/BatchOneways.java b/java/test/Ice/operations/BatchOneways.java index 69d54b6942e..cd36c0df159 100644 --- a/java/test/Ice/operations/BatchOneways.java +++ b/java/test/Ice/operations/BatchOneways.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Client.java b/java/test/Ice/operations/Client.java index 4f8c26c2d55..8b57a5c4189 100644 --- a/java/test/Ice/operations/Client.java +++ b/java/test/Ice/operations/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Collocated.java b/java/test/Ice/operations/Collocated.java index b10bff56681..66738685f25 100644 --- a/java/test/Ice/operations/Collocated.java +++ b/java/test/Ice/operations/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/MyDerivedClassI.java b/java/test/Ice/operations/MyDerivedClassI.java index f68c4c11ac0..13ea6a2c086 100644 --- a/java/test/Ice/operations/MyDerivedClassI.java +++ b/java/test/Ice/operations/MyDerivedClassI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Oneways.java b/java/test/Ice/operations/Oneways.java index 4dee1d01354..47a6ecc37dc 100644 --- a/java/test/Ice/operations/Oneways.java +++ b/java/test/Ice/operations/Oneways.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/OnewaysAMI.java b/java/test/Ice/operations/OnewaysAMI.java index 511daf65921..3cc3cc8f1e7 100644 --- a/java/test/Ice/operations/OnewaysAMI.java +++ b/java/test/Ice/operations/OnewaysAMI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Server.java b/java/test/Ice/operations/Server.java index e1766d6a2bd..676ab7a47e4 100644 --- a/java/test/Ice/operations/Server.java +++ b/java/test/Ice/operations/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Test.ice b/java/test/Ice/operations/Test.ice index 6ac0d17e461..447b3c8b17b 100644 --- a/java/test/Ice/operations/Test.ice +++ b/java/test/Ice/operations/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/Twoways.java b/java/test/Ice/operations/Twoways.java index 4e962bb950a..fe316198d93 100644 --- a/java/test/Ice/operations/Twoways.java +++ b/java/test/Ice/operations/Twoways.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/TwowaysAMI.java b/java/test/Ice/operations/TwowaysAMI.java index 7480bf4d10c..2aa9ed11b7d 100644 --- a/java/test/Ice/operations/TwowaysAMI.java +++ b/java/test/Ice/operations/TwowaysAMI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/build.xml b/java/test/Ice/operations/build.xml index cb8f398fb67..48ad1c5562e 100644 --- a/java/test/Ice/operations/build.xml +++ b/java/test/Ice/operations/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operations/run.py b/java/test/Ice/operations/run.py index 84cccf81362..6fee41d3e94 100755 --- a/java/test/Ice/operations/run.py +++ b/java/test/Ice/operations/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,33 +10,24 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "operations") -testdir = os.path.dirname(os.path.abspath(__file__)) -nameAMD = os.path.join("Ice", "operationsAMD") -testdirAMD = testdir + "AMD" +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name, \ - os.path.join(testdirAMD, "classes") + os.pathsep + classpath,\ - os.path.join(testdir, "classes") + os.pathsep + classpath) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "operationsAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) print "tests with collocated server." -TestUtil.collocatedTest(name) - -sys.exit(0) +TestUtil.collocatedTest() diff --git a/java/test/Ice/operationsAMD/MyDerivedClassI.java b/java/test/Ice/operationsAMD/MyDerivedClassI.java index 059c16875fe..8a56485e129 100644 --- a/java/test/Ice/operationsAMD/MyDerivedClassI.java +++ b/java/test/Ice/operationsAMD/MyDerivedClassI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operationsAMD/Server.java b/java/test/Ice/operationsAMD/Server.java index d7cbf2b9833..14189454f1d 100644 --- a/java/test/Ice/operationsAMD/Server.java +++ b/java/test/Ice/operationsAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operationsAMD/TestAMD.ice b/java/test/Ice/operationsAMD/TestAMD.ice index 39d6bcfbed0..6ad25e0be3c 100644 --- a/java/test/Ice/operationsAMD/TestAMD.ice +++ b/java/test/Ice/operationsAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/operationsAMD/build.xml b/java/test/Ice/operationsAMD/build.xml index fa25ed867ad..f85428c5854 100644 --- a/java/test/Ice/operationsAMD/build.xml +++ b/java/test/Ice/operationsAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/AllTests.java b/java/test/Ice/package/AllTests.java index 9ef0b69dafb..97352227889 100644 --- a/java/test/Ice/package/AllTests.java +++ b/java/test/Ice/package/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/Client.java b/java/test/Ice/package/Client.java index 308cbb94dc5..d126c6f4fe5 100644 --- a/java/test/Ice/package/Client.java +++ b/java/test/Ice/package/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/InitialI.java b/java/test/Ice/package/InitialI.java index 4fcbd7220ab..f7d51e629bb 100644 --- a/java/test/Ice/package/InitialI.java +++ b/java/test/Ice/package/InitialI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/NoPackage.ice b/java/test/Ice/package/NoPackage.ice index 10ded9f277c..73e9ad175b6 100644 --- a/java/test/Ice/package/NoPackage.ice +++ b/java/test/Ice/package/NoPackage.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/Package.ice b/java/test/Ice/package/Package.ice index c24362f8096..bc9c0b83361 100644 --- a/java/test/Ice/package/Package.ice +++ b/java/test/Ice/package/Package.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/Server.java b/java/test/Ice/package/Server.java index e7a4f8446cc..8b14a4d713a 100644 --- a/java/test/Ice/package/Server.java +++ b/java/test/Ice/package/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/Test.ice b/java/test/Ice/package/Test.ice index 6cdcd561f1b..8069b3083a2 100644 --- a/java/test/Ice/package/Test.ice +++ b/java/test/Ice/package/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/build.xml b/java/test/Ice/package/build.xml index 23c1f34a293..e037ff089b8 100644 --- a/java/test/Ice/package/build.xml +++ b/java/test/Ice/package/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/package/run.py b/java/test/Ice/package/run.py index f72ab158050..bb34e7d35b7 100755 --- a/java/test/Ice/package/run.py +++ b/java/test/Ice/package/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,20 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "package") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/proxy/AllTests.java b/java/test/Ice/proxy/AllTests.java index b3333ffbc88..2f261bf794a 100644 --- a/java/test/Ice/proxy/AllTests.java +++ b/java/test/Ice/proxy/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/Client.java b/java/test/Ice/proxy/Client.java index 19f41f7f360..62e11df5601 100644 --- a/java/test/Ice/proxy/Client.java +++ b/java/test/Ice/proxy/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/Collocated.java b/java/test/Ice/proxy/Collocated.java index dd865143812..11dc99c01e8 100644 --- a/java/test/Ice/proxy/Collocated.java +++ b/java/test/Ice/proxy/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/MyDerivedClassI.java b/java/test/Ice/proxy/MyDerivedClassI.java index 9a1f0eac2dc..64fb542d69b 100644 --- a/java/test/Ice/proxy/MyDerivedClassI.java +++ b/java/test/Ice/proxy/MyDerivedClassI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/Server.java b/java/test/Ice/proxy/Server.java index 85ef9230478..807bd7f6363 100644 --- a/java/test/Ice/proxy/Server.java +++ b/java/test/Ice/proxy/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/Test.ice b/java/test/Ice/proxy/Test.ice index 61b6b6d06b7..90db7303858 100644 --- a/java/test/Ice/proxy/Test.ice +++ b/java/test/Ice/proxy/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/build.xml b/java/test/Ice/proxy/build.xml index cb8f398fb67..48ad1c5562e 100644 --- a/java/test/Ice/proxy/build.xml +++ b/java/test/Ice/proxy/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxy/run.py b/java/test/Ice/proxy/run.py index 26c6aba7ca0..739d5ae9903 100755 --- a/java/test/Ice/proxy/run.py +++ b/java/test/Ice/proxy/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,33 +10,24 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "proxy") -testdir = os.path.dirname(os.path.abspath(__file__)) -nameAMD = os.path.join("Ice", "proxyAMD") -testdirAMD = testdir + "AMD" +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name,\ - os.path.join(testdirAMD, "classes") + os.pathsep + classpath,\ - os.path.join(testdir, "classes") + os.pathsep + classpath) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "proxyAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) print "tests with collocated server." -TestUtil.collocatedTest(name) - -sys.exit(0) +TestUtil.collocatedTest() diff --git a/java/test/Ice/proxyAMD/MyDerivedClassI.java b/java/test/Ice/proxyAMD/MyDerivedClassI.java index 17b8568ff75..75ff8d685f4 100644 --- a/java/test/Ice/proxyAMD/MyDerivedClassI.java +++ b/java/test/Ice/proxyAMD/MyDerivedClassI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxyAMD/Server.java b/java/test/Ice/proxyAMD/Server.java index d3615833c45..7564f506231 100644 --- a/java/test/Ice/proxyAMD/Server.java +++ b/java/test/Ice/proxyAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxyAMD/TestAMD.ice b/java/test/Ice/proxyAMD/TestAMD.ice index 659041c68e7..0b88c93de99 100644 --- a/java/test/Ice/proxyAMD/TestAMD.ice +++ b/java/test/Ice/proxyAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/proxyAMD/build.xml b/java/test/Ice/proxyAMD/build.xml index fa25ed867ad..f85428c5854 100644 --- a/java/test/Ice/proxyAMD/build.xml +++ b/java/test/Ice/proxyAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/AllTests.java b/java/test/Ice/retry/AllTests.java index bd4be5e91f6..c1c3532132c 100644 --- a/java/test/Ice/retry/AllTests.java +++ b/java/test/Ice/retry/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/Client.java b/java/test/Ice/retry/Client.java index 53d4a927ef6..0a2fad21024 100644 --- a/java/test/Ice/retry/Client.java +++ b/java/test/Ice/retry/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/RetryI.java b/java/test/Ice/retry/RetryI.java index 4126e9a97d7..1f5a2f92c99 100644 --- a/java/test/Ice/retry/RetryI.java +++ b/java/test/Ice/retry/RetryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/Server.java b/java/test/Ice/retry/Server.java index 01492bef5b1..d7c66ff182a 100644 --- a/java/test/Ice/retry/Server.java +++ b/java/test/Ice/retry/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/Test.ice b/java/test/Ice/retry/Test.ice index c82abeb80eb..6a48fa388a3 100644 --- a/java/test/Ice/retry/Test.ice +++ b/java/test/Ice/retry/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/build.xml b/java/test/Ice/retry/build.xml index 207c7ab6e87..bba491f0941 100644 --- a/java/test/Ice/retry/build.xml +++ b/java/test/Ice/retry/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/retry/run.py b/java/test/Ice/retry/run.py index 245f4dd2f87..bb34e7d35b7 100755 --- a/java/test/Ice/retry/run.py +++ b/java/test/Ice/retry/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "retry") -testdir = os.path.dirname(os.path.abspath(__file__)) - -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/servantLocator/AllTests.java b/java/test/Ice/servantLocator/AllTests.java index 7260ec9bcbe..5e56853980d 100644 --- a/java/test/Ice/servantLocator/AllTests.java +++ b/java/test/Ice/servantLocator/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/Client.java b/java/test/Ice/servantLocator/Client.java index 33ae3e1eb00..963c404b88d 100644 --- a/java/test/Ice/servantLocator/Client.java +++ b/java/test/Ice/servantLocator/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/Collocated.java b/java/test/Ice/servantLocator/Collocated.java index a7fe284343a..3a6f7815e6f 100644 --- a/java/test/Ice/servantLocator/Collocated.java +++ b/java/test/Ice/servantLocator/Collocated.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/CookieI.java b/java/test/Ice/servantLocator/CookieI.java index 8e051f40033..46b4fac6e28 100644 --- a/java/test/Ice/servantLocator/CookieI.java +++ b/java/test/Ice/servantLocator/CookieI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/ServantLocatorI.java b/java/test/Ice/servantLocator/ServantLocatorI.java index 4119a40ddb2..aa24bcf5058 100644 --- a/java/test/Ice/servantLocator/ServantLocatorI.java +++ b/java/test/Ice/servantLocator/ServantLocatorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/Server.java b/java/test/Ice/servantLocator/Server.java index 20da5ef0ef1..14cddc3ef54 100644 --- a/java/test/Ice/servantLocator/Server.java +++ b/java/test/Ice/servantLocator/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/Test.ice b/java/test/Ice/servantLocator/Test.ice index a4af79e1c11..5225d2c4331 100644 --- a/java/test/Ice/servantLocator/Test.ice +++ b/java/test/Ice/servantLocator/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/TestI.java b/java/test/Ice/servantLocator/TestI.java index d8a487debc7..eacc1c2e61e 100644 --- a/java/test/Ice/servantLocator/TestI.java +++ b/java/test/Ice/servantLocator/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/build.xml b/java/test/Ice/servantLocator/build.xml index a0c1c47cc43..27ed596c9b5 100644 --- a/java/test/Ice/servantLocator/build.xml +++ b/java/test/Ice/servantLocator/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocator/run.py b/java/test/Ice/servantLocator/run.py index a337928b7e3..08229481f20 100755 --- a/java/test/Ice/servantLocator/run.py +++ b/java/test/Ice/servantLocator/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,38 +10,24 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "servantLocator") -nameAMD = os.path.join("Ice", "servantLocatorAMD") -testdir = os.path.dirname(os.path.abspath(__file__)) -testdirAMD = testdir + "AMD" -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -# -# We need to use mixedClientServerTest so that, when using SSL, the -# server-side SSL configuration properties are defined. This is -# necessary because the client creates object adapters. -# print "tests with regular server." -classpath = os.getenv("CLASSPATH", "") -TestUtil.mixedClientServerTest(name) +TestUtil.clientServerTest() print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name, \ - os.path.join(testdirAMD, "classes") + os.pathsep + classpath,\ - os.path.join(testdir, "classes") + os.pathsep + classpath) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "servantLocatorAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) print "tests with collocated server." -TestUtil.collocatedTest(name) - -sys.exit(0) +TestUtil.collocatedTest() diff --git a/java/test/Ice/servantLocatorAMD/CookieI.java b/java/test/Ice/servantLocatorAMD/CookieI.java index 8e051f40033..46b4fac6e28 100644 --- a/java/test/Ice/servantLocatorAMD/CookieI.java +++ b/java/test/Ice/servantLocatorAMD/CookieI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocatorAMD/ServantLocatorI.java b/java/test/Ice/servantLocatorAMD/ServantLocatorI.java index 4119a40ddb2..aa24bcf5058 100644 --- a/java/test/Ice/servantLocatorAMD/ServantLocatorI.java +++ b/java/test/Ice/servantLocatorAMD/ServantLocatorI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocatorAMD/Server.java b/java/test/Ice/servantLocatorAMD/Server.java index 20da5ef0ef1..14cddc3ef54 100644 --- a/java/test/Ice/servantLocatorAMD/Server.java +++ b/java/test/Ice/servantLocatorAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocatorAMD/TestAMD.ice b/java/test/Ice/servantLocatorAMD/TestAMD.ice index abcc006aa54..b9b23d1173d 100644 --- a/java/test/Ice/servantLocatorAMD/TestAMD.ice +++ b/java/test/Ice/servantLocatorAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocatorAMD/TestI.java b/java/test/Ice/servantLocatorAMD/TestI.java index 39642231676..0441b9b3f68 100644 --- a/java/test/Ice/servantLocatorAMD/TestI.java +++ b/java/test/Ice/servantLocatorAMD/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/servantLocatorAMD/build.xml b/java/test/Ice/servantLocatorAMD/build.xml index 732ca966af4..787833f89e6 100644 --- a/java/test/Ice/servantLocatorAMD/build.xml +++ b/java/test/Ice/servantLocatorAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/build.xml b/java/test/Ice/slicing/build.xml index 5fec44826e2..3f0ee6e0ca0 100644 --- a/java/test/Ice/slicing/build.xml +++ b/java/test/Ice/slicing/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/Test.ice b/java/test/Ice/slicing/exceptions/Test.ice index 599b57fec54..a5918458a6c 100644 --- a/java/test/Ice/slicing/exceptions/Test.ice +++ b/java/test/Ice/slicing/exceptions/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/build.xml b/java/test/Ice/slicing/exceptions/build.xml index 94bcd591be3..f2fd285b42b 100644 --- a/java/test/Ice/slicing/exceptions/build.xml +++ b/java/test/Ice/slicing/exceptions/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -17,9 +17,9 @@ <!-- import common definitions --> <import file="${top.dir}/config/common.xml"/> - <property name="cclass.dir" value="cclasses"/> + <property name="cclass.dir" value="classes"/> <property name="sclass.dir" value="sclasses"/> - <property name="cgen.dir" value="cgenerated"/> + <property name="cgen.dir" value="generated"/> <property name="sgen.dir" value="sgenerated"/> <property name="csrc.dir" value="csrc"/> <property name="ssrc.dir" value="ssrc"/> diff --git a/java/test/Ice/slicing/exceptions/csrc/AllTests.java b/java/test/Ice/slicing/exceptions/csrc/AllTests.java index 773fbe9e7ca..97fc9a0c9e4 100644 --- a/java/test/Ice/slicing/exceptions/csrc/AllTests.java +++ b/java/test/Ice/slicing/exceptions/csrc/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/csrc/Client.java b/java/test/Ice/slicing/exceptions/csrc/Client.java index cd40d91f958..a6bd5eb1c17 100644 --- a/java/test/Ice/slicing/exceptions/csrc/Client.java +++ b/java/test/Ice/slicing/exceptions/csrc/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/run.py b/java/test/Ice/slicing/exceptions/run.py index 237610d7a45..392a127aa5d 100755 --- a/java/test/Ice/slicing/exceptions/run.py +++ b/java/test/Ice/slicing/exceptions/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,26 +10,24 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "slicing", "exceptions") -testdir = os.path.dirname(os.path.abspath(__file__)) -nameAMD = os.path.join("Ice", "slicing", "exceptionsAMD") -testdirAMD = testdir + "AMD" +sys.path.append(os.path.join(path[0])) +from scripts import * print "tests with regular server." -TestUtil.clientServerTestWithClasspath(name, os.path.join(testdir, "sclasses"), os.path.join(testdir, "cclasses")) +import copy +serverenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "sclasses"), serverenv) +TestUtil.clientServerTest(serverenv = serverenv) print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name, os.path.join(testdirAMD, "classes"), os.path.join(testdir, "cclasses")) - -sys.exit(0) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "exceptionsAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) diff --git a/java/test/Ice/slicing/exceptions/ssrc/Server.java b/java/test/Ice/slicing/exceptions/ssrc/Server.java index e75b5a97fa1..6b7c1b84ffa 100644 --- a/java/test/Ice/slicing/exceptions/ssrc/Server.java +++ b/java/test/Ice/slicing/exceptions/ssrc/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/ssrc/ServerPrivate.ice b/java/test/Ice/slicing/exceptions/ssrc/ServerPrivate.ice index 489a184d3e5..e2ae8cb3696 100644 --- a/java/test/Ice/slicing/exceptions/ssrc/ServerPrivate.ice +++ b/java/test/Ice/slicing/exceptions/ssrc/ServerPrivate.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptions/ssrc/TestI.java b/java/test/Ice/slicing/exceptions/ssrc/TestI.java index 1b21a84347f..01647a1708b 100644 --- a/java/test/Ice/slicing/exceptions/ssrc/TestI.java +++ b/java/test/Ice/slicing/exceptions/ssrc/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptionsAMD/Server.java b/java/test/Ice/slicing/exceptionsAMD/Server.java index 93fcfcbf9c4..028930fc8c1 100644 --- a/java/test/Ice/slicing/exceptionsAMD/Server.java +++ b/java/test/Ice/slicing/exceptionsAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice b/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice index 0ec29a0ea91..76f139c79c2 100644 --- a/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice +++ b/java/test/Ice/slicing/exceptionsAMD/ServerPrivateAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice b/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice index c241f17a01d..f878338c995 100644 --- a/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice +++ b/java/test/Ice/slicing/exceptionsAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptionsAMD/TestI.java b/java/test/Ice/slicing/exceptionsAMD/TestI.java index 815ccc43880..b6ef7eb5c6f 100644 --- a/java/test/Ice/slicing/exceptionsAMD/TestI.java +++ b/java/test/Ice/slicing/exceptionsAMD/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/exceptionsAMD/build.xml b/java/test/Ice/slicing/exceptionsAMD/build.xml index 76988d22f8a..26bb8d5e6bb 100644 --- a/java/test/Ice/slicing/exceptionsAMD/build.xml +++ b/java/test/Ice/slicing/exceptionsAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/Forward.ice b/java/test/Ice/slicing/objects/Forward.ice index b589b897152..1c48e3ff480 100644 --- a/java/test/Ice/slicing/objects/Forward.ice +++ b/java/test/Ice/slicing/objects/Forward.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/Test.ice b/java/test/Ice/slicing/objects/Test.ice index 0ce49886fc9..2fa79937f53 100644 --- a/java/test/Ice/slicing/objects/Test.ice +++ b/java/test/Ice/slicing/objects/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/build.xml b/java/test/Ice/slicing/objects/build.xml index 4a0ae963e61..2dc899785f0 100644 --- a/java/test/Ice/slicing/objects/build.xml +++ b/java/test/Ice/slicing/objects/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -17,9 +17,9 @@ <!-- import common definitions --> <import file="${top.dir}/config/common.xml"/> - <property name="cclass.dir" value="cclasses"/> + <property name="cclass.dir" value="classes"/> <property name="sclass.dir" value="sclasses"/> - <property name="cgen.dir" value="cgenerated"/> + <property name="cgen.dir" value="generated"/> <property name="sgen.dir" value="sgenerated"/> <property name="csrc.dir" value="csrc"/> <property name="ssrc.dir" value="ssrc"/> diff --git a/java/test/Ice/slicing/objects/csrc/AllTests.java b/java/test/Ice/slicing/objects/csrc/AllTests.java index aae82d50ccf..ab0c45dc5d2 100644 --- a/java/test/Ice/slicing/objects/csrc/AllTests.java +++ b/java/test/Ice/slicing/objects/csrc/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -1471,8 +1471,8 @@ public class AllTests System.out.print("return value identity for input params known first... "); System.out.flush(); { - try - { + //try + //{ D1 d1 = new D1(); d1.sb = "D1.sb"; d1.sd1 = "D1.sd1"; @@ -1512,11 +1512,11 @@ public class AllTests test(b1 != d3); test(b2 != d1); test(b2 != d3); - } - catch(Exception ex) - { - test(false); - } + //} + //catch(Exception ex) + //{ + //test(false); + //} } System.out.println("ok"); diff --git a/java/test/Ice/slicing/objects/csrc/Client.java b/java/test/Ice/slicing/objects/csrc/Client.java index cd40d91f958..a6bd5eb1c17 100644 --- a/java/test/Ice/slicing/objects/csrc/Client.java +++ b/java/test/Ice/slicing/objects/csrc/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/csrc/ClientPrivate.ice b/java/test/Ice/slicing/objects/csrc/ClientPrivate.ice index 1b8b26e1988..aaadf4bb9a2 100644 --- a/java/test/Ice/slicing/objects/csrc/ClientPrivate.ice +++ b/java/test/Ice/slicing/objects/csrc/ClientPrivate.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/run.py b/java/test/Ice/slicing/objects/run.py index 5b834e189ff..5d357e042ef 100755 --- a/java/test/Ice/slicing/objects/run.py +++ b/java/test/Ice/slicing/objects/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,26 +10,27 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "slicing", "objects") -testdir = os.path.dirname(os.path.abspath(__file__)) -nameAMD = os.path.join("Ice", "slicing", "objectsAMD") -testdirAMD = testdir + "AMD" +testdir = os.getcwd() +testdirAMD = os.path.join(testdir, "..", "objectsAMD", "classes") print "tests with regular server." -TestUtil.clientServerTestWithClasspath(name, os.path.join(testdir, "sclasses"), os.path.join(testdir, "cclasses")) +import copy +serverenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "sclasses"), serverenv) +TestUtil.clientServerTest(serverenv = serverenv) print "tests with AMD server." -TestUtil.clientServerTestWithClasspath(name, os.path.join(testdirAMD, "classes"), os.path.join(testdir, "cclasses")) - -sys.exit(0) +import copy +amdenv = copy.deepcopy(os.environ) +TestUtil.addClasspath(os.path.join(os.getcwd(), "..", "objectsAMD", "classes"), amdenv) +TestUtil.clientServerTest(serverenv = amdenv) diff --git a/java/test/Ice/slicing/objects/ssrc/Server.java b/java/test/Ice/slicing/objects/ssrc/Server.java index e75b5a97fa1..6b7c1b84ffa 100644 --- a/java/test/Ice/slicing/objects/ssrc/Server.java +++ b/java/test/Ice/slicing/objects/ssrc/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/ssrc/ServerPrivate.ice b/java/test/Ice/slicing/objects/ssrc/ServerPrivate.ice index 95ceaa7f750..2f4189919c4 100644 --- a/java/test/Ice/slicing/objects/ssrc/ServerPrivate.ice +++ b/java/test/Ice/slicing/objects/ssrc/ServerPrivate.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objects/ssrc/TestI.java b/java/test/Ice/slicing/objects/ssrc/TestI.java index b9e324c0aec..94b313cdcac 100644 --- a/java/test/Ice/slicing/objects/ssrc/TestI.java +++ b/java/test/Ice/slicing/objects/ssrc/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/Forward.ice b/java/test/Ice/slicing/objectsAMD/Forward.ice index b589b897152..1c48e3ff480 100644 --- a/java/test/Ice/slicing/objectsAMD/Forward.ice +++ b/java/test/Ice/slicing/objectsAMD/Forward.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/Server.java b/java/test/Ice/slicing/objectsAMD/Server.java index 93fcfcbf9c4..028930fc8c1 100644 --- a/java/test/Ice/slicing/objectsAMD/Server.java +++ b/java/test/Ice/slicing/objectsAMD/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/ServerPrivateAMD.ice b/java/test/Ice/slicing/objectsAMD/ServerPrivateAMD.ice index 3112495277f..18265cf711c 100644 --- a/java/test/Ice/slicing/objectsAMD/ServerPrivateAMD.ice +++ b/java/test/Ice/slicing/objectsAMD/ServerPrivateAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/TestAMD.ice b/java/test/Ice/slicing/objectsAMD/TestAMD.ice index 96fa308cc7f..f9d187d345b 100644 --- a/java/test/Ice/slicing/objectsAMD/TestAMD.ice +++ b/java/test/Ice/slicing/objectsAMD/TestAMD.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/TestI.java b/java/test/Ice/slicing/objectsAMD/TestI.java index 79a0eafb1ad..429126886cc 100644 --- a/java/test/Ice/slicing/objectsAMD/TestI.java +++ b/java/test/Ice/slicing/objectsAMD/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/slicing/objectsAMD/build.xml b/java/test/Ice/slicing/objectsAMD/build.xml index 1dde26a0af6..aaaacfe8ec9 100644 --- a/java/test/Ice/slicing/objectsAMD/build.xml +++ b/java/test/Ice/slicing/objectsAMD/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/stream/Client.java b/java/test/Ice/stream/Client.java index 437eb3e6559..8c1993fc612 100644 --- a/java/test/Ice/stream/Client.java +++ b/java/test/Ice/stream/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/stream/Test.ice b/java/test/Ice/stream/Test.ice index 880c83444ee..dafd2f02d41 100644 --- a/java/test/Ice/stream/Test.ice +++ b/java/test/Ice/stream/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/stream/build.xml b/java/test/Ice/stream/build.xml index c98bcaa505b..f3283a483ba 100644 --- a/java/test/Ice/stream/build.xml +++ b/java/test/Ice/stream/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/stream/run.py b/java/test/Ice/stream/run.py index 09be18dd69f..2ba8e124049 100755 --- a/java/test/Ice/stream/run.py +++ b/java/test/Ice/stream/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,31 +10,20 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "stream") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) print "starting test...", -clientPipe = TestUtil.startClient("Client"," 2>&1") +clientProc = TestUtil.startClient("Client") print "ok" -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - TestUtil.killServers() - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() diff --git a/java/test/Ice/timeout/AllTests.java b/java/test/Ice/timeout/AllTests.java index 8661fa1634c..73cf9dffb5c 100644 --- a/java/test/Ice/timeout/AllTests.java +++ b/java/test/Ice/timeout/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/Client.java b/java/test/Ice/timeout/Client.java index 231e5ec929d..ef685123ac0 100644 --- a/java/test/Ice/timeout/Client.java +++ b/java/test/Ice/timeout/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/Server.java b/java/test/Ice/timeout/Server.java index b73538ff5cd..503094829f8 100644 --- a/java/test/Ice/timeout/Server.java +++ b/java/test/Ice/timeout/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/Test.ice b/java/test/Ice/timeout/Test.ice index 82531c5901e..4ba0c07ab71 100644 --- a/java/test/Ice/timeout/Test.ice +++ b/java/test/Ice/timeout/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/TimeoutI.java b/java/test/Ice/timeout/TimeoutI.java index 870955fb74f..90ce2283c81 100644 --- a/java/test/Ice/timeout/TimeoutI.java +++ b/java/test/Ice/timeout/TimeoutI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/build.xml b/java/test/Ice/timeout/build.xml index 78ca69759fe..56880b609e8 100644 --- a/java/test/Ice/timeout/build.xml +++ b/java/test/Ice/timeout/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/timeout/run.py b/java/test/Ice/timeout/run.py index 57729b5145a..bb34e7d35b7 100755 --- a/java/test/Ice/timeout/run.py +++ b/java/test/Ice/timeout/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,14 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Ice", "timeout") -testdir = os.path.dirname(os.path.abspath(__file__)) - -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTest(name) -sys.exit(0) +TestUtil.clientServerTest() diff --git a/java/test/Ice/translator/DoubleModuleNoPackage.ice b/java/test/Ice/translator/DoubleModuleNoPackage.ice index ac2f2ac8de1..55fdca2afe8 100644 --- a/java/test/Ice/translator/DoubleModuleNoPackage.ice +++ b/java/test/Ice/translator/DoubleModuleNoPackage.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/DoubleModuleWithPackage.ice b/java/test/Ice/translator/DoubleModuleWithPackage.ice index d50dc96f465..46e5bd725b8 100644 --- a/java/test/Ice/translator/DoubleModuleWithPackage.ice +++ b/java/test/Ice/translator/DoubleModuleWithPackage.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/SingleModuleNoPackage.ice b/java/test/Ice/translator/SingleModuleNoPackage.ice index c8e5c6dda78..22bca04ec60 100644 --- a/java/test/Ice/translator/SingleModuleNoPackage.ice +++ b/java/test/Ice/translator/SingleModuleNoPackage.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/SingleModuleWithPackage.ice b/java/test/Ice/translator/SingleModuleWithPackage.ice index d0d528c7eb7..06baf978125 100644 --- a/java/test/Ice/translator/SingleModuleWithPackage.ice +++ b/java/test/Ice/translator/SingleModuleWithPackage.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleNoPackage4.ice b/java/test/Ice/translator/TestDoubleModuleNoPackage4.ice index f115bbabbef..9e6dac7596b 100644 --- a/java/test/Ice/translator/TestDoubleModuleNoPackage4.ice +++ b/java/test/Ice/translator/TestDoubleModuleNoPackage4.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleNoPackage5.ice b/java/test/Ice/translator/TestDoubleModuleNoPackage5.ice index 85b433d381d..27a004c8b0f 100644 --- a/java/test/Ice/translator/TestDoubleModuleNoPackage5.ice +++ b/java/test/Ice/translator/TestDoubleModuleNoPackage5.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleNoPackage6.ice b/java/test/Ice/translator/TestDoubleModuleNoPackage6.ice index 551331bc361..d6a7115af4d 100644 --- a/java/test/Ice/translator/TestDoubleModuleNoPackage6.ice +++ b/java/test/Ice/translator/TestDoubleModuleNoPackage6.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleNoPackage7.ice b/java/test/Ice/translator/TestDoubleModuleNoPackage7.ice index d2fe243f9d7..2b336599876 100644 --- a/java/test/Ice/translator/TestDoubleModuleNoPackage7.ice +++ b/java/test/Ice/translator/TestDoubleModuleNoPackage7.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage10.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage10.ice index 733ec796aac..cb257c0908d 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage10.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage10.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage11.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage11.ice index 2b838d65bc8..250070fb926 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage11.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage11.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage4.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage4.ice index d3cbc3264a1..5614f66cd10 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage4.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage4.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage5.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage5.ice index 630086f7f02..06427d2c1f4 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage5.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage5.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage6.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage6.ice index 0cbc23b1ec6..1fa6f5f6592 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage6.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage6.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage7.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage7.ice index ff99e9330cb..dd2b0d53903 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage7.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage7.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage8.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage8.ice index bca710fe32c..0a4e20ecd37 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage8.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage8.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestDoubleModuleWithPackage9.ice b/java/test/Ice/translator/TestDoubleModuleWithPackage9.ice index abcff7d5685..9b62faa0a27 100644 --- a/java/test/Ice/translator/TestDoubleModuleWithPackage9.ice +++ b/java/test/Ice/translator/TestDoubleModuleWithPackage9.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleNoPackage4.ice b/java/test/Ice/translator/TestSingleModuleNoPackage4.ice index abc59228c37..7c2dab8e2fd 100644 --- a/java/test/Ice/translator/TestSingleModuleNoPackage4.ice +++ b/java/test/Ice/translator/TestSingleModuleNoPackage4.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleNoPackage6.ice b/java/test/Ice/translator/TestSingleModuleNoPackage6.ice index f81bc011b09..d1adac45e7d 100644 --- a/java/test/Ice/translator/TestSingleModuleNoPackage6.ice +++ b/java/test/Ice/translator/TestSingleModuleNoPackage6.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleNoPackage7.ice b/java/test/Ice/translator/TestSingleModuleNoPackage7.ice index b8db1822b93..3a1d58242c0 100644 --- a/java/test/Ice/translator/TestSingleModuleNoPackage7.ice +++ b/java/test/Ice/translator/TestSingleModuleNoPackage7.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage10.ice b/java/test/Ice/translator/TestSingleModuleWithPackage10.ice index 8c3f9c83201..4000da21a68 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage10.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage10.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage11.ice b/java/test/Ice/translator/TestSingleModuleWithPackage11.ice index 284b97e468e..dd8113a21c2 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage11.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage11.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage12.ice b/java/test/Ice/translator/TestSingleModuleWithPackage12.ice index a10981a9ef7..49bd3551749 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage12.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage12.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage13.ice b/java/test/Ice/translator/TestSingleModuleWithPackage13.ice index 401582f9e12..c220dd65f93 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage13.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage13.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage4.ice b/java/test/Ice/translator/TestSingleModuleWithPackage4.ice index 3900d8fe565..fea0ff6d4f4 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage4.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage4.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage5.ice b/java/test/Ice/translator/TestSingleModuleWithPackage5.ice index 09389feafbd..620a2db20e1 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage5.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage5.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage6.ice b/java/test/Ice/translator/TestSingleModuleWithPackage6.ice index 25e06e0c3be..2d039eebf04 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage6.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage6.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage7.ice b/java/test/Ice/translator/TestSingleModuleWithPackage7.ice index 6daab774c3e..a304459ea98 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage7.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage7.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/TestSingleModuleWithPackage9.ice b/java/test/Ice/translator/TestSingleModuleWithPackage9.ice index e3443f33b6d..027ecc12b2e 100644 --- a/java/test/Ice/translator/TestSingleModuleWithPackage9.ice +++ b/java/test/Ice/translator/TestSingleModuleWithPackage9.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/translator/build.xml b/java/test/Ice/translator/build.xml index 2719cfbfefc..d95d3936d22 100644 --- a/java/test/Ice/translator/build.xml +++ b/java/test/Ice/translator/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Ice/udp/AllTests.java b/java/test/Ice/udp/AllTests.java new file mode 100644 index 00000000000..d7b44820367 --- /dev/null +++ b/java/test/Ice/udp/AllTests.java @@ -0,0 +1,154 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +public class AllTests +{ + private static void + test(boolean b) + { + if(!b) + { + throw new RuntimeException(); + } + } + + public static class PingReplyI extends Test._PingReplyDisp + { + public synchronized void + reply(Ice.Current current) + { + ++_replies; + notify(); + } + + public synchronized void + reset() + { + _replies = 0; + } + + public synchronized boolean + waitReply(int expectedReplies, long timeout) + { + long end = System.currentTimeMillis() + timeout; + while(_replies < expectedReplies) + { + long delay = end - System.currentTimeMillis(); + if(delay > 0) + { + try + { + wait(delay); + } + catch(java.lang.InterruptedException ex) + { + } + } + else + { + break; + } + } + return _replies == expectedReplies; + } + + private int _replies; + } + + public static Test.TestIntfPrx + allTests(Ice.Communicator communicator) + { + communicator.getProperties().setProperty("ReplyAdapter.Endpoints", "udp -p 12030"); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ReplyAdapter"); + PingReplyI replyI = new PingReplyI(); + Test.PingReplyPrx reply = + (Test.PingReplyPrx)Test.PingReplyPrxHelper.uncheckedCast(adapter.addWithUUID(replyI)).ice_datagram(); + adapter.activate(); + + System.out.print("testing udp... "); + System.out.flush(); + Ice.ObjectPrx base = communicator.stringToProxy("test:udp -p 12010").ice_datagram(); + Test.TestIntfPrx obj = Test.TestIntfPrxHelper.uncheckedCast(base); + + replyI.reset(); + obj.ping(reply); + obj.ping(reply); + obj.ping(reply); + boolean ret = replyI.waitReply(3, 2000); + test(ret == true); + + byte[] seq = null; + try + { + seq = new byte[1024]; + while(true) + { + seq = new byte[seq.length * 2 + 10]; + replyI.reset(); + obj.sendByteSeq(seq, reply); + replyI.waitReply(1, 10000); + } + } + catch(Ice.DatagramLimitException ex) + { + test(seq.length > 16384); + } + + communicator.getProperties().setProperty("Ice.UDP.SndSize", "64000"); + seq = new byte[50000]; + try + { + replyI.reset(); + obj.sendByteSeq(seq, reply); + test(!replyI.waitReply(1, 500)); + } + catch(Ice.LocalException ex) + { + System.err.println(ex); + test(false); + } + + System.out.println("ok"); + + System.out.print("testing udp multicast... "); + System.out.flush(); + String host; + if(communicator.getProperties().getProperty("Ice.IPv6") == "1") + { + host = "\"ff01::1:1\""; + } + else + { + host = "239.255.1.1"; + } + base = communicator.stringToProxy("test:udp -h " + host + " -p 12020").ice_datagram(); + obj = Test.TestIntfPrxHelper.uncheckedCast(base); + + replyI.reset(); + obj.ping(reply); + if(!replyI.waitReply(5, 2000)) + { + System.out.println("failed (is a firewall enabled?)"); + return obj; + } + + replyI.reset(); + obj.ping(reply); + ret = replyI.waitReply(5, 2000); + if(!replyI.waitReply(5, 2000)) + { + System.out.println("failed (is a firewall enabled?)"); + return obj; + } + + System.out.println("ok"); + + return obj; + } +} diff --git a/java/test/Ice/udp/Client.java b/java/test/Ice/udp/Client.java new file mode 100644 index 00000000000..321f89d3ecf --- /dev/null +++ b/java/test/Ice/udp/Client.java @@ -0,0 +1,62 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +import Test.*; + +public class Client +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + TestIntfPrx obj = AllTests.allTests(communicator); + obj.shutdown(); + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + Ice.StringSeqHolder argHolder = new Ice.StringSeqHolder(args); + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(argHolder); + + initData.properties.setProperty("Ice.Warn.Connections", "0"); + initData.properties.setProperty("Ice.UDP.SndSize", "16384"); + + communicator = Ice.Util.initialize(argHolder, initData); + status = run(args, communicator); + } + catch(Exception ex) + { + ex.printStackTrace(); + status = 1; + } + + if(communicator != null) + { + try + { + communicator.destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.gc(); + System.exit(status); + } +} diff --git a/java/test/Ice/udp/Server.java b/java/test/Ice/udp/Server.java new file mode 100644 index 00000000000..bedd63218bb --- /dev/null +++ b/java/test/Ice/udp/Server.java @@ -0,0 +1,82 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +public class Server +{ + private static int + run(String[] args, Ice.Communicator communicator) + { + Ice.Properties properties = communicator.getProperties(); + if(args.length == 1 && args[0].equals("1")) + { + properties.setProperty("TestAdapter.Endpoints", "udp -p 12010"); + Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); + adapter.add(new TestIntfI(), communicator.stringToIdentity("test")); + adapter.activate(); + } + + String host; + if(properties.getProperty("Ice.IPv6") == "1") + { + host = "\"ff01::1:1\""; + } + else + { + host = "239.255.1.1"; + } + properties.setProperty("McastTestAdapter.Endpoints", "udp -h " + host + " -p 12020"); + Ice.ObjectAdapter mcastAdapter = communicator.createObjectAdapter("McastTestAdapter"); + mcastAdapter.add(new TestIntfI(), communicator.stringToIdentity("test")); + mcastAdapter.activate(); + + communicator.waitForShutdown(); + return 0; + } + + public static void + main(String[] args) + { + int status = 0; + Ice.Communicator communicator = null; + + try + { + Ice.StringSeqHolder argHolder = new Ice.StringSeqHolder(args); + Ice.InitializationData initData = new Ice.InitializationData(); + initData.properties = Ice.Util.createProperties(argHolder); + + initData.properties.setProperty("Ice.Warn.Connections", "0"); + initData.properties.setProperty("Ice.UDP.RcvSize", "16384"); + + communicator = Ice.Util.initialize(argHolder, initData); + status = run(argHolder.value, communicator); + } + catch(Exception ex) + { + ex.printStackTrace(); + status = 1; + } + + if(communicator != null) + { + try + { + communicator.destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + status = 1; + } + } + + System.gc(); + System.exit(status); + } +} diff --git a/java/test/Glacier2/attack/Backend.ice b/java/test/Ice/udp/Test.ice index 5e93560db7c..0d4af4d441a 100644 --- a/java/test/Glacier2/attack/Backend.ice +++ b/java/test/Ice/udp/Test.ice @@ -1,20 +1,29 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** -#ifndef BACKEND_ICE -#define BACKEND_ICE +#ifndef TEST_ICE +#define TEST_ICE module Test { -interface Backend +interface PingReply { + void reply(); +}; + +sequence<byte> ByteSeq; + +interface TestIntf +{ + void ping(PingReply* reply); + void sendByteSeq(ByteSeq seq, PingReply* reply); void shutdown(); }; diff --git a/java/test/Ice/udp/TestIntfI.java b/java/test/Ice/udp/TestIntfI.java new file mode 100644 index 00000000000..585d00be077 --- /dev/null +++ b/java/test/Ice/udp/TestIntfI.java @@ -0,0 +1,40 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +public final class TestIntfI extends Test._TestIntfDisp +{ + public void ping(Test.PingReplyPrx reply, Ice.Current current) + { + try + { + reply.reply(); + } + catch(Ice.LocalException ex) + { + assert(false); + } + } + + public void sendByteSeq(byte[] seq, Test.PingReplyPrx reply, Ice.Current current) + { + try + { + reply.reply(); + } + catch(Ice.LocalException ex) + { + assert(false); + } + } + + public void shutdown(Ice.Current current) + { + current.adapter.getCommunicator().shutdown(); + } +} diff --git a/java/test/Glacier2/attack/build.xml b/java/test/Ice/udp/build.xml index 24877fb4192..daebad93de6 100644 --- a/java/test/Glacier2/attack/build.xml +++ b/java/test/Ice/udp/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -9,7 +9,7 @@ ********************************************************************** --> -<project name="test_Glacier2_attack" default="all" basedir="."> +<project name="test_Ice_udp" default="all" basedir="."> <!-- set global properties for this build --> <property name="top.dir" value="../../.."/> @@ -22,7 +22,7 @@ <mkdir dir="${generated.dir}"/> <slice2java outputdir="${generated.dir}"> <meta value="${java2metadata}"/> - <fileset dir="." includes="Backend.ice"/> + <fileset dir="." includes="Test.ice"/> </slice2java> </target> diff --git a/java/test/Ice/udp/run.py b/java/test/Ice/udp/run.py new file mode 100755 index 00000000000..1ba78b079a2 --- /dev/null +++ b/java/test/Ice/udp/run.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import os, sys + +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * + +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) + +num = 5 + +serverProc = [] +for i in range(0, num): + print "starting server #%d..." % (i + 1), + serverProc.append(TestUtil.startServer("Server", "%d" % (i + 1) , adapter="McastTestAdapter")) + print "ok" + +print "starting client...", +clientProc = TestUtil.startClient("Client") +print "ok" + +clientProc.waitTestSuccess() +for p in serverProc: + p.waitTestSuccess() diff --git a/java/test/IceBox/build.xml b/java/test/IceBox/build.xml index ef641529333..9f98487e325 100644 --- a/java/test/IceBox/build.xml +++ b/java/test/IceBox/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/AllTests.java b/java/test/IceBox/configuration/AllTests.java index e8989971176..488fe4f7c7f 100644 --- a/java/test/IceBox/configuration/AllTests.java +++ b/java/test/IceBox/configuration/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/Client.java b/java/test/IceBox/configuration/Client.java index 428da598c10..dfb55d630db 100644 --- a/java/test/IceBox/configuration/Client.java +++ b/java/test/IceBox/configuration/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/Test.ice b/java/test/IceBox/configuration/Test.ice index 9e70b77cfc8..5300aa44bb0 100644 --- a/java/test/IceBox/configuration/Test.ice +++ b/java/test/IceBox/configuration/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/TestI.java b/java/test/IceBox/configuration/TestI.java index dc28e39fddc..f508705abe4 100644 --- a/java/test/IceBox/configuration/TestI.java +++ b/java/test/IceBox/configuration/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/TestServiceI.java b/java/test/IceBox/configuration/TestServiceI.java index 5f08ac9122b..485d8435c89 100644 --- a/java/test/IceBox/configuration/TestServiceI.java +++ b/java/test/IceBox/configuration/TestServiceI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/build.xml b/java/test/IceBox/configuration/build.xml index 644edb518b7..e874d67da56 100644 --- a/java/test/IceBox/configuration/build.xml +++ b/java/test/IceBox/configuration/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceBox/configuration/run.py b/java/test/IceBox/configuration/run.py index 5b921e2ba2b..67461502cce 100755 --- a/java/test/IceBox/configuration/run.py +++ b/java/test/IceBox/configuration/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,30 +10,17 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() -import IceGridAdmin - -name = os.path.join("IceBox", "configuration") -testdir = os.path.dirname(os.path.abspath(__file__)) -icebox = TestUtil.getIceBox(testdir); - -cwd = os.getcwd() -os.chdir(testdir) - -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") - -TestUtil.clientServerTestWithOptionsAndNames(name, "--Ice.Config=config.icebox", "", icebox, "Client") -TestUtil.clientServerTestWithOptionsAndNames(name, "--Ice.Config=config.icebox2", "", icebox, "Client") - -os.chdir(cwd) - -sys.exit(0) +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/build.xml b/java/test/IceGrid/build.xml index 853d3edd4e1..0e5964d7f95 100644 --- a/java/test/IceGrid/build.xml +++ b/java/test/IceGrid/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceGrid/simple/AllTests.java b/java/test/IceGrid/simple/AllTests.java index a6dda92300b..7df041ec955 100644 --- a/java/test/IceGrid/simple/AllTests.java +++ b/java/test/IceGrid/simple/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. @@ -78,6 +78,11 @@ public class AllTests test(base != null); System.out.println("ok"); + System.out.print("testing IceGrid.Locator is present... "); + IceGrid.LocatorPrx locator = IceGrid.LocatorPrxHelper.uncheckedCast(base); + test(locator != null); + System.out.println("ok"); + System.out.print("testing checked cast... "); System.out.flush(); TestIntfPrx obj = TestIntfPrxHelper.checkedCast(base); diff --git a/java/test/IceGrid/simple/Client.java b/java/test/IceGrid/simple/Client.java index 867f1555d3c..9920cce434d 100644 --- a/java/test/IceGrid/simple/Client.java +++ b/java/test/IceGrid/simple/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceGrid/simple/Server.java b/java/test/IceGrid/simple/Server.java index 83f77ad2911..7a5e11f8cba 100644 --- a/java/test/IceGrid/simple/Server.java +++ b/java/test/IceGrid/simple/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceGrid/simple/Test.ice b/java/test/IceGrid/simple/Test.ice index 900a3c992bc..4e0f2a6a2b9 100644 --- a/java/test/IceGrid/simple/Test.ice +++ b/java/test/IceGrid/simple/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceGrid/simple/TestI.java b/java/test/IceGrid/simple/TestI.java index d125e82e88c..f8954675591 100644 --- a/java/test/IceGrid/simple/TestI.java +++ b/java/test/IceGrid/simple/TestI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceGrid/simple/build.xml b/java/test/IceGrid/simple/build.xml index b1931936f20..04f0df0f7cd 100644 --- a/java/test/IceGrid/simple/build.xml +++ b/java/test/IceGrid/simple/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. @@ -46,6 +46,7 @@ <delete quiet="true" includeEmptyDirs="true"> <fileset dir="db/node"/> <fileset dir="db/registry"/> + <fileset dir="db/replica-1"/> </delete> </target> diff --git a/java/test/IceGrid/simple/run.py b/java/test/IceGrid/simple/run.py index 38b267460bc..4455f5e40e0 100755 --- a/java/test/IceGrid/simple/run.py +++ b/java/test/IceGrid/simple/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,31 +10,22 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" - -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() -import IceGridAdmin - -testdir = os.path.dirname(os.path.abspath(__file__)) - -name = os.path.join("IceGrid", "simple") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +sys.path.append(os.path.join(path[0])) +from scripts import * # # Test client/server without on demand activation. # -IceGridAdmin.iceGridClientServerTest(testdir, name, "", "--TestAdapter.Endpoints=default" + \ - " --TestAdapter.AdapterId=TestAdapter") +IceGridAdmin.iceGridClientServerTest("", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter") # # Test client/server with on demand activation. # -IceGridAdmin.iceGridTest(testdir, name, "simple_server.xml", "--with-deploy") -sys.exit(0) +IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy") diff --git a/java/test/IceSSL/build.xml b/java/test/IceSSL/build.xml index e343b565c25..6e41173e279 100644 --- a/java/test/IceSSL/build.xml +++ b/java/test/IceSSL/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/certs/makecerts.py b/java/test/IceSSL/certs/makecerts.py index d1c474ca07f..5e6fbb7300f 100755 --- a/java/test/IceSSL/certs/makecerts.py +++ b/java/test/IceSSL/certs/makecerts.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -18,7 +18,7 @@ else: raise "can't find toplevel directory!" sys.path.append(os.path.join(toplevel, "config")) -import TestUtil +from scripts import * # # Show usage information. diff --git a/java/test/IceSSL/configuration/AllTests.java b/java/test/IceSSL/configuration/AllTests.java index a974c18ce90..d6470f9e85c 100644 --- a/java/test/IceSSL/configuration/AllTests.java +++ b/java/test/IceSSL/configuration/AllTests.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/CertificateVerifierI.java b/java/test/IceSSL/configuration/CertificateVerifierI.java index f1c0c440d13..547acc4c4f9 100644 --- a/java/test/IceSSL/configuration/CertificateVerifierI.java +++ b/java/test/IceSSL/configuration/CertificateVerifierI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/Client.java b/java/test/IceSSL/configuration/Client.java index d24d99dc759..18a942f22df 100644 --- a/java/test/IceSSL/configuration/Client.java +++ b/java/test/IceSSL/configuration/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/PasswordCallbackI.java b/java/test/IceSSL/configuration/PasswordCallbackI.java index 764e8477142..786170671a0 100644 --- a/java/test/IceSSL/configuration/PasswordCallbackI.java +++ b/java/test/IceSSL/configuration/PasswordCallbackI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/Server.java b/java/test/IceSSL/configuration/Server.java index 02fe64c5110..c1b7b5e9976 100644 --- a/java/test/IceSSL/configuration/Server.java +++ b/java/test/IceSSL/configuration/Server.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/ServerFactoryI.java b/java/test/IceSSL/configuration/ServerFactoryI.java index d406a91d8fd..6fc001550d9 100644 --- a/java/test/IceSSL/configuration/ServerFactoryI.java +++ b/java/test/IceSSL/configuration/ServerFactoryI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/ServerI.java b/java/test/IceSSL/configuration/ServerI.java index cd8ecb442aa..15d446a7480 100644 --- a/java/test/IceSSL/configuration/ServerI.java +++ b/java/test/IceSSL/configuration/ServerI.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/Test.ice b/java/test/IceSSL/configuration/Test.ice index c0149cd962f..335a7cbe344 100644 --- a/java/test/IceSSL/configuration/Test.ice +++ b/java/test/IceSSL/configuration/Test.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/build.xml b/java/test/IceSSL/configuration/build.xml index 9a50b720f2c..1d007a9254c 100644 --- a/java/test/IceSSL/configuration/build.xml +++ b/java/test/IceSSL/configuration/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceSSL/configuration/run.py b/java/test/IceSSL/configuration/run.py index 0c45d6d34d8..154cffc869d 100755 --- a/java/test/IceSSL/configuration/run.py +++ b/java/test/IceSSL/configuration/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,21 +10,16 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() +testdir = os.getcwd() -name = os.path.join("IceSSL", "configuration") -testdir = os.path.dirname(os.path.abspath(__file__)) - -classpath = os.getenv("CLASSPATH", "") -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + classpath -TestUtil.clientServerTestWithOptions(name, "", " " + testdir) -sys.exit(0) +TestUtil.clientServerTest(additionalClientOptions=testdir) diff --git a/java/test/IceUtil/build.xml b/java/test/IceUtil/build.xml index 19a61257a5b..7d81da3433a 100644 --- a/java/test/IceUtil/build.xml +++ b/java/test/IceUtil/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceUtil/inputUtil/Client.java b/java/test/IceUtil/inputUtil/Client.java index 0958339c066..63ebd67811d 100644 --- a/java/test/IceUtil/inputUtil/Client.java +++ b/java/test/IceUtil/inputUtil/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/IceUtil/inputUtil/build.xml b/java/test/IceUtil/inputUtil/build.xml index cb8f398fb67..48ad1c5562e 100644 --- a/java/test/IceUtil/inputUtil/build.xml +++ b/java/test/IceUtil/inputUtil/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/IceUtil/inputUtil/run.py b/java/test/IceUtil/inputUtil/run.py index 6e33ce61269..cae7681d14d 100755 --- a/java/test/IceUtil/inputUtil/run.py +++ b/java/test/IceUtil/inputUtil/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,30 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("IceUtil", "inputUtil") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) print "starting client...", -clientPipe = TestUtil.startClient("Client", " 2>&1") +clientProc = TestUtil.startClient("Client") print "ok" - -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() diff --git a/java/test/Slice/build.xml b/java/test/Slice/build.xml index acb0c57c026..6ebfc0e8344 100644 --- a/java/test/Slice/build.xml +++ b/java/test/Slice/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Slice/keyword/Client.java b/java/test/Slice/keyword/Client.java index f3c8368205b..afb93aa1bda 100644 --- a/java/test/Slice/keyword/Client.java +++ b/java/test/Slice/keyword/Client.java @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Slice/keyword/Key.ice b/java/test/Slice/keyword/Key.ice index b1889510276..f1ce1a558a9 100644 --- a/java/test/Slice/keyword/Key.ice +++ b/java/test/Slice/keyword/Key.ice @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/java/test/Slice/keyword/build.xml b/java/test/Slice/keyword/build.xml index f403b76ae59..232871cd181 100644 --- a/java/test/Slice/keyword/build.xml +++ b/java/test/Slice/keyword/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. diff --git a/java/test/Slice/keyword/run.py b/java/test/Slice/keyword/run.py index 95c29eed3c1..cae7681d14d 100755 --- a/java/test/Slice/keyword/run.py +++ b/java/test/Slice/keyword/run.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # ********************************************************************** # -# Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. +# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. @@ -10,30 +10,19 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../..", "../../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +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 "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - -name = os.path.join("Slice", "keyword") -testdir = os.path.dirname(os.path.abspath(__file__)) -os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + os.pathsep + os.getenv("CLASSPATH", "") +TestUtil.addClasspath(os.path.join(os.getcwd(), "classes")) print "starting client...", -clientPipe = os.popen("java -ea Client 2>&1") +clientProc = TestUtil.startClient("Client") print "ok" - -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) - -if clientStatus: - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() diff --git a/java/test/build.xml b/java/test/build.xml index e8b5f63a642..b8534e5a76c 100644 --- a/java/test/build.xml +++ b/java/test/build.xml @@ -1,7 +1,7 @@ <!-- ********************************************************************** - Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved. + Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved. This copy of Ice is licensed to you under the terms described in the ICE_LICENSE file included in this distribution. |