title: GWT JUnit Testing
body: <p>I'm trying a very JUnit Testing for GWT put it is failing</p>
  
  <pre><code>public class CheckTest extends TestCase
  {
  
      private ServiceAsync RPC;
      private HandlerManager EventBus;
      private CreateTopicPresenter.Display CTV;
      private CreateTopicPresenter CTP;
  
      protected void setUp() 
      {
          RPC= createStrictMock(ServiceAsync.class);
          EventBus = new HandlerManager(null);
          CTV= createStrictMock(CreateTopicView.class);
          CTP= new CreateTopicPresenter(CTV,RPC,EventBus);
      }
      public void testCheck()
      {
  
          CTP.View.getFirstMessage().setValue("MessageTest");
          assertTrue(CTP.View.getFirstMessage().getValue().equals("MessageTest"));
      }
  </code></pre>
  
  <p>Stack Trace:</p>
  
  <pre><code> java.lang.ExceptionInInitializerError
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          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.internal.ClassProxyFactory.createProxy(ClassProxyFactory.java:194)
          at org.easymock.internal.MocksControl.createMock(MocksControl.java:60)
          at org.easymock.EasyMock.createStrictMock(EasyMock.java:70)
          at com.BiddingSystem.client.CheckTest.setUp(CheckTest.java:26)
          at junit.framework.TestCase.runBare(TestCase.java:128)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:120)
          at junit.framework.TestSuite.runTest(TestSuite.java:230)
          at junit.framework.TestSuite.run(TestSuite.java:225)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          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:91)
          at com.google.gwt.user.client.ui.UIObject.&lt;clinit&gt;(UIObject.java:188)
          ... 24 more
  </code></pre>