package alluxio.underfs.s3;

/**
 * Created by botang on 16/8/25.
 */
public class S3UnderFileSystemTest {
}

@@ -1,109 +1,3273 @@
-package alluxio.underfs.s3;%0A%0A/**%0A * Created by botang on 16/8/25.%0A */%0Apublic class S3UnderFileSystemTest %7B
+/*%0A * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0%0A * (the %22License%22). You may not use this work except in compliance with the License, which is%0A * available at www.apache.org/licenses/LICENSE-2.0%0A *%0A * This software is distributed on an %22AS IS%22 basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,%0A * either express or implied, as more fully set forth in the License.%0A *%0A * See the NOTICE file distributed with this work for information regarding copyright ownership.%0A */%0A%0Apackage alluxio.underfs.s3;%0A%0Aimport alluxio.AlluxioURI;%0A%0Aimport org.jets3t.service.S3Service;%0Aimport org.jets3t.service.ServiceException;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Matchers;%0Aimport org.mockito.Mockito;%0A%0Aimport java.io.IOException;%0A%0A/**%0A * Unit tests for the %7B@link S3UnderFileSystem%7D.%0A */%0Apublic class S3UnderFileSystemTest %7B%0A%0A  private S3UnderFileSystem mS3UnderFileSystem;%0A  private S3Service mClient;%0A%0A  private static final String PATH = %22path%22;%0A  private static final String SRC = %22src%22;%0A  private static final String DST = %22dst%22;%0A%0A  private static final String BUCKET_NAME = %22bucket%22;%0A  private static final String BUCKET_PREFIX = %22prefix%22;%0A  private static final short BUCKET_MODE = 0;%0A  private static final String ACCOUNT_OWNER = %22account owner%22;%0A  private static final String ACCOUNT_OWNER_ID = %22account owner id%22;%0A%0A  /**%0A   * Set up.%0A   */%0A  @Before%0A  public void before() throws InterruptedException, ServiceException %7B%0A    mClient = Mockito.mock(S3Service.class);%0A%0A    mS3UnderFileSystem = new S3UnderFileSystem(new AlluxioURI(%22%22),%0A            mClient, BUCKET_NAME, BUCKET_PREFIX, BUCKET_MODE, ACCOUNT_OWNER, ACCOUNT_OWNER_ID);%0A  %7D%0A%0A  /**%0A   * Test case for %7B@link S3UnderFileSystem#delete(String, boolean)%7D.%0A   * when %7B@link ServiceException%7D is thrown.%0A   */%0A  @Test%0A  public void deleteNonRecursive() throws IOException, ServiceException %7B%0A    Mockito.when(mClient.listObjectsChunked(Matchers.anyString(), Matchers.anyString(),%0A            Matchers.anyString(), Matchers.anyLong(), Matchers.anyString()))%0A            .thenThrow(ServiceException.class);%0A%0A    boolean result = mS3UnderFileSystem.delete(PATH, false);%0A    Assert.assertFalse(result);%0A  %7D%0A%0A  /**%0A   * Test case for %7B@link S3UnderFileSystem#delete(String, boolean)%7D.%0A   * when %7B@link ServiceException%7D is thrown.%0A   */%0A  @Test%0A  public void deleteRecursive() throws IOException, ServiceException %7B%0A    Mockito.when(mClient.listObjectsChunked(Matchers.anyString(), Matchers.anyString(),%0A            Matchers.anyString(), Matchers.anyLong(), Matchers.anyString()))%0A            .thenThrow(ServiceException.class);%0A%0A    boolean result = mS3UnderFileSystem.delete(PATH, true);%0A    Assert.assertFalse(result);%0A  %7D%0A%0A  /**%0A   * Test case for %7B@link S3UnderFileSystem#rename(String, String)%7D.%0A   * when %7B@link ServiceException%7D is thrown.%0A   */%0A  @Test%0A  public void rename() throws IOException, ServiceException %7B%0A    Mockito.when(mClient.listObjectsChunked(Matchers.anyString(), Matchers.anyString(),%0A            Matchers.anyString(), Matchers.anyLong(), Matchers.anyString()))%0A            .thenThrow(ServiceException.class);%0A%0A    boolean result = mS3UnderFileSystem.rename(SRC, DST);%0A    Assert.assertFalse(result);%0A  %7D
 %0A%7D%0A

add missing file