mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-13 13:35:54 +00:00
Unthrown Exceptions and @Overrides
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1055731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4b2dccf239
commit
868e46fd5b
@ -49,6 +49,7 @@ public class TestEhcacheHttpCacheStorage extends TestCase {
|
|||||||
private EhcacheHttpCacheStorage impl;
|
private EhcacheHttpCacheStorage impl;
|
||||||
private HttpCacheEntrySerializer mockSerializer;
|
private HttpCacheEntrySerializer mockSerializer;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
mockCache = EasyMock.createMock(Ehcache.class);
|
mockCache = EasyMock.createMock(Ehcache.class);
|
||||||
CacheConfig config = new CacheConfig();
|
CacheConfig config = new CacheConfig();
|
||||||
@ -212,7 +213,7 @@ public HttpCacheEntry update(HttpCacheEntry old){
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCacheUpdateFail() throws IOException, HttpCacheUpdateException {
|
public void testCacheUpdateFail() throws IOException {
|
||||||
final String key = "foo";
|
final String key = "foo";
|
||||||
final HttpCacheEntry existingValue = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry existingValue = HttpTestUtils.makeCacheEntry();
|
||||||
final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
|
||||||
|
@ -51,6 +51,7 @@ public class TestMemcachedHttpCacheStorage extends TestCase {
|
|||||||
private MemcachedClientIF mockMemcachedClient;
|
private MemcachedClientIF mockMemcachedClient;
|
||||||
private HttpCacheEntrySerializer mockSerializer;
|
private HttpCacheEntrySerializer mockSerializer;
|
||||||
|
|
||||||
|
@Override
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
mockMemcachedClient = EasyMock.createMock(MemcachedClientIF.class);
|
mockMemcachedClient = EasyMock.createMock(MemcachedClientIF.class);
|
||||||
@ -72,7 +73,7 @@ private void verifyMocks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCachePut() throws IOException, HttpCacheUpdateException {
|
public void testCachePut() throws IOException {
|
||||||
final String url = "foo";
|
final String url = "foo";
|
||||||
final HttpCacheEntry value = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry value = HttpTestUtils.makeCacheEntry();
|
||||||
mockSerializer.writeTo(EasyMock.isA(HttpCacheEntry.class), EasyMock
|
mockSerializer.writeTo(EasyMock.isA(HttpCacheEntry.class), EasyMock
|
||||||
@ -87,7 +88,7 @@ public void testCachePut() throws IOException, HttpCacheUpdateException {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCacheGet() throws UnsupportedEncodingException,
|
public void testCacheGet() throws UnsupportedEncodingException,
|
||||||
IOException, HttpCacheUpdateException {
|
IOException {
|
||||||
final String url = "foo";
|
final String url = "foo";
|
||||||
final HttpCacheEntry cacheEntry = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry cacheEntry = HttpTestUtils.makeCacheEntry();
|
||||||
EasyMock.expect(mockMemcachedClient.get(url)).andReturn(new byte[] {});
|
EasyMock.expect(mockMemcachedClient.get(url)).andReturn(new byte[] {});
|
||||||
@ -114,7 +115,7 @@ public void testCacheGetNullEntry() throws IOException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCacheRemove() throws IOException, HttpCacheUpdateException {
|
public void testCacheRemove() throws IOException {
|
||||||
final String url = "foo";
|
final String url = "foo";
|
||||||
EasyMock.expect(mockMemcachedClient.delete(url)).andReturn(null);
|
EasyMock.expect(mockMemcachedClient.delete(url)).andReturn(null);
|
||||||
replayMocks();
|
replayMocks();
|
||||||
@ -226,8 +227,7 @@ public HttpCacheEntry update(HttpCacheEntry old) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCacheUpdateFail() throws IOException,
|
public void testCacheUpdateFail() throws IOException {
|
||||||
HttpCacheUpdateException {
|
|
||||||
final String url = "foo";
|
final String url = "foo";
|
||||||
final HttpCacheEntry existingValue = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry existingValue = HttpTestUtils.makeCacheEntry();
|
||||||
final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
|
final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user