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:
Sebastian Bazley 2011-01-06 03:23:34 +00:00
parent 4b2dccf239
commit 868e46fd5b
2 changed files with 7 additions and 6 deletions

View File

@ -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();

View File

@ -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();