Methods Summary |
---|
protected void | setUp()
super.setUp();
// Make the delivery just run its posted responses immediately.
mDelivery = new ImmediateResponseDelivery();
mRequest = new MockRequest();
mRequest.setSequence(1);
byte[] data = new byte[16];
Cache.Entry cacheEntry = CacheTestUtils.makeRandomCacheEntry(data);
mSuccessResponse = Response.success(data, cacheEntry);
|
public void | testPostError_callsDeliverError()
Response<byte[]> errorResponse = Response.error(new ServerError());
mDelivery.postResponse(mRequest, errorResponse);
assertTrue(mRequest.deliverError_called);
assertFalse(mRequest.deliverResponse_called);
|
public void | testPostResponse_callsDeliverResponse()
mDelivery.postResponse(mRequest, mSuccessResponse);
assertTrue(mRequest.deliverResponse_called);
assertFalse(mRequest.deliverError_called);
|
public void | testPostResponse_suppressesCanceled()
mRequest.cancel();
mDelivery.postResponse(mRequest, mSuccessResponse);
assertFalse(mRequest.deliverResponse_called);
assertFalse(mRequest.deliverError_called);
|