You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ga...@apache.org on 2015/04/01 22:13:28 UTC

[1/2] jclouds-labs-google git commit: JCLOUDS-848: Support GCS nearline storage

Repository: jclouds-labs-google
Updated Branches:
  refs/heads/master 6f9783ce4 -> 4e8858a47


JCLOUDS-848: Support GCS nearline storage


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/commit/2455f944
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/tree/2455f944
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/diff/2455f944

Branch: refs/heads/master
Commit: 2455f9445b3fbdfe20006e359945762639a76a66
Parents: 6f9783c
Author: snotling <da...@gmail.com>
Authored: Wed Mar 25 17:28:20 2015 +0100
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Apr 1 11:21:04 2015 -0700

----------------------------------------------------------------------
 .../googlecloudstorage/domain/DomainResourceReferences.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/2455f944/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
----------------------------------------------------------------------
diff --git a/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java b/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
index dd8a07b..36ab418 100644
--- a/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
+++ b/google-cloud-storage/src/main/java/org/jclouds/googlecloudstorage/domain/DomainResourceReferences.java
@@ -45,7 +45,7 @@ public final class DomainResourceReferences {
    }
 
    public enum StorageClass {
-      STANDARD, DURABLE_REDUCED_AVAILABILITY;
+      STANDARD, DURABLE_REDUCED_AVAILABILITY, NEARLINE;
    }
 
    public enum Projection {


[2/2] jclouds-labs-google git commit: JCLOUDS-848: Add tests for storage classes

Posted by ga...@apache.org.
JCLOUDS-848: Add tests for storage classes


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/commit/4e8858a4
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/tree/4e8858a4
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/diff/4e8858a4

Branch: refs/heads/master
Commit: 4e8858a472104c6904f35e94fa5889906582813e
Parents: 2455f94
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Apr 1 11:12:01 2015 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Apr 1 13:12:26 2015 -0700

----------------------------------------------------------------------
 .../features/BucketApiLiveTest.java             | 39 ++++++++++++++++++++
 1 file changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs-google/blob/4e8858a4/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
----------------------------------------------------------------------
diff --git a/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java b/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
index 21f0a18..762e7f2 100644
--- a/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
+++ b/google-cloud-storage/src/test/java/org/jclouds/googlecloudstorage/features/BucketApiLiveTest.java
@@ -16,6 +16,7 @@
  */
 package org.jclouds.googlecloudstorage.features;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertNotNull;
@@ -51,8 +52,14 @@ import com.google.common.collect.Lists;
 
 public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
 
+   // TODO: what removes these buckets?
+
    private static final String BUCKET_NAME = "jcloudstestbucket" + (int) (Math.random() * 10000);
 
+   private static final String BUCKET_NAME_STANDARD = "jcloudstestbucketstandard" + (int) (Math.random() * 10000);
+
+   private static final String BUCKET_NAME_NEARLINE = "jcloudstestbucketnearline" + (int) (Math.random() * 10000);
+
    private static final String BUCKET_NAME_WITHOPTIONS = "jcloudtestbucketoptions" + (int) (Math.random() * 10000);
 
    private static final String LOG_BUCKET_NAME = "jcloudslogbucket" + (int) (Math.random() * 10000);
@@ -63,6 +70,7 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
       return api.getBucketApi();
    }
 
+   // TODO: should this test use STANDARD storage class?
    @Test(groups = "live")
    public void testCreateBucket() {
 
@@ -91,9 +99,40 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
       assertTrue(response.cors().size() == 1);
       assertEquals(response.name(), BUCKET_NAME);
       assertEquals(response.location(), Location.US_CENTRAL2);
+      assertThat(response.storageClass()).isEqualTo(StorageClass.DURABLE_REDUCED_AVAILABILITY);
       assertTrue(response.versioning().enabled());
    }
 
+   @Test(groups = "live")
+   public void testCreateBucketStandard() {
+      BucketTemplate template = new BucketTemplate()
+               .name(BUCKET_NAME_STANDARD)
+               .location(Location.US)
+               .storageClass(StorageClass.STANDARD);
+
+      Bucket response = api().createBucket(PROJECT_NUMBER, template);
+
+      assertNotNull(response);
+      assertEquals(response.name(), BUCKET_NAME_STANDARD);
+      assertEquals(response.location(), Location.US);
+      assertThat(response.storageClass()).isEqualTo(StorageClass.STANDARD);
+   }
+
+   @Test(groups = "live")
+   public void testCreateBucketNearline() {
+      BucketTemplate template = new BucketTemplate()
+               .name(BUCKET_NAME_NEARLINE)
+               .location(Location.US)
+               .storageClass(StorageClass.NEARLINE);
+
+      Bucket response = api().createBucket(PROJECT_NUMBER, template);
+
+      assertNotNull(response);
+      assertEquals(response.name(), BUCKET_NAME_NEARLINE);
+      assertEquals(response.location(), Location.US);
+      assertThat(response.storageClass()).isEqualTo(StorageClass.NEARLINE);
+   }
+
    @Test(groups = "live", dependsOnMethods = { "testCreateBucket" })
    public void testCreateAlreadyExistBucket() {