Java Doc for JMeterUtils.java in  » Testing » jakarta-jmeter » org » apache » jmeter » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jmeter.util.JMeterUtils

JMeterUtils
public class JMeterUtils implements UnitTestManager(Code)
This class contains the static utility methods used by JMeter.


Field Summary
final public static  StringRES_KEY_PFX
    


Method Summary
public static  voidaddLocaleChangeListener(LocaleChangeListener listener)
    
public static  JButtoncreateButton(String name, ActionListener listener)
    
public static  JButtoncreateSimpleButton(String name, ActionListener listener)
    
public static  FilefindFile(String fileName)
     Find a file in the current directory or in the JMeter bin directory.
public static  intfindInArray(String[] array, String value)
     Finds a string in an array of strings and returns the
Parameters:
  array - Array of strings.
Parameters:
  value - String to compare to array values.
public static  HashtablegetAlias(Properties properties)
     Creates the vector of alias strings.
public static  VectorgetControllers(Properties properties)
     Creates a vector of SampleController plugins.
public static  HashtablegetHashtable(Properties properties, String name)
     Creates a table of strings for all the properties that start with a common prefix.
public static  ImageIcongetImage(String name)
     This looks for the requested image in the classpath under org.apache.jmeter.images.
public static  ImageIcongetImage(String name, String description)
     This looks for the requested image in the classpath under org.apache.jmeter.images.
public static  StringgetJMeterBinDir()
     Get the JMeter bin directory - does not include the trailing separator.
public static  StringgetJMeterCopyright()
     Gets the JMeter copyright.
public static  StringgetJMeterHome()
     Get the JMeter home directory - does not include the trailing separator.
public static  PropertiesgetJMeterProperties()
     This gets the currently defined appProperties.
public static  StringgetJMeterVersion()
     Gets the JMeter Version.
public static  LocalegetLocale()
     Gets the current locale.
public static  Perl5MatchergetMatcher()
     Gets Perl5Matcher for this thread.
public static  PatterngetPattern(String expression)
     Get a compiled expression from the pattern cache (READ_ONLY).
Parameters:
  expression - compiled pattern
