/** * Try to kill (and then join) the SUT threads. Killing the SUT threads is * important, because some spawn threads could just wait on objects/locks, * and so make the test case executions always last TIMEOUT ms. */ public void killAndJoinClientThreads() throws IllegalStateException { threadStopper.killAndJoinClientThreads(); }
@After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); }
stopper.killAndJoinClientThreads(); Assert.assertTrue(isThreadRunning(TimerClass.NAME)); stopper.storeCurrentThreads(); stopper.startRecordingTime(); stopper.killAndJoinClientThreads(); Assert.assertFalse(isThreadRunning(TimerClass.NAME));