Class TrendGraph
- java.lang.Object
-
- com.piketec.jenkins.plugins.tpt.publisher.TrendGraph
-
- All Implemented Interfaces:
Action
,ModelObject
,org.kohsuke.stapler.StaplerProxy
public class TrendGraph extends Object implements Action, org.kohsuke.stapler.StaplerProxy
Generates the trend graph on the main page.- Author:
- FInfantino, PikeTec GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TrendGraph.ResultData
Data container to collect numbers of test results of TPT test execuiton for build previous builds.
-
Constructor Summary
Constructors Constructor Description TrendGraph(Job<?,?> project)
Creates a new TrendGraph
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doDynamic(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
This method is called everytime the page is refreshed.String
getDisplayName()
int
getError()
int
getFailed()
ArrayList<Integer>
getFailedBuilds()
ArrayList<TrendGraph.ResultData>
getHistoryData()
String
getIconFileName()
int
getInconclusive()
int
getPassed()
Job<?,?>
getProject()
Object
getTarget()
String
getUrlName()
void
setError(int error)
Set the number of tests with execution error of the last build of the jenkins project this trend graph belongs to.void
setFailed(int failed)
Set the number of failed tests of the last build of the jenkins project this trend graph belongs to.void
setFailedBuilds(ArrayList<Integer> failedBuilds)
Set the number of failed builds of the jenkins project this trend graph belongs tovoid
setInconclusive(int inconclusive)
Set the number of inconclusive tests of the last build of the jenkins project this trend graph belongs to.void
setPassed(int passed)
Set the number of passed tests of the last build of the jenkins project this trend graph belongs to.
-
-
-
Constructor Detail
-
TrendGraph
public TrendGraph(Job<?,?> project)
Creates a new TrendGraph- Parameters:
project
- The Jenkins project this Trendgraph belongs to.
-
-
Method Detail
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
getProject
public Job<?,?> getProject()
- Returns:
- The Jenkins project this Trendgraph belongs to
-
getFailedBuilds
public ArrayList<Integer> getFailedBuilds()
- Returns:
- The number of failed builds of the jenkins project this trend graph belongs to
-
setFailedBuilds
public void setFailedBuilds(ArrayList<Integer> failedBuilds)
Set the number of failed builds of the jenkins project this trend graph belongs to- Parameters:
failedBuilds
- The number of failed builds of the jenkins project this trend graph belongs to
-
getPassed
public int getPassed()
- Returns:
- The number of passed tests of the last build of the jenkins project this trend graph belongs to.
-
setPassed
public void setPassed(int passed)
Set the number of passed tests of the last build of the jenkins project this trend graph belongs to.- Parameters:
passed
- TThe number of passed tests of the last build of the jenkins project this trend graph belongs to.
-
getFailed
public int getFailed()
- Returns:
- The number of failed tests of the last build of the jenkins project this trend graph belongs to.
-
setFailed
public void setFailed(int failed)
Set the number of failed tests of the last build of the jenkins project this trend graph belongs to.- Parameters:
failed
- The number of failed tests of the last build of the jenkins project this trend graph belongs to.
-
getError
public int getError()
- Returns:
- The number of tests with execution error of the last build of the jenkins project this trend graph belongs to.
-
setError
public void setError(int error)
Set the number of tests with execution error of the last build of the jenkins project this trend graph belongs to.- Parameters:
error
- The number of tests with execution error of the last build of the jenkins project this trend graph belongs to.
-
getInconclusive
public int getInconclusive()
- Returns:
- The number of inconclusive tests of the last build of the jenkins project this trend graph belongs to.
-
setInconclusive
public void setInconclusive(int inconclusive)
Set the number of inconclusive tests of the last build of the jenkins project this trend graph belongs to.- Parameters:
inconclusive
- Set the number of inconclusive tests of the last build of the jenkins project this trend graph belongs to.
-
getHistoryData
public ArrayList<TrendGraph.ResultData> getHistoryData()
- Returns:
- A List of Data containing the numer off passed, failed, inconcluive etc. TPT tests of previous builds.
-
getTarget
public Object getTarget()
- Specified by:
getTarget
in interfaceorg.kohsuke.stapler.StaplerProxy
-
doDynamic
public void doDynamic(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException, InterruptedException
This method is called everytime the page is refreshed. It regenerates the json file and refreshes the graph.- Parameters:
req
- The requestrsp
- The response- Throws:
IOException
- if the response could not be generatedjavax.servlet.ServletException
- if the response could not be generatedInterruptedException
- if the job is cancelled
-
-