service event library JSTAF execute C:/STAF/services/STAFEvent.jar
C: cd \STAF mkdir services (This directory may already exist.)
cd services D:\stax\tools\unzip D:\STAX\install\STAXV1521.zip
java -version
notepad C:\STAF\bin\STAF.cfg
service stax library JSTAF execute c:/staf/services/STAX.jar
STAF local SHUTDOWN SHUTDOWN
STAFProc
STAF local SERVICE LIST
STAF local STAX HELPVerify that you see the following:
Response -------- STAX Service Help: EXECUTE < <FILE <xml file name> [MACHINE <machine name>]> | DATA <xml data> > [JOBNAME <Job Name>] [FUNCTION <Function ID>] [ARGS <Arguments>] [SCRIPTFILE <file name>... [SCRIPTFILEMACHINE <machine name>]] [SCRIPT <Python code>]... [CLEARLOGS] [ HOLD | TEST | WAIT [Timeout] [RETURNRESULT] ] GET DTD LIST JOBS | JOB <Job ID> <THREADS | PROCESSES | STAFCMDS | SUBJOBS | BLOCKS | TESTCASES> QUERY JOB <Job ID> [THREAD <Thread ID> | PROCESS <Location:Handle> | STAFCMD <Request#> | BLOCK <Block Name> | TESTCASE <Test Name>] HOLD JOB <Job ID> [BLOCK <Block Name>] RELEASE JOB <Job ID> [BLOCK <Block Name>] TERMINATE JOB <Job ID> [BLOCK <Block Name>] UPDATE JOB <Job ID> TESTCASE <Testcase name> STATUS <Status> [MESSAGE <Message text>] [FORCE] VERSION HELP
STAF local STAX VERSIONWhat is the version? ________________
C:/STAF/data/JSTAF/STAFJVM1/JVMLog.lThis file will contain any Java errors/exceptions that the STAX service (and any other Java STAF services) encounters. The end of the file should be similar to:
****************************************************************************** *** 20030418-14:40:33 - Start of Log for JVMName: STAFJVM1 *** JVM Executable: java *** JVM Options : none ******************************************************************************
java -jar C:/STAF/services/STAXMon.jar
java -jar C:/STAF/services/STAXMon.jar
What is its Job ID? _______
Hint: It is a number displayed in the STAX Job Monitor panel's title.
What is its Command value? _____________________
What is its Parms value? ________________________________________
How many tests ran successfully and how many tests failed?
PASS: ________ FAIL: __________
The number of passes and fails recorded within the 2 mintues could vary based on the speed of your system.
Test complete - ran for 120 secondsIt may show a slightly different value for seconds (e.g. 121), depending on your system.
Hints:
STAF local STAX HELP
STAF local STAX EXECUTE FILE C:/STAF/services/samples/sample1.xml JOBNAME "Sample Job" CLEARLOGS
What is its Job ID? _______
Hint: It is the number displayed in the Response from the STAX EXECUTE request.
Hints:
STAF local STAX HELP
STAF local STAX LIST JOBS
Hint:
STAF local STAX LIST JOB <Job ID> BLOCKSReplace <Job ID> with the Job ID number you recorded in an earlier step.
How many blocks are currently running? _________
Hint:
STAF local STAX LIST JOB <Job ID> THREADSReplace <Job ID> with the Job ID number you recorded in an earlier step.
How many threads are currently running? _________
Write down the thread ID of each thread currently running: __________________________
Hint:
STAF local STAX HELP
STAF local STAX QUERY JOB <Job ID>
How many blocks are currently running? __________
How many blocks are currently held? __________
STAF local STAX QUERY JOB <Job ID> THREAD <Thread ID>Replace <Job ID> with the Job ID number you recorded in an earlier step and replace
Write the thread's call stack here:
STAF local LOG QUERY MACHINE <Machine> LOGNAME STAX_Job_<JobID>
COPY D:\stax\exercises\exercise15\*.* C:\STAF\xml\*.*
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE stax SYSTEM "stax.dtd"> <stax> <defaultcall function="Main"/> <script>numLoops = 10</script> <function name="Main"> <sequence> <process> <location>'local'</location> <command>'java'</command> <parms>'SimpleTestcase %s' % numLoops</parms> <env>'CLASSPATH={STAF/Env/Classpath};C:/STAF/testcases'</env> </process> <if expr="RC == 0"> <sequence> <message>'Completed %s loops' % numLoops</message> <log>'Completed %s loops' % numLoops</log> </sequence> <else> <sequence> <message>'Failed with RC=%s' % RC</message> <log>'Completed %s loops' % numLoops</log> </sequence> </else> </if> </sequence> </function> </stax>
java -jar c:/STAF/services/STAXMon.jar
Job Name: Simple Job Filename: C:\STAF\xml\simple1.xml
numLoops = 30before submitting the job.
COPY C:\STAF\xml\simple1.xml C:\STAF\xml\simple2.xml
'STAFTestcase %s' % numLoops(replacing SimpleTestcase with STAFTestcase)
Now it will run a Java testcase called STAFTestcase on the local machine. This testcase uses the STAF Monitor service to update its current status in the STAX Job Monitor while the testcase is running.
java -jar C:/STAF/services/STAXMon.jar
Job Name: Simple Job Filename: C:\STAF\xml\simple2.xml
COPY D:\stax\exercises\exercise17\*.xml C:\STAF\xml\*.xml
What is the first error found and how did you fix it?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
What is the second error found and how did you fix it?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
What is the first error found and how did you fix it?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
What is the second error found and how did you fix it?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
What is the third error found and how did you fix it?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
What are the errors found and how did you fix them?
______________________________________________________________________________________
______________________________________________________________________________________
______________________________________________________________________________________
COPY D:\stax\exercises\exercise18\*.xml C:\STAF\xml\*.xml
Description: Pool of test machines Pending requests: 0 Resources: machine1;Available machine2;Available machine3;Owned;lucas;STAX/Job/48;235;20020510-14:20:55;20020510-14:20:55 machine4;Owned;lucas;STAX/Job/48;235;20020510-14:20:56;20020510-14:20:56 machine5;Available machine6;Available machine7;Available machine8;Owned;lucas;STAX/Job/48;235;20020510-14:20:56;20020510-14:20:56 machine9;Owned;lucas;STAX/Job/48;235;20020510-14:20:55;20020510-14:20:55 machine10;Owned;lucas;STAX/Job/48;235;20020510-14:20:56;20020510-14:20:56
<!-- Insert code here to release the machines that are in machineList -->
Hint: The syntax for the <iterate> element you want to use here is:
<iterate var="machine" in="machineList"> <sequence> <!-- To be filled in by the next hints --> </sequence> </iterate>
Hint: The AllocateMachines function in respool.xml calls the 'RunSTAFCommand' function to specify a ResPool request for an entry in the poolName pool so copy the following lines from it after the new <iterate element's <sequence> element.
<call function="'RunSTAFCommand'"> [resPoolServer, 'RESPOOL', 'REQUEST POOL %s' % poolName] </call>Modify the request (the third argument in the list) to release an entry from the resource pool.
Hint: Use the 'STAF local RESPOOL HELP' command to get the syntax for the RELEASE request:
'RELEASE POOL %s ENTRY %s FORCE' % (poolName, machine)
Hint: The AllocateMachines function in respool.xml calls the 'CheckSuccess' function to check for sucess, so copy the following lines from it:
<call function="'CheckSuccess'"> [STAXResult[0], [0], STAXResult[1]] </call>
<iterate var="machine" in="machineList"> <sequence> <call function="'RunSTAFCommand'"> [resPoolServer, 'RESPOOL', 'RELEASE POOL %s ENTRY %s' % (poolName, machine)] </call> <call function="'CheckSuccess'"> [STAXResult[0], [0], STAXResult[1]] </call> </sequence> </iterate>
Description: Pool of test machines Pending requests: 0 Resources: machine1;Available machine2;Available machine3;Available machine4;Available machine5;Available machine6;Available machine7;Available machine8;Available machine9;Available machine10;Available
COPY D:\stax\exercises\exercise19\*.xml C:\STAF\xml\*.xml