public class BMUnit extends Object
Constructor | Description |
---|---|
BMUnit() |
Modifier and Type | Method | Description |
---|---|---|
protected static String |
findScript(String dir,
String name) |
Tries to find dir/name in the working directory.
|
protected static String |
findScript(String dir,
String... names) |
|
static String |
getHost() |
getter for the host name used to communicate with the agent
|
static String |
getLoadDirectory() |
getter for the load directory
|
static boolean |
getPolicy() |
getter for the security policy setting
|
static int |
getPort() |
getter for the port used to communicate with the agent
|
static String |
getResourceLoadDirectory() |
getter for the resource load directory
|
static boolean |
isAllowConfigUpdate() |
getter for the allowAgentConfigUpdate setting
|
static boolean |
isBMUnitVerbose() |
getter for the BMUnit verbose setting
|
static boolean |
isDebug() |
getter for the Byteman debug setting
|
static boolean |
isVerbose() |
getter for the Byteman verbose setting
|
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 boolean isAllowConfigUpdate()
public static boolean isVerbose()
public static boolean isDebug()
public static boolean isBMUnitVerbose()
public static String getLoadDirectory()
public static String getResourceLoadDirectory()
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 fromException
- if the script cannot be loadedpublic 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
- if the script cannot be loadedpublic static void unloadScriptFile(Class<?> clazz, String testName) throws Exception
clazz
- the test classtestName
- the test nameException
- if the script cannot be unloadedpublic 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
- if the script text cannot be loadedpublic static void unloadScriptText(Class<?> clazz, String testName) throws Exception
clazz
- the test classtestName
- the test nameException
- if the script text cannot be unloadedprotected static String findScript(String dir, String name)
dir
- The name of the directoryname
- The file nameCopyright © 2018. All rights reserved.