fix broken test

This commit is contained in:
Adrian Cole 2012-03-07 09:51:46 -08:00
parent 40429eaeca
commit 7e87185858
2 changed files with 7 additions and 4 deletions

View File

@ -24,6 +24,7 @@ import java.net.URI;
import java.util.Set; import java.util.Set;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.base.Objects; import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper; import com.google.common.base.Objects.ToStringHelper;
@ -37,6 +38,7 @@ import com.google.common.base.Objects.ToStringHelper;
* *
* @author danikov * @author danikov
*/ */
@XmlRootElement(name = "Catalog")
public class CatalogType<T extends CatalogType<T>> extends EntityType<T> { public class CatalogType<T extends CatalogType<T>> extends EntityType<T> {
public static <T extends CatalogType<T>> Builder<T> builder() { public static <T extends CatalogType<T>> Builder<T> builder() {

View File

@ -26,9 +26,9 @@ import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.VCloudDirectorClient;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Catalog;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItem; import org.jclouds.vcloud.director.v1_5.domain.CatalogItem;
import org.jclouds.vcloud.director.v1_5.domain.CatalogItems; import org.jclouds.vcloud.director.v1_5.domain.CatalogItems;
import org.jclouds.vcloud.director.v1_5.domain.CatalogType;
import org.jclouds.vcloud.director.v1_5.domain.Link; import org.jclouds.vcloud.director.v1_5.domain.Link;
import org.jclouds.vcloud.director.v1_5.domain.Metadata; import org.jclouds.vcloud.director.v1_5.domain.Metadata;
import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry; import org.jclouds.vcloud.director.v1_5.domain.MetadataEntry;
@ -67,7 +67,7 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT
VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse); VCloudDirectorClient client = requestsSendResponses(loginRequest, sessionResponse, catalogRequest, catalogResponse);
Catalog expected = catalog(); CatalogType<?> expected = catalog();
URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4"); URI catalogURI = URI.create(endpoint + "/catalog/7212e451-76e1-4631-b2de-ba1dfd8080e4");
assertEquals(client.getCatalogClient().getCatalog(catalogURI), expected); assertEquals(client.getCatalogClient().getCatalog(catalogURI), expected);
@ -376,8 +376,9 @@ public class CatalogClientExpectTest extends BaseVCloudDirectorRestClientExpectT
assertEquals(client.getCatalogClient().getMetadataClient().deleteMetadataEntry(catalogItemURI, "KEY"), expected); assertEquals(client.getCatalogClient().getMetadataClient().deleteMetadataEntry(catalogItemURI, "KEY"), expected);
} }
public static final Catalog catalog() { @SuppressWarnings("unchecked")
return Catalog.builder() public static final CatalogType<?> catalog() {
return CatalogType.<CatalogType>builder()
.name("QunyingTestCatalog") .name("QunyingTestCatalog")
.type("application/vnd.vmware.vcloud.catalog+xml") .type("application/vnd.vmware.vcloud.catalog+xml")
.id("urn:vcloud:catalog:7212e451-76e1-4631-b2de-ba1dfd8080e4") .id("urn:vcloud:catalog:7212e451-76e1-4631-b2de-ba1dfd8080e4")