Search in sources :

Example 1 with Import

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import in project legend-pure by finos.

the class M3ToJavaGenerator method createWrapperClass.

private String createWrapperClass(final CoreInstance instance, String javaPackage, MutableSet<CoreInstance> properties, MutableSet<CoreInstance> propertiesFromAssociations, MutableSet<CoreInstance> qualifiedProperties, Imports imports, MutableMap<String, CoreInstance> propertyOwners) {
    imports.addImports(Lists.mutable.of("org.finos.legend.pure.m4.coreinstance.simple.ValueHolder", "org.finos.legend.pure.m3.coreinstance.helper.PrimitiveHelper"));
    final String interfaceName = getInterfaceName(instance);
    String wrapperName = getWrapperName(instance);
    String typeParamsWithExtendsCoreInstance = getTypeParams(instance, true);
    final CoreInstance classGenericType = getClassGenericType(instance);
    imports.setThisClassName(wrapperName);
    PartitionIterable<CoreInstance> partition = properties.partition(M3ToJavaGenerator::isToOne);
    RichIterable<CoreInstance> toOneProperties = partition.getSelected();
    RichIterable<CoreInstance> toManyProperties = partition.getRejected();
    RichIterable<CoreInstance> mandatoryToOneProps = toOneProperties.select(M3ToJavaGenerator::isMandatoryProperty);
    RichIterable<Pair<String, String>> typesForMandatoryProps = buildMandatoryProperties(classGenericType, mandatoryToOneProps, imports).toSortedSetBy(Pair::getOne);
    MutableList<String> mandatoryTypes = Lists.mutable.of();
    MutableList<String> mandatoryProps = Lists.mutable.of();
    for (Pair<String, String> pair : typesForMandatoryProps) {
        mandatoryTypes.add(pair.getTwo() + " " + pair.getOne());
        mandatoryProps.add(pair.getOne());
    }
    final String maybeFullyQualifiedInterfaceName = (imports.shouldFullyQualify(javaPackage + "." + interfaceName) ? javaPackage + "." + interfaceName : interfaceName);
    String maybeFullyQualifiedInterfaceNameWithTypeParams = maybeFullyQualifiedInterfaceName + typeParamsWithExtendsCoreInstance;
    String systemPathForPackageableElement = getUserObjectPathForPackageableElement(instance, true).makeString("::");
    String value = "\n" + "package " + javaPackage + ";\n" + "\n" + "import org.eclipse.collections.api.RichIterable;\n" + "import org.eclipse.collections.api.block.predicate.Predicate;\n" + "import org.eclipse.collections.api.list.ListIterable;\n" + "import org.eclipse.collections.api.list.MutableList;\n" + "import org.eclipse.collections.api.set.SetIterable;\n" + "import org.eclipse.collections.impl.factory.Lists;\n" + "import org.eclipse.collections.impl.factory.Sets;\n" + "import org.finos.legend.pure.m3.coreinstance.BaseCoreInstance;\n" + "import org.finos.legend.pure.m4.coreinstance.AbstractCoreInstanceWrapper;\n" + "import org.finos.legend.pure.m3.coreinstance.BaseM3CoreInstanceFactory;\n" + "import org.finos.legend.pure.m4.coreinstance.AbstractCoreInstance;\n" + imports.toImportString() + "\n" + getPrimitiveImports() + "\n" + "import org.finos.legend.pure.m4.coreinstance.CoreInstance;\n" + "\n" + "public class " + wrapperName + " extends AbstractCoreInstanceWrapper implements " + maybeFullyQualifiedInterfaceNameWithTypeParams + "\n" + "{\n" + "    public static final CoreInstanceFunction FROM_CORE_INSTANCE_FN = new CoreInstanceFunction();\n" + "    public " + wrapperName + "(CoreInstance instance)\n" + "    {\n" + "        super(instance);\n" + "    }\n" + "\n" + toOneProperties.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        return createWrapperPropertyGetterToOne(interfaceName, property, propertyReturnGenericType, imports);
    }).makeString("") + toManyProperties.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        return createWrapperPropertyGetterToMany(interfaceName, property, propertyReturnGenericType, imports);
    }).makeString("") + "\n" + toOneProperties.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        String sub = getSubstituteType(property, propertyReturnGenericType);
        return sub == null ? "" : "    public " + maybeFullyQualifiedInterfaceName + " " + getUnifiedMethodName(property) + "(" + sub + " value)\n" + "    {\n" + "        instance.setKeyValues(" + createPropertyKeyNameReference(property.getName(), propertyOwners.get(property.getName()), instance) + ", Lists.immutable.<CoreInstance>with((CoreInstance)value));\n" + "        return this;\n" + "    }\n" + "\n";
    }).makeString("") + properties.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        return createWrapperPropertySetter(property, propertyReturnGenericType, imports, maybeFullyQualifiedInterfaceName, propertyOwners, instance);
    }).makeString("") + propertiesFromAssociations.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        return createPropertyReverse(property, propertyReturnGenericType, imports, false, true) + createPropertyReverse(property, propertyReturnGenericType, imports, true, true);
    }).makeString("") + qualifiedProperties.collect(property -> {
        CoreInstance propertyReturnGenericType = this.propertyTypeResolver.getPropertyReturnType(classGenericType, property);
        return createWrapperQualifiedPropertyGetter(property, propertyReturnGenericType, imports);
    }).makeString("") + "\n" + "    public static " + maybeFullyQualifiedInterfaceName + " to" + interfaceName + "(CoreInstance instance)\n" + "    {\n" + "        if (instance == null) { return null; }\n" + "        return " + maybeFullyQualifiedInterfaceName + ".class.isInstance(instance) ? (" + maybeFullyQualifiedInterfaceName + ") instance : new " + wrapperName + "(instance);\n" + "    }\n" + createWrapperStaticConversionFunction(interfaceName, wrapperName, maybeFullyQualifiedInterfaceNameWithTypeParams, getTypeParams(instance, false)) + createWrapperClassCopyMethod(instance, maybeFullyQualifiedInterfaceName) + createClassPackageableElement(systemPathForPackageableElement) + "}\n";
    return value;
}
Also used : ArrayAdapter(org.eclipse.collections.impl.list.fixed.ArrayAdapter) Lists(org.eclipse.collections.api.factory.Lists) SetIterable(org.eclipse.collections.api.set.SetIterable) MutableList(org.eclipse.collections.api.list.MutableList) FastList(org.eclipse.collections.impl.list.mutable.FastList) Maps(org.eclipse.collections.api.factory.Maps) MutableSet(org.eclipse.collections.api.set.MutableSet) RichIterable(org.eclipse.collections.api.RichIterable) MutableMap(org.eclipse.collections.api.map.MutableMap) Map(java.util.Map) Tuples(org.eclipse.collections.impl.tuple.Tuples) Pair(org.eclipse.collections.api.tuple.Pair) StringIterate(org.eclipse.collections.impl.utility.StringIterate) Path(java.nio.file.Path) Sets(org.eclipse.collections.api.factory.Sets) JavaTools(org.finos.legend.pure.m3.tools.JavaTools) ArrayIterate(org.eclipse.collections.impl.utility.ArrayIterate) ModelRepository(org.finos.legend.pure.m4.ModelRepository) Files(java.nio.file.Files) Collection(java.util.Collection) IOException(java.io.IOException) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) StandardCharsets(java.nio.charset.StandardCharsets) Objects(java.util.Objects) Paths(java.nio.file.Paths) ListIterable(org.eclipse.collections.api.list.ListIterable) MapIterable(org.eclipse.collections.api.map.MapIterable) PartitionIterable(org.eclipse.collections.api.partition.PartitionIterable) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) Pair(org.eclipse.collections.api.tuple.Pair)

Example 2 with Import

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import in project legend-pure by finos.

the class TestSimpleGrammar method testMappingAssociation.

@Test
public void testMappingAssociation() {
    Loader.parseM3("import other::*;\n" + "\n" + "Class other::Person\n" + "{\n" + "    name:String[1];\n" + "}\n" + "Class other::Firm\n" + "{\n" + "    legalName:String[1];\n" + "}\n" + "Association other::Firm_Person\n" + "{\n" + "    firm:Firm[1];\n" + "    employees:Person[1];\n" + "}\n" + "###Relational\n" + "Database mapping::db(\n" + "   Table employeeFirmDenormTable\n" + "   (\n" + "    id INT PRIMARY KEY,\n" + "    name VARCHAR(200),\n" + "    firmId INT,\n" + "    legalName VARCHAR(200)\n" + "   )\n" + "   Join firmJoin(employeeFirmDenormTable.firmId = {target}.firmId)\n" + ")\n" + "###Mapping\n" + "import other::*;\n" + "import mapping::*;\n" + "Mapping mappingPackage::subMapping1\n" + "(\n" + "    Person[per1]: Relational\n" + "    {\n" + "        name : [db]employeeFirmDenormTable.name\n" + "    }\n" + "    Firm[fir1]: Relational\n" + "    {\n" + "        legalName : [db]employeeFirmDenormTable.legalName\n" + "    }\n" + "\n" + "    Firm_Person: Relational\n" + "    {\n" + "        AssociationMapping\n" + "        (\n" + "           employees[fir1,per1] : [db]@firmJoin,\n" + "           firm[per1,fir1] : [db]@firmJoin\n" + "        )\n" + "    }\n" + ")\n", this.repository, new ParserLibrary(Lists.immutable.with(new M3AntlrParser(), new MappingParser(), new RelationalParser())), ValidationType.DEEP, VoidM3M4StateListener.VOID_M3_M4_STATE_LISTENER, this.context);
    this.runtime.compile();
    CoreInstance mapping = this.graphWalker.getMapping("mappingPackage::subMapping1");
    Assert.assertNotNull(mapping);
    ListIterable<? extends CoreInstance> associationMappings = this.graphWalker.getAssociationMappings(mapping);
    Assert.assertEquals(1, associationMappings.size());
    CoreInstance associationMapping = associationMappings.getFirst();
    Assert.assertNotNull(associationMapping);
    CoreInstance employeesMapping = this.graphWalker.getClassMappingImplementationPropertyMapping(associationMapping, "employees");
    Assert.assertNotNull(employeesMapping);
    Assert.assertEquals("fir1", employeesMapping.getValueForMetaPropertyToOne(M2MappingProperties.sourceSetImplementationId).getName());
    Assert.assertEquals("per1", employeesMapping.getValueForMetaPropertyToOne(M2MappingProperties.targetSetImplementationId).getName());
    CoreInstance firmPropertyMapping = this.graphWalker.getClassMappingImplementationPropertyMapping(associationMapping, "firm");
    Assert.assertNotNull(firmPropertyMapping);
    Assert.assertEquals("per1", firmPropertyMapping.getValueForMetaPropertyToOne(M2MappingProperties.sourceSetImplementationId).getName());
    Assert.assertEquals("fir1", firmPropertyMapping.getValueForMetaPropertyToOne(M2MappingProperties.targetSetImplementationId).getName());
}
Also used : EnumerationMappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.EnumerationMappingParser) MappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.MappingParser) ParserLibrary(org.finos.legend.pure.m3.serialization.grammar.ParserLibrary) M3AntlrParser(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3AntlrParser) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) RelationalParser(org.finos.legend.pure.m2.relational.serialization.grammar.v1.RelationalParser) Test(org.junit.Test)

