SeelabFhdo / lemma

Home of the Language Ecosystem for Modeling Microservice Architecture (LEMMA)
MIT License
33 stars 8 forks source link

OpenAPI Support: Check generated test models for syntactic correctness #61

Open frademacher opened 2 years ago

frademacher commented 2 years ago

Currently, the LEMMA models generated by the de.fhdo.lemma.service.openapi.tests project are not checked for syntactic correctness. Consequently, if the syntax of a LEMMA modeling language should change in the future it may happen that the OpenAPI project produces a syntactically wrong output. In a perfect world, this should not happen because a change of the syntax of a LEMMA modeling language should always involve a corresponding adaptation of its extractor. However, since the extractors currently don't have accompanying tests, it would still make sense to let the OpenAPI tests parse LEMMA models after they were generated to detect potential mismatches between the actual syntax implementation and the one extracted from generated in-memory models.

To parse generated LEMMA models, the OpenAPI tests could probably do the same as the loadXtextResource() method over at https://github.com/SeelabFhdo/lemma/blob/4c1de5a2aaed55b5e57a29be2aebec9216faf39a/de.fhdo.lemma.eclipse.ui.utils/src/de/fhdo/lemma/eclipse/ui/utils/LemmaUiUtils.xtend#L134 (yet, the OpenAPI tests project should not directly call loadXtextResource() as this would result in a dependency on the de.fhdo.lemma.eclipse.ui project by the tests project which we definitely do not want).