java - AssertionError when using a TaskExecutor -


I am writing a program that executes multiple threads at the same time (in parallel), I have a task exciterator I am using. @Atoward Task Explorer Thread Pole Task Exchanger; @Test Public Zero Test Display Tape Charger () throws hurdles exceptions {assertNotNull (threadPoolTaskExecutor); For (int k = 0; k & lt; 5; k ++) {runner myThread = new workflow (New Atomicator (K)); ThreadPoolTaskExecutor.execute (myThread); } Thread. Sleep (500); Logger.info ("End all threads"); }

When I checked my code, an assurance error exception was raised. I am using the Spring Framework to manage execution.

Here is the log screen:

  Exceptions to the thread "main" java.lang.AssertionError at org.junit Org.junit.Assert.assertNotNull (assert.java <26 ) At ORg.junit.Assert.assertTrue (Assert.java:43) on   .Assert.fail (Assert.java:92) P> Any one has any ideas please :) Thanks   

I have found a solution, I have to start ThreadPoolTaskExecutor so when we use assertNotNull (threadPoolTaskExecutor) ; The object will be started and we can execute our thread.

The initial method here is:

  Public Zero Start () {logger.info ("Creating Threadpool Explorer"); Blocked Qiu Qi = this.queueCapacity; Executor Service = New Threadpool Extractor (this .core bridge size, this MaxSpace size, keep it. Eliveconds, time unit. SEODDS, queue, it. Threadfactor, denyxixionhandler); }   

And here is the executable service definition:

  Personal Threadpool Explorer Executioner Service;   

Thanks to Andrew and Pace and the Invitation for your help :)

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -