On Oct 25, 9:11 am, lowecg2004 <
chris.lowe...@gmail.com> wrote:
> Your error looks like you're using the EasyMock class extensions and
> are missing cglib jars from your build path.
>
> As it happens, I recently produced a getting started with MVP and unit
> testing with EasyMock article which might be of use:
>
>
http://blog.hivedevelopment.co.uk/2009/10/introduction-to-mvp-unit-te...
>
Hi! Thanks for the heads up -- however, I find a couple of details:
* I added asm-3.1.jar and cglib-2.2.jar, which were in the GWT 2.0
tools/lib directory, but there was no asm-attrs.jar; do you still need
it?
* When running an empty JUnit (*not* GWTTestCase) test, which just
does loginViewMock=createMock(LoginView.class) I get another
exception... The GWT.create( ) problem -- how did you handle it? Or
did I miss a step in your article?
Thanks!!
java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:619)
at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:612)
at net.sf.cglib.proxy.Enhancer.registerCallbacks(Enhancer.java:581)
at org.easymock.classextension.internal.ClassProxyFactory.createProxy
(ClassProxyFactory.java:108)
at org.easymock.internal.MocksControl.createMock(MocksControl.java:
51)
at org.easymock.classextension.EasyMock.createMock(EasyMock.java:46)
at com.fkereki.mvptest.client.LoginPresenterTest.testLoginPresenter1
(LoginPresenterTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall
(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run
(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively
(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate
(InvokeMethod.java:20)
Caused by: 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.
at com.google.gwt.core.client.GWT.create(GWT.java:92)
at com.google.gwt.user.client.ui.UIObject.<clinit>(UIObject.java:140)
... 35 more