summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/background/AllTests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Ice/background/AllTests.cpp')
-rw-r--r--cpp/test/Ice/background/AllTests.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/cpp/test/Ice/background/AllTests.cpp b/cpp/test/Ice/background/AllTests.cpp
index 1d21b70379c..a7745e9a361 100644
--- a/cpp/test/Ice/background/AllTests.cpp
+++ b/cpp/test/Ice/background/AllTests.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 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.
@@ -68,6 +68,11 @@ public:
_response.called();
}
+ void
+ responseNoOp()
+ {
+ }
+
void noResponse()
{
test(false);
@@ -313,6 +318,41 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
cout << "ok" << endl;
+ const bool ws = communicator->getProperties()->getProperty("Ice.Default.Protocol") == "test-ws";
+ const bool wss = communicator->getProperties()->getProperty("Ice.Default.Protocol") == "test-wss";
+ if(!ws && !wss)
+ {
+ cout << "testing buffered transport... " << flush;
+
+ configuration->buffered(true);
+ backgroundController->buffered(true);
+ background->begin_op();
+ background->ice_getCachedConnection()->close(true);
+ background->begin_op();
+
+ Ice::AsyncResultPtr r;
+ OpAMICallbackPtr cb = new OpAMICallback();
+ Callback_Background_opPtr callback = newCallback_Background_op(cb,
+ &OpAMICallback::responseNoOp,
+ &OpAMICallback::noException);
+ for(int i = 0; i < 10000; ++i)
+ {
+ r = background->begin_op(callback);
+ if(i % 50 == 0)
+ {
+ backgroundController->holdAdapter();
+ backgroundController->resumeAdapter();
+ }
+ if(i % 100 == 0)
+ {
+ r->waitForCompleted();
+ }
+ }
+ r->waitForCompleted();
+
+ cout << "ok" << endl;
+ }
+
return background;
}
@@ -422,9 +462,8 @@ initializeTests(const ConfigurationPtr& configuration,
{
background->op();
}
- catch(const Ice::LocalException& ex)
+ catch(const Ice::LocalException&)
{
- cerr << ex << endl;
test(false);
}
background->ice_getConnection()->close(false);