background image
<< Useful Multitestcase Code Templates | PerformClientActivity >>
Client/Server template
<< Useful Multitestcase Code Templates | PerformClientActivity >>
536
User's Guide
D U
SEFUL
M
ULTITESTCASE
C
ODE
T
EMPLATES
Client/Server template
·
Insert the calls to one or more tests, or to the main function, where
indicated.
use "myframe.inc"
multitestcase MyParallelTest (LIST of STRING lsMachines)
STRING sMachine
// Connect to all machines in parallel:
for each sMachine in lsMachines
spawn
SetUpMachine (sMachine, MyMainWin)
rendezvous
// Set app state of each machine, invoking if necessary:
SetMultiAppStates()
// Run testcases in parallel
for each sMachine in lsMachines
spawn
SetMachine (sMachine)
// Call testcase(s) or call main()
rendezvous
Client/Server template
This template is stored as multi_cs.t in the Examples subdirectory of the
SilkTest installation directory. This testcase invokes the server application
and any number of client applications (based on the list of machines passed to
it) and runs the same function on all clients concurrently, after which the
server will perform end-of-session processing.
You can use this template by doing the following edits:
·
Include the files that contains your window declarations for both the
client application and the server application.
·
Substitute your server application's MainWin name defined in your
MainWin window declaration for the template's "MyServerApp"
MainWin name.
·
Substitute your client application's MainWin name defined in your
MainWin window declaration for the template's "MyClientApp"
MainWin name.