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());
}
Aggregations