Skip to content

Commit 7145030

Browse files
committed
Renaming BlobWriterChannelImpl to BlobWriteChannelImpl, renaming tests
1 parent 967c429 commit 7145030

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobWriterChannelImpl.java renamed to gcloud-java-storage/src/main/java/com/google/gcloud/storage/BlobWriteChannelImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
/**
3333
* Default implementation for BlobWriteChannel.
3434
*/
35-
class BlobWriterChannelImpl implements BlobWriteChannel {
35+
class BlobWriteChannelImpl implements BlobWriteChannel {
3636

3737
private static final long serialVersionUID = 8675286882724938737L;
3838
private static final int MIN_CHUNK_SIZE = 256 * 1024;
@@ -50,7 +50,7 @@ class BlobWriterChannelImpl implements BlobWriteChannel {
5050
private transient StorageRpc storageRpc;
5151
private transient StorageObject storageObject;
5252

53-
BlobWriterChannelImpl(StorageOptions options, BlobInfo blobInfo,
53+
BlobWriteChannelImpl(StorageOptions options, BlobInfo blobInfo,
5454
Map<StorageRpc.Option, ?> optionsMap) {
5555
this.options = options;
5656
this.blobInfo = blobInfo;

gcloud-java-storage/src/main/java/com/google/gcloud/storage/StorageImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public BlobReadChannel reader(String bucket, String blob, BlobSourceOption... op
443443
@Override
444444
public BlobWriteChannel writer(BlobInfo blobInfo, BlobTargetOption... options) {
445445
final Map<StorageRpc.Option, ?> optionsMap = optionMap(blobInfo, options);
446-
return new BlobWriterChannelImpl(options(), blobInfo, optionsMap);
446+
return new BlobWriteChannelImpl(options(), blobInfo, optionsMap);
447447
}
448448

449449
@Override

gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobReadChannelTest.java renamed to gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobReadChannelImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.gcloud.storage;
1818

19+
import static org.easymock.EasyMock.verify;
1920
import static org.junit.Assert.assertArrayEquals;
2021
import static org.junit.Assert.assertTrue;
2122
import static org.junit.Assert.assertEquals;
@@ -34,10 +35,9 @@
3435
import java.util.Arrays;
3536
import java.util.Map;
3637
import java.util.Random;
37-
import static org.easymock.EasyMock.verify;
3838
import org.junit.After;
3939

40-
public class BlobReadChannelTest {
40+
public class BlobReadChannelImplTest {
4141

4242
private static final String BUCKET_NAME = "b";
4343
private static final String BLOB_NAME = "n";

gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobWriterChannelTest.java renamed to gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobWriteChannelImplTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.google.gcloud.storage;
1818

19+
import static org.easymock.EasyMock.verify;
1920
import static org.junit.Assert.assertEquals;
2021
import static org.junit.Assert.assertArrayEquals;
2122
import static org.junit.Assert.assertTrue;
@@ -35,10 +36,9 @@
3536
import java.util.Arrays;
3637
import java.util.Map;
3738
import java.util.Random;
38-
import static org.easymock.EasyMock.verify;
3939
import org.junit.After;
4040

41-
public class BlobWriterChannelTest {
41+
public class BlobWriteChannelImplTest {
4242

4343
private static final String BUCKET_NAME = "b";
4444
private static final String BLOB_NAME = "n";
@@ -52,7 +52,7 @@ public class BlobWriterChannelTest {
5252

5353
private StorageOptions optionsMock;
5454
private StorageRpc storageRpcMock;
55-
private BlobWriterChannelImpl writer;
55+
private BlobWriteChannelImpl writer;
5656

5757
@Before
5858
public void setUp() throws IOException, InterruptedException {
@@ -72,7 +72,7 @@ public void testCreate() {
7272
EasyMock.replay(optionsMock);
7373
EasyMock.expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID);
7474
EasyMock.replay(storageRpcMock);
75-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
75+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
7676
assertTrue(writer.isOpen());
7777
}
7878

@@ -82,7 +82,7 @@ public void testWriteWithoutFlush() throws IOException {
8282
EasyMock.replay(optionsMock);
8383
EasyMock.expect(storageRpcMock.open(BLOB_INFO.toPb(), EMPTY_RPC_OPTIONS)).andReturn(UPLOAD_ID);
8484
EasyMock.replay(storageRpcMock);
85-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
85+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
8686
assertEquals(MIN_CHUNK_SIZE, writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE)));
8787
}
8888

@@ -98,7 +98,7 @@ public void testWriteWithFlush() throws IOException {
9898
EasyMock.eq(false));
9999
EasyMock.expectLastCall();
100100
EasyMock.replay(storageRpcMock);
101-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
101+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
102102
writer.chunkSize(CUSTOM_CHUNK_SIZE);
103103
ByteBuffer buffer = randomBuffer(CUSTOM_CHUNK_SIZE);
104104
assertEquals(CUSTOM_CHUNK_SIZE, writer.write(buffer));
@@ -117,7 +117,7 @@ public void testWritesAndFlush() throws IOException {
117117
EasyMock.eq(false));
118118
EasyMock.expectLastCall();
119119
EasyMock.replay(storageRpcMock);
120-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
120+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
121121
ByteBuffer[] buffers = new ByteBuffer[DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE];
122122
for (int i = 0; i < buffers.length; i++) {
123123
buffers[i] = randomBuffer(MIN_CHUNK_SIZE);
@@ -142,7 +142,7 @@ public void testCloseWithoutFlush() throws IOException {
142142
EasyMock.eq(BLOB_INFO.toPb()), EasyMock.eq(0L), EasyMock.eq(0), EasyMock.eq(true));
143143
EasyMock.expectLastCall();
144144
EasyMock.replay(storageRpcMock);
145-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
145+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
146146
assertTrue(writer.isOpen());
147147
writer.close();
148148
assertArrayEquals(new byte[0], capturedBuffer.getValue());
@@ -162,7 +162,7 @@ public void testCloseWithFlush() throws IOException {
162162
EasyMock.eq(true));
163163
EasyMock.expectLastCall();
164164
EasyMock.replay(storageRpcMock);
165-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
165+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
166166
assertTrue(writer.isOpen());
167167
writer.write(buffer);
168168
writer.close();
@@ -182,7 +182,7 @@ public void testWriteClosed() throws IOException {
182182
EasyMock.eq(BLOB_INFO.toPb()), EasyMock.eq(0L), EasyMock.eq(0), EasyMock.eq(true));
183183
EasyMock.expectLastCall();
184184
EasyMock.replay(storageRpcMock);
185-
writer = new BlobWriterChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
185+
writer = new BlobWriteChannelImpl(optionsMock, BLOB_INFO, EMPTY_RPC_OPTIONS);
186186
writer.close();
187187
try {
188188
writer.write(ByteBuffer.allocate(MIN_CHUNK_SIZE));

0 commit comments

Comments
 (0)