JCLOUDS-1259: Add GCS multi-regional and coldline

This commit is contained in:
Andrew Gaul 2017-03-20 18:04:03 -07:00
parent 8e50fe69ad
commit ca75641fc0
2 changed files with 43 additions and 1 deletions

View File

@ -45,7 +45,11 @@ public final class DomainResourceReferences {
}
public enum StorageClass {
STANDARD, DURABLE_REDUCED_AVAILABILITY, NEARLINE;
COLDLINE,
DURABLE_REDUCED_AVAILABILITY,
MULTI_REGIONAL,
NEARLINE,
STANDARD;
}
public enum Projection {

View File

@ -58,6 +58,10 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
private static final String BUCKET_NAME_STANDARD = "jcloudstestbucketstandard" + (int) (Math.random() * 10000);
private static final String BUCKET_NAME_COLDLINE = "jcloudstestbucketcoldline" + (int) (Math.random() * 10000);
private static final String BUCKET_NAME_MULTI_REGIONAL = "jcloudstestbucketmultiregional" + (int) (Math.random() * 10000);
private static final String BUCKET_NAME_NEARLINE = "jcloudstestbucketnearline" + (int) (Math.random() * 10000);
private static final String BUCKET_NAME_WITHOPTIONS = "jcloudstestbucketoptions" + (int) (Math.random() * 10000);
@ -120,6 +124,40 @@ public class BucketApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
api().deleteBucket(BUCKET_NAME_STANDARD);
}
@Test(groups = "live")
public void testCreateBucketColdline() {
BucketTemplate template = new BucketTemplate()
.name(BUCKET_NAME_COLDLINE)
.location(Location.US)
.storageClass(StorageClass.COLDLINE);
Bucket response = api().createBucket(PROJECT_NUMBER, template);
assertNotNull(response);
assertEquals(response.name(), BUCKET_NAME_COLDLINE);
assertEquals(response.location(), Location.US);
assertThat(response.storageClass()).isEqualTo(StorageClass.COLDLINE);
api().deleteBucket(BUCKET_NAME_COLDLINE);
}
@Test(groups = "live")
public void testCreateBucketMultiregional() {
BucketTemplate template = new BucketTemplate()
.name(BUCKET_NAME_MULTI_REGIONAL)
.location(Location.US)
.storageClass(StorageClass.MULTI_REGIONAL);
Bucket response = api().createBucket(PROJECT_NUMBER, template);
assertNotNull(response);
assertEquals(response.name(), BUCKET_NAME_MULTI_REGIONAL);
assertEquals(response.location(), Location.US);
assertThat(response.storageClass()).isEqualTo(StorageClass.MULTI_REGIONAL);
api().deleteBucket(BUCKET_NAME_NEARLINE);
}
@Test(groups = "live")
public void testCreateBucketNearline() {
BucketTemplate template = new BucketTemplate()