Class TextReporter

  • All Implemented Interfaces:
    Reporter

    public class TextReporter
    extends java.lang.Object
    implements Reporter
    Reports results from TCK as tabulated text, suitable for dumping to the console or a file and being read by a human.
    See Also:
    TCK, Reporter
    • Field Detail

      • summary

        private final java.io.PrintStream summary
      • log

        private final java.io.PrintStream log
      • startTime

        private long startTime
      • errorCount

        private int errorCount
      • objenesisStandard

        private Objenesis objenesisStandard
      • objenesisSerializer

        private Objenesis objenesisSerializer
      • currentCandidate

        private Candidate currentCandidate
      • platformDescription

        private java.lang.String platformDescription
    • Constructor Detail

      • TextReporter

        public TextReporter​(java.io.PrintStream summary,
                            java.io.PrintStream log)
        Parameters:
        summary - Output of main report.
        log - Any additional information, useful for diagnostics.
    • Method Detail

      • startTests

        public void startTests​(java.lang.String platformDescription,
                               Objenesis objenesisStandard,
                               Objenesis objenesisSerializer)
        Description copied from interface: Reporter
        Report that the tests are starting. Provides information that is useful to be reported.
        Specified by:
        startTests in interface Reporter
        Parameters:
        platformDescription - Description the platform being run on (i.e. JVM version, vendor, etc)
        objenesisStandard - Standard Objenesis instance used
        objenesisSerializer - Serialization Objenesis instance used
      • startTest

        public void startTest​(Candidate candidate)
        Description copied from interface: Reporter
        Report that a test between a candidate and an objenesis instance is about to start.
        Specified by:
        startTest in interface Reporter
        Parameters:
        candidate - Starting to test this candidate.
      • result

        public void result​(Candidate.CandidateType type,
                           boolean success)
        Description copied from interface: Reporter
        Report details about what happened when performing an instantiation test or a serialization feature test.
        Specified by:
        result in interface Reporter
        Parameters:
        type - type of test
        success - Whether the test was successful or not
      • exception

        public void exception​(Candidate.CandidateType type,
                              java.lang.Exception exception)
        Description copied from interface: Reporter
        Report that something bad happened during the test.
        Specified by:
        exception in interface Reporter
        Parameters:
        type - type of test
        exception - Exception thrown
      • addResult

        private void addResult​(Candidate.CandidateType type,
                               boolean success,
                               java.lang.Exception exception)
      • endTests

        public void endTests()
        Description copied from interface: Reporter
        Report that all tests have finished. Nothing will be called after this method.
        Specified by:
        endTests in interface Reporter
      • printResult

        private void printResult​(long totalTime)
        Print the final summary report
        Parameters:
        totalTime - Time spent running the TCK
      • hasErrors

        public boolean hasErrors()
        Return true if the reporter has registered some errors
        Returns:
        if there was errors during execution
      • pad

        private java.lang.String pad​(java.lang.String text,
                                     int width)
      • lengthOfLongestStringIn

        private int lengthOfLongestStringIn​(java.util.Collection<java.lang.String> descriptions)