org.objenesis.tck
Class TextReporter

java.lang.Object
  extended by org.objenesis.tck.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. If can be reused to provide a summary reports of different candidates as long as the same objenesisDescription is not used twice.

Author:
Joe Walnes, Henri Tremblay
See Also:
TCK, Reporter

Constructor Summary
TextReporter(java.io.PrintStream summary, java.io.PrintStream log)
           
 
Method Summary
 void endTest()
          Report that tests have been completed for a particular Objenesis instance and candidate.
 void endTests()
          Report that all tests have finished.
 void exception(java.lang.Exception exception)
          Report that something bad happened during the test.
 void printResult(boolean parentConstructorTest)
          Print the final summary report
 void result(boolean instantiatedObject)
          Report details about what happened when an Objenesis instance tried to instantiate the current candidate.
 void startTest(java.lang.String candidateDescription, java.lang.String objenesisDescription)
          Report that a test between a candidate and an objenesis instance if about to start.
 void startTests(java.lang.String platformDescription, java.util.Collection allCandidates, java.util.Collection allInstantiators)
          Report that the tests are starting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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,
                       java.util.Collection allCandidates,
                       java.util.Collection allInstantiators)
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).
allCandidates - Descriptions (String) of all candidates being used in tests.
allInstantiators - Descriptions of all Objenesis instances being used in tests.

startTest

public void startTest(java.lang.String candidateDescription,
                      java.lang.String objenesisDescription)
Description copied from interface: Reporter
Report that a test between a candidate and an objenesis instance if about to start.

Specified by:
startTest in interface Reporter
Parameters:
candidateDescription - Description of the candidate class.
objenesisDescription - Description of the objenesis instance.

result

public void result(boolean instantiatedObject)
Description copied from interface: Reporter
Report details about what happened when an Objenesis instance tried to instantiate the current candidate.

Specified by:
result in interface Reporter
Parameters:
instantiatedObject - Whether the ObjectInstantiator successfully instantiated the candidate class.

exception

public void exception(java.lang.Exception exception)
Description copied from interface: Reporter
Report that something bad happened during the test.

Specified by:
exception in interface Reporter
Parameters:
exception - Exception thrown by instantiator.

endTest

public void endTest()
Description copied from interface: Reporter
Report that tests have been completed for a particular Objenesis instance and candidate.

Specified by:
endTest in interface Reporter

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

public void printResult(boolean parentConstructorTest)
Print the final summary report



Copyright © {inceptionYear}-2009 null. All Rights Reserved.