mirror of
https://github.com/apache/jclouds.git
synced 2026-08-06 20:26:54 +00:00
Address error-prone errors
Mostly of the form, Collection.size() >= 0.
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@ public class AddressApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
return;
|
||||
Set<PublicIPAddress> response = client.getAddressApi().listPublicIPAddresses();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (PublicIPAddress ip : response) {
|
||||
PublicIPAddress newDetails = getOnlyElement(client.getAddressApi().listPublicIPAddresses(
|
||||
ListPublicIPAddressesOptions.Builder.id(ip.getId())));
|
||||
|
||||
@@ -33,7 +33,7 @@ public class EventApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testlistEventTypes() throws Exception {
|
||||
final Set<String> response = client.getEventApi().listEventTypes();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (String type : response) {
|
||||
checkEventType(type);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class EventApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testlistEvents() throws Exception {
|
||||
final Set<Event> response = client.getEventApi().listEvents();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (Event event : response) {
|
||||
checkEvent(event);
|
||||
}
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ public class FirewallApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListPortForwardingRules() throws Exception {
|
||||
Set<PortForwardingRule> response = client.getFirewallApi().listPortForwardingRules();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (final PortForwardingRule rule : response) {
|
||||
checkPortForwardingRule(rule);
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class GlobalAlertApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
|
||||
final Set<Alert> response = globalAdminClient.getAlertClient().listAlerts();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
int count = 0;
|
||||
for (Alert alert : response) {
|
||||
assertNotNull(alert.getDescription());
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class GlobalUsageApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
|
||||
Set<UsageRecord> records = globalAdminClient.getUsageClient().listUsageRecords(start, end, ListUsageRecordsOptions.NONE);
|
||||
assertNotNull(records);
|
||||
assertTrue(records.size() >= 0);
|
||||
assertTrue(records.size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ public class GuestOSApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListOSTypes() throws Exception {
|
||||
Set<OSType> response = client.getGuestOSApi().listOSTypes();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (OSType type : response) {
|
||||
OSType newDetails = getOnlyElement(client.getGuestOSApi().listOSTypes(
|
||||
ListOSTypesOptions.Builder.id(type.getId())));
|
||||
@@ -50,7 +50,7 @@ public class GuestOSApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListOSCategories() throws Exception {
|
||||
Map<String, String> response = client.getGuestOSApi().listOSCategories();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (Entry<String, String> category : response.entrySet()) {
|
||||
checkOSCategory(category);
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public class HypervisorApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListHypervisors() throws Exception {
|
||||
Set<String> response = client.getHypervisorApi().listHypervisors();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (Zone zone : client.getZoneApi().listZones()) {
|
||||
Set<String> zoneHype = client.getHypervisorApi().listHypervisorsInZone(zone.getId());
|
||||
assert response.containsAll(zoneHype);
|
||||
|
||||
+1
-1
@@ -191,7 +191,7 @@ public class LoadBalancerApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListLoadBalancerRules() throws Exception {
|
||||
Set<LoadBalancerRule> response = client.getLoadBalancerApi().listLoadBalancerRules();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (LoadBalancerRule rule : response) {
|
||||
LoadBalancerRule newDetails = findRuleWithId(rule.getId());
|
||||
assertEquals(rule.getId(), newDetails.getId());
|
||||
|
||||
@@ -38,7 +38,7 @@ public class NATApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListIPForwardingRules() throws Exception {
|
||||
Set<IPForwardingRule> response = client.getNATApi().listIPForwardingRules();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (IPForwardingRule rule : response) {
|
||||
IPForwardingRule newDetails = getOnlyElement(client.getNATApi().listIPForwardingRules(
|
||||
ListIPForwardingRulesOptions.Builder.id(rule.getId())));
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ public class VirtualMachineApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
public void testListVirtualMachines() throws Exception {
|
||||
Set<VirtualMachine> response = client.getVirtualMachineApi().listVirtualMachines();
|
||||
assert null != response;
|
||||
assertTrue(response.size() >= 0);
|
||||
assertTrue(response.size() > 0);
|
||||
for (VirtualMachine vm : response) {
|
||||
VirtualMachine newDetails = getOnlyElement(client.getVirtualMachineApi().listVirtualMachines(
|
||||
ListVirtualMachinesOptions.Builder.id(vm.getId())));
|
||||
@@ -392,7 +392,7 @@ public class VirtualMachineApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
}
|
||||
|
||||
}
|
||||
assert vm.getSecurityGroups() != null && vm.getSecurityGroups().size() >= 0 : vm;
|
||||
assert vm.getSecurityGroups() != null && vm.getSecurityGroups().size() > 0 : vm;
|
||||
assert vm.getHypervisor() != null : vm;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ public class ZoneApiLiveTest extends BaseCloudStackApiLiveTest {
|
||||
break;
|
||||
case BASIC:
|
||||
assert zone.getVLAN() == null : zone;
|
||||
assert zone.getDNS().size() >= 0 : zone;
|
||||
assert zone.getInternalDNS().size() >= 0 : zone;
|
||||
assert zone.getDNS().size() > 0 : zone;
|
||||
assert zone.getInternalDNS().size() > 0 : zone;
|
||||
assert zone.getDomain() == null : zone;
|
||||
assert zone.getDomainId() == null : zone;
|
||||
assert zone.getGuestCIDRAddress() == null : zone;
|
||||
|
||||
Reference in New Issue
Block a user