mirror of https://github.com/apache/jclouds.git
Address Checkstyle violations
This commit is contained in:
parent
0df905a870
commit
0c005f8094
|
@ -66,7 +66,7 @@ public class SoftLayerProviderMetadata extends BaseProviderMetadata {
|
|||
.apiMetadata(new SoftLayerApiMetadata())
|
||||
.homepage(URI.create("http://www.softlayer.com"))
|
||||
.console(URI.create("https://manage.softlayer.com"))
|
||||
.iso3166Codes("SG","US-CA","US-TX","US-VA","US-WA","US-TX", "NL", "HK", "NSFTW-IL") // NSFTW-IL is a weird isoCode returned by Softlayer
|
||||
.iso3166Codes("SG", "US-CA", "US-TX", "US-VA", "US-WA", "US-TX", "NL", "HK", "NSFTW-IL") // NSFTW-IL is a weird isoCode returned by Softlayer
|
||||
.endpoint("https://api.softlayer.com/rest")
|
||||
.defaultProperties(SoftLayerProviderMetadata.defaultProperties());
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class VirtualGuestToJson implements Binder {
|
|||
templateObject = new TemplateObject(hostname, domain, startCpus, maxMemory, true,
|
||||
operatingSystemReferenceCode, null, localDiskFlag, new Datacenter(datacenterName), networkComponents,
|
||||
getBlockDevices(virtualGuest));
|
||||
} else if(virtualGuest.getVirtualGuestBlockDeviceTemplateGroup() != null) {
|
||||
} else if (virtualGuest.getVirtualGuestBlockDeviceTemplateGroup() != null) {
|
||||
String globalIdentifier = checkNotNull(virtualGuest.getVirtualGuestBlockDeviceTemplateGroup()
|
||||
.getGlobalIdentifier(), "blockDeviceTemplateGroup.globalIdentifier");
|
||||
templateObject = new TemplateObject(hostname, domain, startCpus, maxMemory, true, null,
|
||||
|
|
|
@ -38,7 +38,7 @@ import com.google.common.collect.Iterables;
|
|||
* Converts an Datacenter into a Location.
|
||||
*/
|
||||
@Singleton
|
||||
public class DatacenterToLocation implements Function<Datacenter,Location> {
|
||||
public class DatacenterToLocation implements Function<Datacenter, Location> {
|
||||
private final JustProvider provider;
|
||||
|
||||
// allow us to lazy discover the provider of a resource
|
||||
|
|
|
@ -57,12 +57,12 @@ public class OperatingSystemToImage implements Function<OperatingSystem, Image>
|
|||
OsFamily osFamily = OsFamily.UNRECOGNIZED;
|
||||
String osVersion = UNRECOGNIZED;
|
||||
Integer bits = null;
|
||||
if(optOSReferenceCode.isPresent()) {
|
||||
if (optOSReferenceCode.isPresent()) {
|
||||
String operatingSystemReferenceCode = optOSReferenceCode.get();
|
||||
osFamily = OperatingSystems.osFamily().apply(operatingSystemReferenceCode);
|
||||
bits = OperatingSystems.bits().apply(operatingSystemReferenceCode);
|
||||
}
|
||||
if(optVersion.isPresent()) {
|
||||
if (optVersion.isPresent()) {
|
||||
osVersion = OperatingSystems.version().apply(optVersion.get());
|
||||
}
|
||||
if (osFamily == OsFamily.UNRECOGNIZED) {
|
||||
|
|
|
@ -67,13 +67,13 @@ public class SoftLayerTemplateOptions extends TemplateOptions implements Cloneab
|
|||
if (to instanceof SoftLayerTemplateOptions) {
|
||||
SoftLayerTemplateOptions eTo = SoftLayerTemplateOptions.class.cast(to);
|
||||
eTo.domainName(domainName);
|
||||
if(blockDevices.isPresent()) {
|
||||
if (blockDevices.isPresent()) {
|
||||
eTo.blockDevices(blockDevices.get());
|
||||
}
|
||||
if(diskType.isPresent()) {
|
||||
if (diskType.isPresent()) {
|
||||
eTo.diskType(diskType.get());
|
||||
}
|
||||
if(portSpeed.isPresent()) {
|
||||
if (portSpeed.isPresent()) {
|
||||
eTo.portSpeed(portSpeed.get());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ public class SoftLayerComputeServiceAdapter implements
|
|||
.compare(h1.getRam(), h2.getRam())
|
||||
.compare(getSpace(h1), getSpace(h2))
|
||||
.compare(getBootableDeviceType(h1), getBootableDeviceType(h2));
|
||||
if(!volumes1.isEmpty() && !volumes2.isEmpty() && volumes1.size() == volumes2.size()) {
|
||||
if (!volumes1.isEmpty() && !volumes2.isEmpty() && volumes1.size() == volumes2.size()) {
|
||||
for (int i = 0; i < volumes1.size(); i++) {
|
||||
comparisonChain.compare(volumes1.get(i).getType(), volumes2.get(i).getType());
|
||||
}
|
||||
|
@ -285,7 +285,7 @@ public class SoftLayerComputeServiceAdapter implements
|
|||
return volume.getDevice().equals(BOOTABLE_DEVICE);
|
||||
}
|
||||
});
|
||||
if(!optionalBootableVolume.isPresent()) {
|
||||
if (!optionalBootableVolume.isPresent()) {
|
||||
return Type.LOCAL.ordinal();
|
||||
}
|
||||
return optionalBootableVolume.get().getType().ordinal();
|
||||
|
@ -352,9 +352,9 @@ public class SoftLayerComputeServiceAdapter implements
|
|||
Map<String, SoftwareDescription> softwareDescriptions = Maps.newHashMap();
|
||||
for (VirtualGuestBlockDeviceTemplateGroup image : images) {
|
||||
final String globalIdentifier = image.getGlobalIdentifier();
|
||||
for(VirtualGuestBlockDeviceTemplateGroup child : image.getChildren()) {
|
||||
for(VirtualGuestBlockDeviceTemplate blockDeviceTemplate : child.getBlockDevices()) {
|
||||
for(VirtualDiskImageSoftware softwareReference : blockDeviceTemplate.getDiskImage().getSoftwareReferences()) {
|
||||
for (VirtualGuestBlockDeviceTemplateGroup child : image.getChildren()) {
|
||||
for (VirtualGuestBlockDeviceTemplate blockDeviceTemplate : child.getBlockDevices()) {
|
||||
for (VirtualDiskImageSoftware softwareReference : blockDeviceTemplate.getDiskImage().getSoftwareReferences()) {
|
||||
softwareDescriptions.put(globalIdentifier, softwareReference.getSoftwareDescription());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ public class Address {
|
|||
this.isActive = isActive;
|
||||
this.locationId = locationId;
|
||||
this.postalCode = postalCode;
|
||||
this.country = checkNotNull(emptyToNull(country),"country cannot be null or empty:"+country);
|
||||
this.country = checkNotNull(emptyToNull(country), "country cannot be null or empty:" + country);
|
||||
this.state = state;
|
||||
this.description = description;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class Password {
|
|||
@ConstructorProperties({"id", "username", "password"})
|
||||
public Password(int id, String username, @Nullable String password) {
|
||||
this.id = id;
|
||||
this.username = checkNotNull(emptyToNull(username),"username cannot be null or empty:"+username);
|
||||
this.username = checkNotNull(emptyToNull(username), "username cannot be null or empty:" + username);
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class PowerState {
|
|||
|
||||
@ConstructorProperties("keyName")
|
||||
public PowerState(VirtualGuest.State keyName) {
|
||||
this.keyName = checkNotNull(keyName,"keyName cannot be null or empty:"+keyName);
|
||||
this.keyName = checkNotNull(keyName, "keyName cannot be null or empty:" + keyName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,9 +18,6 @@ package org.jclouds.softlayer.reference;
|
|||
|
||||
/**
|
||||
* Configuration properties and constants used in SoftLayer connections.
|
||||
*
|
||||
* @author Adrian Cole
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
public interface SoftLayerConstants {
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes
|
|||
assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
|
||||
assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
|
||||
assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
|
||||
assertEquals(defaultTemplate.getHardware().getRam(), 1*1024);
|
||||
assertEquals(defaultTemplate.getHardware().getRam(), 1 * 1024);
|
||||
assertEquals(getSpace(defaultTemplate.getHardware()), 25.0d);
|
||||
assertEquals(defaultTemplate.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
|
||||
// test that we bound the correct templateoptions in guice
|
||||
|
@ -134,7 +134,7 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes
|
|||
|
||||
Template template = context.getComputeService().templateBuilder().build();
|
||||
assertEquals(getCores(template.getHardware()), 1.0d);
|
||||
assertEquals(template.getHardware().getRam(), 1*1024);
|
||||
assertEquals(template.getHardware().getRam(), 1 * 1024);
|
||||
assertEquals(getSpace(template.getHardware()), 25.0d);
|
||||
assertEquals(template.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
|
||||
} finally {
|
||||
|
@ -147,7 +147,7 @@ public class SoftLayerTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTes
|
|||
public void testFastestTemplateBuilder() throws IOException {
|
||||
Template template = view.getComputeService().templateBuilder().fastest().build();
|
||||
assertEquals(getCores(template.getHardware()), 16.0d);
|
||||
assertEquals(template.getHardware().getRam(), 1*1024);
|
||||
assertEquals(template.getHardware().getRam(), 1 * 1024);
|
||||
assertEquals(getSpace(template.getHardware()), 25.0d);
|
||||
assertEquals(template.getHardware().getVolumes().get(0).getType(), Volume.Type.LOCAL);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.testng.annotations.Test;
|
|||
/**
|
||||
* Tests the function that transforms SoftLayer OperatingSystem to generic image.
|
||||
*/
|
||||
@Test(groups="unit", testName = "OperatingSystemToImageTest")
|
||||
@Test(groups = "unit", testName = "OperatingSystemToImageTest")
|
||||
public class OperatingSystemToImageTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.google.common.collect.Iterables;
|
|||
/**
|
||||
* Tests the function that transforms SoftLayer VirtualGuest to generic hardware.
|
||||
*/
|
||||
@Test(groups="unit", testName = "VirtualGuestToHardwareTest")
|
||||
@Test(groups = "unit", testName = "VirtualGuestToHardwareTest")
|
||||
public class VirtualGuestToHardwareTest {
|
||||
|
||||
@Test
|
||||
|
|
|
@ -33,7 +33,7 @@ import com.google.inject.Guice;
|
|||
/**
|
||||
* Tests the function that transforms SoftLayer VirtualGuest to generic image.
|
||||
*/
|
||||
@Test(groups="unit", testName = "VirtualGuestToImageTest")
|
||||
@Test(groups = "unit", testName = "VirtualGuestToImageTest")
|
||||
public class VirtualGuestToImageTest {
|
||||
|
||||
OperatingSystemToImage operatingSystemToImage = Guice.createInjector().getInstance(OperatingSystemToImage.class);
|
||||
|
|
|
@ -44,7 +44,7 @@ import com.google.inject.Guice;
|
|||
/**
|
||||
* Tests the function that transforms SoftLayer VirtualGuest to NodeMetadata.
|
||||
*/
|
||||
@Test(groups="unit", testName = "VirtualGuestToNodeMetadataTest")
|
||||
@Test(groups = "unit", testName = "VirtualGuestToNodeMetadataTest")
|
||||
public class VirtualGuestToNodeMetadataTest {
|
||||
|
||||
VirtualGuestToImage virtualGuestToImage = Guice.createInjector().getInstance(VirtualGuestToImage.class);
|
||||
|
|
|
@ -72,9 +72,9 @@ public class DatacenterApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
|
||||
assertEquals(response.size(), expected.size());
|
||||
|
||||
for(Datacenter datacenter: response) {
|
||||
for (Datacenter datacenter : response) {
|
||||
Address address = datacenter.getLocationAddress();
|
||||
if(address!=null) checkAddress(address);
|
||||
if (address != null) checkAddress(address);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ public class DatacenterApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
assertNotNull(dc.getId());
|
||||
assertNotNull(dc.getName());
|
||||
assertNotNull(dc.getLongName());
|
||||
for( Region region: dc.getRegions()) checkRegion(region);
|
||||
for (Region region : dc.getRegions()) checkRegion(region);
|
||||
}
|
||||
|
||||
private void checkRegion(Region region) {
|
||||
|
|
|
@ -132,7 +132,7 @@ public class VirtualGuestApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
guest = api().getVirtualGuest(virtualGuest.getId());
|
||||
return guest.getPowerState().getKeyName() == VirtualGuest.State.PAUSED;
|
||||
}
|
||||
}, 5*60*1000).apply(virtualGuest), "%s still not paused!", virtualGuest);
|
||||
}, 5 * 60 * 1000).apply(virtualGuest), "%s still not paused!", virtualGuest);
|
||||
VirtualGuest found = virtualGuestApi.getVirtualGuest(virtualGuest.getId());
|
||||
assertTrue(found.getPowerState().getKeyName() == VirtualGuest.State.PAUSED);
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ public class VirtualGuestApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
guest = api().getVirtualGuest(virtualGuest.getId());
|
||||
return guest.getPowerState().getKeyName() == VirtualGuest.State.RUNNING;
|
||||
}
|
||||
}, 5*60*1000).apply(virtualGuest), "%s still not running!", virtualGuest);
|
||||
}, 5 * 60 * 1000).apply(virtualGuest), "%s still not running!", virtualGuest);
|
||||
VirtualGuest found = virtualGuestApi.getVirtualGuest(virtualGuest.getId());
|
||||
assertTrue(found.getPowerState().getKeyName() == VirtualGuest.State.RUNNING);
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ public class VirtualGuestApiLiveTest extends BaseSoftLayerApiLiveTest {
|
|||
guest = api().getVirtualGuest(virtualGuest.getId());
|
||||
return guest.getActiveTransactionCount() == 0;
|
||||
}
|
||||
}, 5*60*1000).apply(virtualGuest), "%s still has active transactions!", virtualGuest);
|
||||
}, 5 * 60 * 1000).apply(virtualGuest), "%s still has active transactions!", virtualGuest);
|
||||
assertTrue(api().deleteVirtualGuest(virtualGuest.getId()));
|
||||
}
|
||||
|
||||
|
|
|
@ -24,9 +24,6 @@ import org.jclouds.softlayer.domain.VirtualGuest;
|
|||
import org.jclouds.softlayer.internal.BaseSoftLayerParseTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class CreateVirtualGuestResponseTest extends BaseSoftLayerParseTest<VirtualGuest> {
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class GetAllObjectsResponseTest extends BaseSoftLayerParseTest<Set<SoftwareDescription>> {
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@ import org.jclouds.softlayer.internal.BaseSoftLayerParseTest;
|
|||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
public class GetCreateObjectOptionsResponseTest extends BaseSoftLayerParseTest<ContainerVirtualGuestConfiguration> {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,9 +27,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class GetDatacenterResponseTest extends BaseSoftLayerParseTest<Datacenter> {
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class
|
||||
GetVirtualGuestBlockDeviceTemplateGroupsResponseTest extends
|
||||
|
|
|
@ -24,9 +24,6 @@ import org.jclouds.softlayer.domain.VirtualGuest;
|
|||
import org.jclouds.softlayer.internal.BaseSoftLayerParseTest;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class GetVirtualGuestResponseTest extends BaseSoftLayerParseTest<VirtualGuest> {
|
||||
|
||||
|
|
|
@ -27,9 +27,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class ListDatacentersResponseTest extends BaseSoftLayerParseTest<Set<Datacenter>> {
|
||||
|
||||
|
|
|
@ -31,9 +31,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class ListPublicImagesResponseTest extends
|
||||
BaseSoftLayerParseTest<Set<VirtualGuestBlockDeviceTemplateGroup>> {
|
||||
|
|
|
@ -28,9 +28,6 @@ import org.testng.annotations.Test;
|
|||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
/**
|
||||
* @author Andrea Turli
|
||||
*/
|
||||
@Test(groups = "unit")
|
||||
public class ListVirtualGuestsResponseTest extends BaseSoftLayerParseTest<Set<VirtualGuest>> {
|
||||
|
||||
|
|
Loading…
Reference in New Issue