diff options
Diffstat (limited to 'cpp/test/IceGrid/replication/AllTests.cpp')
-rw-r--r-- | cpp/test/IceGrid/replication/AllTests.cpp | 126 |
1 files changed, 115 insertions, 11 deletions
diff --git a/cpp/test/IceGrid/replication/AllTests.cpp b/cpp/test/IceGrid/replication/AllTests.cpp index 648d9704bf8..a33ba260869 100644 --- a/cpp/test/IceGrid/replication/AllTests.cpp +++ b/cpp/test/IceGrid/replication/AllTests.cpp @@ -427,6 +427,9 @@ allTests(const Ice::CommunicatorPtr& comm) { try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif masterRegistry->createSessionFromSecureConnection(); } catch(const PermissionDeniedException&) @@ -436,6 +439,9 @@ allTests(const Ice::CommunicatorPtr& comm) try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Registry->createSession("dummy", ""); } catch(const PermissionDeniedException&) @@ -443,6 +449,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Registry->createSessionFromSecureConnection(); } catch(const PermissionDeniedException&) @@ -463,6 +472,9 @@ allTests(const Ice::CommunicatorPtr& comm) test(slave1Mapper->getUserAccount("Dummy User Account2") == "dummy2"); try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif masterMapper->getUserAccount("unknown"); test(false); } @@ -471,6 +483,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Mapper->getUserAccount("unknown"); test(false); } @@ -486,6 +501,9 @@ allTests(const Ice::CommunicatorPtr& comm) comm->stringToProxy("TestIceGrid/SSLSessionManager")->ice_locator(replicatedLocator)->ice_ping(); try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif comm->stringToProxy("TestIceGrid/SessionManager-Slave1")->ice_locator(replicatedLocator)->ice_ping(); test(false); } @@ -494,6 +512,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif comm->stringToProxy("TestIceGrid/SSLSessionManager-Slave1")->ice_locator(replicatedLocator)->ice_ping(); test(false); } @@ -544,6 +565,9 @@ allTests(const Ice::CommunicatorPtr& comm) try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Admin->addApplication(app); test(false); } @@ -697,6 +721,9 @@ allTests(const Ice::CommunicatorPtr& comm) slave2Admin = createAdminSession(slave2Locator, "Slave2"); try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif masterAdmin->getApplicationInfo("TestApp"); test(false); } @@ -705,6 +732,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Admin->getApplicationInfo("TestApp"); test(false); } @@ -713,6 +743,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave2Admin->getApplicationInfo("TestApp"); test(false); } @@ -721,6 +754,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif masterAdmin->getAdapterInfo("TestAdpt"); test(false); } @@ -729,6 +765,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Admin->getAdapterInfo("TestAdpt"); test(false); } @@ -737,6 +776,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave2Admin->getAdapterInfo("TestAdpt"); test(false); } @@ -745,6 +787,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif masterAdmin->getObjectInfo(obj.proxy->ice_getIdentity()); test(false); } @@ -753,6 +798,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave1Admin->getObjectInfo(obj.proxy->ice_getIdentity()); test(false); } @@ -761,6 +809,9 @@ allTests(const Ice::CommunicatorPtr& comm) } try { +#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600) + IceUtil::DummyBCC dummy; +#endif slave2Admin->getObjectInfo(obj.proxy->ice_getIdentity()); test(false); } @@ -930,6 +981,7 @@ allTests(const Ice::CommunicatorPtr& comm) adapter.name = "TestAdapter"; adapter.id = "TestAdapter.Server"; adapter.registerProcess = false; + adapter.serverLifetime = true; PropertyDescriptor property; property.name = "TestAdapter.Endpoints"; property.value = "default"; @@ -946,9 +998,18 @@ allTests(const Ice::CommunicatorPtr& comm) masterAdmin->addApplication(app); - comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); - comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); - comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); + comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } + masterAdmin->stopServer("Server"); // @@ -968,14 +1029,24 @@ allTests(const Ice::CommunicatorPtr& comm) server->propertySet.properties.push_back(property); masterAdmin->updateApplication(update); - comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); - comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); + comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } masterAdmin->shutdown(); waitForServerState(admin, "Master", false); admin->startServer("Slave2"); slave2Admin = createAdminSession(slave2Locator, "Slave2"); + waitForNodeState(slave2Admin, "Node1", true); // Node should connect. + try { slave2Admin->startServer("Server"); @@ -1001,7 +1072,15 @@ allTests(const Ice::CommunicatorPtr& comm) admin->startServer("Slave2"); slave2Admin = createAdminSession(slave2Locator, "Slave2"); - comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } // // Shutdown Node1 and update the application, then, shutdown @@ -1036,7 +1115,15 @@ allTests(const Ice::CommunicatorPtr& comm) slave1Admin->shutdown(); waitForServerState(admin, "Slave1", false); - comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } admin->startServer("Slave1"); slave1Admin = createAdminSession(slave1Locator, "Slave1"); @@ -1049,7 +1136,15 @@ allTests(const Ice::CommunicatorPtr& comm) { } - comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } slave2Admin->stopServer("Server"); // @@ -1077,9 +1172,17 @@ allTests(const Ice::CommunicatorPtr& comm) waitForNodeState(slave1Admin, "Node1", true); waitForNodeState(slave2Admin, "Node1", true); - comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); - comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); - comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + try + { + comm->stringToProxy("test")->ice_locator(masterLocator)->ice_locatorCacheTimeout(0)->ice_ping(); + comm->stringToProxy("test")->ice_locator(slave1Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + comm->stringToProxy("test")->ice_locator(slave2Locator)->ice_locatorCacheTimeout(0)->ice_ping(); + } + catch(const Ice::LocalException& ex) + { + cerr << ex << endl; + test(false); + } slave2Admin->stopServer("Server"); @@ -1104,6 +1207,7 @@ allTests(const Ice::CommunicatorPtr& comm) AdapterDescriptor adapter; adapter.name = "TestAdapter"; adapter.id = "TestAdapter.Server"; + adapter.serverLifetime = true; adapter.registerProcess = false; PropertyDescriptor property; property.name = "TestAdapter.Endpoints"; |