abstracta / jmeter-java-dsl

Simple JMeter performance tests API
https://abstracta.github.io/jmeter-java-dsl/
Apache License 2.0
476 stars 58 forks source link

add opportunity use method csvDataSet() into jar with tests #282

Open Rutkovski opened 4 weeks ago

Rutkovski commented 4 weeks ago

Hello! I didn't find opportunity to use method csvDataSet() with argument inputStream or something like this Users cases: I want package and run tests with resourses into jar. Now, if i make jar and try run it, jmeter can't find path to file (even if i use TestResourses class) I would like use something like InputStream in = getClass().getResourceAsStream("/file.txt"); csvDataSet(in); Example for applying jar is use it into production environment where is no way to get dependencies.

rabelenda commented 2 weeks ago

Hello, thank you for contacting and asking about this.

Can you provide some example project and more details to try to understand why something like this doesn't work?:

TestPlanStats stats = testPlan(
        threadGroup(1, 1,
            csvDataSet(testResource("data.csv")),
            httpSampler("https://abstracta.us/?user=${USER}")
        )
    ).run();