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 80696b1b9f11963b4a93d2d4a75d89d433364d46 Author: Jaroslav Tulach <jaroslav.tul...@apidesign.org> AuthorDate: Wed Jul 6 07:01:09 2022 +0200 Give each executor explicit name --- .../netbeans/html/presenters/spi/test/AsyncJavaOnlyTest.java | 8 ++++++++ .../org/netbeans/html/presenters/spi/test/CallbackTest.java | 8 ++++++++ .../test/java/org/netbeans/html/presenters/spi/test/Case.java | 2 +- .../org/netbeans/html/presenters/spi/test/GenericTest.java | 2 +- .../java/org/netbeans/html/presenters/spi/test/Testing.java | 11 ++++++----- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/generic/src/test/java/org/netbeans/html/presenters/spi/test/AsyncJavaOnlyTest.java b/generic/src/test/java/org/netbeans/html/presenters/spi/test/AsyncJavaOnlyTest.java index c9cd481e..35cf24bf 100644 --- a/generic/src/test/java/org/netbeans/html/presenters/spi/test/AsyncJavaOnlyTest.java +++ b/generic/src/test/java/org/netbeans/html/presenters/spi/test/AsyncJavaOnlyTest.java @@ -18,6 +18,8 @@ */ package org.netbeans.html.presenters.spi.test; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; import net.java.html.js.tests.AsyncJavaTest; import org.netbeans.html.json.tck.KOTest; import static org.netbeans.html.presenters.spi.test.GenericTest.createTests; @@ -35,6 +37,12 @@ public class AsyncJavaOnlyTest { } private static final class PromisesOnly extends Testing { + + public PromisesOnly() { + super(false, Executors.newSingleThreadExecutor((r) -> { + return new Thread(r, "PromisesOnly Executor"); + })); + } @Override protected String js2java(String method, Object a1, Object a2, Object a3, Object a4) throws Exception { switch (method) { diff --git a/generic/src/test/java/org/netbeans/html/presenters/spi/test/CallbackTest.java b/generic/src/test/java/org/netbeans/html/presenters/spi/test/CallbackTest.java index cdf03418..ab51dd0e 100644 --- a/generic/src/test/java/org/netbeans/html/presenters/spi/test/CallbackTest.java +++ b/generic/src/test/java/org/netbeans/html/presenters/spi/test/CallbackTest.java @@ -19,6 +19,8 @@ package org.netbeans.html.presenters.spi.test; import java.lang.reflect.Method; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; import java.util.logging.Level; import javax.script.ScriptException; import static org.testng.Assert.assertEquals; @@ -37,6 +39,12 @@ public class CallbackTest { private static final class CBP extends Testing { + public CBP() { + super(false, Executors.newSingleThreadExecutor((r) -> { + return new Thread(r, "Callback Executor"); + })); + } + @Override protected void loadJS(String js) { dispatch(new Runnable () { diff --git a/generic/src/test/java/org/netbeans/html/presenters/spi/test/Case.java b/generic/src/test/java/org/netbeans/html/presenters/spi/test/Case.java index e2eaa811..de11b067 100644 --- a/generic/src/test/java/org/netbeans/html/presenters/spi/test/Case.java +++ b/generic/src/test/java/org/netbeans/html/presenters/spi/test/Case.java @@ -84,7 +84,7 @@ public final class Case implements ITest, IHookable, Runnable { tp.beforeTest(m.getDeclaringClass()); } if (inst == null) { - inst = m.getDeclaringClass().newInstance(); + inst = m.getDeclaringClass().getConstructor().newInstance(); } result = m.invoke(inst); if (result == null) { diff --git a/generic/src/test/java/org/netbeans/html/presenters/spi/test/GenericTest.java b/generic/src/test/java/org/netbeans/html/presenters/spi/test/GenericTest.java index 49145072..321b4099 100644 --- a/generic/src/test/java/org/netbeans/html/presenters/spi/test/GenericTest.java +++ b/generic/src/test/java/org/netbeans/html/presenters/spi/test/GenericTest.java @@ -40,7 +40,7 @@ public class GenericTest { } @Factory public static Object[] compatibilityTests() throws Exception { - return createTests(new Testing()); + return createTests(Testing.create()); } static Object[] createTests(Testing t) throws Exception { diff --git a/generic/src/test/java/org/netbeans/html/presenters/spi/test/Testing.java b/generic/src/test/java/org/netbeans/html/presenters/spi/test/Testing.java index 53038866..b60004ce 100644 --- a/generic/src/test/java/org/netbeans/html/presenters/spi/test/Testing.java +++ b/generic/src/test/java/org/netbeans/html/presenters/spi/test/Testing.java @@ -40,12 +40,13 @@ class Testing { final boolean sync; final ProtoPresenter presenter; - public Testing() { - this(false); + static Testing create() { + return new Testing(); } - - protected Testing(boolean sync) { - this(sync, Executors.newSingleThreadExecutor()); + private Testing() { + this(false, Executors.newSingleThreadExecutor((r) -> { + return new Thread(r, "Testing Executor"); + })); } protected Testing(boolean sync, Executor queue) { this.sync = sync; --------------------------------------------------------------------- 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