AndrasCsanyi
AndrasCsanyi

Reputation: 4255

What is the type of props in JMeter's world?

I'm writing my test cases in JMeter and I'm at the point when information should be passed between threads. The only thing I don't know is the type of props, so I can't use it easily in my Groovy code.

What is the type of props?

My groovy code looks like this:

class NiceGroovyClass {

    JMeterVariables vars
    Logger log
    <props.type???> props

    ConfigurationManager(
            Logger log,
            JMeterVariables vars,
            <props.type???> props) {
        this.vars = vars
        this.log = log
        this.props = props
    }
}

Upvotes: 0

Views: 200

Answers (2)

Dmitri T
Dmitri T

Reputation: 168122

In Groovy you can use the following methods to get information on an arbitrary object:

Example output:

enter image description here

So props is basically an instance of java.util.Properties

Check out Top 8 JMeter Java Classes You Should Be Using with Groovy article to learn more about the most popular JMeter API shorthands available from JSR223 test elements

Upvotes: 1

tim_yates
tim_yates

Reputation: 171144

The documentation shows that it is a java.util.Properties instance

props (JMeterProperties - class java.util.Properties) - e.g. props.get("START.HMS"); props.put("PROP1","1234");

You could always check the result of props.getClass().toString() to validate this

Upvotes: 2

Related Questions