Is there a way to stop the queues of JUnit tests and still keep JavaFX Gui running?

I am writing a program that sets up a graphical interface for running JUnit test scripts that use Selenium WebDriver in Java. The GUI sets up the JUnit test queue in the background (or, as I suppose). In the GUI, I want to use the โ€œstop testโ€ button, which will stop all future JUnit tests that are still in the queue, but I want to do this in a timely manner. I currently have a code that will stop all tests, but if there are 190 tests in the queue, to stop a singular test in the queue from running, which is not timely, and is not suitable for consumers if you think that many tests

Field field = JUnitCore.class.getDeclaredField("fNotifier"); field.setAccessible(true); RunNotifier runNotifier = (RunNotifier) field.get(runner); runNotifier.pleaseStop(); 

Is there a way to clear the JUnit test queue or a specific thread to close that will stop scripts from executing without killing the GUI?

+7
java multithreading junit selenium webdriver
source share
2 answers

After reviewing this, I recently found out that starting a notification in my question is fast enough, I had too many subprocesses that I recently optimized during the test stop action. Now running the notifier allows you to check the tests in the queue, they can not be run almost instantly.

Although this does not technically answer the question of how to stop JUnit Tests from being queued, at least at least try to run them.

0
source share

How do you define your streams in your xml file? Found some things using a parallel variable to immediately destroy all specific threads. Maybe if you call your threads something common and increase the counter to put "_1" ... "_2", etc. At the end of the common name, could you quickly go through and kill the stream directly? You mentioned the test queue, that you are not sure how it works, perhaps take the queue in your hands manually and kill them all.

+3
source share

All Articles