From 5d252e6fd5a34d517fbbcdf099f028de6bceb0ba Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 28 Oct 2011 15:00:56 +0200 Subject: [PATCH] removed throws clauses to UnsupportedEncodingException where they aren't thrown --- .../AtmosContainerIntegrationLiveTest.java | 6 +- .../jclouds/s3/options/CopyObjectOptions.java | 11 ++-- .../s3/options/CopyObjectOptionsTest.java | 41 +++++++------ .../s3/options/ListBucketOptionsTest.java | 27 +++++---- .../s3/options/PutBucketOptionsTest.java | 4 +- .../s3/options/PutObjectOptionsTest.java | 4 +- .../jclouds/s3/services/BucketsLiveTest.java | 12 ++-- .../java/org/jclouds/s3/xml/S3ParserTest.java | 5 +- .../options/ListContainerOptionsTest.java | 25 ++++---- .../jclouds/blobstore/options/GetOptions.java | 5 +- .../internal/BaseBlobIntegrationTest.java | 8 +-- .../BaseContainerIntegrationTest.java | 14 ++--- .../internal/BaseMapIntegrationTest.java | 3 +- .../blobstore/options/GetOptionsTest.java | 33 ++++++----- .../org/jclouds/http/options/GetOptions.java | 5 -- .../jclouds/http/options/GetOptionsTest.java | 35 ++++++------ .../internal/RestAnnotationProcessorTest.java | 57 +++++++++---------- .../java/org/jclouds/util/Strings2Test.java | 4 +- .../AzureBlobIntegrationLiveTest.java | 3 +- .../jclouds/scriptbuilder/util/UtilsTest.java | 4 +- 20 files changed, 133 insertions(+), 173 deletions(-) diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosContainerIntegrationLiveTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosContainerIntegrationLiveTest.java index 373379bbe9..a2f31c766b 100644 --- a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosContainerIntegrationLiveTest.java +++ b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/integration/AtmosContainerIntegrationLiveTest.java @@ -21,7 +21,6 @@ package org.jclouds.atmos.blobstore.integration; import static org.testng.Assert.assertEquals; import java.io.IOException; -import java.io.UnsupportedEncodingException; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.integration.internal.BaseContainerIntegrationTest; @@ -34,13 +33,12 @@ import org.testng.annotations.Test; public class AtmosContainerIntegrationLiveTest extends BaseContainerIntegrationTest { @Override - public void testListContainerMaxResults() throws InterruptedException, - UnsupportedEncodingException { + public void testListContainerMaxResults() throws InterruptedException { // Not currently working } @Override - public void testListContainerMarker() throws InterruptedException, UnsupportedEncodingException { + public void testListContainerMarker() throws InterruptedException { // Not currently working https://community.emc.com/thread/100545 } diff --git a/apis/s3/src/main/java/org/jclouds/s3/options/CopyObjectOptions.java b/apis/s3/src/main/java/org/jclouds/s3/options/CopyObjectOptions.java index b994458180..cc9989a948 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/options/CopyObjectOptions.java +++ b/apis/s3/src/main/java/org/jclouds/s3/options/CopyObjectOptions.java @@ -30,7 +30,6 @@ import static org.jclouds.s3.reference.S3Headers.COPY_SOURCE_IF_UNMODIFIED_SINCE import static org.jclouds.s3.reference.S3Headers.DEFAULT_AMAZON_HEADERTAG; import static org.jclouds.s3.reference.S3Headers.METADATA_DIRECTIVE; -import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.Map; import java.util.Map.Entry; @@ -227,7 +226,7 @@ public class CopyObjectOptions extends BaseHttpRequestOptions { * @param eTag * hash representing the payload */ - public CopyObjectOptions ifSourceETagMatches(String eTag) throws UnsupportedEncodingException { + public CopyObjectOptions ifSourceETagMatches(String eTag) { checkState(getIfNoneMatch() == null, "ifETagDoesntMatch() is not compatible with ifETagMatches()"); checkState(getIfModifiedSince() == null, "ifModifiedSince() is not compatible with ifETagMatches()"); replaceHeader(COPY_SOURCE_IF_MATCH, String.format("\"%1$s\"", checkNotNull(eTag, "eTag"))); @@ -242,10 +241,8 @@ public class CopyObjectOptions extends BaseHttpRequestOptions { * * @param eTag * hash representing the payload - * @throws UnsupportedEncodingException - * if there was a problem converting this into an S3 eTag string */ - public CopyObjectOptions ifSourceETagDoesntMatch(String eTag) throws UnsupportedEncodingException { + public CopyObjectOptions ifSourceETagDoesntMatch(String eTag) { checkState(getIfMatch() == null, "ifETagMatches() is not compatible with ifETagDoesntMatch()"); Preconditions.checkState(getIfUnmodifiedSince() == null, "ifUnmodifiedSince() is not compatible with ifETagDoesntMatch()"); @@ -307,7 +304,7 @@ public class CopyObjectOptions extends BaseHttpRequestOptions { /** * @see CopyObjectOptions#ifSourceETagMatches(String) */ - public static CopyObjectOptions ifSourceETagMatches(String eTag) throws UnsupportedEncodingException { + public static CopyObjectOptions ifSourceETagMatches(String eTag) { CopyObjectOptions options = new CopyObjectOptions(); return options.ifSourceETagMatches(eTag); } @@ -315,7 +312,7 @@ public class CopyObjectOptions extends BaseHttpRequestOptions { /** * @see CopyObjectOptions#ifSourceETagDoesntMatch(String) */ - public static CopyObjectOptions ifSourceETagDoesntMatch(String eTag) throws UnsupportedEncodingException { + public static CopyObjectOptions ifSourceETagDoesntMatch(String eTag) { CopyObjectOptions options = new CopyObjectOptions(); return options.ifSourceETagDoesntMatch(eTag); } diff --git a/apis/s3/src/test/java/org/jclouds/s3/options/CopyObjectOptionsTest.java b/apis/s3/src/test/java/org/jclouds/s3/options/CopyObjectOptionsTest.java index d650de40eb..68ab331456 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/options/CopyObjectOptionsTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/options/CopyObjectOptionsTest.java @@ -35,7 +35,6 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; -import java.io.UnsupportedEncodingException; import java.util.Date; import java.util.Map; @@ -155,7 +154,7 @@ public class CopyObjectOptionsTest { } @Test - public void testIfETagMatches() throws UnsupportedEncodingException { + public void testIfETagMatches() { CopyObjectOptions options = new CopyObjectOptions(); options.ifSourceETagMatches(etag); matchesHex(options.getIfMatch()); @@ -168,18 +167,18 @@ public class CopyObjectOptionsTest { } @Test - public void testIfETagMatchesStatic() throws UnsupportedEncodingException { + public void testIfETagMatchesStatic() { CopyObjectOptions options = ifSourceETagMatches(etag); matchesHex(options.getIfMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagMatchesNPE() throws UnsupportedEncodingException { + public void testIfETagMatchesNPE() { ifSourceETagMatches(null); } @Test - public void testIfETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfETagDoesntMatch() { CopyObjectOptions options = new CopyObjectOptions(); options.ifSourceETagDoesntMatch(etag); matchesHex(options.getIfNoneMatch()); @@ -192,17 +191,17 @@ public class CopyObjectOptionsTest { } @Test - public void testIfETagDoesntMatchStatic() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchStatic() { CopyObjectOptions options = ifSourceETagDoesntMatch(etag); matchesHex(options.getIfNoneMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagDoesntMatchNPE() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchNPE() { ifSourceETagDoesntMatch(null); } - private void matchesHex(String match) throws UnsupportedEncodingException { + private void matchesHex(String match) { String expected = "\"" + etag + "\""; assertEquals(match, expected); } @@ -213,13 +212,13 @@ public class CopyObjectOptionsTest { } - public void testIfUnmodifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagMatches() { ifSourceETagMatches(etag).ifSourceUnmodifiedSince(now); } @Test(expectedExceptions = IllegalStateException.class) - public void testIfUnmodifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagDoesntMatch() { ifSourceETagDoesntMatch(etag).ifSourceUnmodifiedSince(now); } @@ -230,49 +229,49 @@ public class CopyObjectOptionsTest { } @Test(expectedExceptions = IllegalStateException.class) - public void testIfModifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagMatches() { ifSourceETagMatches(etag).ifSourceModifiedSince(now); } - public void testIfModifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagDoesntMatch() { ifSourceETagDoesntMatch(etag).ifSourceModifiedSince(now); } @Test(expectedExceptions = IllegalStateException.class) - public void testETagMatchesAfterIfModified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfModified() { ifSourceModifiedSince(now).ifSourceETagMatches(etag); } - public void testETagMatchesAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfUnmodified() { ifSourceUnmodifiedSince(now).ifSourceETagMatches(etag); } @Test(expectedExceptions = IllegalStateException.class) - public void testETagMatchesAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testETagMatchesAfterETagDoesntMatch() { ifSourceETagDoesntMatch(etag).ifSourceETagMatches(etag); } - public void testETagDoesntMatchAfterIfModified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfModified() { ifSourceModifiedSince(now).ifSourceETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalStateException.class) - public void testETagDoesntMatchAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfUnmodified() { ifSourceUnmodifiedSince(now).ifSourceETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalStateException.class) - public void testETagDoesntMatchAfterETagMatches() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterETagMatches() { ifSourceETagMatches(etag).ifSourceETagDoesntMatch(etag); } @Test - void testBuildRequestHeadersWhenMetadataNull() throws UnsupportedEncodingException { + void testBuildRequestHeadersWhenMetadataNull() { CopyObjectOptions options = new CopyObjectOptions(); options.setHeaderTag(DEFAULT_AMAZON_HEADERTAG); @@ -281,7 +280,7 @@ public class CopyObjectOptionsTest { } @Test - void testBuildRequestHeaders() throws UnsupportedEncodingException { + void testBuildRequestHeaders() { CopyObjectOptions options = ifSourceModifiedSince(now).ifSourceETagDoesntMatch(etag).overrideMetadataWith( goodMeta); options.setHeaderTag(DEFAULT_AMAZON_HEADERTAG); @@ -310,7 +309,7 @@ public class CopyObjectOptionsTest { } @Test - void testBuildRequestHeadersACL() throws UnsupportedEncodingException { + void testBuildRequestHeadersACL() { CopyObjectOptions options = overrideAcl(CannedAccessPolicy.AUTHENTICATED_READ); options.setHeaderTag(DEFAULT_AMAZON_HEADERTAG); diff --git a/apis/s3/src/test/java/org/jclouds/s3/options/ListBucketOptionsTest.java b/apis/s3/src/test/java/org/jclouds/s3/options/ListBucketOptionsTest.java index 486fe381d8..7d2839bd95 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/options/ListBucketOptionsTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/options/ListBucketOptionsTest.java @@ -24,11 +24,10 @@ import static org.jclouds.s3.options.ListBucketOptions.Builder.maxResults; import static org.jclouds.s3.options.ListBucketOptions.Builder.withPrefix; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; import java.util.Collections; -import org.jclouds.s3.reference.S3Constants; import org.jclouds.http.options.HttpRequestOptions; +import org.jclouds.s3.reference.S3Constants; import org.testng.annotations.Test; import com.google.common.collect.Multimap; @@ -47,7 +46,7 @@ public class ListBucketOptionsTest { } @Test - public void testPrefix() throws UnsupportedEncodingException { + public void testPrefix() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("test"); assertEquals(options.buildQueryParameters().get(S3Constants.PREFIX), Collections @@ -61,7 +60,7 @@ public class ListBucketOptionsTest { } @Test - public void testOneOptionQueryString() throws UnsupportedEncodingException { + public void testOneOptionQueryString() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("test"); Multimap map = options.buildQueryParameters(); @@ -70,7 +69,7 @@ public class ListBucketOptionsTest { } @Test - public void testTwoOptionQueryString() throws UnsupportedEncodingException { + public void testTwoOptionQueryString() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("test").maxResults(1); Multimap map = options.buildQueryParameters(); @@ -80,7 +79,7 @@ public class ListBucketOptionsTest { } @Test - public void testPrefixAndDelimiterUrlEncodingQueryString() throws UnsupportedEncodingException { + public void testPrefixAndDelimiterUrlEncodingQueryString() { ListBucketOptions options = new ListBucketOptions(); options.withPrefix("/test").delimiter("/"); Multimap map = options.buildQueryParameters(); @@ -97,19 +96,19 @@ public class ListBucketOptionsTest { } @Test - public void testPrefixStatic() throws UnsupportedEncodingException { + public void testPrefixStatic() { ListBucketOptions options = withPrefix("test"); assertEquals(options.buildQueryParameters().get(S3Constants.PREFIX), Collections .singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testPrefixNPE() throws UnsupportedEncodingException { + public void testPrefixNPE() { withPrefix(null); } @Test - public void testMarker() throws UnsupportedEncodingException { + public void testMarker() { ListBucketOptions options = new ListBucketOptions(); options.afterMarker("test"); assertEquals(options.buildQueryParameters().get(S3Constants.MARKER), Collections @@ -123,14 +122,14 @@ public class ListBucketOptionsTest { } @Test - public void testMarkerStatic() throws UnsupportedEncodingException { + public void testMarkerStatic() { ListBucketOptions options = afterMarker("test"); assertEquals(options.buildQueryParameters().get(S3Constants.MARKER), Collections .singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testMarkerNPE() throws UnsupportedEncodingException { + public void testMarkerNPE() { afterMarker(null); } @@ -161,7 +160,7 @@ public class ListBucketOptionsTest { } @Test - public void testDelimiter() throws UnsupportedEncodingException { + public void testDelimiter() { ListBucketOptions options = new ListBucketOptions(); options.delimiter("test"); assertEquals(options.buildQueryParameters().get(S3Constants.DELIMITER), Collections @@ -176,14 +175,14 @@ public class ListBucketOptionsTest { } @Test - public void testDelimiterStatic() throws UnsupportedEncodingException { + public void testDelimiterStatic() { ListBucketOptions options = delimiter("test"); assertEquals(options.buildQueryParameters().get(S3Constants.DELIMITER), Collections .singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testDelimiterNPE() throws UnsupportedEncodingException { + public void testDelimiterNPE() { delimiter(null); } } diff --git a/apis/s3/src/test/java/org/jclouds/s3/options/PutBucketOptionsTest.java b/apis/s3/src/test/java/org/jclouds/s3/options/PutBucketOptionsTest.java index 435dd98961..adf15842f4 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/options/PutBucketOptionsTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/options/PutBucketOptionsTest.java @@ -21,8 +21,6 @@ package org.jclouds.s3.options; import static org.jclouds.s3.options.PutBucketOptions.Builder.withBucketAcl; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; - import org.jclouds.s3.domain.CannedAccessPolicy; import org.jclouds.s3.reference.S3Headers; import org.testng.annotations.Test; @@ -50,7 +48,7 @@ public class PutBucketOptionsTest { } @Test - void testBuildRequestHeaders() throws UnsupportedEncodingException { + void testBuildRequestHeaders() { PutBucketOptions options = withBucketAcl(CannedAccessPolicy.AUTHENTICATED_READ); diff --git a/apis/s3/src/test/java/org/jclouds/s3/options/PutObjectOptionsTest.java b/apis/s3/src/test/java/org/jclouds/s3/options/PutObjectOptionsTest.java index c5e2df1d94..556e8e669e 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/options/PutObjectOptionsTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/options/PutObjectOptionsTest.java @@ -21,8 +21,6 @@ package org.jclouds.s3.options; import static org.jclouds.s3.options.PutObjectOptions.Builder.withAcl; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; - import org.jclouds.s3.domain.CannedAccessPolicy; import org.jclouds.s3.reference.S3Headers; import org.testng.annotations.Test; @@ -50,7 +48,7 @@ public class PutObjectOptionsTest { } @Test - void testBuildRequestHeaders() throws UnsupportedEncodingException { + void testBuildRequestHeaders() { PutObjectOptions options = withAcl(CannedAccessPolicy.AUTHENTICATED_READ); options.setHeaderTag(S3Headers.DEFAULT_AMAZON_HEADERTAG); diff --git a/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java b/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java index 594c1d3b7c..d1b65f5969 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/services/BucketsLiveTest.java @@ -28,7 +28,6 @@ import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URL; import java.util.Date; import java.util.Set; @@ -36,6 +35,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; import org.jclouds.aws.domain.Region; +import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; import org.jclouds.s3.S3Client; import org.jclouds.s3.domain.AccessControlList; import org.jclouds.s3.domain.AccessControlList.CanonicalUserGrantee; @@ -50,7 +50,6 @@ import org.jclouds.s3.domain.ListBucketResponse; import org.jclouds.s3.domain.Payer; import org.jclouds.s3.domain.S3Object; import org.jclouds.s3.internal.StubS3AsyncClient; -import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; import org.jclouds.util.Strings2; import org.testng.annotations.Test; @@ -332,8 +331,7 @@ public class BucketsLiveTest extends BaseBlobStoreIntegrationTest { } } - public void testListBucketDelimiter() throws InterruptedException, ExecutionException, TimeoutException, - UnsupportedEncodingException { + public void testListBucketDelimiter() throws InterruptedException, ExecutionException, TimeoutException { String bucketName = getContainerName(); try { String prefix = "apps"; @@ -350,8 +348,7 @@ public class BucketsLiveTest extends BaseBlobStoreIntegrationTest { } - public void testListBucketPrefix() throws InterruptedException, ExecutionException, TimeoutException, - UnsupportedEncodingException { + public void testListBucketPrefix() throws InterruptedException, ExecutionException, TimeoutException { String bucketName = getContainerName(); try { String prefix = "apps"; @@ -368,8 +365,7 @@ public class BucketsLiveTest extends BaseBlobStoreIntegrationTest { } - public void testListBucketMaxResults() throws InterruptedException, ExecutionException, TimeoutException, - UnsupportedEncodingException { + public void testListBucketMaxResults() throws InterruptedException, ExecutionException, TimeoutException { String bucketName = getContainerName(); try { addAlphabetUnderRoot(bucketName); diff --git a/apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java b/apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java index b887c69feb..8ae37fc4aa 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/xml/S3ParserTest.java @@ -21,7 +21,6 @@ package org.jclouds.s3.xml; import static org.testng.Assert.assertEquals; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.Date; import java.util.Set; @@ -130,7 +129,7 @@ public class S3ParserTest extends PerformanceTest { public static final String listContainerResult = "adrianjbosstest1000false33662009-03-12T02:00:13.000Z"9d7bb64e8e18ee34eec06dd2cf37b766"136e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0ferncamSTANDARD"; - public void testCanParseListContainerResult() throws HttpException, UnsupportedEncodingException { + public void testCanParseListContainerResult() throws HttpException { ListBucketResponse container = runParseListContainerResult(); assert !container.isTruncated(); assert container.getName().equals("adrianjbosstest"); @@ -161,7 +160,7 @@ public class S3ParserTest extends PerformanceTest { Strings2.toInputStream(successfulCopyObject200)); } - public void testCanParseCopyObjectResult() throws HttpException, UnsupportedEncodingException { + public void testCanParseCopyObjectResult() throws HttpException { ObjectMetadata metadata = runParseCopyObjectResult(); Date expected = new SimpleDateFormatDateService().iso8601DateParse("2009-03-19T13:23:27.000Z"); assertEquals(metadata.getLastModified(), expected); diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/options/ListContainerOptionsTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/options/ListContainerOptionsTest.java index d15a7ddd75..ab5d5762d1 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/options/ListContainerOptionsTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/options/ListContainerOptionsTest.java @@ -24,7 +24,6 @@ import static org.jclouds.openstack.swift.options.ListContainerOptions.Builder.u import static org.jclouds.openstack.swift.options.ListContainerOptions.Builder.withPrefix; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; import java.util.Collections; import org.jclouds.http.options.HttpRequestOptions; @@ -47,7 +46,7 @@ public class ListContainerOptionsTest { } @Test - public void testPrefix() throws UnsupportedEncodingException { + public void testPrefix() { ListContainerOptions options = new ListContainerOptions(); options.withPrefix("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.PREFIX), Collections.singletonList("test")); @@ -60,7 +59,7 @@ public class ListContainerOptionsTest { } @Test - public void testOneOptionQueryString() throws UnsupportedEncodingException { + public void testOneOptionQueryString() { ListContainerOptions options = new ListContainerOptions(); options.withPrefix("test"); Multimap map = options.buildQueryParameters(); @@ -69,7 +68,7 @@ public class ListContainerOptionsTest { } @Test - public void testTwoOptionQueryString() throws UnsupportedEncodingException { + public void testTwoOptionQueryString() { ListContainerOptions options = new ListContainerOptions(); options.withPrefix("test").maxResults(1); Multimap map = options.buildQueryParameters(); @@ -79,7 +78,7 @@ public class ListContainerOptionsTest { } @Test - public void testPrefixAndPathUrlEncodingQueryString() throws UnsupportedEncodingException { + public void testPrefixAndPathUrlEncodingQueryString() { ListContainerOptions options = new ListContainerOptions(); options.withPrefix("/cloudfiles/test").underPath("/"); Multimap map = options.buildQueryParameters(); @@ -96,18 +95,18 @@ public class ListContainerOptionsTest { } @Test - public void testPrefixStatic() throws UnsupportedEncodingException { + public void testPrefixStatic() { ListContainerOptions options = withPrefix("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.PREFIX), Collections.singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testPrefixNPE() throws UnsupportedEncodingException { + public void testPrefixNPE() { withPrefix(null); } @Test - public void testMarker() throws UnsupportedEncodingException { + public void testMarker() { ListContainerOptions options = new ListContainerOptions(); options.afterMarker("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.MARKER), Collections.singletonList("test")); @@ -120,13 +119,13 @@ public class ListContainerOptionsTest { } @Test - public void testMarkerStatic() throws UnsupportedEncodingException { + public void testMarkerStatic() { ListContainerOptions options = afterMarker("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.MARKER), Collections.singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testMarkerNPE() throws UnsupportedEncodingException { + public void testMarkerNPE() { afterMarker(null); } @@ -155,7 +154,7 @@ public class ListContainerOptionsTest { } @Test - public void testPath() throws UnsupportedEncodingException { + public void testPath() { ListContainerOptions options = new ListContainerOptions(); options.underPath("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.PATH), Collections.singletonList("test")); @@ -168,13 +167,13 @@ public class ListContainerOptionsTest { } @Test - public void testPathStatic() throws UnsupportedEncodingException { + public void testPathStatic() { ListContainerOptions options = underPath("test"); assertEquals(options.buildQueryParameters().get(SwiftConstants.PATH), Collections.singletonList("test")); } @Test(expectedExceptions = NullPointerException.class) - public void testPathNPE() throws UnsupportedEncodingException { + public void testPathNPE() { underPath(null); } } diff --git a/blobstore/src/main/java/org/jclouds/blobstore/options/GetOptions.java b/blobstore/src/main/java/org/jclouds/blobstore/options/GetOptions.java index fa172ca061..eb953d28b6 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/options/GetOptions.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/options/GetOptions.java @@ -21,7 +21,6 @@ package org.jclouds.blobstore.options; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -221,7 +220,7 @@ public class GetOptions { /** * @see GetOptions#ifETagMatches(String) */ - public static GetOptions ifETagMatches(String eTag) throws UnsupportedEncodingException { + public static GetOptions ifETagMatches(String eTag) { GetOptions options = new GetOptions(); return options.ifETagMatches(eTag); } @@ -229,7 +228,7 @@ public class GetOptions { /** * @see GetOptions#ifETagDoesntMatch(String) */ - public static GetOptions ifETagDoesntMatch(String eTag) throws UnsupportedEncodingException { + public static GetOptions ifETagDoesntMatch(String eTag) { GetOptions options = new GetOptions(); return options.ifETagDoesntMatch(eTag); } diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java index b36c8c30d7..56323f28a5 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobIntegrationTest.java @@ -35,7 +35,6 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import java.util.Arrays; @@ -51,11 +50,11 @@ import javax.ws.rs.core.MediaType; import org.jclouds.blobstore.ContainerNotFoundException; import org.jclouds.blobstore.domain.Blob; +import org.jclouds.blobstore.domain.BlobBuilder.PayloadBlobBuilder; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.domain.PageSet; import org.jclouds.blobstore.domain.StorageMetadata; import org.jclouds.blobstore.domain.StorageType; -import org.jclouds.blobstore.domain.BlobBuilder.PayloadBlobBuilder; import org.jclouds.concurrent.Futures; import org.jclouds.crypto.Crypto; import org.jclouds.crypto.CryptoStreams; @@ -268,7 +267,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testGetIfMatch() throws InterruptedException, UnsupportedEncodingException { + public void testGetIfMatch() throws InterruptedException { String container = getContainerName(); try { @@ -291,7 +290,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testGetIfNoneMatch() throws InterruptedException, UnsupportedEncodingException { + public void testGetIfNoneMatch() throws InterruptedException { String container = getContainerName(); try { @@ -304,7 +303,6 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { try { context.getBlobStore().getBlob(container, name, ifETagDoesntMatch(goodETag)); - validateContent(container, name); } catch (HttpResponseException ex) { assertEquals(ex.getResponse().getStatusCode(), 304); } diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java index b313ce34a2..ed2bcc34d5 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerIntegrationTest.java @@ -26,7 +26,6 @@ import static org.jclouds.blobstore.options.ListContainerOptions.Builder.maxResu import static org.testng.Assert.assertEquals; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; @@ -114,7 +113,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testListContainerMarker() throws InterruptedException, UnsupportedEncodingException { + public void testListContainerMarker() throws InterruptedException { String containerName = getContainerName(); try { addAlphabetUnderRoot(containerName); @@ -137,7 +136,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testListRootUsesDelimiter() throws InterruptedException, UnsupportedEncodingException { + public void testListRootUsesDelimiter() throws InterruptedException { String containerName = getContainerName(); try { String prefix = "rootdelimeter"; @@ -153,7 +152,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testDirectory() throws InterruptedException, UnsupportedEncodingException { + public void testDirectory() throws InterruptedException { String containerName = getContainerName(); try { String directory = "directory"; @@ -230,7 +229,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testListContainerPrefix() throws InterruptedException, UnsupportedEncodingException { + public void testListContainerPrefix() throws InterruptedException { String containerName = getContainerName(); try { String prefix = "containerprefix"; @@ -247,7 +246,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testListContainerMaxResults() throws InterruptedException, UnsupportedEncodingException { + public void testListContainerMaxResults() throws InterruptedException { String containerName = getContainerName(); try { addAlphabetUnderRoot(containerName); @@ -295,8 +294,7 @@ public class BaseContainerIntegrationTest extends BaseBlobStoreIntegrationTest { } @Test(groups = { "integration", "live" }) - public void testListContainer() throws InterruptedException, ExecutionException, TimeoutException, - UnsupportedEncodingException { + public void testListContainer() throws InterruptedException, ExecutionException, TimeoutException { String containerName = getContainerName(); try { add15UnderRoot(containerName); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java index 11079a0464..6e59bd2a58 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseMapIntegrationTest.java @@ -27,7 +27,6 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.io.UnsupportedEncodingException; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -150,7 +149,7 @@ public abstract class BaseMapIntegrationTest extends BaseBlobStoreIntegration } @Test(groups = { "integration", "live" }) - public void testDirectory() throws InterruptedException, UnsupportedEncodingException { + public void testDirectory() throws InterruptedException { String containerName = getContainerName(); String directory = "apps"; Map rootMap = createMap(context, containerName); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/options/GetOptionsTest.java b/blobstore/src/test/java/org/jclouds/blobstore/options/GetOptionsTest.java index 8870938a7e..299d8608a2 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/options/GetOptionsTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/options/GetOptionsTest.java @@ -26,7 +26,6 @@ import static org.jclouds.blobstore.options.GetOptions.Builder.range; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; -import java.io.UnsupportedEncodingException; import java.util.Date; import org.testng.annotations.BeforeTest; @@ -179,7 +178,7 @@ public class GetOptionsTest { } @Test - public void testIfETagMatches() throws UnsupportedEncodingException { + public void testIfETagMatches() { GetOptions options = new GetOptions(); options.ifETagMatches(etag); assertEquals(etag, options.getIfMatch()); @@ -192,18 +191,18 @@ public class GetOptionsTest { } @Test - public void testIfETagMatchesStatic() throws UnsupportedEncodingException { + public void testIfETagMatchesStatic() { GetOptions options = ifETagMatches(etag); assertEquals(etag, options.getIfMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagMatchesNPE() throws UnsupportedEncodingException { + public void testIfETagMatchesNPE() { ifETagMatches(null); } @Test - public void testIfETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfETagDoesntMatch() { GetOptions options = new GetOptions(); options.ifETagDoesntMatch(etag); assertEquals(etag, options.getIfNoneMatch()); @@ -216,13 +215,13 @@ public class GetOptionsTest { } @Test - public void testIfETagDoesntMatchStatic() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchStatic() { GetOptions options = ifETagDoesntMatch(etag); assertEquals(etag, options.getIfNoneMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagDoesntMatchNPE() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchNPE() { ifETagDoesntMatch(null); } @@ -232,13 +231,13 @@ public class GetOptionsTest { } - public void testIfUnmodifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagMatches() { ifETagMatches(etag).ifUnmodifiedSince(now); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testIfUnmodifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifUnmodifiedSince(now); } @@ -249,44 +248,44 @@ public class GetOptionsTest { } @Test(expectedExceptions = IllegalArgumentException.class) - public void testIfModifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagMatches() { ifETagMatches(etag).ifModifiedSince(now); } - public void testIfModifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifModifiedSince(now); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagMatchesAfterIfModified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfModified() { ifModifiedSince(now).ifETagMatches(etag); } - public void testETagMatchesAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagMatches(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagMatchesAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testETagMatchesAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifETagMatches(etag); } - public void testETagDoesntMatchAfterIfModified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfModified() { ifModifiedSince(now).ifETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagDoesntMatchAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagDoesntMatchAfterETagMatches() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterETagMatches() { ifETagMatches(etag).ifETagDoesntMatch(etag); } diff --git a/core/src/main/java/org/jclouds/http/options/GetOptions.java b/core/src/main/java/org/jclouds/http/options/GetOptions.java index 77054c4001..ee4d8a635b 100644 --- a/core/src/main/java/org/jclouds/http/options/GetOptions.java +++ b/core/src/main/java/org/jclouds/http/options/GetOptions.java @@ -21,7 +21,6 @@ package org.jclouds.http.options; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; -import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -161,8 +160,6 @@ public class GetOptions extends BaseHttpRequestOptions { * * @param eTag * hash representing the payload - * @throws UnsupportedEncodingException - * if there was a problem converting this into an S3 eTag string */ public GetOptions ifETagMatches(String eTag) { checkArgument(getIfNoneMatch() == null, "ifETagDoesntMatch() is not compatible with ifETagMatches()"); @@ -190,8 +187,6 @@ public class GetOptions extends BaseHttpRequestOptions { * * @param eTag * hash representing the payload - * @throws UnsupportedEncodingException - * if there was a problem converting this into an S3 eTag string */ public GetOptions ifETagDoesntMatch(String eTag) { checkArgument(getIfMatch() == null, "ifETagMatches() is not compatible with ifETagDoesntMatch()"); diff --git a/core/src/test/java/org/jclouds/http/options/GetOptionsTest.java b/core/src/test/java/org/jclouds/http/options/GetOptionsTest.java index 07d5723e80..e9b75f86d6 100644 --- a/core/src/test/java/org/jclouds/http/options/GetOptionsTest.java +++ b/core/src/test/java/org/jclouds/http/options/GetOptionsTest.java @@ -28,7 +28,6 @@ import static org.jclouds.http.options.GetOptions.Builder.tail; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNull; -import java.io.UnsupportedEncodingException; import java.util.Date; import org.jclouds.date.internal.SimpleDateFormatDateService; @@ -205,7 +204,7 @@ public class GetOptionsTest { } @Test - public void testIfETagMatches() throws UnsupportedEncodingException { + public void testIfETagMatches() { GetOptions options = new GetOptions(); options.ifETagMatches(etag); matchesHex(options.getIfMatch()); @@ -218,18 +217,18 @@ public class GetOptionsTest { } @Test - public void testIfETagMatchesStatic() throws UnsupportedEncodingException { + public void testIfETagMatchesStatic() { GetOptions options = ifETagMatches(etag); matchesHex(options.getIfMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagMatchesNPE() throws UnsupportedEncodingException { + public void testIfETagMatchesNPE() { ifETagMatches(null); } @Test - public void testIfETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfETagDoesntMatch() { GetOptions options = new GetOptions(); options.ifETagDoesntMatch(etag); matchesHex(options.getIfNoneMatch()); @@ -242,17 +241,17 @@ public class GetOptionsTest { } @Test - public void testIfETagDoesntMatchStatic() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchStatic() { GetOptions options = ifETagDoesntMatch(etag); matchesHex(options.getIfNoneMatch()); } @Test(expectedExceptions = NullPointerException.class) - public void testIfETagDoesntMatchNPE() throws UnsupportedEncodingException { + public void testIfETagDoesntMatchNPE() { ifETagDoesntMatch(null); } - private void matchesHex(String match) throws UnsupportedEncodingException { + private void matchesHex(String match) { String expected = "\"" + etag + "\""; assertEquals(match, expected); } @@ -263,13 +262,13 @@ public class GetOptionsTest { } - public void testIfUnmodifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagMatches() { ifETagMatches(etag).ifUnmodifiedSince(now); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testIfUnmodifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfUnmodifiedAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifUnmodifiedSince(now); } @@ -280,44 +279,44 @@ public class GetOptionsTest { } @Test(expectedExceptions = IllegalArgumentException.class) - public void testIfModifiedAfterETagMatches() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagMatches() { ifETagMatches(etag).ifModifiedSince(now); } - public void testIfModifiedAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testIfModifiedAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifModifiedSince(now); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagMatchesAfterIfModified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfModified() { ifModifiedSince(now).ifETagMatches(etag); } - public void testETagMatchesAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagMatchesAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagMatches(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagMatchesAfterETagDoesntMatch() throws UnsupportedEncodingException { + public void testETagMatchesAfterETagDoesntMatch() { ifETagDoesntMatch(etag).ifETagMatches(etag); } - public void testETagDoesntMatchAfterIfModified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfModified() { ifModifiedSince(now).ifETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagDoesntMatchAfterIfUnmodified() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterIfUnmodified() { ifUnmodifiedSince(now).ifETagDoesntMatch(etag); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testETagDoesntMatchAfterETagMatches() throws UnsupportedEncodingException { + public void testETagDoesntMatchAfterETagMatches() { ifETagMatches(etag).ifETagDoesntMatch(etag); } diff --git a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java index c1a19b59e9..9ea6c43e66 100644 --- a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java +++ b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java @@ -1485,7 +1485,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoHeader() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoHeader() throws SecurityException, NoSuchMethodException { Method oneHeader = TestHeader.class.getMethod("twoHeader", String.class); Multimap headers = factory(TestHeader.class).createRequest(oneHeader, new Object[] { "robot" }) .getHeaders(); @@ -1503,7 +1503,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneClassHeader() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneClassHeader() throws SecurityException, NoSuchMethodException { Method oneHeader = TestClassHeader.class.getMethod("oneHeader", String.class); Multimap headers = factory(TestClassHeader.class).createRequest(oneHeader, new Object[] { "robot" }).getHeaders(); @@ -1512,7 +1512,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneHeader() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneHeader() throws SecurityException, NoSuchMethodException { Method oneHeader = TestHeader.class.getMethod("oneHeader", String.class); Multimap headers = factory(TestHeader.class).createRequest(oneHeader, new Object[] { "robot" }) .getHeaders(); @@ -1521,7 +1521,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoHeaders() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoHeaders() throws SecurityException, NoSuchMethodException { Method twoHeaders = TestHeader.class.getMethod("twoHeaders", String.class, String.class); Multimap headers = factory(TestHeader.class).createRequest(twoHeaders, new Object[] { "robot", "eggs" }).getHeaders(); @@ -1530,8 +1530,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoHeadersOutOfOrder() throws SecurityException, NoSuchMethodException, - UnsupportedEncodingException { + public void testBuildTwoHeadersOutOfOrder() throws SecurityException, NoSuchMethodException { Method twoHeadersOutOfOrder = TestHeader.class.getMethod("twoHeadersOutOfOrder", String.class, String.class); Multimap headers = factory(TestHeader.class).createRequest(twoHeadersOutOfOrder, new Object[] { "robot", "eggs" }).getHeaders(); @@ -1546,7 +1545,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testQueryInOptions() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testQueryInOptions() throws SecurityException, NoSuchMethodException { Method oneQuery = TestQueryReplace.class.getMethod("queryInOptions", String.class, TestReplaceQueryOptions.class); String query = factory(TestQueryReplace.class).createRequest(oneQuery, new Object[] { "robot", new TestReplaceQueryOptions() }).getEndpoint().getQuery(); @@ -1560,7 +1559,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { @BinderParam(BindMapToMatrixParams.class) Map options); } - public void testTestMapMatrixParams() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testTestMapMatrixParams() throws SecurityException, NoSuchMethodException { Method method = TestMapMatrixParams.class.getMethod("action", String.class, String.class, Map.class); HttpRequest request = factory(TestMapMatrixParams.class).createRequest(method, new Object[] { "robot", "kill", ImmutableMap.of("death", "slow") }); @@ -1602,7 +1601,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoQuery() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoQuery() throws SecurityException, NoSuchMethodException { Method oneQuery = TestQueryReplace.class.getMethod("twoQuery", String.class); String query = factory(TestQueryReplace.class).createRequest(oneQuery, new Object[] { "robot" }).getEndpoint() .getQuery(); @@ -1618,7 +1617,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneClassQuery() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneClassQuery() throws SecurityException, NoSuchMethodException { Method oneQuery = TestClassQuery.class.getMethod("oneQuery", String.class); String query = factory(TestClassQuery.class).createRequest(oneQuery, new Object[] { "robot" }).getEndpoint() .getQuery(); @@ -1626,7 +1625,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneQuery() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneQuery() throws SecurityException, NoSuchMethodException { Method oneQuery = TestQueryReplace.class.getMethod("oneQuery", String.class); String query = factory(TestQueryReplace.class).createRequest(oneQuery, new Object[] { "robot" }).getEndpoint() .getQuery(); @@ -1634,7 +1633,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoQuerys() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoQuerys() throws SecurityException, NoSuchMethodException { Method twoQuerys = TestQueryReplace.class.getMethod("twoQuerys", String.class, String.class); String query = factory(TestQueryReplace.class).createRequest(twoQuerys, new Object[] { "robot", "eggs" }) .getEndpoint().getQuery(); @@ -1642,8 +1641,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoQuerysOutOfOrder() throws SecurityException, NoSuchMethodException, - UnsupportedEncodingException { + public void testBuildTwoQuerysOutOfOrder() throws SecurityException, NoSuchMethodException { Method twoQuerysOutOfOrder = TestQueryReplace.class.getMethod("twoQuerysOutOfOrder", String.class, String.class); String query = factory(TestQueryReplace.class).createRequest(twoQuerysOutOfOrder, new Object[] { "robot", "eggs" }).getEndpoint().getQuery(); @@ -1657,7 +1655,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testMatrixInOptions() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testMatrixInOptions() throws SecurityException, NoSuchMethodException { Method oneMatrix = TestMatrixReplace.class.getMethod("matrixInOptions", String.class, TestReplaceMatrixOptions.class); String path = factory(TestMatrixReplace.class).createRequest(oneMatrix, @@ -1699,7 +1697,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoMatrix() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoMatrix() throws SecurityException, NoSuchMethodException { Method oneMatrix = TestMatrixReplace.class.getMethod("twoMatrix", String.class); String path = factory(TestMatrixReplace.class).createRequest(oneMatrix, new Object[] { "robot" }).getEndpoint() .getPath(); @@ -1716,7 +1714,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneClassMatrix() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneClassMatrix() throws SecurityException, NoSuchMethodException { Method oneMatrix = TestClassMatrix.class.getMethod("oneMatrix", String.class); String path = factory(TestClassMatrix.class).createRequest(oneMatrix, new Object[] { "robot" }).getEndpoint() .getPath(); @@ -1724,7 +1722,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildOneMatrix() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneMatrix() throws SecurityException, NoSuchMethodException { Method oneMatrix = TestMatrixReplace.class.getMethod("oneMatrix", String.class); String path = factory(TestMatrixReplace.class).createRequest(oneMatrix, new Object[] { "robot" }).getEndpoint() .getPath(); @@ -1732,7 +1730,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoMatrixs() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoMatrixs() throws SecurityException, NoSuchMethodException { Method twoMatrixs = TestMatrixReplace.class.getMethod("twoMatrixs", String.class, String.class); String path = factory(TestMatrixReplace.class).createRequest(twoMatrixs, new Object[] { "robot", "eggs" }) .getEndpoint().getPath(); @@ -1740,8 +1738,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoMatrixsOutOfOrder() throws SecurityException, NoSuchMethodException, - UnsupportedEncodingException { + public void testBuildTwoMatrixsOutOfOrder() throws SecurityException, NoSuchMethodException { Method twoMatrixsOutOfOrder = TestMatrixReplace.class.getMethod("twoMatrixsOutOfOrder", String.class, String.class); String path = factory(TestMatrixReplace.class).createRequest(twoMatrixsOutOfOrder, @@ -2380,7 +2377,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoForm() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoForm() throws SecurityException, NoSuchMethodException { Method oneForm = TestFormReplace.class.getMethod("twoForm", String.class); Object form = factory(TestFormReplace.class).createRequest(oneForm, "robot").getPayload().getRawContent(); assertEquals(form, "slash=/robot&hyphen=-robot"); @@ -2406,40 +2403,39 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testProvidesWithGeneric() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testProvidesWithGeneric() throws SecurityException, NoSuchMethodException { Set set = injector.getInstance(AsyncClientFactory.class).create(TestClassForm.class).set(); assertEquals(set, ImmutableSet.of("foo")); } @Test - public void testProvidesWithGenericQualified() throws SecurityException, NoSuchMethodException, - UnsupportedEncodingException { + public void testProvidesWithGenericQualified() throws SecurityException, NoSuchMethodException { Set set = injector.getInstance(AsyncClientFactory.class).create(TestClassForm.class).foo(); assertEquals(set, ImmutableSet.of("bar")); } @Test(expectedExceptions = AuthorizationException.class) public void testProvidesWithGenericQualifiedAuthorizationException() throws SecurityException, - NoSuchMethodException, UnsupportedEncodingException { + NoSuchMethodException { injector.getInstance(AsyncClientFactory.class).create(TestClassForm.class).exception(); } @Test - public void testBuildOneClassForm() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneClassForm() throws SecurityException, NoSuchMethodException { Method oneForm = TestClassForm.class.getMethod("oneForm", String.class); Object form = factory(TestClassForm.class).createRequest(oneForm, "robot").getPayload().getRawContent(); assertEquals(form, "x-amz-copy-source=/robot"); } @Test - public void testBuildOneForm() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildOneForm() throws SecurityException, NoSuchMethodException { Method oneForm = TestFormReplace.class.getMethod("oneForm", String.class); Object form = factory(TestFormReplace.class).createRequest(oneForm, "robot").getPayload().getRawContent(); assertEquals(form, "x-amz-copy-source=/robot"); } @Test - public void testBuildTwoForms() throws SecurityException, NoSuchMethodException, UnsupportedEncodingException { + public void testBuildTwoForms() throws SecurityException, NoSuchMethodException { Method twoForms = TestFormReplace.class.getMethod("twoForms", String.class, String.class); Object form = factory(TestFormReplace.class).createRequest(twoForms, "robot", "eggs").getPayload() .getRawContent(); @@ -2447,8 +2443,7 @@ public class RestAnnotationProcessorTest extends BaseRestClientTest { } @Test - public void testBuildTwoFormsOutOfOrder() throws SecurityException, NoSuchMethodException, - UnsupportedEncodingException { + public void testBuildTwoFormsOutOfOrder() throws SecurityException, NoSuchMethodException { Method twoFormsOutOfOrder = TestFormReplace.class.getMethod("twoFormsOutOfOrder", String.class, String.class); Object form = factory(TestFormReplace.class).createRequest(twoFormsOutOfOrder, "robot", "eggs").getPayload() .getRawContent(); diff --git a/core/src/test/java/org/jclouds/util/Strings2Test.java b/core/src/test/java/org/jclouds/util/Strings2Test.java index a213eca89f..c94a4c17aa 100644 --- a/core/src/test/java/org/jclouds/util/Strings2Test.java +++ b/core/src/test/java/org/jclouds/util/Strings2Test.java @@ -20,8 +20,6 @@ package org.jclouds.util; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; - import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; @@ -43,7 +41,7 @@ public class Strings2Test { assertEquals(Strings2.urlEncode("/read-tests/ tep", '/'), "/read-tests/%20tep"); } - public void testReplaceTokens() throws UnsupportedEncodingException { + public void testReplaceTokens() { assertEquals(Strings2.replaceTokens("hello {where}", ImmutableMap.of("where", "world")), "hello world"); } diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobIntegrationLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobIntegrationLiveTest.java index 49bfa6c950..ce345013da 100644 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobIntegrationLiveTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/integration/AzureBlobIntegrationLiveTest.java @@ -19,7 +19,6 @@ package org.jclouds.azureblob.blobstore.integration; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.concurrent.ExecutionException; import org.jclouds.blobstore.domain.Blob; @@ -34,7 +33,7 @@ import org.testng.annotations.Test; public class AzureBlobIntegrationLiveTest extends BaseBlobIntegrationTest { @Override - public void testGetIfMatch() throws InterruptedException, UnsupportedEncodingException { + public void testGetIfMatch() throws InterruptedException { // this currently fails } diff --git a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/util/UtilsTest.java b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/util/UtilsTest.java index dbcfc99ce7..a1a53ac728 100644 --- a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/util/UtilsTest.java +++ b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/util/UtilsTest.java @@ -20,8 +20,6 @@ package org.jclouds.scriptbuilder.util; import static org.testng.Assert.assertEquals; -import java.io.UnsupportedEncodingException; - import org.jclouds.scriptbuilder.domain.OsFamily; import org.jclouds.scriptbuilder.domain.ShellToken; import org.testng.annotations.Test; @@ -35,7 +33,7 @@ import com.google.common.collect.ImmutableMap; @Test(groups = "unit") public class UtilsTest { - public void testReplaceTokens() throws UnsupportedEncodingException { + public void testReplaceTokens() { assertEquals(Utils.replaceTokens("hello {where}", ImmutableMap.of("where", "world")), "hello world"); }