Skip to content

Commit

Permalink
Temporarily hide FakeStorageRpc and LocalStorageHelper (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard authored Jun 27, 2016
1 parent 7cdcb6c commit dc566ba
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Rule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.Acl;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

import com.google.common.collect.ImmutableList;
import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Rule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.StorageOptions;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.Acl;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.google.common.collect.Iterables;
import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;
import com.google.cloud.storage.testing.LocalStorageHelper;

import org.junit.Before;
import org.junit.Rule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.storage.testing;
package com.google.cloud.storage.contrib.nio;

import com.google.api.services.storage.model.Bucket;
import com.google.api.services.storage.model.StorageObject;
Expand Down Expand Up @@ -63,7 +63,7 @@
* </ul>
*/
@NotThreadSafe
public class FakeStorageRpc implements StorageRpc {
class FakeStorageRpc implements StorageRpc {

// fullname -> metadata
Map<String, StorageObject> metadata = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015 Google Inc. All Rights Reserved.
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.cloud.storage.testing;
package com.google.cloud.storage.contrib.nio;

import com.google.cloud.spi.ServiceRpcFactory;
import com.google.cloud.storage.spi.StorageRpc;
Expand All @@ -24,15 +24,14 @@
* Utility to create an in-memory storage configuration for testing. Storage options can be
* obtained via the {@link #options()} method. Returned options will point to FakeStorageRpc.
*/
public class LocalStorageHelper {
class LocalStorageHelper {

// used for testing. Will throw if you pass it an option.
private static final FakeStorageRpc instance = new FakeStorageRpc(true);

/**
* Returns a {@link StorageOptions} that use the static FakeStorageRpc instance,
* and resets it first so you start from a clean slate.
* That instance will throw if you pass it any option. *
* Returns a {@link StorageOptions} that use the static FakeStorageRpc instance, and resets it
* first so you start from a clean slate. That instance will throw if you pass it any option.
*/
public static StorageOptions options() {
instance.reset();
Expand All @@ -49,8 +48,8 @@ public StorageRpc create(StorageOptions options) {
}

/**
* Returns a {@link StorageOptions} that creates a new FakeStorageRpc instance
* with the given option.
* Returns a {@link StorageOptions} that creates a new FakeStorageRpc instance with the given
* option.
*/
public static StorageOptions customOptions(final boolean throwIfOptions) {
return StorageOptions.builder()
Expand All @@ -64,5 +63,4 @@ public StorageRpc create(StorageOptions options) {
})
.build();
}

}

0 comments on commit dc566ba

Please sign in to comment.