diff options
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/operations/Test.ice | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMD.ice | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.cpp | 7 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestAMDI.h | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.cpp | 6 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TestI.h | 2 | ||||
-rw-r--r-- | cpp/test/Ice/operations/Twoways.cpp | 22 | ||||
-rw-r--r-- | cpp/test/Ice/operations/TwowaysAMI.cpp | 83 |
8 files changed, 125 insertions, 1 deletions
diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index 201f10fc8c5..3efa1db86e9 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -143,6 +143,8 @@ dictionary<string, MyEnum> StringMyEnumD; IntS opIntS(IntS s); + StringStringD opContext(); + }; ["ami"] class MyDerivedClass extends MyClass diff --git a/cpp/test/Ice/operations/TestAMD.ice b/cpp/test/Ice/operations/TestAMD.ice index b69fd08f7c1..349880ab7e9 100644 --- a/cpp/test/Ice/operations/TestAMD.ice +++ b/cpp/test/Ice/operations/TestAMD.ice @@ -143,6 +143,8 @@ dictionary<string, MyEnum> StringMyEnumD; IntS opIntS(IntS s); + StringStringD opContext(); + }; ["ami", "amd"] class MyDerivedClass extends MyClass diff --git a/cpp/test/Ice/operations/TestAMDI.cpp b/cpp/test/Ice/operations/TestAMDI.cpp index 20fd976b205..cc526f023b4 100644 --- a/cpp/test/Ice/operations/TestAMDI.cpp +++ b/cpp/test/Ice/operations/TestAMDI.cpp @@ -358,6 +358,13 @@ MyDerivedClassI::opIntS_async(const ::Test::AMD_MyClass_opIntSPtr& cb, const Tes } void +MyDerivedClassI::opContext_async(const ::Test::AMD_MyClass_opContextPtr& cb, const Ice::Current& c) +{ + Test::StringStringD r = c.ctx; + cb->ice_response(r); +} + +void MyDerivedClassI::opDerived_async(const Test::AMD_MyDerivedClass_opDerivedPtr& cb, const Ice::Current&) { diff --git a/cpp/test/Ice/operations/TestAMDI.h b/cpp/test/Ice/operations/TestAMDI.h index fe82a7007ca..404f96feb7a 100644 --- a/cpp/test/Ice/operations/TestAMDI.h +++ b/cpp/test/Ice/operations/TestAMDI.h @@ -124,6 +124,8 @@ public: virtual void opIntS_async(const ::Test::AMD_MyClass_opIntSPtr&, const Test::IntS&, const Ice::Current&); + virtual void opContext_async(const ::Test::AMD_MyClass_opContextPtr&, const Ice::Current&); + virtual void opDerived_async(const Test::AMD_MyDerivedClass_opDerivedPtr&, const Ice::Current&); diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index cdb67074963..a2e278052bf 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -335,6 +335,12 @@ MyDerivedClassI::opIntS(const Test::IntS& s, const Ice::Current&) return r; } +Test::StringStringD +MyDerivedClassI::opContext(const Ice::Current& c) +{ + return c.ctx; +} + void MyDerivedClassI::opDerived(const Ice::Current&) { diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index fe9f1c7aba3..9dfeaf18f0f 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -148,6 +148,8 @@ public: virtual Test::IntS opIntS(const Test::IntS&, const Ice::Current&); + virtual Test::StringStringD opContext(const Ice::Current&); + virtual void opDerived(const Ice::Current&); private: diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 3fc8b6cc167..950bb3da412 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -591,4 +591,26 @@ twoways(const Test::MyClassPrx& p) } } } + + { + Ice::Context ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + { + Test::StringStringD r = p->opContext(); + test(r != ctx); + } + { + Test::StringStringD r = p->opContext(ctx); + test(r == ctx); + } + { + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_newContext(ctx)); + Test::StringStringD r = p2->opContext(); + test(r == ctx); + r = p2->opContext(ctx); + test(r == ctx); + } + } } diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp index cd3af19f958..deb351d5d6e 100644 --- a/cpp/test/Ice/operations/TwowaysAMI.cpp +++ b/cpp/test/Ice/operations/TwowaysAMI.cpp @@ -696,6 +696,8 @@ public: } }; +typedef IceUtil::Handle<AMI_MyClass_opStringMyEnumDI> AMI_MyClass_opStringMyEnumDIPtr; + class AMI_MyClass_opIntSI : public Test::AMI_MyClass_opIntS, public CallbackBase { public: @@ -724,7 +726,57 @@ private: typedef IceUtil::Handle<AMI_MyClass_opIntSI> AMI_MyClass_opIntSIPtr; -typedef IceUtil::Handle<AMI_MyClass_opStringMyEnumDI> AMI_MyClass_opStringMyEnumDIPtr; +class AMI_MyClass_opContextEqualI : public Test::AMI_MyClass_opContext, public CallbackBase +{ +public: + + AMI_MyClass_opContextEqualI(const Test::StringStringD &d) : _d(d) + { + } + + virtual void ice_response(const Test::StringStringD& r) + { + test(r == _d); + called(); + } + + virtual void ice_exception(const ::Ice::Exception&) + { + test(false); + } + +private: + + Test::StringStringD _d; +}; + +typedef IceUtil::Handle<AMI_MyClass_opContextEqualI> AMI_MyClass_opContextEqualIPtr; + +class AMI_MyClass_opContextNotEqualI : public Test::AMI_MyClass_opContext, public CallbackBase +{ +public: + + AMI_MyClass_opContextNotEqualI(const Test::StringStringD &d) : _d(d) + { + } + + virtual void ice_response(const Test::StringStringD& r) + { + test(r != _d); + called(); + } + + virtual void ice_exception(const ::Ice::Exception&) + { + test(false); + } + +private: + + Test::StringStringD _d; +}; + +typedef IceUtil::Handle<AMI_MyClass_opContextNotEqualI> AMI_MyClass_opContextNotEqualIPtr; class AMI_MyDerivedClass_opDerivedI : public Test::AMI_MyDerivedClass_opDerived, public CallbackBase { @@ -1039,6 +1091,35 @@ twowaysAMI(const Test::MyClassPrx& p) } { + Test::StringStringD ctx; + ctx["one"] = "ONE"; + ctx["two"] = "TWO"; + ctx["three"] = "THREE"; + { + AMI_MyClass_opContextNotEqualIPtr cb = new AMI_MyClass_opContextNotEqualI(ctx); + p->opContext_async(cb); + test(cb->check()); + } + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p->opContext_async(cb, ctx); + test(cb->check()); + } + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_newContext(ctx)); + { + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p2->opContext_async(cb); + test(cb->check()); + } + { + Test::MyClassPrx p2 = Test::MyClassPrx::checkedCast(p->ice_newContext(ctx)); + AMI_MyClass_opContextEqualIPtr cb = new AMI_MyClass_opContextEqualI(ctx); + p2->opContext_async(cb, ctx); + test(cb->check()); + } + } + + { Test::MyDerivedClassPrx derived = Test::MyDerivedClassPrx::checkedCast(p); test(derived); AMI_MyDerivedClass_opDerivedIPtr cb = new AMI_MyDerivedClass_opDerivedI; |