You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by danbroudy <no...@github.com> on 2015/02/12 00:32:50 UTC
[jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
This PR enables running the GCS test with the Json Key format
To do so you provide test.google-cloud.json-key as a parameter with the path to the .json file as the value.
This is relevant to #112 and JCLOUDS-805
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds-labs-google/pull/127
-- Commit Summary --
* enabling running live tests with .json key format
* Adding BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest
-- File Changes --
M google-cloud-storage/pom.xml (6)
M google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/ListPageWithPrefixes.java (2)
M google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/templates/ObjectTemplate.java (16)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/blobstore/integration/GoogleCloudStorageBlobIntegrationLiveTest.java (1)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/blobstore/integration/GoogleCloudStorageBlobLiveTest.java (1)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/blobstore/integration/GoogleCloudStorageContainerIntegrationLiveTest.java (1)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/blobstore/integration/GoogleCloudStorageContainerLiveTest.java (1)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/ObjectApiMockTest.java (247)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/internal/BaseGoogleCloudStorageApiLiveTest.java (8)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/internal/BaseGoogleCloudStorageApiMockTest.java (138)
M google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/internal/BaseGoogleCloudStorageParseTest.java (7)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/parse/ParseGoogleCloudStorageObject.java (66)
A google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/parse/ParseGoogleCloudStorageObjectListTest.java (99)
A google-cloud-storage/src/test/resources/object_compose_request.json (54)
A google-cloud-storage/src/test/resources/object_get.json (21)
A google-cloud-storage/src/test/resources/object_list.json (47)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-google/pull/127.patch
https://github.com/jclouds/jclouds-labs-google/pull/127.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by Andrew Gaul <no...@github.com>.
Tests passed locally and I pushed the first commit to master as 2e8fef5d0ba64ad3e5c25f0065a1c84b8b5b00e5.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127#issuecomment-74150481
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by danbroudy <no...@github.com>.
Ran Live tests for Storage:
```
Results :
Failed tests:
GoogleCloudStorageBlobIntegrationLiveTest>BaseBlobIntegrationTest.testPutMultipartInputStream:555->BaseBlobIntegrationTest.testPut:575 » HttpResponse
BucketApiLiveTest.testCreateBucket:88 expected object to not be null
GoogleCloudStorageBlobIntegrationLiveTest.testMultipartChunkedFileStream:235->addMultipartBlobToContainer:253 » HttpResponse
BucketApiLiveTest.testUpdateBucketWithOptions:146 » Authorization {
"error": ...
ObjectApiLiveTest.testUpdateObject:292 » Authorization {
"error": {
"errors...
ObjectApiLiveTest.deleteBucket:424 » IllegalState {
"error": {
"errors": [
...
Tests run: 101, Failures: 6, Errors: 0, Skipped: 22
```
Existing Jira Issue tracking this - JCLOUDS-805
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127#issuecomment-73996847
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by danbroudy <no...@github.com>.
> + .predefinedAcl(PredefinedAcl.PUBLIC_READ_WRITE);
> +
> + assertEquals(objectApi().simpleUpload("bucket_name", "text/plain",
> + p.getPayload().getContentMetadata().getContentLength(), p.getPayload(), options),
> + new ParseGoogleCloudStorageObject().expected());
> +
> + RecordedRequest request = assertSent(server, "POST", "/upload/storage/v1/b/bucket_name/o" +
> + "?uploadType=media&name=new_object&predefinedAcl=publicReadWrite", null);
> + assertEquals(request.getHeader("Content-Type"), "text/plain");
> + assertEquals(new String(request.getBody(), UTF_8), testPayload);
> + }
> +
> + public void delete() throws Exception {
> + server.enqueue(new MockResponse());
> +
> + // Question: Should this be returning True on not found?
This is the same question raised in #122. Happy to change a TODO.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127/files#r24617783
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by Andrew Gaul <no...@github.com>.
Pushed second commit to master as c9b3845af2cd2539e7e49d5d23567c03bcff6405.
Please do send multiple pull requests for independent commits since this makes reviewing easier.
Also would appreciate your help on [JCLOUDS-805](https://issues.apache.org/jira/browse/JCLOUDS-805)!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127#issuecomment-74154764
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by Andrew Gaul <no...@github.com>.
Some small nits, overall looks good and running the live tests now. Any reason to conjoin the JSON and MockTest into a single pull request?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127#issuecomment-74141846
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by danbroudy <no...@github.com>.
Convenience. I am happy to break them apart if that would be easier!
I got used to running the tests with the JSON format.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127#issuecomment-74147193
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by Andrew Gaul <no...@github.com>.
> + .predefinedAcl(PredefinedAcl.PUBLIC_READ_WRITE);
> +
> + assertEquals(objectApi().simpleUpload("bucket_name", "text/plain",
> + p.getPayload().getContentMetadata().getContentLength(), p.getPayload(), options),
> + new ParseGoogleCloudStorageObject().expected());
> +
> + RecordedRequest request = assertSent(server, "POST", "/upload/storage/v1/b/bucket_name/o" +
> + "?uploadType=media&name=new_object&predefinedAcl=publicReadWrite", null);
> + assertEquals(request.getHeader("Content-Type"), "text/plain");
> + assertEquals(new String(request.getBody(), UTF_8), testPayload);
> + }
> +
> + public void delete() throws Exception {
> + server.enqueue(new MockResponse());
> +
> + // Question: Should this be returning True on not found?
Mark as TODO?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127/files#r24614605
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by Andrew Gaul <no...@github.com>.
> @@ -37,8 +37,8 @@
> private String contentType;
> private String crc32c;
> private String md5Hash;
> - private Map<String, String> metadata = Maps.newLinkedHashMap();
> - private List<ObjectAccessControls> acl = Lists.newArrayList();
> + private Map<String, String> metadata;
> + private List<ObjectAccessControls> acl;
Why change this?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127/files#r24614642
Re: [jclouds-labs-google] Json Keys for running GCS tests +
BaseGoogleCloudStorageApiMockTest + ObjectApiMockTest. (#127)
Posted by danbroudy <no...@github.com>.
> @@ -37,8 +37,8 @@
> private String contentType;
> private String crc32c;
> private String md5Hash;
> - private Map<String, String> metadata = Maps.newLinkedHashMap();
> - private List<ObjectAccessControls> acl = Lists.newArrayList();
> + private Map<String, String> metadata;
> + private List<ObjectAccessControls> acl;
Initializing these as empty overwrites metadata and acls when using the PATCH operation.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/127/files#r24617654