public class LoadTestGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
LoadTestGenerator.BodyMatcher |
protected static class |
LoadTestGenerator.TransactionNameGenerator |
| Modifier and Type | Method and Description |
|---|---|
void |
checkNoColidingFilesExists() |
void |
gen() |
protected static void |
generate(String pathToHARFile,
List<String> acceptableUrlStarts,
String javaPackage,
String destinationJavaCodeDir,
String destinationResourceDir,
boolean allowOverwritingExistingFiles,
com.loadcoder.network.CodeGeneratable reporting,
com.loadcoder.network.CodeGeneratable loadBuilder,
List<String> bodyMatchers)
Generate a Loadcoder test based from a har file.
|
static String |
generateCodeLoadBuilder(String originalCode,
long durationMilliseconds,
int amountOfThreads,
int callsPerSecond) |
LoadMethod |
generateLoadMethod(de.sstoehr.harreader.model.HarEntry entry,
LoadTestGenerator.TransactionNameGenerator transactionNameGenerator,
int transactionIterator,
File resourceDstDir,
List<de.sstoehr.harreader.model.HarHeader> heads) |
void |
generateScenario(List<de.sstoehr.harreader.model.HarEntry> entries,
File javaDstDir,
File resourceDstDir) |
void |
generateTest(File dstDir) |
void |
generateThreadInstance(File dstDir) |
protected static Matcher |
getDefaultMatcher(List<String> urlShallStartWithOneOfThese) |
protected static String |
getPossibleFilenameExtension(String url) |
protected static boolean |
isFilenameExtensionAKeeper(String filenameExtension) |
protected static boolean |
isStringQualifiedFilenameExtension(String partToUse) |
protected static void |
printAllURLs(String pathToHARFile) |
static de.sstoehr.harreader.model.Har |
readHar(String pathToHARFile) |
protected static String |
removeBasePathOfUrl(String url) |
void |
sortHarEntries(List<de.sstoehr.harreader.model.HarEntry> entries) |
protected static boolean isStringQualifiedFilenameExtension(String partToUse)
protected static Matcher getDefaultMatcher(List<String> urlShallStartWithOneOfThese)
protected static boolean isFilenameExtensionAKeeper(String filenameExtension)
protected static void printAllURLs(String pathToHARFile)
public void sortHarEntries(List<de.sstoehr.harreader.model.HarEntry> entries)
protected static void generate(String pathToHARFile, List<String> acceptableUrlStarts, String javaPackage, String destinationJavaCodeDir, String destinationResourceDir, boolean allowOverwritingExistingFiles, com.loadcoder.network.CodeGeneratable reporting, com.loadcoder.network.CodeGeneratable loadBuilder, List<String> bodyMatchers)
pathToHARFile - the path to where the har file is located. A
har file is a file with http requests and
response, that can be recorded from various
internet browsers and proxy servers.acceptableUrlStarts - Whitelist for acceptable starts of urls that
should be a part of the generated tests. Most
time you don't want to generate a load test
containing all the request from the har file.
You probably want to filter out some of the
requests that isn't a part of the scope for the
test.javaPackage - the java package as a string value. This value
shall correlate with the argument
destinationJavaCodeDirdestinationJavaCodeDir - the destination package to where the load test
Java files shall be generated. This shall
correlate with the argument for the package
destinationJavaCodeDirdestinationResourceDir - the destination directory to where resource
files for the load test shall be generatedreporting - CodeTemplateModifier for how to generate the
code for performing the
storeAndConsumeResultRuntime callloadBuilder - CodeTemplateModifier for how to generate the
code for the loadBuilder methodspublic void gen()
public void checkNoColidingFilesExists()
public void generateScenario(List<de.sstoehr.harreader.model.HarEntry> entries, File javaDstDir, File resourceDstDir)
public void generateTest(File dstDir)
public void generateThreadInstance(File dstDir)
public LoadMethod generateLoadMethod(de.sstoehr.harreader.model.HarEntry entry, LoadTestGenerator.TransactionNameGenerator transactionNameGenerator, int transactionIterator, File resourceDstDir, List<de.sstoehr.harreader.model.HarHeader> heads)
public static de.sstoehr.harreader.model.Har readHar(String pathToHARFile)
Copyright © 2021. All rights reserved.