use of org.finos.legend.pure.generated.Root_meta_data_BinaryData in project legend-engine by finos.
the class TestDataCompilationFromGrammar method testBinaryDataCompilation.
@Test
public void testBinaryDataCompilation() {
Pair<PureModelContextData, PureModel> result = test("###Data\n" + "Data <<meta::pure::profiles::typemodifiers.abstract>> {doc.doc = 'something'} meta::data::MyData\n" + "Binary #{\n" + " contentType: 'application/x-protobuf';\n" + " data: '1B4A 9DEA 230F FF20';\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_BinaryData);
Root_meta_data_BinaryData binaryData = (Root_meta_data_BinaryData) dataElement._data();
Assert.assertEquals("application/x-protobuf", binaryData._contentType());
Assert.assertEquals("1B4A9DEA230FFF20", binaryData._hexData());
}
Aggregations