On Oct 25, 9:11 am, lowecg2004 <[email protected]> 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)
at org.junit.internal.runners.statements.RunBefores.evaluate
(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate
(RunAfters.java:31)
at org.junit.runners.BlockJUnit4ClassRunner.runChild
(BlockJUnit4ClassRunner.java:73)
at org.junit.runners.BlockJUnit4ClassRunner.runChild
(BlockJUnit4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate
(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate
(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
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
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---