|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.byteman.contrib.bmunit.BMUnit
public class BMUnit
Byteman Unit test manager class which provides support for loading and unloading scripts. This version assumes loads the agent as needed (unless inhibited -- see below) using System properties to control what hostname and port it uses for the socket. Other system properties can be used to configure operation of the load/unload operations.
| Field Summary | |
|---|---|
static java.lang.String |
AGENT_HOST
System property specifying the host to be used when starting the agent and when submitting rules to it. |
static java.lang.String |
AGENT_INHIBIT
System property which inhibits automatic loading of the agent. |
static java.lang.String |
AGENT_PORT
System property specifying the port to be used when starting the agent and when submitting rules to it. |
static java.lang.String |
LOAD_DIRECTORY
System property which identifies the directory from which to start searching for rule script. |
static java.lang.String |
VERBOSE
System property which enables tracing of bmunit activity |
| Constructor Summary | |
|---|---|
BMUnit()
|
|
| Method Summary | |
|---|---|
protected static java.lang.String |
findScript(java.lang.String dir,
java.lang.String... names)
|
protected static java.lang.String |
findScript(java.lang.String dir,
java.lang.String name)
Tries to find dir/name in the working directory. |
static java.lang.String |
getHost()
getter for the host name used to communicate with the agent |
static int |
getPort()
getter for the port used to communicate with the agent |
static void |
loadScriptFile(java.lang.Class<?> clazz,
java.lang.String dir)
loads a script by calling loadScriptFile(clazz, null, dir) |
static void |
loadScriptFile(java.lang.Class<?> clazz,
java.lang.String testName,
java.lang.String dir)
loads a script from the load directory using the name of a unit test as the root name for the script file and ".btm" or, failing that, ".txt" for the file extension |
static void |
loadScriptText(java.lang.Class<?> clazz,
java.lang.String testname,
java.lang.String scriptText)
loads a script supplied as a text String rather than via a file on disk |
static void |
unloadScriptFile(java.lang.Class<?> clazz,
java.lang.String testName)
loads a script from the load directory using the name of a unit test as the root name for the script file and ".btm" or, failing that, ".txt" for the file extension |
static void |
unloadScriptText(java.lang.Class<?> clazz,
java.lang.String testName)
unloads a script previously supplied as a text String |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String LOAD_DIRECTORY
public static final java.lang.String AGENT_PORT
public static final java.lang.String AGENT_HOST
public static final java.lang.String AGENT_INHIBIT
public static final java.lang.String VERBOSE
| Constructor Detail |
|---|
public BMUnit()
| Method Detail |
|---|
public static java.lang.String getHost()
public static int getPort()
public static void loadScriptFile(java.lang.Class<?> clazz,
java.lang.String dir)
throws java.lang.Exception
clazz - the test classdir - the directory to load the script from
java.lang.Exception
public static void loadScriptFile(java.lang.Class<?> clazz,
java.lang.String testName,
java.lang.String dir)
throws java.lang.Exception
clazz - the classname of the unit testtestName - the name of the unit test methoddir - the directory in which the scripts are located
java.lang.Exception
public static void unloadScriptFile(java.lang.Class<?> clazz,
java.lang.String testName)
throws java.lang.Exception
clazz - the test classtestName - the test name
java.lang.Exception
public static void loadScriptText(java.lang.Class<?> clazz,
java.lang.String testname,
java.lang.String scriptText)
throws java.lang.Exception
clazz - the test classtestName - the test namescriptText - the text of the rule or rules contained in the script
java.lang.Exception
public static void unloadScriptText(java.lang.Class<?> clazz,
java.lang.String testName)
throws java.lang.Exception
clazz - the test classtestName - the test namescriptText - the text of the rule or rules contained in the script
java.lang.Exception
protected static java.lang.String findScript(java.lang.String dir,
java.lang.String name)
dir - The name of the directoryname - The file name
protected static java.lang.String findScript(java.lang.String dir,
java.lang.String... names)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||