summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/info/AllTests.cpp12
-rw-r--r--cpp/test/Ice/info/TestI.cpp4
-rw-r--r--cpp/test/Ice/location/AllTests.cpp13
-rw-r--r--cpp/test/Ice/location/ServerLocator.cpp8
-rw-r--r--cpp/test/Ice/metrics/AllTests.cpp42
-rw-r--r--cpp/test/Ice/proxy/AllTests.cpp141
6 files changed, 114 insertions, 106 deletions
diff --git a/cpp/test/Ice/info/AllTests.cpp b/cpp/test/Ice/info/AllTests.cpp
index b7527f182fb..8640bc0d291 100644
--- a/cpp/test/Ice/info/AllTests.cpp
+++ b/cpp/test/Ice/info/AllTests.cpp
@@ -20,7 +20,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "testing proxy endpoint information... " << flush;
{
- Ice::ObjectPrx p1 = communicator->stringToProxy("test -t:default -v 1.4 -e 1.3 -h tcphost -p 10000 -t 1200 -z:"
+ Ice::ObjectPrx p1 = communicator->stringToProxy("test -t:default -h tcphost -p 10000 -t 1200 -z:"
"udp -h udphost -p 10001 --interface eth0 --ttl 5:"
"opaque -e 1.8 -t 100 -v ABCD");
@@ -28,14 +28,6 @@ allTests(const Ice::CommunicatorPtr& communicator)
Ice::IPEndpointInfoPtr ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast(endps[0]->getInfo());
test(ipEndpoint);
- Ice::ProtocolVersion pv;
- pv.major = 1;
- pv.minor = 4;
- test(ipEndpoint->protocol == pv);
- Ice::EncodingVersion ev;
- ev.major = 1;
- ev.minor = 3;
- test(ipEndpoint->encoding == ev);
test(ipEndpoint->host == "tcphost");
test(ipEndpoint->port == 10000);
test(ipEndpoint->timeout == 1200);
@@ -48,8 +40,6 @@ allTests(const Ice::CommunicatorPtr& communicator)
Ice::UDPEndpointInfoPtr udpEndpoint = Ice::UDPEndpointInfoPtr::dynamicCast(endps[1]->getInfo());
test(udpEndpoint);
- test(udpEndpoint->protocol == Ice::currentProtocol);
- test(udpEndpoint->encoding == Ice::currentEncoding);
test(udpEndpoint->host == "udphost");
test(udpEndpoint->port == 10001);
test(udpEndpoint->mcastInterface == "eth0");
diff --git a/cpp/test/Ice/info/TestI.cpp b/cpp/test/Ice/info/TestI.cpp
index 306b6493690..183d39018f9 100644
--- a/cpp/test/Ice/info/TestI.cpp
+++ b/cpp/test/Ice/info/TestI.cpp
@@ -48,10 +48,6 @@ TestI::getEndpointInfoAsContext(const Ice::Current& c)
if(Ice::UDPEndpointInfoPtr::dynamicCast(ipinfo))
{
Ice::UDPEndpointInfoPtr udp = Ice::UDPEndpointInfoPtr::dynamicCast(ipinfo);
- ctx["protocolMajor"] = udp->protocol.major;
- ctx["protocolMinor"] = udp->protocol.minor;
- ctx["encodingMajor"] = udp->encoding.major;
- ctx["encodingMinor"] = udp->encoding.minor;
ctx["mcastInterface"] = udp->mcastInterface;
ctx["mcastTtl"] = udp->mcastTtl;
}
diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp
index 1c6a73461d2..53751798b20 100644
--- a/cpp/test/Ice/location/AllTests.cpp
+++ b/cpp/test/Ice/location/AllTests.cpp
@@ -577,6 +577,19 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref)
hello->sayHello();
cout << "ok" << endl;
+ cout << "testing locator encoding resolution... " << flush;
+
+ hello = HelloPrx::checkedCast(communicator->stringToProxy("hello"));
+ count = locator->getRequestCount();
+ communicator->stringToProxy("test@TestAdapter")->ice_encodingVersion(Ice::Encoding_1_1)->ice_ping();
+ test(count == locator->getRequestCount());
+ communicator->stringToProxy("test@TestAdapter10")->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
+ test(++count == locator->getRequestCount());
+ communicator->stringToProxy("test -e 1.0@TestAdapter10-2")->ice_ping();
+ test(++count == locator->getRequestCount());
+
+ cout << "ok" << endl;
+
cout << "shutdown server... " << flush;
obj->shutdown();
cout << "ok" << endl;
diff --git a/cpp/test/Ice/location/ServerLocator.cpp b/cpp/test/Ice/location/ServerLocator.cpp
index 75f403e83fc..efb4e9b71b7 100644
--- a/cpp/test/Ice/location/ServerLocator.cpp
+++ b/cpp/test/Ice/location/ServerLocator.cpp
@@ -9,6 +9,7 @@
#include <Ice/Ice.h>
#include <Ice/BuiltinSequences.h>
+#include <TestCommon.h>
#include <ServerLocator.h>
using namespace std;
@@ -117,6 +118,13 @@ ServerLocator::findAdapterById_async(const Ice::AMD_Locator_findAdapterByIdPtr&
const Ice::Current& current) const
{
++const_cast<int&>(_requestCount);
+ if(id == "TestAdapter10" || id == "TestAdapter10-2")
+ {
+ test(current.encoding == Ice::Encoding_1_0);
+ response->ice_response(_registry->getAdapter("TestAdapter"));
+ return;
+ }
+
// We add a small delay to make sure locator request queuing gets tested when
// running the test on a fast machine
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1));
diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp
index 215dab04312..3c1bfa42822 100644
--- a/cpp/test/Ice/metrics/AllTests.cpp
+++ b/cpp/test/Ice/metrics/AllTests.cpp
@@ -488,7 +488,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
cm2 = IceMX::ConnectionMetricsPtr::dynamicCast(clientMetrics->getMetricsView("View", timestamp)["Connection"][0]);
sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
- test(cm2->sentBytes - cm1->sentBytes == requestSz + static_cast<int>(bs.size()) + 4); // 4 is for the seq variable size
+ // 4 is for the seq variable size
+ test(cm2->sentBytes - cm1->sentBytes == requestSz + static_cast<int>(bs.size()) + 4);
test(cm2->receivedBytes - cm1->receivedBytes == replySz);
test(sm2->receivedBytes - sm1->receivedBytes == requestSz + static_cast<int>(bs.size()) + 4);
if(sm2->sentBytes - sm1->sentBytes != replySz)
@@ -498,7 +499,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
// to the operation is sent and getMetricsView can be dispatched before the metric is really
// updated.
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(100));
- sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
+ sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(
+ serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
}
test(sm2->sentBytes - sm1->sentBytes == replySz);
@@ -511,7 +513,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
cm2 = IceMX::ConnectionMetricsPtr::dynamicCast(clientMetrics->getMetricsView("View", timestamp)["Connection"][0]);
sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
- test(cm2->sentBytes - cm1->sentBytes == requestSz + static_cast<int>(bs.size()) + 4); // 4 is for the seq variable size
+ // 4 is for the seq variable size
+ test(cm2->sentBytes - cm1->sentBytes == requestSz + static_cast<int>(bs.size()) + 4);
test(cm2->receivedBytes - cm1->receivedBytes == replySz);
test(sm2->receivedBytes - sm1->receivedBytes == requestSz + static_cast<int>(bs.size()) + 4);
if(sm2->sentBytes - sm1->sentBytes != replySz)
@@ -521,7 +524,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
// to the operation is sent and getMetricsView can be dispatched before the metric is really
// updated.
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(100));
- sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
+ sm2 = IceMX::ConnectionMetricsPtr::dynamicCast(
+ serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
}
test(sm2->sentBytes - sm1->sentBytes == replySz);
@@ -574,7 +578,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
cm1 = IceMX::ConnectionMetricsPtr::dynamicCast(clientMetrics->getMetricsView("View", timestamp)["Connection"][0]);
while(true)
{
- sm1 = IceMX::ConnectionMetricsPtr::dynamicCast(serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
+ sm1 = IceMX::ConnectionMetricsPtr::dynamicCast(
+ serverMetrics->getMetricsView("View", timestamp)["Connection"][0]);
if(sm1-> failures >= 2)
{
break;
@@ -593,14 +598,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
testAttribute(clientMetrics, clientProps, update, "Connection", "parent", "Communicator");
//testAttribute(clientMetrics, clientProps, update, "Connection", "id", "");
- testAttribute(clientMetrics, clientProps, update, "Connection", "endpoint",
- "tcp -e 1.1 -h 127.0.0.1 -p 12010 -t 500");
+ testAttribute(clientMetrics, clientProps, update, "Connection", "endpoint", "tcp -h 127.0.0.1 -p 12010 -t 500");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointType", "1");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointIsDatagram", "false");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointIsSecure", "false");
- testAttribute(clientMetrics, clientProps, update, "Connection", "endpointProtocolVersion", "1.0");
- testAttribute(clientMetrics, clientProps, update, "Connection", "endpointEncodingVersion", "1.1");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointTimeout", "500");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointCompress", "false");
testAttribute(clientMetrics, clientProps, update, "Connection", "endpointHost", "127.0.0.1");
@@ -660,13 +662,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "parent", "Communicator", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "id", "127.0.0.1:12010", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpoint",
- "tcp -e 1.1 -h 127.0.0.1 -p 12010", c);
+ "tcp -h 127.0.0.1 -p 12010", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointType", "1", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointIsDatagram", "false", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointIsSecure", "false", c);
- testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointProtocolVersion", "1.0", c);
- testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointEncodingVersion", "1.1", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointTimeout", "-1", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointCompress", "false", c);
testAttribute(clientMetrics, clientProps, update, "ConnectionEstablishment", "endpointHost", "127.0.0.1", c);
@@ -691,7 +691,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].size() == 1);
m1 = clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"][0];
- test(m1->current <= 1 && m1->total == 1 && m1->id == "tcp -e 1.1 -h localhost -p 12010");
+ test(m1->current <= 1 && m1->total == 1 && m1->id == "tcp -h localhost -p 12010");
prx->ice_getConnection()->close(false);
@@ -709,22 +709,20 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].size() == 2);
m1 = clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"][1];
- test(m1->id == "tcp -e 1.1 -h unknownfoo.zeroc.com -p 12010" && m1->total == 2 && m1->failures == 2);
+ test(m1->id == "tcp -h unknownfoo.zeroc.com -p 12010" && m1->total == 2 && m1->failures == 2);
checkFailure(clientMetrics, "EndpointLookup", m1->id, "Ice::DNSException", 2);
c = Connect(prx);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "parent", "Communicator", c);
- testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "id", "tcp -e 1.1 -h localhost -p 12010", c);
+ testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "id", "tcp -h localhost -p 12010", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpoint",
- "tcp -e 1.1 -h localhost -p 12010", c);
+ "tcp -h localhost -p 12010", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointType", "1", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointIsDatagram", "false", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointIsSecure", "false", c);
- testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointProtocolVersion", "1.0", c);
- testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointEncodingVersion", "1.1", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointTimeout", "-1", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointCompress", "false", c);
testAttribute(clientMetrics, clientProps, update, "EndpointLookup", "endpointHost", "localhost", c);
@@ -806,14 +804,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
testAttribute(serverMetrics, serverProps, update, "Dispatch", "parent", "TestAdapter", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "id", "metrics [op]", op);
- testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpoint", "tcp -e 1.1 -h 127.0.0.1 -p 12010", op);
+ testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpoint", "tcp -h 127.0.0.1 -p 12010", op);
//testAttribute(serverMetrics, serverProps, update, "Dispatch", "connection", "", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointType", "1", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointIsDatagram", "false", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointIsSecure", "false", op);
- testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointProtocolVersion", "1.0", op);
- testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointEncodingVersion", "1.1", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointTimeout", "-1", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointCompress", "false", op);
testAttribute(serverMetrics, serverProps, update, "Dispatch", "endpointHost", "127.0.0.1", op);
@@ -997,7 +993,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
testAttribute(clientMetrics, clientProps, update, "Invocation", "parent", "Communicator", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "id",
- "metrics -t:tcp -e 1.1 -h 127.0.0.1 -p 12010 [op]", op);
+ "metrics -t -e 1.1:tcp -h 127.0.0.1 -p 12010 [op]", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "operation", "op", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "identity", "metrics", op);
@@ -1005,7 +1001,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
testAttribute(clientMetrics, clientProps, update, "Invocation", "encoding", "1.1", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "mode", "twoway", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "proxy",
- "metrics -t:tcp -e 1.1 -h 127.0.0.1 -p 12010", op);
+ "metrics -t -e 1.1:tcp -h 127.0.0.1 -p 12010", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "context.entry1", "test", op);
testAttribute(clientMetrics, clientProps, update, "Invocation", "context.entry2", "", op);
diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp
index 4773088850d..9f6428f111b 100644
--- a/cpp/test/Ice/proxy/AllTests.cpp
+++ b/cpp/test/Ice/proxy/AllTests.cpp
@@ -212,6 +212,14 @@ allTests(const Ice::CommunicatorPtr& communicator)
b1 = communicator->stringToProxy("test -s");
test(b1->ice_isSecure());
+ test(b1->ice_getEncodingVersion() == Ice::currentEncoding);
+
+ b1 = communicator->stringToProxy("test -e 1.0");
+ test(b1->ice_getEncodingVersion().major == 1 && b1->ice_getEncodingVersion().minor == 0);
+
+ b1 = communicator->stringToProxy("test -e 6.5");
+ test(b1->ice_getEncodingVersion().major == 6 && b1->ice_getEncodingVersion().minor == 5);
+
try
{
b1 = communicator->stringToProxy("test:tcp@adapterId");
@@ -327,31 +335,6 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(!b1->ice_isCollocationOptimized());
prop->setProperty(property, "");
- property = propertyPrefix + ".EncodingVersion";
- test(b1->ice_getEncodingVersion() == Ice::currentEncoding);
- prop->setProperty(property, "1.0");
- b1 = communicator->propertyToProxy(propertyPrefix);
- test(b1->ice_getEncodingVersion().major == 1 && b1->ice_getEncodingVersion().minor == 0);
- prop->setProperty(property, "6.5");
- try
- {
- communicator->propertyToProxy(propertyPrefix);
- test(false);
- }
- catch(const Ice::UnsupportedEncodingException&)
- {
- }
- prop->setProperty(property, "1.2");
- try
- {
- communicator->propertyToProxy(propertyPrefix);
- test(false);
- }
- catch(const Ice::UnsupportedEncodingException&)
- {
- }
- prop->setProperty(property, "");
-
cout << "ok" << endl;
cout << "testing proxyToProperty... " << flush;
@@ -382,42 +365,29 @@ allTests(const Ice::CommunicatorPtr& communicator)
b1 = b1->ice_locator(Ice::LocatorPrx::uncheckedCast(locator));
Ice::PropertyDict proxyProps = communicator->proxyToProperty(b1, "Test");
- test(proxyProps.size() == 21);
+ test(proxyProps.size() == 18);
test(proxyProps["Test"] == "test -t");
- test(proxyProps["Test.EncodingVersion"] == "1.0");
test(proxyProps["Test.CollocationOptimized"] == "1");
test(proxyProps["Test.ConnectionCached"] == "1");
test(proxyProps["Test.PreferSecure"] == "0");
test(proxyProps["Test.EndpointSelection"] == "Ordered");
test(proxyProps["Test.LocatorCacheTimeout"] == "100");
- test(proxyProps["Test.Locator"] == "locator -t");
- test(proxyProps["Test.Locator.EncodingVersion"] == Ice::encodingVersionToString(Ice::currentEncoding));
+ test(proxyProps["Test.Locator"] == "locator -t -e " + Ice::encodingVersionToString(Ice::currentEncoding));
test(proxyProps["Test.Locator.CollocationOptimized"] == "1");
test(proxyProps["Test.Locator.ConnectionCached"] == "0");
test(proxyProps["Test.Locator.PreferSecure"] == "1");
test(proxyProps["Test.Locator.EndpointSelection"] == "Random");
test(proxyProps["Test.Locator.LocatorCacheTimeout"] == "300");
- test(proxyProps["Test.Locator.Router"] == "router -t");
- test(proxyProps["Test.Locator.Router.EncodingVersion"] == Ice::encodingVersionToString(Ice::currentEncoding));
+ test(proxyProps["Test.Locator.Router"] == "router -t -e " + Ice::encodingVersionToString(Ice::currentEncoding));
test(proxyProps["Test.Locator.Router.CollocationOptimized"] == "0");
test(proxyProps["Test.Locator.Router.ConnectionCached"] == "1");
test(proxyProps["Test.Locator.Router.PreferSecure"] == "1");
test(proxyProps["Test.Locator.Router.EndpointSelection"] == "Random");
test(proxyProps["Test.Locator.Router.LocatorCacheTimeout"] == "200");
- try
- {
- Ice::EncodingVersion v = { 3, 4 };
- b1->ice_encodingVersion(v);
- test(false);
- }
- catch(const Ice::UnsupportedEncodingException&)
- {
- }
-
cout << "ok" << endl;
cout << "testing ice_getCommunicator... " << flush;
@@ -653,35 +623,74 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "ok" << endl;
+ cout << "testing protocol versioning... " << flush;
+ {
+ Ice::OutputStreamPtr out = Ice::createOutputStream(communicator);
+ out->write(cl);
+ vector<Ice::Byte> inBytes;
+ out->finished(inBytes);
+
+ // Protocol version 1.1
+ inBytes[9] = 1;
+ inBytes[10] = 1;
+
+ Ice::InputStreamPtr in = Ice::createInputStream(communicator, inBytes);
+ Test::MyClassPrx cl11;
+ in->read(cl11);
+ cl11 = cl11->ice_collocationOptimized(false);
+ test(cl11->ice_toString() == "test -t -p 1.1 -e 1.1:tcp -h 127.0.0.1 -p 12010");
+ try
+ {
+ cl11->ice_ping();
+ test(false);
+ }
+ catch(const Ice::UnsupportedProtocolException&)
+ {
+ }
+ try
+ {
+ cl11->end_ice_ping(cl11->begin_ice_ping());
+ test(false);
+ }
+ catch(const Ice::UnsupportedProtocolException&)
+ {
+ }
+ try
+ {
+ cl11->ice_flushBatchRequests();
+ test(false);
+ }
+ catch(const Ice::UnsupportedProtocolException&)
+ {
+ }
+ try
+ {
+ cl11->end_ice_flushBatchRequests(cl11->begin_ice_flushBatchRequests());
+ test(false);
+ }
+ catch(const Ice::UnsupportedProtocolException&)
+ {
+ }
+ }
+ cout << "ok" << endl;
+
cout << "testing encoding versioning... " << flush;
- string ref20 = "test:default -p 12010 -e 2.0";
+ string ref20 = "test -e 2.0:default -p 12010";
Test::MyClassPrx cl20 = Test::MyClassPrx::uncheckedCast(communicator->stringToProxy(ref20));
try
{
cl20->ice_collocationOptimized(false)->ice_ping();
test(false);
}
- catch(const Ice::NoEndpointException&)
+ catch(const Ice::UnsupportedEncodingException&)
{
// Server 2.0 endpoint doesn't support 1.1 version.
}
- string ref10 = "test:default -p 12010 -e 1.0";
+ string ref10 = "test -e 1.0:default -p 12010";
Test::MyClassPrx cl10 = Test::MyClassPrx::uncheckedCast(communicator->stringToProxy(ref10));
- try
- {
- cl10->ice_collocationOptimized(false)->ice_ping(); // Can't send request with 1.1 encoding on 1.0 endpoint.
- test(false);
- }
- catch(const Ice::NoEndpointException&)
- {
- // Server 1.0 endpoint doesn't support 1.1 version.
- }
-
- // Server with 1.0 endpoint supports 1.0 encoding.
+ cl10->ice_ping();
cl10->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
-
- // Server with 1.1 endpoint supports 1.0 encoding.
cl->ice_collocationOptimized(false)->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
try
@@ -841,17 +850,13 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
// Legal TCP endpoint expressed as opaque endpoint
- Ice::ObjectPrx p1 = communicator->stringToProxy("test:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==");
+ Ice::ObjectPrx p1 = communicator->stringToProxy("test -e 1.1:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==");
string pstr = communicator->proxyToString(p1);
- test(pstr == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000");
-
- // 1.1 TCP endpoint encoded with 1.1 encoding.
- Ice::ObjectPrx p2 = communicator->stringToProxy("test:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAAEAAQE=");
- test(communicator->proxyToString(p2) == "test -t:tcp -e 1.1 -h 127.0.0.1 -p 12010 -t 10000");
+ test(pstr == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000");
- // 1.0 TCP endpoint encoded with 1.1 encoding.
- p2 = communicator->stringToProxy("test: opaque -t 1 -e 1.1 -v CTEyNy4wLjAuMeouAAAQJwAAAAEAAQA=");
- test(communicator->proxyToString(p2) == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000");
+ // Opaque endpoint encoded with 1.1 encoding.
+ Ice::ObjectPrx p2 = communicator->stringToProxy("test -e 1.1:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==");
+ test(communicator->proxyToString(p2) == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000");
if(communicator->getProperties()->getPropertyAsInt("Ice.IPv6") == 0)
{
@@ -867,7 +872,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
// Two legal TCP endpoints expressed as opaque endpoints
- p1 = communicator->stringToProxy("test:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMusuAAAQJwAAAA==");
+ p1 = communicator->stringToProxy("test -e 1.0:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMusuAAAQJwAAAA==");
pstr = communicator->proxyToString(p1);
test(pstr == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000:tcp -h 127.0.0.2 -p 12011 -t 10000");
@@ -875,7 +880,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
// Test that an SSL endpoint and a nonsense endpoint get written
// back out as an opaque endpoint.
//
- p1 = communicator->stringToProxy("test:opaque -e 1.0 -t 2 -v CTEyNy4wLjAuMREnAAD/////AA==:opaque -e 1.0 -t 99 -v abch");
+ p1 = communicator->stringToProxy("test -e 1.0:opaque -e 1.0 -t 2 -v CTEyNy4wLjAuMREnAAD/////AA==:opaque -e 1.0 -t 99 -v abch");
pstr = communicator->proxyToString(p1);
if(!ssl)
{