I want to change the way JMeter's pop-up menu's are generated.  Currently,
implementors write code that creates JMenu items for every component they
build.  This has two unfortunate side-effects:
1. non-gui code is dependent on swing classes
2. For every type of add action, we need separate menus (ie, "add" and
"insert" can't use the same exact JMenu objects, because the actions must be
different).  Rather than add a "getInsertList()" method, I'd prefer another
alternative.

I see two choices.  One, have the classes return a structure that specifies
class names rather than fully created JMenu items.  This solves both
problems, but I don't like it.

The other choice, and the one I prefer, is to remove this "configuration"
stuff from the java files, and put them into an XML configuration file(s).
By doing this, we can specify a lot of the behavior of the classes in XML,
and, to some extent, it will be possible for a user to modify these files to
customize their experience (ie, they can cut out FTP & JDBC classes from
appearing if their just doing web testing).

Here is my five-minute effort at designing such an XML description of the
classes (it's obviously incomplete):

<?xml version="1.0" ?>

<jmeterConfig>
<!-- Should be obvious - components listed here will never show up in any
pop-up menu -->
<universalExclude>
        <label>HTTP Cookie</label>
        <label>Default Controller</label>
</universalExclude>

<!-- A mechanism for setting defaults by class type.  Say a develop creates
a new Logic Controller.  If they specify nothing in this file, then JMeter
will use this section to control
the new Logic Controller, because it matches the "type" given here. -->
<componentType>
        <type>org.apache.jmeter.control.LogicController</type>
        <label>Logic Controller</label>
        <addList id="default logic control"> <!-- has an id so can be reused
by other addList elements -->
                <components label="Logic Controllers">
        
<type>org.apache.jmeter.control.LogicController</type>
                </components>
                <components label="Generative Controllers">
        
<type>org.apache.jmeter.control.AbstractGenerativeController</type>
                </components>
                <components label="Config Elements">
                        <type>org.apache.jmeter.config.ConfigElements</type>
                </components>
        </addList>
</componentType>

<!-- description for the HTTP Request.  gives label, class, and the list of
components that show up in the "Add/insert" list. Note the use of "*" to
grab all elements that start with "HTTP" in their label, plus the
restriction that the elements must be of type "ConfigElement" -->
<component>
        <label>HTTP Request</label>
        
<class>org.apache.jmeter.protocol.http.control.HttpTestSample</class>
        <addList>
                <components>
                        <type>org.apache.jmeter.config.ConfigElement</type>
                        <label>HTTP*</label>
                </components>
        </addList>
</component>

<!-- Simple controller, doesn't need to specify add list, because it's of
type "LogicController", which was specified above -->
<component>
        <label>Simple Controller</label>
        <class>org.apache.jmeter.control.LogicController</class>        
</component>

<component>
        <label>Interleave Controller</label>
        <class>org.apache.jmeter.control.InterleaveController</class>   
</component>

<component>
        <label>Loop Controller</label>
        <class>org.apache.jmeter.control.LoopController</class> 
</component>

<component>
        <label>Once Only Controller</label>
        <class>org.apache.jmeter.control.OnceOnlyController</class>     
</component>

<!-- Uses the addlist from above, plus adds two more sections -->
<component>
        <label>Modification Manager</label>
        <class>org.apache.jmeter.control.ModifyController</class>       
        <addList refer="default logic control">
                <components label="Modifiers">
                        <type>org.apache.jmeter.control.Modifier</type>
                </components>
                <components label="Response Based Modifiers">
        
<type>org.apache.jmeter.control.ResponseBaseModifier</type>
                </components>
        </addList>
</component>

</jmeterConfig>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to