Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Put all business logic into Presenters and make them JRE testable (aka JUnit). 
    • The philosophy of our infrastructure and this technique is described here
    • This means that Presenters can not deal with class instances that rely upon GWT.create(...) calls. For the rare case when this is necessary, create a GWTTestCase. Be aware that these tests take significant time to spin up.
    • The philosophy of our architecture and this testing technique is described here
  • To mock callbacks, such as with RPC services, use AsyncMockStubber's static methods. 

    Code Block
    languagejava
    // Example call onSuccess(..)
    AsyncMockStubber.callSuccessWith("Result Object").when(mockService).getSomething(eq("someInputParam"), any(AsyncCallback.class)); 
     
    // Example call onFailure(..)
    AsyncMockStubber.callFailureWith(new Throwable("error message")).when(mockService).getSomething(eq("someInputParam"), any(AsyncCallback.class));