org.apache.myfaces.test.runners
Class NamedRunner

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 org.apache.myfaces.test.runners.NamedRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable
Direct Known Subclasses:
TestPerClassLoaderRunner

public class NamedRunner
extends org.junit.runners.BlockJUnit4ClassRunner

A Junit 4 runner that stores the name of the method that runs. The methods marked with @After and @Before (but also the Test method itself) can request this name for which it is running.

Since:
1.0.0
Author:
Rudy De Busscher

Constructor Summary
NamedRunner(Class<?> klass)
          Instantiates a new named runner.
 
Method Summary
static String getTestMethodName()
          Gets the test method name.
protected  void runChild(org.junit.runners.model.FrameworkMethod method, org.junit.runner.notification.RunNotifier notifier)
           
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, methodBlock, methodInvoker, possiblyExpectingExceptions, testName, validateInstanceMethods, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
childrenInvoker, classBlock, filter, getDescription, getName, getTestClass, run, 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
 
Methods inherited from interface org.junit.runner.manipulation.Filterable
filter
 
Methods inherited from interface org.junit.runner.manipulation.Sortable
sort
 

Constructor Detail

NamedRunner

public NamedRunner(Class<?> klass)
            throws org.junit.runners.model.InitializationError
Instantiates a new named runner.

Parameters:
klass - the klass
Throws:
org.junit.runners.model.InitializationError - the initialization error
Method Detail

runChild

protected void runChild(org.junit.runners.model.FrameworkMethod method,
                        org.junit.runner.notification.RunNotifier notifier)
Overrides:
runChild in class org.junit.runners.BlockJUnit4ClassRunner

getTestMethodName

public static String getTestMethodName()
Gets the test method name.

Returns:
the test method name


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.