View | Details | Raw Unified | Return to bug 59067
Collapse All | Expand All

(-)a/src/core/org/apache/jmeter/threads/JMeterThread.java (-21 / +4 lines)
Lines 308-334 public class JMeterThread implements Runnable, Interruptible { Link Here
308
     * @param threadContext 
308
     * @param threadContext 
309
     */
309
     */
310
    private void triggerEndOfLoopOnParentControllers(Sampler sam, JMeterContext threadContext) {
310
    private void triggerEndOfLoopOnParentControllers(Sampler sam, JMeterContext threadContext) {
311
        
311
        // Find parent controllers of current sampler
312
        FindTestElementsUpToRootTraverser pathToRootTraverser = null;
312
        TransactionSampler transactionSampler = null;
313
        TransactionSampler transactionSampler = null;
313
        if(sam instanceof TransactionSampler) {
314
        if(sam instanceof TransactionSampler) {
314
            transactionSampler = (TransactionSampler) sam;
315
            transactionSampler = (TransactionSampler) sam;
315
        }
316
            pathToRootTraverser = new FindTestElementsUpToRootTraverser(transactionSampler.getTransactionController());
316
317
        Sampler realSampler = findRealSampler(sam);
318
        
319
        // Find parent controllers of current sampler
320
        FindTestElementsUpToRootTraverser pathToRootTraverser = null;
321
        if(realSampler instanceof TransactionSampler) {
322
            pathToRootTraverser = new FindTestElementsUpToRootTraverser(((TransactionSampler) realSampler).getTransactionController());
323
        } else {
317
        } else {
324
            pathToRootTraverser = new FindTestElementsUpToRootTraverser(realSampler);
318
            pathToRootTraverser = new FindTestElementsUpToRootTraverser(sam);
325
        }
319
        }
326
        testTree.traverse(pathToRootTraverser);
320
        testTree.traverse(pathToRootTraverser);
327
        
321
        
328
        // Trigger end of loop condition on all parent controllers of current sampler
322
        // Trigger end of loop condition on all parent controllers of current sampler
329
        List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
323
        List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
330
        for (Controller parentController : controllersToReinit) {
324
        for (Controller parentController : controllersToReinit) {
331
            System.out.println("Will trigger " + parentController.getName());
332
            if(parentController instanceof AbstractThreadGroup) {
325
            if(parentController instanceof AbstractThreadGroup) {
333
                AbstractThreadGroup tg = (AbstractThreadGroup) parentController;
326
                AbstractThreadGroup tg = (AbstractThreadGroup) parentController;
334
                tg.startNextLoop();
327
                tg.startNextLoop();
Lines 347-362 public class JMeterThread implements Runnable, Interruptible { Link Here
347
        }
340
        }
348
    }
341
    }
349
342
350
    private Sampler findRealSampler(Sampler sam) {
351
        Sampler realSampler = sam;
352
353
        while(realSampler instanceof TransactionSampler) {
354
            realSampler = ((TransactionSampler) realSampler).getSubSampler();
355
        }
356
       
357
        return realSampler;
358
    }
359
360
    /**
343
    /**
361
     * Process the current sampler, handling transaction samplers.
344
     * Process the current sampler, handling transaction samplers.
362
     *
345
     *

Return to bug 59067