Repository: jclouds Updated Branches: refs/heads/master 59462747e -> 23d529052
OpenStack Cinder general cleanup. Prefer ByteSourcePayload. Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/23d52905 Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/23d52905 Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/23d52905 Branch: refs/heads/master Commit: 23d5290526fa83df8efdf67b38d6279d34da4b0c Parents: 5946274 Author: Jeremy Daggett <[email protected]> Authored: Wed Aug 6 11:44:13 2014 -0700 Committer: Jeremy Daggett <[email protected]> Committed: Wed Aug 6 15:20:03 2014 -0700 ---------------------------------------------------------------------- .../services/org.jclouds.apis.ApiMetadata | 19 ++++++++++++++++++- .../v1/features/SnapshotApiExpectTest.java | 18 ++++++++++++------ .../src/test/resources/quotas.json | 14 ++++++++------ .../src/test/resources/snapshot_create.json | 9 ++++++++- .../test/resources/snapshot_create_response.json | 2 +- .../src/test/resources/snapshot_get.json | 2 +- .../test/resources/snapshot_list_details.json | 2 +- .../src/test/resources/snapshot_list_simple.json | 2 +- .../src/test/resources/volume_create.json | 8 +++++++- .../test/resources/volume_create_response.json | 2 +- .../src/test/resources/volume_get.json | 2 +- .../src/test/resources/volume_list_details.json | 2 +- .../src/test/resources/volume_list_simple.json | 2 +- .../src/test/resources/volume_type_get.json | 2 +- .../test/resources/volume_type_list_simple.json | 2 +- 15 files changed, 63 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata index b007ce5..083e7f7 100644 --- a/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata +++ b/apis/openstack-cinder/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata @@ -1 +1,18 @@ -org.jclouds.openstack.cinder.v1.CinderApiMetadata \ No newline at end of file +# +# 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. +# + +org.jclouds.openstack.cinder.v1.CinderApiMetadata http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java index 48d5ed7..9ab2e33 100644 --- a/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java +++ b/apis/openstack-cinder/src/test/java/org/jclouds/openstack/cinder/v1/features/SnapshotApiExpectTest.java @@ -17,8 +17,8 @@ package org.jclouds.openstack.cinder.v1.features; import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNull; import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import java.net.URI; @@ -29,6 +29,7 @@ import javax.ws.rs.core.MediaType; import org.jclouds.date.DateService; import org.jclouds.date.internal.SimpleDateFormatDateService; import org.jclouds.http.HttpResponse; +import org.jclouds.io.Payloads; import org.jclouds.openstack.cinder.v1.domain.Snapshot; import org.jclouds.openstack.cinder.v1.domain.Volume; import org.jclouds.openstack.cinder.v1.internal.BaseCinderApiExpectTest; @@ -39,6 +40,7 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.common.io.ByteSource; /** * Tests SnapshotApi Guice wiring and parsing @@ -144,7 +146,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_create_response.json")).build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -166,7 +168,7 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder().statusCode(404).build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -187,10 +189,12 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { .build(), HttpResponse.builder() .statusCode(400) - .payload("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}") + .payload(Payloads.newByteSourcePayload(ByteSource + .wrap("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}" + .getBytes()))) .build() ).getSnapshotApiForZone("RegionOne"); - + CreateSnapshotOptions options = CreateSnapshotOptions.Builder .name("jclouds-test-snapshot") .description("jclouds test snapshot") @@ -266,7 +270,9 @@ public class SnapshotApiExpectTest extends BaseCinderApiExpectTest { authenticatedGET().endpoint(endpoint).method("DELETE").build(), HttpResponse.builder() .statusCode(400) - .payload("{\"badRequest\": {\"message\": \"Invalid volume: Volume Snapshot status must be available or error\", \"code\": 400}}") + .payload(Payloads.newByteSourcePayload(ByteSource + .wrap("{\"badRequest\": {\"message\": \"Invalid volume: Volume Snapshot status must be available or error\", \"code\": 400}}" + .getBytes()))) .build() ).getSnapshotApiForZone("RegionOne"); http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/quotas.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/quotas.json b/apis/openstack-cinder/src/test/resources/quotas.json index a50b8b5..21b9f55 100644 --- a/apis/openstack-cinder/src/test/resources/quotas.json +++ b/apis/openstack-cinder/src/test/resources/quotas.json @@ -1,6 +1,8 @@ -{"quota_set": { - "gigabytes": 1000, - "volumes": 10, - "snapshots": 20, - "id": "demo" -}} +{ + "quota_set": { + "gigabytes": 1000, + "volumes": 10, + "snapshots": 20, + "id": "demo" + } +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/snapshot_create.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/snapshot_create.json b/apis/openstack-cinder/src/test/resources/snapshot_create.json index 66b3303..5acecfd 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_create.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_create.json @@ -1 +1,8 @@ -{"snapshot":{"display_name":"jclouds-test-snapshot","volume_id":"ea6f70ef-2784-40b9-9d14-d7f33c507c3f","display_description":"jclouds test snapshot","force":"true"}} \ No newline at end of file +{ + "snapshot": { + "display_name": "jclouds-test-snapshot", + "volume_id": "ea6f70ef-2784-40b9-9d14-d7f33c507c3f", + "display_description": "jclouds test snapshot", + "force": "true" + } +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/snapshot_create_response.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/snapshot_create_response.json b/apis/openstack-cinder/src/test/resources/snapshot_create_response.json index 9aba94a..5c74009 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_create_response.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_create_response.json @@ -8,4 +8,4 @@ "id": "67d03df1-ce5d-4ba7-adbe-492ceb80170b", "size": 1 } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/snapshot_get.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/snapshot_get.json b/apis/openstack-cinder/src/test/resources/snapshot_get.json index 1c5d558..da3ff67 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_get.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_get.json @@ -10,4 +10,4 @@ "id": "67d03df1-ce5d-4ba7-adbe-492ceb80170b", "size": 1 } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/snapshot_list_details.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/snapshot_list_details.json b/apis/openstack-cinder/src/test/resources/snapshot_list_details.json index f93736f..14db785 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_list_details.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_list_details.json @@ -12,4 +12,4 @@ "size": 1 } ] -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json b/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json index 2ffb8f8..8f5918a 100644 --- a/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/snapshot_list_simple.json @@ -10,4 +10,4 @@ "size": 1 } ] -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_create.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_create.json b/apis/openstack-cinder/src/test/resources/volume_create.json index 6799b04..9bfafb7 100644 --- a/apis/openstack-cinder/src/test/resources/volume_create.json +++ b/apis/openstack-cinder/src/test/resources/volume_create.json @@ -1 +1,7 @@ -{"volume":{"display_name":"jclouds-test-volume","display_description":"description of test volume","size":1}} \ No newline at end of file +{ + "volume": { + "display_name": "jclouds-test-volume", + "display_description": "description of test volume", + "size": 1 + } +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_create_response.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_create_response.json b/apis/openstack-cinder/src/test/resources/volume_create_response.json index 91aaa9d..dd6a68e 100644 --- a/apis/openstack-cinder/src/test/resources/volume_create_response.json +++ b/apis/openstack-cinder/src/test/resources/volume_create_response.json @@ -12,4 +12,4 @@ "id": "60761c60-0f56-4499-b522-ff13e120af10", "size": 1 } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_get.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_get.json b/apis/openstack-cinder/src/test/resources/volume_get.json index c402317..2d9a8cc 100644 --- a/apis/openstack-cinder/src/test/resources/volume_get.json +++ b/apis/openstack-cinder/src/test/resources/volume_get.json @@ -19,4 +19,4 @@ "id": "60761c60-0f56-4499-b522-ff13e120af10", "size": 1 } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_list_details.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_list_details.json b/apis/openstack-cinder/src/test/resources/volume_list_details.json index e1a8dc8..7de9b19 100644 --- a/apis/openstack-cinder/src/test/resources/volume_list_details.json +++ b/apis/openstack-cinder/src/test/resources/volume_list_details.json @@ -21,4 +21,4 @@ "size": 1 } ] -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_list_simple.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_list_simple.json b/apis/openstack-cinder/src/test/resources/volume_list_simple.json index e1a8dc8..7de9b19 100644 --- a/apis/openstack-cinder/src/test/resources/volume_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/volume_list_simple.json @@ -21,4 +21,4 @@ "size": 1 } ] -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_type_get.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_type_get.json b/apis/openstack-cinder/src/test/resources/volume_type_get.json index ffda197..0089e80 100644 --- a/apis/openstack-cinder/src/test/resources/volume_type_get.json +++ b/apis/openstack-cinder/src/test/resources/volume_type_get.json @@ -11,4 +11,4 @@ "deleted_at": null, "id": 1 } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/jclouds/blob/23d52905/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json ---------------------------------------------------------------------- diff --git a/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json b/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json index 600c380..02eb792 100644 --- a/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json +++ b/apis/openstack-cinder/src/test/resources/volume_type_list_simple.json @@ -13,4 +13,4 @@ "id": 1 } ] -} \ No newline at end of file +}
