// Path: google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java
// public final class LocalStorageHelper {
// 
//   // used for testing. Will throw if you pass it an option.
//   private static final FakeStorageRpc instance = new FakeStorageRpc(true);
// 
//   private LocalStorageHelper() {}
// 
//   /**
//    * 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 getOptions() {
//     instance.reset();
//     return StorageOptions.newBuilder()
//         .setProjectId("fake-project-for-testing")
//         .setServiceRpcFactory(new FakeStorageRpcFactory())
//         .build();
//   }
// 
//   /**
//    * Returns a {@link StorageOptions} that creates a new FakeStorageRpc instance with the given
//    * option.
//    */
//   public static StorageOptions customOptions(final boolean throwIfOptions) {
//     return StorageOptions.newBuilder()
//         .setProjectId("fake-project-for-testing")
//         .setServiceRpcFactory(new FakeStorageRpcFactory(new FakeStorageRpc(throwIfOptions)))
//         .build();
//   }
// 
//   public static class FakeStorageRpcFactory implements ServiceRpcFactory<StorageOptions> {
// 
//     private final FakeStorageRpc instance;
// 
//     public FakeStorageRpcFactory() {
//       this(LocalStorageHelper.instance);
//     }
// 
//     public FakeStorageRpcFactory(FakeStorageRpc instance) {
//       this.instance = instance;
//     }
// 
//     @Override
//     public ServiceRpc create(StorageOptions storageOptions) {
//       return instance;
//     }
//   }
// }


import static com.google.common.truth.Truth.assertThat;
import com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper;
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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



/**
 * Unit tests for {@link CloudStorageFileSystemProvider}. Makes sure the NIO system picks it up
 * properly.
 */
@RunWith(JUnit4.class)
public class NIOTest {
  @Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);

  private URI uriToCloudStorage;

  @Before
  public void setUp() {
// Path: google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/testing/LocalStorageHelper.java
// public final class LocalStorageHelper {
// 
//   // used for testing. Will throw if you pass it an option.
//   private static final FakeStorageRpc instance = new FakeStorageRpc(true);
// 
//   private LocalStorageHelper() {}
// 
//   /**
//    * 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 getOptions() {
//     instance.reset();
//     return StorageOptions.newBuilder()
//         .setProjectId("fake-project-for-testing")
//         .setServiceRpcFactory(new FakeStorageRpcFactory())
//         .build();
//   }
// 
//   /**
//    * Returns a {@link StorageOptions} that creates a new FakeStorageRpc instance with the given
//    * option.
//    */
//   public static StorageOptions customOptions(final boolean throwIfOptions) {
//     return StorageOptions.newBuilder()
//         .setProjectId("fake-project-for-testing")
//         .setServiceRpcFactory(new FakeStorageRpcFactory(new FakeStorageRpc(throwIfOptions)))
//         .build();
//   }
// 
//   public static class FakeStorageRpcFactory implements ServiceRpcFactory<StorageOptions> {
// 
//     private final FakeStorageRpc instance;
// 
//     public FakeStorageRpcFactory() {
//       this(LocalStorageHelper.instance);
//     }
// 
//     public FakeStorageRpcFactory(FakeStorageRpc instance) {
//       this.instance = instance;
//     }
// 
//     @Override
//     public ServiceRpc create(StorageOptions storageOptions) {
//       return instance;
//     }
//   }
// }


// Path: google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/NIOTest.java
import static com.google.common.truth.Truth.assertThat;
import com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper;
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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



/**
 * Unit tests for {@link CloudStorageFileSystemProvider}. Makes sure the NIO system picks it up
 * properly.
 */
@RunWith(JUnit4.class)
public class NIOTest {
  @Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);

  private URI uriToCloudStorage;

  @Before
  public void setUp() {
    CloudStorageFileSystemProvider.setStorageOptions(LocalStorageHelper.getOptions());