Search code examples
gwtgwttestcase

How Can I Make and Run GWTTestCase Based Tests with Intellij 12?


I've tried multiple times over a few months now to do this, but I haven't had any luck. I've found Google's documentation about how to setup GWTTestCase tests via the command line and Eclipse, but nothing about how to do it with IntelliJ. When I try to excite GWTTestCase tests in IntelliJ like a normal J-unit test, I get a bunch of errors. I assume that the Google Eclipse plugin is probably doing some sort of magic to make the tests work in Eclipse, so I'm not even sure if what I want to do is possible.


Solution

  • GWTTestCases are especial junit tests, because they have to execute some extra stuff like the gwt compiler. This is done automatically, but the compiler needs to know where your .java files are (main and tests). So previously to run the test you have to add the src, test folders (if you use ant) or src/main/java, src/test/java (if your project is a maven one) to the class-path of your launcher.

    If you are using the native GWT support in intellij (it was previously called GWT Studio plugin), it should add those folders to the classpath. You can find more info in this page, although it is a bit outdated.