@@ -0,0 +1,2301 @@
+/*%0A * Copyright 2017 Volker Berlin (i-net software)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage de.inetsoftware.jwebassembly.runtime;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0A%0Aimport org.junit.ClassRule;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0Aimport org.junit.runners.Parameterized.Parameters;%0Aimport org.webassembly.annotation.Export;%0A%0Aimport de.inetsoftware.jwebassembly.ScriptEngine;%0Aimport de.inetsoftware.jwebassembly.WasmRule;%0A%0A/**%0A * @author Volker Berlin%0A */%0A@RunWith(Parameterized.class)%0Apublic class CallFunctions %7B%0A    %0A    @ClassRule%0A    public static WasmRule rule = new WasmRule( TestClass.class ); %0A%0A    private final ScriptEngine script;%0A    private final String method;%0A    private final Object%5B%5D params;%0A%0A    public CallFunctions( ScriptEngine script, String method, Object%5B%5D params ) %7B%0A        this.script = script;%0A        this.method = method;%0A        this.params = params;%0A    %7D%0A%0A    @Parameters(name=%22%7B0%7D-%7B1%7D%22)%0A    public static Collection%3CObject%5B%5D%3E data() %7B%0A        ArrayList%3CObject%5B%5D%3E list = new ArrayList%3C%3E();%0A        for( Object%5B%5D val : ScriptEngine.testParams() ) %7B%0A            ScriptEngine script = (ScriptEngine)val%5B0%5D;%0A            addParam( list, script, %22intCall%22 );%0A        %7D%0A        return list;%0A    %7D%0A%0A    private static void addParam( ArrayList%3CObject%5B%5D%3E list, ScriptEngine script, String method, Object ...params ) %7B%0A        list.add( new Object%5B%5D%7Bscript, method, params%7D );%0A    %7D%0A%0A    @Test%0A    public void test() %7B%0A        rule.test( script, method, params );%0A    %7D%0A%0A    static class TestClass %7B%0A%0A        @Export%0A        static int intCall() %7B%0A            return intConst();%0A        %7D%0A%0A        static int intConst() %7B%0A            return -42;%0A        %7D%0A%0A    %7D%0A%7D%0A

Add support for invoke static method calls