Package org.frankframework.larva
Class LarvaTool
java.lang.Object
org.frankframework.larva.LarvaTool
- Author:
- Jaco de Groot
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean
static final int
protected static int
static final int
static final int
static final int
protected static final Message
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAbsolutePathProperties
(String propertiesDirectory, Properties properties) canonicaliseFilePathContentBetweenKeys
(String string, String key1, String key2) int
compareResult
(String step, String stepDisplayName, String fileName, Message expectedResultMessage, Message actualResultMessage, Properties properties) createParametersMapFromParamProperties
(Properties properties) Create a Map for a specific property based on other properties that are the same except for a .param1.name, .param1.value or .param1.valuefile suffix.void
debugMessage
(String message) void
debugPipelineMessage
(String stepDisplayName, String message, String pipelineMessage) void
debugPipelineMessage
(String stepDisplayName, String message, Message pipelineMessage) void
debugPipelineMessagePreparedForDiff
(String stepDisplayName, String message, String pipelineMessage) decodeUnzipContentBetweenKeys
(String string, String key1, String key2, boolean replaceNewlines) doActionBetweenKeys
(String key, String value, Properties properties, Map<String, HashMap<String, HashMap<String, String>>> ignoreMap, LarvaTool.BetweenKeysAction action) doActionWithSingleKey
(String keyName, String value, Properties properties, Map<String, HashMap<String, HashMap<String, String>>> ignoreMap, LarvaTool.SingleKeyAction action) void
errorMessage
(String message) void
errorMessage
(String message, Exception exception) protected int
executeStep
(String step, Properties properties, String stepDisplayName, Map<String, LarvaScenarioAction> actions, String correlationId) findAttributesForIgnore
(String propertyName) This method is used to de-couple the need of providing a set of attributes when calling mapPropertiesByIdentifier().formatDecimalContentBetweenKeys
(String string, String key1, String key2) formatString
(String string) static String
getAbsolutePath
(String parent, String child) static String
getAbsolutePath
(String parent, String child, boolean addFileSeparator) Returns the absolute pathname for the child pathname.static String
ignoreContentAfterKey
(String string, String key) static String
ignoreContentBeforeKey
(String string, String key) static String
ignoreContentBetweenKeys
(String string, String key1, String key2) ignoreCurrentTimeBetweenKeys
(String string, String key1, String key2, String pattern, String margin, boolean errorMessageOnRemainingString, boolean isControlString) static String
static String
ignoreKeysAndContentBetweenKeys
(String string, String key1, String key2) static String
ignoreRegularExpression
(String string, String regex) initScenariosRootDirectories
(String paramScenariosRootDirectory, List<String> scenariosRootDirectories, List<String> scenariosRootDescriptions) mapPropertiesToIgnores
(Properties properties) This method is used to provide a way to implement ignores based on an identifier.prepareResultForCompare
(String input, Properties properties, Map<String, HashMap<String, HashMap<String, String>>> ignoreMap) void
printHtmlForm
(List<String> scenariosRootDirectories, List<String> scenariosRootDescriptions, String scenariosRootDirectory, AppConstants appConstants, List<File> scenarioFiles, int waitBeforeCleanUp, int timeout, String paramExecute) readProperties
(AppConstants appConstants, File propertiesFile) readProperties
(AppConstants appConstants, File propertiesFile, boolean root) readScenarioFiles
(AppConstants appConstants, String scenariosDirectory) static String
static String
removeKeysAndContentBetweenKeys
(String string, String key1, String key2) static String
removeRegularExpression
(String string, String regex) static String
replaceKey
(String string, String from, String to) static String
replaceRegularExpression
(String string, String from, String to) static int
runScenarios
(jakarta.servlet.ServletContext application, jakarta.servlet.http.HttpServletRequest request, Writer out) static int
runScenarios
(IbisContext ibisContext, jakarta.servlet.http.HttpServletRequest request, Writer out, boolean silent) int
runScenarios
(IbisContext ibisContext, String paramLogLevel, String paramAutoScroll, String paramMultithreaded, String paramExecute, String paramWaitBeforeCleanUp, int timeout, String paramScenariosRootDirectory, Writer out, boolean silent) void
scenariosAutosavedTotalMessage
(String message) void
scenariosFailedTotalMessage
(String message) void
scenariosPassedTotalMessage
(String message) void
scenariosTotalMessage
(String message) static void
setTimeout
(int newTimeout) void
warningMessage
(String message) void
void
write
(String html, boolean isHtmlType, LarvaLogLevel logLevel, boolean scroll) static void
void
void
writeLog
(String html, LarvaLogLevel logLevel, boolean scroll) void
wrongPipelineMessage
(String stepDisplayName, String message, String pipelineMessage, String pipelineMessageExpected) void
wrongPipelineMessage
(String message, Message pipelineMessage) void
wrongPipelineMessagePreparedForDiff
(String stepDisplayName, String pipelineMessagePreparedForDiff, String pipelineMessageExpectedPreparedForDiff)
-
Field Details
-
ERROR_NO_SCENARIO_DIRECTORIES_FOUND
public static final int ERROR_NO_SCENARIO_DIRECTORIES_FOUND- See Also:
-
TESTTOOL_CLEAN_UP_REPLY
-
RESULT_ERROR
public static final int RESULT_ERROR- See Also:
-
RESULT_OK
public static final int RESULT_OK- See Also:
-
RESULT_AUTOSAVED
public static final int RESULT_AUTOSAVED- See Also:
-
allowReadlineSteps
protected final boolean allowReadlineSteps- See Also:
-
globalTimeoutMillis
protected static int globalTimeoutMillis
-
-
Constructor Details
-
LarvaTool
public LarvaTool()
-
-
Method Details
-
setTimeout
public static void setTimeout(int newTimeout) -
runScenarios
public static int runScenarios(jakarta.servlet.ServletContext application, jakarta.servlet.http.HttpServletRequest request, Writer out) -
runScenarios
public static int runScenarios(IbisContext ibisContext, jakarta.servlet.http.HttpServletRequest request, Writer out, boolean silent) -
runScenarios
public int runScenarios(IbisContext ibisContext, String paramLogLevel, String paramAutoScroll, String paramMultithreaded, String paramExecute, String paramWaitBeforeCleanUp, int timeout, String paramScenariosRootDirectory, Writer out, boolean silent) - Returns:
- negative: error condition 0: all scenarios passed positive: number of scenarios that failed
-
printHtmlForm
-
write
-
writeHtml
-
writeLog
-
debugMessage
-
debugPipelineMessage
-
debugPipelineMessage
-
debugPipelineMessagePreparedForDiff
-
wrongPipelineMessage
-
wrongPipelineMessage
-
wrongPipelineMessagePreparedForDiff
-
scenariosTotalMessage
-
scenariosPassedTotalMessage
-
scenariosAutosavedTotalMessage
-
scenariosFailedTotalMessage
-
errorMessage
-
warningMessage
-
errorMessage
-
initScenariosRootDirectories
-
readScenarioFiles
-
readProperties
-
readProperties
@Nullable public Properties readProperties(AppConstants appConstants, File propertiesFile, boolean root) -
getAbsolutePath
-
getAbsolutePath
Returns the absolute pathname for the child pathname. The parent pathname is used as a prefix when the child pathname is an not absolute.- Parameters:
parent
- the parent pathname to usechild
- the child pathname to convert to a absolute pathname
-
addAbsolutePathProperties
-
executeStep
protected int executeStep(String step, Properties properties, String stepDisplayName, Map<String, LarvaScenarioAction> actions, String correlationId) -
windiff
public void windiff(String expectedFileName, String result, String expected) throws IOException, SenderException - Throws:
IOException
SenderException
-
writeFile
- Throws:
IOException
-
compareResult
-
prepareResultForCompare
-
doActionBetweenKeys
-
doActionWithSingleKey
-
ignoreContentBetweenKeys
-
ignoreKeysAndContentBetweenKeys
-
removeKeysAndContentBetweenKeys
-
ignoreKey
-
removeKey
-
replaceKey
-
decodeUnzipContentBetweenKeys
-
canonicaliseFilePathContentBetweenKeys
-
ignoreCurrentTimeBetweenKeys
-
formatDecimalContentBetweenKeys
-
ignoreContentBeforeKey
-
ignoreContentAfterKey
-
ignoreRegularExpression
-
removeRegularExpression
-
replaceRegularExpression
-
createParametersMapFromParamProperties
Create a Map for a specific property based on other properties that are the same except for a .param1.name, .param1.value or .param1.valuefile suffix. The property with the .name suffix specifies the key for the Map, the property with the value suffix specifies the value for the Map. A property with a the .valuefile suffix can be used as an alternative for a property with a .value suffix to specify the file to read the value for the Map from. More than one param can be specified by using param2, param3 etc.- Parameters:
properties
- Properties object from which to create the mapproperty
- Property name to use as base name- Returns:
- A map with parameters
-
formatString
-
mapPropertiesToIgnores
public static HashMap<String,HashMap<String, mapPropertiesToIgnoresHashMap<String, String>>> (Properties properties) This method is used to provide a way to implement ignores based on an identifier. For example: ignoreContentBetweenKeys.fieldA.key1=ignoreContentBetweenKeys.fieldA.key2= - Parameters:
properties
- Properties to be checked- Returns:
- HashMapinvalid input: '<'String, HashMapinvalid input: '<'String, HashMapinvalid input: '<'String, String>>> as HashMapinvalid input: '<''ignoreContentBetweenKeys', Hashmapinvalid input: '<''fieldA', HashMapinvalid input: '<''key1', '
'>
-
findAttributesForIgnore
This method is used to de-couple the need of providing a set of attributes when calling mapPropertiesByIdentifier(). Caller of mapPropertiesByIdentifier() should not necessarily know about all attributes related to an ignore.- Parameters:
propertyName
- The name of the ignore we are checking, in the example 'ignoreContentBetweenKeys'
-