gUnit - Maven Integration

Skip to end of metadata
Go to start of metadata

Directory structure:

  • src
    • main
      • java
      • resources
    • test
      • java
        • org.antlr.gunit.test
      • resources
        • org.antlr.gunit.test
      • gunit
        • org.antlr.gunit.test
          • Test.gunit

The following POM parts will generate a JUnit test java file from your gUnit file and includes it in the surefire test run when running the test goal of maven.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Apr 27, 2009

    Now that is an interesting workaround, as long as there is no gunit functionality in antlr3-plugin or a gunit-maven-plugin.

    Thanks for sharing this Rabea!

    How would you configure it to create a JUnit file for every gUnit Testuite in my testdirs?

  2. Apr 28, 2009

    Maybe the gUnit command-line could be extended to support a wildcard feature to include all gUnit files in a directory. I've extended my example to support two or more different gUnit files which are explicitly given.

  3. Apr 29, 2009

    That is really great workaround. Thanks Rabea.

  4. May 03, 2009

    @Rabea: Thanks for the documentation update. I agree  with you that at least two more params could be added to the gunit-tool:

    - wildcard feature for input files

    -d option to specify output when generating JUnit

    And there is great news: Jim announced the release of a maven-gunit-plugin just two days ago. See the antlr-interest mailing-list for details.

    Hint: name your test directory /src/test/gunit and the files Something.testsuite, so the maven-gunit-plugin will find them.