Friday, July 29, 2011

Tested class changes not visible to test class using gwt-maven-plugin

Can anyone help with this? (I know there is a separate mailing list
for gwt-maven-plugin but I'm not sure it has a lot of subscribers.)

Given that you have a JUnit test case class in /src/test/java/*/ and a tested class /src/main/java/*/ If you
attempt run your test case in you will get a runtime
error indicating that FooTest doesn't have access to the modified
Foo.class file.

Steps to reproduce.
1) Generate a GWT project using the gwt-maven-plugin archetype.
2) Import the project into Eclipse using new->Existing Projects into
3) Create class in /src/main/java/**/client.
4) Define a simple test method in "public hello(){return
5) Create class in /src/test/java/**/client.
6) Define a test in
"@Test public void testFooTest() {Foo foo = new Foo();
assertEquals("hello", foo.hello());}
7) Run the test case method. You will get a runtime message
complaining that Foo can't be found.

A workaround is to:
1) open the junit run configuration.
2) select the classpath tab.
3) select user entries
4) click advanced button
5) select "Add folders" radio button
6) click ok button
7) add folder src/main/webapp/WEB-INF/classes

Its not a great workaround since you have to do this with every test
case run configuration.

Another workaround is to run Project/clean on the project.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

1 comment: