コード例 #1
0
ファイル: AdlsAdapterTests.cs プロジェクト: minettes/CDM
        public void TestEndpointMissingOnConfig()
        {
            var config = new JObject
            {
                { "hostname", "hostname.dfs.core.windows.net" },
                { "root", "root" },
                { "tenant", "tenant" },
                { "clientId", "clientId" }
            };
            var adlsAdapter = new ADLSAdapter();

            adlsAdapter.UpdateConfig(config.ToString());
            Assert.AreEqual(AzureCloudEndpoint.AzurePublic, adlsAdapter.Endpoint);
        }
コード例 #2
0
ファイル: AdlsAdapterTests.cs プロジェクト: minettes/CDM
        public void TestFormattedHostname()
        {
            var config = new JObject
            {
                { "hostname", "hostname.dfs.core.windows.net" },
                { "root", "root" },
                { "tenant", "tenant" },
                { "clientId", "clientId" }
            };
            var adlsAdapter = new ADLSAdapter();

            adlsAdapter.UpdateConfig(config.ToString());

            var corpusPath = adlsAdapter.CreateCorpusPath("https://hostname.dfs.core.windows.net/root/partitions/data.csv");

            Assert.AreEqual("/partitions/data.csv", corpusPath);
        }
コード例 #3
0
        public void TestConfigAndUpdateConfigWithoutAuthenticationDetails()
        {
            var adlsAdapter = new ADLSAdapter();

            try
            {
                var config = new JObject
                {
                    { "root", "root" },
                    { "hostname", "hostname" },
                    { "tenant", "tenant" },
                    { "clientId", "clientId" }
                };
                adlsAdapter.UpdateConfig(config.ToString());
                adlsAdapter.Secret    = "secret";
                adlsAdapter.SharedKey = "sharedKey";
            }
            catch
            {
                Assert.Fail("AdlsAdapter initialized without secret shouldn't throw exception when updating config.");
            }
        }