gogrid: improving GridImageClientLiveTest

This commit is contained in:
Adam Lowe 2012-07-06 16:58:55 +01:00
parent 3c01b3171b
commit 9af07d0073
1 changed files with 6 additions and 5 deletions

View File

@ -69,7 +69,7 @@ public class GridImageClientLiveTest extends BaseGoGridClientLiveTest {
assert image.getArchitecture() != null : image; assert image.getArchitecture() != null : image;
assert image.getBillingTokens() != null : image; assert image.getBillingTokens() != null : image;
if (image.getCreatedTime() == null) if (image.getCreatedTime() == null)
Logger.getAnonymousLogger().warning("image " + image.getId() + " is missing the createdon field"); Logger.getAnonymousLogger().warning("image " + image.getId() + " is missing the createdTime field");
assert image.getDescription() != null : image; assert image.getDescription() != null : image;
assert image.getFriendlyName() != null : image; assert image.getFriendlyName() != null : image;
assert image.getId() >= 0 : image; assert image.getId() >= 0 : image;
@ -81,7 +81,7 @@ public class GridImageClientLiveTest extends BaseGoGridClientLiveTest {
assert image.getState() != null : image; assert image.getState() != null : image;
assert image.getType() != null : image; assert image.getType() != null : image;
if (image.getUpdatedTime() == null) if (image.getUpdatedTime() == null)
Logger.getAnonymousLogger().warning("image " + image.getId() + " is missing the updatedon field"); Logger.getAnonymousLogger().warning("image " + image.getId() + " is missing the updatedTime field");
} }
@Test @Test
@ -92,7 +92,7 @@ public class GridImageClientLiveTest extends BaseGoGridClientLiveTest {
final String nameOfServer = "Server" + String.valueOf(new Date().getTime()).substring(6); final String nameOfServer = "Server" + String.valueOf(new Date().getTime()).substring(6);
ServerImage image = null; ServerImage image = null;
try { try {
Set<Ip> availableIps = restContext.getApi().getIpServices().getUnassignedIpList(); Set<Ip> availableIps = restContext.getApi().getIpServices().getUnassignedPublicIpList();
Ip availableIp = Iterables.getLast(availableIps); Ip availableIp = Iterables.getLast(availableIps);
Server createdServer = restContext.getApi().getServerServices() Server createdServer = restContext.getApi().getServerServices()
@ -115,6 +115,7 @@ public class GridImageClientLiveTest extends BaseGoGridClientLiveTest {
assertEventuallyImageStateEquals(image, ServerImageState.TRASH); assertEventuallyImageStateEquals(image, ServerImageState.TRASH);
image = null;
} finally { } finally {
if (image != null) if (image != null)
try { try {
@ -138,6 +139,6 @@ public class GridImageClientLiveTest extends BaseGoGridClientLiveTest {
.getApi() .getApi()
.getImageServices().getImagesById(input.getId())).getState() == state; .getImageServices().getImagesById(input.getId())).getState() == state;
} }
}, 300, 1, TimeUnit.SECONDS).apply(image)); }, 600, 1, TimeUnit.SECONDS).apply(image));
} }
} }