Replay Tool
You may want to use this tool to help automate your testing.
The tool makes the HTTP requests from a file and saves the responses
to each request in an appropriately named file in a directory. While
running the replay tool, you should watch your web server to see if
any strange or unexpected behavior occurs. (What are good test cases
to use?) After the tool makes the requests, you can look at the saved
result files in a web browser. (Use "open file" instead of "open
location".)
Warning: I have only tested this tool on UNIX and Linux.
Please let me know if you have tool-related problems on other
platforms.
The tool may not be exactly what you want/need, which is why I
provided the code that you can change it to suit your needs.
Provided Files:
- simplereplay.jar - the jar file
that contains the .java and .class file for the replay tool,
SimpleReplayTool.
- HTTPClient.jar - the jar file I got
from HTTPClient,
which made writing this much easier. (Although it may be
unnecessarily complex for this assignment.)
- test.tc - an example test file that
contains the HTTP requests. Note that the request starts with the
request type ("GET" or "POST"), that resource names start with "/",
and that the file name ends in ".tc" for "test case".
- test_replay.sh - simple bash script
that puts everything together, showing how you can run the tool. You
Running the Tool
- Your CLASSPATH must contain the two jar files, simplereplay.jar
and HTTPClient.jar
- Run the tool as
java replay.SimpleReplayTool <hostname> <portnumber>
<testcasename> <responsedirectory>
- If all goes well, the tool will make the requests, as specified
in the test case
testcasename
, and saves the responses
for each request in an appropriately named file in the directory,
responsedirectory
.