View Full Version : [2.2.5] Component is unmockable as GXT.class statically calls GWT.getModuleBaseURL

23 Feb 2012, 3:58 PM

- Detailed description of the problem

I'm trying to mock out GXT widgets using GWTMockUtilities.disarm() to avoid Exceptions from GWT.create(). Note I'm doing this as GWTTestCase is too slow.

I get another exception because com.extjs.gxt.ui.client.widget.Component calls GXT.init() (in a static initialiser) which then calls GWT.getModuleBase() in a static member:

public static String SSL_SECURE_URL = GWT.getModuleBaseURL() + "blank.html";

Is there a way you could prevent calling GWT.getModuleBaseURL() in GXT.class; either by making a method to get SSL_SECURE_URL to defer the call, or by putting a special static flag on GXT.class that disables calls to GWT.getModuleBaseURL();

- GXT version: 2.2.5

- Host mode / web mode / both: Both

- Browser and version: All

- Operating System: All
- Sample code: NA

Carl Pritchett

24 Feb 2012, 12:53 AM
We cannot defer it as it is required directly in the widgets, and not deferred. I do not see a way on removing it without adding a braking change.