guard against task already finished in createMedia test

This commit is contained in:
danikov 2012-03-20 16:45:22 +00:00
parent ee2a7e96ba
commit 13cf27cd0f
1 changed files with 4 additions and 3 deletions

View File

@ -143,9 +143,10 @@ public class MediaClientLiveTest extends BaseVCloudDirectorClientLiveTest {
media = mediaClient.getMedia(media.getHref());
Task task = Iterables.getOnlyElement(media.getTasks());
assertEquals(task.getStatus(), "running");
if (media.getTasks().size() == 1) {
Task task = Iterables.getOnlyElement(media.getTasks());
assertEquals(task.getStatus(), "running");
}
File file = Iterables.getOnlyElement(media.getFiles());
assertEquals(file.getSize(), new Long(iso.length));