UnsatisfiedLinkError with gwt-test-utils in DOMImplStandard

224 views Asked by At

I want to write a gwt-test-utils test to test the composite widget I created. After spending some time getting started, the JUnit test is finally starting up, I can initialize the widget and even access private fields.

However here is the show stopper: my widget uses another widget which extends ComplexPanel. Whenever I try to call its insertChild method, I get the following exception

java.lang.UnsatisfiedLinkError: com.google.gwt.user.client.impl.DOMImplStandard.insertChild(Lcom/google/gwt/user/client/Element;Lcom/google/gwt/user/client/Element;I)V at com.google.gwt.user.client.impl.DOMImplStandard.insertChild(Native Method) at com.google.gwt.user.client.impl.DOMImplMobileSafari.insertChild(DOMImplMobileSafari.java:26) at com.google.gwt.user.client.DOM.insertChild(DOM.java:958) at com.google.gwt.user.client.ui.ComplexPanel.insert(ComplexPanel.java:203) [...]

I read about gwt-test-utils' Patcher API and took a look at its source code. DOMImplStandard extends DOMImpl. There is a PatchClass for DOMImpl with a PatchMethod for insertChild (DOMImplUserPatcher). But for some reason the patching does not seem to work for me. I tried writing my own patch for DOMImpl.insertChild which resulted in

com.googlecode.gwt.test.exceptions.GwtTestPatchException: 2 @PatchMethod methods detected for the same target...

After that I wrote a patch for DOMImplMobileSafari.insertChild and that did work! But I do not want to copy DOMImplUserPatcher just to apply it to DOMImplMobileSafari and still think that something is not working as expected for me.

Any idea what I am doing wrong?

0

There are 0 answers