Java Doc for JUnitSampler.java in  » Testing » jakarta-jmeter » org » apache » jmeter » protocol » java » sampler » 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.protocol.java.sampler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.jmeter.samplers.AbstractSampler
   org.apache.jmeter.protocol.java.sampler.JUnitSampler

JUnitSampler
public class JUnitSampler extends AbstractSampler (Code)
This is a basic implementation that runs a single test method of a JUnit test case. The current implementation will use the string constructor first. If the test class does not declare a string constructor, the sampler will try empty constructor.


Field Summary
final public static  StringAPPEND_ERROR
    
final public static  StringAPPEND_EXCEPTION
    
final public static  StringCLASSNAME
     Property key representing the classname of the JavaSamplerClient to user.
final public static  StringCONSTRUCTORSTRING
    
final public static  StringDOSETUP
    
final public static  StringERROR
    
final public static  StringERRORCODE
    
final public static  StringFAILURE
    
final public static  StringFAILURECODE
    
final public static  StringFILTER
    
final public static  StringMETHOD
    
final public static  StringRUNTEST
    
final public static  StringSETUP
    
protected transient  MethodSETUP_METHOD
    
final public static  StringSUCCESS
    
final public static  StringSUCCESSCODE
    
protected transient  MethodTDOWN_METHOD
    
final public static  StringTEARDOWN
    
protected transient  TestCaseTEST_INSTANCE
    
protected  booleancheckStartUpTearDown
    

Constructor Summary
public  JUnitSampler()
    

Method Summary
public  booleangetAppendError()
     If append error is not set, by default it is set to false, which means users have to explicitly set the sampler to append the assert errors.
public  booleangetAppendException()
     If append exception is not set, by default it is set to false.
public static  ObjectgetClassInstance(String className, String label)
     If the method is not able to create a new instance of the class, it returns null and logs all the exceptions at warning level.
public  StringgetClassname()
    
public  StringgetConstructorString()
    
public  booleangetDoNotSetUpTearDown()
     if the sample shouldn't call setup/teardown, the method returns true.
public  StringgetError()
    
public  StringgetErrorCode()
     return the error code for the test method.
public  StringgetFailure()
    
public  StringgetFailureCode()
    
public  StringgetFilterString()
    
public  StringgetMethod()
    
public  MethodgetMethod(Object clazz, String method)
    
public  MethodgetRunTestMethod(Object clazz)
    
public  StringgetSuccess()
    
public  StringgetSuccessCode()
    
public  voidinitMethodObjects(TestCase tc)
    
public  SampleResultsample(Entry entry)
    
public  voidsetAppendError(boolean error)
    
public  voidsetAppendException(boolean exc)
    
public  voidsetClassname(String classname)
    
public  voidsetConstructorString(String constr)
     Set the string label used to create an instance of the test with the string constructor.
public  voidsetDoNotSetUpTearDown(boolean setup)
    
public  voidsetError(String error)
     provide a descriptive error for the test method.
public  voidsetErrorCode(String code)
     provide an unique error code for when the test does not pass the assert test.
public  voidsetFailure(String fail)
    
public  voidsetFailureCode(String code)
    
public  voidsetFilterString(String text)
    
public  voidsetMethod(String methodName)
     Method should add the JUnit testXXX method to the list at the end, since the sequence matters.
public  voidsetSuccess(String success)
    
public  voidsetSuccessCode(String code)
     set the succes code.

Field Detail
APPEND_ERROR
final public static String APPEND_ERROR(Code)



APPEND_EXCEPTION
final public static String APPEND_EXCEPTION(Code)



CLASSNAME
final public static String CLASSNAME(Code)
Property key representing the classname of the JavaSamplerClient to user.



CONSTRUCTORSTRING
final public static String CONSTRUCTORSTRING(Code)



DOSETUP
final public static String DOSETUP(Code)



ERROR
final public static String ERROR(Code)



ERRORCODE
final public static String ERRORCODE(Code)



FAILURE
final public static String FAILURE(Code)



FAILURECODE
final public static String FAILURECODE(Code)



FILTER
final public static String FILTER(Code)



METHOD
final public static String METHOD(Code)



RUNTEST
final public static String RUNTEST(Code)



