public class BMUnitConfigState extends Object
Modifier and Type | Field | 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 |
BMUNIT_VERBOSE |
System property which enables tracing of bmunit activity
|
static String |
BYTEMAN_ALLOW_CONFIG_UPDATE |
System property which enables tracing of Byteman activity
|
static String |
BYTEMAN_DEBUG |
System property which enables printing of Byteman rule debug statements
|
static String |
BYTEMAN_DUMP_GENERATED_CLASSES |
System property which enables dumping of generated classes
|
static String |
BYTEMAN_DUMP_GENERATED_CLASSES_DIRECTORY |
System property which configures directory path for files used for dumping of generated classes
|
static String |
BYTEMAN_DUMP_GENERATED_CLASSES_INTERMEDIATE |
System property which configures dumping of intermediate versions of generated classes
|
static String |
BYTEMAN_VERBOSE |
System property which enables tracing of Byteman activity
|
static BMUnitConfigState |
defaultConfigState |
a default configuration state used when a test class does not specify
a configuration state.
|
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 |
this is only provided for backward compatibility in case some app was
using this constant string to configure the required property.
|
Modifier and Type | Method | Description |
---|---|---|
BMUnitConfigState |
currentConfigState() |
|
static BMUnitConfigState |
getCurrentConfigState() |
the global configuration state which configures the operation
of BMUnit when running tests in a specific class or a method
in that class.
|
String |
getDumpGeneratedClassesDirectory() |
smart getter for current dumpGeneratedClassesDirectory setting
which only returns a directory when dumpGeneratedClasses is set
in which case it uses any current setting but delegates to previous
if no value has been set.
|
String |
getHost() |
getter for currently configured agent host setting
|
String |
getLoadDirectory() |
getter for currently configured load directory setting
|
int |
getPort() |
getter for currently configured agent port setting
|
String |
getResourceLoadDirectory() |
getter for currently configured resource directory setting
|
boolean |
isAllowConfigUpdate() |
smart getter for currently configured allowAgentConfigUpdate setting
which redirects through to the previous config to ensure that
we employ the setting used for the initial agent load
|
boolean |
isBMUnitVerbose() |
getter for currently configured BMUnit verbose setting
|
boolean |
isDebug() |
smart getter for currently configured Byteman debug setting
which redirects through to the previous config if config
updates are not allowed but otherwise returns the currently
configured Byteman debug setting
|
boolean |
isDumpGeneratedClasses() |
getter for current dumpGeneratedClasses setting
|
boolean |
isDumpGeneratedClassesIntermediate() |
smart getter for current dumpGeneratedClassesIntermediate setting
which only returns the attribute setting if dumpGeneratedClasses
has also been set.
|
boolean |
isInhibitAgentLoad() |
smart getter for currently configured inhibitAgentLoad setting
which redirects through to the previous config to ensure that
we employ the setting used for the initial agent load
|
boolean |
isPolicy() |
smart getter for currently configured policy setting
which redirects through to the previous config to ensure that
we employ the setting used for the initial agent load
|
boolean |
isVerbose() |
smart getter for currently configured Byteman verbose setting
which redirects through to the previous config if config
updates are not allowed but otherwise returns the currently
configured Byteman verbose setting
|
static void |
popConfigurationState(Class<?> testClass) |
|
static void |
popConfigurationState(Method method) |
|
static void |
pushConfigurationState(BMUnitConfig config,
Class<?> testClass) |
install the configuration for a specific test class, possibly
also adopting it as the default configuration
this method is not thread-safe.
|
static void |
pushConfigurationState(BMUnitConfig config,
Method method) |
|
static void |
resetConfigurationState(Class<?> testClass) |
|
static void |
resetConfigurationState(Method method) |
public static BMUnitConfigState defaultConfigState
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 BYTEMAN_ALLOW_CONFIG_UPDATE
public static final String BYTEMAN_VERBOSE
public static final String BYTEMAN_DEBUG
public static final String BMUNIT_VERBOSE
public static final String BYTEMAN_DUMP_GENERATED_CLASSES
public static final String BYTEMAN_DUMP_GENERATED_CLASSES_DIRECTORY
public static final String BYTEMAN_DUMP_GENERATED_CLASSES_INTERMEDIATE
public static final String VERBOSE
public static void pushConfigurationState(BMUnitConfig config, Class<?> testClass) throws Exception
config
- the config to install or null if no config is availabletestClass
- the test class which may or may not have an
associated configException
- if the config cannot be installed or an agent
load error occurspublic static void popConfigurationState(Class<?> testClass) throws Exception
Exception
public static void pushConfigurationState(BMUnitConfig config, Method method) throws Exception
Exception
public static void popConfigurationState(Method method) throws Exception
Exception
public static void resetConfigurationState(Method method) throws Exception
Exception
public static void resetConfigurationState(Class<?> testClass) throws Exception
Exception
public static BMUnitConfigState getCurrentConfigState()
public BMUnitConfigState currentConfigState()
public String getHost()
public int getPort()
public String getLoadDirectory()
public String getResourceLoadDirectory()
public boolean isAllowConfigUpdate()
public boolean isVerbose()
public boolean isDebug()
public boolean isBMUnitVerbose()
public boolean isInhibitAgentLoad()
public boolean isPolicy()
public boolean isDumpGeneratedClasses()
public String getDumpGeneratedClassesDirectory()
public boolean isDumpGeneratedClassesIntermediate()
Copyright © 2018. All rights reserved.