Download Developing an Efficient Application for the Distribution of Large Files
Transcript
Developing an Efficient Application for the Distribution of Large Files 32 3.5.5. Test Scripts The test scripts are placed in separate subfolders, the folder names being formatted as ut_<testname> for unit tests and it_<testname> for integration tests. The test name includes the postfixes _neg or _pos indicating whether the test scripts should have a negative or a positive outcome. Each test script consists of the following elements: config.xml file for the service implementation (only in unit tests), machine.xml to provide test machine information (only in unit tests), testinput.txt containing commands for the test script, expected.txt containing the expected output of the test script. The following batch files are used to evaluate test scripts and output results to the console or a file: run_all_tests.cmd runs all the tests found in the current directory (based on the ut_* or it_* filters). log_all_tests.cmd runs the previous batch file and redirects the output to the unit_tests.log file. run_test.cmd runs a single test, which is passed to it via the first command line argument. The output of a test scripts is similar to the following: -----------------------------------------------------------Running test: TestName Test result: SUCCESS/FAIL ------------------------------------------------------------ I have defined a set of machines that is suitable for every test script that involves querying or amending their properties: <TestMachineStates> <machines> <machine name="labpc1" turnedOn="true" freeSpace="6.5" uftpdServiceState="Running" ipAddress="10.40.100.10" macAddress="001111EF9273" /> <machine name="labpc2" turnedOn="false" freeSpace="4" uftpdServiceState="Stopped" ipAddress="10.40.100.20" macAddress="001111890C88" /> <machine name="labpc3" turnedOn="true" freeSpace="5" uftpdServiceState="Stopped" ipAddress="10.40.100.30" macAddress="001111B546FB" /> </machines> </TestMachineStates> These machines have identical configuration as the machines in the laboratory with the same name.