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_POLICY
System property specifying whether to set a security policy when loading 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 |
RESOURCE_LOAD_DIRECTORY
System property which identifies the resource load 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 boolean |
getPolicy()
getter for the security policy setting
|
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 RESOURCE_LOAD_DIRECTORY
public static final String AGENT_PORT
public static final String AGENT_HOST
public static final String AGENT_POLICY
public static final String AGENT_INHIBIT
public static final String VERBOSE
public static String getHost()
public static int getPort()
public static boolean getPolicy()
public static void loadScriptFile(Class<?> clazz, String dir) throws Exception
clazz - the test classdir - the directory to load the script fromExceptionpublic 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 locatedExceptionpublic static void unloadScriptFile(Class<?> clazz, String testName) throws Exception
clazz - the test classtestName - the test nameExceptionpublic 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 scriptExceptionpublic static void unloadScriptText(Class<?> clazz, String testName) throws Exception
clazz - the test classtestName - the test nameExceptionprotected static String findScript(String dir, String name)
dir - The name of the directoryname - The file nameCopyright © 2018. All Rights Reserved.