diff options
Diffstat (limited to 'cpp/test')
-rw-r--r-- | cpp/test/Ice/adapterDeactivation/AllTests.cpp | 47 | ||||
-rw-r--r-- | cpp/test/Ice/exceptions/AllTests.cpp | 169 | ||||
-rw-r--r-- | cpp/test/Ice/facets/AllTests.cpp | 115 | ||||
-rw-r--r-- | cpp/test/Ice/info/AllTests.cpp | 96 | ||||
-rw-r--r-- | cpp/test/Ice/location/AllTests.cpp | 56 | ||||
-rw-r--r-- | cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters | 6 |
6 files changed, 277 insertions, 212 deletions
diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp index 1e701f52db2..b752c39c621 100644 --- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp +++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp @@ -28,29 +28,38 @@ allTests(const CommunicatorPtr& communicator) test(obj); test(obj == base); cout << "ok" << endl; +#ifdef ICE_OS_WINRT + bool winrt = true; +#else + bool winrt = false; +#endif { - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - cout << "creating/destroying/recreating object adapter... " << flush; - ObjectAdapterPtr adapter = - communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); - try + if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" && + communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")) { - communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); - test(false); - } - catch(const AlreadyRegisteredException&) - { - } - adapter->destroy(); + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? + "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; + cout << "creating/destroying/recreating object adapter... " << flush; + ObjectAdapterPtr adapter = + communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); + try + { + communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); + test(false); + } + catch(const AlreadyRegisteredException&) + { + } + adapter->destroy(); - // - // Use a different port than the first adapter to avoid an "address already in use" error. - // - adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); - adapter->destroy(); - cout << "ok" << endl; + // + // Use a different port than the first adapter to avoid an "address already in use" error. + // + adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host); + adapter->destroy(); + cout << "ok" << endl; + } } cout << "creating/activating/deactivating object adapter in one operation... " << flush; diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp index 9bccdb4841a..814e0d0d38d 100644 --- a/cpp/test/Ice/exceptions/AllTests.cpp +++ b/cpp/test/Ice/exceptions/AllTests.cpp @@ -397,6 +397,11 @@ endsWith(const string& s, const string& findme) ThrowerPrx allTests(const Ice::CommunicatorPtr& communicator) { +#ifdef ICE_OS_WINRT + bool winrt = true; +#else + bool winrt = false; +#endif cout << "testing ice_print()/what()... " << flush; { A a; @@ -449,10 +454,10 @@ allTests(const Ice::CommunicatorPtr& communicator) test(os.str() == "Test::E"); test(ex.data == "E"); } - + // // Test custom ice_print - // + // { F ex("F"); ostringstream os; @@ -498,12 +503,12 @@ allTests(const Ice::CommunicatorPtr& communicator) // Expected } - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; communicator->getProperties()->setProperty("TestAdapter0.Endpoints", "default -h " + host); - first = communicator->createObjectAdapter("TestAdapter0"); try { + first = communicator->createObjectAdapter("TestAdapter0"); Ice::ObjectAdapterPtr second = communicator->createObjectAdapter("TestAdapter0"); test(false); } @@ -517,6 +522,12 @@ allTests(const Ice::CommunicatorPtr& communicator) // Expected } +#ifdef ICE_OS_WINRT + catch(const Ice::FeatureNotSupportedException&) + { + // WinRT doesn't support SSL server side endponints. + } +#endif try { @@ -534,99 +545,109 @@ allTests(const Ice::CommunicatorPtr& communicator) // Expected. } - first->deactivate(); +#ifdef ICE_OS_WINRT + catch(const Ice::FeatureNotSupportedException&) + { + // WinRT doesn't support SSL server side endponints. + } +#else + first->deactivate(); +#endif } - cout << "ok" << endl; - cout << "testing servant registration exceptions... " << flush; + if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" && + communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")) { - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("TestAdapter1.Endpoints", "default -h " + host); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1"); - Ice::ObjectPtr obj = new EmptyI; - adapter->add(obj, communicator->stringToIdentity("x")); - try + cout << "testing servant registration exceptions... " << flush; { + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? + "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; + communicator->getProperties()->setProperty("TestAdapter1.Endpoints", "default -h " + host); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter1"); + Ice::ObjectPtr obj = new EmptyI; adapter->add(obj, communicator->stringToIdentity("x")); - test(false); - } - catch(const Ice::AlreadyRegisteredException& ex) - { - if(printException) + try { - Ice::Print printer(communicator->getLogger()); - printer << ex; + adapter->add(obj, communicator->stringToIdentity("x")); + test(false); + } + catch(const Ice::AlreadyRegisteredException& ex) + { + if(printException) + { + Ice::Print printer(communicator->getLogger()); + printer << ex; + } } - } - try - { - adapter->add(obj, communicator->stringToIdentity("")); - } - catch(const Ice::IllegalIdentityException& ex) - { - test(ex.id.name == ""); - if(printException) + try { - Ice::Print printer(communicator->getLogger()); - printer << ex; + adapter->add(obj, communicator->stringToIdentity("")); } - } - - try - { - adapter->add(0, communicator->stringToIdentity("x")); - } - catch(const Ice::IllegalServantException& ex) - { - if(printException) + catch(const Ice::IllegalIdentityException& ex) { - Ice::Print printer(communicator->getLogger()); - printer << ex; + test(ex.id.name == ""); + if(printException) + { + Ice::Print printer(communicator->getLogger()); + printer << ex; + } + } + + try + { + adapter->add(0, communicator->stringToIdentity("x")); + } + catch(const Ice::IllegalServantException& ex) + { + if(printException) + { + Ice::Print printer(communicator->getLogger()); + printer << ex; + } } - } - adapter->remove(communicator->stringToIdentity("x")); - try - { adapter->remove(communicator->stringToIdentity("x")); - test(false); - } - catch(const Ice::NotRegisteredException& ex) - { - if(printException) + try { - Ice::Print printer(communicator->getLogger()); - printer << ex; + adapter->remove(communicator->stringToIdentity("x")); + test(false); + } + catch(const Ice::NotRegisteredException& ex) + { + if(printException) + { + Ice::Print printer(communicator->getLogger()); + printer << ex; + } } - } - adapter->deactivate(); - } - cout << "ok" << endl; + adapter->deactivate(); + } + cout << "ok" << endl; - cout << "testing servant locator registrations exceptions... " << flush; - { - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("TestAdapter2.Endpoints", "default -h " + host); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2"); - Ice::ServantLocatorPtr loc = new ServantLocatorI; - adapter->addServantLocator(loc, "x"); - try + cout << "testing servant locator registrations exceptions... " << flush; { + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? + "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; + communicator->getProperties()->setProperty("TestAdapter2.Endpoints", "default -h " + host); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter2"); + Ice::ServantLocatorPtr loc = new ServantLocatorI; adapter->addServantLocator(loc, "x"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - } + try + { + adapter->addServantLocator(loc, "x"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + } - adapter->deactivate(); + adapter->deactivate(); + } + cout << "ok" << endl; } - cout << "ok" << endl; cout << "testing object factory registration exception... " << flush; { diff --git a/cpp/test/Ice/facets/AllTests.cpp b/cpp/test/Ice/facets/AllTests.cpp index 668a2753280..1e4c07e0d41 100644 --- a/cpp/test/Ice/facets/AllTests.cpp +++ b/cpp/test/Ice/facets/AllTests.cpp @@ -22,6 +22,11 @@ class EmptyI : virtual public Empty GPrx allTests(const Ice::CommunicatorPtr& communicator) { +#ifdef ICE_OS_WINRT + bool winrt = true; +#else + bool winrt = false +#endif cout << "testing Ice.Admin.Facets property... " << flush; test(communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets").empty()); communicator->getProperties()->setProperty("Ice.Admin.Facets", "foobar"); @@ -32,7 +37,7 @@ allTests(const Ice::CommunicatorPtr& communicator) test(facetFilter.size() == 1 && facetFilter[0] == "foo'bar"); communicator->getProperties()->setProperty("Ice.Admin.Facets", "'foo bar' toto 'titi'"); facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets"); - test(facetFilter.size() == 3 && facetFilter[0] == "foo bar" && facetFilter[1] == "toto" && + test(facetFilter.size() == 3 && facetFilter[0] == "foo bar" && facetFilter[1] == "toto" && facetFilter[2] == "titi"); communicator->getProperties()->setProperty("Ice.Admin.Facets", "'foo bar\\' toto' 'titi'"); facetFilter = communicator->getProperties()->getPropertyAsList("Ice.Admin.Facets"); @@ -43,62 +48,66 @@ allTests(const Ice::CommunicatorPtr& communicator) communicator->getProperties()->setProperty("Ice.Admin.Facets", ""); cout << "ok" << endl; - cout << "testing facet registration exceptions... " << flush; - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? - "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - communicator->getProperties()->setProperty("FacetExceptionTestAdapter.Endpoints", "default -h " + host); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("FacetExceptionTestAdapter"); - Ice::ObjectPtr obj = new EmptyI; - adapter->add(obj, communicator->stringToIdentity("d")); - adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); - try + if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" && + communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")) { + cout << "testing facet registration exceptions... " << flush; + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? + "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; + communicator->getProperties()->setProperty("FacetExceptionTestAdapter.Endpoints", "default -h " + host); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("FacetExceptionTestAdapter"); + Ice::ObjectPtr obj = new EmptyI; + adapter->add(obj, communicator->stringToIdentity("d")); adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); - test(false); - } - catch(const Ice::AlreadyRegisteredException&) - { - } - adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); - try - { + try + { + adapter->addFacet(obj, communicator->stringToIdentity("d"), "facetABCD"); + test(false); + } + catch(const Ice::AlreadyRegisteredException&) + { + } adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); - test(false); - } - catch(const Ice::NotRegisteredException&) - { + try + { + adapter->removeFacet(communicator->stringToIdentity("d"), "facetABCD"); + test(false); + } + catch(const Ice::NotRegisteredException&) + { + } + cout << "ok" << endl; + + cout << "testing removeAllFacets... " << flush; + Ice::ObjectPtr obj1 = new EmptyI; + Ice::ObjectPtr obj2 = new EmptyI; + adapter->addFacet(obj1, communicator->stringToIdentity("id1"), "f1"); + adapter->addFacet(obj2, communicator->stringToIdentity("id1"), "f2"); + Ice::ObjectPtr obj3 = new EmptyI; + adapter->addFacet(obj1, communicator->stringToIdentity("id2"), "f1"); + adapter->addFacet(obj2, communicator->stringToIdentity("id2"), "f2"); + adapter->addFacet(obj3, communicator->stringToIdentity("id2"), ""); + Ice::FacetMap fm = adapter->removeAllFacets(communicator->stringToIdentity("id1")); + test(fm.size() == 2); + test(fm["f1"] == obj1); + test(fm["f2"] == obj2); + try + { + adapter->removeAllFacets(communicator->stringToIdentity("id1")); + test(false); + } + catch(const Ice::NotRegisteredException&) + { + } + fm = adapter->removeAllFacets(communicator->stringToIdentity("id2")); + test(fm.size() == 3); + test(fm["f1"] == obj1); + test(fm["f2"] == obj2); + test(fm[""] == obj3); + cout << "ok" << endl; + + adapter->deactivate(); } - cout << "ok" << endl; - - cout << "testing removeAllFacets... " << flush; - Ice::ObjectPtr obj1 = new EmptyI; - Ice::ObjectPtr obj2 = new EmptyI; - adapter->addFacet(obj1, communicator->stringToIdentity("id1"), "f1"); - adapter->addFacet(obj2, communicator->stringToIdentity("id1"), "f2"); - Ice::ObjectPtr obj3 = new EmptyI; - adapter->addFacet(obj1, communicator->stringToIdentity("id2"), "f1"); - adapter->addFacet(obj2, communicator->stringToIdentity("id2"), "f2"); - adapter->addFacet(obj3, communicator->stringToIdentity("id2"), ""); - Ice::FacetMap fm = adapter->removeAllFacets(communicator->stringToIdentity("id1")); - test(fm.size() == 2); - test(fm["f1"] == obj1); - test(fm["f2"] == obj2); - try - { - adapter->removeAllFacets(communicator->stringToIdentity("id1")); - test(false); - } - catch(const Ice::NotRegisteredException&) - { - } - fm = adapter->removeAllFacets(communicator->stringToIdentity("id2")); - test(fm.size() == 3); - test(fm["f1"] == obj1); - test(fm["f2"] == obj2); - test(fm[""] == obj3); - cout << "ok" << endl; - - adapter->deactivate(); cout << "testing stringToProxy... " << flush; string ref = "d:default -p 12010"; diff --git a/cpp/test/Ice/info/AllTests.cpp b/cpp/test/Ice/info/AllTests.cpp index efe452f7c9f..cf9e5f28bea 100644 --- a/cpp/test/Ice/info/AllTests.cpp +++ b/cpp/test/Ice/info/AllTests.cpp @@ -70,55 +70,65 @@ allTests(const Ice::CommunicatorPtr& communicator) } cout << "ok" << endl; +#ifdef ICE_OS_WINRT + bool winrt = true; +#else + bool winrt = false; +#endif + string defaultHost = communicator->getProperties()->getProperty("Ice.Default.Host"); - cout << "test object adapter endpoint information... " << flush; + if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" && + communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h 127.0.0.1 -t 15000:udp -h 127.0.0.1"); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); - - Ice::EndpointSeq endpoints = adapter->getEndpoints(); - test(endpoints.size() == 2); - Ice::EndpointSeq publishedEndpoints = adapter->getPublishedEndpoints(); - test(endpoints == publishedEndpoints); - - Ice::IPEndpointInfoPtr ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast(endpoints[0]->getInfo()); - test(ipEndpoint); - test(ipEndpoint->type() == Ice::TCPEndpointType || ipEndpoint->type() == IceSSL::EndpointType || - ipEndpoint->type() == Ice::WSEndpointType || ipEndpoint->type() == Ice::WSSEndpointType); - test(ipEndpoint->host == "127.0.0.1"); - test(ipEndpoint->port > 0); - test(ipEndpoint->timeout == 15000); - - Ice::UDPEndpointInfoPtr udpEndpoint = Ice::UDPEndpointInfoPtr::dynamicCast(endpoints[1]->getInfo()); - test(udpEndpoint); - test(udpEndpoint->host == "127.0.0.1"); - test(udpEndpoint->datagram()); - test(udpEndpoint->port > 0); - - adapter->destroy(); - - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h * -p 12020"); - communicator->getProperties()->setProperty("TestAdapter.PublishedEndpoints", "default -h 127.0.0.1 -p 12020"); - adapter = communicator->createObjectAdapter("TestAdapter"); - - endpoints = adapter->getEndpoints(); - test(endpoints.size() >= 1); - publishedEndpoints = adapter->getPublishedEndpoints(); - test(publishedEndpoints.size() == 1); - - for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) + cout << "test object adapter endpoint information... " << flush; { - ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast((*p)->getInfo()); - test(ipEndpoint->port == 12020); - } + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h 127.0.0.1 -t 15000:udp -h 127.0.0.1"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + + Ice::EndpointSeq endpoints = adapter->getEndpoints(); + test(endpoints.size() == 2); + Ice::EndpointSeq publishedEndpoints = adapter->getPublishedEndpoints(); + test(endpoints == publishedEndpoints); + + Ice::IPEndpointInfoPtr ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast(endpoints[0]->getInfo()); + test(ipEndpoint); + test(ipEndpoint->type() == Ice::TCPEndpointType || ipEndpoint->type() == IceSSL::EndpointType || + ipEndpoint->type() == Ice::WSEndpointType || ipEndpoint->type() == Ice::WSSEndpointType); + test(ipEndpoint->host == "127.0.0.1"); + test(ipEndpoint->port > 0); + test(ipEndpoint->timeout == 15000); + + Ice::UDPEndpointInfoPtr udpEndpoint = Ice::UDPEndpointInfoPtr::dynamicCast(endpoints[1]->getInfo()); + test(udpEndpoint); + test(udpEndpoint->host == "127.0.0.1"); + test(udpEndpoint->datagram()); + test(udpEndpoint->port > 0); + + adapter->destroy(); + + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h * -p 12020"); + communicator->getProperties()->setProperty("TestAdapter.PublishedEndpoints", "default -h 127.0.0.1 -p 12020"); + adapter = communicator->createObjectAdapter("TestAdapter"); + + endpoints = adapter->getEndpoints(); + test(endpoints.size() >= 1); + publishedEndpoints = adapter->getPublishedEndpoints(); + test(publishedEndpoints.size() == 1); + + for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) + { + ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast((*p)->getInfo()); + test(ipEndpoint->port == 12020); + } - ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast(publishedEndpoints[0]->getInfo()); - test(ipEndpoint->host == "127.0.0.1"); - test(ipEndpoint->port == 12020); + ipEndpoint = Ice::IPEndpointInfoPtr::dynamicCast(publishedEndpoints[0]->getInfo()); + test(ipEndpoint->host == "127.0.0.1"); + test(ipEndpoint->port == 12020); - adapter->destroy(); + adapter->destroy(); + } + cout << "ok" << endl; } - cout << "ok" << endl; Ice::ObjectPrx base = communicator->stringToProxy("test:default -p 12010:udp -p 12010 -c"); TestIntfPrx testIntf = TestIntfPrx::checkedCast(base); diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index 92066115ac9..ffd3531675a 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -20,7 +20,7 @@ using namespace Test; class HelloI : virtual public Hello { public: - + virtual void sayHello(const Ice::Current&) { @@ -622,29 +622,39 @@ allTests(const Ice::CommunicatorPtr& communicator, const string& ref) } cout << "ok" << endl; - string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? +#ifdef ICE_OS_WINRT + bool winrt = true; +#else + bool winrt = false; +#endif + string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ? "127.0.0.1" : "\"0:0:0:0:0:0:0:1\""; - if(communicator->getProperties()->getProperty("Ice.Default.Host") == host) - { - cout << "testing indirect proxies to collocated objects... " << flush; - // - // Set up test for calling a collocated object through an indirect, adapterless reference. - // - Ice::PropertiesPtr properties = communicator->getProperties(); - properties->setProperty("Ice.PrintAdapterReady", "0"); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Hello", "default"); - adapter->setLocator(locator); - - Ice::Identity id; - id.name = IceUtil::generateUUID(); - registry->addObject(adapter->add(new HelloI, id)); - adapter->activate(); - - HelloPrx helloPrx = HelloPrx::checkedCast(communicator->stringToProxy(communicator->identityToString(id))); - test(!helloPrx->ice_getConnection()); - - adapter->deactivate(); - cout << "ok" << endl; + + if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" && + communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss")) + { + if(communicator->getProperties()->getProperty("Ice.Default.Host") == host) + { + cout << "testing indirect proxies to collocated objects... " << flush; + // + // Set up test for calling a collocated object through an indirect, adapterless reference. + // + Ice::PropertiesPtr properties = communicator->getProperties(); + properties->setProperty("Ice.PrintAdapterReady", "0"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("Hello", "default"); + adapter->setLocator(locator); + + Ice::Identity id; + id.name = IceUtil::generateUUID(); + registry->addObject(adapter->add(new HelloI, id)); + adapter->activate(); + + HelloPrx helloPrx = HelloPrx::checkedCast(communicator->stringToProxy(communicator->identityToString(id))); + test(!helloPrx->ice_getConnection()); + + adapter->deactivate(); + cout << "ok" << endl; + } } cout << "shutdown server manager... " << flush; manager->shutdown(); diff --git a/cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters b/cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters index 1f75556759b..c92fc4db3da 100644 --- a/cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters +++ b/cpp/test/TestSuite/10.0/TestSuite.vcxproj.filters @@ -15,6 +15,12 @@ <Filter Include="Styles"> <UniqueIdentifier>65bbfccd-24aa-402e-8946-23421ba48638</UniqueIdentifier> </Filter> + <Filter Include="Source Files"> + <UniqueIdentifier>{07e8b16a-ff68-49b2-8edd-c57a68d0f344}</UniqueIdentifier> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{c22d6406-2914-479e-abf7-d07276ada0f7}</UniqueIdentifier> + </Filter> </ItemGroup> <ItemGroup> <ApplicationDefinition Include="App.xaml" /> |