summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-11-26 14:18:59 -0330
committerDwayne Boone <dwayne@zeroc.com>2009-11-26 14:18:59 -0330
commiteb9894afe8da3a9ef6a7da0ca27e0a6b32676b0c (patch)
treeb0abd1a4d60e7842b1b74ac8c9bbb02797db8a8b /cpp
parentRemoved getCookie from C# AsyncResult (diff)
downloadice-eb9894afe8da3a9ef6a7da0ca27e0a6b32676b0c.tar.bz2
ice-eb9894afe8da3a9ef6a7da0ca27e0a6b32676b0c.tar.xz
ice-eb9894afe8da3a9ef6a7da0ca27e0a6b32676b0c.zip
Added invoke test
Cleaned up invoke demo Fixed order of paramaters in end_ice_invoke in C++
Diffstat (limited to 'cpp')
-rwxr-xr-xcpp/allTests.py1
-rw-r--r--cpp/demo/Ice/invoke/Client.cpp267
-rw-r--r--cpp/demo/Ice/invoke/README4
-rw-r--r--cpp/include/Ice/Object.h2
-rw-r--r--cpp/include/Ice/Proxy.h12
-rw-r--r--cpp/src/Ice/Proxy.cpp4
-rw-r--r--cpp/test/Ice/Makefile3
-rw-r--r--cpp/test/Ice/Makefile.mak5
-rw-r--r--cpp/test/Ice/invoke/.depend8
-rw-r--r--cpp/test/Ice/invoke/.gitignore7
-rw-r--r--cpp/test/Ice/invoke/AllTests.cpp435
-rw-r--r--cpp/test/Ice/invoke/BlobjectI.cpp104
-rw-r--r--cpp/test/Ice/invoke/BlobjectI.h47
-rw-r--r--cpp/test/Ice/invoke/Client.cpp62
-rw-r--r--cpp/test/Ice/invoke/Makefile43
-rw-r--r--cpp/test/Ice/invoke/Makefile.mak51
-rw-r--r--cpp/test/Ice/invoke/Server.cpp130
-rw-r--r--cpp/test/Ice/invoke/Test.ice31
-rwxr-xr-xcpp/test/Ice/invoke/run.py31
19 files changed, 1008 insertions, 239 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py
index c713bb80dcb..58eeeef6a86 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -59,6 +59,7 @@ tests = [
("Ice/stringConverter", ["core"]),
("Ice/udp", ["core"]),
("Ice/defaultServant", ["core"]),
+ ("Ice/invoke", ["core", "novc6"]),
("IceSSL/configuration", ["once", "novalgrind"]), # valgrind doesn't work well with openssl
("IceBox/configuration", ["core", "noipv6", "nobcc", "novc6"]),
("Freeze/dbmap", ["once", "novc6"]),
diff --git a/cpp/demo/Ice/invoke/Client.cpp b/cpp/demo/Ice/invoke/Client.cpp
index 4226899e60a..c13d94b57d0 100644
--- a/cpp/demo/Ice/invoke/Client.cpp
+++ b/cpp/demo/Ice/invoke/Client.cpp
@@ -31,106 +31,6 @@ operator<<(ostream& out, Demo::Color c)
return out;
}
-class AMI_Object_ice_invokeI : public Ice::AMI_Object_ice_invoke
-{
-public:
-
- virtual void
- ice_response(bool result, const Ice::ByteSeq& outParams)
- {
- if(!result)
- {
- cout << "Unknown user exception" << endl;
- }
- }
-
- virtual void
- ice_exception(const Ice::Exception& ex)
- {
- cout << ex << endl;
- }
-};
-
-class AMI_Object_ice_invokeGetValuesI : public Ice::AMI_Object_ice_invoke
-{
-public:
-
- AMI_Object_ice_invokeGetValuesI(const Ice::CommunicatorPtr& communicator) :
- _communicator(communicator)
- {
- }
-
- virtual void
- ice_response(bool result, const Ice::ByteSeq& outParams)
- {
- if(!result)
- {
- cout << "Unknown user exception" << endl;
- }
- else
- {
- //
- // Unmarshal the results.
- //
- Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
- Demo::CPtr c;
- in->read(c);
- string str = in->readString();
- in->readPendingObjects();
- cout << "Got string `" << str << "' and class: s.name=" << c->s.name
- << ", s.value=" << c->s.value << endl;
- }
- }
-
- virtual void
- ice_exception(const Ice::Exception& ex)
- {
- cout << ex << endl;
- }
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
-class AMI_Object_ice_invokeThrowPrintFailureI : public Ice::AMI_Object_ice_invoke
-{
-public:
-
- AMI_Object_ice_invokeThrowPrintFailureI(const Ice::CommunicatorPtr& communicator) :
- _communicator(communicator)
- {
- }
-
- virtual void
- ice_response(bool result, const Ice::ByteSeq& outParams)
- {
- Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
- try
- {
- in->throwException();
- }
- catch(const Demo::PrintFailure&)
- {
- // Expected.
- }
- catch(const Ice::UserException&)
- {
- cout << "Unknown user exception" << endl;
- }
- }
-
- virtual void
- ice_exception(const Ice::Exception& ex)
- {
- cout << ex << endl;
- }
-
-private:
-
- Ice::CommunicatorPtr _communicator;
-};
-
class InvokeClient : public Ice::Application
{
public:
@@ -163,14 +63,9 @@ InvokeClient::InvokeClient() :
int
InvokeClient::run(int argc, char* argv[])
{
- bool async = false;
- if(argc == 2 && strcmp(argv[1], "--async") == 0)
- {
- async = true;
- }
- else if(argc > 1)
+ if(argc > 1)
{
- cerr << "Usage: " << appName() << " [--async]" << endl;
+ cerr << appName() << ": too many arguments" << endl;
return EXIT_FAILURE;
}
@@ -198,16 +93,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
- {
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printString", Ice::Normal, inParams);
- }
- else
+ if(!obj->ice_invoke("printString", Ice::Normal, inParams, outParams))
{
- if(!obj->ice_invoke("printString", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '2')
@@ -228,16 +116,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
+ if(!obj->ice_invoke("printStringSequence", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printStringSequence", Ice::Normal, inParams);
- }
- else
- {
- if(!obj->ice_invoke("printStringSequence", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '3')
@@ -256,16 +137,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
+ if(!obj->ice_invoke("printDictionary", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printDictionary", Ice::Normal, inParams);
- }
- else
- {
- if(!obj->ice_invoke("printDictionary", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '4')
@@ -281,16 +155,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
- {
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printEnum", Ice::Normal, inParams);
- }
- else
+ if(!obj->ice_invoke("printEnum", Ice::Normal, inParams, outParams))
{
- if(!obj->ice_invoke("printEnum", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '5')
@@ -309,16 +176,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
- {
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printStruct", Ice::Normal, inParams);
- }
- else
+ if(!obj->ice_invoke("printStruct", Ice::Normal, inParams, outParams))
{
- if(!obj->ice_invoke("printStruct", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '6')
@@ -344,16 +204,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
+ if(!obj->ice_invoke("printStructSequence", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printStructSequence", Ice::Normal, inParams);
- }
- else
- {
- if(!obj->ice_invoke("printStructSequence", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '7')
@@ -373,16 +226,9 @@ InvokeClient::run(int argc, char* argv[])
//
// Invoke operation.
//
- if(async)
+ if(!obj->ice_invoke("printClass", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "printClass", Ice::Normal, inParams);
- }
- else
- {
- if(!obj->ice_invoke("printClass", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- }
+ cout << "Unknown user exception" << endl;
}
}
else if(ch == '8')
@@ -391,30 +237,22 @@ InvokeClient::run(int argc, char* argv[])
// Invoke operation.
//
Ice::ByteSeq inParams, outParams;
- if(async)
+ if(!obj->ice_invoke("getValues", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeGetValuesI(communicator()), "getValues",
- Ice::Normal, inParams);
+ cout << "Unknown user exception" << endl;
+ continue;
}
- else
- {
- if(!obj->ice_invoke("getValues", Ice::Normal, inParams, outParams))
- {
- cout << "Unknown user exception" << endl;
- continue;
- }
- //
- // Unmarshal the results.
- //
- Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
- Demo::CPtr c;
- in->read(c);
- string str = in->readString();
- in->readPendingObjects();
- cout << "Got string `" << str << "' and class: s.name=" << c->s.name
- << ", s.value=" << c->s.value << endl;
- }
+ //
+ // Unmarshal the results.
+ //
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
+ Demo::CPtr c;
+ in->read(c);
+ string str = in->readString();
+ in->readPendingObjects();
+ cout << "Got string `" << str << "' and class: s.name=" << c->s.name
+ << ", s.value=" << c->s.value << endl;
}
else if(ch == '9')
{
@@ -422,46 +260,31 @@ InvokeClient::run(int argc, char* argv[])
// Invoke operation.
//
Ice::ByteSeq inParams, outParams;
- if(async)
+ if(obj->ice_invoke("throwPrintFailure", Ice::Normal, inParams, outParams))
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeThrowPrintFailureI(communicator()),
- "throwPrintFailure", Ice::Normal, inParams);
+ cout << "Expected exception" << endl;
+ continue;
}
- else
- {
- if(obj->ice_invoke("throwPrintFailure", Ice::Normal, inParams, outParams))
- {
- cout << "Expected exception" << endl;
- continue;
- }
- Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
- try
- {
- in->throwException();
- }
- catch(const Demo::PrintFailure&)
- {
- // Expected.
- }
- catch(const Ice::UserException&)
- {
- cout << "Unknown user exception" << endl;
- }
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator(), outParams);
+ try
+ {
+ in->throwException();
}
- }
- else if(ch == 's')
- {
- Ice::ByteSeq inParams, outParams;
- if(async)
+ catch(const Demo::PrintFailure&)
{
- obj->ice_invoke_async(new AMI_Object_ice_invokeI(), "shutdown", Ice::Normal, inParams);
+ // Expected.
}
- else
+ catch(const Ice::UserException&)
{
- obj->ice_invoke("shutdown", Ice::Normal, inParams, outParams);
+ cout << "Unknown user exception" << endl;
}
}
+ else if(ch == 's')
+ {
+ Ice::ByteSeq inParams, outParams;
+ obj->ice_invoke("shutdown", Ice::Normal, inParams, outParams);
+ }
else if(ch == 'x')
{
// Nothing to do.
diff --git a/cpp/demo/Ice/invoke/README b/cpp/demo/Ice/invoke/README
index 8fc943163cc..76ca767d80b 100644
--- a/cpp/demo/Ice/invoke/README
+++ b/cpp/demo/Ice/invoke/README
@@ -7,7 +7,3 @@ $ server
In a separate window, start the client:
$ client
-
-To run the client using asynchronous calls use:
-
-$ client --async
diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h
index c3170a88ff3..325ffa35ba3 100644
--- a/cpp/include/Ice/Object.h
+++ b/cpp/include/Ice/Object.h
@@ -146,7 +146,6 @@ class ICE_API BlobjectAsync : virtual public Object
{
public:
- // Returns true if ok, false if user exception.
virtual void ice_invoke_async(const AMD_Object_ice_invokePtr&, const std::vector<Byte>&, const Current&) = 0;
virtual DispatchStatus __dispatch(IceInternal::Incoming&, const Current&);
};
@@ -155,7 +154,6 @@ class ICE_API BlobjectArrayAsync : virtual public Object
{
public:
- // Returns true if ok, false if user exception.
virtual void ice_invoke_async(const AMD_Object_ice_invokePtr&, const std::pair<const Byte*, const Byte*>&,
const Current&) = 0;
virtual DispatchStatus __dispatch(IceInternal::Incoming&, const Current&);
diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h
index 0fd5603a2d1..c3729e4826c 100644
--- a/cpp/include/Ice/Proxy.h
+++ b/cpp/include/Ice/Proxy.h
@@ -425,7 +425,7 @@ public:
return begin_ice_invoke(operation, mode, inParams, &__ctx, __del, __cookie);
}
- bool end_ice_invoke(const ::Ice::AsyncResultPtr&, ::std::vector< ::Ice::Byte>&);
+ bool end_ice_invoke(::std::vector< ::Ice::Byte>&, const ::Ice::AsyncResultPtr&);
bool ice_invoke(const ::std::string& operation,
::Ice::OperationMode mode,
@@ -503,7 +503,7 @@ public:
return begin_ice_invoke(operation, mode, inParams, &__ctx, __del, __cookie);
}
- bool end_ice_invoke(const ::Ice::AsyncResultPtr&, ::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&);
+ bool end_ice_invoke(::std::pair<const ::Ice::Byte*, const ::Ice::Byte*>&, const ::Ice::AsyncResultPtr&);
::Ice::Identity ice_getIdentity() const;
::Ice::ObjectPrx ice_identity(const ::Ice::Identity&) const;
@@ -1590,7 +1590,7 @@ public:
std::vector< ::Ice::Byte> outParams;
try
{
- __ok = __result->getProxy()->end_ice_invoke(__result, outParams);
+ __ok = __result->getProxy()->end_ice_invoke(outParams, __result);
}
catch(const ::Ice::Exception& ex)
{
@@ -1615,7 +1615,7 @@ public:
std::pair<const ::Ice::Byte*, const::Ice::Byte*> outParams;
try
{
- __ok = __result->getProxy()->end_ice_invoke(__result, outParams);
+ __ok = __result->getProxy()->end_ice_invoke(outParams, __result);
}
catch(const ::Ice::Exception& ex)
{
@@ -1670,7 +1670,7 @@ public:
std::vector< ::Ice::Byte> outParams;
try
{
- __ok = __result->getProxy()->end_ice_invoke(__result, outParams);
+ __ok = __result->getProxy()->end_ice_invoke(outParams, __result);
}
catch(const ::Ice::Exception& ex)
{
@@ -1697,7 +1697,7 @@ public:
std::pair<const ::Ice::Byte*, const::Ice::Byte*> outParams;
try
{
- __ok = __result->getProxy()->end_ice_invoke(__result, outParams);
+ __ok = __result->getProxy()->end_ice_invoke(outParams, __result);
}
catch(const ::Ice::Exception& ex)
{
diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp
index e8e583cf78c..cb31063381e 100644
--- a/cpp/src/Ice/Proxy.cpp
+++ b/cpp/src/Ice/Proxy.cpp
@@ -468,7 +468,7 @@ IceProxy::Ice::Object::begin_ice_invoke(const string& operation,
}
bool
-IceProxy::Ice::Object::end_ice_invoke(const AsyncResultPtr& __result, vector<Byte>& outParams)
+IceProxy::Ice::Object::end_ice_invoke(vector<Byte>& outParams, const AsyncResultPtr& __result)
{
AsyncResult::__check(__result, this, ice_invoke_name);
bool ok = __result->__wait();
@@ -592,7 +592,7 @@ IceProxy::Ice::Object::begin_ice_invoke(const string& operation,
}
bool
-IceProxy::Ice::Object::end_ice_invoke(const AsyncResultPtr& __result, pair<const Byte*, const Byte*>& outParams)
+IceProxy::Ice::Object::end_ice_invoke(pair<const Byte*, const Byte*>& outParams, const AsyncResultPtr& __result)
{
AsyncResult::__check(__result, this, ice_invoke_name);
bool ok = __result->__wait();
diff --git a/cpp/test/Ice/Makefile b/cpp/test/Ice/Makefile
index d4a2b82b556..c606bf3ef27 100644
--- a/cpp/test/Ice/Makefile
+++ b/cpp/test/Ice/Makefile
@@ -37,7 +37,8 @@ SUBDIRS = proxy \
background \
udp \
defaultServant \
- threadPoolPriority
+ threadPoolPriority \
+ invoke
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak
index fdeb3dfafd2..36f808dbec7 100644
--- a/cpp/test/Ice/Makefile.mak
+++ b/cpp/test/Ice/Makefile.mak
@@ -36,11 +36,12 @@ SUBDIRS = proxy \
background \
udp \
defaultServant \
- threadPoolPriority
+ threadPoolPriority \
!if "$(CPP_COMPILER)" != "VC60"
SUBDIRS = $(SUBDIRS) \
- stream
+ stream,
+ invoke
!endif
$(EVERYTHING)::
diff --git a/cpp/test/Ice/invoke/.depend b/cpp/test/Ice/invoke/.depend
new file mode 100644
index 00000000000..f2177514ce0
--- /dev/null
+++ b/cpp/test/Ice/invoke/.depend
@@ -0,0 +1,8 @@
+Test$(OBJEXT): Test.cpp ./Test.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/Stream.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/ObjectFactory.h $(includedir)/IceUtil/Iterator.h
+Client$(OBJEXT): Client.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h ../../include/TestCommon.h ./Test.h
+AllTests$(OBJEXT): AllTests.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h ../../include/TestCommon.h ./Test.h
+Test$(OBJEXT): Test.cpp ./Test.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/Stream.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/ObjectFactory.h $(includedir)/IceUtil/Iterator.h
+BlobjectI$(OBJEXT): BlobjectI.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h ./BlobjectI.h ./Test.h ../../include/TestCommon.h
+Server$(OBJEXT): Server.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/RecMutex.h ./BlobjectI.h
+Test.cpp: Test.ice
+Test.ice: $(SLICE2CPP) $(SLICEPARSERLIB)
diff --git a/cpp/test/Ice/invoke/.gitignore b/cpp/test/Ice/invoke/.gitignore
new file mode 100644
index 00000000000..67872faa673
--- /dev/null
+++ b/cpp/test/Ice/invoke/.gitignore
@@ -0,0 +1,7 @@
+// Generated by makegitignore.py
+
+// IMPORTANT: Do not edit this file -- any edits made here will be lost!
+client
+server
+Test.cpp
+Test.h
diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp
new file mode 100644
index 00000000000..5d334bcfd18
--- /dev/null
+++ b/cpp/test/Ice/invoke/AllTests.cpp
@@ -0,0 +1,435 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <Ice/Stream.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+
+static string testString = "This is a test string";
+
+class Cookie : public Ice::LocalObject
+{
+public:
+
+ string getString()
+ {
+ return testString;
+ }
+};
+typedef IceUtil::Handle<Cookie> CookiePtr;
+
+class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
+{
+public:
+
+ CallbackBase() :
+ _called(false)
+ {
+ }
+
+ virtual ~CallbackBase()
+ {
+ }
+
+ void check()
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ while(!_called)
+ {
+ wait();
+ }
+ _called = false;
+ }
+
+protected:
+
+ void called()
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ assert(!_called);
+ _called = true;
+ notify();
+ }
+
+private:
+
+ bool _called;
+};
+
+class Callback : public IceUtil::Shared, public CallbackBase
+{
+public:
+
+ Callback(const Ice::CommunicatorPtr& communicator, bool useCookie) :
+ _communicator(communicator),
+ _useCookie(useCookie)
+ {
+ }
+
+ void opString(const Ice::AsyncResultPtr& result)
+ {
+ string cmp = testString;
+ if(_useCookie)
+ {
+ CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
+ cmp = cookie->getString();
+ }
+
+ Ice::ByteSeq outParams;
+ if(result->getProxy()->end_ice_invoke(outParams, result))
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == cmp);
+ in->read(s);
+ test(s == cmp);
+ called();
+ }
+ else
+ {
+ test(false);
+ };
+ }
+
+ void opException(const Ice::AsyncResultPtr& result)
+ {
+ if(_useCookie)
+ {
+ CookiePtr cookie = CookiePtr::dynamicCast(result->getCookie());
+ test(cookie->getString() == testString);
+ }
+
+ Ice::ByteSeq outParams;
+ if(result->getProxy()->end_ice_invoke(outParams, result))
+ {
+ test(false);
+ }
+ else
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ try
+ {
+ in->throwException();
+ }
+ catch(const Test::MyException&)
+ {
+ called();
+ }
+ catch(...)
+ {
+ test(false);
+ }
+ }
+ }
+
+ void opStringNC(bool ok, const Ice::ByteSeq& outParams)
+ {
+ if(ok)
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == testString);
+ in->read(s);
+ test(s == testString);
+ called();
+ }
+ else
+ {
+ test(false);
+ }
+ }
+
+ void opStringWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
+ {
+ if(ok)
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == cookie->getString());
+ in->read(s);
+ test(s == cookie->getString());
+ called();
+ }
+ else
+ {
+ test(false);
+ }
+ }
+
+ void opExceptionNC(bool ok, const Ice::ByteSeq& outParams)
+ {
+ if(ok)
+ {
+ test(false);
+ }
+ else
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ try
+ {
+ in->throwException();
+ }
+ catch(const Test::MyException&)
+ {
+ called();
+ }
+ catch(...)
+ {
+ test(false);
+ }
+ }
+ }
+
+ void opExceptionWC(bool ok, const Ice::ByteSeq& outParams, const CookiePtr& cookie)
+ {
+ test(cookie->getString() == testString);
+ if(ok)
+ {
+ test(false);
+ }
+ else
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(_communicator, outParams);
+ try
+ {
+ in->throwException();
+ }
+ catch(const Test::MyException&)
+ {
+ called();
+ }
+ catch(...)
+ {
+ test(false);
+ }
+ }
+ }
+
+private:
+
+ Ice::CommunicatorPtr _communicator;
+ bool _useCookie;
+};
+typedef IceUtil::Handle<Callback> CallbackPtr;
+
+Test::MyClassPrx
+allTests(const Ice::CommunicatorPtr& communicator)
+{
+ string ref = "test:default -p 12010";
+ Ice::ObjectPrx base = communicator->stringToProxy(ref);
+ test(base);
+
+ Test::MyClassPrx cl = Test::MyClassPrx::checkedCast(base);
+ test(cl);
+
+ cout << "testing ice_invoke... " << flush;
+
+ {
+ Ice::ByteSeq inParams, outParams;
+ Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
+ out->write(testString);
+ out->finished(inParams);
+
+ // ice_invoke
+ if(cl->ice_invoke("opString", Ice::Normal, inParams, outParams))
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == testString);
+ in->read(s);
+ test(s == testString);
+ }
+ else
+ {
+ test(false);
+ }
+
+ // ice_invoke with array mapping
+ pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inParams[0], &inParams[0] + inParams.size());
+ if(cl->ice_invoke("opString", Ice::Normal, inPair, outParams))
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == testString);
+ in->read(s);
+ test(s == testString);
+ }
+ else
+ {
+ test(false);
+ }
+ }
+
+ {
+ Ice::ByteSeq inParams, outParams;
+ if(cl->ice_invoke("opException", Ice::Normal, inParams, outParams))
+ {
+ test(false);
+ }
+ else
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
+ try
+ {
+ in->throwException();
+ }
+ catch(const Test::MyException&)
+ {
+ }
+ catch(...)
+ {
+ test(false);
+ }
+ }
+ }
+
+ cout << "ok" << endl;
+
+ cout << "testing asynchronous ice_invoke... " << flush;
+
+ {
+ CookiePtr cookie = new Cookie();
+
+ Ice::ByteSeq inParams, outParams;
+ Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
+ out->write(testString);
+ out->finished(inParams);
+
+ // begin_ice_invoke with no callback
+ Ice::AsyncResultPtr result = cl->begin_ice_invoke("opString", Ice::Normal, inParams);
+ if(cl->end_ice_invoke(outParams, result))
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
+ string s;
+ in->read(s);
+ test(s == testString);
+ in->read(s);
+ test(s == testString);
+ }
+ else
+ {
+ test(false);
+ };
+
+ // begin_ice_invoke with no callback and array mapping
+ pair<const ::Ice::Byte*, const ::Ice::Byte*> inPair(&inParams[0], &inParams[0] + inParams.size());
+ result = cl->begin_ice_invoke("opString", Ice::Normal, inPair);
+ pair<const ::Ice::Byte*, const ::Ice::Byte*> outPair;
+ if(cl->end_ice_invoke(outPair, result))
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outPair);
+ string s;
+ in->read(s);
+ test(s == testString);
+ in->read(s);
+ test(s == testString);
+ }
+ else
+ {
+ test(false);
+ };
+
+ // begin_ice_invoke with Callback
+ CallbackPtr cb = new Callback(communicator, false);
+ cl->begin_ice_invoke("opString", Ice::Normal, inParams, Ice::newCallback(cb, &Callback::opString));
+ cb->check();
+
+ // begin_ice_invoke with Callback and Cookie
+ cb = new Callback(communicator, true);
+ cl->begin_ice_invoke("opString", Ice::Normal, inParams, Ice::newCallback(cb, &Callback::opString), cookie);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke
+ cb = new Callback(communicator, false);
+ Ice::Callback_Object_ice_invokePtr d =
+ Ice::newCallback_Object_ice_invoke(cb, &Callback::opStringNC);
+ cl->begin_ice_invoke("opString", Ice::Normal, inParams, d);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke with Cookie
+ cb = new Callback(communicator, false);
+ d = Ice::newCallback_Object_ice_invoke(cb, &Callback::opStringWC);
+ cl->begin_ice_invoke("opString", Ice::Normal, inParams, d, cookie);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke and array mapping
+ cb = new Callback(communicator, false);
+ d = Ice::newCallback_Object_ice_invoke(cb, &Callback::opStringNC);
+ cl->begin_ice_invoke("opString", Ice::Normal, inPair, d);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke and array mapping with Cookie
+ cb = new Callback(communicator, false);
+ d = Ice::newCallback_Object_ice_invoke(cb, &Callback::opStringWC);
+ cl->begin_ice_invoke("opString", Ice::Normal, inPair, d, cookie);
+ cb->check();
+ }
+
+ {
+ CookiePtr cookie = new Cookie();
+ Ice::ByteSeq inParams, outParams;
+
+ // begin_ice_invoke with no callback
+ Ice::AsyncResultPtr result = cl->begin_ice_invoke("opException", Ice::Normal, inParams);
+ if(cl->end_ice_invoke(outParams, result))
+ {
+ test(false);
+ }
+ else
+ {
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, outParams);
+ try
+ {
+ in->throwException();
+ }
+ catch(const Test::MyException&)
+ {
+ }
+ catch(...)
+ {
+ test(false);
+ }
+ }
+
+ // begin_ice_invoke with Callback
+ CallbackPtr cb = new Callback(communicator, false);
+ cl->begin_ice_invoke("opException", Ice::Normal, inParams, Ice::newCallback(cb, &Callback::opException));
+ cb->check();
+
+ // begin_ice_invoke with Callback and Cookie
+ cb = new Callback(communicator, true);
+ cl->begin_ice_invoke("opException", Ice::Normal, inParams, Ice::newCallback(cb, &Callback::opException),
+ cookie);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke
+ cb = new Callback(communicator, false);
+ Ice::Callback_Object_ice_invokePtr d = Ice::newCallback_Object_ice_invoke(cb, &Callback::opExceptionNC);
+ cl->begin_ice_invoke("opException", Ice::Normal, inParams, d);
+ cb->check();
+
+ // begin_ice_invoke with Callback_Object_ice_invoke with Cookie
+ cb = new Callback(communicator, false);
+ d = Ice::newCallback_Object_ice_invoke(cb, &Callback::opExceptionWC);
+ cl->begin_ice_invoke("opException", Ice::Normal, inParams, d, cookie);
+ cb->check();
+ }
+
+ cout << "ok" << endl;
+
+ return cl;
+}
diff --git a/cpp/test/Ice/invoke/BlobjectI.cpp b/cpp/test/Ice/invoke/BlobjectI.cpp
new file mode 100644
index 00000000000..b1bb6c08b9b
--- /dev/null
+++ b/cpp/test/Ice/invoke/BlobjectI.cpp
@@ -0,0 +1,104 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <BlobjectI.h>
+#include <Test.h>
+#include <TestCommon.h>
+
+using namespace std;
+
+bool
+invokeInternal(const Ice::InputStreamPtr& in, vector<Ice::Byte>& outParams, const Ice::Current& current)
+{
+ Ice::CommunicatorPtr communicator = current.adapter->getCommunicator();
+ Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
+ if(current.operation == "opString")
+ {
+ string s;
+ in->read(s);
+ out->write(s);
+ out->write(s);
+ out->finished(outParams);
+ return true;
+ }
+ else if(current.operation == "opException")
+ {
+ Test::MyException ex;
+ out->writeException(ex);
+ out->finished(outParams);
+ return false;
+ }
+ else if(current.operation == "shutdown")
+ {
+ communicator->shutdown();
+ return true;
+ }
+ else if(current.operation == "ice_isA")
+ {
+ string s;
+ in->read(s);
+ if(s == "::Test::MyClass")
+ {
+ out->write(true);
+ }
+ else
+ {
+ out->write(false);
+ }
+ out->finished(outParams);
+ return true;
+ }
+ else
+ {
+ Ice::OperationNotExistException ex(__FILE__, __LINE__);
+ ex.id = current.id;
+ ex.facet = current.facet;
+ ex.operation = current.operation;
+ throw ex;
+ }
+}
+
+bool
+BlobjectI::ice_invoke(const vector<Ice::Byte>& inParams, vector<Ice::Byte>& outParams, const Ice::Current& current)
+{
+ Ice::InputStreamPtr in = Ice::createInputStream(current.adapter->getCommunicator(), inParams);
+ return invokeInternal(in, outParams, current);
+}
+
+bool
+BlobjectArrayI::ice_invoke(const pair<const Ice::Byte*, const Ice::Byte*>& inParams, vector<Ice::Byte>& outParams,
+ const Ice::Current& current)
+{
+ Ice::InputStreamPtr in = Ice::createInputStream(current.adapter->getCommunicator(), inParams);
+ return invokeInternal(in, outParams, current);
+}
+
+
+void
+BlobjectAsyncI::ice_invoke_async(const Ice::AMD_Object_ice_invokePtr& cb, const vector<Ice::Byte>& inParams,
+ const Ice::Current& current)
+{
+ Ice::InputStreamPtr in = Ice::createInputStream(current.adapter->getCommunicator(), inParams);
+ vector<Ice::Byte> outParams;
+ bool ok = invokeInternal(in, outParams, current);
+ cb->ice_response(ok, outParams);
+}
+
+void
+BlobjectArrayAsyncI::ice_invoke_async(const Ice::AMD_Object_ice_invokePtr& cb,
+ const pair<const Ice::Byte*, const Ice::Byte*>& inParams,
+ const Ice::Current& current)
+{
+ Ice::InputStreamPtr in = Ice::createInputStream(current.adapter->getCommunicator(), inParams);
+ vector<Ice::Byte> outParams;
+ bool ok = invokeInternal(in, outParams, current);
+ pair<const Ice::Byte*, const Ice::Byte*> outPair(&outParams[0], &outParams[0] + outParams.size());
+ cb->ice_response(ok, outParams);
+}
diff --git a/cpp/test/Ice/invoke/BlobjectI.h b/cpp/test/Ice/invoke/BlobjectI.h
new file mode 100644
index 00000000000..08b6f4c1d2a
--- /dev/null
+++ b/cpp/test/Ice/invoke/BlobjectI.h
@@ -0,0 +1,47 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef BLOBJECT_H
+#define BLOBJECT_H
+
+#include <Ice/Object.h>
+
+class BlobjectI : public Ice::Blobject
+{
+public:
+
+ virtual bool ice_invoke(const std::vector<Ice::Byte>&, std::vector<Ice::Byte>&, const Ice::Current&);
+};
+
+class BlobjectArrayI : public Ice::BlobjectArray
+{
+public:
+
+ virtual bool ice_invoke(const std::pair<const Ice::Byte*, const Ice::Byte*>&, std::vector<Ice::Byte>&,
+ const Ice::Current&);
+};
+
+
+class BlobjectAsyncI : public Ice::BlobjectAsync
+{
+public:
+
+ virtual void ice_invoke_async(const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte>&,
+ const Ice::Current&);
+};
+
+class BlobjectArrayAsyncI : public Ice::BlobjectArrayAsync
+{
+public:
+
+ virtual void ice_invoke_async(const Ice::AMD_Object_ice_invokePtr&,
+ const std::pair<const Ice::Byte*, const Ice::Byte*>&, const Ice::Current&);
+};
+
+#endif
diff --git a/cpp/test/Ice/invoke/Client.cpp b/cpp/test/Ice/invoke/Client.cpp
new file mode 100644
index 00000000000..394be5c412d
--- /dev/null
+++ b/cpp/test/Ice/invoke/Client.cpp
@@ -0,0 +1,62 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+
+int
+run(int argc, char* argv[],
+ const Ice::CommunicatorPtr& communicator,
+ const Ice::InitializationData& initData)
+{
+ Test::MyClassPrx allTests(const Ice::CommunicatorPtr&);
+ Test::MyClassPrx myClass = allTests(communicator);
+
+ myClass->shutdown();
+
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator, initData);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}
diff --git a/cpp/test/Ice/invoke/Makefile b/cpp/test/Ice/invoke/Makefile
new file mode 100644
index 00000000000..a00870cdcb3
--- /dev/null
+++ b/cpp/test/Ice/invoke/Makefile
@@ -0,0 +1,43 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+CLIENT = client
+SERVER = server
+
+TARGETS = $(CLIENT) $(SERVER)
+
+COBJS = Test.o \
+ Client.o \
+ AllTests.o
+
+SOBJS = Test.o \
+ BlobjectI.o \
+ Server.o
+
+SRCS = $(COBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp)
+
+SLICE_SRCS = Test.ice
+
+include $(top_srcdir)/config/Make.rules
+
+CPPFLAGS := -I. -I../../include $(CPPFLAGS)
+SLICE2CPPFLAGS := --stream $(SLICE2CPPFLAGS)
+
+$(CLIENT): $(COBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(COBJS) $(LIBS)
+
+$(SERVER): $(SOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(SOBJS) $(LIBS)
+
+include .depend
diff --git a/cpp/test/Ice/invoke/Makefile.mak b/cpp/test/Ice/invoke/Makefile.mak
new file mode 100644
index 00000000000..979a5e71f1c
--- /dev/null
+++ b/cpp/test/Ice/invoke/Makefile.mak
@@ -0,0 +1,51 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..
+
+CLIENT = client.exe
+SERVER = server.exe
+
+TARGETS = $(CLIENT) $(SERVER)
+
+COBJS = Test.obj \
+ Client.obj \
+ AllTests.obj
+
+SOBJS = Test.obj \
+ BlobjectI.obj \
+ Server.obj
+
+SRCS = $(COBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+SLICE2CPPFLAGS = --stream $(SLICE2CPPFLAGS)
+
+!if "$(GENERATE_PDB)" == "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(CLIENT): $(COBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+$(SERVER): $(SOBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Test.cpp Test.h
+
+!include .depend
diff --git a/cpp/test/Ice/invoke/Server.cpp b/cpp/test/Ice/invoke/Server.cpp
new file mode 100644
index 00000000000..f704ffae89c
--- /dev/null
+++ b/cpp/test/Ice/invoke/Server.cpp
@@ -0,0 +1,130 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <IceUtil/Options.h>
+#include <BlobjectI.h>
+
+using namespace std;
+
+class ServantLocatorI : public Ice::ServantLocator
+{
+public:
+
+ ServantLocatorI(bool array, bool async)
+ {
+ if(array)
+ {
+ if(async)
+ {
+ _blobject = new BlobjectArrayAsyncI();
+ }
+ else
+ {
+ _blobject = new BlobjectArrayI();
+ }
+ }
+ else
+ {
+ if(async)
+ {
+ _blobject = new BlobjectAsyncI();
+ }
+ else
+ {
+ _blobject = new BlobjectI();
+ }
+ }
+ }
+
+ virtual Ice::ObjectPtr
+ locate(const Ice::Current&, Ice::LocalObjectPtr&)
+ {
+ return _blobject;
+ }
+
+ virtual void
+ finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr&)
+ {
+ }
+
+ virtual void
+ deactivate(const string&)
+ {
+ }
+
+private:
+
+ Ice::ObjectPtr _blobject;
+};
+
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+ IceUtilInternal::Options opts;
+ opts.addOpt("", "array");
+ opts.addOpt("", "async");
+
+ vector<string> args;
+ try
+ {
+ args = opts.parse(argc, (const char**)argv);
+ }
+ catch(const IceUtilInternal::BadOptException& e)
+ {
+ cout << argv[0] << ": " << e.reason << endl;
+ return false;
+ }
+ bool array = opts.isSet("array");
+ bool async = opts.isSet("async");
+
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+ adapter->addServantLocator(new ServantLocatorI(array, async), "");
+ adapter->activate();
+
+ communicator->waitForShutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ Ice::InitializationData initData;
+ initData.properties = Ice::createProperties(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}
diff --git a/cpp/test/Ice/invoke/Test.ice b/cpp/test/Ice/invoke/Test.ice
new file mode 100644
index 00000000000..5e624e9204b
--- /dev/null
+++ b/cpp/test/Ice/invoke/Test.ice
@@ -0,0 +1,31 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+module Test
+{
+
+exception MyException
+{
+};
+
+class MyClass
+{
+ string opString(string s1, out string s2);
+
+ void opException() throws MyException;
+
+ void shutdown();
+};
+
+};
+
+#endif
diff --git a/cpp/test/Ice/invoke/run.py b/cpp/test/Ice/invoke/run.py
new file mode 100755
index 00000000000..6b63023f48e
--- /dev/null
+++ b/cpp/test/Ice/invoke/run.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+print "tests with Blobject server."
+TestUtil.clientServerTest()
+print "tests with BlobjectArray server."
+TestUtil.clientServerTest(additionalServerOptions = "--array")
+print "tests with BlobjectAsync server."
+TestUtil.clientServerTest(additionalServerOptions = "--async")
+print "tests with BlobjectAsyncArray server."
+TestUtil.clientServerTest(additionalServerOptions = "--array --async")
+