public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.out.println("Incorrect number of arguments");
return;
}
// The first argument is the input file
File inputFile = new File(args[0]);
// The second argument is the output file
File outputFile = new File(args[1]);
Adapter testAdapter = new RandomAdapter();
Http11Processor http11Processor = new Http11Processor();
http11Processor.setSocket(new Socket("127.0.0.1", 8080));
http11Processor.action(ActionCode.ACTION_START, null);
FileTester tester = new FileTester(testAdapter, http11Processor,
inputFile, outputFile);
tester.test();
}
Utility main method, which will use the HTTP/1.1 processor with the
test adapter. |