Package flexagon.fd.core.workflow
Class MockWorkflowExecutionContext
java.lang.Object
flexagon.ff.common.core.pojos.BasePOJO
flexagon.fd.core.workflow.WorkflowExecutionContext
flexagon.fd.core.workflow.MockWorkflowExecutionContext
- All Implemented Interfaces:
Serializable,Cloneable
MockWorkflowExecutionContext is used for testing plugins.
MockWorkflowExecutionContext sets up the file structure necessary for a project.
Please set Java Option: -Dflexagon.fd.install.root to the path where the folders will be created. The directories are created like this: flexagon.fd.install.root\ work \ 1 \ 1 \ temp,artifacts,etc. You can modify execution folders by changing Project Id and/or WorkflowExecutionId.
Add properties and input by calling various add methods.
Change Environment and Instance code by calling set methods if necessary.
It is recommended to set flexagon.fd.install.root to a unique path for each plugin developed.
- See Also:
-
Field Summary
Fields inherited from class flexagon.fd.core.workflow.WorkflowExecutionContext
mUnfilteredPackageObjectList -
Constructor Summary
ConstructorsConstructorDescriptionCreate a MockWorkflowExecutionContext with no inputs.MockWorkflowExecutionContext(Map<String, PropertyValue> pInputs) Create a MockWorkflowExecutionContext with no inputs. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBooleanCurrentInstanceProperty(String pKey, Boolean pValue) voidaddBooleanInput(String pKey, Boolean pValue) voidaddBooleanInstanceProperty(String pInstanceCode, String pKey, Boolean pValue) voidaddBooleanProjectProperty(String pKey, Boolean pValue) voidaddDoubleCurrentInstanceProperty(String pKey, Double pValue) voidaddDoubleInput(String pKey, Double pValue) voidaddDoubleInstanceProperty(String pInstanceCode, String pKey, Double pValue) voidaddDoubleProjectProperty(String pKey, Double pValue) voidaddIntegerCurrentInstanceProperty(String pKey, Integer pValue) voidaddIntegerInput(String pKey, Integer pValue) voidaddIntegerInstanceProperty(String pInstanceCode, String pKey, Integer pValue) voidaddIntegerProjectProperty(String pKey, Integer pValue) voidaddStringCurrentInstanceProperty(String pKey, String pValue) voidaddStringInput(String pKey, String pValue) voidaddStringInstanceProperty(String pInstanceCode, String pKey, String pValue) voidaddStringProjectProperty(String pKey, String pValue) voidvoidvoidvoidvoidvoidvoidvoidvoidThis cleans all the directories inside the Working directory as well.getInstallPluginsDirectory(String pluginName, String pluginVersion) Returns the plugin installation sub-directory for the given plugin name and plugin version.booleanvoidmkdirs()voidsetEnvironmentCode(String pCode) voidsetInstanceCode(String pCode) voidsetIsWindows(boolean pIsWindows) voidsetOrginatingWorkflowExecutionId(Long pOrginatingWorkflowExecutionId) INTERNAL USE ONLYvoidsetProjectId(Long pProjectId) voidsetWorkflowExecutionId(Long pWorkflowExecutionId) INTERNAL USE ONLYMethods inherited from class flexagon.fd.core.workflow.WorkflowExecutionContext
addProperty, addProperty, clone, copyState, getArtifactsDirectory, getBackupsDirectory, getBaseInstallDirectory, getBaseWorkingDirectory, getCommits, getEnvironment, getInput, getInputMap, getInstallPluginsDirectory, getInstance, getInternalDirectory, getIssues, getLastEndPoint, getMainInstance, getObjectResultsDirectory, getOrginatingWorkflowExecutionId, getOutputMap, getPackageObjects, getPluginExecutionId, getPrintablePropertyValue, getPrintablePropertyValue, getProject, getProjectSourcesDirectory, getProperties, getPropertyDefinitions, getPropertyValue, getPropertyValue, getPropertyValueOrDefault, getPropertyValueOrDefault, getReportsDirectory, getScanResultsDirectory, getTempDirectory, getTestResultsDirectory, getTransferDirectory, getUnfilteredPackageObjectList, getWorkflowExecutionId, getWorkflowExecutionState, getWorkflowRequestId, getWorkflowType, getWorkingDirectory, isBuildWorkflow, isConsumesArtifacts, isDeployOrPreDeployWorkflow, isDeployOrUtilityWorkflow, isDeployWorkflow, isForceDeploy, isPostRefresh, isPreDeployWorkflow, isProducesArtifacts, isSyncStateWorkflow, isTestWorkflow, isUtilityWorkflow, setBaseInstallDirectory, setCommits, setConsumesArtifacts, setEnvironment, setForceDeploy, setInstance, setIssues, setLastEndPoint, setMainInstance, setOutput, setPackageObjects, setPluginExecutionId, setPostRefresh, setProducesArtifacts, setProject, setProperties, setPropertyDefinitions, setUnfilteredPackageObjectList, setWorkflowRequestId, setWorkflowType, toString
-
Constructor Details
-
MockWorkflowExecutionContext
public MockWorkflowExecutionContext()Create a MockWorkflowExecutionContext with no inputs. Properties are added later. -
MockWorkflowExecutionContext
Create a MockWorkflowExecutionContext with no inputs. Properties are added later.
-
-
Method Details
-
setProjectId
-
setWorkflowExecutionId
Description copied from class:WorkflowExecutionContextINTERNAL USE ONLY- Overrides:
setWorkflowExecutionIdin classWorkflowExecutionContext
-
setOrginatingWorkflowExecutionId
Description copied from class:WorkflowExecutionContextINTERNAL USE ONLY- Overrides:
setOrginatingWorkflowExecutionIdin classWorkflowExecutionContext
-
mkdirs
public void mkdirs() -
cleanTempDirectory
- Throws:
FlexCheckedException
-
cleanArtifactsDirectory
- Throws:
FlexCheckedException
-
cleanInternalDirectory
- Throws:
FlexCheckedException
-
cleanTransferDirectory
- Throws:
FlexCheckedException
-
cleanObjectResultsDirectory
- Throws:
FlexCheckedException
-
cleanScanResultsDirectory
- Throws:
FlexCheckedException
-
cleanTestResultsDirectory
- Throws:
FlexCheckedException
-
cleanReportsDirectory
- Throws:
FlexCheckedException
-
cleanWorkingDirectory
This cleans all the directories inside the Working directory as well. This includes all other directories.- Throws:
FlexCheckedException
-
isWindows
public boolean isWindows()- Overrides:
isWindowsin classWorkflowExecutionContext
-
setIsWindows
public void setIsWindows(boolean pIsWindows) -
addBooleanInput
-
addDoubleInput
-
addIntegerInput
-
addStringInput
-
addBooleanCurrentInstanceProperty
-
addDoubleCurrentInstanceProperty
-
addIntegerCurrentInstanceProperty
-
addStringCurrentInstanceProperty
-
addBooleanInstanceProperty
-
addDoubleInstanceProperty
-
addIntegerInstanceProperty
-
addStringInstanceProperty
-
addBooleanProjectProperty
-
addDoubleProjectProperty
-
addIntegerProjectProperty
-
addStringProjectProperty
-
setInstanceCode
-
setEnvironmentCode
-
getInstallPluginsDirectory
Description copied from class:WorkflowExecutionContextReturns the plugin installation sub-directory for the given plugin name and plugin version. This directory is located in the following path on the endpoint:
[plugin installation directory]/[plugin name]/[plugin version]
- Overrides:
getInstallPluginsDirectoryin classWorkflowExecutionContext- Parameters:
pluginName- the name of the pluginpluginVersion- the plugin version- Returns:
- the plugin installation directory for a specific plugin name and version
-