|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.util.JMeterUtils
This class contains the static utility methods used by JMeter.
Field Summary | |
static String |
CLASSFINDER
|
static String |
ELEMENTS
|
static String |
ENGINE
|
static String |
FTP
|
static String |
GUI
|
static String |
HTTP
|
static String |
JAVA
|
static String |
JDBC
|
static String |
JMETER
|
static String |
PROPERTIES
|
static String |
RES_KEY_PFX
|
static String |
TEST
|
static String |
UTIL
|
Constructor Summary | |
JMeterUtils()
|
Method Summary | |
static void |
addLocaleChangeListener(LocaleChangeListener listener)
author Oliver Rossmueller |
static JButton |
createButton(String name,
ActionListener listener)
Create a button with the netscape style |
static JButton |
createSimpleButton(String name,
ActionListener listener)
Create a button with the netscape style |
static int |
findInArray(String[] array,
String value)
Finds a string in an array of strings and returns the |
static Hashtable |
getAlias(Properties properties)
Creates the vector of alias strings. |
static Vector |
getControllers(Properties properties)
Creates a vector of SampleController plugins. |
static String |
getExtendedFrameTitle(String fname)
Builds the string used as the main frame title |
static Hashtable |
getHashtable(Properties properties,
String name)
Creates a table of strings for all the properties that start with a common prefix. |
static ImageIcon |
getImage(String name)
This looks for the requested image in the classpath under org.apache.jmeter.images. |
static String |
getJMeterCopyright()
Gets the JMeter copyright. |
static String |
getJMeterHome()
|
static Properties |
getJMeterProperties()
This gets the currently defined appProperties. |
static String |
getJMeterVersion()
Gets the JMeter Version. |
static Locale |
getLocale()
Gets the current locale. |
static org.apache.oro.text.regex.Perl5Matcher |
getMatcher()
Gets Perl5Matcher for this thread. |
static org.apache.oro.text.PatternCacheLRU |
getPatternCache()
|
static boolean |
getPropDefault(String propName,
boolean defaultVal)
Get a boolean value with default if not present. |
static int |
getPropDefault(String propName,
int defaultVal)
Get a int value with default if not present. |
static long |
getPropDefault(String propName,
long defaultVal)
Get a long value with default if not present. |
static String |
getPropDefault(String propName,
String defaultVal)
Get a String value with default if not present. |
static Properties |
getProperties(String file)
This method is used by the init method to load the property file that may even reside in the user space, or in the classpath under org.apache.jmeter.jmeter.properties. |
static String |
getProperty(String propName)
Get a String value with NO default if not present. |
static int |
getRandomInt(int r)
Provide random numbers |
static String |
getResourceFileAsText(String name)
|
static String |
getResString(String key)
Gets the resource string for this key. |
static String |
getResString(String key,
String defaultValue)
Deprecated. Only intended for use in development; use getResString(String) normally |
static String[] |
getSearchPaths()
|
static String[] |
getTestSamples(Properties properties,
String name)
Create a string of class names for a particular SamplerController |
static Vector |
getTimers(Properties properties)
Creates the vector of Timers plugins. |
static Vector |
getVector(Properties properties,
String name)
Creates a vector of strings for all the properties that start with a common prefix. |
static Vector |
getVisualizers(Properties properties)
Creates the vector of visualizer plugins. |
static org.xml.sax.XMLReader |
getXMLParser()
Create an instance of an org.xml.sax.Parser based on the default props. |
static org.xml.sax.XMLReader |
getXMLParser(Properties properties)
Deprecated. use the plain version instead. We are using JAXP! |
void |
initializeProperties(String file)
Your implementation will be handed the filename that was provided to AllTests as a configuration file. |
static Object |
instantiate(String className,
String impls)
Instatiate an object and guarantee its class. |
static Vector |
instantiate(Vector v,
String className)
Instantiate a vector of classes |
static boolean |
isExpertMode()
Determine whether we are in 'expert' mode. |
static void |
removeLocaleChangeListener(LocaleChangeListener listener)
author Oliver Rossmueller |
static void |
reportErrorToUser(String errorMsg)
Report an error through a dialog box. |
static void |
selJComboBoxItem(Properties properties,
JComboBox combo,
Vector namVec,
String name)
Sets the selection of the JComboBox to the Object 'name' from the list in namVec. |
static void |
setJMeterHome(String home)
|
static void |
setLocale(Locale loc)
Changes the current locale: re-reads resource strings and notifies listeners. |
static Object |
setProperty(String propName,
String propValue)
Set a String value |
static String[] |
split(String splittee,
String splitChar,
String def)
Takes a String and a tokenizer character, and returns a new array of strings of the string split by the tokenizer character. |
static Vector |
tokenize(String string,
String separator)
Tokenize a string into a vector of tokens |
static String |
unsplit(Object[] splittee,
Object splitChar)
Takes an array of strings and a tokenizer character, and returns a string of all the strings concatenated with the tokenizer string in between each one. |
static String |
unsplit(Object[] splittee,
Object splitChar,
String def)
Takes an array of strings and a tokenizer character, and returns a string of all the strings concatenated with the tokenizer string in between each one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String RES_KEY_PFX
public static final String JMETER
public static final String ENGINE
public static final String ELEMENTS
public static final String GUI
public static final String UTIL
public static final String CLASSFINDER
public static final String TEST
public static final String HTTP
public static final String JDBC
public static final String FTP
public static final String JAVA
public static final String PROPERTIES
Constructor Detail |
public JMeterUtils()
Method Detail |
public static org.apache.oro.text.regex.Perl5Matcher getMatcher()
public static Properties getProperties(String file)
file
- the file to load
public static org.apache.oro.text.PatternCacheLRU getPatternCache()
public void initializeProperties(String file)
UnitTestManager
initializeProperties
in interface UnitTestManager
file
- public static String[] getSearchPaths()
public static int getRandomInt(int r)
r
- - the upper bound (exclusive)public static void setLocale(Locale loc)
loc
- - new localepublic static Locale getLocale()
public static void addLocaleChangeListener(LocaleChangeListener listener)
public static void removeLocaleChangeListener(LocaleChangeListener listener)
public static String getResString(String key)
key
- the key in the resource file
public static String getResString(String key, String defaultValue)
key
- the key in the resource filedefaultValue
- - the default value
public static Properties getJMeterProperties()
getProperties(String)
method is called.
public static ImageIcon getImage(String name)
name
- Description of Parameter
public static String getResourceFileAsText(String name)
public static Vector getTimers(Properties properties)
properties
- Description of Parameter
public static Vector getVisualizers(Properties properties)
properties
- Description of Parameter
public static Vector getControllers(Properties properties)
properties
- The properties with information about the samplers
public static String[] getTestSamples(Properties properties, String name)
properties
- The properties with info about the samples.name
- The name of the sampler controller.
public static org.xml.sax.XMLReader getXMLParser(Properties properties)
properties
- The properties file containing the parser's class name
public static org.xml.sax.XMLReader getXMLParser()
public static Hashtable getAlias(Properties properties)
properties
- Description of Parameter
public static Vector getVector(Properties properties, String name)
properties
- Description of Parametername
- Description of Parameter
public static Hashtable getHashtable(Properties properties, String name)
properties
- Description of Parametername
- Description of Parameter
public static int getPropDefault(String propName, int defaultVal)
propName
- the name of the property.defaultVal
- the default value.
public static boolean getPropDefault(String propName, boolean defaultVal)
propName
- the name of the property.defaultVal
- the default value.
public static long getPropDefault(String propName, long defaultVal)
propName
- the name of the property.defaultVal
- the default value.
public static String getPropDefault(String propName, String defaultVal)
propName
- the name of the property.defaultVal
- the default value.
public static String getProperty(String propName)
propName
- the name of the property.
public static Object setProperty(String propName, String propValue)
propName
- the name of the property.propValue
- the value of the property
public static void selJComboBoxItem(Properties properties, JComboBox combo, Vector namVec, String name)
public static Object instantiate(String className, String impls)
className
- The name of the class to instantiate.impls
- The name of the class it subclases.
public static Vector instantiate(Vector v, String className)
v
- Description of ParameterclassName
- Description of Parameter
public static Vector tokenize(String string, String separator)
string
- Description of Parameterseparator
- Description of Parameter
public static JButton createButton(String name, ActionListener listener)
name
- Description of Parameterlistener
- Description of Parameter
public static JButton createSimpleButton(String name, ActionListener listener)
name
- Description of Parameterlistener
- Description of Parameter
public static String[] split(String splittee, String splitChar, String def)
splittee
- String to be splitsplitChar
- Character to split the string ondef
- Default value to place between two split chars that
have nothing between them
public static void reportErrorToUser(String errorMsg)
errorMsg
- the error message.public static int findInArray(String[] array, String value)
array
- Array of strings.value
- String to compare to array values.
public static String unsplit(Object[] splittee, Object splitChar)
splittee
- Array of Objects to be concatenated.splitChar
- Object to unsplit the strings with.
public static String unsplit(Object[] splittee, Object splitChar, String def)
splittee
- Array of Objects to be concatenated.splitChar
- Object to unsplit the strings with.def
- Default value to replace null values in array.
public static String getJMeterHome()
public static void setJMeterHome(String home)
public static String getJMeterVersion()
public static String getJMeterCopyright()
public static String getExtendedFrameTitle(String fname)
fname
- the fully qualified name of the current working file
public static boolean isExpertMode()
|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |