Class OpenReportForFailedTestAction

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

    public class OpenReportForFailedTestAction
    extends java.lang.Object
    implements Action, org.kohsuke.stapler.StaplerProxy
    Action to open a TPT report of a failed test case
    Author:
    FInfantino, PikeTec GmbH
    • Constructor Summary

      Constructors 
      Constructor Description
      OpenReportForFailedTestAction​(Run<?,​?> build, java.lang.String fileName, java.lang.String reportFile, java.lang.String id, java.lang.String exConfig, java.lang.String date, java.lang.String jenkinsConfigId)
      This class is made for generating the failed html on the TPTReportPage.
    • 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 when an object from this class is created.
      java.lang.String getDisplayName()  
      java.lang.String getExecutionConfiguration()  
      java.lang.String getIconFileName()  
      java.lang.String getName()  
      java.lang.Object getTarget()  
      java.lang.String getUrlName()  
      void setExecutionConfiguration​(java.lang.String executionConfiguration)
      set the name of the TPT execution configuration
      • Methods inherited from class java.lang.Object

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

      • OpenReportForFailedTestAction

        public OpenReportForFailedTestAction​(Run<?,​?> build,
                                             java.lang.String fileName,
                                             java.lang.String reportFile,
                                             java.lang.String id,
                                             java.lang.String exConfig,
                                             java.lang.String date,
                                             java.lang.String jenkinsConfigId)
        This class is made for generating the failed html on the TPTReportPage. We open the index.html and we replace the string "overview.html" with the name of the failed test. We store that in a new html file called "failedTest.html". This will be done when it is requested by the user. This class is also similar to InvisibleActionHostingHtml.
        Parameters:
        build - The current jenkins build
        fileName - The name of the tpt file
        reportFile - the path to the report file
        id - the test case id
        exConfig - the name of the execution configurationm
        date - the execution date
        jenkinsConfigId - The unique ID of the configuration to create unique paths
    • 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
      • getTarget

        public java.lang.Object getTarget()
        Specified by:
        getTarget in interface org.kohsuke.stapler.StaplerProxy
      • getName

        public java.lang.String getName()
        Returns:
        The name of the TPT file
      • doDynamic

        public void doDynamic​(org.kohsuke.stapler.StaplerRequest req,
                              org.kohsuke.stapler.StaplerResponse rsp)
                       throws java.io.IOException,
                              javax.servlet.ServletException
        This method is called when an object from this class is created. When clicking on a failed test case, the overview report should be opened, with the navigation on the left and the failed test case report on the right. It maps the URL the user sees to the file path where the corresponding html document lies.
        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
      • getExecutionConfiguration

        public java.lang.String getExecutionConfiguration()
        Returns:
        the name of the TPT execution configuration
      • setExecutionConfiguration

        public void setExecutionConfiguration​(java.lang.String executionConfiguration)
        set the name of the TPT execution configuration
        Parameters:
        executionConfiguration - the name of the TPT execution configuration