Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<metadata>

<id>Microsoft.CommonDataModel.ObjectModel.Adapter.Adls.All</id>
<version>1.2.2</version>
<version>1.2.3</version>
<description>The ADLS adapter implementation for the Microsoft Common Data Model Object Model.</description>

<authors>Microsoft</authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net462</TargetFrameworks>
<version>1.2.2</version>
<version>1.2.3</version>
<Description>The ADLS adapter implementation for the Microsoft Common Data Model Object Model.</Description>

<Authors>Microsoft</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<metadata>

<id>Microsoft.CommonDataModel.ObjectModel.Adapter.Adls</id>
<version>1.2.2</version>
<version>1.2.3</version>
<description>The ADLS adapter implementation for the Microsoft Common Data Model Object Model.</description>

<authors>Microsoft</authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public class LocalEntityDeclarationTest
/// Creates Manifest using empty string as namespace.
/// </summary>
[TestMethod]
public void TestLoadLocalEntityNoPartition()
public void TestLoadNoPartition()
{
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadLocalEntityNoPartition", "entities.manifest.cdm.json");
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadNoPartition", "entities.manifest.cdm.json");
var cdmManifest = ManifestPersistence.FromObject(new ResolveContext(new CdmCorpusDefinition(), null), "", "", "", JsonConvert.DeserializeObject<ManifestContent>(content));
Assert.AreEqual(1, cdmManifest.Entities.Count);
Assert.AreEqual(cdmManifest.Entities[0].ObjectType, CdmObjectType.LocalEntityDeclarationDef);
Expand All @@ -49,9 +49,9 @@ public void TestLoadLocalEntityNoPartition()
/// </summary>
/// <returns></returns>
[TestMethod]
public void TestLoadLocalEntityNoPartitionNamespaceSet()
public void TestLoadNoPartitionNamespaceSet()
{
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadLocalEntityNoPartitionNamespaceSet", "entities.manifest.cdm.json");
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadNoPartitionNamespaceSet", "entities.manifest.cdm.json");
ManifestContent manifestContent = JsonConvert.DeserializeObject<ManifestContent>(content);
var cdmManifest = ManifestPersistence.FromObject(new ResolveContext(new CdmCorpusDefinition(), null), "testEntity", "testNamespace", "/", manifestContent);
Assert.AreEqual(cdmManifest.Entities.Count, 1);
Expand All @@ -74,9 +74,9 @@ public void TestLoadLocalEntityNoPartitionNamespaceSet()
/// </summary>
/// <returns></returns>
[TestMethod]
public void TestLoadLocalEntityNoPartitionAbsoluteNamespaceSet()
public void TestLoadNoPartitionAbsoluteNamespaceSet()
{
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadLocalEntityNoPartitionAbsoluteNamespaceSet", "entitiesWithNamespace.manifest.cdm.json");
var content = TestHelper.GetInputFileContent(testsSubpath, "TestLoadNoPartitionAbsoluteNamespaceSet", "entities.manifest.cdm.json");
ManifestContent manifestContent = JsonConvert.DeserializeObject<ManifestContent>(content);
var cdmManifest = ManifestPersistence.FromObject(new ResolveContext(new CdmCorpusDefinition(), null), "testEntity", "testNamespace", "/", manifestContent);
Assert.AreEqual(cdmManifest.Entities.Count, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public async Task TestManifestFoundationImport()
{
Invoke = (CdmStatusLevel statusLevel, string message1) =>
{
if (statusLevel >= CdmStatusLevel.Error)
if (statusLevel >= CdmStatusLevel.Warning)
{
Assert.Fail(message1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Microsoft.CommonDataModel.ObjectModel.Tests.Samples
{
using Microsoft.CommonDataModel.ObjectModel.Cdm;
using Microsoft.CommonDataModel.ObjectModel.Storage;
using Microsoft.CommonDataModel.ObjectModel.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -38,7 +39,7 @@ public async Task TestReadManifest()

var testInputPath = Path.Combine(TestHelper.GetInputFolderPath(testsSubpath, nameof(TestReadManifest)), "input.txt");
var testActualOutputPath = Path.Combine(TestHelper.GetActualOutputFolderPath(testsSubpath, nameof(TestReadManifest)), "output.txt");

using (var reader = new StreamReader(testInputPath, Encoding.UTF8))
{
using (var writer = new StreamWriter(testActualOutputPath, false, Encoding.UTF8))
Expand All @@ -64,6 +65,14 @@ public async Task TestReadManifest()
private CdmCorpusDefinition SetupCdmCorpus()
{
var cdmCorpus = new CdmCorpusDefinition();
cdmCorpus.SetEventCallback(new EventCallback
{
Invoke = (level, message) =>
{
Assert.Fail(message);
}
}, CdmStatusLevel.Warning);

cdmCorpus.Storage.Mount("local", new LocalAdapter(TestHelper.GetInputFolderPath(testsSubpath, nameof(TestReadManifest))));
cdmCorpus.Storage.DefaultNamespace = "local";
cdmCorpus.Storage.Mount("cdm", new LocalAdapter(TestHelper.SampleSchemaFolderPath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace Microsoft.CommonDataModel.ObjectModel.Tests.Storage
using System.Threading.Tasks;
using Microsoft.CommonDataModel.ObjectModel.Cdm;
using Microsoft.CommonDataModel.ObjectModel.Storage;
using Microsoft.CommonDataModel.ObjectModel.Utilities;
using Microsoft.CommonDataModel.ObjectModel.Utilities.Network;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -148,6 +149,37 @@ public async Task ADLSSpecialCharactersTest()
await RunSpecialCharactersTest(AdlsTestHelper.CreateAdapterWithClientId("PathWithSpecialCharactersAndUnescapedStringTest/Root-With=Special Characters:"));
}


/// <summary>
/// Tests if the adapter won't retry if a HttpStatusCode response with a code in AvoidRetryCodes is received.
/// </summary>
/// <returns></returns>
[TestMethod]
public async Task TestAvoidRetryCodes()
{
AdlsTestHelper.CheckADLSEnvironment();
var adlsAdapter = AdlsTestHelper.CreateAdapterWithSharedKey();
adlsAdapter.NumberOfRetries = 3;

var corpus = new CdmCorpusDefinition();
corpus.Storage.Mount("adls", adlsAdapter);
var count = 0;
corpus.SetEventCallback(new EventCallback
{
Invoke = (status, message) =>
{
if (message.Contains("Response for request "))
{
count++;
}
}
}, CdmStatusLevel.Progress);

await corpus.FetchObjectAsync<CdmDocumentDefinition>("adls:/inexistentFile.cdm.json");

Assert.AreEqual(1, count);
}

/// <summary>
/// Creates corpus path and adapter path.
/// </summary>
Expand Down
Loading