org.atinject.tck
Class Tck

java.lang.Object
  extended by org.atinject.tck.Tck

public class Tck
extends java.lang.Object

Maufactures the compatibility test suite. Call testsFor from a JUnit static suite method:

 import junit.framework.Test;
 import org.atinject.tck.Tck;

 public class MyTck {
   public static Test suite() {
     Car car = new MyInjector().getInstance(Car.class);
     return Tck.testsFor(car, true, true);
   }
 }
 

Run the tests using JUnit. For example:

 java junit.textui.TestRunner MyTck
 


Constructor Summary
private Tck()
           
 
Method Summary
static junit.framework.Test testsFor(Car car, boolean supportsStatic, boolean supportsPrivate)
          Constructs a test suite for the given Car instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tck

private Tck()
Method Detail

testsFor

public static junit.framework.Test testsFor(Car car,
                                            boolean supportsStatic,
                                            boolean supportsPrivate)
Constructs a test suite for the given Car instance. Create the Car instance using an injector with the following configuration:

If static member injection is supported, the static members of the following types shall also be injected: Convertible, Tire, and SpareTire.

Parameters:
car - to test
supportsStatic - if the injector supports static member injection
supportsPrivate - if the injector supports private member injection
Throws:
java.lang.NullPointerException - if car is null
java.lang.ClassCastException - if car doesn't extend Convertible


Copyright (C) 2009 The JSR-330 Expert Group. Licensed under the Apache License, Version 2.0.