@@ -0,0 +1,2336 @@
+/*%0A * Copyright 2019 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 static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.junit.Assume.assumeFalse;%0A%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;%0A%0Aimport de.inetsoftware.jwebassembly.ScriptEngine;%0Aimport de.inetsoftware.jwebassembly.WasmRule;%0Aimport de.inetsoftware.jwebassembly.api.annotation.Export;%0A%0A/**%0A * Run some tests which not return static/fix values likes times or random value and which are difficult to compare.%0A * %0A * @author Volker Berlin%0A *%0A */%0A@RunWith( Parameterized.class )%0Apublic class DynamicValues %7B%0A%0A    @ClassRule%0A    public static WasmRule rule = new WasmRule( TestClass.class );%0A%0A    private final ScriptEngine script;%0A%0A    public DynamicValues( ScriptEngine script ) %7B%0A        this.script = script;%0A    %7D%0A%0A    @Parameters( name = %22%7B0%7D%22 )%0A    public static Collection%3CScriptEngine%5B%5D%3E data() %7B%0A        return ScriptEngine.testParams();%0A    %7D%0A%0A    @Test%0A    public void currentTimeMillis() %7B%0A        assumeFalse( script == ScriptEngine.SpiderMonkey %7C%7C script == ScriptEngine.SpiderMonkeyWat );%0A        long before = System.currentTimeMillis(); %0A        String result = rule.evalWasm( script, %22currentTimeMillis%22 );%0A        long after = System.currentTimeMillis(); %0A        long val = Long.parseLong( result );%0A        assertTrue( before + %22%3C=%22 + val + %22%3C=%22 + after, before %3C= val && val %3C= after );%0A    %7D%0A%0A    static class TestClass %7B%0A%0A        @Export%0A        static long currentTimeMillis() %7B%0A            return System.currentTimeMillis();%0A        %7D%0A    %7D%0A%7D%0A

Add a test for System.currentTimeMillis()