throws:
  org.apache.oro.text.regex.MalformedPatternException - (Runtime)This should be caught for expressions that may vary (e.g.
public static  PatterngetPattern(String expression, int options)
     Get a compiled expression from the pattern cache.
Parameters:
  expression - RE
Parameters:
  options - e.g.
public static  PatternCacheLRUgetPatternCache()
    
public static  intgetPropDefault(String propName, int defaultVal)
     Get a int value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value.
public static  booleangetPropDefault(String propName, boolean defaultVal)
     Get a boolean value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value.
public static  longgetPropDefault(String propName, long defaultVal)
     Get a long value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value.
public static  StringgetPropDefault(String propName, String defaultVal)
     Get a String value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value.
public static  PropertiesgetProperties(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.
public static  StringgetProperty(String propName)
     Get the value of a JMeter property.
Parameters:
  propName - the name of the property.
public static  intgetRandomInt(int r)
    
public static  StringgetResString(String key)
     Gets the resource string for this key.
public static  StringgetResString(String key, String defaultValue)
     Gets the resource string for this key.
public static  StringgetResourceFileAsText(String name)
    
public static  String[]getSearchPaths()
    
public static  String[]getTestSamples(Properties properties, String name)
     Create a string of class names for a particular SamplerController
Parameters:
  properties - The properties with info about the samples.
Parameters:
  name - The name of the sampler controller.
public static  VectorgetTimers(Properties properties)
     Creates the vector of Timers plugins.
public static  VectorgetVector(Properties properties, String name)
     Creates a vector of strings for all the properties that start with a common prefix.
public static  VectorgetVisualizers(Properties properties)
     Creates the vector of visualizer plugins.
public static  XMLReadergetXMLParser()
     Create an instance of an org.xml.sax.Parser based on the default props.
public static  voidinitLocale()
    
public static  voidinitLogging()
    
public  voidinitializeProperties(String file)
    
public static  Objectinstantiate(String className, String impls)
     Instatiate an object and guarantee its class.
Parameters:
  className - The name of the class to instantiate.
Parameters:
  impls - The name of the class it subclases.
public static  Vectorinstantiate(Vector v, String className)
    
public static  booleanisExpertMode()
     Determine whether we are in 'expert' mode.
public static  voidloadJMeterProperties(String file)
     Load the JMeter properties file; if not found, then default to "org/apache/jmeter/jmeter.properties" from the classpath c.f.
public static  PropertiesloadProperties(String file)
    
public static  voidremoveLocaleChangeListener(LocaleChangeListener listener)
    
public static  voidreportErrorToUser(String errorMsg)
     Report an error through a dialog box.
public static  voidreportErrorToUser(String errorMsg, String titleMsg)
     Report an error through a dialog box.
public static  voidselJComboBoxItem(Properties properties, JComboBox combo, Vector namVec, String name)
     Sets the selection of the JComboBox to the Object 'name' from the list in namVec.
public static  voidsetJMeterHome(String home)
    
public static  voidsetLocale(Locale loc)
     Changes the current locale: re-reads resource strings and notifies listeners.
public static  ObjectsetProperty(String propName, String propValue)
    
public static  Vectortokenize(String string, String separator)
    
public static  Stringunsplit(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.
Parameters:
  splittee - Array of Objects to be concatenated.
Parameters:
  splitChar - Object to unsplit the strings with.
public static  Stringunsplit(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.
Parameters:
  splittee - Array of Objects to be concatenated.
Parameters:
  splitChar - Object to unsplit the strings with.
Parameters:
  def - Default value to replace null values in array.

Field Detail
RES_KEY_PFX
final public static String RES_KEY_PFX(Code)





Method Detail
addLocaleChangeListener
public static void addLocaleChangeListener(LocaleChangeListener listener)(Code)



createButton
public static JButton createButton(String name, ActionListener listener)(Code)
Create a button with the netscape style
Parameters:
  name - Description of Parameter
Parameters:
  listener - Description of Parameter Description of the Returned Value



createSimpleButton
public static JButton createSimpleButton(String name, ActionListener listener)(Code)
Create a button with the netscape style
Parameters:
  name - Description of Parameter
Parameters:
  listener - Description of Parameter Description of the Returned Value



findFile
public static File findFile(String fileName)(Code)
Find a file in the current directory or in the JMeter bin directory.
Parameters:
  fileName - File object



findInArray
public static int findInArray(String[] array, String value)(Code)
Finds a string in an array of strings and returns the
Parameters:
  array - Array of strings.
Parameters:
  value - String to compare to array values. Index of value in array, or -1 if not in array.



getAlias
public static Hashtable getAlias(Properties properties)(Code)
Creates the vector of alias strings.
Parameters:
  properties - Description of Parameter The Alias value



getControllers
public static Vector getControllers(Properties properties)(Code)
Creates a vector of SampleController plugins.
Parameters:
  properties - The properties with information about the samplers The Controllers value



getHashtable
public static Hashtable getHashtable(Properties properties, String name)(Code)
Creates a table of strings for all the properties that start with a common prefix.
Parameters:
  properties - Description of Parameter
Parameters:
  name - Description of Parameter The Hashtable value



getImage
public static ImageIcon getImage(String name)(Code)
This looks for the requested image in the classpath under org.apache.jmeter.images.
Parameters:
  name - Description of Parameter The Image value



getImage
public static ImageIcon getImage(String name, String description)(Code)
This looks for the requested image in the classpath under org.apache.jmeter.images. , and also sets the description of the image, which is useful if the icon is going to be placed on the clipboard.
Parameters:
  name - the name of the image
Parameters:
  description - the description of the image The Image value



getJMeterBinDir
public static String getJMeterBinDir()(Code)
Get the JMeter bin directory - does not include the trailing separator. the bin directory



getJMeterCopyright
public static String getJMeterCopyright()(Code)
Gets the JMeter copyright. the JMeter copyright string



getJMeterHome
public static String getJMeterHome()(Code)
Get the JMeter home directory - does not include the trailing separator. the home directory



getJMeterProperties
public static Properties getJMeterProperties()(Code)
This gets the currently defined appProperties. It can only be called after the JMeterUtils.getProperties(String) method is called. The JMeterProperties value



getJMeterVersion
public static String getJMeterVersion()(Code)
Gets the JMeter Version. the JMeter version string



getLocale
public static Locale getLocale()(Code)
Gets the current locale. current locale



getMatcher
public static Perl5Matcher getMatcher()(Code)
Gets Perl5Matcher for this thread.



getPattern
public static Pattern getPattern(String expression)(Code)
Get a compiled expression from the pattern cache (READ_ONLY).
Parameters:
  expression - compiled pattern
throws:
  org.apache.oro.text.regex.MalformedPatternException - (Runtime)This should be caught for expressions that may vary (e.g. user input)



getPattern
public static Pattern getPattern(String expression, int options)(Code)
Get a compiled expression from the pattern cache.
Parameters:
  expression - RE
Parameters:
  options - e.g. READ_ONLY_MASK compiled pattern
throws:
  org.apache.oro.text.regex.MalformedPatternException - (Runtime)This should be caught for expressions that may vary (e.g. user input)



getPatternCache
public static PatternCacheLRU getPatternCache()(Code)



getPropDefault
public static int getPropDefault(String propName, int defaultVal)(Code)
Get a int value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value. The PropDefault value



getPropDefault
public static boolean getPropDefault(String propName, boolean defaultVal)(Code)
Get a boolean value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value. The PropDefault value



getPropDefault
public static long getPropDefault(String propName, long defaultVal)(Code)
Get a long value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value. The PropDefault value



getPropDefault
public static String getPropDefault(String propName, String defaultVal)(Code)
Get a String value with default if not present.
Parameters:
  propName - the name of the property.
Parameters:
  defaultVal - the default value. The PropDefault value



getProperties
public static Properties getProperties(String file)(Code)
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. The method also initialises logging and sets up the default Locale TODO - perhaps remove? [still used
Parameters:
  file - the file to load the Properties from the file



getProperty
public static String getProperty(String propName)(Code)
Get the value of a JMeter property.
Parameters:
  propName - the name of the property. the value of the JMeter property, or null if not defined



getRandomInt
public static int getRandomInt(int r)(Code)
Provide random numbers
Parameters:
  r - -the upper bound (exclusive)



getResString
public static String getResString(String key)(Code)
Gets the resource string for this key. If the resource is not found, a warning is logged
Parameters:
  key - the key in the resource file the resource string if the key is found; otherwise, return"[res_key="+key+"]"



getResString
public static String getResString(String key, String defaultValue)(Code)
Gets the resource string for this key. If the resource is not found, a warning is logged
Parameters:
  key - the key in the resource file
Parameters:
  defaultValue - -the default value the resource string if the key is found; otherwise, return thedefault



getResourceFileAsText
public static String getResourceFileAsText(String name)(Code)



getSearchPaths
public static String[] getSearchPaths()(Code)



getTestSamples
public static String[] getTestSamples(Properties properties, String name)(Code)
Create a string of class names for a particular SamplerController
Parameters:
  properties - The properties with info about the samples.
Parameters:
  name - The name of the sampler controller. The TestSamples value



getTimers
public static Vector getTimers(Properties properties)(Code)
Creates the vector of Timers plugins.
Parameters:
  properties - Description of Parameter The Timers value



getVector
public static Vector getVector(Properties properties, String name)(Code)
Creates a vector of strings for all the properties that start with a common prefix.
Parameters:
  properties - Description of Parameter
Parameters:
  name - Description of Parameter The Vector value



getVisualizers
public static Vector getVisualizers(Properties properties)(Code)
Creates the vector of visualizer plugins.
Parameters:
  properties - Description of Parameter The Visualizers value



getXMLParser
public static XMLReader getXMLParser()(Code)
Create an instance of an org.xml.sax.Parser based on the default props. The XMLParser value



initLocale
public static void initLocale()(Code)
Initialise the JMeter Locale



initLogging
public static void initLogging()(Code)
Initialise JMeter logging



initializeProperties
public void initializeProperties(String file)(Code)



instantiate
public static Object instantiate(String className, String impls)(Code)
Instatiate an object and guarantee its class.
Parameters:
  className - The name of the class to instantiate.
Parameters:
  impls - The name of the class it subclases. Description of the Returned Value



instantiate
public static Vector instantiate(Vector v, String className)(Code)
Instantiate a vector of classes
Parameters:
  v - Description of Parameter
Parameters:
  className - Description of Parameter Description of the Returned Value



isExpertMode
public static boolean isExpertMode()(Code)
Determine whether we are in 'expert' mode. Certain features may be hidden from user's view unless in expert mode. true iif we're in expert mode



loadJMeterProperties
public static void loadJMeterProperties(String file)(Code)
Load the JMeter properties file; if not found, then default to "org/apache/jmeter/jmeter.properties" from the classpath c.f. loadProperties



loadProperties
public static Properties loadProperties(String file)(Code)
This method loads a property file that may reside in the user space, or in the classpath
Parameters:
  file - the file to load the Properties from the file



removeLocaleChangeListener
public static void removeLocaleChangeListener(LocaleChangeListener listener)(Code)



reportErrorToUser
public static void reportErrorToUser(String errorMsg)(Code)
Report an error through a dialog box. Title defaults to "error_title" resource string
Parameters:
  errorMsg - - the error message.



reportErrorToUser
public static void reportErrorToUser(String errorMsg, String titleMsg)(Code)
Report an error through a dialog box.
Parameters:
  errorMsg - - the error message.
Parameters:
  titleMsg - - title string



selJComboBoxItem
public static void selJComboBoxItem(Properties properties, JComboBox combo, Vector namVec, String name)(Code)
Sets the selection of the JComboBox to the Object 'name' from the list in namVec.



setJMeterHome
public static void setJMeterHome(String home)(Code)



setLocale
public static void setLocale(Locale loc)(Code)
Changes the current locale: re-reads resource strings and notifies listeners.
Parameters:
  loc - -new locale



setProperty
public static Object setProperty(String propName, String propValue)(Code)
Set a String value
Parameters:
  propName - the name of the property.
Parameters:
  propValue - the value of the property the previous value of the property



tokenize
public static Vector tokenize(String string, String separator)(Code)
Tokenize a string into a vector of tokens
Parameters:
  string - Description of Parameter
Parameters:
  separator - Description of Parameter Description of the Returned Value



unsplit
public static String unsplit(Object[] splittee, Object splitChar)(Code)
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.
Parameters:
  splittee - Array of Objects to be concatenated.
Parameters:
  splitChar - Object to unsplit the strings with. Array of all the tokens.



unsplit
public static String unsplit(Object[] splittee, Object splitChar, String def)(Code)
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.
Parameters:
  splittee - Array of Objects to be concatenated.
Parameters:
  splitChar - Object to unsplit the strings with.
Parameters:
  def - Default value to replace null values in array. Array of all the tokens.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.