Package org.jboss.byteman.contrib.bmunit
Class BMNGAbstractRunner
- java.lang.Object
-
- org.jboss.byteman.contrib.bmunit.BMNGAbstractRunner
-
- All Implemented Interfaces:
org.testng.IHookable
,org.testng.ITestNGListener
- Direct Known Subclasses:
BMNGListener
,BMNGRunner
public abstract class BMNGAbstractRunner extends java.lang.Object implements org.testng.IHookable
An abstract class which provides the ability to load Byteman rules into TestNG style tests. The two subclasses of this class support the two alternative models for mixing Byteman capability into TestNG test classes.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BMUnitConfig
classConfigAnnotation
(package private) BMRules
classMultiRuleAnnotation
(package private) BMScripts
classMultiScriptAnnotation
(package private) BMRule
classSingleRuleAnnotation
(package private) BMScript
classSingleScriptAnnotation
(package private) static java.lang.Class
currentClazz
-
Constructor Summary
Constructors Constructor Description BMNGAbstractRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bmngAfterClass(java.lang.Class<?> testKlazz)
provides behaviour to unload rules specified via BMScript or BMRule annotations attached to the supplied test class.void
bmngAfterTest(java.lang.reflect.Method method)
provides behaviour to unload rules specified via annotations associated with a specific method of a test class.void
bmngBeforeClass(java.lang.Class<?> testKlazz)
provides behaviour to load rules specified via BMScript or BMRule annotations attached to the supplied test class.void
bmngBeforeTest(java.lang.reflect.Method method)
provides behaviour to load rules specified via annotations associated with a specific method of a test class.void
run(org.testng.IHookCallBack callBack, org.testng.ITestResult testResult)
implement standard run behaviour by devolving control back to the original runner using the hook callbackvoid
switchClass(java.lang.Class newClazz)
-
-
-
Field Detail
-
classConfigAnnotation
BMUnitConfig classConfigAnnotation
-
classSingleScriptAnnotation
BMScript classSingleScriptAnnotation
-
classMultiScriptAnnotation
BMScripts classMultiScriptAnnotation
-
classMultiRuleAnnotation
BMRules classMultiRuleAnnotation
-
classSingleRuleAnnotation
BMRule classSingleRuleAnnotation
-
currentClazz
static java.lang.Class currentClazz
-
-
Method Detail
-
run
public void run(org.testng.IHookCallBack callBack, org.testng.ITestResult testResult)
implement standard run behaviour by devolving control back to the original runner using the hook callback- Specified by:
run
in interfaceorg.testng.IHookable
- Parameters:
callBack
- not usedtestResult
- used to post results
-
bmngBeforeClass
public void bmngBeforeClass(java.lang.Class<?> testKlazz) throws java.lang.Exception
provides behaviour to load rules specified via BMScript or BMRule annotations attached to the supplied test class. the class is cached and used to resolve subsequent requests to load and unload method level rules and to unload the class level rules.- Parameters:
testKlazz
- the class whose tests are being run- Throws:
java.lang.Exception
- if the test cannot be run
-
bmngAfterClass
public void bmngAfterClass(java.lang.Class<?> testKlazz) throws java.lang.Exception
provides behaviour to unload rules specified via BMScript or BMRule annotations attached to the supplied test class.- Parameters:
testKlazz
- the class whose tests are being run- Throws:
java.lang.Exception
- if cleanup fails
-
bmngBeforeTest
public void bmngBeforeTest(java.lang.reflect.Method method) throws java.lang.Exception
provides behaviour to load rules specified via annotations associated with a specific method of a test class.- Parameters:
method
- the test method about to be run- Throws:
java.lang.Exception
- if the test cannot be run
-
bmngAfterTest
public void bmngAfterTest(java.lang.reflect.Method method) throws java.lang.Exception
provides behaviour to unload rules specified via annotations associated with a specific method of a test class.- Parameters:
method
- the test method about to be run- Throws:
java.lang.Exception
- if the test cannot be run
-
switchClass
public void switchClass(java.lang.Class newClazz)
-
-