hmi.testutil
Class LabelledParameterized

java.lang.Object
  extended by org.junit.runner.Runner
      extended by org.junit.runners.ParentRunner<org.junit.runner.Runner>
          extended by org.junit.runners.Suite
              extended by org.junit.runners.Parameterized
                  extended by hmi.testutil.LabelledParameterized
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class LabelledParameterized
extends org.junit.runners.Parameterized

Parameterized with understandable test names, to be provided as the first element in the object array. code from uk.ac.lkl.common.util.testing.LabelledParameterized

Author:
Darren Pearce TODO: move elsewhere?

Nested Class Summary
 
Nested classes/interfaces inherited from class org.junit.runners.Parameterized
org.junit.runners.Parameterized.Parameters
 
Nested classes/interfaces inherited from class org.junit.runners.Suite
org.junit.runners.Suite.SuiteClasses
 
Field Summary
private  org.junit.runner.Description labelledDescription
           
private  List<String> labels
           
 
Constructor Summary
LabelledParameterized(Class<?> cl)
           
 
Method Summary
private  void generateLabelledDescription()
           
private  Method getDeclaredMethod(Class<?> cl, String methodName, Class<?>... parameterTypes)
           
 org.junit.runner.Description getDescription()
           
private  Collection<Object[]> getParameterArrays()
           
private  Collection<Object[]> getParameterArrays4_3()
           
private  Collection<Object[]> getParameterArrays4_4()
           
private  void initialiseLabels()
           
private
<T> T
invokeMethodChain(Object object, Object[][] methodCalls)
           
 
Methods inherited from class org.junit.runners.Parameterized
getChildren
 
Methods inherited from class org.junit.runners.Suite
describeChild, emptySuite, runChild
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, collectInitializationErrors, filter, 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
 

Field Detail

labels

private List<String> labels

labelledDescription

private org.junit.runner.Description labelledDescription
Constructor Detail

LabelledParameterized

public LabelledParameterized(Class<?> cl)
                      throws Throwable
Throws:
Throwable
Method Detail

initialiseLabels

private void initialiseLabels()
                       throws Exception
Throws:
Exception

getParameterArrays

private Collection<Object[]> getParameterArrays()
                                         throws Exception
Throws:
Exception

getParameterArrays4_3

private Collection<Object[]> getParameterArrays4_3()
                                            throws Exception
Throws:
Exception

getParameterArrays4_4

private Collection<Object[]> getParameterArrays4_4()
                                            throws Exception
Throws:
Exception

invokeMethodChain

private <T> T invokeMethodChain(Object object,
                                Object[][] methodCalls)
                     throws Exception
Throws:
Exception

getDeclaredMethod

private Method getDeclaredMethod(Class<?> cl,
                                 String methodName,
                                 Class<?>... parameterTypes)
                          throws NoSuchMethodException
Throws:
NoSuchMethodException

generateLabelledDescription

private void generateLabelledDescription()
                                  throws Exception
Throws:
Exception

getDescription

public org.junit.runner.Description getDescription()
Specified by:
getDescription in interface org.junit.runner.Describable
Overrides:
getDescription in class org.junit.runners.ParentRunner<org.junit.runner.Runner>