0

Is it possible to get rid of from import statements in JUnit tests written in Groovy? I know you could do it in groovy scripts in GroovyShell by changing compiler configuration or import customizer.

I like to do same thing but:

  • IntelliJ should still provide code highlight and auto complete (I think I could do this with gdsl file feature of IntelliJ)
  • I could still use IntelliJ's JUnit window to see which tests failed and which are passed.
cfrick
  • 35,203
  • 6
  • 56
  • 68
Deniz
  • 1,575
  • 1
  • 16
  • 27
  • Why do you want this? – Oliver Charlesworth Dec 09 '14 at 08:45
  • We have prepared a DSL like API for testing our domain applications. Having to import classes before using them is ugly, we have very small number of static methods. I also want to do this in Groovy Console of IntelliJ but I couldn't figure out how to add my default imports to there too. – Deniz Dec 09 '14 at 22:38
  • In a modern IDE (like IntelliJ), you won't even notice the imports. They're managed automatically, and automatically collapsed in the editor. – Oliver Charlesworth Dec 09 '14 at 23:50
  • I know it, but the people using this DSL's will not be programmers. You can do it in groovy scripts. Groovy has build in support for this feature. I just wan't to customize IntelliJ's JUnit executor to inject my default imports. It seams that only way to do it is modifying source code of IntellIJ plugin. Thanks. – Deniz Dec 10 '14 at 05:59

0 Answers0