Nala
unread,Oct 1, 2009, 1:56:47 PM10/1/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Web Toolkit
I want to run JUnit tests on GWT code that I am working on. I was
having some difficulties so I tried to simplify things as much as
possible. I'm still having issues:
I'm working with Eclipse Galileo, WTP , and the GWT plugin.
I created a brand new java project, enabled GWT for the project.
I added the file /src/org/example/gettest/GwtTest.gwt.xml :
<module>
<inherits name='com.google.gwt.user.User'/>
</module>
I created a very simple test, org.example.gwttest.TrueIsTrueGWTTest:
package org.example.gwttest.client;
import com.google.gwt.junit.client.GWTTestCase;
public class TrueIsTrueGWTTest extends GWTTestCase {
@Override
public String getModuleName() {
return "org.example.gwttest.GwtTest";
}
public void testTrueIsTrue() {
assertTrue(true);
}
}
I run the test from the Project Explorer using the context menu "Run
as -> GWT JUnit test" or "Run as -> GWT JUnit test (web mode)" and
the test runs just fine, taking under 10 seconds.
If I run the test multiple times, tho, after 2 to 5 tries, I get
com.google.gwt.junit.client.TimeoutException: The browser did not
contact the server within 60000ms.
- 1 client(s) haven't responded back to JUnitShell since the start
of the test.
Actual time elapsed: 60.025 seconds.
at com.google.gwt.junit.JUnitShell.notDone(JUnitShell.java:551)
at com.google.gwt.dev.HostedModeBase.pumpEventLoop
(HostedModeBase.java:556)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
652)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:346)
at com.google.gwt.junit.client.GWTTestCase.runTest
(GWTTestCase.java:219)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:
132)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
Then I can run it again, and it works. I have seen some suggestions
related the that error, but they applied to situation where the test
wouldn't run at all - mine works some of the time.
Does anyone have a suggestion for getting rid of this intermittent
problem?
Thank you,
Nancy Deschenes