Example 3 with Import

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import in project legend-pure by finos.

the class TestSimpleGrammar method testMapping.

@Test
public void testMapping() {
    Loader.parseM3("import other::deep::*;\n" + "import other::*;\n" + "\n" + "Class other::Person\n" + "{\n" + "    name:String[1];\n" + "    firm:Firm[1];\n" + "}\n" + "Class other::deep::Firm\n" + "{\n" + "    legalName:String[1];\n" + "    employees:Person[1];\n" + "}\n" + "###Relational\n" + "Database mapping::pack::db(Table employeeTable\n" + "(\n" + "    id INT PRIMARY KEY,\n" + "    name VARCHAR(200),\n" + "    firmId INT\n" + ")\n" + "Table firmTable\n" + "(\n" + "    id INT PRIMARY KEY,\n" + "    name VARCHAR(200)\n" + ")\n" + "\n" + "Join Employee_Firm\n" + "(\n" + "    employeeTable.firmId = [mapping::pack::db]firmTable.id\n" + "))\n" + "###Mapping\n" + "import other::deep::*;\n" + "import mapping::pack::*;\n" + "Mapping mappingPackage::myMapping\n" + "(\n" + "    other::Person: Relational\n" + "            {\n" + "                name : [db]employeeTable.name,\n" + "                firm : [db]@Employee_Firm\n" + "            }\n" + "    Firm : Relational\n" + "           {\n" + "                legalName: [db]firmTable.name,\n" + "                employees: [db]@Employee_Firm\n" + "           }\n" + ")\n", this.repository, new ParserLibrary(Lists.immutable.with(new M3AntlrParser(), new MappingParser(), new RelationalParser())), ValidationType.DEEP, VoidM3M4StateListener.VOID_M3_M4_STATE_LISTENER, this.context);
    this.runtime.compile();
    CoreInstance db = this.graphWalker.getDbInstance("mapping::pack::db");
    Assert.assertNotNull(db);
    ListIterable<? extends CoreInstance> schemas = this.graphWalker.getSchemas(db);
    Assert.assertEquals(1, schemas.size());
    CoreInstance defaultSchema = this.graphWalker.getDefaultSchema(db);
    Assert.assertNotNull(defaultSchema);
    Assert.assertNotNull(this.graphWalker.getTable(defaultSchema, "employeeTable"));
    Assert.assertNotNull(this.graphWalker.getTable(defaultSchema, "firmTable"));
    CoreInstance employeeTable = this.graphWalker.getTable(defaultSchema, "employeeTable");
    CoreInstance firmTable = this.graphWalker.getTable(defaultSchema, "firmTable");
    ListIterable<? extends CoreInstance> employeeTableColumns = this.graphWalker.getColumns(employeeTable);
    ListIterable<? extends CoreInstance> firmTableColumns = this.graphWalker.getColumns(firmTable);
    Assert.assertEquals(3, employeeTableColumns.size());
    Assert.assertEquals(2, firmTableColumns.size());
    Assert.assertNotNull(this.graphWalker.getColumn(employeeTable, "id"));
    Assert.assertNotNull(this.graphWalker.getColumn(employeeTable, "name"));
    Assert.assertNotNull(this.graphWalker.getColumn(firmTable, "id"));
    Assert.assertNotNull(this.graphWalker.getColumn(firmTable, "name"));
    Assert.assertEquals(200, this.graphWalker.getColumnSize(this.graphWalker.getColumn(firmTable, "name")));
    Assert.assertEquals("Varchar", this.graphWalker.getClassifier(this.graphWalker.getColumnType(this.graphWalker.getColumn(firmTable, "name"))));
    CoreInstance mapping = this.graphWalker.getMapping("mappingPackage::myMapping");
    Assert.assertNotNull(mapping);
    Assert.assertEquals(2, this.graphWalker.getClassMappings(mapping).size());
    CoreInstance personMapping = this.graphWalker.getClassMapping(mapping, "Person");
    Assert.assertNotNull(personMapping);
    CoreInstance firmMapping = this.graphWalker.getClassMapping(mapping, "Firm");
    Assert.assertNotNull(firmMapping);
    Assert.assertEquals("employeeTable", this.graphWalker.getName(this.graphWalker.getClassMappingImplementationMainTable(personMapping)));
    Assert.assertEquals("firmTable", this.graphWalker.getName(this.graphWalker.getClassMappingImplementationMainTable(firmMapping)));
    Assert.assertEquals(2, this.graphWalker.getClassMappingImplementationPropertyMappings(personMapping).size());
    Assert.assertEquals(2, this.graphWalker.getClassMappingImplementationPropertyMappings(firmMapping).size());
    CoreInstance namePropMapping = this.graphWalker.getClassMappingImplementationPropertyMapping(personMapping, "name");
    CoreInstance firmPropMapping = this.graphWalker.getClassMappingImplementationPropertyMapping(personMapping, "firm");
    Assert.assertNotNull(firmPropMapping);
    CoreInstance nameColumnAlias = this.graphWalker.getClassMappingImplementationPropertyMappingRelationalOperationElement(namePropMapping);
    Assert.assertEquals("employeeTable", this.graphWalker.getTableAliasColumnAliasName(nameColumnAlias));
    Assert.assertEquals("name", this.graphWalker.getTableAliasColumnColumnName(nameColumnAlias));
    CoreInstance firmJoinNode = this.graphWalker.getRelationalOperationElementJoinTreeNode(this.graphWalker.getClassMappingImplementationPropertyMappingRelationalOperationElement(firmPropMapping));
    Assert.assertEquals("Employee_Firm", this.graphWalker.getRelationalOperationElementJoinTreeNodeJoinName(firmJoinNode));
    CoreInstance legalNamePropMapping = this.graphWalker.getClassMappingImplementationPropertyMapping(firmMapping, "legalName");
    CoreInstance legalNameColumnAlias = this.graphWalker.getClassMappingImplementationPropertyMappingRelationalOperationElement(legalNamePropMapping);
    Assert.assertEquals("firmTable", this.graphWalker.getTableAliasColumnAliasName(legalNameColumnAlias));
    Assert.assertEquals("name", this.graphWalker.getTableAliasColumnColumnName(legalNameColumnAlias));
    CoreInstance employeesPropMapping = this.graphWalker.getClassMappingImplementationPropertyMappingRelationalOperationElement(firmPropMapping);
    CoreInstance employeesJoinNode = this.graphWalker.getRelationalOperationElementJoinTreeNode(employeesPropMapping);
    Assert.assertEquals("Employee_Firm", this.graphWalker.getRelationalOperationElementJoinTreeNodeJoinName(employeesJoinNode));
}
Also used : EnumerationMappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.EnumerationMappingParser) MappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.MappingParser) ParserLibrary(org.finos.legend.pure.m3.serialization.grammar.ParserLibrary) M3AntlrParser(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3AntlrParser) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) RelationalParser(org.finos.legend.pure.m2.relational.serialization.grammar.v1.RelationalParser) Test(org.junit.Test)

