use of org.finos.legend.pure.generated.Root_meta_data_TextData in project legend-engine by finos.
the class TestDataCompilationFromGrammar method testTextDataCompilation.
@Test
public void testTextDataCompilation() {
Pair<PureModelContextData, PureModel> result = test("###Data\n" + "Data <<meta::pure::profiles::typemodifiers.abstract>> {doc.doc = 'something'} meta::data::MyData\n" + "Text #{\n" + " contentType: 'application/json';\n" + " data: '{\"some\":\"data\"}';\n" + "}#\n");
PackageableElement element = result.getTwo().getPackageableElement("meta::data::MyData");
Assert.assertTrue(element instanceof Root_meta_data_DataElement);
Root_meta_data_DataElement dataElement = (Root_meta_data_DataElement) element;
Assert.assertTrue(dataElement._data() instanceof Root_meta_data_TextData);
Root_meta_data_TextData textData = (Root_meta_data_TextData) dataElement._data();
Assert.assertEquals("application/json", textData._contentType());
Assert.assertEquals("{\"some\":\"data\"}", textData._data());
}
Aggregations