org.apache.myfaces.test.runners
Class TestPerClassLoaderRunner

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

public class TestPerClassLoaderRunner
extends NamedRunner

A Junit 4 runner that executes each Test method with a new Custom classloader so that all variables, also the final ones, are reinitialized.

Since:
1.0.0
Author:
Rudy De Busscher

Constructor Summary
TestPerClassLoaderRunner(Class<?> klass)
          Instantiates a new test per class loader runner.
 
Method Summary
protected  Object createTest()
           
protected  org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
           
protected  org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runners.model.Statement statement)
           
protected  org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method, Object target, org.junit.runners.model.Statement statement)
           
 
Methods inherited from class org.apache.myfaces.test.runners.NamedRunner
getTestMethodName, runChild
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, describeChild, getChildren, methodInvoker, possiblyExpectingExceptions, testName, validateInstanceMethods, validateTestMethods, validateZeroArgConstructor, 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

TestPerClassLoaderRunner

public TestPerClassLoaderRunner(Class<?> klass)
                         throws org.junit.runners.model.InitializationError
Instantiates a new test per class loader runner.

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

createTest

protected Object createTest()
                     throws Exception
Overrides:
createTest in class org.junit.runners.BlockJUnit4ClassRunner
Throws:
Exception

methodBlock

protected org.junit.runners.model.Statement methodBlock(org.junit.runners.model.FrameworkMethod method)
Overrides:
methodBlock in class org.junit.runners.BlockJUnit4ClassRunner

withAfters

protected org.junit.runners.model.Statement withAfters(org.junit.runners.model.FrameworkMethod method,
                                                       Object target,
                                                       org.junit.runners.model.Statement statement)
Overrides:
withAfters in class org.junit.runners.BlockJUnit4ClassRunner

withBefores

protected org.junit.runners.model.Statement withBefores(org.junit.runners.model.FrameworkMethod method,
                                                        Object target,
                                                        org.junit.runners.model.Statement statement)
Overrides:
withBefores in class org.junit.runners.BlockJUnit4ClassRunner


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