Search in sources :

Example 1 with Backend

use of org.apache.jmeter.visualizers.backend.Backend in project jmeter by apache.

the class TreeClonerForValidation method addNodeToTree.

/**
     * @see org.apache.jmeter.engine.TreeCloner#addNodeToTree(java.lang.Object)
     */
@Override
protected Object addNodeToTree(Object node) {
    if ((VALIDATION_IGNORE_TIMERS && node instanceof Timer) || (VALIDATION_IGNORE_BACKENDS && node instanceof Backend)) {
        // don't add timer or backend
        return node;
    } else {
        Object clonedNode = super.addNodeToTree(node);
        if (clonedNode instanceof org.apache.jmeter.threads.ThreadGroup) {
            ThreadGroup tg = (ThreadGroup) clonedNode;
            tg.setNumThreads(VALIDATION_NUMBER_OF_THREADS);
            tg.setScheduler(false);
            tg.setProperty(ThreadGroup.DELAY, 0);
            if (((AbstractThreadGroup) clonedNode).getSamplerController() instanceof LoopController) {
                ((LoopController) ((AbstractThreadGroup) clonedNode).getSamplerController()).setLoops(VALIDATION_ITERATIONS);
            }
        }
        return clonedNode;
    }
}
Also used : Backend(org.apache.jmeter.visualizers.backend.Backend) Timer(org.apache.jmeter.timers.Timer) ThreadGroup(org.apache.jmeter.threads.ThreadGroup) AbstractThreadGroup(org.apache.jmeter.threads.AbstractThreadGroup) LoopController(org.apache.jmeter.control.LoopController)

Aggregations

LoopController (org.apache.jmeter.control.LoopController)1 AbstractThreadGroup (org.apache.jmeter.threads.AbstractThreadGroup)1 ThreadGroup (org.apache.jmeter.threads.ThreadGroup)1 Timer (org.apache.jmeter.timers.Timer)1 Backend (org.apache.jmeter.visualizers.backend.Backend)1