I launch the test in projects directory with:
java -Dgwt.args="-out www-test" -cp "./src:./test:./bin:/home/frede/
devel/libs/junit/junit-4.2.jar:/home/frede/devel/libs/gwt-linux-1.3.3/
gwt-user.jar:/home/frede/devel/libs/gwt-linux-1.3.3/gwt-dev-linux.jar"
junit.textui.TestRunner edu.upc.ladybird.hmi.test.Test
But all I get is this nice exception:
---------------------
.Rebinding edu.upc.ladybird.hmi.test.Test
Checking rule <generate-with
class='com.google.gwt.junit.rebind.JUnitTestCaseStubGenerator'/>
[ERROR] Unable to find type 'edu.upc.ladybird.hmi.test.Test'
[ERROR] Hint: Previous compiler errors may have made this
type unavailable
[ERROR] Deferred binding failed for 'edu.upc.ladybird.hmi.test.Test';
expect subsequent failures
com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at
com.google.gwt.dev.cfg.ConditionWhenTypeAssignableTo.doEval(ConditionWhenTypeAssignableTo.java:
52)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:36)
at
com.google.gwt.dev.cfg.ConditionAll.doEval(ConditionAll.java:37)
at com.google.gwt.dev.cfg.Condition.isTrue(Condition.java:36)
at com.google.gwt.dev.cfg.Rule.isApplicable(Rule.java:35)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:107)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:62)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
170)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
122)
at
com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:231)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
171)
at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:135)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:
313)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access
$100(BrowserWidgetMoz.java:35)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz
$ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:53)
at
org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native
Method)
at
org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1428)
at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:
657)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
337)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
120)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:
128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.start(TestRunner.java:180)
at junit.textui.TestRunner.main(TestRunner.java:138)
[ERROR] Unable to load module entry point class
edu.upc.ladybird.hmi.test.Test
com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at
com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:241)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
171)
at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:135)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:
313)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access
$100(BrowserWidgetMoz.java:35)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz
$ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:53)
at
org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native
Method)
at
org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1428)
at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:
657)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
337)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
120)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:
128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.start(TestRunner.java:180)
at junit.textui.TestRunner.main(TestRunner.java:138)
[ERROR] Failure to load module 'edu.upc.ladybird.hmi.TestExample'
com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:160)
at
com.google.gwt.dev.shell.BrowserWidget.attachModuleSpace(BrowserWidget.java:
313)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access
$100(BrowserWidgetMoz.java:35)
at com.google.gwt.dev.shell.moz.BrowserWidgetMoz
$ExternalObjectImpl.gwtOnLoad(BrowserWidgetMoz.java:53)
at
org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native
Method)
at
org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1428)
at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:
657)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
337)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
120)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:177)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:
128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at junit.textui.TestRunner.start(TestRunner.java:180)
at junit.textui.TestRunner.main(TestRunner.java:138)
E
Time: 23,159
There was 1 error:
1)
testSimple(edu.upc.ladybird.hmi.test.Test)com.google.gwt.junit.client.TimeoutException:
The browser did not contact the server within 20000ms.
at com.google.gwt.junit.JUnitShell.notDone(JUnitShell.java:
301)
at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:
655)
at com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:
337)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
120)
at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:177)
at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)
FAILURES!!!
Tests run: 1, Failures: 0, Errors: 1
--------------------------
Test.java reads:
---------
package edu.upc.ladybird.hmi.test;
import com.google.gwt.junit.client.GWTTestCase;
public class Test extends GWTTestCase {
public String getModuleName() {
return "edu.upc.ladybird.hmi.TestExample";
}
public void testSimple() {
assertTrue(true);
}
}
----------
And TestExample.gwt.xml:
------------
<module>
<inherits name='com.google.gwt.user.User'/>
</module>
-----------
I'm using Linux and java 1.6 (it fails on 5.0 also), junit 4.2 (3.8
tested with same results) and GWT 1.3.3
Any ideas on what's going on?
Thank you!
Try using JUnit 3.8.2.
JUnit 4 introduced Java 1.5 specific features that may confuse GWT as
it only supports Java 1.4 right now.
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine
Cheers
On Feb 28, 6:36 pm, "Sandy McArthur" <sandy...@gmail.com> wrote:
Any ideas on how to get the JUnit test to run without timing out?
Time: 32.86
[java] There was 1 error:
[java] 1)
testSimple(...web.client.test.JPASTest)com.google.gwt.junit.client.TimeoutException:
The browser did not contact the server within 20000ms.
[java] at com.google.gwt.junit.JUnitShell.notDone(JUnitShell.java:
301)
[java] at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:
655)
[java] at
com.google.gwt.junit.JUnitShell.runTestImpl(JUnitShell.java:337)
[java] at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:
120)
[java] at
com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:177)
[java] at
com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:114)
[java] FAILURES!!!
[java] Tests run: 1, Failures: 0, Errors: 1
Thanks!
There are several techniques to work around this:
1. Try a simple dummy test as the first method, that way browser may
contact the server under the timeout, before it has to then churn on
your more involved actual tests
2. Cut down what you test by making a test specific module
3. Edit the timeout in JUnitShell
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/c229e9a4b67fa2bd
JUnitShell is set to 20 seconds -
http://google-web-toolkit.googlecode.com/svn/trunk/user/src/com/google/gwt/junit/
On Feb 28, 11:12 am, "frider...@gmail.com" <freder...@gmail.com>
wrote:
I experienced similar problems. When you look into the source code
where the TimeoutException is actually thrown it tells following
// Set a timeout period to automatically fail if the servlet hasn't
been
// contacted; something probably went wrong (the module failed to
load?)
So what I already complained about is that when this exception is
thrown you actually don't know what was the problem. The easiest way
to get a test up and running was for me with the junitCreator.cmd. I
would recommend doing what charlie.collins suggested.
HTH
Dominik
On 1 Mrz., 04:15, "charlie.coll...@gmail.com"
<charlie.coll...@gmail.com> wrote:
> Sometimes, if you have a lot of classes involved, tests will timeout
> with this message - this is still an open issue -http://code.google.com/p/google-web-toolkit/issues/detail?id=96.
>
> There are several techniques to work around this:
> 1. Try a simple dummy test as the first method, that way browser may
> contact the server under the timeout, before it has to then churn on
> your more involved actual tests
> 2. Cut down what you test by making a test specific module
> 3. Edit the timeout in JUnitShell
>
> http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
>
> JUnitShell is set to 20 seconds -http://google-web-toolkit.googlecode.com/svn/trunk/user/src/com/googl...
On Mar 1, 2:56 am, "dominik_steiner" <Dominik.Stei...@partner.bmw-
#!/bin/bash
export GWT_HOME=/home/frede/devel/libs/gwt-linux-1.3.3/
export JUNIT_JAR=/home/frede/devel/libs/junit/junit.jar
mkdir test
cd test
${GWT_HOME}/applicationCreator com.client.Hello
${GWT_HOME}/junitCreator -junit ${JUNIT_JAR} -module com.Hello
com.test.TestHello
mkdir bin
javac -d bin src/com/client/Hello.java -classpath "${GWT_HOME}/gwt-
user.jar"
javac -d bin test/com/test/TestHello.java -classpath "${GWT_HOME}/gwt-
user.jar:${JUNIT_JAR}"
./TestHello-hosted
----- end script ------
Cheers
On Mar 1, 3:37 pm, "charlie.coll...@gmail.com"
> ...
>
> read more »
Add this to the Hello.gwt.xml file:
<source path="client" />
<source path="test" />
Or, change com.test.TestHello to com.client.TestHello.
> ...
>
> read more »
----- init script ------
#!/bin/bash
# Change the directories!
export GWT_HOME=/home/frede/devel/libs/gwt-linux-1.3.3/
export JUNIT_JAR=/home/frede/devel/libs/junit/junit.jar
mkdir test
cd test
${GWT_HOME}/applicationCreator com.client.Hello
${GWT_HOME}/junitCreator -junit ${JUNIT_JAR} -module com.Hello
com.client.TestHello
mkdir bin
javac -d bin src/com/client/Hello.java -classpath "${GWT_HOME}/gwt-
user.jar"
javac -d bin test/com/client/TestHello.java -classpath "${GWT_HOME}/
gwt-
user.jar:${JUNIT_JAR}"
./TestHello-hosted
----- end script ------
Thank you very much.