Skip to content

Commit 9ddeb40

Browse files
authored
Clarify usage of LocalStorageHelper, explicitly specify which operations are supported and which are not (#2334)
1 parent 2d5cbfe commit 9ddeb40

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

TESTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ You can test against an in-memory local Resource Manager by following these step
208208

209209
#### On your machine
210210

211-
You can test against an in-memory local Storage by following these steps:
211+
You can test against an in-memory local Storage. The in-memory configuration supports only limited number of operations; please refer to the `LocalStorageHelper` class documentation for more details. Please use `RemoteStorageHelper` (see next section) if you need to use operations which are not supported by `LocalStorageHelper`.
212+
213+
To use the in-memory configuration please follow these steps:
212214

213215
1. Follow the [Quickstart instructions][cloud-nio] to add the nio dependency to your project.
214216
2. In your program, create and use a fake Storage service object. For example:
@@ -221,7 +223,7 @@ You can test against an in-memory local Storage by following these steps:
221223

222224
#### Remote
223225

224-
The alternative way of testing is to create a test project. `RemoteStorageHelper` contains convenience methods to make setting up and cleaning up the test project easier. To use this class, follow the steps below:
226+
The alternative way of testing is to create a test project. This way allows using operations not supported by the in-memory configuration. `RemoteStorageHelper` contains convenience methods to make setting up and cleaning up the test project easier. To use this class, follow the steps below:
225227

226228
1. Create a test Google Cloud project.
227229

google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,31 @@
2323
/**
2424
* Utility to create an in-memory storage configuration for testing. Storage options can be
2525
* obtained via the {@link #getOptions()} method. Returned options will point to FakeStorageRpc.
26+
*
27+
* <p>Note, the created in-memory storage configuration supports limited set of operations and is <b>not</b> thread-safe:
28+
* <ul>
29+
* <li>Supported operations
30+
* <ul>
31+
* <li>object create
32+
* <li>object get
33+
* <li>object delete
34+
* <li>list the contents of a bucket
35+
* </ul>
36+
* <li>Unsupported operations
37+
* <ul>
38+
* <li>bucket create
39+
* <li>bucket get
40+
* <li>bucket delete
41+
* <li>list all buckets
42+
* <li>generations
43+
* <li>file attributes
44+
* <li>patch
45+
* <li>continueRewrite
46+
* <li>createBatch
47+
* <li>checksums, etags
48+
* <li>IAM operations</li>
49+
* </ul>
50+
* </ul>
2651
*/
2752
public final class LocalStorageHelper {
2853

0 commit comments

Comments
 (0)