test with GwtTestCase JUnitShell ant : testBeginTimeout and junitvmwatcher errors

479 views
Skip to first unread message

Francois Wauquier

unread,
Jan 24, 2011, 5:56:47 AM1/24/11
to google-we...@googlegroups.com
Hi

I am facing issue concerning testing with GwtTestCase using ant.

I can run my tests in eclipse and they all pass.
(I ran all the tests of my project with the regular JunitRunner, with sources included)

But with ant, i constructed a similar classpath for the junit task, and i get this error.

    [junit]  - 1 client(s) haven't responded back to JUnitShell since the start
of the test.
    [junit]  Actual time elapsed: 60.014 seconds.
    [junit] Try increasing this timeout using the '-testBeginTimeout minutes' op
tion
    [junit] The default value of minutes is 1, i.e., the server waits 1 minute o
r 60 seconds.
    [junit] )
    [junit] Tests run: 7, Failures: 0, Errors: 7, Time elapsed: 71,764 sec
BUILD FAILED

And the message is effectively concise and give a tip to fix.

So i tried to use this parameter by using the ant "jvm" attribute
jvm="java -testMethodTimeout 2"

Then i get a strange junitvmwatcher NotFound error
    [junit] java.io.FileNotFoundException: C:\workspace\MyWebProject\junitvmwatc
her55650195.properties (Le fichier spÚcifiÚ est introuvable)
    [junit]     at java.io.FileInputStream.open(Native Method)
    [junit]     at java.io.FileInputStream.<init>(FileInputStream.java:106)
    [junit]     at java.io.FileReader.<init>(FileReader.java:55)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
eAsForked(JUnitTask.java:1028)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execut
e(JUnitTask.java:817)
BUILD FAILED

It seems that the junitvmwatcher thing append in other contexts than gwt, but i have not found any resolution.
It may be related to the "fork" parameter but i am not sure.

I am using GWT 2.1, ant 1.7.0 and junit 4.3.1

Could someone explain that ?
Does Eclipse google plugin have a default testBeginTimeout, different than the default-default one (60s) ?
Does anybody had fixed one or both of this problems ?
Is there a different way to set the testMethodTimeout  value : system property, test itself ?

Thanks

Francois Wauquier

Francois Wauquier

unread,
Feb 1, 2011, 3:57:33 AM2/1/11
to google-we...@googlegroups.com
Hi

I am back with new infos.
I have succeeded in define the testBeginTimeout using "sysproperty" tag intead of "jvm" attribute, like this :

<junit printsummary="yes" haltonfailure="yes" fork="yes" >
            <sysproperty key="gwt.args" value="-testBeginTimeout 5 -testMethodTimeout 2 -runStyle HtmlUnit"/>

But the error is the same, with a different timeout (300 instead of 60)

    [junit]  - 1 client(s) haven't responded back to JUnitShell since the start
of the test.
    [junit]  Actual time elapsed: 300.148 seconds.
    [junit] Try increasing this timeout using the '-testBeginTimeout minutes' op
tion
    [junit] The default value of minutes is 1, i.e., the server waits 1 minute o
r 60 seconds.
    [junit] )

My all suite take only one minute in eclipse, so it is very strange.

Francois Wauquier

Francois Wauquier

unread,
Feb 4, 2011, 9:08:00 AM2/4/11
to google-we...@googlegroups.com
Hi

to close this
after the correction of the gwt.args definition, 
the error was an invalid classpath, with a missing configuration file (application specific).
It is now working.

The junitvmwatcher error  came back when i included all the production librairies.
After that i added one by one the needed jars.
The order in the class path is also very important for this kind of tests, because several classes are overriden.

Francois Wauquier

Reply all
Reply to author
Forward
0 new messages