예제 #1
0
        public async Task ADLSWriteClientIdLargeFileContentsNoEmptyFileLeft()
        {
            AdlsTestHelper.CheckADLSEnvironment();
            string      filename      = "largefilecheck_CSharp.txt";
            string      writeContents = new string('A', 100000000);
            ADLSAdapter adapter       = AdlsTestHelper.CreateAdapterWithClientId();

            adapter.Ctx = new ResolveContext(null, null);
            adapter.Ctx.FeatureFlags.Add("ADLSAdapter_deleteEmptyFile", true);

            try
            {
                await adapter.WriteAsync(filename, writeContents);
            }
            catch (Exception e)
            { }

            try
            {
                await adapter.ReadAsync(filename);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.Message.Contains("The specified path does not exist"));
            }
        }
예제 #2
0
        private CdmCorpusDefinition SetupCdmCorpus()
        {
            // ------------------------------------------------------------------------------------------------------------
            // Instantiate corpus and set up the default namespace to be local
            var cdmCorpus = new CdmCorpusDefinition();

            cdmCorpus.Storage.DefaultNamespace = "local";

            // ------------------------------------------------------------------------------------------------------------
            // Set up adapters for managing access to different files-system locations c

            // Fake cdm, normaly use the CDM Standards adapter
            // Mount it as the 'cdm' device, not the default so must use "cdm:/folder" to get there
            cdmCorpus.Storage.Mount("cdm", new LocalAdapter(TestHelper.SampleSchemaFolderPath));

            cdmCorpus.Storage.Mount(
                "local",
                new LocalAdapter(AdlsModelJsonTestHelper.GetActualSubFolderPath(testsSubpath, nameof(TestReadLocalSaveAdls), AdlsModelJsonTestHelper.inputFolderName))
                );

            // Example how to mount to the ADLS - make sure the hostname and root entered here are also changed
            // in the example.model.json file we load in the next section
            cdmCorpus.Storage.Mount(
                "adls",
                AdlsTestHelper.CreateAdapterWithClientId(rootRelativePath)
                );

            return(cdmCorpus);
        }
예제 #3
0
        public async Task ADLSWriteClientIdEmptyContentsNoEmptyFileLeft()
        {
            AdlsTestHelper.CheckADLSEnvironment();
            string filename      = "emptycheck_CSharp.txt";
            string writeContents = "";

            ADLSAdapter adapter = AdlsTestHelper.CreateAdapterWithClientId();

            try
            {
                await adapter.WriteAsync(filename, writeContents);
            }
            catch (Exception e)
            {}

            try
            {
                await adapter.ReadAsync(filename);
            }
            catch (Exception e)
            {
                Assert.IsTrue(e.Message.Contains("The specified path does not exist"));
            }
        }
예제 #4
0
 public async Task ADLSSpecialCharactersTest()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunSpecialCharactersTest(AdlsTestHelper.CreateAdapterWithClientId("PathWithSpecialCharactersAndUnescapedStringTest/Root-With=Special Characters:"));
 }
예제 #5
0
 public async Task ADLSFileEnumClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunFileEnumTest(AdlsTestHelper.CreateAdapterWithClientId());
 }
예제 #6
0
 public async Task ADLSCheckFileTimeClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunCheckFileTimeTest(AdlsTestHelper.CreateAdapterWithClientId());
 }
예제 #7
0
 public async Task ADLSWriteReadWithBlobHostName()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithSharedKey(testBlobHostName: true));
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId(testBlobHostName: true));
 }
예제 #8
0
 public async Task ADLSWriteReadClientIdWithEndpoint()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId(specifyEndpoint: true));
 }
예제 #9
0
 public async Task ADLSWriteReadClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId());
 }