Exemplo n.º 1
0
 /** Tests that a {@link DummyFileOutputStream} is returned. */
 @Test
 public void getDummyOutStreamTest() throws Exception {
   AlluxioURI path = new AlluxioURI("test");
   Mockito.when(mLineageMasterClient.reinitializeFile("test", TEST_BLOCK_SIZE, 0)).thenReturn(-1L);
   CreateFileOptions options =
       CreateFileOptions.defaults().setBlockSizeBytes(TEST_BLOCK_SIZE).setTtl(0);
   FileOutStream outStream = mAlluxioLineageFileSystem.createFile(path, options);
   Assert.assertTrue(outStream instanceof DummyFileOutputStream);
   // verify client is released
   Mockito.verify(mLineageContext).releaseMasterClient(mLineageMasterClient);
 }