public class DslTestPlan extends TestElementContainer<DslTestPlan,DslTestPlan.TestPlanChild>
| Modifier and Type | Class and Description |
|---|---|
static class |
DslTestPlan.CodeBuilder |
static interface |
DslTestPlan.TestPlanChild
Test elements that can be added directly as test plan children in JMeter should implement this
interface.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
serializeThreadGroups |
protected boolean |
tearDownOnlyAfterMainThreadsDone |
childrenguiClass, name| Constructor and Description |
|---|
DslTestPlan(List<DslTestPlan.TestPlanChild> children) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.jmeter.testelement.TestElement |
buildTestElement() |
DslTestPlan |
children(DslTestPlan.TestPlanChild... children)
Allows adding additional children elements to a test plan.
|
static DslTestPlan |
fromJmx(String filePath)
Loads a test plan from the given JMX to be able to run it in embedded engine.
|
TestPlanStats |
run()
Uses
EmbeddedJmeterEngine to run the test plan. |
TestPlanStats |
runIn(DslJmeterEngine engine)
Allows to run the test plan in a given engine.
|
void |
saveAsJmx(String filePath)
Saves the given test plan as JMX, which allows it to be loaded in JMeter GUI.
|
DslTestPlan |
sequentialThreadGroups()
Specifies to run thread groups one after the other, instead of running them in parallel.
|
DslTestPlan |
sequentialThreadGroups(boolean enable)
Specifies to run thread groups one after the other, instead of running them in parallel.
|
void |
showInGui()
Shows the test element in it's defined GUI in a popup window.
|
DslTestPlan |
tearDownOnlyAfterMainThreadsDone()
Allows running tear down thread groups only after main thread groups ends cleanly (due to
iterations or time limit).
|
DslTestPlan |
tearDownOnlyAfterMainThreadsDone(boolean enabled)
Allows running tear down thread groups only after main thread groups ends cleanly (due to
iterations or time limit).
|
buildTreeUnderbuildConfiguredTestElement, buildTestElementGui, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showTestElementGuiprotected boolean serializeThreadGroups
protected boolean tearDownOnlyAfterMainThreadsDone
public DslTestPlan(List<DslTestPlan.TestPlanChild> children)
public DslTestPlan sequentialThreadGroups()
public DslTestPlan sequentialThreadGroups(boolean enable)
Same as sequentialThreadGroups() but allowing to enable/disable the setting during
runtime.
enable - specifies to run thread groups one after the other when set to true, or in
parallel when false. By default, is set to false.public DslTestPlan tearDownOnlyAfterMainThreadsDone()
By default, JMeter automatically executes tear down thread groups when a test plan stops due to unscheduled event like sample error when stop test is configured in thread group, invocation of `ctx.getEngine().askThreadsToStop()` in jsr223 element, etc. This method allows to disable such behavior not running teardown thread groups in such cases, which might be helpful if teardown thread group has only to run on clean test plan completion.
public DslTestPlan tearDownOnlyAfterMainThreadsDone(boolean enabled)
By default, JMeter automatically executes tear down thread groups when a test plan stops due to unscheduled event like sample error when stop test is configured in thread group, invocation of `ctx.getEngine().askThreadsToStop()` in jsr223 element, etc. This method allows to disable such behavior not running teardown thread groups in such cases, which might be helpful if teardown thread group has only to run on clean test plan completion.
protected org.apache.jmeter.testelement.TestElement buildTestElement()
buildTestElement in class BaseTestElementpublic TestPlanStats run() throws IOException
EmbeddedJmeterEngine to run the test plan.TestPlanStats containing all statistics of the test plan execution.IOException - thrown when there is some problem running the plan.public TestPlanStats runIn(DslJmeterEngine engine) throws IOException, InterruptedException, TimeoutException
This method is just a simple method which provides fluent API to run the test plans in a given engine.
IOExceptionInterruptedExceptionTimeoutExceptionDslJmeterEngine.run(DslTestPlan)public void showInGui()
DslTestElementshowInGui in interface DslTestElementshowInGui in class BaseTestElementpublic void saveAsJmx(String filePath) throws IOException
filePath - specifies where to store the JMX of the test plan.IOException - when there is a problem saving to the file.public static DslTestPlan fromJmx(String filePath) throws IOException
filePath - specifies the path where the JMX file is located.IOException - when there is a problem loading to the file.public DslTestPlan children(DslTestPlan.TestPlanChild... children)
This might be helpful for adding elements to a test plan loaded from a JMX file (like adding htmlReport, resultsTreeVisualizer or dashboard) or if you want to create a test plan and then incrementally adding children to it.
children in class TestElementContainer<DslTestPlan,DslTestPlan.TestPlanChild>children - elements to add to the test plan.Copyright © 2024. All rights reserved.