Skip to content

Commit

Permalink
include executables in dataspaceCoverageAPI (#3080)
Browse files Browse the repository at this point in the history
  • Loading branch information
YannanGao-gs authored Sep 18, 2024
1 parent 94ff3d5 commit e9118fa
Show file tree
Hide file tree
Showing 10 changed files with 209 additions and 194 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-javaPlatformBinding-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-analytics-function-pure</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-javaPlatformBinding-externalFormat-pure</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-analytics-store-entitlement</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-analytics-function-pure</artifactId>
</dependency>
<dependency>
<groupId>org.finos.legend.engine</groupId>
<artifactId>legend-engine-xt-analytics-binding-pure</artifactId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
package org.finos.legend.engine.generation.analytics.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.finos.legend.engine.protocol.analytics.model.MappingModelCoverageAnalysisResult;
import org.finos.legend.engine.protocol.pure.v1.model.context.PureModelContextData;
import org.finos.legend.engine.protocol.pure.v1.model.packageableElement.dataSpace.DataSpaceSupportInfo;

import java.util.Collections;
import java.util.List;
import java.util.Map;

public class DataSpaceAnalysisResult
{
Expand All @@ -44,4 +46,6 @@ public class DataSpaceAnalysisResult
public List<DataSpaceExecutableAnalysisResult> executables = Collections.emptyList();
public List<DataSpaceDiagramAnalysisResult> diagrams = Collections.emptyList();
public List<DataSpaceModelDocumentationEntry> elementDocs = Collections.emptyList();

public Map<String, MappingModelCoverageAnalysisResult> mappingToMappingCoverageResult;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
})
public abstract class DataSpaceExecutableInfo
{
public String id;
public String executionContextKey;
public String query;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class DataSpaceExecutionContextAnalysisResult
public List<String> compatibleRuntimes;
public String defaultRuntime;
public DataSpaceExecutionContextRuntimeMetadata runtimeMetadata;
@Deprecated
public MappingModelCoverageAnalysisResult mappingModelCoverageAnalysisResult;
public List<DatasetSpecification> datasets;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@

public class DataSpaceFunctionPointerExecutableInfo extends DataSpaceExecutableInfo
{
public String id;
public String executionContextKey;
public String function;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

public class DataSpaceTemplateExecutableInfo extends DataSpaceExecutableInfo
{
public String id;
public String executionContextKey;
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public void testDataSpaceAnalysisWithNotFoundDataSpace() throws IOException
public void testDataSpaceAnalysis() throws IOException
{
PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("dataSpaceAnalyticsTestData.json")), PureModelContextData.class);
String expected = "{\"defaultExecutionContext\":\"dummyContext\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping\",\"mappingModelCoverageAnalysisResult\":{\"mappedEntities\":[]},\"name\":\"dummyContext\"}],\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[],\"taggedValues\":[]}";
String expected = "{\"defaultExecutionContext\":\"dummyContext\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"datasets\":[],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[]}},\"model\":{\"_type\":\"data\",\"elements\":[]},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[],\"taggedValues\":[]}";
testAnalyticsWithVersions(expected, modelContextData, "model::animal::AnimalDS");
}

@Test
public void testDataSpaceCoverageAnalysis() throws IOException
{
PureModelContextData modelContextData = objectMapper.readValue(Objects.requireNonNull(getClass().getClassLoader().getResource("dataSpaceAnalyticsTestData.json")), PureModelContextData.class);
String expected = "{\"defaultExecutionContext\":\"dummyContext\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping\",\"mappingModelCoverageAnalysisResult\":{\"mappedEntities\":[],\"model\":{\"_type\":\"data\",\"elements\":[{\"_type\":\"dataSpace\",\"defaultExecutionContext\":\"dummyContext\",\"executionContexts\":[{\"defaultRuntime\":{\"path\":\"model::dummyRuntime\",\"type\":\"RUNTIME\"},\"mapping\":{\"path\":\"model::dummyMapping\",\"type\":\"MAPPING\"},\"name\":\"dummyContext\"}],\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"stereotypes\":[],\"taggedValues\":[]}]}},\"name\":\"dummyContext\"}],\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[],\"taggedValues\":[]}";
String expected = "{\"defaultExecutionContext\":\"dummyContext\",\"diagrams\":[],\"elementDocs\":[],\"elements\":[],\"executables\":[],\"executionContexts\":[{\"compatibleRuntimes\":[\"model::dummyRuntime\"],\"defaultRuntime\":\"model::dummyRuntime\",\"mapping\":\"model::dummyMapping\",\"name\":\"dummyContext\"}],\"mappingToMappingCoverageResult\":{\"model::dummyMapping\":{\"mappedEntities\":[],\"model\":{\"_type\":\"data\",\"elements\":[]}}},\"name\":\"AnimalDS\",\"package\":\"model::animal\",\"path\":\"model::animal::AnimalDS\",\"stereotypes\":[],\"taggedValues\":[]}";
testCoverageAnalyticsWithVersions(expected, modelContextData, "model::animal::AnimalDS");
}

Expand Down

0 comments on commit e9118fa

Please sign in to comment.