Fix DefaultObjectAccessControlsApiLiveTest, ResumableUploadApiLiveTest, ObjectApiLiveTest

This commit is contained in:
Daniel Broudy 2015-06-01 17:18:33 -07:00
parent 2585624d44
commit 3d9258f75a
3 changed files with 3 additions and 9 deletions

View File

@ -32,7 +32,7 @@ import org.testng.annotations.Test;
public class DefaultObjectAccessControlsApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
protected static final String BUCKET_NAME = "jcloudstestbucketdefaultoacl" + UUID.randomUUID();
protected static final String BUCKET_NAME = "jcloudsdefaultoacltest" + UUID.randomUUID();
private DefaultObjectAccessControlsApi api() {
return api.getDefaultObjectAccessControlsApi();

View File

@ -63,7 +63,6 @@ import com.beust.jcommander.internal.Lists;
import com.google.common.collect.ImmutableMap;
import com.google.common.hash.Hashing;
import com.google.common.io.ByteSource;
import com.google.common.primitives.Bytes;
public class ObjectApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
@ -435,6 +434,7 @@ public class ObjectApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
assertTrue(api().deleteObject(BUCKET_NAME2, COMPOSED_OBJECT2));
assertTrue(api().deleteObject(BUCKET_NAME2, COMPOSED_OBJECT));
assertTrue(api().deleteObject(BUCKET_NAME2, COPIED_OBJECT_NAME));
assertTrue(api().deleteObject(BUCKET_NAME2, COPIED_OBJECT_NAME2));
assertFalse(api().deleteObject(BUCKET_NAME, UPLOAD_OBJECT_NAME));
assertTrue(api().deleteObject(BUCKET_NAME, UPLOAD_OBJECT_NAME2));
assertTrue(api().deleteObject(BUCKET_NAME, MULTIPART_UPLOAD_OBJECT));
@ -453,10 +453,4 @@ public class ObjectApiLiveTest extends BaseGoogleCloudStorageApiLiveTest {
api.getBucketApi().deleteBucket(BUCKET_NAME);
api.getBucketApi().deleteBucket(BUCKET_NAME2);
}
private static byte[] reverse(byte[] b) {
List<Byte> hashByte = Bytes.asList(b);
List<Byte> reversedList = com.google.common.collect.Lists.reverse(hashByte);
return Bytes.toArray(reversedList);
}
}

View File

@ -136,7 +136,7 @@ public class ResumableUploadApiLiveTest extends BaseGoogleCloudStorageApiLiveTes
// Uploading First chunk
ByteSourcePayload payload = Payloads.newByteSourcePayload(byteSource.slice(offset, chunkSize));
long length = byteSource.slice(offset, chunkSize).size();
String Content_Range = generateContentRange(0L, length, totalSize);
String Content_Range = generateContentRange(0L, length - 1, totalSize);
ResumableUpload uploadResponse = api().chunkUpload(BUCKET_NAME, uploadId, "application/pdf", length,
Content_Range, payload);