Example 4 with Import

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import in project legend-pure by finos.

the class TestSimpleGrammar method testMappingIncludes.

@Test
public void testMappingIncludes() {
    String pureCode = "import other::*;\n" + "\n" + "Class other::Person\n" + "{\n" + "    name:String[1];\n" + "    firm:Firm[1];\n" + "}\n" + "Class other::Firm\n" + "{\n" + "    legalName:String[1];\n" + "    employees:Person[1];\n" + "}\n" + "###Relational\n" + "Database mapping::db(\n" + "   Table employeeFirmDenormTable\n" + "   (\n" + "    id INT PRIMARY KEY,\n" + "    name VARCHAR(200),\n" + "    firmId INT,\n" + "    legalName VARCHAR(200)\n" + "   )\n" + "   Join firmJoin(employeeFirmDenormTable.firmId = {target}.firmId)\n" + ")\n" + "###Mapping\n" + "import other::*;\n" + "import mapping::*;\n" + "import mappingPackage::*;\n" + "Mapping mappingPackage::subMapping1\n" + "(\n" + "    Person: Relational\n" + "    {\n" + "        name : [db]employeeFirmDenormTable.name\n" + "    }\n" + ")\n" + "Mapping mappingPackage::subMapping2\n" + "(\n" + "    Firm: Relational\n" + "    {\n" + "        legalName : [db]employeeFirmDenormTable.legalName\n" + "    }\n" + ")\n" + "Mapping mappingPackage::myMapping\n" + "(\n" + "    include mappingPackage::subMapping1\n" + "    include subMapping2\n" + ")\n";
    Loader.parseM3(pureCode, this.repository, new ParserLibrary(Lists.immutable.with(new M3AntlrParser(), new MappingParser(), new RelationalParser())), ValidationType.DEEP, VoidM3M4StateListener.VOID_M3_M4_STATE_LISTENER, this.context);
    this.runtime.compile();
    CoreInstance mapping = this.graphWalker.getMapping("mappingPackage::myMapping");
    Assert.assertNotNull(mapping);
    ListIterable<? extends CoreInstance> includes = this.graphWalker.getMany(mapping, M3Properties.includes);
    Assert.assertEquals(2, includes.size());
    MutableList<String> includedMappingPaths = includes.collect(new Function<CoreInstance, String>() {

        @Override
        public String valueOf(CoreInstance include) {
            return PackageableElement.getUserPathForPackageableElement(graphWalker.getOne(include, M3Properties.included));
        }
    }, FastList.<String>newList(2));
    Verify.assertListsEqual(Lists.fixedSize.with("mappingPackage::subMapping1", "mappingPackage::subMapping2"), includedMappingPaths);
}
Also used : EnumerationMappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.EnumerationMappingParser) MappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.MappingParser) ParserLibrary(org.finos.legend.pure.m3.serialization.grammar.ParserLibrary) M3AntlrParser(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3AntlrParser) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) RelationalParser(org.finos.legend.pure.m2.relational.serialization.grammar.v1.RelationalParser) Test(org.junit.Test)

