Xtext highly fosters using unit tests, and this is reflected by the fact that, by default, the MWE2 workflow generates a specific plug-in project for testing your DSL. In fact, usually tests should reside in a separate project, since they should not be deployed as part of your DSL implementation. This additional project ends with the
.tests suffix, thus, for our Entities DSL, it is
org.example.entities.tests. The tests plug-in project has the needed dependencies on the required Xtext utility bundles for testing.
We will use Xtend to write Junit tests.
src-gen directory of the tests project, you will find the injector providers for both headless and UI tests. You can use these providers to easily write Junit ...