This is an automated email from the ASF dual-hosted git repository. jtulach pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/netbeans-html4j.git
commit a39be9d0bf05d57bcb04e61073ef3c8bd5c25db7 Author: Jaroslav Tulach <jaroslav.tul...@apidesign.org> AuthorDate: Fri May 13 20:06:05 2022 +0200 Java callback can be executed immediatelly, just then has to be delayed --- json-tck/src/main/java/net/java/html/js/tests/AsyncJavaTest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaTest.java b/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaTest.java index e3c29776..3abe6797 100644 --- a/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaTest.java +++ b/json-tck/src/main/java/net/java/html/js/tests/AsyncJavaTest.java @@ -18,9 +18,7 @@ */ package net.java.html.js.tests; -import net.java.html.js.JavaScriptBody; import static net.java.html.js.tests.JavaScriptBodyTest.assertEquals; -import static net.java.html.js.tests.JavaScriptBodyTest.assertFalse; import net.java.html.json.tests.PhaseExecutor; import org.netbeans.html.json.tck.KOTest; @@ -32,12 +30,10 @@ public class AsyncJavaTest { PhaseExecutor.schedule(phases, () -> { boolean[] javaExecuted = { false }; Object objWithX = AsyncJava.computeInAsyncJava(5, (n) -> { - javaExecuted[0] = true; return new Factorial().factorial(n); }, () -> {}); int initialValue = Bodies.readIntX(objWithX); - assertFalse(javaExecuted[0], "Java code shall only be called when the JavaScript ends"); - assertEquals(-1, initialValue, "Promise shall only be resolved 1when the JavaScript ends"); + assertEquals(-1, initialValue, "Promise.then shall only be called when the code ends"); return objWithX; }).then((objWithX) -> { int result = Bodies.readIntX(objWithX); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists