mirror of https://github.com/apache/jclouds.git
Avoid lower-case l literal suffix
Readers can confuse this with 1. Found via error-prone. Fixed via: find -name \*.java | xargs sed -i 's/\( [0-9][0-9]*\)l/\1L/g' find -name \*.java | xargs sed -i 's/\(([0-9][0-9]*\)l/\1L/g'
This commit is contained in:
parent
8117574c83
commit
3c9f66b8e9
|
@ -213,7 +213,7 @@ public class AtmosClientLiveTest extends BaseBlobStoreIntegrationTest {
|
|||
AtmosObject object = getApi().newObject();
|
||||
object.getContentMetadata().setName(name);
|
||||
object.setPayload(Payloads.newPayload(data));
|
||||
object.getContentMetadata().setContentLength(16l);
|
||||
object.getContentMetadata().setContentLength(16L);
|
||||
object.getContentMetadata().setContentMD5(hashCode.asBytes());
|
||||
object.getContentMetadata().setContentType("text/plain");
|
||||
object.getUserMetadata().getMetadata().put("Metadata", metadataValue);
|
||||
|
|
|
@ -88,7 +88,7 @@ public class AtmosBlobRequestSignerTest extends BaseRestAnnotationProcessingTest
|
|||
Blob blob = blobFactory.create(null);
|
||||
blob.getMetadata().setName("name");
|
||||
blob.setPayload("");
|
||||
blob.getPayload().getContentMetadata().setContentLength(2l);
|
||||
blob.getPayload().getContentMetadata().setContentLength(2L);
|
||||
blob.getPayload().getContentMetadata().setContentMD5(hashCode.asBytes());
|
||||
blob.getPayload().getContentMetadata().setContentType("text/plain");
|
||||
blob.getPayload().getContentMetadata().setExpires(new Date(1000));
|
||||
|
|
|
@ -120,7 +120,7 @@ public class SignRequestTest {
|
|||
.endpoint("http://localhost/rest/objects")
|
||||
.headers(headers).build();
|
||||
request.setPayload("");
|
||||
request.getPayload().getContentMetadata().setContentLength(4286l);
|
||||
request.getPayload().getContentMetadata().setContentLength(4286L);
|
||||
request.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
return request;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ParseSystemMetadataFromHeadersTest {
|
|||
dateService.iso8601SecondsDateParse("2009-10-19T04:37:00Z"), "rootr",
|
||||
dateService.iso8601SecondsDateParse("2009-10-12T16:09:42Z"),
|
||||
dateService.iso8601SecondsDateParse("2009-10-19T04:37:00Z"), 1,
|
||||
"4980cdb2b010109b04a44f7bb83f5f04ad354c638ae5", "e913e09366364e9ba384b8fead643d43", "default", 4096l,
|
||||
"4980cdb2b010109b04a44f7bb83f5f04ad354c638ae5", "e913e09366364e9ba384b8fead643d43", "default", 4096L,
|
||||
FileType.DIRECTORY, "root"
|
||||
|
||||
);
|
||||
|
|
|
@ -31,9 +31,9 @@ import com.google.common.collect.ImmutableList;
|
|||
*/
|
||||
@Test(groups = { "unit" }, sequential = true)
|
||||
public class ChefUtilsTest {
|
||||
public static long millis = 1280251180727l;
|
||||
public static long millis = 1280251180727L;
|
||||
public static String millisString = "1280251180727";
|
||||
public static Date now = new Date(1280251180727l);
|
||||
public static Date now = new Date(1280251180727L);
|
||||
|
||||
public void testToOhaiTime() {
|
||||
assertEquals(ChefUtils.toOhaiTime(millis).toString(), millisString);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class JMXTest {
|
|||
|
||||
final RuntimeMXBean runtime = createMock(RuntimeMXBean.class);
|
||||
|
||||
expect(runtime.getUptime()).andReturn(69876000l);
|
||||
expect(runtime.getUptime()).andReturn(69876000L);
|
||||
|
||||
replay(runtime);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class OhaiModuleTest {
|
|||
}, new ChefParserModule(), new GsonModule(), new OhaiModule() {
|
||||
@Override
|
||||
protected Long millis() {
|
||||
return 127999291932529l;
|
||||
return 127999291932529L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -100,7 +100,7 @@ public class OhaiModuleTest {
|
|||
}, new ChefParserModule(), new GsonModule(), new OhaiModule() {
|
||||
@Override
|
||||
protected Long millis() {
|
||||
return 1279992919l;
|
||||
return 1279992919L;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,22 +76,22 @@ public class AccountApiExpectTest extends BaseCloudStackExpectTest<AccountApi> {
|
|||
.domain("AA000062-jclouds-dev")
|
||||
.receivedBytes(318900216)
|
||||
.sentBytes(23189677)
|
||||
.VMLimit(15l)
|
||||
.VMLimit(15L)
|
||||
.VMs(1)
|
||||
.IPsAvailable(14l)
|
||||
.IPLimit(15l)
|
||||
.IPsAvailable(14L)
|
||||
.IPLimit(15L)
|
||||
.IPs(0)
|
||||
.IPsAvailable(15l)
|
||||
.volumeLimit(90l)
|
||||
.IPsAvailable(15L)
|
||||
.volumeLimit(90L)
|
||||
.volumes(2)
|
||||
.volumesAvailable(88l)
|
||||
.snapshotLimit(250l)
|
||||
.volumesAvailable(88L)
|
||||
.snapshotLimit(250L)
|
||||
.snapshots(0)
|
||||
.snapshotsAvailable(250l)
|
||||
.templateLimit(15l)
|
||||
.snapshotsAvailable(250L)
|
||||
.templateLimit(15L)
|
||||
.templates(0)
|
||||
.templatesAvailable(15l)
|
||||
.VMsAvailable(14l)
|
||||
.templatesAvailable(15L)
|
||||
.VMsAvailable(14L)
|
||||
.VMsStopped(0)
|
||||
.VMsRunning(1)
|
||||
.state(Account.State.ENABLED)
|
||||
|
|
|
@ -42,7 +42,7 @@ public class AsyncJobApiTest extends BaseCloudStackApiTest<AsyncJobApi> {
|
|||
|
||||
public void testGetAsyncJob() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(AsyncJobApi.class, "getAsyncJob", String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11l));
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11L));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=queryAsyncJobResult&jobid=11 HTTP/1.1");
|
||||
|
|
|
@ -44,7 +44,7 @@ public class GuestOSApiTest extends BaseCloudStackApiTest<GuestOSApi> {
|
|||
|
||||
public void testGetOSCategory() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(GuestOSApi.class, "getOSCategory", String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11l));
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11L));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=listOsCategories&listAll=true&id=11 HTTP/1.1");
|
||||
|
@ -78,7 +78,7 @@ public class GuestOSApiTest extends BaseCloudStackApiTest<GuestOSApi> {
|
|||
|
||||
public void testGetOSType() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(GuestOSApi.class, "getOSType", String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11l));
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11L));
|
||||
|
||||
assertRequestLineEquals(httpRequest,
|
||||
"GET http://localhost:8080/client/api?response=json&command=listOsTypes&listAll=true&id=11 HTTP/1.1");
|
||||
|
|
|
@ -82,7 +82,7 @@ public class VolumeApiTest extends BaseCloudStackApiTest<VolumeApi> {
|
|||
public void testCreateVolumeWithSnapshot() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(VolumeApi.class, "createVolumeFromSnapshotInZone", String.class, String.class,
|
||||
String.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("jclouds-volume", 999L, 111l));
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("jclouds-volume", 999L, 111L));
|
||||
|
||||
assertRequestLineEquals(httpRequest, createVolumeFromSnapshot.getRequestLine());
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n");
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DeleteIPForwardingRuleResponseTest extends BaseItemParserTest<Long>
|
|||
@Override
|
||||
@SelectJson("jobid")
|
||||
public Long expected() {
|
||||
return 50005l;
|
||||
return 50005L;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DeleteNetworkResponseTest extends BaseItemParserTest<Long> {
|
|||
@Override
|
||||
@SelectJson("jobid")
|
||||
public Long expected() {
|
||||
return 45612l;
|
||||
return 45612L;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DisableStaticNATResponseTest extends BaseItemParserTest<Long> {
|
|||
@Override
|
||||
@SelectJson("jobid")
|
||||
public Long expected() {
|
||||
return 50006l;
|
||||
return 50006L;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,22 +66,22 @@ public class ListAccountsResponseTest extends BaseSetParserTest<Account> {
|
|||
.domain("AA000062-jclouds-dev")
|
||||
.receivedBytes(318900216)
|
||||
.sentBytes(23189677)
|
||||
.VMLimit(15l)
|
||||
.VMLimit(15L)
|
||||
.VMs(1)
|
||||
.IPsAvailable(14l)
|
||||
.IPLimit(15l)
|
||||
.IPsAvailable(14L)
|
||||
.IPLimit(15L)
|
||||
.IPs(0)
|
||||
.IPsAvailable(15l)
|
||||
.volumeLimit(90l)
|
||||
.IPsAvailable(15L)
|
||||
.volumeLimit(90L)
|
||||
.volumes(2)
|
||||
.volumesAvailable(88l)
|
||||
.snapshotLimit(250l)
|
||||
.volumesAvailable(88L)
|
||||
.snapshotLimit(250L)
|
||||
.snapshots(0)
|
||||
.snapshotsAvailable(250l)
|
||||
.templateLimit(15l)
|
||||
.snapshotsAvailable(250L)
|
||||
.templateLimit(15L)
|
||||
.templates(0)
|
||||
.templatesAvailable(15l)
|
||||
.VMsAvailable(14l)
|
||||
.templatesAvailable(15L)
|
||||
.VMsAvailable(14L)
|
||||
.VMsStopped(0)
|
||||
.VMsRunning(1)
|
||||
.state(State.ENABLED)
|
||||
|
|
|
@ -54,13 +54,13 @@ public class ListTemplatesResponseTest extends BaseSetParserTest<Template> {
|
|||
.created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-03-20T19:17:48-0700"))
|
||||
.ready(true).passwordEnabled(false).format(Format.QCOW2).featured(true).crossZones(true)
|
||||
.OSTypeId("112").OSType("CentOS 5.5 (64-bit)").account("system").zoneId("2").zone("Chicago")
|
||||
.size(8589934592l).type(Type.BUILTIN).hypervisor("KVM").domain("ROOT").domainId("1").extractable(true)
|
||||
.size(8589934592L).type(Type.BUILTIN).hypervisor("KVM").domain("ROOT").domainId("1").extractable(true)
|
||||
.build(),
|
||||
Template.builder().id("203").name("Windows 7 KVM").displayText("Windows 7 KVM").isPublic(true)
|
||||
.created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-03-20T22:02:18-0700"))
|
||||
.ready(true).passwordEnabled(false).format(Format.QCOW2).featured(true).crossZones(false)
|
||||
.OSTypeId("48").OSType("Windows 7 (32-bit)").account("admin").zoneId("2").zone("Chicago")
|
||||
.size(17179869184l).type(Type.USER).hypervisor("KVM").domain("ROOT").domainId("1").extractable(false)
|
||||
.size(17179869184L).type(Type.USER).hypervisor("KVM").domain("ROOT").domainId("1").extractable(false)
|
||||
.build(),
|
||||
Template.builder().id("7").name("CentOS 5.3(64-bit) no GUI (vSphere)")
|
||||
.displayText("CentOS 5.3(64-bit) no GUI (vSphere)").isPublic(true)
|
||||
|
@ -72,7 +72,7 @@ public class ListTemplatesResponseTest extends BaseSetParserTest<Template> {
|
|||
.created(new SimpleDateFormatDateService().iso8601SecondsDateParse("2011-04-21T09:43:25-0700"))
|
||||
.ready(true).passwordEnabled(false).format(Format.QCOW2).featured(false).crossZones(false)
|
||||
.OSTypeId("14").OSType("CentOS 5.4 (64-bit)").account("rs3").zoneId("2").zone("Chicago")
|
||||
.size(10737418240l).type(Type.USER).hypervisor("KVM").domain("ROOT").domainId("1").extractable(false)
|
||||
.size(10737418240L).type(Type.USER).hypervisor("KVM").domain("ROOT").domainId("1").extractable(false)
|
||||
.tags(ImmutableSet.of(Tag.builder().account("rs3").domain("ROOT").domainId("1").key("some-tag")
|
||||
.resourceId("241").resourceType(Tag.ResourceType.TEMPLATE).value("some-value").build()))
|
||||
.build());
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ListUsageRecordsResponseTest extends BaseSetParserTest<UsageRecord>
|
|||
.accountName("admin").accountId("2").domainId("1").zoneId("1")
|
||||
.description("Template Id:203 Size:3117171712")
|
||||
.usage("24 Hrs").usageType(UsageRecord.UsageType.TEMPLATE).rawUsageHours(24)
|
||||
.size(3117171712l).templateId("0").id("203").project("project1").projectId("1")
|
||||
.size(3117171712L).templateId("0").id("203").project("project1").projectId("1")
|
||||
.startDate(start).endDate(end).build());
|
||||
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class MetricDataBinderTest {
|
|||
.dimension(new Dimension("TestDimension", "FAKE"))
|
||||
.dimension(new Dimension("TestDimension2", "FAKE2"))
|
||||
.unit(Unit.COUNT)
|
||||
.timestamp(new Date(10000000l))
|
||||
.timestamp(new Date(10000000L))
|
||||
.value(5.0)
|
||||
.build();
|
||||
|
||||
|
@ -107,14 +107,14 @@ public class MetricDataBinderTest {
|
|||
.dimension(new Dimension("TestDimension", "FAKE"))
|
||||
.dimension(new Dimension("TestDimension2", "FAKE2"))
|
||||
.unit(Unit.COUNT)
|
||||
.timestamp(new Date(10000000l))
|
||||
.timestamp(new Date(10000000L))
|
||||
.value(2.0)
|
||||
.build();
|
||||
MetricDatum metricDatum2 = MetricDatum.builder()
|
||||
.metricName("TestMetricName")
|
||||
.dimension(new Dimension("TestDimension", "FAKE"))
|
||||
.unit(Unit.COUNT)
|
||||
.timestamp(new Date(10000000l))
|
||||
.timestamp(new Date(10000000L))
|
||||
.value(5.0)
|
||||
.build();
|
||||
|
||||
|
|
|
@ -156,11 +156,11 @@ public class MetricApiExpectTest extends BaseCloudWatchApiExpectTest {
|
|||
}
|
||||
|
||||
GetMetricStatistics stats = GetMetricStatistics.builder()
|
||||
.endTime(new Date(10000000l))
|
||||
.endTime(new Date(10000000L))
|
||||
.metricName(EC2Constants.MetricName.CPU_UTILIZATION)
|
||||
.namespace(Namespaces.EC2)
|
||||
.period(60)
|
||||
.startTime(new Date(10000000l))
|
||||
.startTime(new Date(10000000L))
|
||||
.statistic(Statistics.MAXIMUM)
|
||||
.statistic(Statistics.MINIMUM)
|
||||
.unit(Unit.PERCENT).build();
|
||||
|
|
|
@ -53,8 +53,8 @@ public class ImageToImageTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.<String> of() // repoTags
|
||||
);
|
||||
|
||||
|
@ -74,8 +74,8 @@ public class ImageToImageTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.of("registry.company.example:8888/a/b/c/d:latest") // repoTags
|
||||
);
|
||||
|
||||
|
@ -101,8 +101,8 @@ public class ImageToImageTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.of("repoTag1:version") // repoTags
|
||||
);
|
||||
function = new ImageToImage();
|
||||
|
|
|
@ -46,8 +46,8 @@ public class PredicateLocateImageByNameTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.<String> of("kwart/alpine-ext:3.3-ssh", "kwart/alpine-ext:latest", "my-tag:latestdock") // repoTags
|
||||
);
|
||||
|
||||
|
@ -59,8 +59,8 @@ public class PredicateLocateImageByNameTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.<String> of() // repoTags
|
||||
);
|
||||
|
||||
|
@ -72,8 +72,8 @@ public class PredicateLocateImageByNameTest {
|
|||
"1.3.1", // dockerVersion
|
||||
"x86_64", // architecture
|
||||
"os", // os
|
||||
0l, // size
|
||||
0l, // virtualSize
|
||||
0L, // size
|
||||
0L, // virtualSize
|
||||
ImmutableList.<String> of("docker.io/kwart/alpine-ext:3.3-ssh", "docker.io/kwart/alpine-ext:latest") // repoTags
|
||||
);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ContainerApiMockTest extends BaseDockerMockTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test(timeOut = 10000l)
|
||||
@Test(timeOut = 10000L)
|
||||
public void testListAllContainers() throws Exception {
|
||||
MockWebServer server = mockWebServer(new MockResponse().setBody(payloadFromResource("/containers.json")));
|
||||
ContainerApi api = api(DockerApi.class, server.getUrl("/").toString()).getContainerApi();
|
||||
|
|
|
@ -187,7 +187,7 @@ public class EC2ComputeServiceDependenciesModule extends AbstractModule {
|
|||
@Named("SECURITY")
|
||||
protected final Predicate<RegionAndName> securityGroupEventualConsistencyDelay(SecurityGroupPresent in,
|
||||
@Named(PROPERTY_EC2_TIMEOUT_SECURITYGROUP_PRESENT) long msDelay) {
|
||||
return retry(in, msDelay, 100l, MILLISECONDS);
|
||||
return retry(in, msDelay, 100L, MILLISECONDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BindBlockDeviceMappingToIndexedFormParamsTest {
|
|||
public void testMappingOrdersLexicographically() {
|
||||
Map<String, BlockDevice> mapping = Maps.newLinkedHashMap();
|
||||
mapping.put("apple", new BlockDevice("appleId", true));
|
||||
Date date = new Date(999999l);
|
||||
Date date = new Date(999999L);
|
||||
mapping.put("cranberry", new BlockDevice("cranberry", Status.ATTACHED, date, false));
|
||||
|
||||
HttpRequest request = HttpRequest.builder().method("POST").endpoint("http://localhost")
|
||||
|
|
|
@ -104,7 +104,7 @@ public class ElasticStackComputeServiceAdapter implements
|
|||
|
||||
@Override
|
||||
public NodeAndInitialCredentials<ServerInfo> createNodeWithGroupEncodedIntoName(String tag, String name, Template template) {
|
||||
long bootSize = (long) (template.getHardware().getVolumes().get(0).getSize() * 1024 * 1024 * 1024l);
|
||||
long bootSize = (long) (template.getHardware().getVolumes().get(0).getSize() * 1024 * 1024 * 1024L);
|
||||
|
||||
logger.debug(">> creating boot drive bytes(%d)", bootSize);
|
||||
DriveInfo drive = client
|
||||
|
|
|
@ -69,7 +69,7 @@ public class ElasticStackApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
provider = "elasticstack";
|
||||
}
|
||||
|
||||
protected long driveSize = 1 * 1024 * 1024 * 1024l;
|
||||
protected long driveSize = 1 * 1024 * 1024 * 1024L;
|
||||
protected int maxDriveImageTime = 360;
|
||||
protected String vncPassword = "Il0veVNC";
|
||||
protected ElasticStackApi client;
|
||||
|
@ -167,10 +167,10 @@ public class ElasticStackApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
assertEquals(drive.getSize(), driveSize);
|
||||
assertEquals(drive.getStatus(), DriveStatus.ACTIVE);
|
||||
// for some reason, these occasionally return as 4096,1
|
||||
// assertEquals(info.getReadBytes(), 0l);
|
||||
// assertEquals(info.getWriteBytes(), 0l);
|
||||
// assertEquals(info.getReadRequests(), 0l);
|
||||
// assertEquals(info.getWriteRequests(), 0l);
|
||||
// assertEquals(info.getReadBytes(), 0L);
|
||||
// assertEquals(info.getWriteBytes(), 0L);
|
||||
// assertEquals(info.getReadRequests(), 0L);
|
||||
// assertEquals(info.getWriteRequests(), 0L);
|
||||
assertEquals(drive.getEncryptionCipher(), "aes-xts-plain");
|
||||
}
|
||||
|
||||
|
@ -326,7 +326,7 @@ public class ElasticStackApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
private DriveInfo drive3;
|
||||
|
||||
public void testWeCanReadAndWriteToDrive() throws IOException {
|
||||
drive2 = client.createDrive(new CreateDriveRequest.Builder().name(prefix + "2").size(1 * 1024 * 1024l).build());
|
||||
drive2 = client.createDrive(new CreateDriveRequest.Builder().name(prefix + "2").size(1 * 1024 * 1024L).build());
|
||||
client.writeDrive(drive2.getUuid(), Payloads.newStringPayload("foo"));
|
||||
assertEquals(Strings2.toStringAndClose(client.readDrive(drive2.getUuid(), 0, 3).openStream()), "foo");
|
||||
}
|
||||
|
@ -335,7 +335,7 @@ public class ElasticStackApiLiveTest extends BaseComputeServiceContextLiveTest {
|
|||
public void testWeCopyADriveContentsViaGzip() throws IOException {
|
||||
try {
|
||||
drive3 = client
|
||||
.createDrive(new CreateDriveRequest.Builder().name(prefix + "3").size(1 * 1024 * 1024l).build());
|
||||
.createDrive(new CreateDriveRequest.Builder().name(prefix + "3").size(1 * 1024 * 1024L).build());
|
||||
System.err.println("before image; drive 2" + client.getDriveInfo(drive2.getUuid()));
|
||||
System.err.println("before image; drive 3" + client.getDriveInfo(drive3.getUuid()));
|
||||
client.imageDrive(drive2.getUuid(), drive3.getUuid());
|
||||
|
|
|
@ -312,7 +312,7 @@ public class ElasticStackApiTest extends BaseRestAnnotationProcessingTest<Elasti
|
|||
public void testCreateDrive() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(ElasticStackApi.class, "createDrive", Drive.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(
|
||||
new CreateDriveRequest.Builder().name("foo").size(10000l).build()));
|
||||
new CreateDriveRequest.Builder().name("foo").size(10000L).build()));
|
||||
|
||||
assertRequestLineEquals(httpRequest, "POST https://api-lon-p.elastichosts.com/drives/create HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||
|
@ -329,7 +329,7 @@ public class ElasticStackApiTest extends BaseRestAnnotationProcessingTest<Elasti
|
|||
public void testSetDriveData() throws SecurityException, NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(ElasticStackApi.class, "setDriveData", String.class, DriveData.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("100",
|
||||
new DriveData.Builder().name("foo").size(10000l).tags(ImmutableList.of("production", "candy")).build()));
|
||||
new DriveData.Builder().name("foo").size(10000L).tags(ImmutableList.of("production", "candy")).build()));
|
||||
|
||||
assertRequestLineEquals(httpRequest, "POST https://api-lon-p.elastichosts.com/drives/100/set HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
|
||||
|
|
|
@ -56,7 +56,7 @@ public class BindDriveDataToPlainTextStringTest {
|
|||
|
||||
public void testSimple() {
|
||||
HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
|
||||
FN.bindToRequest(request, new DriveData.Builder().name("foo").size(100l).build());
|
||||
FN.bindToRequest(request, new DriveData.Builder().name("foo").size(100L).build());
|
||||
assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
|
||||
assertEquals(request.getPayload().getRawContent(), "name foo\nsize 100");
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class BindDriveDataToPlainTextStringTest {
|
|||
public void testComplete() throws IOException {
|
||||
DriveData input = new DriveData.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.claimType(ClaimType.SHARED)//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.tags(ImmutableSet.of("tag1", "tag2")).userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz"))//
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BindDriveToPlainTextStringTest {
|
|||
|
||||
public void testSimple() {
|
||||
HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
|
||||
FN.bindToRequest(request, new CreateDriveRequest.Builder().name("foo").size(100l).build());
|
||||
FN.bindToRequest(request, new CreateDriveRequest.Builder().name("foo").size(100L).build());
|
||||
assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
|
||||
assertEquals(request.getPayload().getRawContent(), "name foo\nsize 100");
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class BindDriveToPlainTextStringTest {
|
|||
CreateDriveRequest input = new CreateDriveRequest.Builder()
|
||||
.name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.claimType(ClaimType.SHARED)//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.tags(ImmutableSet.of("tag1", "tag2")).userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz"))//
|
||||
|
|
|
@ -33,14 +33,14 @@ public class BaseDriveToMapTest {
|
|||
private static final BaseDriveToMap BASEDRIVE_TO_MAP = new BaseDriveToMap();
|
||||
|
||||
public void testBasics() {
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new Drive.Builder().name("foo").size(100l).build()),
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new Drive.Builder().name("foo").size(100L).build()),
|
||||
ImmutableMap.of("name", "foo", "size", "100"));
|
||||
}
|
||||
|
||||
public void testComplete() throws IOException {
|
||||
Drive one = new Drive.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.claimType(ClaimType.SHARED)//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.tags(ImmutableSet.of("tag1", "tag2")).userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz"))//
|
||||
|
|
|
@ -35,7 +35,7 @@ public class CreateDriveRequestToMapTest {
|
|||
CreateDriveRequestToMap.class);
|
||||
|
||||
public void testBasics() {
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new CreateDriveRequest.Builder().name("foo").size(100l).build()),
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new CreateDriveRequest.Builder().name("foo").size(100L).build()),
|
||||
ImmutableMap.of("name", "foo", "size", "100"));
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class CreateDriveRequestToMapTest {
|
|||
CreateDriveRequest one = new CreateDriveRequest.Builder()
|
||||
.name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.claimType(ClaimType.SHARED)//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.tags(ImmutableSet.of("tag1", "tag2")).userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz"))//
|
||||
|
|
|
@ -34,14 +34,14 @@ public class DriveDataToMapTest {
|
|||
private static final DriveDataToMap BASEDRIVE_TO_MAP = Guice.createInjector().getInstance(DriveDataToMap.class);
|
||||
|
||||
public void testBasics() {
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new DriveData.Builder().name("foo").size(100l).build()),
|
||||
assertEquals(BASEDRIVE_TO_MAP.apply(new DriveData.Builder().name("foo").size(100L).build()),
|
||||
ImmutableMap.of("name", "foo", "size", "100"));
|
||||
}
|
||||
|
||||
public void testComplete() throws IOException {
|
||||
DriveData one = new DriveData.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.claimType(ClaimType.SHARED)//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.tags(ImmutableSet.of("tag1", "tag2")).userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz"))//
|
||||
|
|
|
@ -37,8 +37,8 @@ public class MapToDriveInfoTest {
|
|||
.status(DriveStatus.ACTIVE)
|
||||
.name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
|
||||
.metrics(
|
||||
new DriveMetrics.Builder().readBytes(4096l).writeBytes(8589938688l).writeRequests(2097153l)
|
||||
.readRequests(1l).build())
|
||||
new DriveMetrics.Builder().readBytes(4096L).writeBytes(8589938688L).writeRequests(2097153L)
|
||||
.readRequests(1L).build())
|
||||
.user("58ca3c1f-7629-4771-9b71-863f40153ba4")
|
||||
.encryptionCipher("aes-xts-plain")
|
||||
.uuid("b8171d28-755a-4271-b891-7998871a160e")
|
||||
|
@ -51,7 +51,7 @@ public class MapToDriveInfoTest {
|
|||
"00031836-a624-4b22-bc7d-41ff8977087b:guest:17b076be-430d-4a76-9df3-b9896fec82a5:ide:0:0",
|
||||
"000663ee-9fb6-4461-90f6-01327a4aff07:guest:f83b519f-feab-42cf-859c-f61495681ada:ide:0:1"))//
|
||||
.readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
|
||||
.size(8589934592l)//
|
||||
.size(8589934592L)//
|
||||
.userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz")).build();
|
||||
|
||||
private static final MapToDriveInfo MAP_TO_DRIVE = new MapToDriveInfo();
|
||||
|
@ -61,7 +61,7 @@ public class MapToDriveInfoTest {
|
|||
}
|
||||
|
||||
public void testBasics() {
|
||||
DriveInfo expects = new DriveInfo.Builder().name("foo").size(100l).metrics(new DriveMetrics.Builder().build())
|
||||
DriveInfo expects = new DriveInfo.Builder().name("foo").size(100L).metrics(new DriveMetrics.Builder().build())
|
||||
.build();
|
||||
assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "size", "100")), expects);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class MapToServerInfoTest {
|
|||
.smp(1)
|
||||
.mem(1024)
|
||||
.status(ServerStatus.ACTIVE)
|
||||
.started(new Date(1291493868l))
|
||||
.started(new Date(1291493868L))
|
||||
.user("2f6244eb-50bc-4403-847e-f03cc3706a1f")
|
||||
.name("jo")
|
||||
.vnc(new VNC("46.20.114.124", "HfHzVmLT", false))
|
||||
|
|
|
@ -51,8 +51,8 @@ public class MapToStandardDriveTest {
|
|||
}
|
||||
|
||||
public void testBasics() {
|
||||
StandardDrive expects = new StandardDrive.Builder().name("foo").size(100l).media(MediaType.DISK)
|
||||
.format(ImageConversionType.GZIP).rawSize(5l).build();
|
||||
StandardDrive expects = new StandardDrive.Builder().name("foo").size(100L).media(MediaType.DISK)
|
||||
.format(ImageConversionType.GZIP).rawSize(5L).build();
|
||||
assertEquals(MAP_TO_STANDARD_DRIVE.apply(ImmutableMap.of("name", "foo", "size", "100", "format", "gzip", "media",
|
||||
"disk", "rawsize", "5")), expects);
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ public class NovaComputeServiceContextModule extends
|
|||
protected final Predicate<AtomicReference<RegionAndName>> securityGroupEventualConsistencyDelay(
|
||||
FindSecurityGroupWithNameAndReturnTrue in,
|
||||
@Named(TIMEOUT_SECURITYGROUP_PRESENT) long msDelay) {
|
||||
return retry(in, msDelay, 100l, MILLISECONDS);
|
||||
return retry(in, msDelay, 100L, MILLISECONDS);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -49,7 +49,7 @@ public class SetPayload implements Binder {
|
|||
|
||||
Long contentLength = payload.getContentMetadata().getContentLength();
|
||||
if (contentLength != null && contentLength >= 0) {
|
||||
checkArgument(contentLength <= 5l * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s",
|
||||
checkArgument(contentLength <= 5L * 1024 * 1024 * 1024, "maximum size for put object is 5GB, %s",
|
||||
contentLength);
|
||||
} else {
|
||||
builder.replaceHeader(TRANSFER_ENCODING, "chunked").build();
|
||||
|
|
|
@ -42,7 +42,7 @@ public class TemporaryUrlSignerMockTest extends BaseOpenStackMockTest<SwiftApi>
|
|||
try {
|
||||
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
|
||||
String signature = TemporaryUrlSigner.checkApiEvery(api.getAccountApi("DFW"), 10000)
|
||||
.sign("GET", "/v1/AUTH_account/container/object", 1323479485l);
|
||||
.sign("GET", "/v1/AUTH_account/container/object", 1323479485L);
|
||||
|
||||
assertEquals(signature, "d9fc2067e52b06598421664cf6610bfc8fc431f6");
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class TemporaryUrlSignerMockTest extends BaseOpenStackMockTest<SwiftApi>
|
|||
try {
|
||||
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
|
||||
TemporaryUrlSigner.checkApiEvery(api.getAccountApi("DFW"), 10000)
|
||||
.sign("GET", "/v1/AUTH_account/container/object", 1323479485l);
|
||||
.sign("GET", "/v1/AUTH_account/container/object", 1323479485L);
|
||||
} finally {
|
||||
assertEquals(server.getRequestCount(), 2);
|
||||
assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
|
||||
|
|
|
@ -53,9 +53,9 @@ public class AccountApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
|
|||
try {
|
||||
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
|
||||
Account account = api.getAccountApi("DFW").get();
|
||||
assertEquals(account.getContainerCount(), 3l);
|
||||
assertEquals(account.getObjectCount(), 42l);
|
||||
assertEquals(account.getBytesUsed(), 323479l);
|
||||
assertEquals(account.getContainerCount(), 3L);
|
||||
assertEquals(account.getObjectCount(), 42L);
|
||||
assertEquals(account.getBytesUsed(), 323479L);
|
||||
for (Entry<String, String> entry : metadata.entrySet()) {
|
||||
assertEquals(account.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -116,8 +116,8 @@ public class ContainerApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
|
|||
|
||||
Container container = api.getContainerApi("DFW").get("myContainer");
|
||||
assertEquals(container.getName(), "myContainer");
|
||||
assertEquals(container.getObjectCount(), Long.valueOf(42l));
|
||||
assertEquals(container.getBytesUsed(), Long.valueOf(323479l));
|
||||
assertEquals(container.getObjectCount(), Long.valueOf(42L));
|
||||
assertEquals(container.getBytesUsed(), Long.valueOf(323479L));
|
||||
for (Entry<String, String> entry : container.getMetadata().entrySet()) {
|
||||
assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
|
||||
}
|
||||
|
@ -236,8 +236,8 @@ public class ContainerApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
|
|||
SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
|
||||
Container container = api.getContainerApi("DFW").get("myContainer");
|
||||
assertEquals(container.getName(), "myContainer");
|
||||
assertEquals(container.getObjectCount(), Long.valueOf(42l));
|
||||
assertEquals(container.getBytesUsed(), Long.valueOf(323479l));
|
||||
assertEquals(container.getObjectCount(), Long.valueOf(42L));
|
||||
assertEquals(container.getBytesUsed(), Long.valueOf(323479L));
|
||||
for (Entry<String, String> entry : container.getMetadata().entrySet()) {
|
||||
assertEquals(container.getMetadata().get(entry.getKey().toLowerCase()), entry.getValue());
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ObjectApiMockTest extends BaseOpenStackMockTest<SwiftApi> {
|
|||
.name("test_obj_2")
|
||||
.uri(URI.create(baseUri + "/test_obj_2"))
|
||||
.etag("b039efe731ad111bc1b0ef221c3849d0")
|
||||
.payload(payload(64l, "application/octet-stream", null))
|
||||
.payload(payload(64L, "application/octet-stream", null))
|
||||
.lastModified(dates.iso8601DateParse("2009-02-03T05:26:32.612278")).build(),
|
||||
SwiftObject.builder()
|
||||
.name("test obj 3")
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BindS3ObjectMetadataToRequest implements Binder {
|
|||
checkArgument(s3Object.getMetadata().getKey() != null, "s3Object.getMetadata().getKey() must be set!");
|
||||
checkArgument(s3Object.getPayload().getContentMetadata().getContentLength() != null,
|
||||
"contentLength must be set, streaming not supported");
|
||||
checkArgument(s3Object.getPayload().getContentMetadata().getContentLength() <= 5l * 1024 * 1024 * 1024,
|
||||
checkArgument(s3Object.getPayload().getContentMetadata().getContentLength() <= 5L * 1024 * 1024 * 1024,
|
||||
"maximum size for put object is 5GB");
|
||||
|
||||
request = metadataPrefixer.bindToRequest(request, s3Object.getMetadata().getUserMetadata());
|
||||
|
|
|
@ -45,7 +45,7 @@ public class BackoffOnNotFoundWhenGetBucketACL extends CacheLoader<String, Acces
|
|||
try {
|
||||
return client.getBucketACL(bucketName);
|
||||
} catch (ResourceNotFoundException e) {
|
||||
imposeBackoffExponentialDelay(100l, 200l, 2, currentTries, maxTries);
|
||||
imposeBackoffExponentialDelay(100L, 200L, 2, currentTries, maxTries);
|
||||
last = e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public class RequestAuthorizeSignatureV4 implements RequestAuthorizeSignature {
|
|||
return false;
|
||||
}
|
||||
|
||||
return contentLength > 0l && !payload.isRepeatable();
|
||||
return contentLength > 0L && !payload.isRepeatable();
|
||||
}
|
||||
|
||||
protected HttpRequest signForAuthorizationHeader(HttpRequest request) {
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BindS3ObjectMetadataToRequestTest extends BaseS3ClientTest<S3Client
|
|||
public void testPassWithMinimumDetailsAndPayload5GB() {
|
||||
S3Object object = injector.getInstance(S3Object.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(5368709120l);
|
||||
payload.getContentMetadata().setContentLength(5368709120L);
|
||||
object.setPayload(payload);
|
||||
object.getMetadata().setKey("foo");
|
||||
|
||||
|
@ -59,7 +59,7 @@ public class BindS3ObjectMetadataToRequestTest extends BaseS3ClientTest<S3Client
|
|||
public void testExtendedPropertiesBind() {
|
||||
S3Object object = injector.getInstance(S3Object.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(5368709120l);
|
||||
payload.getContentMetadata().setContentLength(5368709120L);
|
||||
object.setPayload(payload);
|
||||
object.getMetadata().setKey("foo");
|
||||
object.getMetadata().setUserMetadata(ImmutableMap.of("foo", "bar"));
|
||||
|
@ -89,7 +89,7 @@ public class BindS3ObjectMetadataToRequestTest extends BaseS3ClientTest<S3Client
|
|||
public void testNoKeyIsBad() {
|
||||
S3Object object = injector.getInstance(S3Object.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(5368709120000l);
|
||||
payload.getContentMetadata().setContentLength(5368709120000L);
|
||||
object.setPayload(payload);
|
||||
|
||||
HttpRequest request = HttpRequest.builder().method("PUT").endpoint("http://localhost").build();
|
||||
|
@ -101,7 +101,7 @@ public class BindS3ObjectMetadataToRequestTest extends BaseS3ClientTest<S3Client
|
|||
public void testOver5GBIsBad() {
|
||||
S3Object object = injector.getInstance(S3Object.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(5368709120000l);
|
||||
payload.getContentMetadata().setContentLength(5368709120000L);
|
||||
object.setPayload(payload);
|
||||
object.getMetadata().setKey("foo");
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
.addHeader(HttpHeaders.LAST_MODIFIED, lastModified)
|
||||
.addHeader(HttpHeaders.ETAG, "\"00000000000000000000000000000000\"")
|
||||
.addHeader(HttpHeaders.CACHE_CONTROL, "cacheControl").build();
|
||||
http.getPayload().getContentMetadata().setContentLength(1025l);
|
||||
http.getPayload().getContentMetadata().setContentLength(1025L);
|
||||
http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
|
||||
http.getPayload().getContentMetadata().setContentEncoding("encoding");
|
||||
http.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
|
@ -66,7 +66,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
expects.getContentMetadata().setContentDisposition("contentDisposition");
|
||||
expects.getContentMetadata().setContentEncoding("encoding");
|
||||
expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
expects.getContentMetadata().setContentLength(1025l);
|
||||
expects.getContentMetadata().setContentLength(1025L);
|
||||
expects.getContentMetadata().setContentMD5(hashCode);
|
||||
expects.setETag("\"abcd\"");
|
||||
expects.setKey("key");
|
||||
|
@ -84,7 +84,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
.addHeader(HttpHeaders.LAST_MODIFIED, lastModified)
|
||||
.addHeader(HttpHeaders.ETAG, "\"abcd-1\"")
|
||||
.addHeader(HttpHeaders.CACHE_CONTROL, "cacheControl").build();
|
||||
http.getPayload().getContentMetadata().setContentLength(1025l);
|
||||
http.getPayload().getContentMetadata().setContentLength(1025L);
|
||||
http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
|
||||
http.getPayload().getContentMetadata().setContentEncoding("encoding");
|
||||
http.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
|
@ -96,7 +96,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
expects.getContentMetadata().setContentDisposition("contentDisposition");
|
||||
expects.getContentMetadata().setContentEncoding("encoding");
|
||||
expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
expects.getContentMetadata().setContentLength(1025l);
|
||||
expects.getContentMetadata().setContentLength(1025L);
|
||||
expects.setETag("\"abcd-1\"");
|
||||
expects.setKey("key");
|
||||
expects.setLastModified(now);
|
||||
|
@ -114,7 +114,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
.addHeader(S3Headers.AMZ_ETAG, "\"00000000000000000000000000000000\"")
|
||||
.addHeader(HttpHeaders.CACHE_CONTROL, "cacheControl").build();
|
||||
|
||||
http.getPayload().getContentMetadata().setContentLength(1025l);
|
||||
http.getPayload().getContentMetadata().setContentLength(1025L);
|
||||
http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
|
||||
http.getPayload().getContentMetadata().setContentEncoding("encoding");
|
||||
http.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
|
@ -128,7 +128,7 @@ public class ParseObjectMetadataFromHeadersTest {
|
|||
expects.getContentMetadata().setContentEncoding("encoding");
|
||||
expects.getContentMetadata().setContentMD5(hashCode);
|
||||
expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
expects.getContentMetadata().setContentLength(1025l);
|
||||
expects.getContentMetadata().setContentLength(1025L);
|
||||
expects.setETag("\"abcd\"");
|
||||
expects.setKey("key");
|
||||
expects.setLastModified(now);
|
||||
|
|
|
@ -69,43 +69,43 @@ public class ListBucketHandlerTest extends BaseHandlerTest {
|
|||
new ObjectMetadataBuilder().key("apps/0").bucket(bucket).uri(URI.create("http://bucket.com/apps/0"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:08.000Z")).eTag(
|
||||
"\"c82e6a0025c31c5de5947fda62ac51ab\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("c82e6a0025c31c5de5947fda62ac51ab")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("c82e6a0025c31c5de5947fda62ac51ab")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/1").bucket(bucket).uri(URI.create("http://bucket.com/apps/1"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:09.000Z")).eTag(
|
||||
"\"944fab2c5a9a6bacf07db5e688310d7a\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("944fab2c5a9a6bacf07db5e688310d7a")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("944fab2c5a9a6bacf07db5e688310d7a")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/2").bucket(bucket).uri(URI.create("http://bucket.com/apps/2"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:09.000Z")).eTag(
|
||||
"\"a227b8888045c8fd159fb495214000f0\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("a227b8888045c8fd159fb495214000f0")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("a227b8888045c8fd159fb495214000f0")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/3").bucket(bucket).uri(URI.create("http://bucket.com/apps/3"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:09.000Z")).eTag(
|
||||
"\"c9caa76c3dec53e2a192608ce73eef03\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("c9caa76c3dec53e2a192608ce73eef03")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("c9caa76c3dec53e2a192608ce73eef03")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/4").bucket(bucket).uri(URI.create("http://bucket.com/apps/4"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:09.000Z")).eTag(
|
||||
"\"1ce5d0dcc6154a647ea90c7bdf82a224\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("1ce5d0dcc6154a647ea90c7bdf82a224")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("1ce5d0dcc6154a647ea90c7bdf82a224")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/5").bucket(bucket).uri(URI.create("http://bucket.com/apps/5"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:09.000Z")).eTag(
|
||||
"\"79433524d87462ee05708a8ef894ed55\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("79433524d87462ee05708a8ef894ed55")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("79433524d87462ee05708a8ef894ed55")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/6").bucket(bucket).uri(URI.create("http://bucket.com/apps/6"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:10.000Z")).eTag(
|
||||
"\"dd00a060b28ddca8bc5a21a49e306f67\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("dd00a060b28ddca8bc5a21a49e306f67")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("dd00a060b28ddca8bc5a21a49e306f67")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/7").bucket(bucket).uri(URI.create("http://bucket.com/apps/7"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:10.000Z")).eTag(
|
||||
"\"8cd06eca6e819a927b07a285d750b100\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("8cd06eca6e819a927b07a285d750b100")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("8cd06eca6e819a927b07a285d750b100")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/8").bucket(bucket).uri(URI.create("http://bucket.com/apps/8"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:10.000Z")).eTag(
|
||||
"\"174495094d0633b92cbe46603eee6bad\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("174495094d0633b92cbe46603eee6bad")).contentLength(8l).build(),
|
||||
base16().lowerCase().decode("174495094d0633b92cbe46603eee6bad")).contentLength(8L).build(),
|
||||
new ObjectMetadataBuilder().key("apps/9").bucket(bucket).uri(URI.create("http://bucket.com/apps/9"))
|
||||
.lastModified(dateService.iso8601DateParse("2009-05-07T18:27:10.000Z")).eTag(
|
||||
"\"cd8a19b26fea8a827276df0ad11c580d\"").owner(owner).contentMD5(
|
||||
base16().lowerCase().decode("cd8a19b26fea8a827276df0ad11c580d")).contentLength(8l).build()),
|
||||
base16().lowerCase().decode("cd8a19b26fea8a827276df0ad11c580d")).contentLength(8L).build()),
|
||||
"apps/", null, null, 1000, null, false, new TreeSet<String>());
|
||||
return expected;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class MapToQueueAttributesTest {
|
|||
.approximateNumberOfMessages(0)
|
||||
.approximateNumberOfMessagesNotVisible(0)
|
||||
.approximateNumberOfMessagesDelayed(0)
|
||||
.createdTimestamp(new Date(1347566436l))
|
||||
.createdTimestamp(new Date(1347566436L))
|
||||
.lastModifiedTimestamp(new Date(1347566436))
|
||||
.visibilityTimeout(30)
|
||||
.maximumMessageSize(65536)
|
||||
|
|
|
@ -73,7 +73,7 @@ public class AWSServerErrorRetryHandler extends BackoffLimitedRetryHandler {
|
|||
}
|
||||
|
||||
public void imposeBackoffExponentialDelay(long period, int pow, int failureCount, int max, String commandDescription) {
|
||||
imposeBackoffExponentialDelay(period, period * 100l, pow, failureCount, max, commandDescription);
|
||||
imposeBackoffExponentialDelay(period, period * 100L, pow, failureCount, max, commandDescription);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class TransientBlobRequestSignerTest extends BaseRestAnnotationProcessing
|
|||
public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityException, IllegalArgumentException,
|
||||
NoSuchMethodException, IOException {
|
||||
HashCode hashCode = HashCode.fromBytes(new byte[16]);
|
||||
Blob blob = blobFactory.get().name(blobName).forSigning().contentLength(2l).contentMD5(hashCode)
|
||||
Blob blob = blobFactory.get().name(blobName).forSigning().contentLength(2L).contentMD5(hashCode)
|
||||
.contentType("text/plain").build();
|
||||
|
||||
assertEquals(blob.getPayload().getContentMetadata().getContentMD5AsHashCode(), hashCode);
|
||||
|
|
|
@ -35,7 +35,7 @@ public class BlobToHttpGetOptionsTest {
|
|||
@Test
|
||||
public void testIfUnmodifiedSince() {
|
||||
|
||||
Date ifUnmodifiedSince = new Date(999999l);
|
||||
Date ifUnmodifiedSince = new Date(999999L);
|
||||
|
||||
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
|
||||
in.ifUnmodifiedSince(ifUnmodifiedSince);
|
||||
|
@ -48,7 +48,7 @@ public class BlobToHttpGetOptionsTest {
|
|||
@Test
|
||||
public void testIfModifiedSince() {
|
||||
|
||||
Date ifModifiedSince = new Date(999999l);
|
||||
Date ifModifiedSince = new Date(999999L);
|
||||
|
||||
org.jclouds.blobstore.options.GetOptions in = new org.jclouds.blobstore.options.GetOptions();
|
||||
in.ifModifiedSince(ifModifiedSince);
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ParseBlobFromHeadersAndHttpContentTest {
|
|||
.addHeader("Content-Range", "0-10485759/20232760").build();
|
||||
|
||||
response.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON);
|
||||
response.getPayload().getContentMetadata().setContentLength(10485760l);
|
||||
response.getPayload().getContentMetadata().setContentLength(10485760L);
|
||||
|
||||
MutableBlobMetadata meta = blobMetadataProvider.get();
|
||||
expect(metadataParser.apply(response)).andReturn(meta);
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ParseSystemAndUserMetadataFromHeadersTest {
|
|||
.payload("")
|
||||
.addHeader(HttpHeaders.LAST_MODIFIED, "Wed, 09 Sep 2009 19:50:23 GMT").build();
|
||||
from.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_JSON);
|
||||
from.getPayload().getContentMetadata().setContentLength(100l);
|
||||
from.getPayload().getContentMetadata().setContentLength(100L);
|
||||
BlobMetadata metadata = parser.apply(from);
|
||||
assertEquals(metadata.getName(), "key");
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||
|
||||
}));
|
||||
}
|
||||
Map<Integer, Exception> exceptions = awaitCompletion(responses, exec, 30000l, Logger.CONSOLE,
|
||||
Map<Integer, Exception> exceptions = awaitCompletion(responses, exec, 30000L, Logger.CONSOLE,
|
||||
"putFileParallel");
|
||||
assert exceptions.size() == 0 : exceptions;
|
||||
|
||||
|
@ -179,7 +179,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||
}
|
||||
}));
|
||||
}
|
||||
Map<Integer, Exception> exceptions = awaitCompletion(responses, exec, 30000l, Logger.CONSOLE,
|
||||
Map<Integer, Exception> exceptions = awaitCompletion(responses, exec, 30000L, Logger.CONSOLE,
|
||||
"get constitution");
|
||||
if (!exceptions.isEmpty()) {
|
||||
throw exceptions.values().iterator().next();
|
||||
|
|
|
@ -63,7 +63,7 @@ public abstract class BaseBlobSignerExpectTest extends BaseRestApiExpectTest<Blo
|
|||
public void testSignGetBlobWithTime() {
|
||||
BlobStore getBlobWithTime = requestsSendResponses(init());
|
||||
HttpRequest compare = getBlobWithTime();
|
||||
assertEquals(getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 3l /* seconds */),
|
||||
assertEquals(getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 3L /* seconds */),
|
||||
compare);
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public abstract class BaseBlobSignerExpectTest extends BaseRestApiExpectTest<Blo
|
|||
public void testSignPutBlob() throws Exception {
|
||||
HashCode hashCode = HashCode.fromBytes(new byte[16]);
|
||||
BlobStore signPutBlob = requestsSendResponses(init());
|
||||
Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2l).contentMD5(hashCode)
|
||||
Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2L).contentMD5(hashCode)
|
||||
.contentType("text/plain").expires(new Date(1000)).build();
|
||||
HttpRequest compare = putBlob();
|
||||
compare.setPayload(blob.getPayload());
|
||||
|
@ -103,7 +103,7 @@ public abstract class BaseBlobSignerExpectTest extends BaseRestApiExpectTest<Blo
|
|||
Blob blob = signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();
|
||||
HttpRequest compare = putBlobWithTime();
|
||||
compare.setPayload(blob.getPayload());
|
||||
assertEquals(signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 3l /* seconds */),
|
||||
assertEquals(signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 3L /* seconds */),
|
||||
compare);
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class StubComputeServiceAdapter implements JCloudsNativeComputeServiceAda
|
|||
}
|
||||
|
||||
protected void setStateOnNodeAfterDelay(final Status status, final NodeMetadata node, final long millis) {
|
||||
if (millis == 0l)
|
||||
if (millis == 0L)
|
||||
setStateOnNode(status, node);
|
||||
else
|
||||
executor.execute(new Runnable() {
|
||||
|
|
|
@ -174,7 +174,7 @@ public abstract class BaseImageExtensionLiveTest extends BaseComputeServiceConte
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}, getSpawnNodeMaxWait(), 1l, SECONDS).apply(client));
|
||||
}, getSpawnNodeMaxWait(), 1L, SECONDS).apply(client));
|
||||
}
|
||||
|
||||
protected Optional<Image> findImageWithNameInCache(String name) {
|
||||
|
|
|
@ -44,9 +44,9 @@ public class DiskSectionHandlerTest {
|
|||
assertEquals(result.toString(), DiskSection.builder().info("Describes the set of virtual disks").disk(
|
||||
Disk.builder().id("vmdisk1")
|
||||
|
||||
.fileRef("file1").capacity(8589934592l).populatedSize(3549324972l).format(
|
||||
.fileRef("file1").capacity(8589934592L).populatedSize(3549324972L).format(
|
||||
URI.create("http://www.vmware.com/interfaces/specifications/vmdk.html#sparse")).build()).disk(
|
||||
Disk.builder().id("vmdisk2").capacity(536870912l).build()).disk(
|
||||
Disk.builder().id("vmdisk2").capacity(536870912L).build()).disk(
|
||||
Disk.builder().id("vmdisk3").capacityAllocationUnits("byte * 2^30").build())
|
||||
|
||||
.build().toString()
|
||||
|
|
|
@ -118,7 +118,7 @@ public class BackoffLimitedRetryHandler implements HttpRetryHandler, IOException
|
|||
}
|
||||
|
||||
public void imposeBackoffExponentialDelay(long period, int pow, int failureCount, int max, String commandDescription) {
|
||||
imposeBackoffExponentialDelay(period, period * 10l, pow, failureCount, max, commandDescription);
|
||||
imposeBackoffExponentialDelay(period, period * 10L, pow, failureCount, max, commandDescription);
|
||||
}
|
||||
|
||||
public void imposeBackoffExponentialDelay(long period, long maxPeriod, int pow, int failureCount, int max,
|
||||
|
|
|
@ -59,7 +59,7 @@ public class Predicates2 {
|
|||
* like {@link #retry(Predicate, long, long, long, TimeUnit)} where {@code maxPeriod} is 10x {@code period}
|
||||
*/
|
||||
public static <T> Predicate<T> retry(Predicate<T> findOrBreak, long timeout, long period, TimeUnit unit) {
|
||||
return retry(findOrBreak, timeout, period, period * 10l, unit);
|
||||
return retry(findOrBreak, timeout, period, period * 10L, unit);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,11 +72,11 @@ public class Predicates2 {
|
|||
/**
|
||||
* @see org.jclouds.compute.config.ComputeServiceProperties#POLL_INITIAL_PERIOD
|
||||
*/
|
||||
public static final long DEFAULT_PERIOD = 50l;
|
||||
public static final long DEFAULT_PERIOD = 50L;
|
||||
/**
|
||||
* @see org.jclouds.compute.config.ComputeServiceProperties#POLL_MAX_PERIOD
|
||||
*/
|
||||
public static final long DEFAULT_MAX_PERIOD = 1000l;
|
||||
public static final long DEFAULT_MAX_PERIOD = 1000L;
|
||||
|
||||
/**
|
||||
* like {@link #retry(Predicate, long, long, long, TimeUnit)} where {@code unit} is in milliseconds, {@code period}
|
||||
|
@ -110,7 +110,7 @@ public class Predicates2 {
|
|||
// Always try at least once, even if timeout is 0 or negative.
|
||||
// A timeout of 0 means 0 millis.
|
||||
try {
|
||||
long i = 1l;
|
||||
long i = 1L;
|
||||
long now = System.currentTimeMillis();
|
||||
long end = now + timeout;
|
||||
while (now < end) {
|
||||
|
|
|
@ -76,17 +76,17 @@ public class DateServiceTest extends PerformanceTest {
|
|||
// times!
|
||||
testData = new TestData[] {
|
||||
new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T06:00:07+0400", "2009-03-12T02:00:07Z",
|
||||
"Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)),
|
||||
"Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000L)),
|
||||
new TestData("2009-03-12T02:00:07.000Z", "2009-03-12T06:00:07+0400", "2009-03-12T02:00:07Z",
|
||||
"Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000l)),
|
||||
"Thu, 12 Mar 2009 02:00:07 GMT", "Thu Mar 12 02:00:07 +0000 2009", new Date(1236823207000L)),
|
||||
new TestData("2009-03-14T04:00:07.000Z", "2009-03-14T08:00:07+0400", "2009-03-14T04:00:07Z",
|
||||
"Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000l)),
|
||||
"Sat, 14 Mar 2009 04:00:07 GMT", "Thu Mar 14 04:00:07 +0000 2009", new Date(1237003207000L)),
|
||||
new TestData("2009-03-16T06:00:07.000Z", "2009-03-16T10:00:07+0400", "2009-03-16T06:00:07Z",
|
||||
"Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000l)),
|
||||
"Mon, 16 Mar 2009 06:00:07 GMT", "Thu Mar 16 06:00:07 +0000 2009", new Date(1237183207000L)),
|
||||
new TestData("2009-03-18T08:00:07.000Z", "2009-03-18T12:00:07+0400", "2009-03-18T08:00:07Z",
|
||||
"Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000l)),
|
||||
"Wed, 18 Mar 2009 08:00:07 GMT", "Thu Mar 18 08:00:07 +0000 2009", new Date(1237363207000L)),
|
||||
new TestData("2009-03-20T10:00:07.000Z", "2009-03-20T14:00:07+0400", "2009-03-20T10:00:07Z",
|
||||
"Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000l)) };
|
||||
"Fri, 20 Mar 2009 10:00:07 GMT", "Thu Mar 20 10:00:07 +0000 2009", new Date(1237543207000L)) };
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -192,12 +192,12 @@ public class DateServiceTest extends PerformanceTest {
|
|||
|
||||
@Test
|
||||
void testTz() {
|
||||
assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T02:14:13-04:00").getTime(), 1306390453000l);
|
||||
assertEquals(dateService.iso8601SecondsDateParse("2011-05-26T02:14:13-04:00").getTime(), 1306390453000L);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testTzNoT() {
|
||||
assertEquals(dateService.iso8601DateParse("2011-05-25 16:12:21.656+0000").getTime(), 1306339941656l);
|
||||
assertEquals(dateService.iso8601DateParse("2011-05-25 16:12:21.656+0000").getTime(), 1306339941656L);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -99,7 +99,7 @@ public class DateServiceDateCodecFactoryTest {
|
|||
Date date = new Date(1000);
|
||||
assertEquals(iso8601SecondsCodec.toDate(iso8601SecondsCodec.toString(date)), date);
|
||||
|
||||
assertEquals(iso8601SecondsCodec.toDate("2012-11-14T21:51:28UTC").getTime(), 1352929888000l);
|
||||
assertEquals(iso8601SecondsCodec.toDate("2012-11-14T21:51:28UTC").getTime(), 1352929888000L);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -26,13 +26,13 @@ import com.google.common.collect.ImmutableList;
|
|||
public class JoinOnCommaTest {
|
||||
@Test
|
||||
public void testIterableLong() {
|
||||
String list = new JoinOnComma().apply(ImmutableList.of(1l, 2l));
|
||||
String list = new JoinOnComma().apply(ImmutableList.of(1L, 2L));
|
||||
assertEquals(list, "1,2");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLongArray() {
|
||||
String list = new JoinOnComma().apply(new long[] { 1l, 2l });
|
||||
String list = new JoinOnComma().apply(new long[] { 1L, 2L });
|
||||
assertEquals(list, "1,2");
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ public class BackoffLimitedRetryHandlerTest {
|
|||
};
|
||||
|
||||
response.setPayload(Payloads.newInputStreamPayload(inputStream));
|
||||
response.getPayload().getContentMetadata().setContentLength(1l);
|
||||
response.getPayload().getContentMetadata().setContentLength(1L);
|
||||
assertEquals(response.getPayload().openStream().available(), 2);
|
||||
assertEquals(response.getPayload().openStream().read(), 1);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ public class BaseHttpCommandExecutorServiceTest {
|
|||
public void testStreamIsClosedWhenRetrying() throws IOException {
|
||||
MockInputStream in = new MockInputStream(2); // Input stream that produces 2 bytes
|
||||
HttpResponse response = HttpResponse.builder().payload(newInputStreamPayload(in)).build();
|
||||
response.getPayload().getContentMetadata().setContentLength(1l);
|
||||
response.getPayload().getContentMetadata().setContentLength(1L);
|
||||
HttpCommand command = mockHttpCommand();
|
||||
|
||||
DelegatingRetryHandler retryHandler = EasyMock.createMock(DelegatingRetryHandler.class);
|
||||
|
@ -90,7 +90,7 @@ public class BaseHttpCommandExecutorServiceTest {
|
|||
public void testStreamIsClosedWhenNotRetrying() throws IOException {
|
||||
MockInputStream in = new MockInputStream(2); // Input stream that produces 2 bytes
|
||||
HttpResponse response = HttpResponse.builder().payload(newInputStreamPayload(in)).build();
|
||||
response.getPayload().getContentMetadata().setContentLength(1l);
|
||||
response.getPayload().getContentMetadata().setContentLength(1L);
|
||||
HttpCommand command = mockHttpCommand();
|
||||
|
||||
DelegatingRetryHandler retryHandler = EasyMock.createMock(DelegatingRetryHandler.class);
|
||||
|
@ -120,7 +120,7 @@ public class BaseHttpCommandExecutorServiceTest {
|
|||
public void testStreamIsClosedAndBufferedInTheErrorHandlerWhenNotRetrying() throws IOException {
|
||||
MockInputStream in = new MockInputStream(2); // Input stream that produces 2 bytes
|
||||
HttpResponse response = HttpResponse.builder().payload(newInputStreamPayload(in)).build();
|
||||
response.getPayload().getContentMetadata().setContentLength(1l);
|
||||
response.getPayload().getContentMetadata().setContentLength(1L);
|
||||
HttpCommand command = mockHttpCommand();
|
||||
|
||||
DelegatingRetryHandler retryHandler = EasyMock.createMock(DelegatingRetryHandler.class);
|
||||
|
@ -164,7 +164,7 @@ public class BaseHttpCommandExecutorServiceTest {
|
|||
public void testCloseStreamCanBeCalledMoreThanOnce() throws IOException {
|
||||
MockInputStream in = new MockInputStream(2); // Input stream that produces 2 bytes
|
||||
HttpResponse response = HttpResponse.builder().payload(newInputStreamPayload(in)).build();
|
||||
response.getPayload().getContentMetadata().setContentLength(1l);
|
||||
response.getPayload().getContentMetadata().setContentLength(1L);
|
||||
HttpCommand command = mockHttpCommand();
|
||||
|
||||
DelegatingRetryHandler retryHandler = EasyMock.createMock(DelegatingRetryHandler.class);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class FilterStringsBoundToInjectorByNameTest {
|
|||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bindConstant().annotatedWith(Names.named("foo")).to(1l);
|
||||
bindConstant().annotatedWith(Names.named("foo")).to(1L);
|
||||
}
|
||||
|
||||
}).getInstance(FilterStringsBoundToInjectorByName.class);
|
||||
|
|
|
@ -74,8 +74,8 @@ public class ReadAnnotationsAndPropertiesTest {
|
|||
});
|
||||
ReadAnnotationsAndProperties config = new ReadAnnotationsAndProperties(injector,
|
||||
new FilterStringsBoundToInjectorByName(injector), defaultFallback);
|
||||
assertEquals(config.getTimeoutNanos(asyncGet), Optional.of(250000000l));
|
||||
assertEquals(config.getTimeoutNanos(asyncNamedGet), Optional.of(250000000l));
|
||||
assertEquals(config.getTimeoutNanos(asyncGet), Optional.of(250000000L));
|
||||
assertEquals(config.getTimeoutNanos(asyncNamedGet), Optional.of(250000000L));
|
||||
}
|
||||
|
||||
public void testNamedInvocationGetsTimeoutOverrideOnAsyncMethods() throws Exception {
|
||||
|
@ -90,7 +90,7 @@ public class ReadAnnotationsAndPropertiesTest {
|
|||
});
|
||||
ReadAnnotationsAndProperties config = new ReadAnnotationsAndProperties(injector,
|
||||
new FilterStringsBoundToInjectorByName(injector), defaultFallback);
|
||||
assertEquals(config.getTimeoutNanos(asyncNamedGet), Optional.of(250000000l));
|
||||
assertEquals(config.getTimeoutNanos(asyncNamedGet), Optional.of(250000000L));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -96,7 +96,7 @@ public class InvokeHttpMethodTest {
|
|||
}
|
||||
|
||||
public void testMethodWithTimeoutRunsTimeLimiter() throws Exception {
|
||||
expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
|
||||
expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000L));
|
||||
InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
|
||||
expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andReturn(response);
|
||||
replay(http, timeLimiter, fallback, config);
|
||||
|
@ -123,7 +123,7 @@ public class InvokeHttpMethodTest {
|
|||
|
||||
public void testTimeLimitedRunsFallbackCreateOrPropagate() throws Exception {
|
||||
IllegalStateException exception = new IllegalStateException();
|
||||
expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000l));
|
||||
expect(config.getTimeoutNanos(get)).andReturn(Optional.of(250000000L));
|
||||
InvokeAndTransform invoke = invokeHttpMethod.new InvokeAndTransform("ns:get", getCommand);
|
||||
expect(timeLimiter.callWithTimeout(invoke, 250000000, TimeUnit.NANOSECONDS, true)).andThrow(exception);
|
||||
expect(fallback.createOrPropagate(exception)).andReturn(fallbackResponse);
|
||||
|
|
|
@ -120,7 +120,7 @@ public class ConvertToGaeRequestTest {
|
|||
.method(HttpMethod.GET)
|
||||
.endpoint(endPoint)
|
||||
.payload(Strings2.toInputStream("hoot!")).build();
|
||||
request.getPayload().getContentMetadata().setContentLength(5l);
|
||||
request.getPayload().getContentMetadata().setContentLength(5L);
|
||||
testHoot(request);
|
||||
}
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ import com.squareup.okhttp.mockwebserver.MockResponse;
|
|||
enqueueRegions(DEFAULT_REGION);
|
||||
enqueueXml(DEFAULT_REGION, "/describe_spot_price_history.xml");
|
||||
|
||||
Date from = new Date(12345678910l);
|
||||
Date to = new Date(1234567891011l);
|
||||
Date from = new Date(12345678910L);
|
||||
Date to = new Date(1234567891011L);
|
||||
|
||||
Set<Spot> result = spotApi().describeSpotPriceHistoryInRegion(DEFAULT_REGION,
|
||||
from(from).to(to).productDescription("description").instanceType("m1.small"));
|
||||
|
|
|
@ -83,7 +83,7 @@ public class DescribeSpotPriceHistoryOptionsTest {
|
|||
assertEquals(options.buildFormParameters().get("StartTime"), ImmutableList.of("1970-05-23T21:21:18.910Z"));
|
||||
}
|
||||
|
||||
Date test = new Date(12345678910l);
|
||||
Date test = new Date(12345678910L);
|
||||
|
||||
@Test
|
||||
public void testFromStatic() {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class RequestSpotInstancesOptionsTest {
|
|||
ImmutableList.of("1970-05-23T21:21:18Z"));
|
||||
}
|
||||
|
||||
Date test = new Date(12345678910l);
|
||||
Date test = new Date(12345678910L);
|
||||
|
||||
@Test
|
||||
public void testFromStatic() {
|
||||
|
|
|
@ -88,7 +88,7 @@ public class AWSS3BlobSignerExpectTest extends S3BlobSignerExpectTest {
|
|||
public void testSignGetBlobWithTime() {
|
||||
BlobStore getBlobWithTime = requestsSendResponses(init());
|
||||
HttpRequest compare = getBlobWithTime();
|
||||
HttpRequest request = getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 3l /* seconds */);
|
||||
HttpRequest request = getBlobWithTime.getContext().getSigner().signGetBlob(container, name, 3L /* seconds */);
|
||||
compareRequestComponents(request, compare);
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class AWSS3BlobSignerExpectTest extends S3BlobSignerExpectTest {
|
|||
Blob blob = signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();
|
||||
HttpRequest compare = putBlobWithTime();
|
||||
compare.setPayload(blob.getPayload());
|
||||
HttpRequest request = signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 3l /* seconds */);
|
||||
HttpRequest request = signPutBloblWithTime.getContext().getSigner().signPutBlob(container, blob, 3L /* seconds */);
|
||||
compareRequestComponents(request, compare);
|
||||
assertEquals(request.getPayload(), compare.getPayload());
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ public class AWSS3BlobSignerV4ExpectTest extends S3BlobSignerExpectTest {
|
|||
BlobStore getBlobWithTime = requestsSendResponses(init());
|
||||
HttpRequest compare = getBlobWithTime();
|
||||
HttpRequest signedRequest = getBlobWithTime.getContext().getSigner().signGetBlob(BUCKET_NAME, OBJECT_NAME,
|
||||
86400l /* seconds */);
|
||||
86400L /* seconds */);
|
||||
assertEquals(signedRequest, compare);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class AWSS3BlobSignerV4ExpectTest extends S3BlobSignerExpectTest {
|
|||
HttpRequest compare = _putBlobWithTime();
|
||||
compare.setPayload(blob.getPayload());
|
||||
HttpRequest signedRequest = signPutBloblWithTime.getContext().getSigner().signPutBlob(BUCKET_NAME, blob,
|
||||
86400l /* seconds */);
|
||||
86400L /* seconds */);
|
||||
assertEquals(signedRequest, compare);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public class BindAzureBlobMetadataToRequest implements Binder {
|
|||
break;
|
||||
case BLOCK_BLOB:
|
||||
checkArgument(
|
||||
checkNotNull(blob.getPayload().getContentMetadata().getContentLength(), "blob.getContentLength()") <= 64l * 1024 * 1024,
|
||||
checkNotNull(blob.getPayload().getContentMetadata().getContentLength(), "blob.getContentLength()") <= 64L * 1024 * 1024,
|
||||
"maximum size for put Blob is 64MB");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BindAzureBlobMetadataToRequestTest extends BaseRestAnnotationProces
|
|||
public void testPassWithMinimumDetailsAndPayload64MB() {
|
||||
AzureBlob blob = injector.getInstance(AzureBlob.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024l);
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024L);
|
||||
blob.setPayload(payload);
|
||||
blob.getProperties().setName("foo");
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class BindAzureBlobMetadataToRequestTest extends BaseRestAnnotationProces
|
|||
public void testExtendedPropertiesBind() {
|
||||
AzureBlob blob = injector.getInstance(AzureBlob.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024l);
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024L);
|
||||
blob.setPayload(payload);
|
||||
blob.getProperties().setName("foo");
|
||||
blob.getProperties().setMetadata(ImmutableMap.of("foo", "bar"));
|
||||
|
@ -87,7 +87,7 @@ public class BindAzureBlobMetadataToRequestTest extends BaseRestAnnotationProces
|
|||
public void testNoNameIsBad() {
|
||||
AzureBlob blob = injector.getInstance(AzureBlob.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(5368709120000l);
|
||||
payload.getContentMetadata().setContentLength(5368709120000L);
|
||||
blob.setPayload(payload);
|
||||
|
||||
HttpRequest request = HttpRequest.builder().method("PUT").endpoint("http://localhost").build();
|
||||
|
@ -99,7 +99,7 @@ public class BindAzureBlobMetadataToRequestTest extends BaseRestAnnotationProces
|
|||
public void testOver64MBIsBad() {
|
||||
AzureBlob blob = injector.getInstance(AzureBlob.Factory.class).create(null);
|
||||
Payload payload = Payloads.newStringPayload("");
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024l + 1);
|
||||
payload.getContentMetadata().setContentLength(64 * 1024 * 1024L + 1);
|
||||
blob.setPayload(payload);
|
||||
blob.getProperties().setName("foo");
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public class AzureBlobRequestSignerTest extends BaseRestAnnotationProcessingTest
|
|||
Blob blob = blobFactory.create(null);
|
||||
blob.getMetadata().setName("name");
|
||||
blob.setPayload("");
|
||||
blob.getPayload().getContentMetadata().setContentLength(2l);
|
||||
blob.getPayload().getContentMetadata().setContentLength(2L);
|
||||
blob.getPayload().getContentMetadata().setContentMD5(hashCode);
|
||||
blob.getPayload().getContentMetadata().setContentType("text/plain");
|
||||
blob.getPayload().getContentMetadata().setExpires(new Date(1000));
|
||||
|
|
|
@ -66,7 +66,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("SOA")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getSOA, soaResponse);
|
||||
|
@ -92,7 +92,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("AAAA")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetAAAAWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getAAAA, aaaaResponse);
|
||||
|
@ -118,7 +118,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("A")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetAWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getA, aResponse);
|
||||
|
@ -144,7 +144,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("CNAME")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetCNAMEWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getCNAME, cnameResponse);
|
||||
|
@ -170,7 +170,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("MX")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetMXWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getMX, mxResponse);
|
||||
|
@ -196,7 +196,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("NS")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetNSWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getNS, nsResponse);
|
||||
|
@ -222,7 +222,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("PTR")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetPTRWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getPTR, ptrResponse);
|
||||
|
@ -259,7 +259,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("SPF")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetSPFWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getSPF, spfResponse);
|
||||
|
@ -280,7 +280,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("SRV")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetSRVWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getSRV, srvResponse);
|
||||
|
@ -301,7 +301,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("SSHFP")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetSSHFPWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getSSHFP, sshfpResponse);
|
||||
|
@ -322,7 +322,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("jclouds.org")
|
||||
.type("TXT")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
public void testGetTXTWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, getTXT, txtResponse);
|
||||
|
@ -403,7 +403,7 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.ttl(86400)
|
||||
.rdata(a("1.1.1.1"))
|
||||
.build();
|
||||
assertEquals(success.getRecordApiForZone("jclouds.org").scheduleCreate(record), Job.success(285372440l));
|
||||
assertEquals(success.getRecordApiForZone("jclouds.org").scheduleCreate(record), Job.success(285372440L));
|
||||
}
|
||||
|
||||
HttpRequest delete = HttpRequest.builder().method(DELETE)
|
||||
|
@ -420,13 +420,13 @@ public class RecordApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
.zone("jclouds.org")
|
||||
.fqdn("www.jclouds.org")
|
||||
.type("A")
|
||||
.id(285372440l)
|
||||
.id(285372440L)
|
||||
.build();
|
||||
|
||||
public void testDeleteWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, delete, deleteResponse);
|
||||
|
||||
assertEquals(success.getRecordApiForZone("jclouds.org").scheduleDelete(id), Job.success(285372457l));
|
||||
assertEquals(success.getRecordApiForZone("jclouds.org").scheduleDelete(id), Job.success(285372457L));
|
||||
}
|
||||
|
||||
public void testDeleteWhenResponseIs404() {
|
||||
|
|
|
@ -70,12 +70,12 @@ public class ZoneApiExpectTest extends BaseDynECTApiExpectTest {
|
|||
assertEquals(success.getZoneApi().scheduleCreate(CreatePrimaryZone.builder()
|
||||
.fqdn("jclouds.org")
|
||||
.contact("jimmy@jclouds.org")
|
||||
.build()), Job.success(285351593l));
|
||||
.build()), Job.success(285351593L));
|
||||
}
|
||||
|
||||
public void testCreateWithContactWhenResponseIs2xx() {
|
||||
DynECTApi success = requestsSendResponses(createSession, createSessionResponse, create, createResponse);
|
||||
assertEquals(success.getZoneApi().scheduleCreateWithContact("jclouds.org", "jimmy@jclouds.org"), Job.success(285351593l));
|
||||
assertEquals(success.getZoneApi().scheduleCreateWithContact("jclouds.org", "jimmy@jclouds.org"), Job.success(285351593L));
|
||||
}
|
||||
|
||||
public void testGetWhenResponseIs404() {
|
||||
|
|
|
@ -34,6 +34,6 @@ public class DeleteZoneChangesResponseTest extends BaseDynECTParseTest<Job> {
|
|||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public Job expected() {
|
||||
return Job.success(275625520l);
|
||||
return Job.success(275625520L);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,6 @@ public class DeleteZoneResponseTest extends BaseDynECTParseTest<Job> {
|
|||
@Override
|
||||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public Job expected() {
|
||||
return Job.success(262989027l);
|
||||
return Job.success(262989027L);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class GetRecordResponseTest extends BaseDynECTParseTest<Record<Map<String
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("adrianc.zone.dynecttest.jclouds.org")
|
||||
.type("SOA")
|
||||
.id(50976579l)
|
||||
.id(50976579L)
|
||||
.ttl(3600)
|
||||
// TODO: default parse to unsigned
|
||||
.rdata(ImmutableMap.<String, Object> builder()
|
||||
|
|
|
@ -43,7 +43,7 @@ public class GetSOARecordResponseTest extends BaseDynECTParseTest<SOARecord> {
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("adrianc.zone.dynecttest.jclouds.org")
|
||||
.type("SOA")
|
||||
.id(50976579l)
|
||||
.id(50976579L)
|
||||
.ttl(3600)
|
||||
.serialStyle(INCREMENT)
|
||||
.rdata(SOAData.builder()
|
||||
|
|
|
@ -41,7 +41,7 @@ public class GetSPFRecordResponseTest extends BaseDynECTParseTest<Record<SPFData
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("_http._tcp.www.jclouds.org.")
|
||||
.type("SPF")
|
||||
.id(50976579l)
|
||||
.id(50976579L)
|
||||
.ttl(3600)
|
||||
.rdata(SPFData.create("v=spf1 a -all")).build();
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class GetSRVRecordResponseTest extends BaseDynECTParseTest<Record<SRVData
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("_http._tcp.www.jclouds.org.")
|
||||
.type("SRV")
|
||||
.id(50976579l)
|
||||
.id(50976579L)
|
||||
.ttl(3600)
|
||||
.rdata(SRVData.builder()
|
||||
.priority(0)
|
||||
|
|
|
@ -38,7 +38,7 @@ public class GetSSHFPRecordResponseTest extends BaseDynECTParseTest<Record<SSHFP
|
|||
@Consumes(MediaType.APPLICATION_JSON)
|
||||
public Record<SSHFPData> expected() {
|
||||
return Record.<SSHFPData> builder().zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("_http._tcp.www.jclouds.org.").type("SSHFP").id(50976579l).ttl(3600)
|
||||
.fqdn("_http._tcp.www.jclouds.org.").type("SSHFP").id(50976579L).ttl(3600)
|
||||
.rdata(SSHFPData.builder().algorithm(2).fptype(1).fingerprint("190E37C5B5DB9A1C455E648A41AF3CC83F99F102").build()).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,11 +43,11 @@ public class ListRecordsResponseTest extends BaseDynECTParseTest<FluentIterable<
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("adrianc.zone.dynecttest.jclouds.org");
|
||||
return FluentIterable.from(ImmutableSet.<RecordId> builder()
|
||||
.add(builder.type("SOA").id(50976579l).build())
|
||||
.add(builder.type("NS").id(50976580l).build())
|
||||
.add(builder.type("NS").id(50976581l).build())
|
||||
.add(builder.type("NS").id(50976582l).build())
|
||||
.add(builder.type("NS").id(50976583l).build())
|
||||
.add(builder.type("SOA").id(50976579L).build())
|
||||
.add(builder.type("NS").id(50976580L).build())
|
||||
.add(builder.type("NS").id(50976581L).build())
|
||||
.add(builder.type("NS").id(50976582L).build())
|
||||
.add(builder.type("NS").id(50976583L).build())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class RecordPredicatesTest {
|
|||
.zone("adrianc.zone.dynecttest.jclouds.org")
|
||||
.fqdn("adrianc.zone.dynecttest.jclouds.org")
|
||||
.type("SOA")
|
||||
.id(50976579l).build();
|
||||
.id(50976579L).build();
|
||||
|
||||
@Test
|
||||
public void testTypeEqualsWhenEqual() {
|
||||
|
|
|
@ -70,9 +70,9 @@ public class GoGridComputeServiceAdapter implements ComputeServiceAdapter<Server
|
|||
this.client = checkNotNull(client, "client");
|
||||
this.sizeToRam = checkNotNull(sizeToRam, "sizeToRam");
|
||||
this.serverLatestJobCompleted = retry(new ServerLatestJobCompleted(client.getJobServices()),
|
||||
timeouts.nodeRunning * 9l / 10l);
|
||||
timeouts.nodeRunning * 9L / 10L);
|
||||
this.serverLatestJobCompletedShort = retry(new ServerLatestJobCompleted(client.getJobServices()),
|
||||
timeouts.nodeRunning * 1l / 10l);
|
||||
timeouts.nodeRunning * 1L / 10L);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -57,13 +57,13 @@ public class ServerToNodeMetadataTest {
|
|||
|
||||
Map<ServerState, Status> serverStateToNodeStatus = createMock(Map.class);
|
||||
org.jclouds.compute.domain.Image jcImage = createMock(org.jclouds.compute.domain.Image.class);
|
||||
Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");
|
||||
Option ram = Option.createWithIdNameAndDescription(1l, "512MB", "Server with 512MB RAM");
|
||||
Option dc = Option.createWithIdNameAndDescription(1L, "US-West-1", "US West 1 Datacenter");
|
||||
Option ram = Option.createWithIdNameAndDescription(1L, "512MB", "Server with 512MB RAM");
|
||||
|
||||
Set<? extends org.jclouds.compute.domain.Image> images = ImmutableSet.of(jcImage);
|
||||
Server server = createMock(Server.class);
|
||||
|
||||
expect(server.getId()).andReturn(1000l).atLeastOnce();
|
||||
expect(server.getId()).andReturn(1000L).atLeastOnce();
|
||||
expect(server.getName()).andReturn("group-ff").atLeastOnce();
|
||||
expect(server.getState()).andReturn(ServerState.ON).atLeastOnce();
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class ServerToNodeMetadataTest {
|
|||
expect(server.getImage()).andReturn(image).atLeastOnce();
|
||||
expect(server.getRam()).andReturn(ram).atLeastOnce();
|
||||
expect(server.getDatacenter()).andReturn(dc).atLeastOnce();
|
||||
expect(image.getId()).andReturn(2000l).atLeastOnce();
|
||||
expect(image.getId()).andReturn(2000L).atLeastOnce();
|
||||
expect(jcImage.getProviderId()).andReturn("2000").atLeastOnce();
|
||||
expect(jcImage.getLocation()).andReturn(location).atLeastOnce();
|
||||
expect(jcImage.getOperatingSystem()).andReturn(createMock(OperatingSystem.class)).atLeastOnce();
|
||||
|
|
|
@ -141,7 +141,7 @@ public class GridImageApiTest extends BaseGoGridApiTest<GridImageApi> {
|
|||
@Test
|
||||
public void testDeleteById() throws NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(GridImageApi.class, "deleteById", long.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11l));
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(11L));
|
||||
|
||||
assertRequestLineEquals(httpRequest, "GET https://api.gogrid.com/api/grid/image/delete?v=1.5&id=11 HTTP/1.1");
|
||||
assertNonPayloadHeadersEqual(httpRequest, "");
|
||||
|
|
|
@ -106,7 +106,7 @@ public class GridLoadBalancerApiTest extends BaseGoGridApiTest<GridLoadBalancerA
|
|||
@Test
|
||||
public void testEditLoadBalancer() throws NoSuchMethodException, IOException {
|
||||
Invokable<?, ?> method = method(GridLoadBalancerApi.class, "editLoadBalancer", long.class, List.class);
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(1l, ImmutableList.of(
|
||||
GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(1L, ImmutableList.of(
|
||||
IpPortPair.builder().ip(Ip.builder().ip("127.0.0.1").build()).port(8080).build(),
|
||||
IpPortPair.builder().ip(Ip.builder().ip("127.0.0.1").build()).port(9090).build())));
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ParseLoadBalancersFromJsonResponseTest {
|
|||
ParseLoadBalancerListFromJsonResponse parser = i.getInstance(ParseLoadBalancerListFromJsonResponse.class);
|
||||
SortedSet<LoadBalancer> response = parser.apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());
|
||||
|
||||
Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");
|
||||
Option dc = Option.createWithIdNameAndDescription(1L, "US-West-1", "US West 1 Datacenter");
|
||||
|
||||
LoadBalancer loadBalancer = LoadBalancer.builder().id(6372L).name("Balancer")
|
||||
.virtualIp(IpPortPair.builder().ip(Ip.builder().id(1313082L)
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ParseServerListTest extends BaseSetParserTest<Server> {
|
|||
@Override
|
||||
@SelectJson("list")
|
||||
public Set<Server> expected() {
|
||||
Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");
|
||||
Option dc = Option.createWithIdNameAndDescription(1L, "US-West-1", "US West 1 Datacenter");
|
||||
Option centOs = Option.createWithIdNameAndDescription(13L, "CentOS 5.2 (32-bit)", "CentOS 5.2 (32-bit)");
|
||||
Option webServer = Option.createWithIdNameAndDescription(1L, "Web Server", "Web or Application Server");
|
||||
return ImmutableSet.of(Server.builder().id(75245L).datacenter(dc).name("PowerServer").description("server to test the api. created by Alex")
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ParseServerTest extends BaseItemParserTest<Server> {
|
|||
@SelectJson("list")
|
||||
@OnlyElement
|
||||
public Server expected() {
|
||||
Option dc = Option.createWithIdNameAndDescription(1l, "US-West-1", "US West 1 Datacenter");
|
||||
Option dc = Option.createWithIdNameAndDescription(1L, "US-West-1", "US West 1 Datacenter");
|
||||
Option centOs = Option.createWithIdNameAndDescription(13L, "CentOS 5.2 (32-bit)", "CentOS 5.2 (32-bit)");
|
||||
Option webServer = Option.createWithIdNameAndDescription(1L, "Web Server", "Web or Application Server");
|
||||
return Server.builder().id(75245L).datacenter(dc).isSandbox(false).name("PowerServer").description("server to test the api. created by Alex")
|
||||
|
|
|
@ -62,7 +62,7 @@ public class StatusPredicateTest extends BaseProfitBricksMockTest {
|
|||
|
||||
Predicate<String> waitUntilAvailable = Predicates2.retry(
|
||||
new DataCenterProvisioningStatePredicate(pbApi, ProvisioningState.AVAILABLE),
|
||||
30l, 1l, TimeUnit.SECONDS);
|
||||
30L, 1L, TimeUnit.SECONDS);
|
||||
|
||||
String id = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";
|
||||
try {
|
||||
|
@ -95,7 +95,7 @@ public class StatusPredicateTest extends BaseProfitBricksMockTest {
|
|||
|
||||
Predicate<String> waitUntilAvailable = Predicates2.retry(
|
||||
new ServerStatusPredicate(pbApi, Server.Status.RUNNING),
|
||||
30l, 1l, TimeUnit.SECONDS);
|
||||
30L, 1L, TimeUnit.SECONDS);
|
||||
|
||||
String id = "qwertyui-qwer-qwer-qwer-qwertyyuiiop";
|
||||
try {
|
||||
|
@ -128,7 +128,7 @@ public class StatusPredicateTest extends BaseProfitBricksMockTest {
|
|||
|
||||
Predicate<String> waitUntilAvailable = Predicates2.retry(
|
||||
new SnapshotProvisioningStatePredicate(pbApi, ProvisioningState.AVAILABLE),
|
||||
30l, 1l, TimeUnit.SECONDS);
|
||||
30L, 1L, TimeUnit.SECONDS);
|
||||
|
||||
String id = "qswdefrg-qaws-qaws-defe-rgrgdsvcxbrh";
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue