summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/ami/TestI.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-12-08 14:10:38 -0800
committerMark Spruiell <mes@zeroc.com>2009-12-08 14:10:38 -0800
commit55527152af356fda6037f836c978c2b3a2e2f045 (patch)
treed1872fe6e2d01fa15455a462df090ef94799cb5b /cpp/test/Ice/ami/TestI.cpp
parentvsplugin fxcop issues (diff)
downloadice-55527152af356fda6037f836c978c2b3a2e2f045.tar.bz2
ice-55527152af356fda6037f836c978c2b3a2e2f045.tar.xz
ice-55527152af356fda6037f836c978c2b3a2e2f045.zip
- bug 3533: add async version of Connection/Communicator
flushBatchRequests operation - Slice file cleanup in C# tests - Updating C++ dependencies
Diffstat (limited to 'cpp/test/Ice/ami/TestI.cpp')
-rw-r--r--cpp/test/Ice/ami/TestI.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/cpp/test/Ice/ami/TestI.cpp b/cpp/test/Ice/ami/TestI.cpp
index b2e42bee81d..1157bb99350 100644
--- a/cpp/test/Ice/ami/TestI.cpp
+++ b/cpp/test/Ice/ami/TestI.cpp
@@ -13,8 +13,13 @@
using namespace std;
using namespace Ice;
+TestIntfI::TestIntfI() :
+ _batchCount(0)
+{
+}
+
void
-TestIntfI::op(const Ice::Current& current)
+TestIntfI::op(const Ice::Current&)
{
}
@@ -25,7 +30,7 @@ TestIntfI::opWithResult(const Ice::Current& current)
}
void
-TestIntfI::opWithUE(const Ice::Current& current)
+TestIntfI::opWithUE(const Ice::Current&)
{
throw Test::TestIntfException();
}
@@ -36,6 +41,34 @@ TestIntfI::opWithPayload(const Ice::ByteSeq&, const Ice::Current& current)
}
void
+TestIntfI::opBatch(const Ice::Current&)
+{
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ ++_batchCount;
+ notify();
+}
+
+Ice::Int
+TestIntfI::opBatchCount(const Ice::Current&)
+{
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ return _batchCount;
+}
+
+bool
+TestIntfI::waitForBatch(Ice::Int count, const Ice::Current&)
+{
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ while(_batchCount < count)
+ {
+ timedWait(IceUtil::Time::milliSeconds(5000));
+ }
+ bool result = count == _batchCount;
+ _batchCount = 0;
+ return result;
+}
+
+void
TestIntfI::shutdown(const Ice::Current& current)
{
current.adapter->getCommunicator()->shutdown();