Search in sources :

Example 1 with CompleteUfsFileTOptions

use of alluxio.thrift.CompleteUfsFileTOptions in project alluxio by Alluxio.

the class CompleteUfsFileOptionsTest method toThrift.

/**
   * Tests conversion to thrift representation.
   */
@Test
public void toThrift() throws IOException {
    Random random = new Random();
    String owner = CommonUtils.randomAlphaNumString(10);
    String group = CommonUtils.randomAlphaNumString(10);
    Mode mode = new Mode((short) random.nextInt());
    CompleteUfsFileOptions options = CompleteUfsFileOptions.defaults();
    options.setOwner(owner);
    options.setGroup(group);
    options.setMode(mode);
    CompleteUfsFileTOptions thriftOptions = options.toThrift();
    Assert.assertEquals(owner, thriftOptions.getOwner());
    Assert.assertEquals(group, thriftOptions.getGroup());
    Assert.assertEquals(mode.toShort(), thriftOptions.getMode());
}
Also used : CompleteUfsFileTOptions(alluxio.thrift.CompleteUfsFileTOptions) Random(java.util.Random) Mode(alluxio.security.authorization.Mode) Test(org.junit.Test)

Aggregations

Mode (alluxio.security.authorization.Mode)1 CompleteUfsFileTOptions (alluxio.thrift.CompleteUfsFileTOptions)1 Random (java.util.Random)1 Test (org.junit.Test)1