fixed bad test assertions in openstack-nova

This commit is contained in:
Adrian Cole 2012-09-16 12:23:39 -07:00
parent 85b5006084
commit f7feb0248a
2 changed files with 10 additions and 19 deletions

View File

@ -69,10 +69,10 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest {
assertTrue(image.getMinRam() > 0);
assertTrue(image.getProgress() >= 0 && image.getProgress() <= 100);
assertNotNull(image.getStatus());
assertNotNull(image.getServer());
assertNotNull(image.getTenantId());
assertNotNull(image.getUpdated());
assertNotNull(image.getUserId());
// image.getServer() can be null
// image.getTenantId() can be null
// image.getUpdated() can be null
// image.getUserId() can be null
}
}
}

View File

@ -19,9 +19,9 @@
package org.jclouds.openstack.nova.v2_0.features;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.*;
import java.util.Set;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import org.jclouds.openstack.nova.v2_0.domain.Server;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
@ -44,12 +44,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
public void testListServers() throws Exception {
for (String zoneId : zones) {
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
Set<? extends Resource> response = api.list().concat().toImmutableSet();
assertNotNull(response);
assertFalse(response.isEmpty());
assert null != response;
assertTrue(response.size() >= 0);
for (Resource server : response) {
for (Resource server : api.list().concat()) {
checkResource(server);
}
}
@ -59,10 +54,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
public void testListServersInDetail() throws Exception {
for (String zoneId : zones) {
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
Set<? extends Server> response = api.listInDetail().concat().toImmutableSet();
assertNotNull(response);
assertFalse(response.isEmpty());
for (Server server : response) {
for (Server server : api.listInDetail().concat()) {
checkServer(server);
}
}
@ -72,8 +64,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest {
public void testGetServerById() throws Exception {
for (String zoneId : zones) {
ServerApi api = novaContext.getApi().getServerApiForZone(zoneId);
Set<? extends Resource> response = api.list().concat().toImmutableSet();
for (Resource server : response) {
for (Resource server : api.list().concat()) {
Server details = api.get(server.getId());
assertEquals(details.getId(), server.getId());
assertEquals(details.getName(), server.getName());