You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2013/08/02 23:30:26 UTC
[5/6] Removing OpenStack modules from Labs repo (now in
jclouds-labs-openstack)
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
deleted file mode 100644
index e070fe1..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/ListImageOptions.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_DISK;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_RAM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.NAME;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROTECTED;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE_MAX;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE_MIN;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.STATUS;
-
-import java.util.Date;
-
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image.Status;
-import org.jclouds.openstack.v2_0.options.PaginationOptions;
-
-/**
- * <h2></h2>Usage</h2> The recommended way to instantiate a ListImageOptions object is to statically import
- * ListImageOptions.Builder.* and invoke a static creation method for each option as needed:
- * <p/>
- * <code>
- * import static org.jclouds.openstack.glance.v1_0.options.ListImageOptions.Builder.*
- *
- *
- * // this will list the first 10 images with the name "name", minimum required disk of 5GB.
- * list = api.list(name("newName"), limit(10), minDisk(5));
- * <code>
- *
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html"/>
- */
-public class ListImageOptions extends PaginationOptions {
- public static final ListImageOptions NONE = new ListImageOptions();
-
- /**
- * Return only those images having a matching name attribute
- */
- public ListImageOptions name(String name) {
- queryParameters.put(NAME.asParam(), name);
- return this;
- }
-
- /**
- * Return only those images that have the requested status
- */
- public ListImageOptions status(Status status) {
- queryParameters.put(STATUS.asParam(), status.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching container format
- */
- public ListImageOptions containerFormat(ContainerFormat containerFormat) {
- queryParameters.put(CONTAINER_FORMAT.asParam(), containerFormat.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching disk format
- */
- public ListImageOptions diskFormat(DiskFormat diskFormat) {
- queryParameters.put(DISK_FORMAT.asParam(), diskFormat.toString());
- return this;
- }
-
- /**
- * Return only those images having a matching min ram size
- */
- public ListImageOptions minRam(long ram) {
- queryParameters.put(MIN_RAM.asParam(), Long.toString(ram));
- return this;
- }
-
- /**
- * Return only those images having a matching min disk size
- */
- public ListImageOptions minDisk(long disk) {
- queryParameters.put(MIN_DISK.asParam(), Long.toString(disk));
- return this;
- }
-
- /**
- * Return those images that have a size attribute greater than or equal to size
- */
- public ListImageOptions minSize(long size) {
- queryParameters.put(SIZE_MIN.asParam(), Long.toString(size));
- return this;
- }
-
- /**
- * Return those images that have a size attribute less than or equal to size
- */
- public ListImageOptions maxSize(long size) {
- queryParameters.put(SIZE_MAX.asParam(), Long.toString(size));
- return this;
- }
-
- /**
- * Return only public images or only private images
- */
- public ListImageOptions isPublic(boolean isPublic) {
- queryParameters.put(IS_PUBLIC.asParam(), Boolean.toString(isPublic));
- return this;
- }
-
- /**
- * Filter to only protected or unprotected images
- */
- public ListImageOptions isProtected(boolean isProtected) {
- queryParameters.put(PROTECTED.asParam(), Boolean.toString(isProtected));
- return this;
- }
-
- /**
- * Results will be ordered by the specified image attribute.
- */
- public ListImageOptions sortBy(ImageField key) {
- queryParameters.put("sort_key", key.asParam());
- return this;
- }
-
- /**
- * Ascending sort order (smallest first).
- * <p/>
- * NOTE: default behavior is to sort descending (largest first)
- */
- public ListImageOptions sortAscending() {
- queryParameters.put("sort_dir", "asc");
- return this;
- }
-
- public static class Builder {
- /**
- * @see ListImageOptions#name
- */
- public static ListImageOptions name(String name) {
- return new ListImageOptions().name(name);
- }
-
- /**
- * @see ListImageOptions#diskFormat
- */
- public static ListImageOptions diskFormat(DiskFormat diskFormat) {
- return new ListImageOptions().diskFormat(diskFormat);
- }
-
- /**
- * @see ListImageOptions#containerFormat
- */
- public static ListImageOptions containerFormat(ContainerFormat containerFormat) {
- return new ListImageOptions().containerFormat(containerFormat);
- }
-
- /**
- * @see ListImageOptions#minRam
- */
- public static ListImageOptions minRam(long size) {
- return new ListImageOptions().minRam(size);
- }
-
-
- /**
- * @see ListImageOptions#minDisk
- */
- public static ListImageOptions minDisk(long size) {
- return new ListImageOptions().minDisk(size);
- }
-
- /**
- * @see ListImageOptions#minSize
- */
- public static ListImageOptions minSize(long size) {
- return new ListImageOptions().minSize(size);
- }
-
- /**
- * @see ListImageOptions#maxSize
- */
- public static ListImageOptions maxSize(long size) {
- return new ListImageOptions().maxSize(size);
- }
-
- /**
- * @see ListImageOptions#sortBy
- */
- public static ListImageOptions status(Status status) {
- return new ListImageOptions().status(status);
- }
-
- /**
- * @see ListImageOptions#sortBy
- */
- public static ListImageOptions sortBy(ImageField sortKey) {
- return new ListImageOptions().sortBy(sortKey);
- }
-
- /**
- * @see ListImageOptions#sortAscending
- */
- public static ListImageOptions sortAscending() {
- return new ListImageOptions().sortAscending();
- }
-
- /**
- * @see ListImageOptions#isPublic
- */
- public static ListImageOptions isPublic(boolean isPublic) {
- return ListImageOptions.class.cast(new ListImageOptions().isPublic(isPublic));
- }
-
- /**
- * @see ListImageOptions#isProtected
- */
- public static ListImageOptions isProtected(boolean isProtected) {
- return ListImageOptions.class.cast(new ListImageOptions().isProtected(isProtected));
- }
-
- /**
- * @see ListImageOptions#limit
- */
- public static ListImageOptions limit(int limit) {
- return new ListImageOptions().limit(limit);
- }
-
- /**
- * @see ListImageOptions#marker
- */
- public static ListImageOptions marker(String marker) {
- return new ListImageOptions().marker(marker);
- }
- }
-
- @Override
- public ListImageOptions changesSince(Date ifModifiedSince) {
- return ListImageOptions.class.cast(super.changesSince(ifModifiedSince));
- }
-
- @Override
- public ListImageOptions marker(String marker) {
- return ListImageOptions.class.cast(super.marker(marker));
- }
-
- @Override
- public ListImageOptions limit(int limit) {
- return ListImageOptions.class.cast(super.limit(limit));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java b/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
deleted file mode 100644
index 5701b8d..0000000
--- a/openstack/openstack-glance/src/main/java/org/jclouds/openstack/glance/v1_0/options/UpdateImageOptions.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.options;
-
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CHECKSUM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.CONTAINER_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.DISK_FORMAT;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.IS_PUBLIC;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.LOCATION;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_DISK;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.MIN_RAM;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.NAME;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.OWNER;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROPERTY;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.PROTECTED;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.SIZE;
-import static org.jclouds.openstack.glance.v1_0.options.ImageField.STORE;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.StoreType;
-
-/**
- * <h2></h2>Usage</h2> The recommended way to instantiate a UpdateImageOptions object is to statically import
- * UpdateImageOptions.Builder.* and invoke a static creation method for each option as needed:
- * <p/>
- * <code>
- * import static org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions.Builder.*
- *
- *
- * // this will adjust the image with id 'id' the name "newName", minimum required disk of 5GB, etc.
- * details = api.update(id, name("newName"), minDisk(5), isPublic(true), property("mykey", "somevalue"));
- * <code>
- * @author Adam Lowe
- * @see <a href="http://glance.openstack.org/glanceapi.html"/>
- */
-public class UpdateImageOptions extends BaseHttpRequestOptions {
-
- /**
- * Adjust the name of the image
- */
- public UpdateImageOptions name(String name) {
- headers.put(NAME.asHeader(), name);
- return this;
- }
-
- /**
- * When present, Glance will attempt to store the disk image data in the backing store indicated by the value of the
- * header. If the Glance node does not support the backing store, Glance will return a 400 Bad Request.
- */
- public UpdateImageOptions storeType(StoreType storeType) {
- headers.put(STORE.asHeader(), storeType.toString());
- return this;
- }
-
- public UpdateImageOptions diskFormat(DiskFormat diskFormat) {
- headers.put(DISK_FORMAT.asHeader(), diskFormat.toString());
- return this;
- }
-
- public UpdateImageOptions containerFormat(ContainerFormat containerFormat) {
- headers.put(CONTAINER_FORMAT.asHeader(), containerFormat.toString());
- return this;
- }
-
- /**
- * When present, Glance assumes that the expected size of the request body will be the value of this header. If the
- * length in bytes of the request body does not match the value of this header, Glance will return a 400 Bad Request.
- */
- public UpdateImageOptions size(long size) {
- headers.put(SIZE.asHeader(), Long.toString(size));
- return this;
- }
-
- /**
- * MD5 checksum of the image
- * <p/>
- * When present, Glance will verify the checksum generated from the backend store when storing your image against
- * this value and return a 400 Bad Request if the values do not match.
- */
- public UpdateImageOptions checksum(String checksum) {
- headers.put(CHECKSUM.asHeader(), checksum);
- return this;
- }
-
- public UpdateImageOptions location(String location) {
- headers.put(LOCATION.asHeader(), location);
- return this;
- }
-
- /**
- * Mark the image as public, meaning that any user may view its metadata and may read the disk image
- * from Glance.
- */
- public UpdateImageOptions isPublic(boolean isPublic) {
- headers.put(IS_PUBLIC.asHeader(), Boolean.toString(isPublic));
- return this;
- }
-
- /**
- * Mark the image as protected - if set to true the image cannot be deleted till it is unset.
- */
- public UpdateImageOptions isProtected(boolean isProtected) {
- headers.put(PROTECTED.asHeader(), Boolean.toString(isProtected));
- return this;
- }
-
- /**
- * The expected minimum ram required in megabytes to run this image on a server (default 0).
- */
- public UpdateImageOptions minRam(long ram) {
- headers.put(MIN_RAM.asHeader(), Long.toString(ram));
- return this;
- }
-
- /**
- * The expected minimum disk required in gigabytes to run this image on a server (default 0).
- */
- public UpdateImageOptions minDisk(long disk) {
- headers.put(MIN_DISK.asHeader(), Long.toString(disk));
- return this;
- }
-
- /**
- * Glance normally sets the owner of an image to be the tenant or user (depending on the “owner_is_tenant”
- * configuration option) of the authenticated user issuing the request. However, if the authenticated user has the
- * Admin role, this default may be overridden by setting this header to null or to a string identifying the owner of
- * the image.
- */
- public UpdateImageOptions owner(String owner) {
- headers.put(OWNER.asHeader(), owner);
- return this;
- }
-
- /**
- * Custom, free-form image properties stored with the image.
- */
- public UpdateImageOptions property(String key, String value) {
- if (!key.toLowerCase().startsWith(PROPERTY.asHeader() + "-")) {
- key = PROPERTY.asHeader() + "-" + key;
- }
- headers.put(key, value);
- return this;
- }
-
- public static class Builder {
- /**
- * @see UpdateImageOptions#name
- */
- public static UpdateImageOptions name(String name) {
- return new UpdateImageOptions().name(name);
- }
-
- /**
- * @see UpdateImageOptions#storeType
- */
- public static UpdateImageOptions storeType(StoreType storeType) {
- return new UpdateImageOptions().storeType(storeType);
- }
-
- /**
- * @see UpdateImageOptions#diskFormat
- */
- public static UpdateImageOptions diskFormat(DiskFormat diskFormat) {
- return new UpdateImageOptions().diskFormat(diskFormat);
- }
-
- /**
- * @see UpdateImageOptions#containerFormat
- */
- public static UpdateImageOptions containerFormat(ContainerFormat containerFormat) {
- return new UpdateImageOptions().containerFormat(containerFormat);
- }
-
- /**
- * @see UpdateImageOptions#size
- */
- public static UpdateImageOptions size(long size) {
- return new UpdateImageOptions().size(size);
- }
-
- /**
- * @see UpdateImageOptions#checksum
- */
- public static UpdateImageOptions checksum(String checksum) {
- return new UpdateImageOptions().checksum(checksum);
- }
-
- /**
- * @see UpdateImageOptions#location
- */
- public static UpdateImageOptions location(String location) {
- return new UpdateImageOptions().location(location);
- }
-
- /**
- * @see UpdateImageOptions#isPublic
- */
- public static UpdateImageOptions isPublic(boolean isPublic) {
- return new UpdateImageOptions().isPublic(isPublic);
- }
-
- /**
- * @see UpdateImageOptions#isProtected
- */
- public static UpdateImageOptions isProtected(boolean isProtected) {
- return new UpdateImageOptions().isProtected(isProtected);
- }
-
- /**
- * @see UpdateImageOptions#minRam
- */
- public static UpdateImageOptions minRam(long ram) {
- return new UpdateImageOptions().minRam(ram);
- }
-
- /**
- * @see UpdateImageOptions#minDisk
- */
- public static UpdateImageOptions minDisk(long disk) {
- return new UpdateImageOptions().minDisk(disk);
- }
-
- /**
- * @see UpdateImageOptions#owner
- */
- public static UpdateImageOptions owner(String owner) {
- return new UpdateImageOptions().owner(owner);
- }
-
- /**
- * @see UpdateImageOptions#property
- */
- public static UpdateImageOptions property(String key, String value) {
- return new UpdateImageOptions().property(key, value);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index c010366..0000000
--- a/openstack/openstack-glance/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.openstack.glance.v1_0.GlanceApiMetadata
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
deleted file mode 100644
index dd1b856..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/GlanceApiMetadataTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0;
-
-import org.jclouds.View;
-import org.jclouds.apis.internal.BaseApiMetadataTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "GlanceApiMetadataTest")
-public class GlanceApiMetadataTest extends BaseApiMetadataTest {
- public GlanceApiMetadataTest() {
- super(new GlanceApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
deleted file mode 100644
index 7236aff..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiExpectTest.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.io.Payloads;
-import org.jclouds.io.payloads.StringPayload;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.glance.v1_0.functions.ParseImageDetailsFromHeadersTest;
-import org.jclouds.openstack.glance.v1_0.internal.BaseGlanceApiExpectTest;
-import org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImageDetailsTest;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImagesInDetailTest;
-import org.jclouds.openstack.glance.v1_0.parse.ParseImagesTest;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMultimap;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * @author Adrian Cole
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ImageApiExpectTest")
-public class ImageApiExpectTest extends BaseGlanceApiExpectTest {
-
- public void testListWhenResponseIs2xx() throws Exception {
- HttpRequest list = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/images.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").list().concat().toString(),
- new ParseImagesTest().expected().toString());
- }
-
- public void testListWhenReponseIs404IsEmpty() throws Exception {
- HttpRequest list = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, list, listResponse);
-
- assertTrue(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").list().concat().isEmpty());
- }
-
- public void testListInDetailWhenResponseIs2xx() throws Exception {
- HttpRequest listInDetail = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/detail")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listInDetailResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/images_detail.json")).build();
-
- GlanceApi apiWhenExistInDetail = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, listInDetail, listInDetailResponse);
-
- assertEquals(apiWhenExistInDetail.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExistInDetail.getImageApiForZone("az-1.region-a.geo-1").listInDetail().concat().toString(),
- new ParseImagesInDetailTest().expected().toString());
- }
-
- public void testListInDetailWhenReponseIs404IsEmpty() throws Exception {
- HttpRequest listInDetail = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/detail")
- .addHeader("Accept", "application/json")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse listInDetailResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExistInDetail = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, listInDetail, listInDetailResponse);
-
- assertTrue(apiWhenNoExistInDetail.getImageApiForZone("az-1.region-a.geo-1").listInDetail().concat().isEmpty());
- }
-
- public void testShowWhenResponseIs2xx() throws Exception {
- HttpRequest show = HttpRequest
- .builder()
- .method("HEAD")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse showResponse = new ParseImageDetailsFromHeadersTest().response;
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, show, showResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").get("fcc451d0-f6e4-4824-ad8f-70ec12326d07").toString(),
- new ParseImageDetailsFromHeadersTest().expected().toString());
- }
-
- public void testShowWhenReponseIs404IsNull() throws Exception {
- HttpRequest show = HttpRequest.builder().method("HEAD")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse showResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, show, showResponse);
-
- assertNull(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").get("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
-
- public void testGetAsStreamWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(200).payload(Payloads.newStringPayload("foo")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(Strings2.toStringAndClose(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").getAsStream("fcc451d0-f6e4-4824-ad8f-70ec12326d07")),
- "foo");
- }
-
- public void testGetAsStreamWhenReponseIs404IsNull() throws Exception {
- HttpRequest get = HttpRequest.builder().method("GET")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenNoExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertNull(apiWhenNoExist.getImageApiForZone("az-1.region-a.geo-1").getAsStream("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
- public void testCreateWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somedata", MediaType.APPLICATION_OCTET_STREAM)).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").create("test", new StringPayload("somedata")),
- new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testCreateWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somedata", MediaType.APPLICATION_OCTET_STREAM)).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(403)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").create("test", new StringPayload("somedata"));
- }
-
- public void testReserveWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").reserve("test"), new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testReserveWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("POST")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images")
- .addHeader("x-image-meta-name", "test")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse createResponse = HttpResponse.builder().statusCode(403)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, createResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").reserve("test");
- }
-
- public void testUpdateMetadataWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "newname")
- .put("X-Image-Meta-Is_public", "true")
- .put("X-Image-Meta-Protected", "true")
- .put("X-Image-Meta-Checksum", "XXXX")
- .put("X-Image-Meta-Location", "somewhere")
- .put("X-Image-Meta-Min_disk", "10")
- .put("X-Image-Meta-Min_ram", "2048")
- .put("X-Auth-Token", authToken).build())
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1")
- .update("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- UpdateImageOptions.Builder.name("newname"),
- UpdateImageOptions.Builder.isPublic(true),
- UpdateImageOptions.Builder.isProtected(true),
- UpdateImageOptions.Builder.checksum("XXXX"),
- UpdateImageOptions.Builder.location("somewhere"),
- UpdateImageOptions.Builder.minDisk(10),
- UpdateImageOptions.Builder.minRam(2048)),
- new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testUpdateMetadataWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "newname")
- .put("X-Image-Meta-Is_public", "true")
- .put("X-Auth-Token", authToken).build())
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1")
- .update("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- UpdateImageOptions.Builder.name("newname"),
- UpdateImageOptions.Builder.isPublic(true));
- }
-
- public void testUpdateImageWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("Accept", MediaType.APPLICATION_JSON)
- .addHeader("X-Auth-Token", authToken)
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata")), new ParseImageDetailsTest().expected());
- }
-
- public void testUpdateNameAndImageWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "anothernewname")
- .put("X-Auth-Token", authToken).build())
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(200)
- .payload(payloadFromResource("/image.json")).build();
-
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertEquals(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata"), UpdateImageOptions.Builder.name("anothernewname")), new ParseImageDetailsTest().expected());
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testUpdateNameAndImageWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("PUT")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .headers(
- ImmutableMultimap.<String, String>builder()
- .put("Accept", MediaType.APPLICATION_JSON)
- .put("X-Image-Meta-Name", "anothernewname")
- .put("X-Auth-Token", authToken).build())
- .payload(payloadFromStringWithContentType("somenewdata", MediaType.APPLICATION_OCTET_STREAM))
- .build();
-
- HttpResponse updateResponse = HttpResponse.builder().statusCode(403).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, updateResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").upload("fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- new StringPayload("somenewdata"), UpdateImageOptions.Builder.name("anothernewname"));
- }
-
- public void testDeleteWhenResponseIs2xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("DELETE")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(200).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertTrue(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").delete("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-
- public void testDeleteWhenResponseIs4xx() throws Exception {
- HttpRequest get = HttpRequest.builder().method("DELETE")
- .endpoint("https://glance.jclouds.org:9292/v1.0/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .addHeader("X-Auth-Token", authToken).build();
-
-
- HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();
-
- GlanceApi apiWhenExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
- responseWithKeystoneAccess, get, getResponse);
-
- assertEquals(apiWhenExist.getConfiguredZones(), ImmutableSet.of("az-1.region-a.geo-1"));
-
- assertFalse(apiWhenExist.getImageApiForZone("az-1.region-a.geo-1").delete("fcc451d0-f6e4-4824-ad8f-70ec12326d07"));
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
deleted file mode 100644
index 6199fa3..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/features/ImageApiLiveTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.features;
-
-
-import static org.jclouds.openstack.glance.v1_0.options.CreateImageOptions.Builder.containerFormat;
-import static org.jclouds.openstack.glance.v1_0.options.CreateImageOptions.Builder.diskFormat;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.jclouds.io.payloads.StringPayload;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.openstack.glance.v1_0.internal.BaseGlanceApiLiveTest;
-import org.jclouds.openstack.glance.v1_0.options.ListImageOptions;
-import org.jclouds.openstack.glance.v1_0.options.UpdateImageOptions;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.Iterables;
-
-/**
- * @author Adrian Cole
- * @author Adam Lowe
- */
-@Test(groups = "live", testName = "ImageApiLiveTest")
-public class ImageApiLiveTest extends BaseGlanceApiLiveTest {
-
- @Test
- public void testList() throws Exception {
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- Set<? extends Image> response = imageApi.list().concat().toSet();
- assert null != response;
- for (Image image : response) {
- checkImage(image);
- }
- }
- }
-
- private void checkImage(Image image) {
- assert image.getId() != null : image;
- assert image.getName() != null : image;
- assert image.getLinks() != null : image;
- }
-
- @Test
- public void testListInDetail() throws Exception {
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- Set<? extends ImageDetails> response = imageApi.listInDetail().concat().toSet();
- assert null != response;
- for (ImageDetails image : response) {
- checkImage(image);
- ImageDetails newDetails = imageApi.get(image.getId());
- checkImageDetails(newDetails);
- checkImageDetailsEqual(image, newDetails);
- }
- }
- }
-
- private void checkImageDetails(ImageDetails image) {
- checkImage(image);
- assertTrue(image.getMinDisk() >= 0);
- assertTrue(image.getMinRam() >= 0);
- }
-
- private void checkImageDetailsEqual(ImageDetails image, ImageDetails newDetails) {
- assertEquals(newDetails.getId(), image.getId());
- assertEquals(newDetails.getName(), image.getName());
- assertEquals(newDetails.getLinks(), image.getLinks());
- }
-
- @Test
- public void testCreateUpdateAndDeleteImage() {
- StringPayload imageData = new StringPayload("This isn't really an image!");
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- ImageDetails details = imageApi.create("jclouds-live-test", imageData, diskFormat(DiskFormat.RAW), containerFormat(ContainerFormat.BARE));
- assertEquals(details.getName(), "jclouds-live-test");
- assertEquals(details.getSize().get().longValue(), imageData.getRawContent().length());
-
- details = imageApi.update(details.getId(), UpdateImageOptions.Builder.name("jclouds-live-test2"), UpdateImageOptions.Builder.minDisk(10));
- assertEquals(details.getName(), "jclouds-live-test2");
- assertEquals(details.getMinDisk(), 10);
-
- Image fromListing = imageApi.list(
- ListImageOptions.Builder.containerFormat(ContainerFormat.BARE).name("jclouds-live-test2").limit(2))
- .get(0);
- assertEquals(fromListing.getId(), details.getId());
- assertEquals(fromListing.getSize(), details.getSize());
-
- assertEquals(Iterables.getOnlyElement(imageApi.listInDetail(ListImageOptions.Builder.name("jclouds-live-test2"))), details);
-
- assertTrue(imageApi.delete(details.getId()));
-
- assertTrue(imageApi.list(ListImageOptions.Builder.name("jclouds-live-test2")).isEmpty());
- }
- }
-
- @Test
- public void testReserveUploadAndDeleteImage() {
- StringPayload imageData = new StringPayload("This isn't an image!");
- for (String zoneId : api.getConfiguredZones()) {
- ImageApi imageApi = api.getImageApiForZone(zoneId);
- ImageDetails details = imageApi.reserve("jclouds-live-res-test", diskFormat(DiskFormat.RAW), containerFormat(ContainerFormat.BARE));
- assertEquals(details.getName(), "jclouds-live-res-test");
-
- details = imageApi.upload(details.getId(), imageData, UpdateImageOptions.Builder.name("jclouds-live-res-test2"), UpdateImageOptions.Builder.minDisk(10));
- assertEquals(details.getName(), "jclouds-live-res-test2");
- assertEquals(details.getSize().get().longValue(), imageData.getRawContent().length());
- assertEquals(details.getMinDisk(), 10);
-
- Image fromListing = Iterables.getOnlyElement(imageApi.list(ListImageOptions.Builder.name("jclouds-live-res-test2").limit(2).containerFormat(ContainerFormat.BARE)));
- assertEquals(fromListing.getId(), details.getId());
- assertEquals(fromListing.getSize(), details.getSize());
-
- assertEquals(Iterables.getOnlyElement(imageApi.listInDetail(ListImageOptions.Builder.name("jclouds-live-res-test2"))), details);
-
- assertTrue(imageApi.delete(details.getId()));
-
- assertTrue(imageApi.list(ListImageOptions.Builder.name("jclouds-live-res-test2")).isEmpty());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
deleted file mode 100644
index 131517c..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/functions/ParseImageDetailsFromHeadersTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMultimap;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageDetailsFromHeadersTest")
-public class ParseImageDetailsFromHeadersTest {
-
- ParseImageDetailsFromHeaders fn = new ParseImageDetailsFromHeaders(new SimpleDateFormatDateService());
-
- public HttpResponse response = HttpResponse.builder()
- .message("HTTP/1.1 200 OK")
- .statusCode(200)
- .headers(ImmutableMultimap.<String,String>builder()
- .put("X-Image-Meta-Id", "fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .put("X-Image-Meta-Deleted", "False")
- .put("X-Image-Meta-Container_format", "bare")
- .put("X-Image-Meta-Checksum", "233afa7b8809d840679b5f0d36d7350a")
- .put("X-Image-Meta-Protected", "False")
- .put("X-Image-Meta-Min_disk", "0")
- .put("X-Image-Meta-Created_at", "2012-05-18T18:06:44")
- .put("X-Image-Meta-Size", "65645798")
- .put("X-Image-Meta-Status", "active")
- .put("X-Image-Meta-Is_public", "True")
- .put("X-Image-Meta-Min_ram", "0")
- .put("X-Image-Meta-Owner", "5821675")
- .put("X-Image-Meta-Updated_at", "2012-05-18T18:42:58")
- .put("X-Image-Meta-Disk_format", "raw")
- .put("X-Image-Meta-Name", "debian")
- .put("Location", "http://HOST/v1/images/fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .put("Etag", "233afa7b8809d840679b5f0d36d7350a")
- .build())
- .build();
-
- public void test() {
- assertEquals(fn.apply(response).toString(), expected().toString());
- }
-
- public ImageDetails expected() {
- return ImageDetails.builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:44"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:42:58"))
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
deleted file mode 100644
index 1245788..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/handlers/GlanceErrorHandlerTest.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.handlers;
-
-import static org.easymock.EasyMock.createMockBuilder;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "GlanceErrorHandlerTest")
-public class GlanceErrorHandlerTest {
-
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "text/plain", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- GlanceErrorHandler function = new GlanceErrorHandler();
-
- HttpCommand command = createMockBuilder(HttpCommand.class).createMock();
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
deleted file mode 100644
index 36c2229..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiExpectTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-
-/**
- * Base class for writing KeyStone Rest Api Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseGlanceApiExpectTest extends BaseGlanceExpectTest<GlanceApi> {
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
deleted file mode 100644
index c3b898e..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceApiLiveTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import java.util.Properties;
-
-import org.jclouds.apis.BaseApiLiveTest;
-import org.jclouds.openstack.glance.v1_0.GlanceApi;
-import org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code GlanceApi}
- *
- * @author Adrian Cole
- */
-@Test(groups = "live")
-public class BaseGlanceApiLiveTest extends BaseApiLiveTest<GlanceApi> {
-
- public BaseGlanceApiLiveTest() {
- provider = "openstack-glance";
- }
-
- @Override
- protected Properties setupProperties() {
- Properties props = super.setupProperties();
- setIfTestSystemPropertyPresent(props, KeystoneProperties.CREDENTIAL_TYPE);
- return props;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
deleted file mode 100644
index 40dc393..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/internal/BaseGlanceExpectTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.internal;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.openstack.keystone.v2_0.internal.KeystoneFixture;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-/**
- * Base class for writing Glance Expect tests
- *
- * @author Adrian Cole
- */
-public class BaseGlanceExpectTest<T> extends BaseRestApiExpectTest<T> {
- protected HttpRequest keystoneAuthWithUsernameAndPassword;
- protected HttpRequest keystoneAuthWithAccessKeyAndSecretKey;
- protected String authToken;
- protected HttpResponse responseWithKeystoneAccess;
- protected HttpRequest extensionsOfGlanceRequest;
- protected HttpResponse extensionsOfGlanceResponse;
- protected HttpResponse unmatchedExtensionsOfGlanceResponse;
-
- public BaseGlanceExpectTest() {
- provider = "openstack-glance";
- keystoneAuthWithUsernameAndPassword = KeystoneFixture.INSTANCE.initialAuthWithUsernameAndPasswordAndTenantName(identity,
- credential);
- keystoneAuthWithAccessKeyAndSecretKey = KeystoneFixture.INSTANCE.initialAuthWithAccessKeyAndSecretKeyAndTenantName(identity,
- credential);
-
- authToken = KeystoneFixture.INSTANCE.getAuthToken();
- responseWithKeystoneAccess = KeystoneFixture.INSTANCE.responseWithAccess();
- // now, createContext arg will need tenant prefix
- identity = KeystoneFixture.INSTANCE.getTenantName() + ":" + identity;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
deleted file mode 100644
index db0e398..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImageDetailsTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.json.BaseItemParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-/**
- *
- * @author Adam Lowe
- */
-@Test(groups = "unit", testName = "ParseImageDetailTest")
-public class ParseImageDetailsTest extends BaseItemParserTest<ImageDetails> {
-
- @Override
- public String resource() {
- return "/image.json";
- }
-
- @Override
- @SelectJson("image")
- @Consumes(MediaType.APPLICATION_JSON)
- public ImageDetails expected() {
- return ImageDetails
- .builder()
- .id("02fa0378-f305-43cf-8058-8572fe1da795")
- .name("jclouds-live-test")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("6ae4e0fdc3c108a1bfe10ef5e436f4f4")
- .size(27L)
- .status(Image.Status.ACTIVE)
- .owner("68a7c7abb7bf45ada1536dfa28ec2115")
- .isPublic(false)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-31T10:13:47"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-31T10:13:47"))
- .build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
deleted file mode 100644
index cf311c1..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesInDetailTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.date.internal.SimpleDateFormatDateService;
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.openstack.glance.v1_0.domain.ImageDetails;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageDetailsListTest")
-public class ParseImagesInDetailTest extends BaseSetParserTest<ImageDetails> {
-
- @Override
- public String resource() {
- return "/images_detail.json";
- }
-
- @Override
- @SelectJson("images")
- @Consumes(MediaType.APPLICATION_JSON)
- public Set<ImageDetails> expected() {
- return ImmutableSet.<ImageDetails>builder()
- .add(ImageDetails
- .builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:44"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-18T18:06:45"))
- .build())
- .add(ImageDetails
- .builder()
- .id("f9fcb127-071d-4670-883e-eedb7efac183")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .status(Image.Status.ACTIVE)
- .owner("5821675")
- .isPublic(true)
- .createdAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-11T15:04:47"))
- .updatedAt(new SimpleDateFormatDateService().iso8601SecondsDateParse("2012-05-11T15:04:48"))
- .build())
- .build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java b/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
deleted file mode 100644
index aef16e1..0000000
--- a/openstack/openstack-glance/src/test/java/org/jclouds/openstack/glance/v1_0/parse/ParseImagesTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.glance.v1_0.parse;
-
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.json.BaseSetParserTest;
-import org.jclouds.openstack.glance.v1_0.domain.ContainerFormat;
-import org.jclouds.openstack.glance.v1_0.domain.DiskFormat;
-import org.jclouds.openstack.glance.v1_0.domain.Image;
-import org.jclouds.rest.annotations.SelectJson;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- *
- * @author Adrian Cole
- */
-@Test(groups = "unit", testName = "ParseImageListTest")
-public class ParseImagesTest extends BaseSetParserTest<Image> {
-
- @Override
- public String resource() {
- return "/images.json";
- }
-
- @Override
- @SelectJson("images")
- @Consumes(MediaType.APPLICATION_JSON)
- public Set<Image> expected() {
- return ImmutableSet.<Image>builder()
- .add(Image
- .builder()
- .id("f0209a30-25b8-4d9a-8e2f-dbc028e20b2b")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .add(Image
- .builder()
- .id("fcc451d0-f6e4-4824-ad8f-70ec12326d07")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .add(Image
- .builder()
- .id("f9fcb127-071d-4670-883e-eedb7efac183")
- .name("debian")
- .containerFormat(ContainerFormat.BARE)
- .diskFormat(DiskFormat.RAW)
- .checksum("233afa7b8809d840679b5f0d36d7350a")
- .size(65645798l)
- .build())
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/image.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/image.json b/openstack/openstack-glance/src/test/resources/image.json
deleted file mode 100644
index 0e47c78..0000000
--- a/openstack/openstack-glance/src/test/resources/image.json
+++ /dev/null
@@ -1 +0,0 @@
-{"image": {"status": "active", "name": "jclouds-live-test", "deleted": false, "container_format": "bare", "created_at": "2012-05-31T10:13:47", "disk_format": "raw", "updated_at": "2012-05-31T10:13:47", "properties": {}, "min_disk": 0, "protected": false, "id": "02fa0378-f305-43cf-8058-8572fe1da795", "checksum": "6ae4e0fdc3c108a1bfe10ef5e436f4f4", "owner": "68a7c7abb7bf45ada1536dfa28ec2115", "is_public": false, "deleted_at": null, "min_ram": 0, "size": 27}}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/images.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/images.json b/openstack/openstack-glance/src/test/resources/images.json
deleted file mode 100644
index 29dfb07..0000000
--- a/openstack/openstack-glance/src/test/resources/images.json
+++ /dev/null
@@ -1,24 +0,0 @@
- {
- "images": [{
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "f0209a30-25b8-4d9a-8e2f-dbc028e20b2b",
- "size": 65645798
- }, {
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- "size": 65645798
- }, {
- "name": "debian",
- "container_format": "bare",
- "disk_format": "raw",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "id": "f9fcb127-071d-4670-883e-eedb7efac183",
- "size": 65645798
- }]
- }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/images_detail.json
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/images_detail.json b/openstack/openstack-glance/src/test/resources/images_detail.json
deleted file mode 100644
index 9840138..0000000
--- a/openstack/openstack-glance/src/test/resources/images_detail.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "images": [{
- "status": "active",
- "name": "debian",
- "deleted": false,
- "container_format": "bare",
- "created_at": "2012-05-18T18:06:44",
- "disk_format": "raw",
- "updated_at": "2012-05-18T18:06:45",
- "properties": {},
- "min_disk": 0,
- "protected": false,
- "id": "fcc451d0-f6e4-4824-ad8f-70ec12326d07",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "owner": "5821675",
- "is_public": true,
- "deleted_at": null,
- "min_ram": 0,
- "size": 65645798
- }, {
- "status": "active",
- "name": "debian",
- "deleted": false,
- "container_format": "bare",
- "created_at": "2012-05-11T15:04:47",
- "disk_format": "raw",
- "updated_at": "2012-05-11T15:04:48",
- "properties": {},
- "min_disk": 0,
- "protected": false,
- "id": "f9fcb127-071d-4670-883e-eedb7efac183",
- "checksum": "233afa7b8809d840679b5f0d36d7350a",
- "owner": "5821675",
- "is_public": true,
- "deleted_at": null,
- "min_ram": 0,
- "size": 65645798
- }]
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-glance/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-glance/src/test/resources/logback.xml b/openstack/openstack-glance/src/test/resources/logback.xml
deleted file mode 100644
index a4f81d3..0000000
--- a/openstack/openstack-glance/src/test/resources/logback.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<configuration scan="false">
- <appender name="FILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="WIREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-wire.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-blobstore.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
- <root>
- <level value="warn" />
- </root>
-
- <logger name="org.jclouds">
- <level value="DEBUG" />
- <appender-ref ref="FILE" />
- </logger>
-
- <logger name="jclouds.wire">
- <level value="DEBUG" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
- <logger name="jclouds.headers">
- <level value="DEBUG" />
- <appender-ref ref="WIREFILE" />
- </logger>
-
- <logger name="jclouds.blobstore">
- <level value="DEBUG" />
- <appender-ref ref="BLOBSTOREFILE" />
- </logger>
-
-</configuration>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds-labs/blob/0736d2dd/openstack/openstack-quantum/pom.xml
----------------------------------------------------------------------
diff --git a/openstack/openstack-quantum/pom.xml b/openstack/openstack-quantum/pom.xml
deleted file mode 100644
index 9aff8e4..0000000
--- a/openstack/openstack-quantum/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>jclouds-labs-openstack</artifactId>
- <version>1.6.2-SNAPSHOT</version>
- </parent>
-
- <!-- TODO: when out of labs, switch to org.jclouds.api -->
- <groupId>org.apache.jclouds.labs</groupId>
- <artifactId>openstack-quantum</artifactId>
- <name>jclouds openstack-quantum api</name>
- <description>jclouds components to access an implementation of OpenStack Quantum</description>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- keystone endpoint -->
- <test.openstack-quantum.endpoint>http://localhost:5000/v2.0/</test.openstack-quantum.endpoint>
- <!-- keystone version -->
- <test.openstack-quantum.api-version>1.0</test.openstack-quantum.api-version>
- <test.openstack-quantum.build-version />
- <test.openstack-quantum.identity>FIXME_IDENTITY</test.openstack-quantum.identity>
- <test.openstack-quantum.credential>FIXME_CREDENTIALS</test.openstack-quantum.credential>
- <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
- <jclouds.osgi.export>org.jclouds.openstack.quantum.v1_0*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.rest.internal;version="${jclouds.version}",
- org.jclouds*;version="${jclouds.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>openstack-keystone</artifactId>
- <version>${jclouds.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-slf4j</artifactId>
- <version>${jclouds.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.openstack-quantum.endpoint>${test.openstack-quantum.endpoint}</test.openstack-quantum.endpoint>
- <test.openstack-quantum.api-version>${test.openstack-quantum.api-version}</test.openstack-quantum.api-version>
- <test.openstack-quantum.build-version>${test.openstack-quantum.build-version}</test.openstack-quantum.build-version>
- <test.openstack-quantum.identity>${test.openstack-quantum.identity}</test.openstack-quantum.identity>
- <test.openstack-quantum.credential>${test.openstack-quantum.credential}</test.openstack-quantum.credential>
- <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>