@@ -0,0 +1,3475 @@
+/*%0A * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0%0A * (the %E2%80%9CLicense%E2%80%9D). 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.client.file;%0A%0Aimport alluxio.wire.FileInfo;%0Aimport alluxio.wire.FileInfoTest;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0A/**%0A * Tests for the %7B@link URIStatus%7D class.%0A */%0Apublic class URIStatusTest %7B%0A%0A  @Test%0A  public void constructorTest() %7B%0A    try %7B%0A      new URIStatus(null);%0A      Assert.fail(%22Cannot create a URIStatus from a null FileInfo%22);%0A    %7D catch (Exception e) %7B%0A      Assert.assertTrue(e instanceof NullPointerException);%0A      Assert.assertTrue(e.getMessage().contains(%0A          %22Cannot create a URIStatus from a null FileInfo%22));%0A    %7D%0A  %7D%0A%0A  /**%0A   * Tests getting and setting fields.%0A   */%0A  @Test (timeout = 10000)%0A  public void fieldsTest() %7B%0A    FileInfo fileInfo = FileInfoTest.createRandom();%0A    URIStatus uriStatus = new URIStatus(fileInfo);%0A    Assert.assertEquals(uriStatus.getBlockIds(), fileInfo.getBlockIds());%0A    Assert.assertEquals(uriStatus.getBlockSizeBytes(),%0A        fileInfo.getBlockSizeBytes());%0A    Assert.assertEquals(uriStatus.getCreationTimeMs(),%0A        fileInfo.getCreationTimeMs());%0A    Assert.assertEquals(uriStatus.getFileId(), fileInfo.getFileId());%0A    Assert.assertEquals(uriStatus.getGroupName(), fileInfo.getGroupName());%0A    Assert.assertEquals(uriStatus.getInMemoryPercentage(),%0A        fileInfo.getInMemoryPercentage());%0A    Assert.assertEquals(uriStatus.getLastModificationTimeMs(),%0A        fileInfo.getLastModificationTimeMs());%0A    Assert.assertEquals(uriStatus.getLength(), fileInfo.getLength());%0A    Assert.assertEquals(uriStatus.getName(), fileInfo.getName());%0A    Assert.assertEquals(uriStatus.getPath(), fileInfo.getPath());%0A    Assert.assertEquals(uriStatus.getPermission(), fileInfo.getPermission());%0A    Assert.assertEquals(uriStatus.getPersistenceState(),%0A        fileInfo.getPersistenceState());%0A    Assert.assertEquals(uriStatus.getTtl(), fileInfo.getTtl());%0A    Assert.assertEquals(uriStatus.getUfsPath(), fileInfo.getUfsPath());%0A    Assert.assertEquals(uriStatus.getUserName(), fileInfo.getUserName());%0A    Assert.assertEquals(uriStatus.isCacheable(), fileInfo.isCacheable());%0A    Assert.assertEquals(uriStatus.isCompleted(), fileInfo.isCompleted());%0A    Assert.assertEquals(uriStatus.isFolder(), fileInfo.isFolder());%0A    Assert.assertEquals(uriStatus.isPersisted(), fileInfo.isPersisted());%0A    Assert.assertEquals(uriStatus.isPinned(), fileInfo.isPinned());%0A    Assert.assertEquals(uriStatus.isMountPoint(), fileInfo.isMountPoint());%0A    Assert.assertEquals(uriStatus.getFileBlockInfos(),%0A        fileInfo.getFileBlockInfos());%0A    Assert.assertEquals(uriStatus.toString(), fileInfo.toString());%0A  %7D%0A%0A  @Test (timeout = 10000)%0A  public void testEquals() throws Exception %7B%0A    FileInfo fileInfo = FileInfoTest.createRandom();%0A    URIStatus uriStatus1 = new URIStatus(fileInfo);%0A    URIStatus uriStatus2 = new URIStatus(fileInfo);%0A    Assert.assertTrue(uriStatus1.equals(uriStatus2));%0A    Assert.assertEquals(uriStatus1.hashCode(), uriStatus2.hashCode());%0A  %7D%0A%7D%0A

Add unit tests for URIStatus