No source code is available for type org.junit.Assert; did you forget to inherit a required module?
Case
You run a GWT application, with a a service layer. Those services are tested through unit tests, which may use EasyMock, among other frameworks. Of course, you hinted at related jars, such us JUnit, by a <scope>test</scope>
in your pom.xml
.
Yet, when you run the GWT application with a Jetty light container, you get the following message:
Compiling module lalou.jonathan.gwt.client.MyModule
Validating newly compiled units
[java][ERROR] Errors in ‘file:/C:/eclipse/workspace/…/test/unit/lalou/jonathan/gwt/client//MyServiceUnitTest.java’
[ERROR] Line 26: No source code is available for type org.easymock.MockControl; did you forget to inherit a required module?
[ERROR] Line 76: No source code is available for type org.junit.Assert; did you forget to inherit a required module?[/java]
Fix
Since Maven2 and GWT scopes are fully independant, you have to modify you *.gwt.xml. Replace:
[xml] <source path=’client’/>[/xml]
with:
[xml]<source path=’client’ excludes="**/*UnitTest.java,**/*RuntimeTest.java"/>[/xml]
NB: Never forget that Google teams work with Ant, and not with Maven!