Package org.objenesis.tck
Class TextReporter
- java.lang.Object
-
- org.objenesis.tck.TextReporter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TextReporter.Result
-
Field Summary
Fields Modifier and Type Field Description private Candidate
currentCandidate
private int
errorCount
private java.io.PrintStream
log
private Objenesis
objenesisSerializer
private Objenesis
objenesisStandard
private java.lang.String
platformDescription
private java.util.Map<Candidate,java.util.Map<Candidate.CandidateType,TextReporter.Result>>
results
private long
startTime
private java.io.PrintStream
summary
-
Constructor Summary
Constructors Constructor Description TextReporter(java.io.PrintStream summary, java.io.PrintStream log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addResult(Candidate.CandidateType type, boolean success, java.lang.Exception exception)
void
endTests()
Report that all tests have finished.void
exception(Candidate.CandidateType type, java.lang.Exception exception)
Report that something bad happened during the test.boolean
hasErrors()
Return true if the reporter has registered some errorsprivate int
lengthOfLongestStringIn(java.util.Collection<java.lang.String> descriptions)
private java.lang.String
pad(java.lang.String text, int width)
private void
printResult(long totalTime)
Print the final summary reportvoid
result(Candidate.CandidateType type, boolean success)
Report details about what happened when performing an instantiation test or a serialization feature test.void
startTest(Candidate candidate)
Report that a test between a candidate and an objenesis instance is about to start.void
startTests(java.lang.String platformDescription, Objenesis objenesisStandard, Objenesis objenesisSerializer)
Report that the tests are starting.
-
-
-
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
-
results
private final java.util.Map<Candidate,java.util.Map<Candidate.CandidateType,TextReporter.Result>> results
-
platformDescription
private java.lang.String platformDescription
-
-
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 interfaceReporter
- Parameters:
platformDescription
- Description the platform being run on (i.e. JVM version, vendor, etc)objenesisStandard
- Standard Objenesis instance usedobjenesisSerializer
- 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.
-
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.
-
exception
public void exception(Candidate.CandidateType type, java.lang.Exception exception)
Description copied from interface:Reporter
Report that something bad happened during the test.
-
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.
-
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)
-
-