Example 5 with Import

use of org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.Import in project legend-pure by finos.

the class TestPureRuntimeClassMapping method testMilestoningMappingUnbindStability.

@Test
public void testMilestoningMappingUnbindStability() {
    String modelTrade = "Class my::Trade{\n" + "   id:Integer[1];\n" + "   product:my::Product[1];\n" + "}";
    String modelProduct = "Class my::Product{\n" + "   id:Integer[1];\n" + "}";
    String modelProductTemporal = "Class <<temporal.businesstemporal>> my::Product{\n" + "   id:Integer[1];\n" + "}";
    String storeAndMapping = "###Mapping\n" + "import meta::relational::tests::*;\n" + "import my::*;\n" + "\n" + "Mapping myMapping\n" + "(\n" + "   Trade : Relational {id : [myDB] tradeTable.ID, product : [myDB] @trade_product} \n" + "   Product : Relational { id : [myDB] productTable.ID}\n" + ")\n" + "###Relational\n" + "Database myDB\n" + "(\n" + "   Table tradeTable(ID INT PRIMARY KEY, PRODID INT)\n" + "   Table productTable(ID INT PRIMARY KEY)\n" + "   \n" + "   Join trade_product(tradeTable.PRODID = productTable.ID)\n" + ")";
    String f = "function f():Any[0..1]{let m = myMapping}";
    RuntimeVerifier.verifyOperationIsStable(new RuntimeTestScriptBuilder().createInMemorySource("modelTrade.pure", modelTrade).createInMemorySource("modelProductTemporal.pure", modelProductTemporal).createInMemorySource("storeAndMapping.pure", storeAndMapping).createInMemorySource("f.pure", f).compile(), new RuntimeTestScriptBuilder().deleteSource("modelProductTemporal.pure").createInMemorySource("modelProduct.pure", modelProduct).compile().deleteSource("modelProduct.pure").createInMemorySource("modelProductTemporal.pure", modelProductTemporal).compile(), this.runtime, this.functionExecution, this.getAdditionalVerifiers());
}
Also used : RuntimeTestScriptBuilder(org.finos.legend.pure.m3.RuntimeTestScriptBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)103 CoreInstance (org.finos.legend.pure.m4.coreinstance.CoreInstance)68 M3AntlrParser (org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3AntlrParser)48 ParserLibrary (org.finos.legend.pure.m3.serialization.grammar.ParserLibrary)44 RelationalParser (org.finos.legend.pure.m2.relational.serialization.grammar.v1.RelationalParser)43 MappingParser (org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.MappingParser)42 PureParserException (org.finos.legend.pure.m4.serialization.grammar.antlr.PureParserException)27 PureCompilationException (org.finos.legend.pure.m4.exception.PureCompilationException)25 PureExecutionException (org.finos.legend.pure.m3.exception.PureExecutionException)21 RuntimeTestScriptBuilder (org.finos.legend.pure.m3.RuntimeTestScriptBuilder)13 MutableList (org.eclipse.collections.api.list.MutableList)9 EnumerationMappingParser (org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.EnumerationMappingParser)9 RichIterable (org.eclipse.collections.api.RichIterable)8 ListIterable (org.eclipse.collections.api.list.ListIterable)8 Pair (org.eclipse.collections.api.tuple.Pair)8 Source (org.finos.legend.pure.m3.serialization.runtime.Source)8 SourceInformation (org.finos.legend.pure.m4.coreinstance.SourceInformation)8 Lists (org.eclipse.collections.api.factory.Lists)7 Sets (org.eclipse.collections.api.factory.Sets)7 MutableMap (org.eclipse.collections.api.map.MutableMap)7