summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/operations/OnewaysNewAMI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-12-04 10:02:20 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-12-04 10:02:20 +0100
commit97b8898f58ca33ccbf8a24d483c6a7e530c4ac21 (patch)
tree89e4e9d041999d4c0c1b54607826e65e85340fac /cpp/test/Ice/operations/OnewaysNewAMI.cpp
parent4089 - IceGrid database corruption. (diff)
downloadice-97b8898f58ca33ccbf8a24d483c6a7e530c4ac21.tar.bz2
ice-97b8898f58ca33ccbf8a24d483c6a7e530c4ac21.tar.xz
ice-97b8898f58ca33ccbf8a24d483c6a7e530c4ac21.zip
Fixed bug 4426 and 4409
Diffstat (limited to 'cpp/test/Ice/operations/OnewaysNewAMI.cpp')
-rw-r--r--cpp/test/Ice/operations/OnewaysNewAMI.cpp68
1 files changed, 32 insertions, 36 deletions
diff --git a/cpp/test/Ice/operations/OnewaysNewAMI.cpp b/cpp/test/Ice/operations/OnewaysNewAMI.cpp
index 21694cb3df9..c8f6517edb6 100644
--- a/cpp/test/Ice/operations/OnewaysNewAMI.cpp
+++ b/cpp/test/Ice/operations/OnewaysNewAMI.cpp
@@ -78,22 +78,6 @@ public:
{
test(false);
}
-
- void twowayOnlyException(const Ice::Exception& ex)
- {
- try
- {
- ex.ice_throw();
- }
- catch(const Ice::TwowayOnlyException&)
- {
- called();
- }
- catch(const Ice::Exception&)
- {
- test(false);
- }
- }
};
typedef IceUtil::Handle<Callback> CallbackPtr;
@@ -113,24 +97,36 @@ onewaysNewAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx&
}
{
- CallbackPtr cb = new Callback;
- Ice::Callback_Object_ice_isAPtr callback = Ice::newCallback_Object_ice_isA(cb, &Callback::twowayOnlyException);
- p->begin_ice_isA(Test::MyClass::ice_staticId(), callback);
- cb->check();
+ try
+ {
+ p->begin_ice_isA(Test::MyClass::ice_staticId());
+ test(false);
+ }
+ catch(const IceUtil::IllegalArgumentException&)
+ {
+ }
}
{
- CallbackPtr cb = new Callback;
- Ice::Callback_Object_ice_idPtr callback = Ice::newCallback_Object_ice_id(cb, &Callback::twowayOnlyException);
- p->begin_ice_id(callback);
- cb->check();
+ try
+ {
+ p->begin_ice_id();
+ test(false);
+ }
+ catch(const IceUtil::IllegalArgumentException&)
+ {
+ }
}
{
- CallbackPtr cb = new Callback;
- Ice::Callback_Object_ice_idsPtr callback = Ice::newCallback_Object_ice_ids(cb, &Callback::twowayOnlyException);
- p->begin_ice_ids(callback);
- cb->check();
+ try
+ {
+ p->begin_ice_ids();
+ test(false);
+ }
+ catch(const IceUtil::IllegalArgumentException&)
+ {
+ }
}
{
@@ -143,14 +139,14 @@ onewaysNewAMI(const Ice::CommunicatorPtr& communicator, const Test::MyClassPrx&
}
}
- //
- // Test that calling a twoway operation with a oneway proxy raises TwowayOnlyException.
- //
{
- CallbackPtr cb = new Callback;
- Test::Callback_MyClass_opBytePtr callback =
- Test::newCallback_MyClass_opByte(cb, &Callback::opByte, &Callback::twowayOnlyException);
- p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f), callback);
- cb->check();
+ try
+ {
+ p->begin_opByte(Ice::Byte(0xff), Ice::Byte(0x0f));
+ test(false);
+ }
+ catch(const IceUtil::IllegalArgumentException&)
+ {
+ }
}
}