Search in sources :

Example 1 with PreProcessor

use of org.apache.jmeter.processor.PreProcessor in project jmeter by apache.

the class TestCompiler method saveTransactionControllerConfigs.

private void saveTransactionControllerConfigs(TransactionController tc) {
    List<ConfigTestElement> configs = new ArrayList<>();
    List<Controller> controllers = new ArrayList<>();
    List<SampleListener> listeners = new ArrayList<>();
    List<Timer> timers = new ArrayList<>();
    List<Assertion> assertions = new ArrayList<>();
    List<PostProcessor> posts = new ArrayList<>();
    List<PreProcessor> pres = new ArrayList<>();
    for (int i = stack.size(); i > 0; i--) {
        addDirectParentControllers(controllers, stack.get(i - 1));
        for (Object item : testTree.list(stack.subList(0, i))) {
            if (item instanceof SampleListener) {
                listeners.add((SampleListener) item);
            }
            if (item instanceof Assertion) {
                assertions.add((Assertion) item);
            }
        }
    }
    SamplePackage pack = new SamplePackage(configs, listeners, timers, assertions, posts, pres, controllers);
    pack.setSampler(new TransactionSampler(tc, tc.getName()));
    pack.setRunningVersion(true);
    transactionControllerConfigMap.put(tc, pack);
}
Also used : ArrayList(java.util.ArrayList) Assertion(org.apache.jmeter.assertions.Assertion) PreProcessor(org.apache.jmeter.processor.PreProcessor) Controller(org.apache.jmeter.control.Controller) TransactionController(org.apache.jmeter.control.TransactionController) SampleListener(org.apache.jmeter.samplers.SampleListener) Timer(org.apache.jmeter.timers.Timer) TransactionSampler(org.apache.jmeter.control.TransactionSampler) ConfigTestElement(org.apache.jmeter.config.ConfigTestElement) PostProcessor(org.apache.jmeter.processor.PostProcessor)

Example 2 with PreProcessor

use of org.apache.jmeter.processor.PreProcessor in project jmeter by apache.

the class JMeterThread method runPreProcessors.

private void runPreProcessors(List<PreProcessor> preProcessors) {
    for (PreProcessor ex : preProcessors) {
        if (log.isDebugEnabled()) {
            log.debug("Running preprocessor: {}", ((AbstractTestElement) ex).getName());
        }
        TestBeanHelper.prepare((TestElement) ex);
        ex.process();
    }
}
Also used : PreProcessor(org.apache.jmeter.processor.PreProcessor)

Aggregations

PreProcessor (org.apache.jmeter.processor.PreProcessor)2 ArrayList (java.util.ArrayList)1 Assertion (org.apache.jmeter.assertions.Assertion)1 ConfigTestElement (org.apache.jmeter.config.ConfigTestElement)1 Controller (org.apache.jmeter.control.Controller)1 TransactionController (org.apache.jmeter.control.TransactionController)1 TransactionSampler (org.apache.jmeter.control.TransactionSampler)1 PostProcessor (org.apache.jmeter.processor.PostProcessor)1 SampleListener (org.apache.jmeter.samplers.SampleListener)1 Timer (org.apache.jmeter.timers.Timer)1