Implementing tests for your DSL

Xtext highly fosters using unit tests, and this is reflected by the fact that, by default, the MWE2 workflow generates specific plug-in projects 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. Xtext generates two test projects. One that ends with the .tests suffix, for tests that do not depend on the UI, and one that ends with the .ui.tests suffix, for tests that depend on the UI. For our Entities DSL, these two projects are org.example.entities.tests and org.example.entities.ui.tests. The test plug-in projects have the needed dependencies on the required Xtext utility bundles for testing.

We will use Xtend to ...

Get Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.