use of org.finos.legend.pure.m3.compiler.ReferenceUsage in project legend-pure by finos.
the class PackageableElementUnloaderWalk method run.
@Override
public void run(CoreInstance element, MatcherState state, Matcher matcher, ModelRepository modelRepository, Context context) throws PureCompilationException {
PackageableElement packageableElement = PackageableElementCoreInstanceWrapper.toPackageableElement(element);
for (ReferenceUsage referenceUsage : packageableElement._referenceUsages()) {
matcher.fullMatch(referenceUsage._ownerCoreInstance(), state);
}
Package pkg = packageableElement._package();
if ((pkg != null) && (pkg.getSourceInformation() == null)) {
matcher.fullMatch(pkg, state);
}
}
use of org.finos.legend.pure.m3.compiler.ReferenceUsage in project legend-pure by finos.
the class TestPureRuntimeClass_FunctionExpressionParam method testPureRuntimeClassParameterUsageCleanUp.
@Test
public void testPureRuntimeClassParameterUsageCleanUp() throws Exception {
RuntimeVerifier.verifyOperationIsStable(new RuntimeTestScriptBuilder().createInMemorySource("sourceId.pure", "function f(c:Class<Any>[1]):Any[1]{$c} function k():Nil[0]{f(A);[];}").createInMemorySource("userId.pure", "Class A{}").compile(), new RuntimeTestScriptBuilder().deleteSource("sourceId.pure").compile().createInMemorySource("sourceId.pure", "function f(c:Class<Any>[1]):Any[1]{$c} function k():Nil[0]{f(A);[];}").compile(), this.runtime, this.functionExecution, this.getAdditionalVerifiers());
Assert.assertEquals("A instance Class\n" + " classifierGenericType(Property):\n" + " Anonymous_StripedId instance GenericType\n" + " [... >0]\n" + " generalizations(Property):\n" + " Anonymous_StripedId instance Generalization\n" + " [... >0]\n" + " name(Property):\n" + " A instance String\n" + " package(Property):\n" + " Root instance Package\n" + " referenceUsages(Property):\n" + " Anonymous_StripedId instance ReferenceUsage\n" + " [... >0]", this.runtime.getCoreInstance("A").printWithoutDebug("", 0));
}
use of org.finos.legend.pure.m3.compiler.ReferenceUsage in project legend-pure by finos.
the class TestReferenceUsagesForDatabase method assertDatabaseReferenceUsages.
private static void assertDatabaseReferenceUsages(PureRuntime runtime, String sourceCode, String dbName, int dbCount) {
String[] lines = sourceCode.split("\n");
Database database = (Database) runtime.getCoreInstance("my::" + dbName);
MutableList<? extends ReferenceUsage> databaseReferenceUsageList = Lists.mutable.ofAll(database._referenceUsages()).reject(NULL_SOURCE_INFORMATION).distinct(COMPARE_SOURCE_ID_LINE_COLUMN);
Assert.assertEquals(dbCount, databaseReferenceUsageList.size());
for (ReferenceUsage referenceUsage : databaseReferenceUsageList) {
SourceInformation sourceInformation = referenceUsage.getSourceInformation();
Assert.assertEquals(dbName, lines[sourceInformation.getLine() - 1].substring(sourceInformation.getColumn() - 1, sourceInformation.getColumn() + dbName.length() - 1));
}
}
use of org.finos.legend.pure.m3.compiler.ReferenceUsage in project legend-pure by finos.
the class TestSimpleGrammar method testMappingScope.
@Test
public void testMappingScope() {
Loader.parseM3("import other::*;\n" + "\n" + "Class other::Person\n" + "{\n" + " name : String[1];\n" + " id : Integer[1];" + " other : String[1];" + "}\n" + "###Relational\n" + "Database mapping::pack::db" + "(" + " Table employeeTable\n" + " (\n" + " id INT PRIMARY KEY,\n" + " name VARCHAR(200),\n" + " other VARCHAR(200),\n" + " firmId INT\n" + " )" + ")\n" + "###Mapping\n" + "import mapping::pack::*;\n" + "Mapping mappingPackage::myMapping\n" + "(\n" + " /* comment */\n" + " other::Person: Relational\n" + " {" + " scope([db])" + " (" + " name : employeeTable.name\n" + " )," + " scope([db]default.employeeTable)" + " (" + " id : id" + " )," + " scope([db]employeeTable)" + " (" + " other : other" + " )" + " }\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.runtime.getCoreInstance("mappingPackage::myMapping");
CoreInstance personClassMappingImplementation = Instance.getValueForMetaPropertyToManyResolved(mapping, "classMappings", this.processorSupport).getFirst();
ListIterable<? extends CoreInstance> personClassMappingImplementationPropertyMappings = Instance.getValueForMetaPropertyToManyResolved(personClassMappingImplementation, "propertyMappings", this.processorSupport);
final StringBuilder sb = new StringBuilder("[\n");
personClassMappingImplementationPropertyMappings.forEach(new Procedure<CoreInstance>() {
@Override
public void value(CoreInstance each) {
CoreInstance relationalOperationElement = Instance.getValueForMetaPropertyToOneResolved(each, "relationalOperationElement", TestSimpleGrammar.this.processorSupport);
Printer.print(sb, relationalOperationElement, 3);
sb.append("\n");
}
});
final String mappingGraphDump = sb.append("]").toString();
Assert.assertEquals("[\n" + "Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [~>] db instance Database\n" + " name(Property):\n" + " employeeTable instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " name instance String\n" + " nullable(Property):\n" + " true instance Boolean\n" + " owner(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " type(Property):\n" + " Anonymous_StripedId instance Varchar\n" + " size(Property):\n" + " 200 instance Integer\n" + " columnName(Property):\n" + " name instance String\n" + " setMappingOwner(Property):\n" + " Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " class(Property):\n" + " [~>] other::Person instance Class\n" + " distinct(Property):\n" + " false instance Boolean\n" + " id(Property):\n" + " other_Person instance String\n" + " mainTableAlias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " milestoning(Property):\n" + " name(Property):\n" + " [>3] employeeTable instance String\n" + " primaryKey(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " schema(Property):\n" + " [>3] Anonymous_StripedId instance Schema\n" + " setColumns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " temporaryTable(Property):\n" + " [>3] false instance Boolean\n" + " parent(Property):\n" + " [~>] mappingPackage::myMapping instance Mapping\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] instance String\n" + " relationalElement(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " propertyMappings(Property):\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " name instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] name instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " [_] Anonymous_StripedId instance TableAliasColumn\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " id instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] id instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] id instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " other instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] other instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] other instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " root(Property):\n" + " true instance Boolean\n" + " stores(Property):\n" + " [X] db instance Database\n" + " userDefinedPrimaryKey(Property):\n" + " false instance Boolean\n" + "Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [~>] db instance Database\n" + " name(Property):\n" + " employeeTable instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " schema(Property):\n" + " default instance String\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " id instance String\n" + " nullable(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " [_] Anonymous_StripedId instance Column\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " type(Property):\n" + " Anonymous_StripedId instance Integer\n" + " columnName(Property):\n" + " id instance String\n" + " setMappingOwner(Property):\n" + " Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " class(Property):\n" + " [~>] other::Person instance Class\n" + " distinct(Property):\n" + " false instance Boolean\n" + " id(Property):\n" + " other_Person instance String\n" + " mainTableAlias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " milestoning(Property):\n" + " name(Property):\n" + " [>3] employeeTable instance String\n" + " primaryKey(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " schema(Property):\n" + " [>3] Anonymous_StripedId instance Schema\n" + " setColumns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " temporaryTable(Property):\n" + " [>3] false instance Boolean\n" + " parent(Property):\n" + " [~>] mappingPackage::myMapping instance Mapping\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] instance String\n" + " relationalElement(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " propertyMappings(Property):\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " name instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] name instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] name instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " id instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] id instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " [_] Anonymous_StripedId instance TableAliasColumn\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " other instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] other instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] other instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " root(Property):\n" + " true instance Boolean\n" + " stores(Property):\n" + " [X] db instance Database\n" + " userDefinedPrimaryKey(Property):\n" + " false instance Boolean\n" + "Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [~>] db instance Database\n" + " name(Property):\n" + " employeeTable instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] other instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " other instance String\n" + " nullable(Property):\n" + " true instance Boolean\n" + " owner(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " milestoning(Property):\n" + " name(Property):\n" + " employeeTable instance String\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " schema(Property):\n" + " Anonymous_StripedId instance Schema\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] default instance String\n" + " relations(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " tables(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " views(Property):\n" + " setColumns(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] name instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Varchar\n" + " [_] Anonymous_StripedId instance Column\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] firmId instance String\n" + " nullable(Property):\n" + " [>3] true instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " temporaryTable(Property):\n" + " false instance Boolean\n" + " type(Property):\n" + " Anonymous_StripedId instance Varchar\n" + " size(Property):\n" + " 200 instance Integer\n" + " columnName(Property):\n" + " other instance String\n" + " setMappingOwner(Property):\n" + " Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " class(Property):\n" + " [~>] other::Person instance Class\n" + " distinct(Property):\n" + " false instance Boolean\n" + " id(Property):\n" + " other_Person instance String\n" + " mainTableAlias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " instance String\n" + " relationalElement(Property):\n" + " Anonymous_StripedId instance Table\n" + " columns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " milestoning(Property):\n" + " name(Property):\n" + " [>3] employeeTable instance String\n" + " primaryKey(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " schema(Property):\n" + " [>3] Anonymous_StripedId instance Schema\n" + " setColumns(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " [>3] Anonymous_StripedId instance Column\n" + " temporaryTable(Property):\n" + " [>3] false instance Boolean\n" + " parent(Property):\n" + " [~>] mappingPackage::myMapping instance Mapping\n" + " primaryKey(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " Anonymous_StripedId instance TableAlias\n" + " database(Property):\n" + " [X] db instance Database\n" + " name(Property):\n" + " [>3] instance String\n" + " relationalElement(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " column(Property):\n" + " Anonymous_StripedId instance Column\n" + " name(Property):\n" + " [>3] id instance String\n" + " nullable(Property):\n" + " [>3] false instance Boolean\n" + " owner(Property):\n" + " [>3] Anonymous_StripedId instance Table\n" + " type(Property):\n" + " [>3] Anonymous_StripedId instance Integer\n" + " propertyMappings(Property):\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " name instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] name instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] name instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " id instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] id instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " Anonymous_StripedId instance TableAliasColumn\n" + " alias(Property):\n" + " [>3] Anonymous_StripedId instance TableAlias\n" + " column(Property):\n" + " [>3] Anonymous_StripedId instance Column\n" + " columnName(Property):\n" + " [>3] id instance String\n" + " setMappingOwner(Property):\n" + " [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " Anonymous_StripedId instance RelationalPropertyMapping\n" + " localMappingProperty(Property):\n" + " false instance Boolean\n" + " owner(Property):\n" + " [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + " property(Property):\n" + " other instance Property\n" + " aggregation(Property):\n" + " [>3] None instance AggregationKind\n" + " classifierGenericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " genericType(Property):\n" + " [>3] Anonymous_StripedId instance GenericType\n" + " multiplicity(Property):\n" + " [X] PureOne instance PackageableMultiplicity\n" + " name(Property):\n" + " [>3] other instance String\n" + " owner(Property):\n" + " [X] Person instance Class\n" + " referenceUsages(Property):\n" + " [>3] Anonymous_StripedId instance ReferenceUsage\n" + " relationalOperationElement(Property):\n" + " [_] Anonymous_StripedId instance TableAliasColumn\n" + " sourceSetImplementationId(Property):\n" + " other_Person instance String\n" + " targetSetImplementationId(Property):\n" + " instance String\n" + " root(Property):\n" + " true instance Boolean\n" + " stores(Property):\n" + " [X] db instance Database\n" + " userDefinedPrimaryKey(Property):\n" + " false instance Boolean\n" + "]", mappingGraphDump);
}
use of org.finos.legend.pure.m3.compiler.ReferenceUsage in project legend-pure by finos.
the class TestDiagramParsing method testDiagramModelDiagram.
@Test
public void testDiagramModelDiagram() {
final String source = "###Diagram\n" + "Diagram meta::pure::diagram::DiagramDiagram(width=924.0, height=798.0)\n" + "{\n" + " TypeView AbstractPathView(type=meta::pure::diagram::AbstractPathView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(599.0, 278.0),\n" + " width=123.0,\n" + " height=57.1875)\n" + " TypeView AssociationView(type=meta::pure::diagram::AssociationView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(402.0, 476.0),\n" + " width=115.0,\n" + " height=42.09375)\n" + " TypeView Diagram(type=meta::pure::diagram::Diagram,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(37.5, 476.0),\n" + " width=68.0,\n" + " height=42.09375)\n" + " TypeView DiagramNode(type=meta::pure::diagram::DiagramNode,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(310.0, 124.0),\n" + " width=299.0,\n" + " height=57.1875)\n" + " TypeView GeneralizationView(type=meta::pure::diagram::GeneralizationView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(599.0, 476.0),\n" + " width=129.0,\n" + " height=42.09375)\n" + " TypeView PropertyView(type=meta::pure::diagram::PropertyView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(786.0, 476.0),\n" + " width=97.0,\n" + " height=42.09375)\n" + " TypeView TypeView(type=meta::pure::diagram::TypeView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(216.0, 286.0),\n" + " width=75.0,\n" + " height=42.09375)\n" + " PropertyView AbstractPathView_source(property=meta::pure::diagram::AbstractPathView.source,\n" + " stereotypesVisible=true,\n" + " nameVisible=true,\n" + " color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(600.23, 320.0), (290.25, 320.0)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=TypeView,\n" + " propertyPosition=(297.5, 320.453125),\n" + " multiplicityPosition=(356.0, 320.453125))\n" + " PropertyView AbstractPathView_target(property=meta::pure::diagram::AbstractPathView.target,\n" + " stereotypesVisible=true,\n" + " nameVisible=true,\n" + " color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(600.23, 292.0), (424.0, 292.0), (290.0, 293.0)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=TypeView,\n" + " propertyPosition=(299.13357281145454, 278.2436741823325),\n" + " multiplicityPosition=(358.8651741778389, 278.31183889983697))\n" + " GeneralizationView AbstractPathView_DiagramNode(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(459.5, 152.59375), (459.5, 229.59375), (660.5, 229.59375), (660.5, 306.59375)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=DiagramNode)\n" + " GeneralizationView AssociationView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (459.5, 405.59375), (459.5, 497.046875)],\n" + " label='',\n" + " source=AssociationView,\n" + " target=AbstractPathView)\n" + " GeneralizationView GeneralizationView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (663.5, 405.59375), (663.5, 497.046875)],\n" + " label='',\n" + " source=GeneralizationView,\n" + " target=AbstractPathView)\n" + " GeneralizationView PropertyView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (834.5, 405.59375), (834.5, 497.046875)],\n" + " label='',\n" + " source=PropertyView,\n" + " target=AbstractPathView)\n" + " GeneralizationView TypeView_DiagramNode(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(459.5, 152.59375), (459.5, 229.59375), (253.5, 229.59375), (253.5, 307.046875)],\n" + " label='',\n" + " source=TypeView,\n" + " target=DiagramNode)\n" + "}\n" + "Diagram meta::pure::diagram::DiagramDiagram1(width=924.0, height=798.0)\n" + "{\n" + " TypeView AbstractPathView(type=meta::pure::diagram::AbstractPathView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(599.0, 278.0),\n" + " width=123.0,\n" + " height=57.1875)\n" + " TypeView AssociationView(type=meta::pure::diagram::AssociationView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(402.0, 476.0),\n" + " width=115.0,\n" + " height=42.09375)\n" + " TypeView Diagram(type=meta::pure::diagram::Diagram,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(37.5, 476.0),\n" + " width=68.0,\n" + " height=42.09375)\n" + " TypeView DiagramNode(type=meta::pure::diagram::DiagramNode,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(310.0, 124.0),\n" + " width=299.0,\n" + " height=57.1875)\n" + " TypeView GeneralizationView(type=meta::pure::diagram::GeneralizationView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(599.0, 476.0),\n" + " width=129.0,\n" + " height=42.09375)\n" + " TypeView PropertyView(type=meta::pure::diagram::PropertyView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(786.0, 476.0),\n" + " width=97.0,\n" + " height=42.09375)\n" + " TypeView TypeView(type=meta::pure::diagram::TypeView,\n" + " stereotypesVisible=true,\n" + " attributesVisible=true,\n" + " attributeStereotypesVisible=true,\n" + " attributeTypesVisible=true,\n" + " color=#FFFFCC,\n" + " lineWidth=1.0,\n" + " position=(216.0, 286.0),\n" + " width=75.0,\n" + " height=42.09375)\n" + " PropertyView AbstractPathView_source(property=meta::pure::diagram::AbstractPathView.source,\n" + " stereotypesVisible=true,\n" + " nameVisible=true,\n" + " color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(600.23, 320.0), (290.25, 320.0)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=TypeView,\n" + " propertyPosition=(297.5, 320.453125),\n" + " multiplicityPosition=(356.0, 320.453125))\n" + " PropertyView AbstractPathView_target(property=meta::pure::diagram::AbstractPathView.target,\n" + " stereotypesVisible=true,\n" + " nameVisible=true,\n" + " color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(600.23, 292.0), (424.0, 292.0), (290.0, 293.0)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=TypeView,\n" + " propertyPosition=(299.13357281145454, 278.2436741823325),\n" + " multiplicityPosition=(358.8651741778389, 278.31183889983697))\n" + " GeneralizationView AbstractPathView_DiagramNode(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(459.5, 152.59375), (459.5, 229.59375), (660.5, 229.59375), (660.5, 306.59375)],\n" + " label='',\n" + " source=AbstractPathView,\n" + " target=DiagramNode)\n" + " GeneralizationView AssociationView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (459.5, 405.59375), (459.5, 497.046875)],\n" + " label='',\n" + " source=AssociationView,\n" + " target=AbstractPathView)\n" + " GeneralizationView GeneralizationView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (663.5, 405.59375), (663.5, 497.046875)],\n" + " label='',\n" + " source=GeneralizationView,\n" + " target=AbstractPathView)\n" + " GeneralizationView PropertyView_AbstractPathView(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(660.5, 306.59375), (660.5, 405.59375), (834.5, 405.59375), (834.5, 497.046875)],\n" + " label='',\n" + " source=PropertyView,\n" + " target=AbstractPathView)\n" + " GeneralizationView TypeView_DiagramNode(color=#000000,\n" + " lineWidth=-1.0,\n" + " lineStyle=SIMPLE,\n" + " points=[(459.5, 152.59375), (459.5, 229.59375), (253.5, 229.59375), (253.5, 307.046875)],\n" + " label='',\n" + " source=TypeView,\n" + " target=DiagramNode)\n" + "}";
compileTestSource("testDiagram.pure", source);
Class typeViewClass = (Class) this.runtime.getCoreInstance("meta::pure::diagram::TypeView");
RichIterable<? extends ReferenceUsage> typeViewReferenceUsages = typeViewClass._referenceUsages().select(new Predicate<ReferenceUsage>() {
@Override
public boolean accept(ReferenceUsage usage) {
return usage._owner() instanceof TypeView;
}
});
String[] lines = source.split("\n");
for (ReferenceUsage referenceUsage : typeViewReferenceUsages) {
SourceInformation sourceInformation = referenceUsage.getSourceInformation();
Assert.assertEquals("TypeView", lines[sourceInformation.getLine() - 1].substring(sourceInformation.getColumn() - 1, sourceInformation.getColumn() + "TypeView".length() - 1));
}
}
Aggregations