summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-04-03 14:41:54 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-04-03 14:41:54 -0230
commitd4edcb664ce60c2e4395d534e6759dd8475c5089 (patch)
treef7322eaeb6472f6506cf85cc4aa6121c19a8d84f /py
parentFixed compile error (diff)
downloadice-d4edcb664ce60c2e4395d534e6759dd8475c5089.tar.bz2
ice-d4edcb664ce60c2e4395d534e6759dd8475c5089.tar.xz
ice-d4edcb664ce60c2e4395d534e6759dd8475c5089.zip
Bug 3465 - Remove _adapter members from test where unecessary
Diffstat (limited to 'py')
-rwxr-xr-xpy/test/Ice/checksum/Server.py7
-rwxr-xr-xpy/test/Ice/custom/Server.py7
-rwxr-xr-xpy/test/Ice/exceptions/Collocated.py2
-rwxr-xr-xpy/test/Ice/exceptions/Server.py2
-rwxr-xr-xpy/test/Ice/exceptions/ServerAMD.py7
-rw-r--r--py/test/Ice/exceptions/TestI.py5
-rwxr-xr-xpy/test/Ice/faultTolerance/Server.py7
-rw-r--r--py/test/Ice/inheritance/TestI.py19
-rwxr-xr-xpy/test/Ice/location/Server.py7
-rwxr-xr-xpy/test/Ice/slicing/exceptions/Server.py7
-rwxr-xr-xpy/test/Ice/slicing/exceptions/ServerAMD.py7
-rwxr-xr-xpy/test/Ice/slicing/objects/Server.py7
-rwxr-xr-xpy/test/Ice/slicing/objects/ServerAMD.py7
13 files changed, 31 insertions, 60 deletions
diff --git a/py/test/Ice/checksum/Server.py b/py/test/Ice/checksum/Server.py
index 7c6b3d2579e..00668d748d0 100755
--- a/py/test/Ice/checksum/Server.py
+++ b/py/test/Ice/checksum/Server.py
@@ -20,19 +20,16 @@ Ice.loadSlice('-I' + slice_dir + ' --checksum Test.ice STypes.ice')
import Test
class ChecksumI(Test.Checksum):
- def __init__(self, adapter):
- self._adapter = adapter
-
def getSliceChecksums(self, current=None):
return Ice.sliceChecksums
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = ChecksumI(adapter)
+ object = ChecksumI()
adapter.add(object, communicator.stringToIdentity("test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/custom/Server.py b/py/test/Ice/custom/Server.py
index 256afc9b6e4..dfbb5cb6b84 100755
--- a/py/test/Ice/custom/Server.py
+++ b/py/test/Ice/custom/Server.py
@@ -19,9 +19,6 @@ def test(b):
raise RuntimeError('test assertion failed')
class CustomI(Test.Custom):
- def __init__(self, adapter):
- self._adapter = adapter
-
def opByteString1(self, b1, current=None):
test(isinstance(b1, str))
return (b1, b1)
@@ -75,12 +72,12 @@ class CustomI(Test.Custom):
test(isinstance(val.s4, list))
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = CustomI(adapter)
+ object = CustomI()
adapter.add(object, communicator.stringToIdentity("test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/exceptions/Collocated.py b/py/test/Ice/exceptions/Collocated.py
index b07d4acdfba..b05e6b5424c 100755
--- a/py/test/Ice/exceptions/Collocated.py
+++ b/py/test/Ice/exceptions/Collocated.py
@@ -19,7 +19,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI.ThrowerI(adapter)
+ object = TestI.ThrowerI()
adapter.add(object, communicator.stringToIdentity("thrower"))
adapter.activate()
diff --git a/py/test/Ice/exceptions/Server.py b/py/test/Ice/exceptions/Server.py
index 4706d57d0a1..1f95ec175ba 100755
--- a/py/test/Ice/exceptions/Server.py
+++ b/py/test/Ice/exceptions/Server.py
@@ -19,7 +19,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI.ThrowerI(adapter)
+ object = TestI.ThrowerI()
adapter.add(object, communicator.stringToIdentity("thrower"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/exceptions/ServerAMD.py b/py/test/Ice/exceptions/ServerAMD.py
index ca9ecd81761..bd446bd2e79 100755
--- a/py/test/Ice/exceptions/ServerAMD.py
+++ b/py/test/Ice/exceptions/ServerAMD.py
@@ -15,11 +15,8 @@ Ice.loadSlice('TestAMD.ice')
import Test
class ThrowerI(Test.Thrower):
- def __init__(self, adapter):
- self._adapter = adapter
-
def shutdown_async(self, cb, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
cb.ice_response()
def supportsUndeclaredExceptions_async(self, cb, current=None):
@@ -117,7 +114,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = ThrowerI(adapter)
+ object = ThrowerI()
adapter.add(object, communicator.stringToIdentity("thrower"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/exceptions/TestI.py b/py/test/Ice/exceptions/TestI.py
index 08953a39bd5..be4d8c7e1f4 100644
--- a/py/test/Ice/exceptions/TestI.py
+++ b/py/test/Ice/exceptions/TestI.py
@@ -10,11 +10,8 @@
import Ice, Test
class ThrowerI(Test.Thrower):
- def __init__(self, adapter):
- self._adapter = adapter
-
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def supportsUndeclaredExceptions(self, current=None):
return True
diff --git a/py/test/Ice/faultTolerance/Server.py b/py/test/Ice/faultTolerance/Server.py
index d9c22820ef5..ad319dfcf50 100755
--- a/py/test/Ice/faultTolerance/Server.py
+++ b/py/test/Ice/faultTolerance/Server.py
@@ -18,11 +18,8 @@ def usage(n):
sys.stderr.write("Usage: " + n + " port\n")
class TestI(Test.TestIntf):
- def __init__(self, adapter):
- self._adapter = adapter
-
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def abort(self, current=None):
print "aborting..."
@@ -56,7 +53,7 @@ def run(args, communicator):
endpts = "default -p " + str(port) + ":udp"
communicator.getProperties().setProperty("TestAdapter.Endpoints", endpts)
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI(adapter)
+ object = TestI()
adapter.add(object, communicator.stringToIdentity("test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/inheritance/TestI.py b/py/test/Ice/inheritance/TestI.py
index 57987efef8f..22c9103f14f 100644
--- a/py/test/Ice/inheritance/TestI.py
+++ b/py/test/Ice/inheritance/TestI.py
@@ -43,18 +43,17 @@ class CDI(Test.MA.CD, CCI, IB1I, IB2I):
class InitialI(Test.Initial):
def __init__(self, adapter):
- self._adapter = adapter
- self._ca = Test.MA.CAPrx.uncheckedCast(self._adapter.addWithUUID(CAI()))
- self._cb = Test.MB.CBPrx.uncheckedCast(self._adapter.addWithUUID(CBI()))
- self._cc = Test.MA.CCPrx.uncheckedCast(self._adapter.addWithUUID(CCI()))
- self._cd = Test.MA.CDPrx.uncheckedCast(self._adapter.addWithUUID(CDI()))
- self._ia = Test.MA.IAPrx.uncheckedCast(self._adapter.addWithUUID(IAI()))
- self._ib1 = Test.MB.IB1Prx.uncheckedCast(self._adapter.addWithUUID(IB1I()))
- self._ib2 = Test.MB.IB2Prx.uncheckedCast(self._adapter.addWithUUID(IB2I()))
- self._ic = Test.MA.ICPrx.uncheckedCast(self._adapter.addWithUUID(ICI()))
+ self._ca = Test.MA.CAPrx.uncheckedCast(adapter.addWithUUID(CAI()))
+ self._cb = Test.MB.CBPrx.uncheckedCast(adapter.addWithUUID(CBI()))
+ self._cc = Test.MA.CCPrx.uncheckedCast(adapter.addWithUUID(CCI()))
+ self._cd = Test.MA.CDPrx.uncheckedCast(adapter.addWithUUID(CDI()))
+ self._ia = Test.MA.IAPrx.uncheckedCast(adapter.addWithUUID(IAI()))
+ self._ib1 = Test.MB.IB1Prx.uncheckedCast(adapter.addWithUUID(IB1I()))
+ self._ib2 = Test.MB.IB2Prx.uncheckedCast(adapter.addWithUUID(IB2I()))
+ self._ic = Test.MA.ICPrx.uncheckedCast(adapter.addWithUUID(ICI()))
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def caop(self, current=None):
return self._ca
diff --git a/py/test/Ice/location/Server.py b/py/test/Ice/location/Server.py
index ebcbd95df2d..82623694ac6 100755
--- a/py/test/Ice/location/Server.py
+++ b/py/test/Ice/location/Server.py
@@ -78,8 +78,7 @@ class ServerLocator(Test.TestLocator):
return self._requestCount
class ServerManagerI(Test.ServerManager):
- def __init__(self, adapter, registry, initData):
- self._adapter = adapter
+ def __init__(self, registry, initData):
self._registry = registry
self._communicators = []
self._initData = initData
@@ -120,7 +119,7 @@ class ServerManagerI(Test.ServerManager):
def shutdown(self, current=None):
for i in self._communicators:
i.destroy()
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
class HelloI(Test.Hello):
def sayHello(self, current=None):
@@ -168,7 +167,7 @@ def run(args, communicator, initData):
#
registry = ServerLocatorRegistry()
registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager")))
- object = ServerManagerI(adapter, registry, initData)
+ object = ServerManagerI(registry, initData)
adapter.add(object, communicator.stringToIdentity("ServerManager"))
registryPrx = Ice.LocatorRegistryPrx.uncheckedCast(adapter.add(registry, communicator.stringToIdentity("registry")))
diff --git a/py/test/Ice/slicing/exceptions/Server.py b/py/test/Ice/slicing/exceptions/Server.py
index 87a7e954c1b..f3dd291de9a 100755
--- a/py/test/Ice/slicing/exceptions/Server.py
+++ b/py/test/Ice/slicing/exceptions/Server.py
@@ -14,11 +14,8 @@ Ice.loadSlice('-I. --all ServerPrivate.ice')
import Test
class TestI(Test.TestIntf):
- def __init__(self, adapter):
- self._adapter = adapter
-
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def baseAsBase(self, current=None):
b = Test.Base()
@@ -108,7 +105,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI(adapter)
+ object = TestI()
adapter.add(object, communicator.stringToIdentity("Test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/slicing/exceptions/ServerAMD.py b/py/test/Ice/slicing/exceptions/ServerAMD.py
index e13f9cf4e82..daa99e03452 100755
--- a/py/test/Ice/slicing/exceptions/ServerAMD.py
+++ b/py/test/Ice/slicing/exceptions/ServerAMD.py
@@ -15,11 +15,8 @@ Ice.loadSlice('-I. --all ServerPrivateAMD.ice')
import Test
class TestI(Test.TestIntf):
- def __init__(self, adapter):
- self._adapter = adapter
-
def shutdown_async(self, cb, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
cb.ice_response()
def baseAsBase_async(self, cb, current=None):
@@ -110,7 +107,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI(adapter)
+ object = TestI()
adapter.add(object, communicator.stringToIdentity("Test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/slicing/objects/Server.py b/py/test/Ice/slicing/objects/Server.py
index dd4f56aa1ed..f86252fc95c 100755
--- a/py/test/Ice/slicing/objects/Server.py
+++ b/py/test/Ice/slicing/objects/Server.py
@@ -15,9 +15,6 @@ Ice.loadSlice('-I. --all ServerPrivate.ice Forward.ice')
import Test
class TestI(Test.TestIntf):
- def __init__(self, adapter):
- self._adapter = adapter
-
def SBaseAsObject(self, current=None):
sb = Test.SBase()
sb.sb = "SBase.sb"
@@ -264,14 +261,14 @@ class TestI(Test.TestIntf):
return f
def shutdown(self, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
def run(args, communicator):
properties = communicator.getProperties()
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI(adapter)
+ object = TestI()
adapter.add(object, communicator.stringToIdentity("Test"))
adapter.activate()
communicator.waitForShutdown()
diff --git a/py/test/Ice/slicing/objects/ServerAMD.py b/py/test/Ice/slicing/objects/ServerAMD.py
index 8fcba1a0ea0..33ff9769a89 100755
--- a/py/test/Ice/slicing/objects/ServerAMD.py
+++ b/py/test/Ice/slicing/objects/ServerAMD.py
@@ -15,9 +15,6 @@ Ice.loadSlice('-I. --all ServerPrivateAMD.ice Forward.ice')
import Test
class TestI(Test.TestIntf):
- def __init__(self, adapter):
- self._adapter = adapter
-
def SBaseAsObject_async(self, cb, current=None):
sb = Test.SBase()
sb.sb = "SBase.sb"
@@ -288,7 +285,7 @@ class TestI(Test.TestIntf):
cb.ice_response(f)
def shutdown_async(self, cb, current=None):
- self._adapter.getCommunicator().shutdown()
+ current.adapter.getCommunicator().shutdown()
cb.ice_response()
def run(args, communicator):
@@ -296,7 +293,7 @@ def run(args, communicator):
properties.setProperty("Ice.Warn.Dispatch", "0")
properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
adapter = communicator.createObjectAdapter("TestAdapter")
- object = TestI(adapter)
+ object = TestI()
adapter.add(object, communicator.stringToIdentity("Test"))
adapter.activate()
communicator.waitForShutdown()