mirror of https://github.com/apache/jclouds.git
fixed bad test assertions in openstack-nova
This commit is contained in:
parent
85b5006084
commit
f7feb0248a
|
@ -69,10 +69,10 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
|
||||||
assertTrue(image.getMinRam() > 0);
|
assertTrue(image.getMinRam() > 0);
|
||||||
assertTrue(image.getProgress() >= 0 && image.getProgress() <= 100);
|
assertTrue(image.getProgress() >= 0 && image.getProgress() <= 100);
|
||||||
assertNotNull(image.getStatus());
|
assertNotNull(image.getStatus());
|
||||||
assertNotNull(image.getServer());
|
// image.getServer() can be null
|
||||||
assertNotNull(image.getTenantId());
|
// image.getTenantId() can be null
|
||||||
assertNotNull(image.getUpdated());
|
// image.getUpdated() can be null
|
||||||
assertNotNull(image.getUserId());
|
// image.getUserId() can be null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
package org.jclouds.openstack.nova.v2_0.features;
|
package org.jclouds.openstack.nova.v2_0.features;
|
||||||
|
|
||||||
import static org.testng.Assert.assertEquals;
|
import static org.testng.Assert.assertEquals;
|
||||||
import static org.testng.Assert.*;
|
import static org.testng.Assert.assertFalse;
|
||||||
|
import static org.testng.Assert.assertNotNull;
|
||||||
import java.util.Set;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
import org.jclouds.openstack.nova.v2_0.domain.Server;
|
import org.jclouds.openstack.nova.v2_0.domain.Server;
|
||||||
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
|
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
|
||||||
|
@ -44,12 +44,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
|
||||||
public void testListServers() throws Exception {
|
public void testListServers() throws Exception {
|
||||||
for (String zoneId : zones) {
|
for (String zoneId : zones) {
|
||||||
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
||||||
Set<? extends Resource> response = api.list().concat().toImmutableSet();
|
for (Resource server : api.list().concat()) {
|
||||||
assertNotNull(response);
|
|
||||||
assertFalse(response.isEmpty());
|
|
||||||
assert null != response;
|
|
||||||
assertTrue(response.size() >= 0);
|
|
||||||
for (Resource server : response) {
|
|
||||||
checkResource(server);
|
checkResource(server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,10 +54,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
|
||||||
public void testListServersInDetail() throws Exception {
|
public void testListServersInDetail() throws Exception {
|
||||||
for (String zoneId : zones) {
|
for (String zoneId : zones) {
|
||||||
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
||||||
Set<? extends Server> response = api.listInDetail().concat().toImmutableSet();
|
for (Server server : api.listInDetail().concat()) {
|
||||||
assertNotNull(response);
|
|
||||||
assertFalse(response.isEmpty());
|
|
||||||
for (Server server : response) {
|
|
||||||
checkServer(server);
|
checkServer(server);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +64,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
|
||||||
public void testGetServerById() throws Exception {
|
public void testGetServerById() throws Exception {
|
||||||
for (String zoneId : zones) {
|
for (String zoneId : zones) {
|
||||||
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
|
||||||
Set<? extends Resource> response = api.list().concat().toImmutableSet();
|
for (Resource server : api.list().concat()) {
|
||||||
for (Resource server : response) {
|
|
||||||
Server details = api.get(server.getId());
|
Server details = api.get(server.getId());
|
||||||
assertEquals(details.getId(), server.getId());
|
assertEquals(details.getId(), server.getId());
|
||||||
assertEquals(details.getName(), server.getName());
|
assertEquals(details.getName(), server.getName());
|
||||||
|
|
Loading…
Reference in New Issue