On 1 sep, 19:48, davis <[email protected]> wrote:
> As far as I can tell, this should work:
>
> HasWidgets mockHasWidgets = org.easymock.EasyMock.createMock
> (HasWidgets.class);
>
> since HasWidgets is an 
> interface:http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/index.html
>
> ...but if you execute this, it promptly throws:
>
> java.lang.UnsupportedOperationException: ERROR: GWT.create() is only
> usable in client code!  It cannot be called, for example, from server
> code.  If you are running a unit test, check that your test case
> extends GWTTestCase and that GWT.create() is not called from within an
> initializer or constructor.
>
> This usually happens when you execute any code in standard JUnit tests
> that end up calling GWT.create( ) -- but this is an interface...what
> am I missing here?

EasyMock is only usable in pure Java, i.e. (to make it short) not in a
GWTTestCase. If your code ultimately depends on GWT.create() (which
EasyMock does not!), you can use GWTMockUtilities to make GWT.create()
work (and simply return null).

In a word, your GWT.create() issue is unrelated to the EasyMock line
you quoted.
--~--~---------~--~----~------------~-------~--~----~
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