SETUP
final public static String SETUP(Code)



SETUP_METHOD
protected transient Method SETUP_METHOD(Code)



SUCCESS
final public static String SUCCESS(Code)



SUCCESSCODE
final public static String SUCCESSCODE(Code)



TDOWN_METHOD
protected transient Method TDOWN_METHOD(Code)



TEARDOWN
final public static String TEARDOWN(Code)



TEST_INSTANCE
protected transient TestCase TEST_INSTANCE(Code)



checkStartUpTearDown
protected boolean checkStartUpTearDown(Code)




Constructor Detail
JUnitSampler
public JUnitSampler()(Code)




Method Detail
getAppendError
public boolean getAppendError()(Code)
If append error is not set, by default it is set to false, which means users have to explicitly set the sampler to append the assert errors. Because of how junit works, there should only be one error



getAppendException
public boolean getAppendException()(Code)
If append exception is not set, by default it is set to false. Users have to explicitly set it to true to see the exceptions in the result tree.



getClassInstance
public static Object getClassInstance(String className, String label)(Code)
If the method is not able to create a new instance of the class, it returns null and logs all the exceptions at warning level.



getClassname
public String getClassname()(Code)
Gets the Classname attribute of the JavaConfig object the Classname value



getConstructorString
public String getConstructorString()(Code)
get the string passed to the string constructor



getDoNotSetUpTearDown
public boolean getDoNotSetUpTearDown()(Code)
if the sample shouldn't call setup/teardown, the method returns true. It's meant for onetimesetup and onetimeteardown.



getError
public String getError()(Code)
return the descriptive error for the test



getErrorCode
public String getErrorCode()(Code)
return the error code for the test method. it should be an unique error code.



getFailure
public String getFailure()(Code)
get the failure message



getFailureCode
public String getFailureCode()(Code)
The failure code is used by other components



getFilterString
public String getFilterString()(Code)
return the comma separated string for the filter



getMethod
public String getMethod()(Code)
Return the name of the method to test



getMethod
public Method getMethod(Object clazz, String method)(Code)

Parameters:
  clazz -
Parameters:
  method - the method or null if an error occurred



getRunTestMethod
public Method getRunTestMethod(Object clazz)(Code)



getSuccess
public String getSuccess()(Code)
get the success message



getSuccessCode
public String getSuccessCode()(Code)
get the success code defined by the user



initMethodObjects
public void initMethodObjects(TestCase tc)(Code)
Method tries to get the setUp and tearDown method for the class
Parameters:
  tc -



sample
public SampleResult sample(Entry entry)(Code)



setAppendError
public void setAppendError(boolean error)(Code)



setAppendException
public void setAppendException(boolean exc)(Code)



setClassname
public void setClassname(String classname)(Code)
Sets the Classname attribute of the JavaConfig object
Parameters:
  classname - the new Classname value



setConstructorString
public void setConstructorString(String constr)(Code)
Set the string label used to create an instance of the test with the string constructor.
Parameters:
  constr -



setDoNotSetUpTearDown
public void setDoNotSetUpTearDown(boolean setup)(Code)
set the setup/teardown option
Parameters:
  setup -



setError
public void setError(String error)(Code)
provide a descriptive error for the test method. For a description of the difference between failure and error, please refer to the following url http://junit.sourceforge.net/doc/faq/faq.htm#tests_9
Parameters:
  error -



setErrorCode
public void setErrorCode(String code)(Code)
provide an unique error code for when the test does not pass the assert test.
Parameters:
  code -



setFailure
public void setFailure(String fail)(Code)
set the failure message
Parameters:
  fail -



setFailureCode
public void setFailureCode(String code)(Code)
Provide some unique code to denote a type of failure
Parameters:
  code -



setFilterString
public void setFilterString(String text)(Code)
set the filter string in comman separated format
Parameters:
  text -



setMethod
public void setMethod(String methodName)(Code)
Method should add the JUnit testXXX method to the list at the end, since the sequence matters.
Parameters:
  methodName -



setSuccess
public void setSuccess(String success)(Code)
set the success message
Parameters:
  success -



setSuccessCode
public void setSuccessCode(String code)(Code)
set the succes code. the success code should be unique.
Parameters:
  code -




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