Author: adietish
Date: 2010-10-21 09:55:20 -0400 (Thu, 21 Oct 2010)
New Revision: 25973
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java
Log:
[JBIDE-7371] completed listImages test
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java
===================================================================
---
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java 2010-10-21
13:42:24 UTC (rev 25972)
+++
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/DeltaCloudMockClientIntegrationTest.java 2010-10-21
13:55:20 UTC (rev 25973)
@@ -8,11 +8,13 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
+import java.util.List;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.jboss.tools.deltacloud.core.client.DeltaCloudClient;
import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Image;
import org.jboss.tools.internal.deltacloud.test.fakes.ServerFake;
import org.junit.Before;
import org.junit.Test;
@@ -78,7 +80,19 @@
}
@Test
- public void canListImages() throws DeltaCloudClientException {
- client.listImages();
+ public void canListMockImages() throws DeltaCloudClientException {
+ List<Image> images = client.listImages();
+ assertEquals(3, images.size());
+ assertImage("img2", "Fedora 10", "fedoraproject",
"Fedora 10", "i386", images.get(0));
+ assertImage("img1", "Fedora 10", "fedoraproject",
"Fedora 10", "x86_64", images.get(1));
+ assertImage("img3", "JBoss", "mockuser",
"JBoss", "i386", images.get(2));
}
+
+ private void assertImage(String id, String name, String owner, String description,
String architecture, Image image) {
+ assertEquals(id, image.getId());
+ assertEquals(name, image.getName());
+ assertEquals(owner, image.getOwnerId());
+ assertEquals(architecture, image.getArchitecture());
+ assertEquals(description, image.getDescription());
+ }
}
Show replies by date