summaryrefslogtreecommitdiff
path: root/py/test/Ice/exceptions/Collocated.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-09-14 19:44:51 +0000
committerMark Spruiell <mes@zeroc.com>2005-09-14 19:44:51 +0000
commit48918d87206d3cc754f5741f9b0f844c0799ca3a (patch)
tree74189a0639c5dce5bd39a0ddbd7c6301ca6d44d2 /py/test/Ice/exceptions/Collocated.py
parentfix for bug 282 (diff)
downloadice-48918d87206d3cc754f5741f9b0f844c0799ca3a.tar.bz2
ice-48918d87206d3cc754f5741f9b0f844c0799ca3a.tar.xz
ice-48918d87206d3cc754f5741f9b0f844c0799ca3a.zip
adding collocated tests
Diffstat (limited to 'py/test/Ice/exceptions/Collocated.py')
-rw-r--r--py/test/Ice/exceptions/Collocated.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/py/test/Ice/exceptions/Collocated.py b/py/test/Ice/exceptions/Collocated.py
new file mode 100644
index 00000000000..0d60f411c80
--- /dev/null
+++ b/py/test/Ice/exceptions/Collocated.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2005 ZeroC, Inc. 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, traceback
+
+for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "python", "Ice.py")):
+ break
+else:
+ raise "can't find toplevel directory!"
+
+sys.path.insert(0, os.path.join(toplevel, "python"))
+sys.path.insert(0, os.path.join(toplevel, "lib"))
+
+import Ice
+Ice.loadSlice('Test.ice')
+import Test, TestI, AllTests
+
+def run(args, communicator):
+ properties = communicator.getProperties()
+ properties.setProperty("Ice.Warn.Dispatch", "0")
+ properties.setProperty("TestAdapter.Endpoints", "default -p 12345 -t 10000")
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ object = TestI.ThrowerI(adapter)
+ adapter.add(object, Ice.stringToIdentity("thrower"))
+ adapter.activate()
+
+ thrower = AllTests.allTests(communicator)
+
+ return True
+
+try:
+ communicator = Ice.initialize(sys.argv)
+ status = run(sys.argv, communicator)
+except:
+ traceback.print_exc()
+ status = False
+
+if communicator:
+ try:
+ communicator.destroy()
+ except:
+ traceback.print_exc()
+ status = False
+
+sys.exit(not status)