Bug 50475 - Introduction of a Test Fragment Test Element for a better Include flow
Introduction of a Test Fragment Test Element for a better Include flow
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.3.4
Macintosh All
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-12-14 15:39 UTC by ansoni
Modified: 2010-12-15 22:10 UTC (History)
0 users



Attachments
testFragment Patch of MenuFactory, TestPlan and IncludeController to support this enhancement (6.41 KB, patch)
2010-12-14 15:39 UTC, ansoni
Details | Diff
TestFragmentController.java (961 bytes, text/plain)
2010-12-14 15:40 UTC, ansoni
Details
TestFragmentControllerGUI.java (3.32 KB, text/plain)
2010-12-14 15:40 UTC, ansoni
Details
Screenshot showing how this would exist in the Test Plan Tree (55.84 KB, image/png)
2010-12-14 15:41 UTC, ansoni
Details
user_manual patches for test_plan and component_reference (2.43 KB, patch)
2010-12-15 15:08 UTC, ansoni
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ansoni 2010-12-14 15:39:01 UTC
Created attachment 26403 [details]
testFragment Patch of MenuFactory, TestPlan and IncludeController to support this enhancement

The Include and Module controller logic currently has some bad user flows.  Here is the main one I see:

User Flow: Update Include File

1.  Open Existing Include File
    -- Contained Element is automatically added to WorkBench
2.  Edit File
3.  Click on desired Node
4.  File->Save Selection As
5.  Rename file if needed(it takes the name of the Node()
6.  Overwrite Existing?  -> Yes

This overly complicated flow is introduced because Include-type JMX files are second-rate citizens.  They are not part of a Test Plan so they cannot be automatically saved with Ctrl+S.  Also, since they cannot contain any save-able Thread Groups, they have to be debugged with another Test Plan that imports it.  This is another bad user-flow.

Enhancement:  Introduce a sub-TestPlan Test Element named Test Fragment that can be used for holding non-executing trees.

This element behaves like the Thread Group except that it doesn't execute during a Run->Start.  Since it exists underneath the Test Plan element, it can be saved in the more natural flow preventing users from accidentally over-writing their include file with a blank Test Plan.  The IncludeController would be enhanced to support importing these Test Fragments while maintaining support for the non-Test Plan JMX files that already exist.

A side-affect of this change is that a user could also create a Thread Group for the Include File that can Regress the Test Fragment logic by simply using the ModuleController to run the Test Fragment Tree.
Comment 1 ansoni 2010-12-14 15:40:08 UTC
Created attachment 26404 [details]
TestFragmentController.java
Comment 2 ansoni 2010-12-14 15:40:50 UTC
Created attachment 26405 [details]
TestFragmentControllerGUI.java
Comment 3 ansoni 2010-12-14 15:41:54 UTC
Created attachment 26406 [details]
Screenshot showing how this would exist in the Test Plan Tree
Comment 4 Sebb 2010-12-15 12:47:15 UTC
I've had a look at the patch. It seems to work well, and does not appear to affect existing test plans.

However, there are some odd bits of code that don't appear to do anything in the TestFragmentControllerGui class:

        if (element instanceof TestFragmentController) {
            TestFragmentController testFragmentController = (TestFragmentController) element;
        }

and

        if (controller instanceof TestFragmentController) {
        }

Is there some code missing here? Or should these code snippets be removed?
Comment 5 Sebb 2010-12-15 12:49:54 UTC
Forgot to mention - it would be useful to have a documentation patch for component_reference.xml if at all possible.
Comment 6 ansoni 2010-12-15 14:20:02 UTC
The instanceof portions were left-over from the re-use of an existing component.  No missing code... they can just be removed.

I will update the component_reference.xml and attach shortly.
Comment 7 ansoni 2010-12-15 15:08:50 UTC
Created attachment 26412 [details]
user_manual patches for test_plan and component_reference
Comment 8 ansoni 2010-12-15 15:11:53 UTC
Document patch attached.  New Section added in the test_plan.xml to give an overview of the Test Fragment Element and the Include Controller section updated to reflect the new flow.
Comment 9 Sebb 2010-12-15 22:10:35 UTC
Thanks very much. Patches applied with a few minor tweaks:

URL: http://svn.apache.org/viewvc?rev=1049771&view=rev
Log:
Bug 50475 - Introduction of a Test Fragment Test Element for a better Include flow

Added:
   jakarta/jmeter/trunk/docs/images/screenshots/test_fragment.png   (with props)
   jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/TestFragmentController.java   (with props)
   jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/TestFragmentControllerGui.java   (with props)
   jakarta/jmeter/trunk/xdocs/images/screenshots/test_fragment.png   (with props)
Modified:
   jakarta/jmeter/trunk/bin/saveservice.properties
   jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/IncludeController.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/control/gui/TestPlanGui.java
   jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/MenuFactory.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
   jakarta/jmeter/trunk/xdocs/usermanual/test_plan.xml

Code will be in nightly builds from r1049771