Class SerializedRenderer

  • All Implemented Interfaces:
    Renderer, RendererFactory

    @Service
    public class SerializedRenderer
    extends org.junit.runner.notification.RunListener
    implements Renderer, RendererFactory
    Renderer for Sling JUnit server-side testing, which renders test results in binary form. Used to send results, and especially Exceptions, as is to a remote IDE.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.junit.runner.notification.RunListener

        org.junit.runner.notification.RunListener.ThreadSafe
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EXTENSION  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean appliesTo​(TestSelector s)
      True if this renderer applies to supplied request
      void cleanup()
      Called once rendering is done
      Renderer createRenderer()  
      java.lang.String getExtension()
      Return the extension that triggers this renderer
      org.junit.runner.notification.RunListener getRunListener()
      Provide a RunListener for JUnit tests
      void info​(java.lang.String role, java.lang.String info)
      Render general information
      void link​(java.lang.String info, java.lang.String url, java.lang.String method)
      Render a link to specified URL using specified HTTP method
      void list​(java.lang.String role, java.util.Collection<java.lang.String> data)
      Render a list of things
      void setup​(javax.servlet.http.HttpServletResponse response, java.lang.String pageTitle)
      Called first to setup rendering
      void testRunFinished​(org.junit.runner.Result result)  
      void title​(int level, java.lang.String title)
      Render a title of a specified hierarchical level
      • Methods inherited from class org.junit.runner.notification.RunListener

        testAssumptionFailure, testFailure, testFinished, testIgnored, testRunStarted, testStarted
      • Methods inherited from class java.lang.Object

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

      • SerializedRenderer

        public SerializedRenderer()
    • Method Detail

      • appliesTo

        public boolean appliesTo​(TestSelector s)
        Description copied from interface: Renderer
        True if this renderer applies to supplied request
        Specified by:
        appliesTo in interface Renderer
      • getExtension

        public java.lang.String getExtension()
        Description copied from interface: Renderer
        Return the extension that triggers this renderer
        Specified by:
        getExtension in interface Renderer
      • setup

        public void setup​(javax.servlet.http.HttpServletResponse response,
                          java.lang.String pageTitle)
                   throws java.io.IOException,
                          java.io.UnsupportedEncodingException
        Description copied from interface: Renderer
        Called first to setup rendering
        Specified by:
        setup in interface Renderer
        Throws:
        java.io.IOException
        java.io.UnsupportedEncodingException
      • cleanup

        public void cleanup()
        Description copied from interface: Renderer
        Called once rendering is done
        Specified by:
        cleanup in interface Renderer
      • getRunListener

        public org.junit.runner.notification.RunListener getRunListener()
        Description copied from interface: Renderer
        Provide a RunListener for JUnit tests
        Specified by:
        getRunListener in interface Renderer
      • info

        public void info​(java.lang.String role,
                         java.lang.String info)
        Description copied from interface: Renderer
        Render general information
        Specified by:
        info in interface Renderer
        Parameters:
        role - describes the role of the list, must be a valid CSS class value
      • link

        public void link​(java.lang.String info,
                         java.lang.String url,
                         java.lang.String method)
        Description copied from interface: Renderer
        Render a link to specified URL using specified HTTP method
        Specified by:
        link in interface Renderer
      • list

        public void list​(java.lang.String role,
                         java.util.Collection<java.lang.String> data)
        Description copied from interface: Renderer
        Render a list of things
        Specified by:
        list in interface Renderer
        Parameters:
        role - describes the role of the list, must be a valid CSS class value
      • title

        public void title​(int level,
                          java.lang.String title)
        Description copied from interface: Renderer
        Render a title of a specified hierarchical level
        Specified by:
        title in interface Renderer
      • testRunFinished

        public void testRunFinished​(org.junit.runner.Result result)
                             throws java.io.IOException
        Overrides:
        testRunFinished in class org.junit.runner.notification.RunListener
        Throws:
        java.io.IOException