org.objenesis.tck
Class TCK

java.lang.Object
  extended by org.objenesis.tck.TCK

public class TCK
extends java.lang.Object

Technology Compatibility Kit (TCK) for 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.

Example usage

 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);
 

Author:
Joe Walnes
See Also:
ObjectInstantiator, Reporter, Main

Constructor Summary
TCK()
           
 
Method Summary
protected  java.lang.String describePlatform()
          Describes the platform.
 void registerCandidate(java.lang.Class candidateClass, java.lang.String description)
          Register a candidate class to attempt to instantiate.
 void registerObjenesisInstance(org.objenesis.Objenesis objenesis, java.lang.String description)
          Register an Objenesis instance to use when attempting to instantiate a class.
 void runTests(Reporter reporter)
          Run all TCK tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCK

public TCK()
Method Detail

registerCandidate

public void registerCandidate(java.lang.Class candidateClass,
                              java.lang.String description)
Register a candidate class to attempt to instantiate.

Parameters:
candidateClass - Class to attempt to instantiate
description - Description of the class

registerObjenesisInstance

public void registerObjenesisInstance(org.objenesis.Objenesis objenesis,
                                      java.lang.String description)
Register an Objenesis instance to use when attempting to instantiate a class.

Parameters:
objenesis - Tested Objenesis instance
description - Description of the Objenesis instance

runTests

public void runTests(Reporter reporter)
Run all TCK tests.

Parameters:
reporter - Where to report the results of the test to.

describePlatform

protected java.lang.String describePlatform()
Describes the platform. Outputs Java version and vendor. To change this behavior, override this method.

Returns:
Description of the current platform


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