I am trying to write my first unit test to test a server side (RPC) method.
Say I have:

      public void testSubmitWord() throws Exception {
          final Hello module = new Hello();
          module.onModuleLoad();
          module.submitWord();
          Timer timer = new Timer() {
              public void run() {
                  String control = "show now:";
                  System.out.println(module.getLabelValue());
                  System.out.println("In Run method..");
                  assertFalse(control.equals(module.getLabelValue()));
                 finishTest();
                }
          };
          // Set a delay period significantly longer than the
          // event is expected to take.
          delayTestFinish(2000);

          // Schedule the event and return control to the test system.
          timer.schedule(100);
      }

The submitWord() method of Hello module changes the labelvalue (got from
getLabelValue()) to some value got from the server side. I am testing if the
default (value of "show now:") is no longer shown by the label.
Now this unit test fails, there is no timeout exception ( though the label
value is set properly by the appln).

Testcase: testSubmitWord took 21.261 sec
    FAILED
Remote test failed at x.y.z.a / Mozilla/5.0 (Windows; U; Windows NT 5.1;
en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
junit.framework.AssertionFailedError: Remote test failed at x.y.z.a /
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19)
Gecko/2010031422 Firefox/3.0.19
    at com.google.gwt.sample.hello.client.HelloTest$1.run(HelloTest.java:35)


Should I increase the delay? What is the problem?
Can anybody tell me please?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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.

Reply via email to