Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

As of Groovy-Eclipse 2.5.2, there is now command line support for testing DSLD descriptors. Because DSLD support us intertwined with Eclipse API, it is not possible to simply run unit tests against them. Rather, it is necessary to load up the Eclipse workbench and process the DSLD files from within the workbench in order to evaluate them.

Setting up

You can only evaluate DSLDs against an existing Eclipse project. So, you need to create an eclipse project inside an existing workspace.

  1. Start Eclipse
  2. Create a groovy project
  3. Create some Groovy classes
  4. You can add your DSLDs directly to this project, or you can add them later when you perform the type checking.
  5. Add some type annotations to assert the static types of certain expressions. Eg-

Shut down Eclipse and you are ready to run static type checking.

Running static type checking

The command looks like this:

Here is a description of the arguments:

--help OR -h

Prints a help message and exits.

--extra_dslds

list of extra dsld files to be included in this check. Use '|' as a file separator.

--assertions_only

Don't report unknown types. Only look for type assertions

--excludes

Project-relative exclusion filters.

--includes

Project-relative inclusion filters.

<PROJECT_NAME>

Name of a project to type check. Must be already in the workspace.

The exclusion and inclusion filters use the syntax from ant filesets. Individual filters can be concatenated using '|'.

For example:

includes all files, but excludes all *Test.groovy files in test/java and test/groovy.

  • No labels