Bug 50490

Summary: Setup and Post Thread Group enhancements for better test flow.
Product: JMeter - Now in Github Reporter: ansoni
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: Nightly (Please specify date)   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Attachments: Patch of JMeter Engine and documentation for fix
New Files include classes and document images

Description ansoni 2010-12-16 16:02:42 UTC
Patch generated against revision 1050154(current as of a few minutes ago).

A common problem that my team has had and one that I recently saw on the User-list is the need to execute pre and post test actions.  The traditional way to do this is by using 3 threads with "Run Thread Groups consecutively".  Unfortunately, this highly constrains the flow of the test.

A simple fix to this is to have 2 special Thread Group elements that will behave like normal Thread Groups except that they are executed before or after a test.  The idea here is that a "Setup Thread Group" can be used for activities like creating accounts, setup of test monitoring, ... etc.  The "Post Thread Group" would be for cleanup activities or even the posting of Test Results via a BSH Sampler or custom Java class.

Overall, the idea behind this patch is to simplify the more advanced test plans with better organization and easier to follow flows.

I will be Attaching a zip file and a patch.  The zip contains all the new additions to the source tree.

The patch includes the updates to the JMeter Engine and documentation.
Comment 1 ansoni 2010-12-16 16:03:42 UTC
Created attachment 26416 [details]
Patch of JMeter Engine and documentation for fix
Comment 2 ansoni 2010-12-16 16:04:34 UTC
Created attachment 26417 [details]
New Files include classes and document images
Comment 3 Sebb 2010-12-17 11:57:34 UTC
Thanks very much - a very useful enhancement.

Code committed to SVN:

URL: http://svn.apache.org/viewvc?rev=1050447&view=rev
Log:
Bug 50490 - Setup and Post Thread Group enhancements for better test flow.

Added:
   jakarta/jmeter/trunk/docs/images/screenshots/post_thread_group.png   (with props)
   jakarta/jmeter/trunk/docs/images/screenshots/setup_thread_group.png   (with props)
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/PostThreadGroup.java   (with props)
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/SetupThreadGroup.java   (with props)
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/PostThreadGroupGui.java   (with props)
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/SetupThreadGroupGui.java   (with props)
   jakarta/jmeter/trunk/xdocs/images/screenshots/post_thread_group.png   (with props)
   jakarta/jmeter/trunk/xdocs/images/screenshots/setup_thread_group.png   (with props)
Modified:
   jakarta/jmeter/trunk/bin/saveservice.properties
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
   jakarta/jmeter/trunk/xdocs/changes.xml
   jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml


I had to make some changes to the StandardJMeterEngine code, as it was detecting end of test after the setup and post groups as well as after normal thread groups. Also the code now checks for the presence of setup/post groups before processing them and logging messages for them.

Also the messages.properties update was missing from the patch.
Comment 4 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2444