Delays or enforcing an execution order doesn't help. I think the problem is
"[WARN] 404 - POST /dp.verp.planer.Planer.JUnit/gwtRequest (192.168.1.51)
1424 bytes"
If I'd get this message in DevMode I'd fix web.xml's servlet-mapping but
what's the equivalent of the servlet-mapping when using GWTTestCase? The
WARN message occurs exactly when *calling fire()*. When calling fire()
always
* @Override*
* public void onFailure(ServerFailure error) {*
* }*
*
*
*is entered, instead of *
*
*
* @Override*
* public void onSuccess(MyType response) {*
* }*
On Friday, March 2, 2012 10:31:13 PM UTC+1, Thomas Broyer wrote:
>
>
>
> On Friday, March 2, 2012 8:45:36 PM UTC+1, Alexander Orlov wrote:
>>
>> When I call RequestFactory calls containing methods from my
>> *GWTTestCase*extending JUnit test I always get:
>>
>> *[WARN] 404 - POST /dp.verp.actas.ActAs.JUnit/gwtRequest (192.168.1.51)
>> 1422 bytes
>> *
>> *Mar 2, 2012 7:36:54 PM
>> com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl
>> runJob*
>> *SEVERE: Job run failed with unexpected RuntimeException: [object Class
>> JavaObject] (injected script#49)*
>>
>> The code works fine when it runs in DevMode or ProdMode:
>>
>> void *check*() {
>> ActAsRequest actAsRequest = ActAs.RF.actAsReqCtx();
>> actAsRequest.isManager("something").fire(new Receiver<Boolean>() {
>> @Override
>> public void onSuccess(Boolean response) {
>> Core.log(response.toString());
>> System.out.println("response = " + response);
>> }
>> });
>> }
>>
>> *GWTTestCase:*
>> public void testIsManager() {
>> Main main = new Main();
>> main.*check*();
>> }
>>
>
> You should rewrite your test to:
>
> - call delayTestFinish()
> - pass some callback to your check() method to be notified when the
> response comes back
> - call finishTest() from that callback
>
> I suspect the error comes from the fact the test is actually finished when
> the response comes back, and that code running outside the tests is causing
> the whole thing to fail.
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/h8A9lOuHHxMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.