From 4cef85d1cdb373dc85ac08e54911f49fe56214ef Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 8 Dec 2013 22:27:18 -0800 Subject: [PATCH] Address Checkstyle violations in tests --- .../ParseImageFromJsonResponseTest.java | 2 +- .../cloudsigma/CloudSigmaClientLiveTest.java | 4 +- .../features/LoadBalancerApiLiveTest.java | 2 +- .../features/TemplateApiLiveTest.java | 4 +- .../options/SaveAlarmOptionsTest.java | 2 +- .../internal/EC2TemplateBuilderImplTest.java | 2 +- .../ec2/features/AMIApiExpectTest.java | 2 +- .../ec2/features/KeyPairApiExpectTest.java | 2 +- .../features/SecurityGroupApiExpectTest.java | 2 +- .../elasticstack/ElasticStackApiLiveTest.java | 4 +- .../FilesystemContainerIntegrationTest.java | 4 +- .../cinder/v1/features/QuotasApiLiveTest.java | 2 +- .../AvailabilityZonesApiLiveTest.java | 2 +- .../v2_0/features/ServerApiExpectTest.java | 2 +- .../v1/features/AccessRuleApiLiveTest.java | 6 +- .../java/org/jclouds/s3/S3ClientLiveTest.java | 6 +- ...entialMultipartUploadStrategyMockTest.java | 3 +- .../KeystoneStorageEndpointModuleTest.java | 3 +- .../org/jclouds/vcloud/VCloudApiTest.java | 4 +- .../jclouds/vcloud/features/VmApiTest.java | 4 +- .../internal/BaseBlobIntegrationTest.java | 6 +- .../BaseBlobStoreIntegrationTest.java | 2 +- .../StubComputeServiceIntegrationTest.java | 2 +- .../internal/BaseComputeServiceLiveTest.java | 4 +- .../java/org/jclouds/JcloudsVersionTest.java | 4 +- .../java/org/jclouds/PerformanceTest.java | 2 +- .../java/org/jclouds/domain/JsonBallTest.java | 18 +++--- .../jclouds/http/functions/ParseSaxTest.java | 4 +- .../BackoffLimitedRetryHandlerTest.java | 10 ++-- .../handlers/BaseHttpErrorHandlerTest.java | 2 +- .../jclouds/http/internal/WireLiveTest.java | 4 +- .../org/jclouds/http/internal/WireTest.java | 4 +- .../lifecycle/config/LifeCycleModuleTest.java | 5 +- .../Reflection2OverriddenMethodTest.java | 2 +- .../DelegateAnnotationExpectTest.java | 2 +- ...AXBResponseParserAnnotationExpectTest.java | 16 ++--- .../internal/RestAnnotationProcessorTest.java | 60 +++++++++---------- .../test/testng/UnitTestStatusListener.java | 6 +- .../jclouds/gae/ConvertToGaeRequestTest.java | 2 +- .../gae/ConvertToJcloudsResponseTest.java | 2 +- .../BaseLoadBalancerServiceLiveTest.java | 2 +- project/pom.xml | 1 + .../compute/AWSEC2ComputeServiceLiveTest.java | 2 +- .../AWSEC2TemplateBuilderLiveTest.java | 22 +++---- .../aws/ec2/features/AWSAMIApiLiveTest.java | 2 +- .../features/PlacementGroupApiExpectTest.java | 2 +- .../features/SpotInstanceApiExpectTest.java | 2 +- .../strategy/internal/MpuGraphData.java | 3 +- .../azureblob/AzureBlobClientLiveTest.java | 2 +- .../xml/BlobBlocksResultsHandlerTest.java | 5 +- .../gogrid/GoGridLiveTestDisabled.java | 12 ++-- .../login/ReplaceShadowPasswordEntryTest.java | 2 +- 52 files changed, 142 insertions(+), 134 deletions(-) diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/functions/ParseImageFromJsonResponseTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/functions/ParseImageFromJsonResponseTest.java index 08cba8097f..cc0533df5d 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/functions/ParseImageFromJsonResponseTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/functions/ParseImageFromJsonResponseTest.java @@ -64,7 +64,7 @@ public class ParseImageFromJsonResponseTest { assertEquals(response.getProgress(), Integer.valueOf(80)); assertEquals(response.getServerId(), Integer.valueOf(12)); assertEquals(response.getStatus(), ImageStatus.SAVING); - assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse(("2010-10-10T12:00:00Z"))); + assertEquals(response.getUpdated(), dateService.iso8601SecondsDateParse("2010-10-10T12:00:00Z")); } diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java index 2c4e206479..9b19e45c27 100644 --- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java +++ b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java @@ -343,8 +343,8 @@ public class CloudSigmaClientLiveTest extends BaseComputeServiceContextLiveTest // behavior on shutdown depends on how your server OS is set up to respond // to an ACPI power // button signal - assert (client.getServerInfo(server.getUuid()).getStatus() == ServerStatus.ACTIVE || client.getServerInfo( - server.getUuid()).getStatus() == ServerStatus.STOPPED); + assert client.getServerInfo(server.getUuid()).getStatus() == ServerStatus.ACTIVE || client.getServerInfo( + server.getUuid()).getStatus() == ServerStatus.STOPPED; } @Test(dependsOnMethods = "testLifeCycle") diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerApiLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerApiLiveTest.java index 79fdf996d4..83c7fa0556 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerApiLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/LoadBalancerApiLiveTest.java @@ -115,7 +115,7 @@ public class LoadBalancerApiLiveTest extends BaseCloudStackApiLiveTest { } } assertNotNull(rule, "Failed to get a load balancer rule after " + attempts + " attempts"); - assert (rule.getPublicIPId() == ip.getId()) : rule; + assert rule.getPublicIPId() == ip.getId() : rule; assertEquals(rule.getPublicPort(), 22); assertEquals(rule.getPrivatePort(), 22); assertEquals(rule.getAlgorithm(), Algorithm.LEASTCONN); diff --git a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateApiLiveTest.java b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateApiLiveTest.java index 1825372b2d..e0a025b344 100644 --- a/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateApiLiveTest.java +++ b/apis/cloudstack/src/test/java/org/jclouds/cloudstack/features/TemplateApiLiveTest.java @@ -86,8 +86,8 @@ public class TemplateApiLiveTest extends BaseCloudStackApiLiveTest { assert template.getAccount() != null : template; assert template.getZone() != null : template; assert template.getZoneId() != null : template; - assert (template.getStatus() == null || - template.getStatus() == Template.Status.DOWNLOADED) : template; + assert template.getStatus() == null || + template.getStatus() == Template.Status.DOWNLOADED : template; assert template.getType() != null && template.getType() != Template.Type.UNRECOGNIZED : template; assert template.getHypervisor() != null : template; assert template.getDomain() != null : template; diff --git a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/options/SaveAlarmOptionsTest.java b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/options/SaveAlarmOptionsTest.java index f1a59740f7..fc810c6aa8 100644 --- a/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/options/SaveAlarmOptionsTest.java +++ b/apis/cloudwatch/src/test/java/org/jclouds/cloudwatch/options/SaveAlarmOptionsTest.java @@ -146,4 +146,4 @@ public class SaveAlarmOptionsTest { assertEquals(formParameters.get("Unit"), ImmutableSet.of(unit.toString())); } -} \ No newline at end of file +} diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/internal/EC2TemplateBuilderImplTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/internal/EC2TemplateBuilderImplTest.java index 8e11036a7a..c8cc78b72c 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/internal/EC2TemplateBuilderImplTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/internal/EC2TemplateBuilderImplTest.java @@ -66,7 +66,7 @@ public class EC2TemplateBuilderImplTest extends TemplateBuilderImplTest { @Override protected EC2TemplateBuilderImpl createTemplateBuilder(final Image knownImage, - @Memoized Supplier> locations, final @Memoized Supplier> images, + @Memoized Supplier> locations, @Memoized final Supplier> images, @Memoized Supplier> sizes, Location defaultLocation, Provider optionsProvider, Provider templateBuilderProvider) { diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/features/AMIApiExpectTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/features/AMIApiExpectTest.java index d3ba9a5e1d..7b57b2ae1c 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/features/AMIApiExpectTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/features/AMIApiExpectTest.java @@ -73,4 +73,4 @@ public class AMIApiExpectTest extends BaseEC2ApiExpectTest { .build()), ImmutableSet.of()); } -} \ No newline at end of file +} diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/features/KeyPairApiExpectTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/features/KeyPairApiExpectTest.java index 4b08ba7584..8c1c3d8019 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/features/KeyPairApiExpectTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/features/KeyPairApiExpectTest.java @@ -73,4 +73,4 @@ public class KeyPairApiExpectTest extends BaseEC2ApiExpectTest { .build()), ImmutableSet.of()); } -} \ No newline at end of file +} diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/features/SecurityGroupApiExpectTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/features/SecurityGroupApiExpectTest.java index 9e5491efbb..5bef06ff94 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/features/SecurityGroupApiExpectTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/features/SecurityGroupApiExpectTest.java @@ -73,4 +73,4 @@ public class SecurityGroupApiExpectTest extends BaseEC2ApiExpectTest { .build()), ImmutableSet.of()); } -} \ No newline at end of file +} diff --git a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackApiLiveTest.java b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackApiLiveTest.java index 2ce94fe72f..f18f2f91ee 100644 --- a/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackApiLiveTest.java +++ b/apis/elasticstack/src/test/java/org/jclouds/elasticstack/ElasticStackApiLiveTest.java @@ -240,8 +240,8 @@ public class ElasticStackApiLiveTest extends BaseComputeServiceContextLiveTest { client.shutdownServer(server.getUuid()); // behavior on shutdown depends on how your server OS is set up to respond to an ACPI power // button signal - assert (client.getServerInfo(server.getUuid()).getStatus() == ServerStatus.ACTIVE || client.getServerInfo( - server.getUuid()).getStatus() == ServerStatus.STOPPED); + assert client.getServerInfo(server.getUuid()).getStatus() == ServerStatus.ACTIVE || client.getServerInfo( + server.getUuid()).getStatus() == ServerStatus.STOPPED; } @Test(dependsOnMethods = "testLifeCycle") diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java index eb124ccabe..7cec685b8e 100644 --- a/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java +++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/integration/FilesystemContainerIntegrationTest.java @@ -157,7 +157,7 @@ public class FilesystemContainerIntegrationTest extends BaseContainerIntegration @DataProvider public Object[][] ignoreOnWindows() { - return (TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS - : TestUtils.SINGLE_NO_ARG_INVOCATION); + return TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS + : TestUtils.SINGLE_NO_ARG_INVOCATION; } } diff --git a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/QuotasApiLiveTest.java b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/QuotasApiLiveTest.java index c316a5d31b..a255a755dc 100644 --- a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/QuotasApiLiveTest.java +++ b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/QuotasApiLiveTest.java @@ -55,4 +55,4 @@ public class QuotasApiLiveTest extends BaseCinderApiLiveTest { assertTrue(volumeQuota.getVolumes() >= 0); assertTrue(volumeQuota.getSnapshots() >= 0); } -} \ No newline at end of file +} diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java index 81e5d6c6a7..a7ad44f3f3 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java @@ -42,4 +42,4 @@ public class AvailabilityZonesApiLiveTest extends BaseNovaApiLiveTest { assertTrue(zone.getState().available(), "zone: " + zone.getName() + " is not available."); } } -} \ No newline at end of file +} diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java index be780ebe25..070dcf6d19 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java @@ -36,7 +36,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; -import org.jclouds.openstack.nova.v2_0.parse.*; +import org.jclouds.openstack.nova.v2_0.parse.ParseServerDiagnostics; /** * Tests annotation parsing of {@code ServerAsyncApi} diff --git a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java index cf06454da1..16b0697c47 100644 --- a/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java +++ b/apis/rackspace-cloudloadbalancers/src/test/java/org/jclouds/rackspace/cloudloadbalancers/v1/features/AccessRuleApiLiveTest.java @@ -21,7 +21,6 @@ import static org.jclouds.rackspace.cloudloadbalancers.v1.predicates.LoadBalance import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,6 +37,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; /** * @author Everett Toews @@ -62,7 +62,7 @@ public class AccessRuleApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { accessRule3 = AccessRule.deny("206.160.163.22"); accessRule4 = AccessRule.deny("206.160.168.22"); - accessRules = new HashMap(); + accessRules = Maps.newHashMap(); accessRules.put(accessRule1.getAddress(), accessRule1); accessRules.put(accessRule2.getAddress(), accessRule2); accessRules.put(accessRule3.getAddress(), accessRule3); @@ -120,7 +120,7 @@ public class AccessRuleApiLiveTest extends BaseCloudLoadBalancersApiLiveTest { assertTrue(api.getAccessRuleApiForZoneAndLoadBalancer(zone, lb.getId()).deleteAll()); assertTrue(awaitAvailable(api.getLoadBalancerApiForZone(zone)).apply(lb)); - assertExpectedAccessRules(new HashMap()); + assertExpectedAccessRules(Maps.newHashMap()); } private void assertExpectedAccessRules(Map expectedAccessList) { diff --git a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java index eaf132ecba..036028c19e 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/S3ClientLiveTest.java @@ -309,14 +309,14 @@ public class S3ClientLiveTest extends BaseBlobStoreIntegrationTest { } protected void assertCacheControl(S3Object newObject, String string) { - assert (newObject.getMetadata().getCacheControl().indexOf(string) != -1) : newObject.getMetadata() + assert newObject.getMetadata().getCacheControl().indexOf(string) != -1 : newObject.getMetadata() .getCacheControl(); } protected void assertContentEncoding(S3Object newObject, String string) { - assert (newObject.getPayload().getContentMetadata().getContentEncoding().indexOf(string) != -1) : newObject + assert newObject.getPayload().getContentMetadata().getContentEncoding().indexOf(string) != -1 : newObject .getPayload().getContentMetadata().getContentEncoding(); - assert (newObject.getMetadata().getContentMetadata().getContentEncoding().indexOf(string) != -1) : newObject + assert newObject.getMetadata().getContentMetadata().getContentEncoding().indexOf(string) != -1 : newObject .getMetadata().getContentMetadata().getContentEncoding(); } diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategyMockTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategyMockTest.java index 313e13670d..0a0b49f0fc 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategyMockTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/strategy/internal/SequentialMultipartUploadStrategyMockTest.java @@ -37,6 +37,7 @@ import org.testng.annotations.Test; import com.google.common.base.Charsets; import com.google.common.collect.ImmutableSet; +import com.google.common.util.concurrent.Atomics; import com.google.inject.Module; import com.google.mockwebserver.MockResponse; import com.google.mockwebserver.MockWebServer; @@ -121,7 +122,7 @@ public class SequentialMultipartUploadStrategyMockTest { * this method, which allows us to send back links to the mock server. */ private AtomicReference setURLReplacingDispatcher(MockWebServer server) { - final AtomicReference url = new AtomicReference(); + final AtomicReference url = Atomics.newReference(); final QueueDispatcher dispatcher = new QueueDispatcher() { protected final BlockingQueue responseQueue = new LinkedBlockingQueue(); diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/config/KeystoneStorageEndpointModuleTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/config/KeystoneStorageEndpointModuleTest.java index 43d4e66e6b..2cce286bb9 100644 --- a/apis/swift/src/test/java/org/jclouds/openstack/swift/config/KeystoneStorageEndpointModuleTest.java +++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/config/KeystoneStorageEndpointModuleTest.java @@ -39,6 +39,7 @@ import org.testng.annotations.Test; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; +import com.google.common.collect.Maps; @Test(groups = "unit") public class KeystoneStorageEndpointModuleTest { @@ -53,7 +54,7 @@ public class KeystoneStorageEndpointModuleTest { */ @BeforeTest public void setup() { - Map> endpoints = new HashMap>(); + Map> endpoints = Maps.newHashMap(); try { endpoints.put("region1", Suppliers.ofInstance(new URI("http://region1.example.org/"))); diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudApiTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudApiTest.java index 7b5371ac00..9578c643ca 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudApiTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/VCloudApiTest.java @@ -57,8 +57,8 @@ public class VCloudApiTest extends BaseVCloudApiTest { @DataProvider public Object[][] ignoreOnWindows() { - return (TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS - : TestUtils.SINGLE_NO_ARG_INVOCATION); + return TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS + : TestUtils.SINGLE_NO_ARG_INVOCATION; } } diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmApiTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmApiTest.java index 6502d27e47..d7f0b0f50f 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmApiTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/features/VmApiTest.java @@ -313,8 +313,8 @@ public class VmApiTest extends BaseVCloudApiTest { @DataProvider public Object[][] ignoreOnWindows() { - return (TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS - : TestUtils.SINGLE_NO_ARG_INVOCATION); + return TestUtils.isWindowsOs() ? TestUtils.NO_INVOCATIONS + : TestUtils.SINGLE_NO_ARG_INVOCATION; } } 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 7b14793ccc..ab777f700f 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 @@ -599,9 +599,9 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { } protected void checkContentEncoding(Blob blob, String contentEncoding) { - assert (blob.getPayload().getContentMetadata().getContentEncoding().indexOf(contentEncoding) != -1) : blob + assert blob.getPayload().getContentMetadata().getContentEncoding().indexOf(contentEncoding) != -1 : blob .getPayload().getContentMetadata().getContentEncoding(); - assert (blob.getMetadata().getContentMetadata().getContentEncoding().indexOf(contentEncoding) != -1) : blob + assert blob.getMetadata().getContentMetadata().getContentEncoding().indexOf(contentEncoding) != -1 : blob .getMetadata().getContentMetadata().getContentEncoding(); } @@ -612,7 +612,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest { .getMetadata().getContentMetadata().getContentLanguage(); } - protected volatile static Crypto crypto; + protected static volatile Crypto crypto; static { try { crypto = new JCECrypto(); diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobStoreIntegrationTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobStoreIntegrationTest.java index e6413ec460..c7344e9f75 100644 --- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobStoreIntegrationTest.java +++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseBlobStoreIntegrationTest.java @@ -90,7 +90,7 @@ public class BaseBlobStoreIntegrationTest extends BaseViewLiveTest containerNames = new ArrayBlockingQueue(containerCount); + private static volatile BlockingQueue containerNames = new ArrayBlockingQueue(containerCount); /** * There are a lot of retries here mainly from experience running inside amazon EC2. diff --git a/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java b/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java index 0a65809a7e..eb5d51ac1a 100644 --- a/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java +++ b/compute/src/test/java/org/jclouds/compute/StubComputeServiceIntegrationTest.java @@ -396,7 +396,7 @@ public class StubComputeServiceIntegrationTest extends BaseComputeServiceLiveTes return actual == null; } try { - String real = Strings2.toString(((Payload) actual)); + String real = Strings2.toString((Payload) actual); assertEquals(real, expected); return true; } catch (IOException e) { diff --git a/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java index d3c7a92cbd..4e35e5c8f0 100644 --- a/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/internal/BaseComputeServiceLiveTest.java @@ -486,7 +486,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte public void testCredentialsCache() throws Exception { initializeContext(); for (NodeMetadata node : nodes) - assert (view.utils().credentialStore().get("node#" + node.getId()) != null) : "credentials for " + node.getId(); + assert view.utils().credentialStore().get("node#" + node.getId()) != null : "credentials for " + node.getId(); } protected Map runScriptWithCreds(final String group, OperatingSystem os, @@ -537,7 +537,7 @@ public abstract class BaseComputeServiceLiveTest extends BaseComputeServiceConte assertLocationSameOrChild(checkNotNull(metadata.getLocation(), "location of %s", metadata), template.getLocation()); checkImageIdMatchesTemplate(metadata); checkOsMatchesTemplate(metadata); - assert (metadata.getStatus() == Status.RUNNING) : metadata; + assert metadata.getStatus() == Status.RUNNING : metadata; // due to DHCP the addresses can actually change in-between runs. assertEquals(metadata.getPrivateAddresses().size(), node.getPrivateAddresses().size(), format( "[%s] didn't match: [%s]", metadata.getPrivateAddresses(), node.getPrivateAddresses().size())); diff --git a/core/src/test/java/org/jclouds/JcloudsVersionTest.java b/core/src/test/java/org/jclouds/JcloudsVersionTest.java index 027d1178f4..3bfc8d503d 100644 --- a/core/src/test/java/org/jclouds/JcloudsVersionTest.java +++ b/core/src/test/java/org/jclouds/JcloudsVersionTest.java @@ -168,9 +168,9 @@ public class JcloudsVersionTest { @Override public InputStream getResourceAsStream(String name) { - return (Iterables.contains(resourcesToHide, name) + return Iterables.contains(resourcesToHide, name) ? null - : delegate.getResourceAsStream(name)); + : delegate.getResourceAsStream(name); } } } diff --git a/core/src/test/java/org/jclouds/PerformanceTest.java b/core/src/test/java/org/jclouds/PerformanceTest.java index 32db39110a..81629e8a41 100644 --- a/core/src/test/java/org/jclouds/PerformanceTest.java +++ b/core/src/test/java/org/jclouds/PerformanceTest.java @@ -112,7 +112,7 @@ public abstract class PerformanceTest { } if (performanceTestName != null) { System.out.printf("TIMING: Multi-threaded %s took %.3fms for %d threads\n", - performanceTestName, ((double) endTime / 1000000), THREAD_COUNT); + performanceTestName, (double) endTime / 1000000, THREAD_COUNT); } } diff --git a/core/src/test/java/org/jclouds/domain/JsonBallTest.java b/core/src/test/java/org/jclouds/domain/JsonBallTest.java index 140a702be4..6964a5ec65 100644 --- a/core/src/test/java/org/jclouds/domain/JsonBallTest.java +++ b/core/src/test/java/org/jclouds/domain/JsonBallTest.java @@ -43,47 +43,47 @@ public class JsonBallTest { public void testJSON_STRING_PATTERN1() { Matcher matcher = JsonBall.JSON_STRING_PATTERN.matcher("hello"); - assert (matcher.find()); + assert matcher.find(); } public void testJSON_STRING_PATTERN2() { Matcher matcher = JsonBall.JSON_STRING_PATTERN.matcher("hello world!"); - assert (matcher.find()); + assert matcher.find(); } public void testJSON_STRING_PATTERN3() { Matcher matcher = JsonBall.JSON_STRING_PATTERN.matcher("\"hello world!\""); - assert (!matcher.find()); + assert !matcher.find(); } public void testJSON_STRING_PATTERN4() { Matcher matcher = JsonBall.JSON_STRING_PATTERN.matcher("[hello world!]"); - assert (!matcher.find()); + assert !matcher.find(); } public void testJSON_STRING_PATTERN5() { Matcher matcher = JsonBall.JSON_STRING_PATTERN.matcher("{hello world!}"); - assert (!matcher.find()); + assert !matcher.find(); } public void testJSON_NUMBER_PATTERN1() { Matcher matcher = JsonBall.JSON_NUMBER_PATTERN.matcher("1"); - assert (matcher.find()); + assert matcher.find(); } public void testJSON_NUMBER_PATTERN2() { Matcher matcher = JsonBall.JSON_NUMBER_PATTERN.matcher("1.1"); - assert (matcher.find()); + assert matcher.find(); } public void testJSON_NUMBER_PATTERN3() { Matcher matcher = JsonBall.JSON_NUMBER_PATTERN.matcher("\"1.1\""); - assert (!matcher.find()); + assert !matcher.find(); } public void testJSON_NUMBER_PATTERN4() { Matcher matcher = JsonBall.JSON_NUMBER_PATTERN.matcher("\"1\""); - assert (!matcher.find()); + assert !matcher.find(); } private ParseJson> handler; diff --git a/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java b/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java index 16d619ae64..c64b286f3c 100644 --- a/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java +++ b/core/src/test/java/org/jclouds/http/functions/ParseSaxTest.java @@ -57,12 +57,12 @@ public class ParseSaxTest extends BaseHandlerTest { @DataProvider public Object[][] runUnderJava7() { - return (TestUtils.isJava7() ? SINGLE_NO_ARG_INVOCATION : NO_INVOCATIONS); + return TestUtils.isJava7() ? SINGLE_NO_ARG_INVOCATION : NO_INVOCATIONS; } @DataProvider public Object[][] ignoreUnderJava7() { - return (TestUtils.isJava7() ? NO_INVOCATIONS : SINGLE_NO_ARG_INVOCATION); + return TestUtils.isJava7() ? NO_INVOCATIONS : SINGLE_NO_ARG_INVOCATION; } @Test diff --git a/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java b/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java index b65efb146e..b19aeda409 100644 --- a/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java +++ b/core/src/test/java/org/jclouds/http/handlers/BackoffLimitedRetryHandlerTest.java @@ -50,31 +50,31 @@ public class BackoffLimitedRetryHandlerTest { long startTime = System.nanoTime(); handler.imposeBackoffExponentialDelay(period, 2, 1, 5, "TEST FAILURE: 1"); long elapsedTime = (System.nanoTime() - startTime) / 1000000; - assert (elapsedTime >= period - 1) : elapsedTime; + assert elapsedTime >= period - 1 : elapsedTime; assertTrue(elapsedTime < period + acceptableDelay); startTime = System.nanoTime(); handler.imposeBackoffExponentialDelay(period, 2, 2, 5, "TEST FAILURE: 2"); elapsedTime = (System.nanoTime() - startTime) / 1000000; - assert (elapsedTime >= period * 4 - 1) : elapsedTime; + assert elapsedTime >= period * 4 - 1 : elapsedTime; assertTrue(elapsedTime < period * 9); startTime = System.nanoTime(); handler.imposeBackoffExponentialDelay(period, 2, 3, 5, "TEST FAILURE: 3"); elapsedTime = (System.nanoTime() - startTime) / 1000000; - assert (elapsedTime >= period * 9 - 1) : elapsedTime; + assert elapsedTime >= period * 9 - 1 : elapsedTime; assertTrue(elapsedTime < period * 10); startTime = System.nanoTime(); handler.imposeBackoffExponentialDelay(period, 2, 4, 5, "TEST FAILURE: 4"); elapsedTime = (System.nanoTime() - startTime) / 1000000; - assert (elapsedTime >= period * 10 - 1) : elapsedTime; + assert elapsedTime >= period * 10 - 1 : elapsedTime; assertTrue(elapsedTime < period * 11); startTime = System.nanoTime(); handler.imposeBackoffExponentialDelay(period, 2, 5, 5, "TEST FAILURE: 5"); elapsedTime = (System.nanoTime() - startTime) / 1000000; - assert (elapsedTime >= period * 10 - 1) : elapsedTime; + assert elapsedTime >= period * 10 - 1 : elapsedTime; assertTrue(elapsedTime < period * 11); } diff --git a/core/src/test/java/org/jclouds/http/handlers/BaseHttpErrorHandlerTest.java b/core/src/test/java/org/jclouds/http/handlers/BaseHttpErrorHandlerTest.java index 8f78fde040..393a3b2159 100644 --- a/core/src/test/java/org/jclouds/http/handlers/BaseHttpErrorHandlerTest.java +++ b/core/src/test/java/org/jclouds/http/handlers/BaseHttpErrorHandlerTest.java @@ -39,7 +39,7 @@ import com.google.inject.Guice; */ @Test(groups = { "unit" }) public abstract class BaseHttpErrorHandlerTest { - abstract protected Class getClassToTest(); + protected abstract Class getClassToTest(); protected void assertCodeMakes(String method, URI uri, int statusCode, String message, String content, Class expected, String exceptionMessage) { diff --git a/core/src/test/java/org/jclouds/http/internal/WireLiveTest.java b/core/src/test/java/org/jclouds/http/internal/WireLiveTest.java index 589308048d..b03daa250a 100644 --- a/core/src/test/java/org/jclouds/http/internal/WireLiveTest.java +++ b/core/src/test/java/org/jclouds/http/internal/WireLiveTest.java @@ -120,14 +120,14 @@ public class WireLiveTest { public static HttpWire setUp() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); - wire.wireLog = (bufferLogger); + wire.wireLog = bufferLogger; return wire; } public HttpWire setUpSynch() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); - wire.wireLog = (bufferLogger); + wire.wireLog = bufferLogger; return wire; } diff --git a/core/src/test/java/org/jclouds/http/internal/WireTest.java b/core/src/test/java/org/jclouds/http/internal/WireTest.java index e0d77da3b0..df924a900e 100644 --- a/core/src/test/java/org/jclouds/http/internal/WireTest.java +++ b/core/src/test/java/org/jclouds/http/internal/WireTest.java @@ -86,14 +86,14 @@ public class WireTest { public HttpWire setUp() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); - wire.wireLog = (bufferLogger); + wire.wireLog = bufferLogger; return wire; } public HttpWire setUpSynch() throws Exception { BufferLogger bufferLogger = new BufferLogger(); HttpWire wire = new HttpWire(); - wire.wireLog = (bufferLogger); + wire.wireLog = bufferLogger; return wire; } diff --git a/core/src/test/java/org/jclouds/lifecycle/config/LifeCycleModuleTest.java b/core/src/test/java/org/jclouds/lifecycle/config/LifeCycleModuleTest.java index 7f8d8bae95..4ef33738aa 100644 --- a/core/src/test/java/org/jclouds/lifecycle/config/LifeCycleModuleTest.java +++ b/core/src/test/java/org/jclouds/lifecycle/config/LifeCycleModuleTest.java @@ -26,7 +26,10 @@ import java.util.concurrent.CountDownLatch; import javax.annotation.PostConstruct; -import static org.easymock.EasyMock.*; +import static org.easymock.EasyMock.createStrictMock; +import static org.easymock.EasyMock.expectLastCall; +import static org.easymock.EasyMock.replay; +import static org.easymock.EasyMock.verify; import org.jclouds.concurrent.config.ExecutorServiceModule; import org.jclouds.lifecycle.Closer; import org.testng.annotations.Test; diff --git a/core/src/test/java/org/jclouds/reflect/Reflection2OverriddenMethodTest.java b/core/src/test/java/org/jclouds/reflect/Reflection2OverriddenMethodTest.java index 3837c2efcf..941e9ed64d 100644 --- a/core/src/test/java/org/jclouds/reflect/Reflection2OverriddenMethodTest.java +++ b/core/src/test/java/org/jclouds/reflect/Reflection2OverriddenMethodTest.java @@ -99,7 +99,7 @@ public class Reflection2OverriddenMethodTest { return new SimpleForwardingLoadingCache, Set>>(originalMethodsForTypeToken) { @Override public Set> get(TypeToken key) throws ExecutionException { - return (key.equals(overriddenKey) ? value : super.get(key)); + return key.equals(overriddenKey) ? value : super.get(key); } }; } diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java index f9eb2a5eff..89fd77b157 100644 --- a/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java +++ b/core/src/test/java/org/jclouds/rest/annotationparsing/DelegateAnnotationExpectTest.java @@ -87,7 +87,7 @@ public class DelegateAnnotationExpectTest extends BaseRestClientExpectTest exists(@PathParam("disk") String diskName); + ListenableFuture exists(@PathParam("disk") String diskName); } public void testDelegatingCallTakesIntoConsiderationAndCalleeFormParam() { diff --git a/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java b/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java index ada3aecc87..d57abec5dc 100644 --- a/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java +++ b/core/src/test/java/org/jclouds/rest/annotationparsing/JAXBResponseParserAnnotationExpectTest.java @@ -69,36 +69,36 @@ public class JAXBResponseParserAnnotationExpectTest extends } public interface TestJAXBApi extends Closeable { - public TestJAXBDomain jaxbGetWithAnnotation(); + TestJAXBDomain jaxbGetWithAnnotation(); - public Object jaxbGetWithAnnotationAndCustomClass(); + Object jaxbGetWithAnnotationAndCustomClass(); - public TestJAXBDomain jaxbGetWithAcceptHeader(); + TestJAXBDomain jaxbGetWithAcceptHeader(); - public String jaxbGetWithTransformer(); + String jaxbGetWithTransformer(); } public interface TestJAXBAsyncApi extends Closeable { @GET @Path("/jaxb/annotation") @JAXBResponseParser - public ListenableFuture jaxbGetWithAnnotation(); + ListenableFuture jaxbGetWithAnnotation(); @GET @Path("/jaxb/custom") @JAXBResponseParser(TestJAXBDomain.class) - public ListenableFuture jaxbGetWithAnnotationAndCustomClass(); + ListenableFuture jaxbGetWithAnnotationAndCustomClass(); @GET @Path("/jaxb/header") @Consumes(MediaType.APPLICATION_XML) - public ListenableFuture jaxbGetWithAcceptHeader(); + ListenableFuture jaxbGetWithAcceptHeader(); @GET @Path("/jaxb/transformer") @JAXBResponseParser(TestJAXBDomain.class) @Transform(ToString.class) - public ListenableFuture jaxbGetWithTransformer(); + ListenableFuture jaxbGetWithTransformer(); } private static class ToString implements Function { 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 35fb50877d..3506572368 100644 --- a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java +++ b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java @@ -199,20 +199,20 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { URI getURI(); @Delegate - public Callee getCallee(); + Callee getCallee(); @Delegate - public Callee2 getCallee2(); + Callee2 getCallee2(); @Delegate - public Callee getCallee(@EndpointParam URI endpoint); + Callee getCallee(@EndpointParam URI endpoint); @Delegate - public Optional getOptionalCallee(@EndpointParam URI endpoint); + Optional getOptionalCallee(@EndpointParam URI endpoint); @Delegate @Path("/testing/testing/{wibble}") - public Callee getCalleeWithPath(@EndpointParam URI endpoint, @PathParam("wibble") String wibble); + Callee getCalleeWithPath(@EndpointParam URI endpoint, @PathParam("wibble") String wibble); } public interface Callee extends Closeable { @@ -229,20 +229,20 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { URI getURI(); @Delegate - public AsyncCallee getCallee(); + AsyncCallee getCallee(); @Delegate - public AsyncCallee2 getCallee2(); + AsyncCallee2 getCallee2(); @Delegate - public AsyncCallee getCallee(@EndpointParam URI endpoint); + AsyncCallee getCallee(@EndpointParam URI endpoint); @Delegate - public Optional getOptionalCallee(@EndpointParam URI endpoint); + Optional getOptionalCallee(@EndpointParam URI endpoint); @Delegate @Path("/testing/testing/{wibble}") - public AsyncCallee getCalleeWithPath(@EndpointParam URI endpoint, @PathParam("wibble") String wibble); + AsyncCallee getCalleeWithPath(@EndpointParam URI endpoint, @PathParam("wibble") String wibble); } public void testAsyncDelegateIsLazyLoadedAndRequestIncludesVersionAndPath() throws InterruptedException, @@ -620,21 +620,21 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { public interface TestPayloadParamVarargs { @POST - public void varargs(HttpRequestOptions... options); + void varargs(HttpRequestOptions... options); @POST - public void varargsWithReq(String required, HttpRequestOptions... options); + void varargsWithReq(String required, HttpRequestOptions... options); @POST - public void post(HttpRequestOptions options); + void post(HttpRequestOptions options); @POST @Produces(MediaType.APPLICATION_OCTET_STREAM) - public void post(); + void post(); @POST @Produces(MediaType.APPLICATION_OCTET_STREAM) - public void post(Payload payload); + void post(Payload payload); } public void testHttpRequestOptionsNoPayloadParam() throws SecurityException, NoSuchMethodException, IOException { @@ -737,7 +737,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { } public interface Parent { - public void foo(); + void foo(); } public class TestOverridden implements Parent { @@ -793,29 +793,29 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { void postNonnull(@BinderParam(BindToStringPayload.class) String content); @POST - public void postAsJson(@BinderParam(BindToJsonPayload.class) String content); + void postAsJson(@BinderParam(BindToJsonPayload.class) String content); @POST @Path("/{foo}") - public void postWithPath(@PathParam("foo") @PayloadParam("fooble") String path, MapBinder content); + void postWithPath(@PathParam("foo") @PayloadParam("fooble") String path, MapBinder content); @POST @Path("/{foo}") @MapBinder(BindToJsonPayload.class) - public void postWithMethodBinder(@PathParam("foo") @PayloadParam("fooble") String path); + void postWithMethodBinder(@PathParam("foo") @PayloadParam("fooble") String path); @POST @Path("/{foo}") @PayloadParams(keys = "rat", values = "atat") @MapBinder(BindToJsonPayload.class) - public void postWithMethodBinderAndDefaults(@PathParam("foo") @PayloadParam("fooble") String path); + void postWithMethodBinderAndDefaults(@PathParam("foo") @PayloadParam("fooble") String path); @POST @Path("/{foo}") @PayloadParams(keys = "rat", values = "atat") @org.jclouds.rest.annotations.Payload("name {fooble}") @Produces(MediaType.TEXT_PLAIN) - public void testPayload(@PathParam("foo") @PayloadParam("fooble") String path); + void testPayload(@PathParam("foo") @PayloadParam("fooble") String path); } public void testCreatePostRequest() throws SecurityException, NoSuchMethodException, IOException { @@ -1148,7 +1148,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @HttpMethod("ROWDY") - public @interface ROWDY { + @interface ROWDY { } @ROWDY @@ -1360,19 +1360,19 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { interface TestRequestFilter { @GET @RequestFilters(TestRequestFilter2.class) - public void get(); + void get(); @GET @OverrideRequestFilters @RequestFilters(TestRequestFilter2.class) - public void getOverride(); + void getOverride(); @OverrideRequestFilters @RequestFilters(TestRequestFilter2.class) - public void getOverride(HttpRequest request); + void getOverride(HttpRequest request); @POST - public void post(); + void post(); } @Test @@ -1468,7 +1468,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { @GET @Path("/{path1}/{path2}") - public void twoPaths(@PathParam("path1") String path, @PathParam("path2") String path2); + void twoPaths(@PathParam("path1") String path, @PathParam("path2") String path2); } @Test(enabled = false) @@ -2308,15 +2308,15 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { public interface TestPayload { @PUT - public void put(@BinderParam(BindToStringPayload.class) String content); + void put(@BinderParam(BindToStringPayload.class) String content); @PUT @Path("/{foo}") - public ListenableFuture putWithPath(@PathParam("foo") String path, + ListenableFuture putWithPath(@PathParam("foo") String path, @BinderParam(BindToStringPayload.class) String content); @PUT - public void twoEntities(@BinderParam(BindToStringPayload.class) String payload1, + void twoEntities(@BinderParam(BindToStringPayload.class) String payload1, @BinderParam(BindToStringPayload.class) String payload2); } diff --git a/core/src/test/java/org/jclouds/test/testng/UnitTestStatusListener.java b/core/src/test/java/org/jclouds/test/testng/UnitTestStatusListener.java index 9132b12778..bd59e30892 100644 --- a/core/src/test/java/org/jclouds/test/testng/UnitTestStatusListener.java +++ b/core/src/test/java/org/jclouds/test/testng/UnitTestStatusListener.java @@ -49,20 +49,20 @@ public class UnitTestStatusListener implements ITestListener { threadTestStart.set(System.currentTimeMillis()); } - synchronized public void onTestSuccess(ITestResult arg0) { + public synchronized void onTestSuccess(ITestResult arg0) { System.out.println(getThreadId() + " Test " + getTestDesc(arg0) + " succeeded: " + (System.currentTimeMillis() - threadTestStart.get()) + "ms"); succeded.incrementAndGet(); printStatus(); } - synchronized public void onTestFailure(ITestResult arg0) { + public synchronized void onTestFailure(ITestResult arg0) { System.out.println(getThreadId() + " Test " + getTestDesc(arg0) + " failed."); failed.incrementAndGet(); printStatus(); } - synchronized public void onTestSkipped(ITestResult arg0) { + public synchronized void onTestSkipped(ITestResult arg0) { System.out.println(getThreadId() + " Test " + getTestDesc(arg0) + " skipped."); skipped.incrementAndGet(); printStatus(); diff --git a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java index a92ad95dac..69d1f53ab2 100644 --- a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java +++ b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java @@ -56,7 +56,7 @@ public class ConvertToGaeRequestTest { ConvertToGaeRequest req; URI endPoint; - protected volatile static Crypto crypto; + protected static volatile Crypto crypto; static { try { crypto = new JCECrypto(); diff --git a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToJcloudsResponseTest.java b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToJcloudsResponseTest.java index a75af11173..e969002284 100644 --- a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToJcloudsResponseTest.java +++ b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToJcloudsResponseTest.java @@ -53,7 +53,7 @@ public class ConvertToJcloudsResponseTest { ConvertToJcloudsResponse req; URI endPoint; - protected volatile static Crypto crypto; + protected static volatile Crypto crypto; static { try { crypto = new JCECrypto(); diff --git a/loadbalancer/src/test/java/org/jclouds/loadbalancer/BaseLoadBalancerServiceLiveTest.java b/loadbalancer/src/test/java/org/jclouds/loadbalancer/BaseLoadBalancerServiceLiveTest.java index f74ec5998c..abf383f980 100644 --- a/loadbalancer/src/test/java/org/jclouds/loadbalancer/BaseLoadBalancerServiceLiveTest.java +++ b/loadbalancer/src/test/java/org/jclouds/loadbalancer/BaseLoadBalancerServiceLiveTest.java @@ -134,7 +134,7 @@ public abstract class BaseLoadBalancerServiceLiveTest extends BaseViewLiveTest resources/checkstyle.xml warning + true diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java index 68d9bf84d5..83bb96cf48 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceLiveTest.java @@ -165,7 +165,7 @@ public class AWSEC2ComputeServiceLiveTest extends EC2ComputeServiceLiveTest { .period(60) .statistic(Statistics.AVERAGE) .build()); - assert (datapoints.size() > 0) : instance; + assert datapoints.size() > 0 : instance; } finally { monitoringApi.close(); } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java index e22f6118de..3cbad70325 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java @@ -104,7 +104,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { // http://www.regular-expressions.info/lookaround.html .imageDescriptionMatches("^(?!.*(daily|testing)).*ubuntu-images.*$").osFamily(OsFamily.UBUNTU).build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assert template.getImage().getDescription().indexOf("test") == -1 : template; assert template.getImage().getDescription().indexOf("daily") == -1 : template; assertEquals(template.getImage().getVersion(), "20100224"); @@ -131,7 +131,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { // http://www.regular-expressions.info/lookaround.html .imageDescriptionMatches("^(?!.*(daily|testing)).*ubuntu-images.*$").osFamily(OsFamily.UBUNTU).build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assert template.getImage().getDescription().indexOf("test") == -1 : template; assert template.getImage().getDescription().indexOf("daily") == -1 : template; assertEquals(template.getImage().getOperatingSystem().getVersion(), "10.04"); @@ -150,7 +150,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { Template template = view.getComputeService().templateBuilder().imageId("us-east-1/ami-ccb35ea5") .hardwareId(InstanceType.M2_2XLARGE).locationId("us-east-1a").build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assertEquals(template.getImage().getOperatingSystem().getVersion(), "5.4"); assertEquals(template.getImage().getOperatingSystem().is64Bit(), true); assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS); @@ -166,7 +166,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { @Test public void testDefaultTemplateBuilder() throws IOException { Template defaultTemplate = view.getComputeService().templateBuilder().build(); - assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; + assert defaultTemplate.getImage().getProviderId().startsWith("ami-") : defaultTemplate; assertTrue(defaultTemplate.getImage().getOperatingSystem().getVersion().contains("pv-201"), "Default template version should include 'pv-201' but is " + defaultTemplate.getImage().getOperatingSystem().getVersion()); @@ -183,7 +183,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { Template defaultTemplate = view.getComputeService().templateBuilder().osFamily(OsFamily.AMZN_LINUX) .imageMatches(EC2ImagePredicates.rootDeviceType(RootDeviceType.INSTANCE_STORE)).build(); - assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; + assert defaultTemplate.getImage().getProviderId().startsWith("ami-") : defaultTemplate; assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "pv-2013.09.rc-1"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); @@ -197,7 +197,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { public void testFastestTemplateBuilder() throws IOException { Template fastestTemplate = view.getComputeService().templateBuilder().fastest().osFamily(OsFamily.AMZN_LINUX) .build(); - assert (fastestTemplate.getImage().getProviderId().startsWith("ami-")) : fastestTemplate; + assert fastestTemplate.getImage().getProviderId().startsWith("ami-") : fastestTemplate; assertEquals(fastestTemplate.getHardware().getProviderId(), InstanceType.CC2_8XLARGE); assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.2"); assertEquals(fastestTemplate.getImage().getOperatingSystem().is64Bit(), true); @@ -214,7 +214,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { Template microTemplate = view.getComputeService().templateBuilder().hardwareId(InstanceType.T1_MICRO) .osFamily(OsFamily.UBUNTU).osVersionMatches("10.10").os64Bit(true).build(); - assert (microTemplate.getImage().getProviderId().startsWith("ami-")) : microTemplate; + assert microTemplate.getImage().getProviderId().startsWith("ami-") : microTemplate; assertEquals(microTemplate.getImage().getOperatingSystem().getVersion(), "10.10"); assertEquals(microTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(microTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU); @@ -238,7 +238,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { assertEquals(context.getComputeService().listImages().size(), 0); Template template = context.getComputeService().templateBuilder().imageId("us-east-1/ami-ccb35ea5").build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assertEquals(template.getImage().getOperatingSystem().getVersion(), "5.4"); assertEquals(template.getImage().getOperatingSystem().is64Bit(), true); assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS); @@ -271,7 +271,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { assertEquals(context.getComputeService().listImages().size(), 0); Template template = context.getComputeService().templateBuilder().imageId("us-east-1/ami-ccb35ea5").build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assertEquals(template.getImage().getOperatingSystem().getVersion(), "5.4"); assertEquals(template.getImage().getOperatingSystem().is64Bit(), true); assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.CENTOS); @@ -316,7 +316,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { assert context.getComputeService().listImages().size() < this.view.getComputeService().listImages().size(); Template template = context.getComputeService().templateBuilder().imageId("eu-west-1/ami-a33b06d7").build(); - assert (template.getImage().getProviderId().startsWith("ami-")) : template; + assert template.getImage().getProviderId().startsWith("ami-") : template; assertEquals(template.getImage().getOperatingSystem().getVersion(), "2011.09.2"); assertEquals(template.getImage().getOperatingSystem().is64Bit(), true); assertEquals(template.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); @@ -349,7 +349,7 @@ public class AWSEC2TemplateBuilderLiveTest extends EC2TemplateBuilderLiveTest { String imageId = "us-east-1/ami-44d02f2d"; Template defaultTemplate = view.getComputeService().templateBuilder().imageId(imageId) .imageMatches(EC2ImagePredicates.rootDeviceType(RootDeviceType.INSTANCE_STORE)).build(); - assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; + assert defaultTemplate.getImage().getProviderId().startsWith("ami-") : defaultTemplate; assertEquals(defaultTemplate.getImage().getId(), imageId); } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSAMIApiLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSAMIApiLiveTest.java index 747e2248ba..e09c4ac5bc 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSAMIApiLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSAMIApiLiveTest.java @@ -53,6 +53,6 @@ public class AWSAMIApiLiveTest extends AMIApiLiveTest { .put("root-device-type", "ebs")// .build()).ownedBy("137112412989", "099720109477")); assertNotNull(ccResults); - assert (ccResults.size() >= 34) : ccResults; + assert ccResults.size() >= 34 : ccResults; } } diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/PlacementGroupApiExpectTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/PlacementGroupApiExpectTest.java index 32502b7c9c..c48e6a87c5 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/PlacementGroupApiExpectTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/PlacementGroupApiExpectTest.java @@ -75,4 +75,4 @@ public class PlacementGroupApiExpectTest extends BaseAWSEC2ComputeServiceExpectT .build()), ImmutableSet.of()); } -} \ No newline at end of file +} diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/SpotInstanceApiExpectTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/SpotInstanceApiExpectTest.java index 08c852bcfc..f15c7c71a0 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/SpotInstanceApiExpectTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/SpotInstanceApiExpectTest.java @@ -75,4 +75,4 @@ public class SpotInstanceApiExpectTest extends BaseAWSEC2ComputeServiceExpectTes .build()), ImmutableSet.of()); } -} \ No newline at end of file +} diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/strategy/internal/MpuGraphData.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/strategy/internal/MpuGraphData.java index 2fe86fe907..db7357d82e 100644 --- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/strategy/internal/MpuGraphData.java +++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/strategy/internal/MpuGraphData.java @@ -31,7 +31,8 @@ public class MpuGraphData { } private static void foreach(long from, long to1, long to2, long to3, MultipartUploadSlicingAlgorithm algorithm) { - long i = 0L, step = 1L; + long i = 0L; + long step = 1L; System.out.println("=== {" + from + "," + to1 + "} ==="); for (; i < to1 - from; step += i, i += step) { calculate(i + from, algorithm); diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java index 231b3f58f3..059a2827d5 100644 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java @@ -324,7 +324,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest { GetOptions.Builder.ifETagDoesntMatch(newEtag)); } catch (Exception e) { HttpResponseException httpEx = Throwables2.getFirstThrowableOfType(e, HttpResponseException.class); - assert (httpEx != null) : "expected http exception, not " + e; + assert httpEx != null : "expected http exception, not " + e; assertEquals(httpEx.getResponse().getStatusCode(), 304); } diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/BlobBlocksResultsHandlerTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/BlobBlocksResultsHandlerTest.java index 4d5efdc16a..d2efefe1e6 100644 --- a/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/BlobBlocksResultsHandlerTest.java +++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/xml/BlobBlocksResultsHandlerTest.java @@ -26,9 +26,10 @@ import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import java.io.InputStream; -import java.util.LinkedList; import java.util.List; +import com.google.common.collect.Lists; + /** * Test XML Parsing of the Blob Block List */ @@ -44,7 +45,7 @@ public class BlobBlocksResultsHandlerTest extends BaseHandlerTest { public void testGetResult() throws Exception { InputStream is = getClass().getResourceAsStream("/test_list_blob_blocks.xml"); - List blocks = new LinkedList(); + List blocks = Lists.newLinkedList(); blocks.add(new BlobBlockPropertiesImpl("blockIdA", 1234, true)); blocks.add(new BlobBlockPropertiesImpl("blockIdB", 4321, true)); blocks.add(new BlobBlockPropertiesImpl("blockIdC", 5678, false)); diff --git a/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java b/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java index 6111c23dbe..18c9f6fddd 100644 --- a/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java +++ b/providers/gogrid/src/test/java/org/jclouds/gogrid/GoGridLiveTestDisabled.java @@ -145,13 +145,13 @@ public class GoGridLiveTestDisabled extends BaseApiLiveTest { // get server by name Set response = api.getServerServices().getServersByName(nameOfServer); - assert (response.size() == 1); + assert response.size() == 1; // restart the server api.getServerServices().power(nameOfServer, PowerCommand.RESTART); Set jobs = api.getJobServices().getJobsForObjectName(nameOfServer); - assert ("RestartVirtualServer".equals(Iterables.getLast(jobs).getCommand().getName())); + assert "RestartVirtualServer".equals(Iterables.getLast(jobs).getCommand().getName()); assert serverLatestJobCompleted.apply(createdServer); @@ -162,7 +162,7 @@ public class GoGridLiveTestDisabled extends BaseApiLiveTest { api.getServerServices().deleteByName(nameOfServer); jobs = api.getJobServices().getJobsForObjectName(nameOfServer); - assert ("DeleteVirtualServer".equals(Iterables.getLast(jobs).getCommand().getName())); + assert "DeleteVirtualServer".equals(Iterables.getLast(jobs).getCommand().getName()); assert serverLatestJobCompleted.apply(createdServer); @@ -249,7 +249,7 @@ public class GoGridLiveTestDisabled extends BaseApiLiveTest { // get load balancer by name Set response = api.getLoadBalancerServices().getLoadBalancersByName(nameOfLoadBalancer); - assert (response.size() == 1); + assert response.size() == 1; createdLoadBalancer = Iterables.getOnlyElement(response); assertNotNull(createdLoadBalancer.getRealIpList()); assertEquals(createdLoadBalancer.getRealIpList().size(), 2); @@ -270,7 +270,7 @@ public class GoGridLiveTestDisabled extends BaseApiLiveTest { api.getLoadBalancerServices().deleteByName(nameOfLoadBalancer); Set jobs = api.getJobServices().getJobsForObjectName(nameOfLoadBalancer); - assert ("DeleteLoadBalancer".equals(Iterables.getLast(jobs).getCommand().getName())); + assert "DeleteLoadBalancer".equals(Iterables.getLast(jobs).getCommand().getName()); assert loadBalancerLatestJobCompleted.apply(createdLoadBalancer); @@ -325,7 +325,7 @@ public class GoGridLiveTestDisabled extends BaseApiLiveTest { // get server by name Set response = api.getServerServices().getServersByName(nameOfServer); - assert (response.size() == 1); + assert response.size() == 1; createdServer = Iterables.getOnlyElement(response); Map credsMap = api.getServerServices().getServerCredentialsList(); diff --git a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/ReplaceShadowPasswordEntryTest.java b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/ReplaceShadowPasswordEntryTest.java index 8e3ac86d03..022e96dfb7 100644 --- a/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/ReplaceShadowPasswordEntryTest.java +++ b/scriptbuilder/src/test/java/org/jclouds/scriptbuilder/statements/login/ReplaceShadowPasswordEntryTest.java @@ -16,7 +16,7 @@ */ package org.jclouds.scriptbuilder.statements.login; -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; import org.jclouds.scriptbuilder.domain.OsFamily; import org.testng.annotations.Test;