summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rwxr-xr-xpy/test/Ice/adapterDeactivation/Collocated.py2
-rwxr-xr-xpy/test/Ice/exceptions/Collocated.py2
-rwxr-xr-xpy/test/Ice/facets/Collocated.py2
-rwxr-xr-xpy/test/Ice/inheritance/Collocated.py2
-rwxr-xr-xpy/test/Ice/objects/Collocated.py2
-rwxr-xr-xpy/test/Ice/operations/Collocated.py2
-rw-r--r--py/test/Ice/operations/Twoways.py84
-rw-r--r--py/test/Ice/operations/TwowaysAMI.py87
-rwxr-xr-xpy/test/Ice/proxy/Collocated.py2
-rwxr-xr-xpy/test/Ice/servantLocator/Collocated.py2
10 files changed, 94 insertions, 93 deletions
diff --git a/py/test/Ice/adapterDeactivation/Collocated.py b/py/test/Ice/adapterDeactivation/Collocated.py
index 0808b415f15..be0aac1ec46 100755
--- a/py/test/Ice/adapterDeactivation/Collocated.py
+++ b/py/test/Ice/adapterDeactivation/Collocated.py
@@ -21,7 +21,7 @@ class TestServer(Ice.Application):
locator = TestI.ServantLocatorI()
adapter.addServantLocator(locator, "")
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
AllTests.allTests(self.communicator())
diff --git a/py/test/Ice/exceptions/Collocated.py b/py/test/Ice/exceptions/Collocated.py
index 908db8f5f82..2203cd53753 100755
--- a/py/test/Ice/exceptions/Collocated.py
+++ b/py/test/Ice/exceptions/Collocated.py
@@ -26,7 +26,7 @@ def run(args, communicator):
adapter = communicator.createObjectAdapter("TestAdapter")
object = TestI.ThrowerI()
adapter.add(object, communicator.stringToIdentity("thrower"))
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
thrower = AllTests.allTests(communicator)
diff --git a/py/test/Ice/facets/Collocated.py b/py/test/Ice/facets/Collocated.py
index e14e3261f50..018e8a371f1 100755
--- a/py/test/Ice/facets/Collocated.py
+++ b/py/test/Ice/facets/Collocated.py
@@ -25,7 +25,7 @@ def run(args, communicator):
h = TestI.HI(communicator)
adapter.addFacet(h, communicator.stringToIdentity("d"), "facetGH")
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
AllTests.allTests(communicator)
diff --git a/py/test/Ice/inheritance/Collocated.py b/py/test/Ice/inheritance/Collocated.py
index f4f28e0b370..c9a6dd6e79d 100755
--- a/py/test/Ice/inheritance/Collocated.py
+++ b/py/test/Ice/inheritance/Collocated.py
@@ -19,7 +19,7 @@ def run(args, communicator):
adapter = communicator.createObjectAdapter("TestAdapter")
object = TestI.InitialI(adapter)
adapter.add(object, communicator.stringToIdentity("initial"))
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
AllTests.allTests(communicator)
diff --git a/py/test/Ice/objects/Collocated.py b/py/test/Ice/objects/Collocated.py
index 8b477ce563e..e4e9df93bb6 100755
--- a/py/test/Ice/objects/Collocated.py
+++ b/py/test/Ice/objects/Collocated.py
@@ -22,7 +22,7 @@ def run(args, communicator):
adapter.add(initial, communicator.stringToIdentity("initial"))
uoet = TestI.UnexpectedObjectExceptionTestI()
adapter.add(uoet, communicator.stringToIdentity("uoet"))
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
AllTests.allTests(communicator)
diff --git a/py/test/Ice/operations/Collocated.py b/py/test/Ice/operations/Collocated.py
index 33aac07e2a3..3a89f62fd7a 100755
--- a/py/test/Ice/operations/Collocated.py
+++ b/py/test/Ice/operations/Collocated.py
@@ -23,7 +23,7 @@ def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
adapter = communicator.createObjectAdapter("TestAdapter")
prx = adapter.add(TestI.MyDerivedClassI(), communicator.stringToIdentity("test"))
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
if prx.ice_getConnection():
raise RuntimeError("collocation doesn't work")
diff --git a/py/test/Ice/operations/Twoways.py b/py/test/Ice/operations/Twoways.py
index 8a4b5c5dd59..c9bd927ad70 100644
--- a/py/test/Ice/operations/Twoways.py
+++ b/py/test/Ice/operations/Twoways.py
@@ -736,48 +736,48 @@ def twoways(communicator, p):
#
# Test implicit context propagation
#
- impls = ( 'Shared', 'PerThread' )
- for i in impls:
- initData = Ice.InitializationData()
- initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty('Ice.ImplicitContext', i)
- ic = Ice.initialize(data=initData)
-
- ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
-
- p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:default -p 12010'))
-
- ic.getImplicitContext().setContext(ctx)
- test(ic.getImplicitContext().getContext() == ctx)
- test(p1.opContext() == ctx)
-
- test(ic.getImplicitContext().containsKey('zero') == False);
- r = ic.getImplicitContext().put('zero', 'ZERO');
- test(r == '');
- test(ic.getImplicitContext().containsKey('zero') == True);
- test(ic.getImplicitContext().get('zero') == 'ZERO');
-
- ctx = ic.getImplicitContext().getContext()
- test(p1.opContext() == ctx)
-
- prxContext = {'one': 'UN', 'four': 'QUATRE'}
-
- combined = ctx.copy()
- combined.update(prxContext)
- test(combined['one'] == 'UN')
-
- p2 = Test.MyClassPrx.uncheckedCast(p1.ice_context(prxContext))
-
- ic.getImplicitContext().setContext({})
- test(p2.opContext() == prxContext)
-
- ic.getImplicitContext().setContext(ctx)
- test(p2.opContext() == combined)
-
- test(ic.getImplicitContext().remove('one') == 'ONE');
-
- ic.destroy()
-
+ if p.ice_getConnection():
+ impls = ( 'Shared', 'PerThread' )
+ for i in impls:
+ initData = Ice.InitializationData()
+ initData.properties = communicator.getProperties().clone()
+ initData.properties.setProperty('Ice.ImplicitContext', i)
+ ic = Ice.initialize(data=initData)
+
+ ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
+
+ p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:default -p 12010'))
+
+ ic.getImplicitContext().setContext(ctx)
+ test(ic.getImplicitContext().getContext() == ctx)
+ test(p1.opContext() == ctx)
+
+ test(ic.getImplicitContext().containsKey('zero') == False);
+ r = ic.getImplicitContext().put('zero', 'ZERO');
+ test(r == '');
+ test(ic.getImplicitContext().containsKey('zero') == True);
+ test(ic.getImplicitContext().get('zero') == 'ZERO');
+
+ ctx = ic.getImplicitContext().getContext()
+ test(p1.opContext() == ctx)
+
+ prxContext = {'one': 'UN', 'four': 'QUATRE'}
+
+ combined = ctx.copy()
+ combined.update(prxContext)
+ test(combined['one'] == 'UN')
+
+ p2 = Test.MyClassPrx.uncheckedCast(p1.ice_context(prxContext))
+
+ ic.getImplicitContext().setContext({})
+ test(p2.opContext() == prxContext)
+
+ ic.getImplicitContext().setContext(ctx)
+ test(p2.opContext() == combined)
+
+ test(ic.getImplicitContext().remove('one') == 'ONE');
+
+ ic.destroy()
d = 1278312346.0 / 13.0;
ds = []
diff --git a/py/test/Ice/operations/TwowaysAMI.py b/py/test/Ice/operations/TwowaysAMI.py
index 618e3de769a..52702ebad18 100644
--- a/py/test/Ice/operations/TwowaysAMI.py
+++ b/py/test/Ice/operations/TwowaysAMI.py
@@ -674,49 +674,50 @@ def twowaysAMI(communicator, p):
#
# Test implicit context propagation
#
- impls = ( 'Shared', 'PerThread' )
- for i in impls:
- initData = Ice.InitializationData()
- initData.properties = communicator.getProperties().clone()
- initData.properties.setProperty('Ice.ImplicitContext', i)
- ic = Ice.initialize(data=initData)
-
- ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
-
- p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010"))
-
- ic.getImplicitContext().setContext(ctx)
- test(ic.getImplicitContext().getContext() == ctx)
- r = p3.begin_opContext()
- c = p3.end_opContext(r)
- test(c == ctx)
-
- ic.getImplicitContext().put('zero', 'ZERO')
-
- ctx = ic.getImplicitContext().getContext()
- r = p3.begin_opContext()
- c = p3.end_opContext(r)
- test(c == ctx)
-
- prxContext = {'one': 'UN', 'four': 'QUATRE'}
-
- combined = {}
- combined.update(ctx)
- combined.update(prxContext)
- test(combined['one'] == 'UN')
-
- p3 = Test.MyClassPrx.uncheckedCast(p3.ice_context(prxContext))
- ic.getImplicitContext().setContext({})
- r = p3.begin_opContext()
- c = p3.end_opContext(r)
- test(c == prxContext)
-
- ic.getImplicitContext().setContext(ctx)
- r = p3.begin_opContext()
- c = p3.end_opContext(r)
- test(c == combined)
-
- ic.destroy()
+ if p.ice_getConnection():
+ impls = ( 'Shared', 'PerThread' )
+ for i in impls:
+ initData = Ice.InitializationData()
+ initData.properties = communicator.getProperties().clone()
+ initData.properties.setProperty('Ice.ImplicitContext', i)
+ ic = Ice.initialize(data=initData)
+
+ ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
+
+ p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010"))
+
+ ic.getImplicitContext().setContext(ctx)
+ test(ic.getImplicitContext().getContext() == ctx)
+ r = p3.begin_opContext()
+ c = p3.end_opContext(r)
+ test(c == ctx)
+
+ ic.getImplicitContext().put('zero', 'ZERO')
+
+ ctx = ic.getImplicitContext().getContext()
+ r = p3.begin_opContext()
+ c = p3.end_opContext(r)
+ test(c == ctx)
+
+ prxContext = {'one': 'UN', 'four': 'QUATRE'}
+
+ combined = {}
+ combined.update(ctx)
+ combined.update(prxContext)
+ test(combined['one'] == 'UN')
+
+ p3 = Test.MyClassPrx.uncheckedCast(p3.ice_context(prxContext))
+ ic.getImplicitContext().setContext({})
+ r = p3.begin_opContext()
+ c = p3.end_opContext(r)
+ test(c == prxContext)
+
+ ic.getImplicitContext().setContext(ctx)
+ r = p3.begin_opContext()
+ c = p3.end_opContext(r)
+ test(c == combined)
+
+ ic.destroy()
cb = Callback()
p.begin_opIdempotent(cb.opIdempotent, cb.exCB)
diff --git a/py/test/Ice/proxy/Collocated.py b/py/test/Ice/proxy/Collocated.py
index 73f1fffe333..dba11a53ca8 100755
--- a/py/test/Ice/proxy/Collocated.py
+++ b/py/test/Ice/proxy/Collocated.py
@@ -23,7 +23,7 @@ def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TestI.MyDerivedClassI(), communicator.stringToIdentity("test"))
- adapter.activate()
+ #adapter.activate() // Don't activate OA to ensure collocation is used.
AllTests.allTests(communicator, True)
diff --git a/py/test/Ice/servantLocator/Collocated.py b/py/test/Ice/servantLocator/Collocated.py
index 36760436524..6efabd7ae8b 100755
--- a/py/test/Ice/servantLocator/Collocated.py
+++ b/py/test/Ice/servantLocator/Collocated.py
@@ -20,7 +20,7 @@ class TestServer(Ice.Application):
self.communicator().getProperties().setProperty("Ice.Warn.Dispatch", "0")
adapter = self.communicator().createObjectAdapter("TestAdapter")
- adapter.activate()
+ #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(), self.communicator().stringToIdentity("asm"))