aliz-ai/gwt-mock-2.5.1

Created Feb 16, 2021 · View the aliz-ai/gwt-mock-2.5.1 repository page

A mocked implementation for GWT-2.5.1 that can run in the JVM to allow integration testing

Want this for your repo?

Render a free sample of any GitHub repo in seconds.

Visualize your own →

Contributors

5

Lines of Code

5,659

From

Feb 14, 2016

To

Jul 13, 2020

About aliz-ai/gwt-mock-2.5.1

gwt-mock-2.5.1 is a mocked implementation of Google Web Toolkit 2.5.1 that enables running GWT code within the JVM for fast integration testing. Rather than relying on slow compilation and browser-based testing approaches like GWTTestCase or Selenium, this library allows developers to test GWT widgets and application logic directly on the JVM by providing mock implementations of GWT's core classes and DOM functionality.

The project started with an attempt to instrument class loading but ultimately took a different approach: the maintainers copied the gwt-user module and systematically removed unnecessary components like the hosted mode code, code generators, server-side code, RPC implementations, CSS generation, UiBinder, and most notably, the problematic Element type that was causing type inconsistencies. They replaced it with Element2, creating a simpler but functional DOM implementation suitable for widget testing.

The library handles several GWT-specific challenges for JVM testing. It provides a basic implementation of GWT.create for common use cases and allows applications to register custom suppliers for application-specific classes. It includes a modified Scheduler that lets tests control when deferred commands execute, supports RPC mocking through Java proxies that forward async calls to synchronous Mockito spies, and uses reflection and proxies to handle message generation and EventBinder functionality. While the implementation is tailored to GWT 2.5.1 and covers only what was needed for the creators' test scenarios, it has proven robust enough for production use at AODocs, an enterprise document management system, and welcomes community contributions for additional coverage.

Share this video

More from aliz-ai

See all →