public class BMUnit
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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_POLICY
System property specifying whether to set a security policy when loading 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 and Description |
---|
BMUnit() |
Modifier and Type | Method and Description |
---|---|
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 boolean |
getPolicy()
getter for the security policy setting
|
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
|
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_POLICY
public static final java.lang.String AGENT_INHIBIT
public static final java.lang.String VERBOSE
public static java.lang.String getHost()
public static int getPort()
public static boolean getPolicy()
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 fromjava.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 locatedjava.lang.Exception
public static void unloadScriptFile(java.lang.Class<?> clazz, java.lang.String testName) throws java.lang.Exception
clazz
- the test classtestName
- the test namejava.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 scriptjava.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 scriptjava.lang.Exception
protected static java.lang.String findScript(java.lang.String dir, java.lang.String name)
dir
- The name of the directoryname
- The file nameprotected static java.lang.String findScript(java.lang.String dir, java.lang.String... names)
Copyright © 2013. All Rights Reserved.