org.jboss.byteman.contrib.bmunit
Class BMUnitRunner

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.jboss.byteman.contrib.bmunit.BMUnitRunner
All Implemented Interfaces:
org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Sortable

public class BMUnitRunner
extends org.junit.runners.BlockJUnit4ClassRunner

Specialisation of the BlockJUnit4ClassRunner Runner class which can be attached to a text class using the @RunWith annotation. It ensures that Byteman rules are loaded and unloaded for tests which are annotated with an @Byteman annotation


Constructor Summary
BMUnitRunner(java.lang.Class<?> klass)
          Creates a BMUnitRunner to run test in klass
 
Method Summary
protected  org.junit.runners.model.Statement addClassMultiRuleLoader(org.junit.runners.model.Statement statement, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement addClassMultiScriptLoader(org.junit.runners.model.Statement statement, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement addClassSingleRuleLoader(org.junit.runners.model.Statement statement, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement addClassSingleScriptLoader(org.junit.runners.model.Statement statement, org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement addMethodMultiRuleLoader(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod method)
          wrap the test method execution statement with the necessary load and unload calls if it has a BMRules annotation
protected  org.junit.runners.model.Statement addMethodMultiScriptLoader(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod method)
          wrap the test method execution statement with the necessary load and unload calls if it has a BMScripts annotation
protected  org.junit.runners.model.Statement addMethodSingleRuleLoader(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod method)
          wrap the test method execution statement with the necessary load and unload calls if it has a BMRule annotation
protected  org.junit.runners.model.Statement addMethodSingleScriptLoader(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod method)
          wrap the test method execution statement with the necessary load and unload calls if it has a BMScript annotation
protected  org.junit.runners.model.Statement childrenInvoker(org.junit.runner.notification.RunNotifier notifier)
           
protected  org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method, java.lang.Object test)
           
 
Methods inherited from class org.junit.runners.BlockJUnit4ClassRunner
collectInitializationErrors, computeTestMethods, createTest, describeChild, getChildren, methodBlock, possiblyExpectingExceptions, runChild, testName, validateConstructor, validateInstanceMethods, validateOnlyOneConstructor, validateTestMethods, validateZeroArgConstructor, withAfters, withBefores, withPotentialTimeout
 
Methods inherited from class org.junit.runners.ParentRunner
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

BMUnitRunner

public BMUnitRunner(java.lang.Class<?> klass)
             throws org.junit.runners.model.InitializationError
Creates a BMUnitRunner to run test in klass

Throws:
org.junit.runners.model.InitializationError - if the test class is malformed.
Method Detail

childrenInvoker

protected org.junit.runners.model.Statement childrenInvoker(org.junit.runner.notification.RunNotifier notifier)
Overrides:
childrenInvoker in class org.junit.runners.ParentRunner<org.junit.runners.model.FrameworkMethod>

addClassSingleScriptLoader

protected org.junit.runners.model.Statement addClassSingleScriptLoader(org.junit.runners.model.Statement statement,
                                                                       org.junit.runner.notification.RunNotifier notifier)

addClassMultiScriptLoader

protected org.junit.runners.model.Statement addClassMultiScriptLoader(org.junit.runners.model.Statement statement,
                                                                      org.junit.runner.notification.RunNotifier notifier)

addClassMultiRuleLoader

protected org.junit.runners.model.Statement addClassMultiRuleLoader(org.junit.runners.model.Statement statement,
                                                                    org.junit.runner.notification.RunNotifier notifier)

addClassSingleRuleLoader

protected org.junit.runners.model.Statement addClassSingleRuleLoader(org.junit.runners.model.Statement statement,
                                                                     org.junit.runner.notification.RunNotifier notifier)

methodInvoker

protected org.junit.runners.model.Statement methodInvoker(org.junit.runners.model.FrameworkMethod method,
                                                          java.lang.Object test)
Overrides:
methodInvoker in class org.junit.runners.BlockJUnit4ClassRunner

addMethodSingleScriptLoader

protected org.junit.runners.model.Statement addMethodSingleScriptLoader(org.junit.runners.model.Statement statement,
                                                                        org.junit.runners.model.FrameworkMethod method)
wrap the test method execution statement with the necessary load and unload calls if it has a BMScript annotation

Parameters:
statement -
method -
Returns:

addMethodMultiScriptLoader

protected org.junit.runners.model.Statement addMethodMultiScriptLoader(org.junit.runners.model.Statement statement,
                                                                       org.junit.runners.model.FrameworkMethod method)
wrap the test method execution statement with the necessary load and unload calls if it has a BMScripts annotation

Parameters:
statement -
method -
Returns:

addMethodMultiRuleLoader

protected org.junit.runners.model.Statement addMethodMultiRuleLoader(org.junit.runners.model.Statement statement,
                                                                     org.junit.runners.model.FrameworkMethod method)
wrap the test method execution statement with the necessary load and unload calls if it has a BMRules annotation

Parameters:
statement -
method -
Returns:

addMethodSingleRuleLoader

protected org.junit.runners.model.Statement addMethodSingleRuleLoader(org.junit.runners.model.Statement statement,
                                                                      org.junit.runners.model.FrameworkMethod method)
wrap the test method execution statement with the necessary load and unload calls if it has a BMRule annotation

Parameters:
statement -
method -
Returns:


Copyright © 2012. All Rights Reserved.