+ COMPARE(tr->responseReason(), string("not found"));
+ COMPARE(tr->responseLength(), 0);
+ }
+
+// test connectToHost failure
+/*
+ {
+ TestRequest* tr = new TestRequest("http://not.found/something");
+ HTTP::Request_ptr own(tr);
+ cl.makeRequest(tr);
+ waitForFailed(tr);
+ COMPARE(tr->responseCode(), -1);
+ }
+ */
+// test proxy
+ {
+ cl.setProxy("localhost", 2000);
+ TestRequest* tr = new TestRequest("http://www.google.com/test2");
+ HTTP::Request_ptr own(tr);
+ cl.makeRequest(tr);
+ waitForComplete(tr);
+ COMPARE(tr->responseCode(), 200);
+ COMPARE(tr->responseLength(), body2Size);
+ COMPARE(tr->bodyData, string(body2, body2Size));
+ }
+
+ {
+ cl.setProxy("localhost", 2000, "ABCDEF");
+ TestRequest* tr = new TestRequest("http://www.google.com/test3");
+ HTTP::Request_ptr own(tr);
+ cl.makeRequest(tr);
+ waitForComplete(tr);
+ COMPARE(tr->responseCode(), 200);
+ COMPARE(tr->responseBytesReceived(), body2Size);
+ COMPARE(tr->bodyData, string(body2, body2Size));