public class BMUnit extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AGENT_HOST
System property specifying the host to be used when starting the agent and when submitting
rules to it.
|
static String |
AGENT_INHIBIT
System property which inhibits automatic loading of the agent.
|
static String |
AGENT_PORT
System property specifying the port to be used when starting the agent and when submitting
rules to it.
|
static String |
LOAD_DIRECTORY
System property which identifies the directory from which to start searching
for rule script.
|
static String |
VERBOSE
System property which enables tracing of bmunit activity
|
Constructor and Description |
---|
BMUnit() |
Modifier and Type | Method and Description |
---|---|
protected static String |
findScript(String dir,
String... names) |
protected static String |
findScript(String dir,
String name)
Tries to find dir/name in the working directory.
|
static 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(Class<?> clazz,
String dir)
loads a script by calling loadScriptFile(clazz, null, dir)
|
static void |
loadScriptFile(Class<?> clazz,
String testName,
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(Class<?> clazz,
String testname,
String scriptText)
loads a script supplied as a text String rather than via a file on disk
|
static void |
unloadScriptFile(Class<?> clazz,
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(Class<?> clazz,
String testName)
unloads a script previously supplied as a text String
|
public static final String LOAD_DIRECTORY
public static final String AGENT_PORT
public static final String AGENT_HOST
public static final String AGENT_INHIBIT
public static final String VERBOSE
public static String getHost()
public static int getPort()
public static void loadScriptFile(Class<?> clazz, String dir) throws Exception
clazz
- the test classdir
- the directory to load the script fromException
public static void loadScriptFile(Class<?> clazz, String testName, String dir) throws Exception
clazz
- the classname of the unit testtestName
- the name of the unit test methoddir
- the directory in which the scripts are locatedException
public static void unloadScriptFile(Class<?> clazz, String testName) throws Exception
clazz
- the test classtestName
- the test nameException
public static void loadScriptText(Class<?> clazz, String testname, String scriptText) throws Exception
clazz
- the test classtestName
- the test namescriptText
- the text of the rule or rules contained in the scriptException
public static void unloadScriptText(Class<?> clazz, String testName) throws Exception
clazz
- the test classtestName
- the test namescriptText
- the text of the rule or rules contained in the scriptException
protected static String findScript(String dir, String name)
dir
- The name of the directoryname
- The file nameCopyright © 2013. All Rights Reserved.