Java Project + Groovy Tests != Happiness

Hi,

I upgraded to IntelliJ 12 and have been trying to figure out, based on the setup of an existing project, I can run my test cases, written in Groovy, against my Java source code.  Here is the layout of our project:

project

     -> layer/business/src

     -> layer/integration/src

     -> src/main/java

     -> src/main/tests

ivy.xml

build.xml

All of the above directories are included as source directories in the Project Settings, however when I run a test using Ctrl+Shift+F10 or a Run Configuration, I get this error:

Groovyc: java.lang.NullPointerException
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.findModule(GroovyCompilerWrapper.java:226)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.addErrorMessage(GroovyCompilerWrapper.java:199)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.processException(GroovyCompilerWrapper.java:167)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.processException(GroovyCompilerWrapper.java:157)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.processCompilationException(GroovyCompilerWrapper.java:143)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:48)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:112)

Essentially I am trying to figure out what the correct rhythm is to do TDD using a set up like this since I have no control over the layout of the project?  Any help is greatly appreciated.

Thanks,

John

3 comments
Comment actions Permalink

This is worth a try:
Enable the old compilation mode again:
_De_select "Use external build" in File -> Settings -> Project Settings -> Compiler

I faintly remember some groovy issues with the new compilation.
See here for some background info: http://blogs.jetbrains.com/idea/2012/06/brand-new-compiler-mode-in-intellij-idea-12-leda/

0
Comment actions Permalink

Hi Stephen,

Thank you for this, it seems to allow me to be able to run our Groovy tests.

John

0
Comment actions Permalink

Can you provide a sample project which illustrates the problem in order to fix the processing with external compiler?

Denis

0

Please sign in to leave a comment.