@echo off REM This is a 4NT Batch file. To use, just type run_test and it will start the REM server, wait for a second, and then start the client. At the end, it will REM clean up. setlocal set nsiorfile=%temp%\qns_ior set del=2 REM variables for parameters set nsport=20002 set clport=20003 set svport=20004 set ffport=20005 set lcport=20006 set gfport=20007 set n=1 set leave=/C set ior=0 set done= :get_args if %1 == /h goto is_h if %1 == /? goto is_h goto no_h :is_h echo run_test [/n num] [/leave] [/h] [/ns, /sv, /ff, /cl, /gf] echo. echo /n num -- runs the client num times echo /leave -- leaves the servers running and their windows open echo /h -- prints this information echo /ns /sv /ff /cl /gf -- Runs only one of the executables quit :no_h if not %1 == /ns goto no_ns set done=quit goto run_name_server :no_ns if not %1 == /sv goto no_sv set done=quit goto run_server :no_sv if not %1 == /ff goto no_ff set done=quit goto run_finder :no_ff if not %1 == /lc goto no_lc set done=quit goto run_lifecycle_service :no_lc if not %1 == /gf goto no_gf set done=quit goto run_generic_factory :no_gf if not %1 == /cl goto no_cl set done=quit goto run_client :no_cl if not %1 == /n goto no_n set n=%2 shift shift goto get_args :no_n if not %1 == /leave goto no_leave set leave=/K shift goto get_args :no_leave :run_name_server REM Naming Service must have been built or else this will fail start "Naming Service" %leave ..\..\orbsvcs\Naming_Service\Naming_Service.exe -ORBport %nsport -ORBobjrefstyle url -o %nsiorfile rem -ORBnameserviceior %temp\qns_ior %done REM Delay some to let the Naming Service get set up DELAY %del :run_server REM read in the IOR from the file for %%d in (@%nsiorfile) do set ior=%%d REM Start the server start "Quoter Server" %leave server.exe -ORBport %svport -ORBobjrefstyle url -ORBnameserviceior %ior -ORBsvcconf server.conf %done REM Delay some to let the server get set up DELAY %del :run_finder REM read in the IOR from the file for %%d in (@%nsiorfile) do set ior=%%d REM Start the factory finder start "Quoter Factory Finder" %leave Factory_Finder.exe -ORBport %ffport -ORBobjrefstyle url -ORBnameserviceior %ior -ORBsvcconf svc.conf %done REM Delay some to let the Factory Finder get set up DELAY %del :run_lifecycle_service REM read in the IOR from the file REM for %%d in (@%nsiorfile) do set ior=%%d REM Start the Lifecycle Service REM start "Quoter LifeCycle Service" %leave LifeCycle_Service.exe -ORBport %lcport -ORBobjrefstyle url -ORBnameserviceior %ior -ORBsvcconf svc.conf %done REM Delay some to let the LifeCycle Service get set up REM DELAY %del :run_generic_factory REM read in the IOR from the file for %%d in (@%nsiorfile) do set ior=%%d REM Start the factory finder start "Quoter Generic Factory" %leave Generic_Factory.exe -ORBport %gfport -ORBobjrefstyle url -ORBnameserviceior %ior -ORBsvcconf svc.conf %done REM Delay some to let the Generic Factory get set up DELAY %del :run_client REM read in the IOR from the file for %%d in (@%nsiorfile) do set ior=%%d REM And now start the client for /l %x in (1,1,%n) do client.exe -ORBobjrefstyle url -ORBport %clport -ORBnameserviceior %ior -ORBsvcconf client.conf %done REM We don't really need to delete this REM del %temp%\qns_ior REM Remove any running servers if %leave==/C activate "Naming Service" CLOSE if %leave==/C activate "Quoter Server" CLOSE if %leave==/C activate "Quoter Factory Finder" CLOSE if %leave==/C activate "Quoter Generic Factory" CLOSE endlocal