Directory structure:
- src
- main
- java
- resources
- test
- java
- org.antlr.gunit.test
- resources
- org.antlr.gunit.test
- gunit
- org.antlr.gunit.test
- Test.gunit
- org.antlr.gunit.test
- java
- main
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
4 Comments
comments.show.hideApr 27, 2009
Tilman Bender
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?
Apr 28, 2009
Rabea Gransberger
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.
Apr 29, 2009
saab
That is really great workaround. Thanks Rabea.
May 03, 2009
Tilman Bender
@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.