Package org.objenesis.tck
Class TCK
java.lang.Object
org.objenesis.tck.TCK
Technology Compatibility Kit (TCK) for
Objenesis
s.
This TCK tests Objenesis implementations against a set of candidate classes (class it attempts to instantiate),
reporting the results to a Reporter
.
Example usage
TextReporter reporter = new TextReporter(System.out, System.err); TCK tck = new TCK(new ObjenesisStd(), new ObjenesisSerializer(), reporter); tck.runTests(reporter); reporter.printResults();
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Describes the platform.protected void
void
registerCandidate
(Class<?> candidateClass, String description, Candidate.CandidateType type) Register a candidate class to attempt to instantiate.private void
runCandidate
(Reporter reporter, Class<?> candidate, Objenesis objenesis, Candidate.CandidateType type) private void
runFeature
(Reporter reporter, Class<?> clazz, Objenesis objenesis, Candidate.CandidateType type) private void
runTest
(Reporter reporter, Class<?> candidate, Objenesis objenesis, Candidate.CandidateType type) void
runTests()
Run all TCK tests.
-
Field Details
-
objenesisStandard
-
objenesisSerializer
-
reporter
-
candidates
-
-
Constructor Details
-
TCK
- Parameters:
objenesisStandard
- Objenesis instance used to instantiate classes the standard way (no constructor called)objenesisSerializer
- Objenesis instance used to instantiate classes in a serialization compliant way (first not serializable constructor called)reporter
- Where to report the results of the tests to
-
-
Method Details
-
loadCandidates
- Throws:
IOException
-
registerCandidate
public void registerCandidate(Class<?> candidateClass, String description, Candidate.CandidateType type) Register a candidate class to attempt to instantiate.- Parameters:
candidateClass
- Class to attempt to instantiatedescription
- Description of the classtype
- Type of the candidate
-
runTests
public void runTests()Run all TCK tests. -
runTest
private void runTest(Reporter reporter, Class<?> candidate, Objenesis objenesis, Candidate.CandidateType type) -
runFeature
private void runFeature(Reporter reporter, Class<?> clazz, Objenesis objenesis, Candidate.CandidateType type) -
runCandidate
private void runCandidate(Reporter reporter, Class<?> candidate, Objenesis objenesis, Candidate.CandidateType type) -
describePlatform
Describes the platform. Outputs Java version and vendor. To change this behavior, override this method.- Returns:
- Description of the current platform
-