[antlr-interest] GUnit: NPE on JUnitCodeGeneration
Leon Su
leon.antlr at mac.com
Thu Apr 2 10:08:31 PDT 2009
Hi Tilman,
Thanks for the bug report and the testing grammars. I'll check this issue later today.
Regards,
Leon
On Thursday, April 02, 2009, at 09:28AM, "Tilman Bender" <tbender at stud.hs-heilbronn.de> wrote:
>Hi folks,
>
>Tried to setup a testsuite for my tree grammar. The testsuite can be
>run (allthough all tests fail) via the normal org.antlr.gunit.Interp
>command but
>when I try to generate JUnit-Code for it I get an NPE:
>
> java -cp ../../../target/classes/:$CLASSPATH org.antlr.gunit.Interp -
>o Optimizer.testsuite
>Exception in thread "main" java.lang.NullPointerException
> at org.antlr.gunit.JUnitCodeGen.changeFirstCapital(JUnitCodeGen.java:
>322)
> at org.antlr.gunit.JUnitCodeGen.genTestRuleMethods(JUnitCodeGen.java:
>193)
> at org.antlr.gunit.JUnitCodeGen.compileToBuffer(JUnitCodeGen.java:121)
> at org.antlr.gunit.JUnitCodeGen.compile(JUnitCodeGen.java:113)
> at org.antlr.gunit.Interp.main(Interp.java:55)
>
>I am using antlr-3.1.3 and the respective version of antlr3-maven-
>plugin to do the grammar code-generation and compilation.
> From what I found so far it seems to be that :
>
>- gUnitTestSuite doesnt correctly set the treerule field
>- JUnitCodeGen doesn't check for null in genTestRuleMethods
>
>I attached my grammars so you can reproduce the problem.
>
>NB: If anybody has a neat solution to integrate gunit with maven
>pleeease answer my prior thread :)
>
>
>
>
>kind regards
>
>Tilman Bender
>Student des Software Engineering
>Hochschule Heilbronn
>tbender at stud.hs-heilbronn.de
>
>
>
>
More information about the antlr-interest
mailing list