/external/mockwebserver/src/main/java/com/google/mockwebserver/ |
Dispatcher.java | 26 public abstract MockResponse dispatch(RecordedRequest request) throws InterruptedException; 35 public MockResponse peek() { 36 return new MockResponse().setSocketPolicy(SocketPolicy.KEEP_OPEN);
|
QueueDispatcher.java | 24 * {@link #enqueueResponse(MockResponse)}. 27 protected final BlockingQueue<MockResponse> responseQueue 28 = new LinkedBlockingQueue<MockResponse>(); 29 private MockResponse failFastResponse; 31 @Override public MockResponse dispatch(RecordedRequest request) throws InterruptedException { 36 return new MockResponse() 48 @Override public MockResponse peek() { 49 MockResponse peek = responseQueue.peek(); 55 public void enqueueResponse(MockResponse response) { 60 MockResponse failFastResponse = failFas [all...] |
MockResponse.java | 34 public final class MockResponse implements Cloneable { 56 public MockResponse() { 60 @Override public MockResponse clone() { 62 MockResponse result = (MockResponse) super.clone(); 77 public MockResponse setResponseCode(int code) { 82 public MockResponse setStatus(String status) { 98 public MockResponse clearHeaders() { 107 public MockResponse addHeader(String header) { 116 public MockResponse addHeader(String name, Object value) [all...] |
/external/okhttp/mockwebserver/src/main/java/com/squareup/okhttp/mockwebserver/ |
Dispatcher.java | 24 public abstract MockResponse dispatch(RecordedRequest request) throws InterruptedException; 33 public MockResponse peek() { 34 return new MockResponse().setSocketPolicy(SocketPolicy.KEEP_OPEN);
|
QueueDispatcher.java | 24 * by calling {@link #enqueueResponse(MockResponse)}. 27 protected final BlockingQueue<MockResponse> responseQueue = new LinkedBlockingQueue<>(); 28 private MockResponse failFastResponse; 30 @Override public MockResponse dispatch(RecordedRequest request) throws InterruptedException { 35 return new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_FOUND); 46 @Override public MockResponse peek() { 47 MockResponse peek = responseQueue.peek(); 53 public void enqueueResponse(MockResponse response) { 58 MockResponse failFastResponse = failFast 59 ? new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_FOUND [all...] |
MockResponse.java | 27 public final class MockResponse implements Cloneable { 48 public MockResponse() { 52 @Override public MockResponse clone() { 54 MockResponse result = (MockResponse) super.clone(); 68 public MockResponse setResponseCode(int code) { 72 public MockResponse setStatus(String status) { 86 public MockResponse clearHeaders() { 95 public MockResponse addHeader(String header) { 104 public MockResponse addHeader(String name, Object value) [all...] |
PushPromise.java | 25 private final MockResponse response; 27 public PushPromise(String method, String path, Headers headers, MockResponse response) { 46 public MockResponse getResponse() {
|
/libcore/support/src/test/java/tests/http/ |
MockResponse.java | 29 public class MockResponse implements Cloneable { 40 public MockResponse() { 44 @Override public MockResponse clone() { 46 MockResponse result = (MockResponse) super.clone(); 61 public MockResponse setResponseCode(int code) { 66 public MockResponse setStatus(String status) { 78 public MockResponse clearHeaders() { 83 public MockResponse addHeader(String header) { 95 public MockResponse setBody(byte[] body) [all...] |
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/ |
CacheTest.java | 24 import com.squareup.okhttp.mockwebserver.MockResponse; 158 MockResponse mockResponse = new MockResponse() 165 mockResponse.addHeader("Proxy-Authenticate: Basic realm=\"protected area\""); 167 mockResponse.addHeader("WWW-Authenticate: Basic realm=\"protected area\""); 170 mockResponse.setBody(""); // We forbid bodies for 204 and 205. 172 server.enqueue(mockResponse); 211 MockResponse mockResponse = new MockResponse( [all...] |
URLConnectionTest.java | 26 import com.squareup.okhttp.mockwebserver.MockResponse; 131 server.enqueue(new MockResponse()); 199 server.enqueue(new MockResponse().setStatus("HTTP/1.0 200 Fantastic") 232 server.enqueue(new MockResponse().setStatus("HTP/1.1 200 OK")); 243 server.enqueue(new MockResponse().setStatus("HTTP/1.1 2147483648 OK")); 254 server.enqueue(new MockResponse().setStatus("HTTP/1.1 00a OK")); 265 server.enqueue(new MockResponse().setStatus(" HTTP/1.1 2147483648 OK")); 300 server.enqueue(new MockResponse().setBody("abc")); 318 server.enqueue(new MockResponse().setBody("A")); 324 server.enqueue(new MockResponse().setResponseCode(404).setBody("A")) [all...] |
CallTest.java | 28 import com.squareup.okhttp.mockwebserver.MockResponse; 111 server.enqueue(new MockResponse().setBody("abc").addHeader("Content-Type: text/plain")); 132 server.enqueue(new MockResponse()); 164 server.enqueue(new MockResponse().setResponseCode(500)); 186 server.enqueue(new MockResponse()); 196 server.enqueue(new MockResponse().addHeader("Content-Type: text/plain")); 226 server.enqueue(new MockResponse().setBody("abc")); 255 server.enqueue(new MockResponse().setBody("abc")); 313 server.enqueue(new MockResponse().setResponseCode(401)); 314 server.enqueue(new MockResponse()); [all...] |
/external/mockwebserver/src/test/java/com/google/mockwebserver/ |
MockWebServerTest.java | 64 MockResponse response = new MockResponse(); 70 MockResponse response = new MockResponse().setBody("ABC"); 81 MockResponse response = new MockResponse() 90 MockResponse response = new MockResponse() 101 server.enqueue(new MockResponse().setBody("hello world")); 119 server.enqueue(new MockResponse() [all...] |
CustomDispatcherTest.java | 42 public MockResponse dispatch(RecordedRequest request) throws InterruptedException { 44 return new MockResponse(); 65 public MockResponse dispatch(RecordedRequest request) throws InterruptedException { 69 return new MockResponse();
|
/external/okhttp/okhttp-android-support/src/test/java/com/squareup/okhttp/internal/huc/ |
ResponseCacheTest.java | 27 import com.squareup.okhttp.mockwebserver.MockResponse; 184 MockResponse mockResponse = new MockResponse() 191 mockResponse.addHeader("Proxy-Authenticate: Basic realm=\"protected area\""); 193 mockResponse.addHeader("WWW-Authenticate: Basic realm=\"protected area\""); 195 server.enqueue(mockResponse); 231 MockResponse mockResponse = new MockResponse() [all...] |
/system/webservd/libwebserv/ |
mock_response.h | 26 class MockResponse : public Response { 28 MockResponse() = default; 53 DISALLOW_COPY_AND_ASSIGN(MockResponse);
|
/libcore/benchmarks/src/benchmarks/regression/ |
URLConnectionBenchmark.java | 21 import com.google.mockwebserver.MockResponse; 42 private MockResponse response; 43 SingleResponseDispatcher(MockResponse response) { 46 @Override public MockResponse dispatch(RecordedRequest request) { 55 MockResponse response = new MockResponse(); 95 void setBody(MockResponse response, int bodySize, int chunkSize) throws IOException { 108 void apply(MockResponse response) {
|
/external/okhttp/okhttp-urlconnection/src/test/java/com/squareup/okhttp/ |
UrlConnectionCacheTest.java | 24 import com.squareup.okhttp.mockwebserver.MockResponse; 167 MockResponse response = new MockResponse() 215 MockResponse response = 216 new MockResponse().addHeader("Last-Modified: " + formatDate(-1, TimeUnit.HOURS)) 250 server.enqueue(new MockResponse().addHeader("Last-Modified: " + formatDate(-1, TimeUnit.HOURS)) 283 server.enqueue(new MockResponse().addHeader("Last-Modified: " + formatDate(-1, TimeUnit.HOURS)) 287 server.enqueue(new MockResponse().addHeader("Last-Modified: " + formatDate(-1, TimeUnit.HOURS)) 290 server.enqueue(new MockResponse().setBody("DEF")); 304 server.enqueue(new MockResponse().addHeader("Cache-Control: max-age=60").setBody("ABC")) [all...] |
OkUrlFactoryTest.java | 7 import com.squareup.okhttp.mockwebserver.MockResponse; 46 server.enqueue(new MockResponse().setResponseCode(407)); 57 server.enqueue(new MockResponse().setBody("Isla Sorna")); 65 server.enqueue(new MockResponse().setResponseCode(404)); 72 server.enqueue(new MockResponse() 76 server.enqueue(new MockResponse().setResponseCode(304)); 88 server.enqueue(new MockResponse() 92 server.enqueue(new MockResponse().setBody("Isla Sorna")); 104 server.enqueue(new MockResponse() 118 server.enqueue(new MockResponse().setBody("Isla Nublar")) [all...] |
/external/okhttp/okhttp-tests/src/test/java/com/squareup/okhttp/internal/http/ |
HttpOverHttp2Test.java | 20 import com.squareup.okhttp.mockwebserver.MockResponse; 36 new MockResponse().setBody("bar").setStatus("HTTP/1.1 200 Sweet")); 37 MockResponse response = new MockResponse() 60 new MockResponse().setStatus("HTTP/1.1 204 Sweet")); 61 MockResponse response = new MockResponse()
|
HttpOverSpdyTest.java | 27 import com.squareup.okhttp.mockwebserver.MockResponse; 97 MockResponse response = new MockResponse().setBody("ABCDE").setStatus("HTTP/1.1 200 Sweet"); 112 server.enqueue(new MockResponse()); 121 server.enqueue(new MockResponse().setBody("ABCDE")); 136 server.enqueue(new MockResponse().setBody("ABCDE")); 151 server.enqueue(new MockResponse().setBody("ABCDE")); 168 server.enqueue(new MockResponse().setBody("ABCDE")); 183 server.enqueue(new MockResponse().setBody("ABCDEF")); 184 server.enqueue(new MockResponse().setBody("GHIJKL")) [all...] |
/external/okhttp/mockwebserver/src/test/java/com/squareup/okhttp/mockwebserver/ |
MockWebServerTest.java | 51 MockResponse response = new MockResponse(); 57 MockResponse response = new MockResponse().setBody("ABC"); 64 MockResponse response = new MockResponse() 72 MockResponse response = new MockResponse() 82 server.enqueue(new MockResponse().setBody("hello world")); 98 server.enqueue(new MockResponse() [all...] |
/external/okhttp/samples/static-server/src/main/java/com/squareup/okhttp/sample/ |
SampleServer.java | 5 import com.squareup.okhttp.mockwebserver.MockResponse; 40 @Override public MockResponse dispatch(RecordedRequest request) { 50 return new MockResponse() 55 return new MockResponse() 62 private MockResponse directoryToResponse(String basePath, File directory) { 74 return new MockResponse() 80 private MockResponse fileToResponse(String path, File file) throws IOException { 81 return new MockResponse()
|
/external/okhttp/okhttp-ws-tests/src/test/java/com/squareup/okhttp/ws/ |
WebSocketCallTest.java | 22 import com.squareup.okhttp.mockwebserver.MockResponse; 55 server.enqueue(new MockResponse().withWebSocketUpgrade(serverListener)); 64 server.enqueue(new MockResponse().withWebSocketUpgrade(serverListener)); 85 server.enqueue(new MockResponse().withWebSocketUpgrade(serverListener)); 93 server.enqueue(new MockResponse().withWebSocketUpgrade(serverListener)); 121 server.enqueue(new MockResponse().withWebSocketUpgrade(serverListener)); 128 server.enqueue(new MockResponse()); 134 server.enqueue(new MockResponse().setStatus("HTTP/1.1 404 Not Found")); 141 server.enqueue(new MockResponse() 151 server.enqueue(new MockResponse() [all...] |
/external/okhttp/okhttp-apache/src/test/java/com/squareup/okhttp/apache/ |
OkApacheClientTest.java | 3 import com.squareup.okhttp.mockwebserver.MockResponse; 48 server.enqueue(new MockResponse().setBody("Hello, World!")); 57 server.enqueue(new MockResponse().setResponseCode(302).addHeader("Location", "/foo")); 58 server.enqueue(new MockResponse().setBody("Hello, Redirect!")); 67 server.enqueue(new MockResponse().setResponseCode(422)); 75 server.enqueue(new MockResponse().addHeader("Foo", "Bar")); 76 server.enqueue(new MockResponse().addHeader("Foo", "Bar").addHeader("Foo", "Baz")); 93 server.enqueue(new MockResponse()); 106 server.enqueue(new MockResponse()); 118 server.enqueue(new MockResponse()); [all...] |
/libcore/luni/src/test/java/libcore/java/net/ |
URLConnectionTest.java | 22 import com.google.mockwebserver.MockResponse; 210 server.enqueue(new MockResponse()); 281 server.enqueue(new MockResponse() 316 server.enqueue(new MockResponse().setBody("A")); 323 server.enqueue(new MockResponse().setResponseCode(404).setBody("A")); 333 MockResponse response = new MockResponse().setChunkedBody("ABCDE\nFGHIJ\nKLMNO\nPQR", 8); 351 MockResponse response = new MockResponse().setBody("ABCDEFGHIJKLMNOPQR"); 367 MockResponse response = new MockResponse().setChunkedBody("ABCDEFGHIJKLMNOPQR", 5) [all...] |