public class BMUnit
extends java.lang.Object
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 java.lang.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 java.lang.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(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 boolean isAllowConfigUpdate()
public static boolean isVerbose()
public static boolean isDebug()
public static boolean isBMUnitVerbose()
public static java.lang.String getLoadDirectory()
public static java.lang.String getResourceLoadDirectory()
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
- if the script cannot be loadedpublic 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
- if the script cannot be loadedpublic static void unloadScriptFile(java.lang.Class<?> clazz, java.lang.String testName) throws java.lang.Exception
clazz
- the test classtestName
- the test namejava.lang.Exception
- if the script cannot be unloadedpublic 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
- if the script text cannot be loadedpublic static void unloadScriptText(java.lang.Class<?> clazz, java.lang.String testName) throws java.lang.Exception
clazz
- the test classtestName
- the test namejava.lang.Exception
- if the script text cannot be unloadedprotected 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 © 2015. All Rights Reserved.