org.mockito.runners
Class VerboseMockitoJUnitRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.mockito.runners.VerboseMockitoJUnitRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable

public class VerboseMockitoJUnitRunner
extends org.junit.runner.Runner
implements org.junit.runner.manipulation.Filterable

Experimental implementation that suppose to improve tdd/testing experience. Don't hesitate to send feedback to [email protected] It is very likely it will change in the next version!

This runner does exactly what MockitoJUnitRunner does but also adds extra Mocktio hints to the exception message. The point is that Mockito should help the tdd developer to quickly figure out if the test fails for the right reason and track the reason.

The implemntation is pretty hacky - it uses brute force of reflection to modify the exception message and add extra mockito hints. You've been warned.

Do you think it is useful or not? Drop us an email at [email protected]

Experimental implementation - will change in future!


Constructor Summary
VerboseMockitoJUnitRunner(java.lang.Class<?> klass)
           
 
Method Summary
 void filter(org.junit.runner.manipulation.Filter filter)
           
 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

VerboseMockitoJUnitRunner

public VerboseMockitoJUnitRunner(java.lang.Class<?> klass)
                          throws java.lang.reflect.InvocationTargetException
Throws:
java.lang.reflect.InvocationTargetException
Method Detail

run

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

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

filter

public void filter(org.junit.runner.manipulation.Filter filter)
            throws org.junit.runner.manipulation.NoTestsRemainException
Specified by:
filter in interface org.junit.runner.manipulation.Filterable
Throws:
org.junit.runner.manipulation.NoTestsRemainException