summaryrefslogtreecommitdiff
path: root/TAO/tests/Quoter/run_test.btm
blob: 904be1b44596575cde27d6eb3e4061563195398f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
@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 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]
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 -- Runs each separately
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 == /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 QuoterFactoryFinder.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_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

endlocal