/* @test @(#)file2.1 1.1 03/08/09
* @summary Unit test for java.net.ResponseCacheHandler
* @bug 4837267
* @author Yingxian Wang
*/
/**
* Request should get serviced by the cache handler. Response get
* saved through the cache handler.
*/
public class ResponseCacheHandlerTest implements Runnable {
static boolean flag = false;
/*
* Our "http" server to return a 404 */
public void run() {
try {
// check request contains "Cookie"
boolean flag = false;
String x;
if (x.length() ==0) {
break;
}
}
new BufferedOutputStream(
s.getOutputStream() ));
/* send file2.1 */
int len;
}
s.close();
} catch (Exception e) {
e.printStackTrace();
}
}
ResponseCacheHandlerTest() throws Exception {
/* start the server */
/* establish http connection to server */
try {
} catch (IOException ioex) {
}
String x;
new BufferedOutputStream(
new FileOutputStream(fileout)));
}
// if !(file1.out == file1.cache)
// throw new RuntimeException("testing ResponseCacheHandler.get() failed");
http.disconnect();
// testing ResponseCacheHandler.put()
try {
} catch (IOException ioex) {
}
int len;
}
// if !(file2.1 == file2.2 == file2.cache)
// throw new RuntimeException("testing ResponseCacheHandler.put() failed");
}
new ResponseCacheHandlerTest();
}
static class MyResponseCacheHandler extends ResponseCacheHandler {
public Response
throws IOException {
return new MyResponse("file1.cache");
flag = true;
return null;
} else {
return new MyResponse("file2.cache");
}
}
// save cache to file2.cache
// 1. serialize headers into file2.cache
// 2. write data to file2.cache
byte[] b = new byte[len];
}
return true;
}
}
static class MyResponse extends Response {
try {
}
}
return fis.getChannel();
}
return headers;
}
}
}