Native function call in testcase using gwt-test-utils causes UnsatisfiedLinkError

585 views Asked by At

I am testing my gwt Composite component using gwt-test-utils 0.44.

I am using gwt-cal Calendar component. But i cant instantiate the class beacause it throws UnstisfiedLinkError when a native function in invoked.

I have simulated the problem. Here is my code.

@GwtModule("com.testing.web.MyProject")
public class CalendarViewTest  extends GwtTest{

    private static native void alrt() /*-{
        $wnd.alert("js");
    }-*/;

    @Test
    public void test01(){
        alrt();
    }
}

This also causes UnstisfiedLinkError. How can i call the native funcion correctly? Is there any configuration needed?

1

There are 1 answers

0
Gael On BEST ANSWER

You have to patch the native alrt() method by writing a custom Patcher. It's explained here : https://github.com/gwt-test-utils/gwt-test-utils/wiki/Writing-custom-Patchers