diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-09-11 20:33:06 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-09-11 20:33:06 +0000 |
commit | af019e080ac9319035abe899838bc6ff7bf7e435 (patch) | |
tree | 754643a46a0f0ef381b0a7596fc08a17dcda5cdf /cpp/test | |
parent | Fix bug in changeTimeout (the newEndpoints were not passed to the (diff) | |
download | ice-af019e080ac9319035abe899838bc6ff7bf7e435.tar.bz2 ice-af019e080ac9319035abe899838bc6ff7bf7e435.tar.xz ice-af019e080ac9319035abe899838bc6ff7bf7e435.zip |
Object adapter creation method changes, IceBox changes.
Diffstat (limited to 'cpp/test')
39 files changed, 100 insertions, 174 deletions
diff --git a/cpp/test/Glacier/starter/Client.cpp b/cpp/test/Glacier/starter/Client.cpp index 55b77842ff7..7fec465695d 100644 --- a/cpp/test/Glacier/starter/Client.cpp +++ b/cpp/test/Glacier/starter/Client.cpp @@ -37,7 +37,8 @@ CallbackClient::run(int argc, char* argv[]) { string ref; - ObjectAdapterPtr adapter = communicator()->createObjectAdapterWithEndpoints("CallbackReceiverAdapter", "default"); + communicator()->getProperties()->setProperty("CallbackReceiverAdapter.Endpoints", "default"); + ObjectAdapterPtr adapter = communicator()->createObjectAdapter("CallbackReceiverAdapter"); adapter->activate(); // Put the print statement after activate(), so that if // Ice.PrintAdapterReady is set, the "ready" is the first output diff --git a/cpp/test/Glacier/starter/Server.cpp b/cpp/test/Glacier/starter/Server.cpp index 7bac3485fe5..135d1dc5b97 100644 --- a/cpp/test/Glacier/starter/Server.cpp +++ b/cpp/test/Glacier/starter/Server.cpp @@ -31,8 +31,8 @@ main(int argc, char* argv[]) int CallbackServer::run(int argc, char* argv[]) { - string endpts = "tcp -p 12345 -t 2000"; - ObjectAdapterPtr adapter = communicator()->createObjectAdapterWithEndpoints("CallbackAdapter", endpts); + communicator()->getProperties()->setProperty("CallbackAdapter.Endpoints", "tcp -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("CallbackAdapter"); CallbackPrx self = CallbackPrx::uncheckedCast(adapter->createProxy(Ice::stringToIdentity("callback"))); adapter->add(new CallbackI(communicator()), Ice::stringToIdentity("callback")); adapter->activate(); diff --git a/cpp/test/Ice/exceptions/Collocated.cpp b/cpp/test/Ice/exceptions/Collocated.cpp index 13fe7ce6158..e13bd348d71 100644 --- a/cpp/test/Ice/exceptions/Collocated.cpp +++ b/cpp/test/Ice/exceptions/Collocated.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new ThrowerI(adapter); adapter->add(object, Ice::stringToIdentity("thrower")); diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp index ff25f39b2ef..25129f353f5 100644 --- a/cpp/test/Ice/exceptions/Server.cpp +++ b/cpp/test/Ice/exceptions/Server.cpp @@ -18,8 +18,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); properties->setProperty("Ice.ConnectionWarnings", "0"); - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new ThrowerI(adapter); adapter->add(object, Ice::stringToIdentity("thrower")); adapter->activate(); diff --git a/cpp/test/Ice/facets/Collocated.cpp b/cpp/test/Ice/facets/Collocated.cpp index 6257639d6b5..963405b6305 100644 --- a/cpp/test/Ice/facets/Collocated.cpp +++ b/cpp/test/Ice/facets/Collocated.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr d = new DI; adapter->add(d, Ice::stringToIdentity("d")); d->ice_addFacet(d, "facetABCD"); diff --git a/cpp/test/Ice/facets/Server.cpp b/cpp/test/Ice/facets/Server.cpp index 7c25e743151..57d1de4c6de 100644 --- a/cpp/test/Ice/facets/Server.cpp +++ b/cpp/test/Ice/facets/Server.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr d = new DI; adapter->add(d, Ice::stringToIdentity("d")); d->ice_addFacet(d, "facetABCD"); diff --git a/cpp/test/Ice/faultTolerance/Server.cpp b/cpp/test/Ice/faultTolerance/Server.cpp index 90c9e33f04e..5f67babd71e 100644 --- a/cpp/test/Ice/faultTolerance/Server.cpp +++ b/cpp/test/Ice/faultTolerance/Server.cpp @@ -51,7 +51,8 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) ostringstream endpts; endpts << "default -p " << port; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts.str()); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpts.str()); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new TestI(adapter); adapter->add(object, Ice::stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/inheritance/Collocated.cpp b/cpp/test/Ice/inheritance/Collocated.cpp index 641674e6942..c49924d7a44 100644 --- a/cpp/test/Ice/inheritance/Collocated.cpp +++ b/cpp/test/Ice/inheritance/Collocated.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new InitialI(adapter); adapter->add(object, Ice::stringToIdentity("initial")); diff --git a/cpp/test/Ice/inheritance/Server.cpp b/cpp/test/Ice/inheritance/Server.cpp index 9d429a7eeb1..515d04fd1a1 100644 --- a/cpp/test/Ice/inheritance/Server.cpp +++ b/cpp/test/Ice/inheritance/Server.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new InitialI(adapter); adapter->add(object, Ice::stringToIdentity("initial")); adapter->activate(); diff --git a/cpp/test/Ice/location/AllTests.cpp b/cpp/test/Ice/location/AllTests.cpp index 67327d1da42..62cba6a87eb 100644 --- a/cpp/test/Ice/location/AllTests.cpp +++ b/cpp/test/Ice/location/AllTests.cpp @@ -15,10 +15,9 @@ using namespace std; void -allTests(const Ice::CommunicatorPtr& communicator) +allTests(const Ice::CommunicatorPtr& communicator, const string& ref) { - ServerManagerPrx manager = ServerManagerPrx::checkedCast( - communicator->stringToProxy("servermanager :default -t 10000 -p 12345")); + ServerManagerPrx manager = ServerManagerPrx::checkedCast(communicator->stringToProxy(ref)); test(manager); // diff --git a/cpp/test/Ice/location/Client.cpp b/cpp/test/Ice/location/Client.cpp index 12108ead77b..dd4954c2058 100644 --- a/cpp/test/Ice/location/Client.cpp +++ b/cpp/test/Ice/location/Client.cpp @@ -17,8 +17,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - void allTests(const Ice::CommunicatorPtr&); - allTests(communicator); + void allTests(const Ice::CommunicatorPtr&, const string&); + allTests(communicator, "ServerManager:default -p 12345 -t 10000"); return EXIT_SUCCESS; } diff --git a/cpp/test/Ice/location/Collocated.cpp b/cpp/test/Ice/location/Collocated.cpp index 367a6ac2982..581673703ca 100644 --- a/cpp/test/Ice/location/Collocated.cpp +++ b/cpp/test/Ice/location/Collocated.cpp @@ -16,13 +16,13 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("ServerManagerAdapter", endpts); + communicator->getProperties()->setProperty("ServerManager.AdapterId", "ServerManager"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ServerManager"); Ice::ObjectPtr object = new ServerManagerI(adapter); - adapter->add(object, Ice::stringToIdentity("servermanager")); + adapter->add(object, Ice::stringToIdentity("ServerManager")); - void allTests(const Ice::CommunicatorPtr&); - allTests(communicator); + void allTests(const Ice::CommunicatorPtr&, const string&); + allTests(communicator, "ServerManager@ServerManager"); return EXIT_SUCCESS; } diff --git a/cpp/test/Ice/location/Server.cpp b/cpp/test/Ice/location/Server.cpp index 2214493b0aa..b0c56c57849 100644 --- a/cpp/test/Ice/location/Server.cpp +++ b/cpp/test/Ice/location/Server.cpp @@ -23,12 +23,12 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) // communicator and object adapter). // Ice::PropertiesPtr properties = communicator->getProperties(); - properties->setProperty("Ice.Adapter.ServerManagerAdapter.Endpoints", "default -p 12345"); + properties->setProperty("ServerManager.Endpoints", "default -p 12345"); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ServerManagerAdapter"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ServerManager"); Ice::ObjectPtr object = new ServerManagerI(adapter); - adapter->add(object, Ice::stringToIdentity("servermanager")); + adapter->add(object, Ice::stringToIdentity("ServerManager")); // // We also register a sample server locator which implements the diff --git a/cpp/test/Ice/location/TestI.cpp b/cpp/test/Ice/location/TestI.cpp index aa800a3a4d6..048aeaf671c 100644 --- a/cpp/test/Ice/location/TestI.cpp +++ b/cpp/test/Ice/location/TestI.cpp @@ -31,7 +31,9 @@ ServerManagerI::startServer(const Ice::Current&) // the adapter id instead of the endpoints. // _serverCommunicator = Ice::initialize(argc, argv); - Ice::ObjectAdapterPtr adapter = _serverCommunicator->createObjectAdapterWithEndpoints("TestAdapter", "default"); + _serverCommunicator->getProperties()->setProperty("TestAdapter.Endpoints", "default"); + _serverCommunicator->getProperties()->setProperty("TestAdapter.AdapterId", "TestAdapter"); + Ice::ObjectAdapterPtr adapter = _serverCommunicator->createObjectAdapter("TestAdapter"); Ice::ObjectPrx locator = _serverCommunicator->stringToProxy("locator:default -p 12345"); adapter->setLocator(Ice::LocatorPrx::uncheckedCast(locator)); diff --git a/cpp/test/Ice/locationForward/Server.cpp b/cpp/test/Ice/locationForward/Server.cpp index fdeb807d092..2765e71003a 100644 --- a/cpp/test/Ice/locationForward/Server.cpp +++ b/cpp/test/Ice/locationForward/Server.cpp @@ -62,8 +62,9 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) } ostringstream endpts; - endpts << "default -p " << port; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts.str()); + endpts << "default -p " << port; + communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpts.str()); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new TestI(adapter, fwd); adapter->add(object, Ice::stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp index 18074993a2d..cdd5f0d25d1 100644 --- a/cpp/test/Ice/objects/Collocated.cpp +++ b/cpp/test/Ice/objects/Collocated.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); InitialPtr initial = new InitialI(adapter); adapter->add(initial, Ice::stringToIdentity("initial")); InitialPrx allTests(const Ice::CommunicatorPtr&, bool); diff --git a/cpp/test/Ice/objects/Server.cpp b/cpp/test/Ice/objects/Server.cpp index 45beed7cf20..d078385f27c 100644 --- a/cpp/test/Ice/objects/Server.cpp +++ b/cpp/test/Ice/objects/Server.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); InitialPtr initial = new InitialI(adapter); adapter->add(initial, Ice::stringToIdentity("initial")); adapter->activate(); diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp index 747d22c2d78..c385c174784 100644 --- a/cpp/test/Ice/operations/Collocated.cpp +++ b/cpp/test/Ice/operations/Collocated.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new MyDerivedClassI(adapter, Ice::stringToIdentity("test")); adapter->add(object, Ice::stringToIdentity("test")); diff --git a/cpp/test/Ice/operations/Server.cpp b/cpp/test/Ice/operations/Server.cpp index 7dd323418ef..7b28350bcbe 100644 --- a/cpp/test/Ice/operations/Server.cpp +++ b/cpp/test/Ice/operations/Server.cpp @@ -16,8 +16,8 @@ using namespace std; int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { - string endpts = "default -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new MyDerivedClassI(adapter, Ice::stringToIdentity("test")); adapter->add(object, Ice::stringToIdentity("test")); adapter->activate(); diff --git a/cpp/test/IcePack/deployer/AllTests.cpp b/cpp/test/IcePack/deployer/AllTests.cpp index d169f912ed4..3960afe5fd9 100644 --- a/cpp/test/IcePack/deployer/AllTests.cpp +++ b/cpp/test/IcePack/deployer/AllTests.cpp @@ -34,7 +34,7 @@ void allCommonTests(const Ice::CommunicatorPtr& communicator) { IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast( - communicator->stringToProxy("IcePack/Admin@IcePackAdminAdapter")); + communicator->stringToProxy("IcePack/Admin@IcePack.Registry.Admin")); test(admin); cout << "test server registration..." << flush; @@ -56,7 +56,7 @@ allCommonTests(const Ice::CommunicatorPtr& communicator) cout << "ok" << endl; Yellow::QueryPrx yellow = Yellow::QueryPrx::checkedCast( - communicator->stringToProxy("Yellow/Query@YellowQueryAdapter")); + communicator->stringToProxy("Yellow/Query@Yellow.Query")); test(yellow); cout << "testing offer registration... " << flush; @@ -127,7 +127,7 @@ allTestsWithTarget(const Ice::CommunicatorPtr& communicator) allCommonTests(communicator); IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast( - communicator->stringToProxy("IcePack/Admin@IcePackAdminAdapter")); + communicator->stringToProxy("IcePack/Admin@IcePack.Registry.Admin")); test(admin); cout << "pinging server objects... " << flush; diff --git a/cpp/test/IcePack/deployer/Server.cpp b/cpp/test/IcePack/deployer/Server.cpp index c68f83839b4..8613974b79a 100644 --- a/cpp/test/IcePack/deployer/Server.cpp +++ b/cpp/test/IcePack/deployer/Server.cpp @@ -28,7 +28,7 @@ int Ice::PropertiesPtr properties = communicator()->getProperties(); string name = properties->getProperty("Ice.ProgramName"); - Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter(name + "Adapter"); + Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter(name); Ice::ObjectPtr object = new TestI(adapter, properties); adapter->add(object, Ice::stringToIdentity(name)); adapter->activate(); diff --git a/cpp/test/IcePack/deployer/Service.cpp b/cpp/test/IcePack/deployer/Service.cpp index b1a54c8bc23..fd0d7b0fce6 100644 --- a/cpp/test/IcePack/deployer/Service.cpp +++ b/cpp/test/IcePack/deployer/Service.cpp @@ -31,7 +31,6 @@ public: virtual void start(const string&, const CommunicatorPtr&, - const PropertiesPtr&, const StringSeq&); virtual void stop(); @@ -46,7 +45,6 @@ public: virtual void start(const string&, const CommunicatorPtr&, - const PropertiesPtr&, const StringSeq&, const Freeze::DBEnvironmentPtr&); @@ -84,11 +82,10 @@ ServiceI::~ServiceI() void ServiceI::start(const string& name, const CommunicatorPtr& communicator, - const PropertiesPtr& properties, const StringSeq& args) { - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter"); - Ice::ObjectPtr object = new TestI(adapter, properties); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name); + Ice::ObjectPtr object = new TestI(adapter, communicator->getProperties()); adapter->add(object, Ice::stringToIdentity(name)); adapter->activate(); } @@ -109,7 +106,6 @@ FreezeServiceI::~FreezeServiceI() void FreezeServiceI::start(const string& name, const CommunicatorPtr& communicator, - const PropertiesPtr& properties, const StringSeq& args, const Freeze::DBEnvironmentPtr& dbEnv) { @@ -118,8 +114,8 @@ FreezeServiceI::start(const string& name, // Freeze::DBPtr db = dbEnv->openDB("testdb", true); - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name + "Adapter"); - Ice::ObjectPtr object = new TestI(adapter, properties); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter(name); + Ice::ObjectPtr object = new TestI(adapter, communicator->getProperties()); adapter->add(object, Ice::stringToIdentity(name)); adapter->activate(); } diff --git a/cpp/test/IcePack/deployer/freezeservice.xml b/cpp/test/IcePack/deployer/freezeservice.xml index 5dd9940494e..e39427c1caa 100644 --- a/cpp/test/IcePack/deployer/freezeservice.xml +++ b/cpp/test/IcePack/deployer/freezeservice.xml @@ -1,7 +1,7 @@ <service kind="freeze" entry="TestService:createFreezeService"> <adapters> - <adapter name="${name}Adapter" endpoints="default"> + <adapter name="${name}" endpoints="default" id="${name}Adapter"> <offer interface="::Test" identity="${name}"/> </adapter> </adapters> diff --git a/cpp/test/IcePack/deployer/server.xml b/cpp/test/IcePack/deployer/server.xml index ac21a8cbd0f..47528322380 100644 --- a/cpp/test/IcePack/deployer/server.xml +++ b/cpp/test/IcePack/deployer/server.xml @@ -6,7 +6,7 @@ </target> <adapters> - <adapter name="${name}Adapter" endpoints="default"> + <adapter name="${name}" endpoints="default" id="${name}Adapter"> <offer interface="::Test" identity="${name}"/> </adapter> </adapters> diff --git a/cpp/test/IcePack/deployer/service.xml b/cpp/test/IcePack/deployer/service.xml index d62c74789b5..11ec815ae3a 100644 --- a/cpp/test/IcePack/deployer/service.xml +++ b/cpp/test/IcePack/deployer/service.xml @@ -1,7 +1,7 @@ <service kind="standard" entry="TestService:create"> <adapters> - <adapter name="${name}Adapter" endpoints="default"> + <adapter name="${name}" endpoints="default" id="${name}Adapter"> <offer interface="::Test" identity="${name}"/> </adapter> </adapters> diff --git a/cpp/test/IcePack/deployer/yellow_service.xml b/cpp/test/IcePack/deployer/yellow_service.xml index 780fb53f086..dd78c1667ab 100644 --- a/cpp/test/IcePack/deployer/yellow_service.xml +++ b/cpp/test/IcePack/deployer/yellow_service.xml @@ -1,13 +1,8 @@ <service kind="freeze" entry="YellowService:create" endpoints="default"> -<adapters> - <adapter name="${name}QueryAdapter"/> - <adapter name="${name}AdminAdapter"/> -</adapters> - -<properties> - <property name="${name}.Query.Endpoints" value="default"/> - <property name="${name}.Admin.Endpoints" value="default"/> -</properties> + <adapters> + <adapter name="${name}.Query" endpoints="default" id="Yellow.Query"/> + <adapter name="${name}.Admin" endpoints="default" id="Yellow.Admin"/> + </adapters> </service> diff --git a/cpp/test/IcePack/simple/Collocated.cpp b/cpp/test/IcePack/simple/Collocated.cpp deleted file mode 100644 index b2130d41c46..00000000000 --- a/cpp/test/IcePack/simple/Collocated.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2001 -// Mutable Realms, Inc. -// Huntsville, AL, USA -// -// All Rights Reserved -// -// ********************************************************************** - -#include <Ice/Ice.h> -#include <TestI.h> - -using namespace std; - -int -run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) -{ - string endpts = "default -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TestAdapter", endpts); - Ice::ObjectPtr object = new TestI(adapter); - adapter->add(object, Ice::stringToIdentity("test")); - - TestPrx allTests(const Ice::CommunicatorPtr&); - allTests(communicator); - return EXIT_SUCCESS; -} - -int -main(int argc, char* argv[]) -{ - int status; - Ice::CommunicatorPtr communicator; - - try - { - communicator = Ice::initialize(argc, argv); - status = run(argc, argv, communicator); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - - if(communicator) - { - try - { - communicator->destroy(); - } - catch(const Ice::Exception& ex) - { - cerr << ex << endl; - status = EXIT_FAILURE; - } - } - - return status; -} diff --git a/cpp/test/IcePack/simple/Makefile b/cpp/test/IcePack/simple/Makefile index 5c13407afd4..8b7b1660ba7 100644 --- a/cpp/test/IcePack/simple/Makefile +++ b/cpp/test/IcePack/simple/Makefile @@ -12,9 +12,8 @@ top_srcdir = ../../.. CLIENT = client SERVER = server -COLLOCATED = collocated -TARGETS = $(CLIENT) $(SERVER) $(COLLOCATED) +TARGETS = $(CLIENT) $(SERVER) OBJS = Test.o \ @@ -24,14 +23,9 @@ COBJS = Client.o \ SOBJS = TestI.o \ Server.o -COLOBJS = TestI.o \ - Collocated.o \ - AllTests.o - SRCS = $(OBJS:.o=.cpp) \ $(COBJS:.o=.cpp) \ $(SOBJS:.o=.cpp) \ - $(COLOBJS:.o=.cpp) SLICE_SRCS = Test.ice @@ -47,10 +41,6 @@ $(SERVER): $(OBJS) $(SOBJS) rm -f $@ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS) -$(COLLOCATED): $(OBJS) $(COLOBJS) - rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) $(LIBS) - Test.h Test.cpp: Test.ice $(SLICE2CPP) rm -f Test.h Test.cpp $(SLICE2CPP) Test.ice diff --git a/cpp/test/IcePack/simple/Server.cpp b/cpp/test/IcePack/simple/Server.cpp index 39f5b6350c7..7ec28990fc6 100644 --- a/cpp/test/IcePack/simple/Server.cpp +++ b/cpp/test/IcePack/simple/Server.cpp @@ -17,8 +17,8 @@ int run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) { Ice::PropertiesPtr properties = communicator->getProperties(); - properties->setProperty("Ice.Adapter.TestAdapter.Endpoints", "default -t 2000"); - properties->setProperty("Ice.Adapter.TestAdapter.Locator", properties->getProperty("Ice.Default.Locator")); + properties->setProperty("TestAdapter.Endpoints", "default -t 2000"); + properties->setProperty("TestAdapter.AdapterId", "TestAdapter"); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::ObjectPtr object = new TestI(adapter); diff --git a/cpp/test/IcePack/simple/run.py b/cpp/test/IcePack/simple/run.py index f0937596df0..24ed905f18f 100755 --- a/cpp/test/IcePack/simple/run.py +++ b/cpp/test/IcePack/simple/run.py @@ -40,10 +40,9 @@ if os.path.exists(os.path.join(testdir, "db/registry")): icePackRegistryPipe = IcePackAdmin.startIcePackRegistry(toplevel, "12346", testdir) # -# Test client/server, collocated without on demand activation. +# Test client/server without on demand activation. # TestUtil.mixedClientServerTestWithOptions(toplevel, name, additionalOptions, additionalOptions) -TestUtil.collocatedTestWithOptions(toplevel, name, additionalOptions) # # Shutdown the registry. diff --git a/cpp/test/IcePack/simple/simple_server.xml b/cpp/test/IcePack/simple/simple_server.xml index 535ded622b5..5557a732b4e 100644 --- a/cpp/test/IcePack/simple/simple_server.xml +++ b/cpp/test/IcePack/simple/simple_server.xml @@ -1,7 +1,7 @@ <server kind="cpp"> <adapters> - <adapter name="TestAdapter"/> + <adapter name="TestAdapter" endpoints="default" id="TestAdapter"/> </adapters> <target name="debug"> diff --git a/cpp/test/IceSSL/certificateVerification/Server.cpp b/cpp/test/IceSSL/certificateVerification/Server.cpp index 69e80bb4532..58c899ac889 100644 --- a/cpp/test/IceSSL/certificateVerification/Server.cpp +++ b/cpp/test/IceSSL/certificateVerification/Server.cpp @@ -159,13 +159,13 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) sslPlugin->setCertificateVerifier(IceSSL::Server, certVerifier); } - string kmEndpts = "tcp -p 12344 -t 2000"; - Ice::ObjectAdapterPtr kmAdapter = communicator->createObjectAdapterWithEndpoints("KeyManagerAdapter", kmEndpts); + properties->setProperty("KeyManagerAdapter.Endpoints", "tcp -p 12344 -t 2000"); + Ice::ObjectAdapterPtr kmAdapter = communicator->createObjectAdapter("KeyManagerAdapter"); kmAdapter->add(object, Ice::stringToIdentity("keyManager")); kmAdapter->activate(); - string endpts = "ssl -p 12345 -t 2000"; - Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("PingerAdapter", endpts); + properties->setProperty("PingerAdapter.Endpoints", "ssl -p 12345 -t 2000"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("PingerAdapter"); adapter->add(new PingerI(), Ice::stringToIdentity("pinger")); adapter->activate(); communicator->waitForShutdown(); diff --git a/cpp/test/IceStorm/federation/Publisher.cpp b/cpp/test/IceStorm/federation/Publisher.cpp index 3578146b12d..e35b3ea4f2c 100644 --- a/cpp/test/IceStorm/federation/Publisher.cpp +++ b/cpp/test/IceStorm/federation/Publisher.cpp @@ -25,19 +25,19 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) args = properties->parseCommandLineOptions("IceStorm", args); stringSeqToArgs(args, argc, argv); - const char* managerReferenceProperty = "IceStorm.TopicManager"; - string managerReference = properties->getProperty(managerReferenceProperty); - if(managerReference.empty()) + const char* managerProxyProperty = "IceStorm.TopicManager.Proxy"; + string managerProxy = properties->getProperty(managerProxyProperty); + if(managerProxy.empty()) { - cerr << argv[0] << ": property `" << managerReferenceProperty << "' is not set" << endl; + cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectPrx base = communicator->stringToProxy(managerReference); + ObjectPrx base = communicator->stringToProxy(managerProxy); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { - cerr << argv[0] << ": `" << managerReference << "' is not running" << endl; + cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl; return EXIT_FAILURE; } diff --git a/cpp/test/IceStorm/federation/Subscriber.cpp b/cpp/test/IceStorm/federation/Subscriber.cpp index 8f1e51e0da6..f1abdd0ef00 100644 --- a/cpp/test/IceStorm/federation/Subscriber.cpp +++ b/cpp/test/IceStorm/federation/Subscriber.cpp @@ -86,23 +86,24 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) } createLock(lockfile); - const char* managerReferenceProperty = "IceStorm.TopicManager"; - string managerReference = properties->getProperty(managerReferenceProperty); - if(managerReference.empty()) + const char* managerProxyProperty = "IceStorm.TopicManager.Proxy"; + string managerProxy = properties->getProperty(managerProxyProperty); + if(managerProxy.empty()) { - cerr << argv[0] << ": property `" << managerReferenceProperty << "' is not set" << endl; + cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectPrx base = communicator->stringToProxy(managerReference); + ObjectPrx base = communicator->stringToProxy(managerProxy); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { - cerr << argv[0] << ": `" << managerReference << "' is not running" << endl; + cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl; return EXIT_FAILURE; } - ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("SubscriberAdapter", "default"); + properties->setProperty("SubscriberAdapter.Endpoints", "default"); + ObjectAdapterPtr adapter = communicator->createObjectAdapter("SubscriberAdapter"); EventIPtr eventFed1 = new EventI(communicator); EventIPtr eventFed2 = new EventI(communicator); EventIPtr eventFed3 = new EventI(communicator); diff --git a/cpp/test/IceStorm/federation/run.py b/cpp/test/IceStorm/federation/run.py index cb821a2f779..83386b06347 100755 --- a/cpp/test/IceStorm/federation/run.py +++ b/cpp/test/IceStorm/federation/run.py @@ -37,7 +37,7 @@ iceBoxEndpoints=' --IceBox.ServiceManager.Endpoints="default -p 12345"' iceStormService=" --IceBox.Service.IceStorm=IceStormService:create" + \ ' --IceStorm.TopicManager.Endpoints="default -p 12346"' + \ " --IceBox.PrintServicesReady=IceStorm" -iceStormReference=' --IceStorm.TopicManager="IceStorm.TopicManager: default -p 12346"' +iceStormReference=' --IceStorm.TopicManager.Proxy="IceStorm/TopicManager: default -p 12346"' dbEnvName = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbEnvName) diff --git a/cpp/test/IceStorm/federation2/run.py b/cpp/test/IceStorm/federation2/run.py index d4c2bd8d3af..088b29d494b 100755 --- a/cpp/test/IceStorm/federation2/run.py +++ b/cpp/test/IceStorm/federation2/run.py @@ -37,7 +37,7 @@ iceBoxEndpoints=' --IceBox.ServiceManager.Endpoints="default -p 12345"' iceStormService=" --IceBox.Service.IceStorm=IceStormService:create" + \ ' --IceStorm.TopicManager.Endpoints="default -p 12346"' + \ " --IceBox.PrintServicesReady=IceStorm" -iceStormReference=' --IceStorm.TopicManager="IceStorm.TopicManager: default -p 12346"' +iceStormReference=' --IceStorm.TopicManager.Proxy="IceStorm/TopicManager: default -p 12346"' dbEnvName = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbEnvName) diff --git a/cpp/test/IceStorm/single/Publisher.cpp b/cpp/test/IceStorm/single/Publisher.cpp index 4647483eae2..24e10019b2d 100644 --- a/cpp/test/IceStorm/single/Publisher.cpp +++ b/cpp/test/IceStorm/single/Publisher.cpp @@ -25,19 +25,19 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) args = properties->parseCommandLineOptions("IceStorm", args); stringSeqToArgs(args, argc, argv); - const char* managerReferenceProperty = "IceStorm.TopicManager"; - string managerReference = properties->getProperty(managerReferenceProperty); - if(managerReference.empty()) + const char* managerProxyProperty = "IceStorm.TopicManager.Proxy"; + string managerProxy = properties->getProperty(managerProxyProperty); + if(managerProxy.empty()) { - cerr << argv[0] << ": property `" << managerReferenceProperty << "' is not set" << endl; + cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectPrx base = communicator->stringToProxy(managerReference); + ObjectPrx base = communicator->stringToProxy(managerProxy); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { - cerr << argv[0] << ": `" << managerReference << "' is not running" << endl; + cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl; return EXIT_FAILURE; } diff --git a/cpp/test/IceStorm/single/Subscriber.cpp b/cpp/test/IceStorm/single/Subscriber.cpp index 40fec79d20a..23f3ca1db29 100644 --- a/cpp/test/IceStorm/single/Subscriber.cpp +++ b/cpp/test/IceStorm/single/Subscriber.cpp @@ -79,23 +79,24 @@ run(int argc, char* argv[], const CommunicatorPtr& communicator) } createLock(lockfile); - const char* managerReferenceProperty = "IceStorm.TopicManager"; - string managerReference = properties->getProperty(managerReferenceProperty); - if(managerReference.empty()) + const char* managerProxyProperty = "IceStorm.TopicManager.Proxy"; + string managerProxy = properties->getProperty(managerProxyProperty); + if(managerProxy.empty()) { - cerr << argv[0] << ": property `" << managerReferenceProperty << "' is not set" << endl; + cerr << argv[0] << ": property `" << managerProxyProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectPrx base = communicator->stringToProxy(managerReference); + ObjectPrx base = communicator->stringToProxy(managerProxy); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { - cerr << argv[0] << ": `" << managerReference << "' is not running" << endl; + cerr << argv[0] << ": `" << managerProxy << "' is not running" << endl; return EXIT_FAILURE; } - ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("SingleAdapter", "default"); + properties->setProperty("SingleAdapter", "default"); + ObjectAdapterPtr adapter = communicator->createObjectAdapter("SingleAdapter"); ObjectPtr single = new SingleI(communicator); ObjectPrx object = adapter->add(single, stringToIdentity("single/events")); diff --git a/cpp/test/IceStorm/single/run.py b/cpp/test/IceStorm/single/run.py index 762ff06609d..69a23e149d0 100755 --- a/cpp/test/IceStorm/single/run.py +++ b/cpp/test/IceStorm/single/run.py @@ -35,9 +35,9 @@ updatedClientServerOptions = TestUtil.clientServerOptions.replace("TOPLEVELDIR", iceBoxEndpoints=' --IceBox.ServiceManager.Endpoints="default -p 12345"' iceStormService=" --IceBox.Service.IceStorm=IceStormService:create" + \ - ' --IceStorm.TopicManager.Endpoints="default -p 12346"' + \ + ' --IceStorm.TopicManager.Endpoints="default -p 12346"' + \ " --IceBox.PrintServicesReady=IceStorm" -iceStormReference=' --IceStorm.TopicManager="IceStorm.TopicManager: default -p 12346"' +iceStormReference=' --IceStorm.TopicManager.Proxy="IceStorm/TopicManager:default -p 12346"' dbEnvName = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbEnvName) |