/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.master.file.meta;

import alluxio.Constants;
import alluxio.master.block.BlockId;
import alluxio.master.file.options.CreateDirectoryOptions;
import alluxio.master.file.options.CreateFileOptions;
import alluxio.security.authorization.Mode;

import org.junit.Rule;
import org.junit.rules.ExpectedException;

/**
 * Abstract class for serving inode tests.
 */
public abstract class AbstractInodeTest {
  public static final String TEST_OWNER = "user1";
  public static final String TEST_GROUP = "group1";
  public static final Mode TEST_DIR_MODE = new Mode((short) 0755);
  public static final Mode TEST_FILE_MODE = new Mode((short) 0644);

  @Rule
  public ExpectedException mThrown = ExpectedException.none();

  protected long createInodeFileId(long containerId) {
    return BlockId.createBlockId(containerId, BlockId.getMaxSequenceNumber());
  }

  protected static InodeDirectory createInodeDirectory() {
    return InodeDirectory.create(1, 0, "test1",
        CreateDirectoryOptions.defaults().setOwner(TEST_OWNER).setGroup(TEST_GROUP)
            .setMode(TEST_DIR_MODE));
  }

  protected InodeFile createInodeFile(long id) {
    return InodeFile.create(id, 1, "testFile" + id, 0,
        CreateFileOptions.defaults().setBlockSizeBytes(Constants.KB).setOwner(TEST_OWNER)
            .setGroup(TEST_GROUP).setMode(TEST_FILE_MODE));
  }
}

@@ -1233,16 +1233,165 @@
 one();%0A%0A
+  /**%0A   * @param containerId the container id to create the InodeFile id with%0A   * @return the InodeFile id constructed with the container id%0A   */%0A
   protec
@@ -1433,24 +1433,24 @@
 tainerId) %7B%0A
-
     return B
@@ -1513,32 +1513,99 @@
 Number());%0A  %7D%0A%0A
+  /**%0A   * @return the %7B@link InodeDirectory%7D representation%0A   */%0A
   protected stat
@@ -1822,16 +1822,126 @@
 );%0A  %7D%0A%0A
+  /**%0A   * @param id block container id of this inode%0A   * @return the %7B@link InodeFile%7D representation%0A   */%0A
   protec

Add javadoc for AbstractInodeTest.java