Skip to content

Commit

Permalink
Microsoft CDM Release Version Update: 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cdm-publisher committed May 18, 2021
1 parent 4f8ce2b commit 824e495
Show file tree
Hide file tree
Showing 41 changed files with 509 additions and 441 deletions.
2 changes: 1 addition & 1 deletion docs/bundle.js

Large diffs are not rendered by default.

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.0</version>
<version>1.2.1</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 @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net462</TargetFrameworks>
<version>1.2.0</version>
<version>1.2.1</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.0</version>
<version>1.2.1</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 @@ -49,6 +49,25 @@ public async Task TestOwnerNotChanged()
Assert.AreEqual(entity, entity.Attributes[0].Owner, "Entity's attribute's owner should have remained unchanged (same as the owning entity)");
}

/// <summary>
/// Tests that resolution runs correctly when resolving a resolved entity
/// </summary>
/// <returns></returns>
[TestMethod]
public async Task TestResolvingResolvedEntity()
{
var corpus = TestHelper.GetLocalCorpus(testsSubpath, "TestResolvingResolvedEntity");
var entity = await corpus.FetchObjectAsync<CdmEntityDefinition>("local:/Entity.cdm.json/Entity");

var resEntity = await entity.CreateResolvedEntityAsync("resEntity");
var resResEntity = await resEntity.CreateResolvedEntityAsync("resResEntity");
Assert.IsNotNull(resResEntity);
Assert.AreEqual(1, resResEntity.ExhibitsTraits.Count);
Assert.AreEqual("has.entitySchemaAbstractionLevel", resResEntity.ExhibitsTraits[0].NamedReference);
Assert.AreEqual(1, ((CdmTraitReference)resResEntity.ExhibitsTraits[0]).Arguments.Count);
Assert.AreEqual("resolved", ((CdmTraitReference)resResEntity.ExhibitsTraits[0]).Arguments[0].Value);
}

/// <summary>
/// Test whether or not the test corpus can be resolved
/// The input of this test is a manifest from SchemaDocs, so this test does not need any individual input files.
Expand Down Expand Up @@ -141,11 +160,13 @@ public async Task TestResolveWithExtended()
{
CdmCorpusDefinition cdmCorpus = TestHelper.GetLocalCorpus(testsSubpath, "TestResolveWithExtended");

cdmCorpus.SetEventCallback(new EventCallback { Invoke = (CdmStatusLevel statusLevel, string message) =>
cdmCorpus.SetEventCallback(new EventCallback
{
if (message.Contains("unable to resolve the reference"))
Assert.Fail();
}
Invoke = (CdmStatusLevel statusLevel, string message) =>
{
if (message.Contains("unable to resolve the reference"))
Assert.Fail();
}
}, CdmStatusLevel.Warning);

CdmEntityDefinition ent = await cdmCorpus.FetchObjectAsync<CdmEntityDefinition>("local:/sub/Account.cdm.json/Account");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"jsonSchemaSemanticVersion": "0.9.0",
"imports": [
{
"corpusPath": "cdm:/foundations.cdm.json"
}
],
"definitions": [
{
"entityName": "Entity",
"hasAttributes": [
{
"name": "id",
"dataType": "entityId"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<metadata>

<id>Microsoft.CommonDataModel.ObjectModel.All</id>
<version>1.2.0</version>
<version>1.2.1</version>
<description>The CSharp implementation of 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 @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net45;net462</TargetFrameworks>
<version>1.2.0</version>
<version>1.2.1</version>
<Description>The CSharp implementation of 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</id>
<version>1.2.0</version>
<version>1.2.1</version>
<description>The CSharp implementation of 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 @@ -49,7 +49,6 @@ public class ProjectionCombineTest {
/**
* Test Entity Extends with a Resolution Guidance that selects 'one'
*/
@Ignore("Please refer to bug https://powerbi.visualstudio.com/Power%20Query/_workitems/edit/446164")
@Test
public void TestExtends() throws InterruptedException {
String testName = "TestExtends";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,7 @@

import com.google.common.base.Strings;
import com.microsoft.commondatamodel.objectmodel.TestHelper;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeContext;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeGroupDefinition;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeGroupReference;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeItem;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmAttributeReference;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmCorpusDefinition;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmDocumentDefinition;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmEntityDefinition;
import com.microsoft.commondatamodel.objectmodel.cdm.CdmManifestDefinition;
import com.microsoft.commondatamodel.objectmodel.cdm.StringSpewCatcher;
import com.microsoft.commondatamodel.objectmodel.cdm.*;
import com.microsoft.commondatamodel.objectmodel.resolvedmodel.ResolvedAttributeSet;
import com.microsoft.commondatamodel.objectmodel.storage.LocalAdapter;
import com.microsoft.commondatamodel.objectmodel.storage.StorageAdapterBase;
Expand Down Expand Up @@ -77,6 +68,23 @@ public void testOwnerNotChanged() throws InterruptedException
Assert.assertEquals(entity, entity.getAttributes().get(0).getOwner(), "Entity's attribute's owner should have remained unchanged (same as the owning entity)");
}

/**
* Tests that resolution runs correctly when resolving a resolved entity
*/
@Test
public void testResolvingResolvedEntity() throws InterruptedException
{
CdmCorpusDefinition corpus = TestHelper.getLocalCorpus(TESTS_SUBPATH, "testResolvingResolvedEntity", null);
CdmEntityDefinition entity = corpus.<CdmEntityDefinition>fetchObjectAsync("local:/Entity.cdm.json/Entity").join();
CdmEntityDefinition resEntity = entity.createResolvedEntityAsync("resEntity").join();
CdmEntityDefinition resResEntity = resEntity.createResolvedEntityAsync("resResEntity").join();
Assert.assertNotNull(resResEntity);
Assert.assertEquals(1, resResEntity.getExhibitsTraits().size());
Assert.assertEquals("has.entitySchemaAbstractionLevel", resResEntity.getExhibitsTraits().get(0).getNamedReference());
Assert.assertEquals(1, ((CdmTraitReference)resResEntity.getExhibitsTraits().get(0)).getArguments().size());
Assert.assertEquals("resolved", ((CdmTraitReference)resResEntity.getExhibitsTraits().get(0)).getArguments().get(0).getValue());
}

/**
* Test if the composite resolved entities match
*/
Expand Down
Loading

0 comments on commit 824e495

Please sign in to comment.