summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/adapterDeactivation/AllTests.cpp11
-rw-r--r--cpp/test/Ice/adapterDeactivation/Client.cpp12
-rw-r--r--cpp/test/Ice/adapterDeactivation/Collocated.cpp13
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp32
4 files changed, 32 insertions, 36 deletions
diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp
index c23f0dd90a5..e9344409fb0 100644
--- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp
+++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp
@@ -37,5 +37,16 @@ allTests(const CommunicatorPtr& communicator)
obj->deactivate();
cout << "ok" << endl;
+ cout << "testing whether server is gone... " << flush;
+ try
+ {
+ obj->ice_ping();
+ test(false);
+ }
+ catch(const LocalException&)
+ {
+ cout << "ok" << endl;
+ }
+
return obj;
}
diff --git a/cpp/test/Ice/adapterDeactivation/Client.cpp b/cpp/test/Ice/adapterDeactivation/Client.cpp
index 5f5f7753831..35f920af47e 100644
--- a/cpp/test/Ice/adapterDeactivation/Client.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Client.cpp
@@ -38,17 +38,5 @@ TestClient::run(int argc, char* argv[])
{
TestPrx allTests(const CommunicatorPtr&);
TestPrx obj = allTests(communicator());
-
- cout << "testing whether server is gone... " << flush;
- try
- {
- obj->ice_ping();
- test(false);
- }
- catch(const LocalException&)
- {
- cout << "ok" << endl;
- }
-
return EXIT_SUCCESS;
}
diff --git a/cpp/test/Ice/adapterDeactivation/Collocated.cpp b/cpp/test/Ice/adapterDeactivation/Collocated.cpp
index 4082a6345bb..2a1e47a371a 100644
--- a/cpp/test/Ice/adapterDeactivation/Collocated.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Collocated.cpp
@@ -43,18 +43,7 @@ TestServer::run(int argc, char* argv[])
adapter->addServantLocator(locator, "");
TestPrx allTests(const CommunicatorPtr&);
- TestPrx obj = allTests(communicator());
-
- cout << "testing whether server is gone... " << flush;
- try
- {
- obj->ice_ping();
- test(false);
- }
- catch(const LocalException&)
- {
- cout << "ok" << endl;
- }
+ allTests(communicator());
adapter->waitForDeactivate();
return EXIT_SUCCESS;
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index 0c800ad3fe1..dd630b29bb4 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -672,13 +672,14 @@ typedef ::IceUtil::Handle< ::AMI_WrongOperation_noSuchOperationI> AMI_WrongOpera
ThrowerPrx
allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
{
- cout << "testing AlreadyRegisteredException and NotRegisteredException for servant... " << flush;
+ cout << "testing servant registration exceptions... " << flush;
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1");
Ice::ObjectPtr obj = new EmptyI;
adapter->add(obj, Ice::stringToIdentity("x"));
bool gotException = false;
- try {
+ try
+ {
adapter->add(obj, Ice::stringToIdentity("x"));
}
catch(const Ice::AlreadyRegisteredException&)
@@ -689,7 +690,8 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
gotException = false;
adapter->remove(Ice::stringToIdentity("x"));
- try {
+ try
+ {
adapter->remove(Ice::stringToIdentity("x"));
}
catch(const Ice::NotRegisteredException&)
@@ -702,13 +704,14 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
}
cout << "ok" << endl;
- cout << "testing AlreadyRegisteredException and NotRegisteredException for servant locator... " << flush;
+ cout << "testing servant locator registrations exceptions... " << flush;
{
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2");
Ice::ServantLocatorPtr loc = new ServantLocatorI;
adapter->addServantLocator(loc, "x");
bool gotException = false;
- try {
+ try
+ {
adapter->addServantLocator(loc, "x");
}
catch(const Ice::AlreadyRegisteredException&)
@@ -719,7 +722,8 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
gotException = false;
adapter->removeServantLocator("x");
- try {
+ try
+ {
adapter->removeServantLocator("x");
}
catch(const Ice::NotRegisteredException&)
@@ -732,12 +736,13 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
}
cout << "ok" << endl;
- cout << "testing AlreadyRegisteredException and NotRegisteredException for object factory... " << flush;
+ cout << "testing object factory registration exceptions... " << flush;
{
Ice::ObjectFactoryPtr of = new ObjectFactoryI;
communicator->addObjectFactory(of, "x");
bool gotException = false;
- try {
+ try
+ {
communicator->addObjectFactory(of, "x");
}
catch(const Ice::AlreadyRegisteredException&)
@@ -748,7 +753,8 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
gotException = false;
communicator->removeObjectFactory("x");
- try {
+ try
+ {
communicator->removeObjectFactory("x");
}
catch(const Ice::NotRegisteredException&)
@@ -759,12 +765,13 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
}
cout << "ok" << endl;
- cout << "testing AlreadyRegisteredException and NotRegisteredException for user exception factory... " << flush;
+ cout << "testing user exception factory registration exceptions... " << flush;
{
Ice::UserExceptionFactoryPtr f = new MyExceptionFactory;
communicator->addUserExceptionFactory(f, "::x");
bool gotException = false;
- try {
+ try
+ {
communicator->addUserExceptionFactory(f, "::x");
}
catch(const Ice::AlreadyRegisteredException&)
@@ -775,7 +782,8 @@ allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
gotException = false;
communicator->removeUserExceptionFactory("::x");
- try {
+ try
+ {
communicator->removeUserExceptionFactory("::x");
}
catch(const Ice::NotRegisteredException&)