本文整理汇总了C++中TestIntfPrx::ice_encodingVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ TestIntfPrx::ice_encodingVersion方法的具体用法?C++ TestIntfPrx::ice_encodingVersion怎么用?C++ TestIntfPrx::ice_encodingVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestIntfPrx
的用法示例。
在下文中一共展示了TestIntfPrx::ice_encodingVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
//.........这里部分代码省略.........
cerr << ex.reason << endl;
test(false);
}
params["replicaGroup"] = "ReplicatedAdapterFromTest1";
params["id"] = "Server1";
instantiateServer(admin, "Server", "localnode", params);
try
{
admin->removeApplication("Test1");
test(false);
}
catch(const DeploymentException&)
{
// ReplicatedAdapterFromTest1 used by server from Test
}
update = ApplicationUpdateDescriptor();
update.name = "Test1";
update.removeReplicaGroups.push_back("ReplicatedAdapterFromTest1");
try
{
admin->updateApplication(update);
test(false);
}
catch(const DeploymentException&)
{
// ReplicatedAdapterFromTest1 used by server from Test
}
removeServer(admin, "Server1");
try
{
admin->updateApplication(update);
}
catch(const DeploymentException& ex)
{
cerr << ex << endl;
test(false);
}
admin->removeApplication("Test1");
};
cout << "ok" << endl;
cout << "testing replica group with different server encoding support... " << flush;
{
vector<string> loadBalancings;
loadBalancings.push_back("Random");
loadBalancings.push_back("RoundRobin");
loadBalancings.push_back("RoundRobin-All");
for(vector<string>::const_iterator p = loadBalancings.begin(); p != loadBalancings.end(); ++p)
{
map<string, string> params;
params["replicaGroup"] = *p;
params["id"] = "Server1";
params["encoding"] = "1.0";
instantiateServer(admin, "Server", "localnode", params);
params["id"] = "Server2";
params["encoding"] = "1.1";
instantiateServer(admin, "Server", "localnode", params);
params["id"] = "Server3";
params["encoding"] = "1.0";
instantiateServer(admin, "Server", "localnode", params);
TestIntfPrx obj = TestIntfPrx::uncheckedCast(comm->stringToProxy(*p));
obj = obj->ice_locatorCacheTimeout(0);
obj = obj->ice_connectionCached(false);
for(int i = 0; i < 30; ++i)
{
test(obj->getReplicaId() == "Server2.ReplicatedAdapter");
}
obj = obj->ice_encodingVersion(Ice::Encoding_1_0);
set<string> replicaIds = serverReplicaIds;
while(!replicaIds.empty())
{
try
{
replicaIds.erase(obj->getReplicaId());
}
catch(const Ice::LocalException& ex)
{
cerr << ex << endl;
test(false);
}
}
removeServer(admin, "Server1");
removeServer(admin, "Server2");
removeServer(admin, "Server3");
}
};
cout << "ok" << endl;
session->destroy();
}