tags:

views:

1065

answers:

4

I'm trying to run a GWT unit test in a sample app. I ran

cmd /c /java/gwt-windows-1.6.4/webAppCreator.cmd -out gwttasks com.gwttasks.GwtTasks

Copied in junit-4.5.jar into a lib directory, and added that to the classpath.

Ran:

cmd /c /java/gwt-windows-1.6.4/junitCreator.cmd -junit lib/junit-4.5.jar -module com.gwttasks.GwtTasks -eclipse GwtTasks com.gwt
tasks.unit.GwtJunit

When I try to run any of the generated cmd file (such as GwtJunit-hosted.cmd) or any of the launch files, I get the following error. All the web pages I've seen say to add the test source to the classpath, but it's already there, so that's not the problem. Anyone else seen this?

com.google.gwt.junit.JUnitFatalLaunchException: The test class 'com.gwttasks.unit.GwtJunit' was not found in module 'com.gwttasks.GwtTasks'; no compilation unit for that type was seen
    at com.google.gwt.junit.JUnitShell.checkTestClassInCurrentModule(JUnitShell.java:390)
    at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:626)
    ...
A: 

Yes, I am faced with this same problem. I do not have any solution

Matt
Ok, I had to add the source directories to the classpath.
Matt
+3  A: 

The answer could be found here : http://raibledesigns.com/rd/entry/testing_gwt_applications

A: 

In netbeans I added the src/java and test to the class path and debugging worked!!!!! THANKS

Norm Wright
A: 

I just want to add that I had the same problem, because I did the (very silly) mistake to not put the GWTTestCase class into the "client" directory, but into another one. No wonder it wasn't found ;)

Harald Schilly