public class TCK extends Object
Objenesiss.
This TCK accepts a set of candidate classes (class it attempts to instantiate) and a set of
Objenesis implementations. It then tries instantiating every candidate with every Objenesis
implementations, reporting the results to a Reporter.
TCK tck = new TCK(); // register candidate classes. tck.registerCandidate(SomeClass.class, "A basic class"); tck.registerCandidate(SomeEvil.class, "Something evil"); tck.registerCandidate(NotEvil.class, "Something nice"); // register Objenesis instances. tck.registerObjenesisInstance(new ObjenesisStd(), "Objenesis"); tck.registerObjenesisInstance(new ObjenesisSerializaer(), "Objenesis for serialization"); // go! Reporter reporter = new TextReporter(System.out, System.err); tck.runTests(reporter);
ObjectInstantiator,
Reporter,
Main| Constructor and Description |
|---|
TCK() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
describePlatform()
Describes the platform.
|
void |
registerCandidate(Class candidateClass,
String description)
Register a candidate class to attempt to instantiate.
|
void |
registerObjenesisInstance(Objenesis objenesis,
String description)
Register an Objenesis instance to use when attempting to instantiate a class.
|
void |
runTests(Reporter reporter)
Run all TCK tests.
|
public void registerCandidate(Class candidateClass, String description)
candidateClass - Class to attempt to instantiatedescription - Description of the classpublic void registerObjenesisInstance(Objenesis objenesis, String description)
objenesis - Tested Objenesis instancedescription - Description of the Objenesis instancepublic void runTests(Reporter reporter)
reporter - Where to report the results of the test to.protected String describePlatform()
Copyright © 2006-2016 Joe Walnes, Henri Tremblay, Leonardo Mesquita. All Rights Reserved.