net.sf.randomjunit
Class RandomTestRunner

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>
          extended by org.junit.runners.BlockJUnit4ClassRunner
              extended by net.sf.randomjunit.RandomTestRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class RandomTestRunner
extends org.junit.runners.BlockJUnit4ClassRunner

This class randomize the execution of tests.

Taken from http://stackoverflow.com/questions/1444314/how-can-i-make-my-junit- tests-run-in-random-order

Control Version

Version:
1.0.0 2011-06-13
Author:
Michael Lloyd Lee (Mlk) - Stackoverflow

Constructor Summary
RandomTestRunner(Class<?> klass)
          Please see BlockJUnit4ClassRunner.BlockJUnit4ClassRunner(Class) .
 
Method Summary
protected  List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
           
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, createTest, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateInstanceMethods, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, filter, getDescription, getName, getTestClass, run, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses
 
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

RandomTestRunner

public RandomTestRunner(Class<?> klass)
                 throws org.junit.runners.model.InitializationError
Please see BlockJUnit4ClassRunner.BlockJUnit4ClassRunner(Class) .

Parameters:
klass - Class to execute.
Throws:
org.junit.runners.model.InitializationError - If there is an error.
Method Detail

computeTestMethods

protected List<org.junit.runners.model.FrameworkMethod> computeTestMethods()
Overrides:
computeTestMethods in class org.junit.runners.BlockJUnit4ClassRunner


AngocA 2011 Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.