use of alluxio.client.file.policy.RoundRobinPolicy in project alluxio by Alluxio.
the class OutStreamOptionsTest method fields.
/**
* Tests getting and setting fields.
*/
@Test
public void fields() {
Random random = new Random();
long blockSize = random.nextLong();
FileWriteLocationPolicy locationPolicy = new RoundRobinPolicy();
String owner = CommonUtils.randomAlphaNumString(10);
String group = CommonUtils.randomAlphaNumString(10);
Mode mode = new Mode((short) random.nextInt());
long ttl = random.nextLong();
int writeTier = random.nextInt();
WriteType writeType = WriteType.NONE;
OutStreamOptions options = OutStreamOptions.defaults();
options.setBlockSizeBytes(blockSize);
options.setLocationPolicy(locationPolicy);
options.setOwner(owner);
options.setGroup(group);
options.setMode(mode);
options.setTtl(ttl);
options.setTtlAction(TtlAction.FREE);
options.setWriteTier(writeTier);
options.setWriteType(writeType);
Assert.assertEquals(blockSize, options.getBlockSizeBytes());
Assert.assertEquals(locationPolicy, options.getLocationPolicy());
Assert.assertEquals(owner, options.getOwner());
Assert.assertEquals(group, options.getGroup());
Assert.assertEquals(mode, options.getMode());
Assert.assertEquals(ttl, options.getTtl());
Assert.assertEquals(TtlAction.FREE, options.getTtlAction());
Assert.assertEquals(writeTier, options.getWriteTier());
Assert.assertEquals(writeType.getAlluxioStorageType(), options.getAlluxioStorageType());
Assert.assertEquals(writeType.getUnderStorageType(), options.getUnderStorageType());
}
Aggregations