public class LoadcoderGeneratorBuilder extends Object
| Constructor and Description |
|---|
LoadcoderGeneratorBuilder(String pathToHARFile,
List<String> urlBeginningsWhiteList,
String javaPackage,
String packagePath,
String resourcesPath)
Create the generator Builder with this constructor.
|
| Modifier and Type | Method and Description |
|---|---|
LoadcoderGeneratorBuilder |
allowCodeOverWriting()
Allow to overwrite already existing Java classes.
|
LoadcoderGeneratorBuilder |
checkResponseBodiesContaining(List<String> expectedResponseBodyParts)
Sets a list of expected parts of response bodies.
|
void |
generate() |
LoadcoderGeneratorBuilder |
load(long executionDurationMillis,
int amountOfThreads,
int callsPerSecond)
Set a load definition.
|
LoadcoderGeneratorBuilder |
sendResultTo(com.loadcoder.network.CodeGeneratable codeModifier)
Sets a CodeGeneratable to modify the code for Loadbuilder method
storeAndConsumeResultRuntime |
public LoadcoderGeneratorBuilder(String pathToHARFile, List<String> urlBeginningsWhiteList, String javaPackage, String packagePath, String resourcesPath)
generate method when the builder is ready to generate the load
test.pathToHARFile - the path to where the HAR file exists.urlBeginningsWhiteList - list of beginnings of URLs that the generator will create transactions for.
If the value is null, all urls will be accepted to use for transaction call generationsjavaPackage - the java package where the Java code shall be created, for instance com.company.loadtests.
This value shall correlate with the value for argument packagePath.packagePath - the path to where the java the Java code shall be created,
for instance src/test/java/com/company/loadtests. This value shall correlate with the value
for argument javaPackage.resourcesPath - the path where to resources shall be created. Typically for Maven projects, this would
be directory src/test/resources/my-loadtest. Thepublic void generate()
public LoadcoderGeneratorBuilder load(long executionDurationMillis, int amountOfThreads, int callsPerSecond)
.amountOfThreads(3)
.stopDecision(duration(120 * SECOND))
.throttle(5, PER_SECOND, SHARED)
executionDurationMillis - duration of the generated test executionamountOfThreads - the amount of threads the generated test will
usecallsPerSecond - calls per second the generated test will
performpublic LoadcoderGeneratorBuilder sendResultTo(com.loadcoder.network.CodeGeneratable codeModifier)
storeAndConsumeResultRuntimecodeModifier - That takes the unchanged code as argument, and returns an
updated versionpublic LoadcoderGeneratorBuilder checkResponseBodiesContaining(List<String> expectedResponseBodyParts)
handleResult method that will verify whether or not the body
contains the expected body parts.expectedResponseBodyParts - the list of body part that shall be expected
as a part of one or more response bodies
during the load test.public LoadcoderGeneratorBuilder allowCodeOverWriting()
Copyright © 2021. All rights reserved.