@Test(timeout = 25000) public void testSetDoneThreadsAfterHold() throws Exception { Object[] objects = createTestPlan(); ListedHashTree hashTree = (ListedHashTree) objects[0]; ConcurrencyThreadGroupExt ctg = (ConcurrencyThreadGroupExt) objects[1]; ListenerNotifier notifier = new ListenerNotifier(); long startTime = System.currentTimeMillis(); ctg.start(1, notifier, hashTree, new StandardJMeterEngine()); Thread threadStarter = ctg.getThreadStarter(); threadStarter.join(); long endTime = System.currentTimeMillis(); Thread.sleep(5000); assertTrue((endTime - startTime) < 20000); assertEquals(0, ctg.getNumberOfThreads()); }
@Override protected Thread getThreadStarter(int groupIndex, ListenerNotifier listenerNotifier, ListedHashTree testTree, StandardJMeterEngine engine) { return new ConcurrencyThreadStarter(groupIndex, listenerNotifier, testTree, engine, this); }
ConcurrencyThreadGroup extends AbstractDynamicThreadGroup { @Override protected Thread getThreadStarter(int groupIndex, ListenerNotifier listenerNotifier, ListedHashTree testTree, StandardJMeterEngine engine) { return new ConcurrencyThreadStarter(groupIndex, listenerNotifier, testTree, engine, this); } }
ConcurrencyThreadGroup extends AbstractDynamicThreadGroup { @Override protected Thread getThreadStarter(int groupIndex, ListenerNotifier listenerNotifier, ListedHashTree testTree, StandardJMeterEngine engine) { return new ConcurrencyThreadStarter(groupIndex, listenerNotifier, testTree, engine, this); } ConcurrencyThreadGroup(); }
ConcurrencyThreadGroup extends AbstractDynamicThreadGroup { @Override protected Thread getThreadStarter(int groupIndex, ListenerNotifier listenerNotifier, ListedHashTree testTree, StandardJMeterEngine engine) { return new ConcurrencyThreadStarter(groupIndex, listenerNotifier, testTree, engine, this); } ConcurrencyThreadGroup(); void waitThreadStopped(); @Override int getNumThreads(); @Override boolean isLimitReached(); void threadStarted(JMeterThread thread); @Override void threadFinished(JMeterThread thread); long getConcurrency(); boolean tooMuchConcurrency(); }
ConcurrencyThreadGroup extends AbstractDynamicThreadGroup { @Override protected Thread getThreadStarter(int groupIndex, ListenerNotifier listenerNotifier, ListedHashTree testTree, StandardJMeterEngine engine) { return new ConcurrencyThreadStarter(groupIndex, listenerNotifier, testTree, engine, this); } ConcurrencyThreadGroup(); void waitThreadStopped(); @Override int getNumThreads(); @Override boolean isLimitReached(); void threadStarted(JMeterThread thread); @Override void threadFinished(JMeterThread thread); long getConcurrency(); boolean tooMuchConcurrency(); static final long MIN_CHECK_TIME; }