public static void createEmptyFile(AzureBlobStorageTestAccount testAccount, Path testPath) throws Exception { FileSystem fs = testAccount.getFileSystem(); FSDataOutputStream inputStream = fs.create(testPath); inputStream.close(); }
@Override protected void setUp() throws Exception { testAccount = AzureBlobStorageTestAccount.create(); if (testAccount != null) { fs = testAccount.getFileSystem(); } }
private boolean validateIOStreams(Path filePath) throws IOException { // Capture the file system from the test account. FileSystem fs = testAccount.getFileSystem(); return validateIOStreams(fs, filePath); }
/** * Validates the implementation of InputStream.mark and reset * for version 1 of the block blob input stream. * @throws Exception */ @Test public void test_0303_MarkAndResetV1() throws Exception { validateMarkAndReset(accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of Seekable.seekToNewSource, which should * return false for version 1 of the block blob input stream. * @throws IOException */ @Test public void test_0305_SeekToNewSourceV1() throws IOException { validateSeekToNewSource(accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of Seekable.seek, Seekable.getPos, * and InputStream.available. * @throws Exception */ @Test public void test_0311_SeekAndAvailableAndPositionV1() throws Exception { validateSeekAndAvailableAndPosition( accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of InputStream.markSupported. * @throws IOException */ @Test public void test_0301_MarkSupportedV1() throws IOException { validateMarkSupported(accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of InputStream.skip and ensures there is no * network I/O for version 1 of the block blob input stream. * @throws Exception */ @Test public void test_0307_SkipBoundsV1() throws Exception { validateSkipBounds(accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of Seekable.seek and ensures there is no * network I/O for forward seek. * @throws Exception */ @Test public void test_0310_SeekBoundsV2() throws Exception { validateSeekBounds(accountUsingInputStreamV2.getFileSystem()); }
/** * Validates the implementation of InputStream.markSupported. * @throws IOException */ @Test public void test_0302_MarkSupportedV2() throws IOException { validateMarkSupported(accountUsingInputStreamV1.getFileSystem()); }
/** * Validates the implementation of InputStream.skip, Seekable.getPos, * and InputStream.available. * @throws IOException */ @Test public void test_0313_SkipAndAvailableAndPositionV1() throws IOException { validateSkipAndAvailableAndPosition( accountUsingInputStreamV1.getFileSystem()); }
@Test public void testSkipMetricsCollection() throws Exception { AzureBlobStorageTestAccount a; a = AzureBlobStorageTestAccount.createMock(); a.getFileSystem().getConf().setBoolean( NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, true); a.getFileSystem().create(new Path("/foo")).close(); a.closeFileSystem(); // Causes the file system to close, which publishes metrics assertEquals(0, getFilesCreated(a)); } }
@Test public void testSkipMetricsCollection() throws Exception { AzureBlobStorageTestAccount a; a = AzureBlobStorageTestAccount.createMock(); a.getFileSystem().getConf().setBoolean( NativeAzureFileSystem.SKIP_AZURE_METRICS_PROPERTY_NAME, true); a.getFileSystem().create(new Path("/foo")).close(); a.closeFileSystem(); // Causes the file system to close, which publishes metrics assertEquals(0, getFilesCreated(a)); } }
@Before public void setUp() throws Exception { nameThread(); testAccount = AzureBlobStorageTestAccount.createForEmulator(); if (testAccount != null) { fs = testAccount.getFileSystem(); } assumeNotNull(fs); basePath = fs.makeQualified( AzureTestUtils.createTestPath( new Path("ITestNativeAzureFileSystemContractEmulator"))); }
@Before public void setUp() throws Exception { testAccount = AzureBlobStorageTestAccount.create(); if (testAccount != null) { fs = testAccount.getFileSystem(); } assumeNotNull(testAccount); }
@Before public void setUp() throws Exception { nameThread(); testAccount = AzureBlobStorageTestAccount.create(); if (testAccount != null) { fs = testAccount.getFileSystem(); } assumeNotNull(fs); basePath = fs.makeQualified( AzureTestUtils.createTestPath( new Path("NativeAzureFileSystemContractLive"))); }
private void testStatisticsWithAccount(AzureBlobStorageTestAccount testAccount) throws Exception { assumeNotNull(testAccount); NativeAzureFileSystem fs = testAccount.getFileSystem(); testStatistics(fs); cleanupTestAccount(testAccount); }
@Before public void setUp() throws Exception { super.setUp(); testAccount = createTestAccount(); fs = testAccount.getFileSystem(); Configuration conf = fs.getConf(); conf.setBoolean(NativeAzureFileSystem.APPEND_SUPPORT_ENABLE_PROPERTY_NAME, true); conf.set(AzureNativeFileSystemStore.KEY_BLOCK_BLOB_WITH_COMPACTION_DIRECTORIES, "/user/active"); URI uri = fs.getUri(); fs.initialize(uri, conf); }
@Before public void setUp() throws Exception { testAccount = createTestAccount(); assumeNotNull(testAccount); fs = testAccount.getFileSystem(); basePath = AzureTestUtils.pathForTests(fs, "filesystemcontractpageblob"); }
@Before public void setUp() throws Exception { testAccount = AzureBlobStorageTestAccount.createMock(); fs = testAccount.getFileSystem(); backingStore = testAccount.getMockStorage().getBackingStore(); }