summaryrefslogtreecommitdiff
path: root/python/test/Ice/servantLocator/Collocated.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/servantLocator/Collocated.py')
-rwxr-xr-xpython/test/Ice/servantLocator/Collocated.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/python/test/Ice/servantLocator/Collocated.py b/python/test/Ice/servantLocator/Collocated.py
index 77d3dc12967..061b032435d 100755
--- a/python/test/Ice/servantLocator/Collocated.py
+++ b/python/test/Ice/servantLocator/Collocated.py
@@ -8,29 +8,29 @@
#
# **********************************************************************
-import os, sys, traceback, time
-
+from TestHelper import TestHelper
+TestHelper.loadSlice('Test.ice')
import Ice
-Ice.loadSlice('Test.ice')
-import Test, TestI, AllTests, TestActivationI
+import TestI
+import AllTests
+import TestActivationI
-class TestServer(Ice.Application):
- def run(self, args):
- self.communicator().getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- self.communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0")
- adapter = self.communicator().createObjectAdapter("TestAdapter")
- #adapter.activate() // Don't activate OA to ensure collocation is used.
- adapter.addServantLocator(TestI.ServantLocatorI("category"), "category")
- adapter.addServantLocator(TestI.ServantLocatorI(""), "")
- adapter.add(TestI.TestI(), Ice.stringToIdentity("asm"))
- adapter.add(TestActivationI.TestActivationI(), Ice.stringToIdentity("test/activation"))
+class Collocated(TestHelper):
+
+ def run(self, args):
+ with self.initialize(args=args) as communicator:
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ communicator.getProperties().setProperty("Ice.Warn.Dispatch", "0")
- AllTests.allTests(self.communicator(), False)
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ # adapter.activate() // Don't activate OA to ensure collocation is used.
+ adapter.addServantLocator(TestI.ServantLocatorI("category"), "category")
+ adapter.addServantLocator(TestI.ServantLocatorI(""), "")
+ adapter.add(TestI.TestI(), Ice.stringToIdentity("asm"))
+ adapter.add(TestActivationI.TestActivationI(), Ice.stringToIdentity("test/activation"))
- adapter.deactivate()
- adapter.waitForDeactivate()
- return 0
+ AllTests.allTests(self, communicator)
-app = TestServer()
-sys.exit(app.main(sys.argv))
+ adapter.deactivate()
+ adapter.waitForDeactivate()