org.callbackparams.junit4
Class CallbackParamsRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.callbackparams.junit4.CallbackParamsRunner
All Implemented Interfaces:
org.junit.runner.Describable
Direct Known Subclasses:
BddRunner

public class CallbackParamsRunner
extends org.junit.runner.Runner

The recommended strategy for JUnit-integration is to use this Runner implementation, by annotating the test-class with ...

 @org.junit.runner.RunWith(CallbackParamsRunner.class)
 
... and possibly complement with some combine-configuration ...
 @CombineConfig(maxCount=100, strategy=CombineCompletely.class)
 
This will work fine even if the test-class uses the JUnit-3.x API, instead of the JUnit-4.x annotations @Test, @Before etc. CallbackParamsRunner will (1) autodetect which JUnit API-version is in use, (2) modify the test-class' bytecode accordingly and (3) pick an appropriate Runner-implementation to take care of the actual test-execution.

Please note that it is possible to specify an arbitrary Runner-implementation class by using the @WrappedRunner annotation. This will work for just about any Runner as long as its normal usage resembles the default JUnit runner's usage of the annotations @Test, @Before, @After.

Author:
Henrik Kaipe

Constructor Summary
CallbackParamsRunner(Class testClass)
           
 
Method Summary
 org.junit.runner.Description getDescription()
           
 void run(org.junit.runner.notification.RunNotifier notifier)
           
 
Methods inherited from class org.junit.runner.Runner
testCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackParamsRunner

public CallbackParamsRunner(Class testClass)
                     throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

getDescription

public org.junit.runner.Description getDescription()
Specified by:
getDescription in interface org.junit.runner.Describable
Specified by:
getDescription in class org.junit.runner.Runner

run

public void run(org.junit.runner.notification.RunNotifier notifier)
Specified by:
run in class org.junit.runner.Runner


Copyright © 2010-2013 Henrik Kaipe. All Rights Reserved.