Class BaseJob
- java.lang.Object
-
- com.vectorcast.plugins.vectorcastexecution.job.BaseJob
-
- Direct Known Subclasses:
NewPipelineJob
,NewSingleJob
public abstract class BaseJob extends Object
Base job management - create/delete/update
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseJob(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, boolean useSavedData)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addArchiveArtifacts(hudson.model.Project project)
Add archive artifacts stepprotected void
addCopyResultsToImport(hudson.model.Project project)
Add archive artifacts stepprotected void
addCredentialID(hudson.model.Project project)
protected void
addDeleteWorkspaceBeforeBuildStarts(hudson.model.Project project)
Add the delete workspace before build starts optionprotected void
addJunit(hudson.model.Project project)
Add JUnit rules stepprotected void
addPCLintPlus(hudson.model.Project project)
Add PC-Lint Plus stepprotected VectorCASTSetup
addSetup(hudson.model.Project project)
Add the VectorCAST setup step to copy the python scripts to the workspaceprotected void
addVCCoverage(hudson.model.Project project)
Add VectorCAST coverage reporting stepprotected abstract void
cleanupProject()
Cleanup top-level project, as in deletevoid
create(boolean update)
Create the job(s)protected abstract hudson.model.Project
createProject()
Create top-level projectprotected abstract void
doCreate(boolean update)
Do create of project detailsprotected String
getBaseName()
Get base name of manage projectprotected String
getEnvironmentSetupUnix()
Get environment setup for unixprotected String
getEnvironmentSetupWin()
Get environment setup for windowsprotected String
getEnvironmentTeardownUnix()
Get environment tear down for unixprotected String
getEnvironmentTeardownWin()
Get environment tear down for windowsprotected String
getExecutePreambleUnix()
Get execute preamble for unixprotected String
getExecutePreambleWin()
Get execute preamble for windowsprotected String
getExternalResultsFilename()
Get option to Use as external result filenameprotected jenkins.model.Jenkins
getInstance()
Get Jenkins instanceprotected String
getJobName()
Get the user-specified job nameprotected String
getManageProjectName()
Get manage project nameprotected Long
getMaxParallel()
Get for maxParallel to control maximum number of jobs to be queue at at any one pointprotected String
getNodeLabel()
Get node labelprotected boolean
getOptionClean()
Get option to clean workspace before buildprotected String
getOptionErrorLevel()
Get error levelprotected boolean
getOptionExecutionReport()
Use execution reportprotected String
getOptionHTMLBuildDesc()
Use HTML Build Descriptionprotected boolean
getOptionUseReporting()
Get use Jenkins reporting optionprotected String
getPclpCommand()
Get pc-lint plus commandprotected String
getPclpResultsPattern()
Get pc-lint plus result patternprotected org.kohsuke.stapler.StaplerRequest
getRequest()
Get requestprotected org.kohsuke.stapler.StaplerResponse
getResponse()
Get responseprotected String
getSquoreCommand()
Get command for running Squoreprotected String
getTESTinsights_credentials_id()
Get Credentials for TESTinsightsprotected String
getTESTinsights_project()
Get Project for TESTinsightsprotected String
getTESTinsights_proxy()
Get Proxy for TESTinsightsprotected String
getTESTinsights_SCM_Tech()
Get SCM Technology TESTinsightsprotected String
getTESTinsights_SCM_URL()
Get SCM URL for TESTinsightsprotected String
getTESTinsights_URL()
Get URL for TESTinsightsprotected hudson.model.Project
getTopProject()
Get top-level projectprotected boolean
getUseCILicenses()
Get option to use CI licensesprotected String
getUseCILicensesUnix()
protected String
getUseCILicensesWin()
Get environment setup for windowsprotected boolean
getUseCoverageHistory()
Get option to Use coverage history to control build statusprotected boolean
getUseExternalImportedResults()
Get option to Use external imported resultsprotected boolean
getUseImportedResults()
Get option to Use imported resultsprotected boolean
getUseLocalImportedResults()
Get option to Use local imported resultsprotected boolean
getUseStrictTestcaseImport()
Get option to Use strict testcase importprotected Long
getWaitLoops()
Get the number of wait loopsprotected Long
getWaitTime()
Get the time to wait between retriesprotected boolean
isUsingSCM()
Using some form of SCMprotected void
setEnvironmentSetupUnix(String environmentSetupUnix)
Set environment setup for unixprotected void
setEnvironmentSetupWin(String environmentSetupWin)
Set environment setup for windowsprotected void
setEnvironmentTeardownUnix(String environmentTeardownUnix)
Set environment teardown for unixprotected void
setEnvironmentTeardownWin(String environmentTeardownWin)
Set environment tear down for windowsprotected void
setExecutePreambleUnix(String executePreambleUnix)
Set execute preamble for unixprotected void
setExecutePreambleWin(String executePreambleWin)
Set execute preamble for windowsprotected void
setExternalResultsFilename(String externalResultsFilename)
Set option to Use imported resultsprotected void
setMaxParallel(Long maxParallel)
Set option for maxParallel to control maximum number of jobs to be queue at at any one pointprotected void
setOptionClean(boolean optionClean)
Set option to clean workspace before buildprotected void
setOptionErrorLevel(String optionErrorLevel)
Set option error levelprotected void
setOptionExecutionReport(boolean optionExecutionReport)
Set use execution reportprotected void
setOptionHTMLBuildDesc(String optionHtmlBuildDesc)
Set use HTML Build descriptionprotected void
setOptionUseReporting(boolean optionUseReporting)
Set use Jenkins reporting optionprotected void
setTESTinsights_project(String TESTinsights_project)
Set Project for TESTinsightsprotected void
setTESTinsights_SCM_Tech(String TESTinsights_SCM_Tech)
Set SCM Technology TESTinsightsprotected void
setTESTinsights_SCM_URL(String TESTinsights_SCM_URL)
Set SCM URL for TESTinsightsprotected void
setUseCILicenses(boolean useCILicenses)
Set option to use CI licensesprotected void
setUseCoverageHistory(boolean useCoverageHistory)
Set option to Use coverage history to control build statusprotected void
setUseExternalImportedResults(boolean useExternalImportedResults)
Set option to Use imported resultsprotected void
setUseImportedResults(boolean useImportedResults)
Set option to Use imported resultsprotected void
setUseLocalImportedResults(boolean useLocalImportedResults)
Set option to Use imported resultsprotected void
setUseStrictTestcaseImport(boolean useStrictTestcaseImport)
Set option to Use strict testcase importprotected void
setUsingSCM(boolean usingSCM)
Set using some form of SCMvoid
useSavedData(VectorCASTSetup savedData)
Use Saved Data
-
-
-
Constructor Detail
-
BaseJob
protected BaseJob(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response, boolean useSavedData) throws javax.servlet.ServletException, IOException, ExternalResultsFileException
Constructor- Parameters:
request
- request objectresponse
- response objectuseSavedData
- use saved data true/false- Throws:
javax.servlet.ServletException
- exceptionIOException
- exceptionExternalResultsFileException
- exception
-
-
Method Detail
-
useSavedData
public void useSavedData(VectorCASTSetup savedData)
Use Saved Data- Parameters:
savedData
- saved data to use
-
isUsingSCM
protected boolean isUsingSCM()
Using some form of SCM- Returns:
- true or false
-
setUsingSCM
protected void setUsingSCM(boolean usingSCM)
Set using some form of SCM- Parameters:
usingSCM
- true/false
-
getEnvironmentSetupWin
protected String getEnvironmentSetupWin()
Get environment setup for windows- Returns:
- setup
-
setEnvironmentSetupWin
protected void setEnvironmentSetupWin(String environmentSetupWin)
Set environment setup for windows- Parameters:
environmentSetupWin
- windows environment setup
-
getExecutePreambleWin
protected String getExecutePreambleWin()
Get execute preamble for windows- Returns:
- preamble
-
setExecutePreambleWin
protected void setExecutePreambleWin(String executePreambleWin)
Set execute preamble for windows- Parameters:
executePreambleWin
- execute preamble for windows
-
getEnvironmentTeardownWin
protected String getEnvironmentTeardownWin()
Get environment tear down for windows- Returns:
- environment tear down for windows
-
setEnvironmentTeardownWin
protected void setEnvironmentTeardownWin(String environmentTeardownWin)
Set environment tear down for windows- Parameters:
environmentTeardownWin
- environment tear down for windows
-
getEnvironmentSetupUnix
protected String getEnvironmentSetupUnix()
Get environment setup for unix- Returns:
- environment setup
-
setEnvironmentSetupUnix
protected void setEnvironmentSetupUnix(String environmentSetupUnix)
Set environment setup for unix- Parameters:
environmentSetupUnix
- environment setup for unix
-
getExecutePreambleUnix
protected String getExecutePreambleUnix()
Get execute preamble for unix- Returns:
- preamble
-
setExecutePreambleUnix
protected void setExecutePreambleUnix(String executePreambleUnix)
Set execute preamble for unix- Parameters:
executePreambleUnix
- execute preamble for unix
-
getEnvironmentTeardownUnix
protected String getEnvironmentTeardownUnix()
Get environment tear down for unix- Returns:
- teardown
-
setEnvironmentTeardownUnix
protected void setEnvironmentTeardownUnix(String environmentTeardownUnix)
Set environment teardown for unix- Parameters:
environmentTeardownUnix
- environment tear down for unix
-
getOptionUseReporting
protected boolean getOptionUseReporting()
Get use Jenkins reporting option- Returns:
- true to use, false to not
-
setOptionUseReporting
protected void setOptionUseReporting(boolean optionUseReporting)
Set use Jenkins reporting option- Parameters:
optionUseReporting
- true to use, false to not
-
getOptionErrorLevel
protected String getOptionErrorLevel()
Get error level- Returns:
- Unstable or Failure
-
setOptionErrorLevel
protected void setOptionErrorLevel(String optionErrorLevel)
Set option error level- Parameters:
optionErrorLevel
- Unstable or Failure
-
getOptionHTMLBuildDesc
protected String getOptionHTMLBuildDesc()
Use HTML Build Description- Returns:
- HTML or TEXT
-
setOptionHTMLBuildDesc
protected void setOptionHTMLBuildDesc(String optionHtmlBuildDesc)
Set use HTML Build description- Parameters:
optionHtmlBuildDesc
- HTML build description
-
getOptionExecutionReport
protected boolean getOptionExecutionReport()
Use execution report- Returns:
- true to use, false to not
-
setOptionExecutionReport
protected void setOptionExecutionReport(boolean optionExecutionReport)
Set use execution report- Parameters:
optionExecutionReport
- true to use, false to not
-
getOptionClean
protected boolean getOptionClean()
Get option to clean workspace before build- Returns:
- true to clean, false to not
-
setOptionClean
protected void setOptionClean(boolean optionClean)
Set option to clean workspace before build- Parameters:
optionClean
- true to clean, false to not
-
getUseCILicenses
protected boolean getUseCILicenses()
Get option to use CI licenses- Returns:
- true to use CI licenses, false to not
-
setUseCILicenses
protected void setUseCILicenses(boolean useCILicenses)
Set option to use CI licenses- Parameters:
useCILicenses
- true to use CI licenses, false to not
-
getUseStrictTestcaseImport
protected boolean getUseStrictTestcaseImport()
Get option to Use strict testcase import- Returns:
- true to Use strict testcase import, false to not
-
setUseStrictTestcaseImport
protected void setUseStrictTestcaseImport(boolean useStrictTestcaseImport)
Set option to Use strict testcase import- Parameters:
useStrictTestcaseImport
- true to Use strict testcase import, false to not
-
getUseImportedResults
protected boolean getUseImportedResults()
Get option to Use imported results- Returns:
- true to Use imported results, false to not
-
setUseImportedResults
protected void setUseImportedResults(boolean useImportedResults)
Set option to Use imported results- Parameters:
useImportedResults
- true to Use imported results, false to not
-
getUseLocalImportedResults
protected boolean getUseLocalImportedResults()
Get option to Use local imported results- Returns:
- true to Use local imported results, false to not
-
setUseLocalImportedResults
protected void setUseLocalImportedResults(boolean useLocalImportedResults)
Set option to Use imported results- Parameters:
useLocalImportedResults
- true to Use local imported results, false to not
-
getUseExternalImportedResults
protected boolean getUseExternalImportedResults()
Get option to Use external imported results- Returns:
- true to Use external imported results, false to not
-
setUseExternalImportedResults
protected void setUseExternalImportedResults(boolean useExternalImportedResults)
Set option to Use imported results- Parameters:
useExternalImportedResults
- true to Use external imported results, false to not
-
getExternalResultsFilename
protected String getExternalResultsFilename()
Get option to Use as external result filename- Returns:
- string external result filename
-
setExternalResultsFilename
protected void setExternalResultsFilename(String externalResultsFilename)
Set option to Use imported results- Parameters:
externalResultsFilename
- true to Use external imported results, false to not
-
getUseCoverageHistory
protected boolean getUseCoverageHistory()
Get option to Use coverage history to control build status- Returns:
- true to Use imported results, false to not
-
setUseCoverageHistory
protected void setUseCoverageHistory(boolean useCoverageHistory)
Set option to Use coverage history to control build status- Parameters:
useCoverageHistory
- true to Use imported results, false to not
-
getMaxParallel
protected Long getMaxParallel()
Get for maxParallel to control maximum number of jobs to be queue at at any one point- Returns:
- MaxParallel integer number
-
setMaxParallel
protected void setMaxParallel(Long maxParallel)
Set option for maxParallel to control maximum number of jobs to be queue at at any one point- Parameters:
maxParallel
- Long number
-
getUseCILicensesWin
protected String getUseCILicensesWin()
Get environment setup for windows- Returns:
- setup
-
getUseCILicensesUnix
protected String getUseCILicensesUnix()
-
getWaitTime
protected Long getWaitTime()
Get the time to wait between retries- Returns:
- number of seconds
-
getWaitLoops
protected Long getWaitLoops()
Get the number of wait loops- Returns:
- number of iterations
-
getJobName
protected String getJobName()
Get the user-specified job name- Returns:
- job name (null for use default)
-
getTopProject
protected hudson.model.Project getTopProject()
Get top-level project- Returns:
- project
-
getManageProjectName
protected String getManageProjectName()
Get manage project name- Returns:
- manage project name
-
getBaseName
protected String getBaseName()
Get base name of manage project- Returns:
- base name
-
getNodeLabel
protected String getNodeLabel()
Get node label- Returns:
- node label
-
getPclpCommand
protected String getPclpCommand()
Get pc-lint plus command- Returns:
- pc-lint plus command
-
getPclpResultsPattern
protected String getPclpResultsPattern()
Get pc-lint plus result pattern- Returns:
- pc-lint plus result pattern
-
getSquoreCommand
protected String getSquoreCommand()
Get command for running Squore- Returns:
- Squore command
-
getTESTinsights_URL
protected String getTESTinsights_URL()
Get URL for TESTinsights- Returns:
- TESTinsights URL
-
getTESTinsights_project
protected String getTESTinsights_project()
Get Project for TESTinsights- Returns:
- TESTinsights Project
-
setTESTinsights_project
protected void setTESTinsights_project(String TESTinsights_project)
Set Project for TESTinsights- Parameters:
TESTinsights_project
- TESTinsights project name
-
getTESTinsights_proxy
protected String getTESTinsights_proxy()
Get Proxy for TESTinsights- Returns:
- TESTinsights proxy
-
getTESTinsights_credentials_id
protected String getTESTinsights_credentials_id()
Get Credentials for TESTinsights- Returns:
- TESTinsights Credentials
-
getTESTinsights_SCM_URL
protected String getTESTinsights_SCM_URL()
Get SCM URL for TESTinsights- Returns:
- TESTinsights SCM URL
-
getTESTinsights_SCM_Tech
protected String getTESTinsights_SCM_Tech()
Get SCM Technology TESTinsights- Returns:
- TESTinsights SCM Technology
-
setTESTinsights_SCM_URL
protected void setTESTinsights_SCM_URL(String TESTinsights_SCM_URL)
Set SCM URL for TESTinsights- Parameters:
TESTinsights_SCM_URL
- - String TESTinsights SCM URL
-
setTESTinsights_SCM_Tech
protected void setTESTinsights_SCM_Tech(String TESTinsights_SCM_Tech)
Set SCM Technology TESTinsights- Parameters:
TESTinsights_SCM_Tech
- - String TESTinsights SCM Techology (git or svn)
-
getRequest
protected org.kohsuke.stapler.StaplerRequest getRequest()
Get request- Returns:
- request
-
getInstance
protected jenkins.model.Jenkins getInstance()
Get Jenkins instance- Returns:
- Jenkins instance
-
getResponse
protected org.kohsuke.stapler.StaplerResponse getResponse()
Get response- Returns:
- response
-
addDeleteWorkspaceBeforeBuildStarts
protected void addDeleteWorkspaceBeforeBuildStarts(hudson.model.Project project)
Add the delete workspace before build starts option- Parameters:
project
- project to add to
-
create
public void create(boolean update) throws IOException, javax.servlet.ServletException, hudson.model.Descriptor.FormException, JobAlreadyExistsException, InvalidProjectFileException
Create the job(s)- Parameters:
update
- true/false- Throws:
IOException
- exceptionjavax.servlet.ServletException
- exceptionhudson.model.Descriptor.FormException
- exceptionJobAlreadyExistsException
- exceptionInvalidProjectFileException
- exception
-
createProject
protected abstract hudson.model.Project createProject() throws IOException, JobAlreadyExistsException
Create top-level project- Returns:
- created project
- Throws:
IOException
- exceptionJobAlreadyExistsException
- exception
-
cleanupProject
protected abstract void cleanupProject()
Cleanup top-level project, as in delete
-
doCreate
protected abstract void doCreate(boolean update) throws IOException, javax.servlet.ServletException, hudson.model.Descriptor.FormException, InvalidProjectFileException
Do create of project details- Parameters:
update
- true if doing an update rather than a create- Throws:
IOException
- exceptionjavax.servlet.ServletException
- exceptionhudson.model.Descriptor.FormException
- exceptionInvalidProjectFileException
- exception
-
addSetup
protected VectorCASTSetup addSetup(hudson.model.Project project)
Add the VectorCAST setup step to copy the python scripts to the workspace- Parameters:
project
- project- Returns:
- the setup build step
-
addArchiveArtifacts
protected void addArchiveArtifacts(hudson.model.Project project)
Add archive artifacts step- Parameters:
project
- project to add to
-
addCopyResultsToImport
protected void addCopyResultsToImport(hudson.model.Project project)
Add archive artifacts step- Parameters:
project
- project to add to
-
addJunit
protected void addJunit(hudson.model.Project project)
Add JUnit rules step- Parameters:
project
- project to add step to
-
addPCLintPlus
protected void addPCLintPlus(hudson.model.Project project)
Add PC-Lint Plus step- Parameters:
project
- project to add step to do PC-Lint Plus
-
addVCCoverage
protected void addVCCoverage(hudson.model.Project project)
Add VectorCAST coverage reporting step- Parameters:
project
- project to add step to
-
addCredentialID
protected void addCredentialID(hudson.model.Project project)
-
-