Search in sources :

Example 6 with ResultCollector

use of org.apache.jmeter.reporters.ResultCollector in project jmeter by apache.

the class AbstractVisualizer method configure.

/* Overrides AbstractJMeterGuiComponent.configure(TestElement) */
@Override
public void configure(TestElement el) {
    super.configure(el);
    setFile(el.getPropertyAsString(ResultCollector.FILENAME));
    ResultCollector rc = (ResultCollector) el;
    errorLogging.setSelected(rc.isErrorLogging());
    successOnlyLogging.setSelected(rc.isSuccessOnlyLogging());
    if (collector == null) {
        collector = new ResultCollector();
    }
    collector.setSaveConfig((SampleSaveConfiguration) rc.getSaveConfig().clone());
}
Also used : ResultCollector(org.apache.jmeter.reporters.ResultCollector)

Example 7 with ResultCollector

use of org.apache.jmeter.reporters.ResultCollector in project jmeter by apache.

the class PreCompiler method addNode.

/** {@inheritDoc} */
@Override
public void addNode(Object node, HashTree subTree) {
    if (isRemote && node instanceof ResultCollector) {
        try {
            replacer.replaceValues((TestElement) node);
        } catch (InvalidVariableException e) {
            log.error("invalid variables", e);
        }
    }
    if (isRemote) {
        return;
    }
    if (node instanceof TestElement) {
        try {
            replacer.replaceValues((TestElement) node);
        } catch (InvalidVariableException e) {
            log.error("invalid variables", e);
        }
    }
    if (node instanceof TestPlan) {
        //A hack to make user-defined variables in the testplan element more dynamic
        ((TestPlan) node).prepareForPreCompile();
        Map<String, String> args = ((TestPlan) node).getUserDefinedVariables();
        replacer.setUserDefinedVariables(args);
        JMeterVariables vars = new JMeterVariables();
        vars.putAll(args);
        JMeterContextService.getContext().setVariables(vars);
    }
    if (node instanceof Arguments) {
        ((Arguments) node).setRunningVersion(true);
        Map<String, String> args = ((Arguments) node).getArgumentsAsMap();
        replacer.addVariables(args);
        JMeterContextService.getContext().getVariables().putAll(args);
    }
}
Also used : JMeterVariables(org.apache.jmeter.threads.JMeterVariables) InvalidVariableException(org.apache.jmeter.functions.InvalidVariableException) TestPlan(org.apache.jmeter.testelement.TestPlan) Arguments(org.apache.jmeter.config.Arguments) TestElement(org.apache.jmeter.testelement.TestElement) ResultCollector(org.apache.jmeter.reporters.ResultCollector)

Example 8 with ResultCollector

use of org.apache.jmeter.reporters.ResultCollector in project jmeter by apache.

the class MailerVisualizer method createTestElement.

/**
     * Makes MailerVisualizer storable.
     */
@Override
public TestElement createTestElement() {
    ResultCollector model = getModel();
    if (model == null) {
        model = new MailerResultCollector();
        setModel(model);
    }
    modifyTestElement(model);
    return model;
}
Also used : MailerResultCollector(org.apache.jmeter.reporters.MailerResultCollector) MailerResultCollector(org.apache.jmeter.reporters.MailerResultCollector) ResultCollector(org.apache.jmeter.reporters.ResultCollector)

Aggregations

ResultCollector (org.apache.jmeter.reporters.ResultCollector)8 File (java.io.File)2 Arguments (org.apache.jmeter.config.Arguments)2 MailerResultCollector (org.apache.jmeter.reporters.MailerResultCollector)2 TestPlan (org.apache.jmeter.testelement.TestPlan)2 SearchByClass (org.apache.jorphan.collections.SearchByClass)2 ConversionException (com.thoughtworks.xstream.converters.ConversionException)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 SocketException (java.net.SocketException)1 Date (java.util.Date)1 LinkedList (java.util.LinkedList)1 StringTokenizer (java.util.StringTokenizer)1 MessagingException (javax.mail.MessagingException)1 AddressException (javax.mail.internet.AddressException)1 Argument (org.apache.jmeter.config.Argument)1 GenericController (org.apache.jmeter.control.GenericController)1 ReplaceableController (org.apache.jmeter.control.ReplaceableController)1 ClientJMeterEngine (org.apache.jmeter.engine.ClientJMeterEngine)1