use of alluxio.testutils.master.FsMasterResource in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method directoryTestUtil.
private void directoryTestUtil(URIStatus status) throws Exception {
try (FsMasterResource masterResource = createFsMasterFromJournal()) {
FileSystemMaster fsMaster = masterResource.getRegistry().get(FileSystemMaster.class);
long rootId = fsMaster.getFileId(mRootUri);
Assert.assertTrue(rootId != IdUtils.INVALID_FILE_ID);
Assert.assertEquals(1, fsMaster.listStatus(mRootUri, ListStatusContext.mergeFrom(ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER))).size());
long fileId = fsMaster.getFileId(new AlluxioURI("/xyz"));
Assert.assertTrue(fileId != IdUtils.INVALID_FILE_ID);
Assert.assertEquals(status, new URIStatus(fsMaster.getFileInfo(fileId).setMountId(status.getMountId())));
}
}
use of alluxio.testutils.master.FsMasterResource in project alluxio by Alluxio.
the class UfsJournalIntegrationTest method deleteTestUtil.
private void deleteTestUtil() throws Exception {
try (FsMasterResource masterResource = createFsMasterFromJournal()) {
FileSystemMaster fsMaster = masterResource.getRegistry().get(FileSystemMaster.class);
long rootId = fsMaster.getFileId(mRootUri);
Assert.assertTrue(rootId != IdUtils.INVALID_FILE_ID);
Assert.assertEquals(5, fsMaster.listStatus(mRootUri, ListStatusContext.mergeFrom(ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER))).size());
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
Assert.assertTrue(fsMaster.getFileId(new AlluxioURI("/i" + i + "/j" + j)) != IdUtils.INVALID_FILE_ID);
}
}
}
}
Aggregations