Esempio n. 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"));
            }
        }
Esempio n. 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);
        }
Esempio n. 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"));
            }
        }
Esempio n. 4
0
 public async Task ADLSSpecialCharactersTest()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunSpecialCharactersTest(AdlsTestHelper.CreateAdapterWithClientId("PathWithSpecialCharactersAndUnescapedStringTest/Root-With=Special Characters:"));
 }
Esempio n. 5
0
 public async Task ADLSFileEnumClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunFileEnumTest(AdlsTestHelper.CreateAdapterWithClientId());
 }
Esempio n. 6
0
 public async Task ADLSCheckFileTimeClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunCheckFileTimeTest(AdlsTestHelper.CreateAdapterWithClientId());
 }
Esempio n. 7
0
 public async Task ADLSWriteReadWithBlobHostName()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithSharedKey(testBlobHostName: true));
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId(testBlobHostName: true));
 }
Esempio n. 8
0
 public async Task ADLSWriteReadClientIdWithEndpoint()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId(specifyEndpoint: true));
 }
Esempio n. 9
0
 public async Task ADLSWriteReadClientId()
 {
     AdlsTestHelper.CheckADLSEnvironment();
     await RunWriteReadTest(AdlsTestHelper.CreateAdapterWithClientId());
 }