jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1763086 - in /jmeter/trunk: src/components/org/apache/jmeter/control/ src/components/org/apache/jmeter/control/gui/ src/core/org/apache/jmeter/resources/ xdocs/ xdocs/usermanual/
Date Sun, 02 Oct 2016 17:14:45 GMT
Author: pmouawad
Date: Sun Oct  2 17:14:45 2016
New Revision: 1763086

URL: http://svn.apache.org/viewvc?rev=1763086&view=rev
Log:
Bug 60081 Interleave Controller : Add an option to alternate across threads
Bugzilla Id: 60081

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/InterleaveControl.java
    jmeter/trunk/src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml
    jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/InterleaveControl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/InterleaveControl.java?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/InterleaveControl.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/InterleaveControl.java Sun Oct 
2 17:14:45 2016
@@ -22,15 +22,19 @@ import java.io.Serializable;
 
 import org.apache.jmeter.samplers.Sampler;
 import org.apache.jmeter.testelement.TestElement;
+import org.apache.jmeter.testelement.property.BooleanProperty;
 import org.apache.jmeter.testelement.property.IntegerProperty;
 
 /**
  * Alternate among each of the children controllers or samplers for each loop iteration
  */
 public class InterleaveControl extends GenericController implements Serializable {
-    private static final long serialVersionUID = 233L;
+    
+    private static final long serialVersionUID = 234L;
 
     private static final String STYLE = "InterleaveControl.style";// $NON-NLS-1$
+    
+    private static final String ACCROSS_THREADS = "InterleaveControl.accrossThreads";// $NON-NLS-1$
 
     public static final int IGNORE_SUB_CONTROLLERS = 0;
 
@@ -71,6 +75,14 @@ public class InterleaveControl extends G
     public int getStyle() {
         return getPropertyAsInt(STYLE);
     }
+    
+    public void setInterleaveAccrossThreads(boolean accrossThreads) {
+        setProperty(new BooleanProperty(ACCROSS_THREADS, accrossThreads));
+    }
+
+    public boolean getInterleaveAccrossThreads() {
+        return getPropertyAsBoolean(ACCROSS_THREADS, false);
+    }
 
     /**
      * {@inheritDoc}
@@ -174,4 +186,16 @@ public class InterleaveControl extends G
         stillSame = false;
         super.incrementCurrent();
     }
+
+    /**
+     * @see org.apache.jmeter.control.GenericController#initialize()
+     */
+    @Override
+    public void initialize() {
+        super.initialize();
+        // get a different start index
+        if(getInterleaveAccrossThreads()) {
+            this.current = getThreadContext().getThreadNum() % getSubControllers().size();
+        }
+    }
 }

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/gui/InterleaveControlGui.java Sun
Oct  2 17:14:45 2016
@@ -30,6 +30,8 @@ public class InterleaveControlGui extend
     private static final long serialVersionUID = 240L;
 
     private JCheckBox style;
+    
+    private JCheckBox accrossThreads;
 
     public InterleaveControlGui() {
         init();
@@ -38,11 +40,13 @@ public class InterleaveControlGui extend
     @Override
     public void configure(TestElement el) {
         super.configure(el);
-        if (((InterleaveControl) el).getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS)
{
+        InterleaveControl controller = (InterleaveControl) el;
+        if (controller.getStyle() == InterleaveControl.IGNORE_SUB_CONTROLLERS) {
             style.setSelected(true);
         } else {
             style.setSelected(false);
         }
+        accrossThreads.setSelected(controller.getInterleaveAccrossThreads());
     }
 
     @Override
@@ -60,11 +64,14 @@ public class InterleaveControlGui extend
     @Override
     public void modifyTestElement(TestElement ic) {
         configureTestElement(ic);
+        InterleaveControl controller = (InterleaveControl) ic;
         if (style.isSelected()) {
-            ((InterleaveControl) ic).setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
+            controller.setStyle(InterleaveControl.IGNORE_SUB_CONTROLLERS);
         } else {
-            ((InterleaveControl) ic).setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
+            controller.setStyle(InterleaveControl.USE_SUB_CONTROLLERS);
         }
+        
+        controller.setInterleaveAccrossThreads(accrossThreads.isSelected());
     }
 
     /**
@@ -74,6 +81,7 @@ public class InterleaveControlGui extend
     public void clearGui() {
         super.clearGui();
         style.setSelected(false);
+        accrossThreads.setSelected(false);
     }
 
     @Override
@@ -89,5 +97,8 @@ public class InterleaveControlGui extend
 
         style = new JCheckBox(JMeterUtils.getResString("ignore_subcontrollers")); // $NON-NLS-1$
         add(CheckBoxPanel.wrap(style));
+        
+        accrossThreads = new JCheckBox(JMeterUtils.getResString("interleave_accross_threads"));
// $NON-NLS-1$
+        add(CheckBoxPanel.wrap(accrossThreads));
     }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Sun Oct  2 17:14:45
2016
@@ -424,6 +424,7 @@ insert_after=Insert After
 insert_before=Insert Before
 insert_parent=Insert Parent
 interleave_control_title=Interleave Controller
+interleave_accross_threads=Interleave accross threads
 intsum_param_1=First int to add.
 intsum_param_2=Second int to add - further ints can be summed by adding further arguments.
 invalid_data=Invalid data

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Sun Oct  2 17:14:45
2016
@@ -417,6 +417,7 @@ insert_after=Ins\u00E9rer apr\u00E8s
 insert_before=Ins\u00E9rer avant
 insert_parent=Ins\u00E9rer en tant que parent
 interleave_control_title=Contr\u00F4leur Interleave
+interleave_accross_threads=Alterne en prenant en compte toutes les unit\u00E9s
 intsum_param_1=Premier entier \u00E0 ajouter
 intsum_param_2=Deuxi\u00E8me entier \u00E0 ajouter - les entier(s) suivants peuvent \u00EAtre
ajout\u00E9(s) avec les arguments suivants.
 invalid_data=Donn\u00E9e invalide

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Oct  2 17:14:45 2016
@@ -106,6 +106,7 @@ Summary
     <li><bug>60082</bug>Validation mode : Be able to force Throughput Controller
to run as if it was set to 100%</li>
     <li><bug>59329</bug>Trim spaces in input filename in CSVDataSet.</li>
     <li><bug>59349</bug>Trim spaces in input filename in IncludeController.</li>
+    <li><bug>60081</bug>Interleave Controller : Add an option to alternate
across threads</li>
 </ul>
 
 <h3>Listeners</h3>

Modified: jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=1763086&r1=1763085&r2=1763086&view=diff
==============================================================================
--- jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jmeter/trunk/xdocs/usermanual/component_reference.xml Sun Oct  2 17:14:45 2016
@@ -2129,6 +2129,9 @@ other controllers for each loop iteratio
 <properties>
         <property name="name" required="No">Descriptive name for this controller that
is shown in the tree.</property>
         <property name="ignore sub-controller blocks" required="No">If checked, the
interleave controller will treat sub-controllers like single request elements and only allow
one request per controller at a time.  </property>
+        <property name="Interleave accross threads" required="No">If checked, the interleave
controller will alternate among each of its children controllers for each loop iteration but
accross all threads, for example in a 
+        configuration with 4 threads and 3 child controllers, on first iteration
+        thread 1 will run first child, thread 2 second child, thread 3 third child, thread
4 first child, on next iteration each thread will run the following child controller</property>
 </properties>
 
 <!--



Mime
View raw message