Class 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
    • Constructor Detail

      • TrendGraph

        public TrendGraph​(Job<?,​?> project)
        Creates a new TrendGraph
        Parameters:
        project - The Jenkins project this Trendgraph belongs to.
    • Method Detail

      • 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 interface org.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 request
        rsp - The response
        Throws:
        IOException - if the response could not be generated
        javax.servlet.ServletException - if the response could not be generated
        InterruptedException - if the job is cancelled