diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-04 12:15:52 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-04 12:15:52 +0100 |
commit | 2a707c77f3342955869b98565f4abd8051a1f45a (patch) | |
tree | 55e1d24b31eac51ea2c4fdc4885f66385c058dc4 | |
parent | ICE-5811 - Minor fix for Java demo distribution build (diff) | |
download | ice-2a707c77f3342955869b98565f4abd8051a1f45a.tar.bz2 ice-2a707c77f3342955869b98565f4abd8051a1f45a.tar.xz ice-2a707c77f3342955869b98565f4abd8051a1f45a.zip |
Fixed ICE-5819: added comments and fixed some tests to work with deactivated OA
39 files changed, 148 insertions, 137 deletions
diff --git a/cpp/test/Ice/dispatcher/Collocated.cpp b/cpp/test/Ice/dispatcher/Collocated.cpp index 0cb6dc6e897..94e874f9d9d 100644 --- a/cpp/test/Ice/dispatcher/Collocated.cpp +++ b/cpp/test/Ice/dispatcher/Collocated.cpp @@ -29,10 +29,10 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) TestIntfControllerIPtr testController = new TestIntfControllerI(adapter); adapter->add(new TestIntfI(), communicator->stringToIdentity("test")); - //adapter->activate(); + //adapter->activate(); // Don't activate OA to ensure collocation is used. adapter2->add(testController, communicator->stringToIdentity("testController")); - //adapter2->activate(); + //adapter2->activate(); // Don't activate OA to ensure collocation is used. void allTests(const Ice::CommunicatorPtr&); allTests(communicator); diff --git a/cpp/test/Ice/metrics/Collocated.cpp b/cpp/test/Ice/metrics/Collocated.cpp index 8b9943fe2b8..062fe3bda84 100644 --- a/cpp/test/Ice/metrics/Collocated.cpp +++ b/cpp/test/Ice/metrics/Collocated.cpp @@ -24,12 +24,12 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, const CommunicatorObs Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new MetricsI; adapter->add(object, communicator->stringToIdentity("metrics")); - //adapter->activate(); + //adapter->activate(); // Don't activate OA to ensure collocation is used. communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011"); Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter"); controllerAdapter->add(new ControllerI(adapter), communicator->stringToIdentity("controller")); - //controllerAdapter->activate(); + //controllerAdapter->activate(); // Don't activate OA to ensure collocation is used. MetricsPrx allTests(const Ice::CommunicatorPtr&, const CommunicatorObserverIPtr&); MetricsPrx metrics = allTests(communicator, observer); diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp index 840a6defa81..1bae52850c1 100644 --- a/cpp/test/Ice/operations/Collocated.cpp +++ b/cpp/test/Ice/operations/Collocated.cpp @@ -23,7 +23,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, communicator->getProperties()->setProperty("TestAdapter.AdapterId", "test"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPrx prx = adapter->add(new MyDerivedClassI, communicator->stringToIdentity("test")); - adapter->activate(); + //adapter->activate(); // Don't activate OA to ensure collocation is used. test(!prx->ice_getConnection()); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 45f462dd430..8edf98ddb16 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -1472,6 +1472,7 @@ twoways(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } #ifndef ICE_OS_WINRT + if(p->ice_getConnection()) { // // Test implicit context propagation diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index eab375624ac..e724ca9a060 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -1949,6 +1949,7 @@ twowaysAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx& p) } #ifndef ICE_OS_WINRT + if(p->ice_getConnection()) { // // Test implicit context propagation diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp index b9371178371..54b3aa65628 100644 --- a/cpp/test/Ice/proxy/AllTests.cpp +++ b/cpp/test/Ice/proxy/AllTests.cpp @@ -764,7 +764,7 @@ allTests(const Ice::CommunicatorPtr& communicator) Test::MyClassPrx cl20 = Test::MyClassPrx::uncheckedCast(communicator->stringToProxy(ref20)); try { - cl20->ice_collocationOptimized(false)->ice_ping(); + cl20->ice_ping(); test(false); } catch(const Ice::UnsupportedEncodingException&) @@ -776,7 +776,7 @@ allTests(const Ice::CommunicatorPtr& communicator) Test::MyClassPrx cl10 = Test::MyClassPrx::uncheckedCast(communicator->stringToProxy(ref10)); cl10->ice_ping(); cl10->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); - cl->ice_collocationOptimized(false)->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); + cl->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping(); // 1.3 isn't supported but since a 1.3 proxy supports 1.1, the // call will use the 1.1 encoding @@ -797,7 +797,7 @@ allTests(const Ice::CommunicatorPtr& communicator) inEncaps[4] = version.major; inEncaps[5] = version.minor; vector<Ice::Byte> outEncaps; - cl->ice_collocationOptimized(false)->ice_invoke("ice_ping", Ice::Normal, inEncaps, outEncaps); + cl->ice_invoke("ice_ping", Ice::Normal, inEncaps, outEncaps); test(false); } catch(const Ice::UnknownLocalException& ex) @@ -818,7 +818,7 @@ allTests(const Ice::CommunicatorPtr& communicator) inEncaps[4] = version.major; inEncaps[5] = version.minor; vector<Ice::Byte> outEncaps; - cl->ice_collocationOptimized(false)->ice_invoke("ice_ping", Ice::Normal, inEncaps, outEncaps); + cl->ice_invoke("ice_ping", Ice::Normal, inEncaps, outEncaps); test(false); } catch(const Ice::UnknownLocalException& ex) @@ -835,7 +835,7 @@ allTests(const Ice::CommunicatorPtr& communicator) cl20 = Test::MyClassPrx::uncheckedCast(communicator->stringToProxy(ref20)); try { - cl20->ice_collocationOptimized(false)->ice_ping(); + cl20->ice_ping(); test(false); } catch(const Ice::UnsupportedProtocolException&) diff --git a/cpp/test/Ice/proxy/Collocated.cpp b/cpp/test/Ice/proxy/Collocated.cpp index 6c5465cff47..a5fafa0ed7f 100644 --- a/cpp/test/Ice/proxy/Collocated.cpp +++ b/cpp/test/Ice/proxy/Collocated.cpp @@ -22,7 +22,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator, communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); adapter->add(new MyDerivedClassI, communicator->stringToIdentity("test")); - adapter->activate(); + //adapter->activate(); // Don't activate OA to ensure collocation is used. Test::MyClassPrx allTests(const Ice::CommunicatorPtr&); allTests(communicator); diff --git a/cpp/test/Ice/retry/Collocated.cpp b/cpp/test/Ice/retry/Collocated.cpp index 3093330d89c..9f6f8ae407a 100644 --- a/cpp/test/Ice/retry/Collocated.cpp +++ b/cpp/test/Ice/retry/Collocated.cpp @@ -25,7 +25,7 @@ run(int, char**, const Ice::CommunicatorPtr& communicator) Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new RetryI; adapter->add(object, communicator->stringToIdentity("retry")); - adapter->activate(); + //adapter->activate(); // Don't activate OA to ensure collocation is used. RetryPrx allTests(const Ice::CommunicatorPtr&); RetryPrx retry = allTests(communicator); diff --git a/cs/test/Ice/dictMapping/Collocated.cs b/cs/test/Ice/dictMapping/Collocated.cs index b88175299c6..9cc589430ef 100644 --- a/cs/test/Ice/dictMapping/Collocated.cs +++ b/cs/test/Ice/dictMapping/Collocated.cs @@ -24,7 +24,7 @@ public class Collocated communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MyClassI(), communicator.stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator, true); diff --git a/cs/test/Ice/dispatcher/Collocated.cs b/cs/test/Ice/dispatcher/Collocated.cs index 0901c81d0ff..bbc17c0609a 100644 --- a/cs/test/Ice/dispatcher/Collocated.cs +++ b/cs/test/Ice/dispatcher/Collocated.cs @@ -29,9 +29,9 @@ public class Collocated Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("ControllerAdapter"); adapter.add(new TestI(), communicator.stringToIdentity("test")); - //adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. adapter2.add(new TestControllerI(adapter), communicator.stringToIdentity("testController")); - //adapter2.activate(); + //adapter2.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator); return 0; diff --git a/cs/test/Ice/metrics/Collocated.cs b/cs/test/Ice/metrics/Collocated.cs index 5259afb5e50..aa8c0430d72 100644 --- a/cs/test/Ice/metrics/Collocated.cs +++ b/cs/test/Ice/metrics/Collocated.cs @@ -23,12 +23,12 @@ public class Collocated { Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MetricsI(), communicator.stringToIdentity("metrics")); - //adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011"); Ice.ObjectAdapter controllerAdapter = communicator.createObjectAdapter("ControllerAdapter"); controllerAdapter.add(new ControllerI(adapter), communicator.stringToIdentity("controller")); - //controllerAdapter.activate(); + //controllerAdapter.activate(); // Don't activate OA to ensure collocation is used. Test.MetricsPrx metrics = AllTests.allTests(communicator, _observer); metrics.shutdown(); diff --git a/cs/test/Ice/operations/Collocated.cs b/cs/test/Ice/operations/Collocated.cs index 4d45b036b83..b2185183739 100644 --- a/cs/test/Ice/operations/Collocated.cs +++ b/cs/test/Ice/operations/Collocated.cs @@ -25,7 +25,7 @@ public class Collocated communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); Ice.ObjectPrx prx = adapter.add(new MyDerivedClassI(), communicator.stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. if(prx.ice_getConnection() != null) { diff --git a/cs/test/Ice/operations/Twoways.cs b/cs/test/Ice/operations/Twoways.cs index a0c9c5c31b8..d260c920982 100644 --- a/cs/test/Ice/operations/Twoways.cs +++ b/cs/test/Ice/operations/Twoways.cs @@ -752,6 +752,8 @@ class Twoways test(Ice.CollectionComparer.Equals(r, ctx)); } } + + if(p.ice_getConnection() != null) { // // Test implicit context propagation diff --git a/cs/test/Ice/operations/TwowaysAMI.cs b/cs/test/Ice/operations/TwowaysAMI.cs index 9c3f09c15da..9610d5f1fe4 100644 --- a/cs/test/Ice/operations/TwowaysAMI.cs +++ b/cs/test/Ice/operations/TwowaysAMI.cs @@ -1681,6 +1681,7 @@ public class TwowaysAMI } } + if(p.ice_getConnection() != null) { // // Test implicit context propagation diff --git a/cs/test/Ice/proxy/AllTests.cs b/cs/test/Ice/proxy/AllTests.cs index faf348a50d0..4b62bf82d25 100644 --- a/cs/test/Ice/proxy/AllTests.cs +++ b/cs/test/Ice/proxy/AllTests.cs @@ -688,7 +688,7 @@ public class AllTests : TestCommon.TestApp Test.MyClassPrx cl20 = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref20)); try { - cl20.ice_collocationOptimized(false).ice_ping(); + cl20.ice_ping(); test(false); } catch(Ice.UnsupportedEncodingException) @@ -700,7 +700,7 @@ public class AllTests : TestCommon.TestApp Test.MyClassPrx cl10 = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref10)); cl10.ice_ping(); cl10.ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); - cl.ice_collocationOptimized(false).ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); + cl.ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); // 1.3 isn't supported but since a 1.3 proxy supports 1.1, the // call will use the 1.1 encoding @@ -720,7 +720,7 @@ public class AllTests : TestCommon.TestApp inEncaps[4] = version.major; inEncaps[5] = version.minor; byte[] outEncaps; - cl.ice_collocationOptimized(false).ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, + cl.ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, out outEncaps); test(false); } @@ -741,7 +741,7 @@ public class AllTests : TestCommon.TestApp inEncaps[4] = version.major; inEncaps[5] = version.minor; byte[] outEncaps; - cl.ice_collocationOptimized(false).ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, + cl.ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, out outEncaps); test(false); } @@ -759,7 +759,7 @@ public class AllTests : TestCommon.TestApp cl20 = Test.MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref20)); try { - cl20.ice_collocationOptimized(false).ice_ping(); + cl20.ice_ping(); test(false); } catch(Ice.UnsupportedProtocolException) diff --git a/cs/test/Ice/proxy/Collocated.cs b/cs/test/Ice/proxy/Collocated.cs index c62fc69160d..c7558021172 100644 --- a/cs/test/Ice/proxy/Collocated.cs +++ b/cs/test/Ice/proxy/Collocated.cs @@ -24,7 +24,7 @@ public class Collocated communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MyDerivedClassI(), communicator.stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator); diff --git a/cs/test/Ice/seqMapping/Collocated.cs b/cs/test/Ice/seqMapping/Collocated.cs index 58421059898..55d21506894 100644 --- a/cs/test/Ice/seqMapping/Collocated.cs +++ b/cs/test/Ice/seqMapping/Collocated.cs @@ -24,7 +24,7 @@ public class Collocated communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MyClassI(), communicator.stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator, true); diff --git a/java/test/src/main/java/test/Ice/background/Collocated.java b/java/test/src/main/java/test/Ice/background/Collocated.java index ac3e4622f17..7505dfefd58 100644 --- a/java/test/src/main/java/test/Ice/background/Collocated.java +++ b/java/test/src/main/java/test/Ice/background/Collocated.java @@ -6,6 +6,7 @@ // ICE_LICENSE file included in this distribution. // // ********************************************************************** + package test.Ice.background; public class Collocated diff --git a/java/test/src/main/java/test/Ice/dispatcher/Collocated.java b/java/test/src/main/java/test/Ice/dispatcher/Collocated.java index 453311a3584..dfeb2f674a8 100644 --- a/java/test/src/main/java/test/Ice/dispatcher/Collocated.java +++ b/java/test/src/main/java/test/Ice/dispatcher/Collocated.java @@ -19,9 +19,9 @@ public class Collocated extends test.Util.Application assert(_dispatcher != null); adapter.add(new TestI(_dispatcher), communicator().stringToIdentity("test")); - //adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. adapter2.add(new TestControllerI(adapter), communicator().stringToIdentity("testController")); - //adapter2.activate(); + //adapter2.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator(), getWriter(), _dispatcher); return 0; diff --git a/java/test/src/main/java/test/Ice/interrupt/AllTests.java b/java/test/src/main/java/test/Ice/interrupt/AllTests.java index dbc7c159ddd..14286ea6896 100644 --- a/java/test/src/main/java/test/Ice/interrupt/AllTests.java +++ b/java/test/src/main/java/test/Ice/interrupt/AllTests.java @@ -558,6 +558,7 @@ public class AllTests out.print("testing Communicator.destroy interrupt... "); out.flush(); + if(p.ice_getConnection() != null) { // // Check that CommunicatorDestroyedException is raised directly. diff --git a/java/test/src/main/java/test/Ice/interrupt/Collocated.java b/java/test/src/main/java/test/Ice/interrupt/Collocated.java index 6e164020aee..8f82f8de45d 100644 --- a/java/test/src/main/java/test/Ice/interrupt/Collocated.java +++ b/java/test/src/main/java/test/Ice/interrupt/Collocated.java @@ -18,9 +18,9 @@ public class Collocated extends test.Util.Application Ice.ObjectAdapter adapter2 = communicator().createObjectAdapter("ControllerAdapter"); TestControllerI controller = new TestControllerI(adapter); adapter.add(new TestI(controller), communicator().stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. adapter2.add(controller, communicator().stringToIdentity("testController")); - adapter2.activate(); + //adapter2.activate(); // Don't activate OA to ensure collocation is used. try { diff --git a/java/test/src/main/java/test/Ice/metrics/Collocated.java b/java/test/src/main/java/test/Ice/metrics/Collocated.java index e1191a4de99..ad2446563d1 100644 --- a/java/test/src/main/java/test/Ice/metrics/Collocated.java +++ b/java/test/src/main/java/test/Ice/metrics/Collocated.java @@ -20,12 +20,12 @@ public class Collocated extends test.Util.Application Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MetricsI(), communicator.stringToIdentity("metrics")); - //adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011"); Ice.ObjectAdapter controllerAdapter = communicator.createObjectAdapter("ControllerAdapter"); controllerAdapter.add(new ControllerI(adapter), communicator.stringToIdentity("controller")); - //controllerAdapter.activate(); + //controllerAdapter.activate(); // Don't activate OA to ensure collocation is used. try { diff --git a/java/test/src/main/java/test/Ice/operations/Collocated.java b/java/test/src/main/java/test/Ice/operations/Collocated.java index ecfab090c8c..8f04dd42052 100644 --- a/java/test/src/main/java/test/Ice/operations/Collocated.java +++ b/java/test/src/main/java/test/Ice/operations/Collocated.java @@ -18,7 +18,7 @@ public class Collocated extends test.Util.Application java.io.PrintWriter out = getWriter(); Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); Ice.ObjectPrx prx = adapter.add(new MyDerivedClassI(), communicator().stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. if(prx.ice_getConnection() != null) { diff --git a/java/test/src/main/java/test/Ice/operations/Twoways.java b/java/test/src/main/java/test/Ice/operations/Twoways.java index c148edddb0e..4c99870b32b 100644 --- a/java/test/src/main/java/test/Ice/operations/Twoways.java +++ b/java/test/src/main/java/test/Ice/operations/Twoways.java @@ -90,10 +90,10 @@ class Twoways test(p.ice_id().equals(MyDerivedClass.ice_staticId())); - test(MyDerivedClassPrxHelper.ice_staticId().equals(MyDerivedClass.ice_staticId())); - test(Ice.ObjectPrxHelper.ice_staticId().equals(Ice.Object.ice_staticId)); - test(Ice.LocatorPrxHelper.ice_staticId().equals(Ice.Locator.ice_staticId)); - + test(MyDerivedClassPrxHelper.ice_staticId().equals(MyDerivedClass.ice_staticId())); + test(Ice.ObjectPrxHelper.ice_staticId().equals(Ice.Object.ice_staticId)); + test(Ice.LocatorPrxHelper.ice_staticId().equals(Ice.Locator.ice_staticId)); + { String[] ids = p.ice_ids(); test(ids.length == 3); @@ -833,6 +833,8 @@ class Twoways test(r.equals(ctx)); } } + + if(p.ice_getConnection() != null) { // // Test implicit context propagation diff --git a/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java b/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java index 70e1a6566a0..4fa98529216 100644 --- a/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java +++ b/java/test/src/main/java/test/Ice/operations/TwowaysAMI.java @@ -1669,6 +1669,7 @@ class TwowaysAMI } } + if(p.ice_getConnection() != null) { // // Test implicit context propagation diff --git a/java/test/src/main/java/test/Ice/proxy/AllTests.java b/java/test/src/main/java/test/Ice/proxy/AllTests.java index 98e3c124fbb..2919b741a19 100644 --- a/java/test/src/main/java/test/Ice/proxy/AllTests.java +++ b/java/test/src/main/java/test/Ice/proxy/AllTests.java @@ -697,7 +697,7 @@ public class AllTests MyClassPrx cl20 = MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref20)); try { - cl20.ice_collocationOptimized(false).ice_ping(); + cl20.ice_ping(); test(false); } catch(Ice.UnsupportedEncodingException ex) @@ -709,7 +709,7 @@ public class AllTests MyClassPrx cl10 = MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref10)); cl10.ice_ping(); cl10.ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); - cl.ice_collocationOptimized(false).ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); + cl.ice_encodingVersion(Ice.Util.Encoding_1_0).ice_ping(); // 1.3 isn't supported but since a 1.3 proxy supports 1.1, the // call will use the 1.1 encoding @@ -729,7 +729,7 @@ public class AllTests inEncaps[4] = version.major; inEncaps[5] = version.minor; Ice.ByteSeqHolder outEncaps = new Ice.ByteSeqHolder(); - cl.ice_collocationOptimized(false).ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, outEncaps); + cl.ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, outEncaps); test(false); } catch(Ice.UnknownLocalException ex) @@ -749,7 +749,7 @@ public class AllTests inEncaps[4] = version.major; inEncaps[5] = version.minor; Ice.ByteSeqHolder outEncaps = new Ice.ByteSeqHolder(); - cl.ice_collocationOptimized(false).ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, outEncaps); + cl.ice_invoke("ice_ping", Ice.OperationMode.Normal, inEncaps, outEncaps); test(false); } catch(Ice.UnknownLocalException ex) @@ -766,7 +766,7 @@ public class AllTests cl20 = MyClassPrxHelper.uncheckedCast(communicator.stringToProxy(ref20)); try { - cl20.ice_collocationOptimized(false).ice_ping(); + cl20.ice_ping(); test(false); } catch(Ice.UnsupportedProtocolException ex) diff --git a/java/test/src/main/java/test/Ice/proxy/Collocated.java b/java/test/src/main/java/test/Ice/proxy/Collocated.java index 26e71003545..103451157d0 100644 --- a/java/test/src/main/java/test/Ice/proxy/Collocated.java +++ b/java/test/src/main/java/test/Ice/proxy/Collocated.java @@ -18,7 +18,7 @@ public class Collocated extends test.Util.Application communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new MyDerivedClassI(), communicator.stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator, getWriter()); diff --git a/java/test/src/main/java/test/Ice/retry/Collocated.java b/java/test/src/main/java/test/Ice/retry/Collocated.java index d28834990c9..481c1f6c661 100644 --- a/java/test/src/main/java/test/Ice/retry/Collocated.java +++ b/java/test/src/main/java/test/Ice/retry/Collocated.java @@ -19,7 +19,7 @@ public class Collocated extends test.Util.Application Ice.Communicator communicator = communicator(); Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); adapter.add(new RetryI(), communicator.stringToIdentity("retry")); - //adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. RetryPrx retry = AllTests.allTests(communicator, getWriter()); retry.shutdown(); diff --git a/java/test/src/main/java/test/Ice/seqMapping/Collocated.java b/java/test/src/main/java/test/Ice/seqMapping/Collocated.java index bafcdce6b20..bf83972f114 100644 --- a/java/test/src/main/java/test/Ice/seqMapping/Collocated.java +++ b/java/test/src/main/java/test/Ice/seqMapping/Collocated.java @@ -18,7 +18,7 @@ public class Collocated extends test.Util.Application java.io.PrintWriter out = getWriter(); Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); adapter.add(new MyClassI(), communicator().stringToIdentity("test")); - adapter.activate(); + //adapter.activate(); // Don't activate OA to ensure collocation is used. AllTests.allTests(communicator(), true, out); 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")) |