EasyMock.expect(delegate.makeAsyncCall(EasyMock.isA(ApiProxy.Environment.class),
EasyMock.eq(LocalDatastoreService.PACKAGE),
EasyMock.eq("RunQuery"),
EasyMock.isA(byte[].class),
ApiConfigMatcher.eqApiConfig(config)))
.andThrow(new DatastoreTimeoutException("too long")).anyTimes();
EasyMock.replay(delegate);
ApiProxy.Delegate original = getDelegateForThread();
setDelegateForThread(delegate);
try {