title: GWTMockito UnsatisfiedLinkError
body: <p>I've done most of my GWT testing MVP-style, without testing widgets. I'd like to be able to build more complex widgets and test them well without using <code>GwtTestCase</code> (slow). </p>
  
  <p>Out of curiosity, I tried an extremely simple test. Given a very simple widget a little like this (this isn't my exact class, just a simplified example):</p>
  
  <pre><code>public class MyWidget extends Composite {
      private TextBox boxOne, boxTwo;
  
      public MyWidget() {
          boxOne = new TextBox();
          boxTwo = new TextBox();
          VerticalPanel panel = new VerticalPanel();
          panel.add( boxOne );
          panel.add( boxTwo );
          initWidget( panel );
      }
  
      public String[] getText() {
        return new String[] { boxOne.getText(), boxTwo.getText() }
      }
  }
  </code></pre>
  
  <p>And I'm using a GWTMockito test a little like this:</p>
  
  <pre class="lang-java prettyprint-override"><code>public class MyWidgetTest {
  
      private ConstantsWithLookup constants;
      private MyWidget widget;
  
      @Before
      public void createMocks() {
          GwtMockito.initMocks( this );
          constants = mock( ConstantsWithLookup.class );
      }
  
      @Test
      public void testIsInvalidByDefault() {
          widget = new MyWidget( constants ) {
              protected void initWidget(Widget w) {
                  // Disarm for testing
                }
          };
          assertNotNull( widget );
      }
  
      @After
      public void tearDown() {
          GwtMockito.tearDown();
      }
  
  }
  </code></pre>
  
  <p>I immediately get:</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: com.google.gwt.dom.client.Document.nativeGet()Lcom/google/gwt/dom/client/Document;
      at com.google.gwt.dom.client.Document.nativeGet(Native Method)
      at com.google.gwt.dom.client.Document.get(Document.java:46)
      at com.google.gwt.user.client.ui.TextBox.&lt;init&gt;(TextBox.java:78)
      at mypackage.MyWidget.&lt;init&gt;(MyWidget.java:linenumber)
      ... etc ...
  </code></pre>
  
  <p>You'll note I'm not using the test runner -- I tried to, but the project I'm testing this on is using JUnit 4.4, the test runner doesn't seem to work with JUnit 4.4. If I use the GwtMockitoTestRunner, I get:</p>
  
  <pre><code>java.lang.NoSuchFieldError: NULL
      at org.junit.runners.ParentRunner.&lt;init&gt;(ParentRunner.java:57)
      at org.junit.runners.BlockJUnit4ClassRunner.&lt;init&gt;(BlockJUnit4ClassRunner.java:57)
      at com.google.gwtmockito.GwtMockitoTestRunner.&lt;init&gt;(GwtMockitoTestRunner.java:114)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  </code></pre>
  
  <p>Based on <a href="https://stackoverflow.com/questions/7688395/nosuchfielderror-when-trying-to-run-a-junit-test-with-spring">another stack overflow question</a>, and a quick investigation, I'm inclined to believe this has to do with the version of JUnit in use on this project. GwtMockito uses <code>BlockJunit4ClassRunner</code>, which is marked @since 4.5.</p>
  
  <p>So -- is this test the sort of thing that GWTMockito is supposed to help with? I'm totally new to GWTMockito, so it could easily be a simple misunderstanding, but I'd like to understand.</p>
  
  <p>Can I use GWTMockito to test complex widgets that are built from smaller widgets using <code>Composite</code> / <code>IsWidget</code>? Shouldn't GWTMockito have helped me with this JSNI issue, or am I misreading something? Is it just because I'm not using the test runner?</p>