From 59b85b8ea5221cf2e538c78f251cf82f92f8d1da Mon Sep 17 00:00:00 2001 From: vam Date: Fri, 11 Aug 2017 12:57:34 -0700 Subject: [PATCH 1/3] Clarify usage of LocalStorageHelper, explicitly specify which operations are supproted and which are not. --- TESTING.md | 4 +-- .../nio/testing/LocalStorageHelper.java | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/TESTING.md b/TESTING.md index 5ceaeec07237..36e7dc9272be 100644 --- a/TESTING.md +++ b/TESTING.md @@ -208,7 +208,7 @@ You can test against an in-memory local Resource Manager by following these step #### On your machine -You can test against an in-memory local Storage by following these steps: +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`. 1. Follow the [Quickstart instructions][cloud-nio] to add the nio dependency to your project. 2. In your program, create and use a fake Storage service object. For example: @@ -221,7 +221,7 @@ You can test against an in-memory local Storage by following these steps: #### Remote -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: +The alternative way of testing is to create a test project. This way allows using operations not supported by the `LocalStorageHelper`. `RemoteStorageHelper` contains convenience methods to make setting up and cleaning up the test project easier. To use this class, follow the steps below: 1. Create a test Google Cloud project. diff --git a/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java b/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java index 293791f70860..258022303546 100644 --- a/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java +++ b/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java @@ -23,6 +23,31 @@ /** * Utility to create an in-memory storage configuration for testing. Storage options can be * obtained via the {@link #getOptions()} method. Returned options will point to FakeStorageRpc. + * + *

Note, the created in-memory storage configuration supports limited set of operations and is not thread-safe: + *

*/ public final class LocalStorageHelper { From 5ff3e441b28035182bb384d1360482c0e44a08ea Mon Sep 17 00:00:00 2001 From: vam Date: Fri, 11 Aug 2017 13:00:46 -0700 Subject: [PATCH 2/3] Make documentation clearer. --- TESTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TESTING.md b/TESTING.md index 36e7dc9272be..5820d9ec6013 100644 --- a/TESTING.md +++ b/TESTING.md @@ -208,7 +208,9 @@ You can test against an in-memory local Resource Manager by following these step #### On your machine -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`. +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`. + +To use the in-memory configuration please follow these steps: 1. Follow the [Quickstart instructions][cloud-nio] to add the nio dependency to your project. 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. The in-memory configuration sup #### Remote -The alternative way of testing is to create a test project. This way allows using operations not supported by the `LocalStorageHelper`. `RemoteStorageHelper` contains convenience methods to make setting up and cleaning up the test project easier. To use this class, follow the steps below: +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: 1. Create a test Google Cloud project. From b095221d438f3b1c3b0929d9ab064be6051c2ba2 Mon Sep 17 00:00:00 2001 From: vam Date: Fri, 11 Aug 2017 14:08:53 -0700 Subject: [PATCH 3/3] s/,/; --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 5820d9ec6013..39f4a950c2c5 100644 --- a/TESTING.md +++ b/TESTING.md @@ -208,7 +208,7 @@ You can test against an in-memory local Resource Manager by following these step #### On your machine -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`. +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`. To use the in-memory configuration please follow these steps: