public class EmbeddedJmeterEngine extends Object implements DslJmeterEngine
| Modifier and Type | Class and Description |
|---|---|
static class |
EmbeddedJmeterEngine.TestRunner |
| Constructor and Description |
|---|
EmbeddedJmeterEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addStatsCollector(org.apache.jorphan.collections.HashTree testPlanTree,
TestPlanStats stats) |
void |
awaitAllClosedVisualizers(List<Future<Void>> closedVisualizers) |
protected EmbeddedJmeterEngine.TestRunner |
buildTestRunner(org.apache.jorphan.collections.HashTree testPlanTree,
org.apache.jorphan.collections.HashTree rootTree) |
EmbeddedJmeterEngine |
prop(String name,
Object value)
Allows setting properties to be used during test plan execution.
|
EmbeddedJmeterEngine |
propertiesFile(String propsFile)
Allows specifying a properties file path to get properties from.
|
TestPlanStats |
run(DslTestPlan testPlan)
Runs the given test plan obtaining the execution metrics.
|
protected TestPlanStats |
runInEnv(DslTestPlan testPlan,
JmeterEnvironment env) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitextractFirstThreadGrouppublic EmbeddedJmeterEngine prop(String name, Object value)
This is an alternate to using System.setProperty(String, String) but that also works
with
props['PROP_NAME']and
props.get('PROP_NAME') in groovy code, in
addition to allowing to set arbitrary objects (and not just strings). This properties
additionally don't alter the JVM properties, which is preferable to improve tests isolation.
Setting arbitrary objects might be helpful to pass some object that can be reused by all threads in test plan (eg: a cache).
name - specifies the name of the property, used by test plan to access the associated
value.value - specifies a value to store associated to the name.public EmbeddedJmeterEngine propertiesFile(String propsFile)
This is handy when different properties are required for different runs (eg: different environments).
This is an alternative to prop(String, Object) which is handy for setting a small set
of properties, or set them programmatically.
propsFile - is the path to the properties file to load.public TestPlanStats run(DslTestPlan testPlan) throws IOException
DslJmeterEngineThis method blocks execution until the test plan execution ends.
run in interface DslJmeterEnginetestPlan - to run in the JMeter engine.IOException - when there is a problem with an IO operation.protected TestPlanStats runInEnv(DslTestPlan testPlan, JmeterEnvironment env) throws IOException
IOExceptionprotected void addStatsCollector(org.apache.jorphan.collections.HashTree testPlanTree,
TestPlanStats stats)
protected EmbeddedJmeterEngine.TestRunner buildTestRunner(org.apache.jorphan.collections.HashTree testPlanTree, org.apache.jorphan.collections.HashTree rootTree)
Copyright © 2023. All rights reserved.