Class TrendGraph

  • All Implemented Interfaces:
    Action, ModelObject, org.kohsuke.stapler.StaplerProxy

    public class TrendGraph
    extends java.lang.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.
      java.lang.String getDisplayName()  
      int getError()  
      int getFailed()  
      java.util.ArrayList<java.lang.Integer> getFailedBuilds()  
      java.util.ArrayList<TrendGraph.ResultData> getHistoryData()  
      java.lang.String getIconFileName()  
      int getInconclusive()  
      int getPassed()  
      Job<?,​?> getProject()  
      java.lang.Object getTarget()  
      java.lang.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​(java.util.ArrayList<java.lang.Integer> failedBuilds)
      Set the number of failed builds of the jenkins project this trend graph belongs to
      void 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TrendGraph

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

      • getIconFileName

        public java.lang.String getIconFileName()
        Specified by:
        getIconFileName in interface Action
      • getUrlName

        public java.lang.String getUrlName()
        Specified by:
        getUrlName in interface Action
      • getProject

        public Job<?,​?> getProject()
        Returns:
        The Jenkins project this Trendgraph belongs to
      • getFailedBuilds

        public java.util.ArrayList<java.lang.Integer> getFailedBuilds()
        Returns:
        The number of failed builds of the jenkins project this trend graph belongs to
      • setFailedBuilds

        public void setFailedBuilds​(java.util.ArrayList<java.lang.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 java.util.ArrayList<TrendGraph.ResultData> getHistoryData()
        Returns:
        A List of Data containing the numer off passed, failed, inconcluive etc. TPT tests of previous builds.
      • getTarget

        public java.lang.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 java.io.IOException,
                              javax.servlet.ServletException,
                              java.lang.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:
        java.io.IOException - if the response could not be generated
        javax.servlet.ServletException - if the response could not be generated
        java.lang.InterruptedException - if the job is cancelled