You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2018/11/03 22:05:46 UTC

svn commit: r1845696 - in /jmeter/trunk: ./ bin/testfiles/ src/components/org/apache/jmeter/control/ src/core/org/apache/jmeter/control/ xdocs/

Author: pmouawad
Date: Sat Nov  3 22:05:46 2018
New Revision: 1845696

URL: http://svn.apache.org/viewvc?rev=1845696&view=rev
Log:
Bug 62847 - If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController
Bugzilla Id: 62847

Added:
    jmeter/trunk/bin/testfiles/BUG_62847.csv
    jmeter/trunk/bin/testfiles/BUG_62847.jmx   (with props)
    jmeter/trunk/bin/testfiles/BUG_62847.xml   (with props)
Modified:
    jmeter/trunk/build.xml
    jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
    jmeter/trunk/xdocs/changes.xml

Added: jmeter/trunk/bin/testfiles/BUG_62847.csv
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/BUG_62847.csv?rev=1845696&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/BUG_62847.csv (added)
+++ jmeter/trunk/bin/testfiles/BUG_62847.csv Sat Nov  3 22:05:46 2018
@@ -0,0 +1,7 @@
+label,responseCode,responseMessage,threadName,success
+SuccessLoop,200,OK,TG 1-1,true
+DS_after_loop,200,OK,TG 1-1,true
+SuccessWhile,200,OK,TG 2-1,true
+DS_after_while,200,OK,TG 2-1,true
+Success_FEC,200,OK,TG 3-1,true
+DS_after_fec,200,OK,TG 3-1,true

Added: jmeter/trunk/bin/testfiles/BUG_62847.jmx
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/BUG_62847.jmx?rev=1845696&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/BUG_62847.jmx (added)
+++ jmeter/trunk/bin/testfiles/BUG_62847.jmx Sat Nov  3 22:05:46 2018
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.1-SNAPSHOT.20181103">
+  <hashTree>
+    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
+      <stringProp name="TestPlan.comments"></stringProp>
+      <boolProp name="TestPlan.functional_mode">false</boolProp>
+      <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
+      <boolProp name="TestPlan.serialize_threadgroups">true</boolProp>
+      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
+        <collectionProp name="Arguments.arguments"/>
+      </elementProp>
+      <stringProp name="TestPlan.user_define_classpath"></stringProp>
+    </TestPlan>
+    <hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TG" enabled="true">
+        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+          <stringProp name="LoopController.loops">1</stringProp>
+        </elementProp>
+        <stringProp name="ThreadGroup.num_threads">1</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop" enabled="true">
+          <boolProp name="LoopController.continue_forever">true</boolProp>
+          <stringProp name="LoopController.loops">8</stringProp>
+        </LoopController>
+        <hashTree>
+          <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true">
+            <stringProp name="IfController.condition">${__jm__loop__idx} == 3</stringProp>
+            <boolProp name="IfController.evaluateAll">false</boolProp>
+          </IfController>
+          <hashTree>
+            <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="SuccessLoop" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugSampler>
+            <hashTree/>
+          </hashTree>
+        </hashTree>
+        <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="DS_after_loop" enabled="true">
+          <boolProp name="displayJMeterProperties">false</boolProp>
+          <boolProp name="displayJMeterVariables">true</boolProp>
+          <boolProp name="displaySystemProperties">false</boolProp>
+        </DebugSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TG" enabled="true">
+        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+          <stringProp name="LoopController.loops">1</stringProp>
+        </elementProp>
+        <stringProp name="ThreadGroup.num_threads">1</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
+          <intProp name="ActionProcessor.action">1</intProp>
+          <intProp name="ActionProcessor.target">0</intProp>
+          <stringProp name="ActionProcessor.duration">0</stringProp>
+        </TestAction>
+        <hashTree>
+          <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="User Parameters" enabled="true">
+            <collectionProp name="UserParameters.names">
+              <stringProp name="-1877925060">continue_loop</stringProp>
+            </collectionProp>
+            <collectionProp name="UserParameters.thread_values">
+              <collectionProp name="1902774694">
+                <stringProp name="3569038">true</stringProp>
+              </collectionProp>
+            </collectionProp>
+            <boolProp name="UserParameters.per_iteration">false</boolProp>
+          </UserParameters>
+          <hashTree/>
+        </hashTree>
+        <WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="while" enabled="true">
+          <stringProp name="WhileController.condition">${continue_loop}</stringProp>
+        </WhileController>
+        <hashTree>
+          <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true">
+            <stringProp name="IfController.condition">${__jm__while__idx} == 3</stringProp>
+            <boolProp name="IfController.evaluateAll">false</boolProp>
+          </IfController>
+          <hashTree>
+            <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="SuccessWhile" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugSampler>
+            <hashTree/>
+            <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
+              <intProp name="ActionProcessor.action">1</intProp>
+              <intProp name="ActionProcessor.target">0</intProp>
+              <stringProp name="ActionProcessor.duration">0</stringProp>
+            </TestAction>
+            <hashTree>
+              <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="User Parameters" enabled="true">
+                <collectionProp name="UserParameters.names">
+                  <stringProp name="-1877925060">continue_loop</stringProp>
+                </collectionProp>
+                <collectionProp name="UserParameters.thread_values">
+                  <collectionProp name="-544885953">
+                    <stringProp name="97196323">false</stringProp>
+                  </collectionProp>
+                </collectionProp>
+                <boolProp name="UserParameters.per_iteration">false</boolProp>
+              </UserParameters>
+              <hashTree/>
+            </hashTree>
+          </hashTree>
+        </hashTree>
+        <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="DS_after_while" enabled="true">
+          <boolProp name="displayJMeterProperties">false</boolProp>
+          <boolProp name="displayJMeterVariables">true</boolProp>
+          <boolProp name="displaySystemProperties">false</boolProp>
+        </DebugSampler>
+        <hashTree/>
+      </hashTree>
+      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="TG" enabled="true">
+        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
+        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
+          <boolProp name="LoopController.continue_forever">false</boolProp>
+          <stringProp name="LoopController.loops">1</stringProp>
+        </elementProp>
+        <stringProp name="ThreadGroup.num_threads">1</stringProp>
+        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
+        <boolProp name="ThreadGroup.scheduler">false</boolProp>
+        <stringProp name="ThreadGroup.duration"></stringProp>
+        <stringProp name="ThreadGroup.delay"></stringProp>
+      </ThreadGroup>
+      <hashTree>
+        <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
+          <intProp name="ActionProcessor.action">1</intProp>
+          <intProp name="ActionProcessor.target">0</intProp>
+          <stringProp name="ActionProcessor.duration">0</stringProp>
+        </TestAction>
+        <hashTree>
+          <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="User Parameters" enabled="true">
+            <collectionProp name="UserParameters.names">
+              <stringProp name="-1119897881">idx_matchNr</stringProp>
+              <stringProp name="100067119">idx_1</stringProp>
+              <stringProp name="100067120">idx_2</stringProp>
+              <stringProp name="100067121">idx_3</stringProp>
+              <stringProp name="100067122">idx_4</stringProp>
+              <stringProp name="100067123">idx_5</stringProp>
+              <stringProp name="100067124">idx_6</stringProp>
+              <stringProp name="100067125">idx_7</stringProp>
+              <stringProp name="100067126">idx_8</stringProp>
+            </collectionProp>
+            <collectionProp name="UserParameters.thread_values">
+              <collectionProp name="-1846294202">
+                <stringProp name="56">8</stringProp>
+                <stringProp name="49">1</stringProp>
+                <stringProp name="50">2</stringProp>
+                <stringProp name="51">3</stringProp>
+                <stringProp name="52">4</stringProp>
+                <stringProp name="53">5</stringProp>
+                <stringProp name="54">6</stringProp>
+                <stringProp name="55">7</stringProp>
+                <stringProp name="56">8</stringProp>
+              </collectionProp>
+            </collectionProp>
+            <boolProp name="UserParameters.per_iteration">false</boolProp>
+          </UserParameters>
+          <hashTree/>
+        </hashTree>
+        <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="for_idx" enabled="true">
+          <stringProp name="ForeachController.inputVal">idx</stringProp>
+          <stringProp name="ForeachController.returnVal">currentIdx</stringProp>
+          <boolProp name="ForeachController.useSeparator">true</boolProp>
+        </ForeachController>
+        <hashTree>
+          <IfController guiclass="IfControllerPanel" testclass="IfController" testname="If Controller" enabled="true">
+            <stringProp name="IfController.condition">${__jm__for_idx__idx} == 3</stringProp>
+            <boolProp name="IfController.evaluateAll">false</boolProp>
+          </IfController>
+          <hashTree>
+            <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Success_FEC" enabled="true">
+              <boolProp name="displayJMeterProperties">false</boolProp>
+              <boolProp name="displayJMeterVariables">true</boolProp>
+              <boolProp name="displaySystemProperties">false</boolProp>
+            </DebugSampler>
+            <hashTree/>
+            <TestAction guiclass="TestActionGui" testclass="TestAction" testname="Flow Control Action" enabled="true">
+              <intProp name="ActionProcessor.action">1</intProp>
+              <intProp name="ActionProcessor.target">0</intProp>
+              <stringProp name="ActionProcessor.duration">0</stringProp>
+            </TestAction>
+            <hashTree>
+              <UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="User Parameters" enabled="true">
+                <collectionProp name="UserParameters.names">
+                  <stringProp name="-1877925060">continue_loop</stringProp>
+                </collectionProp>
+                <collectionProp name="UserParameters.thread_values">
+                  <collectionProp name="-544885953">
+                    <stringProp name="97196323">false</stringProp>
+                  </collectionProp>
+                </collectionProp>
+                <boolProp name="UserParameters.per_iteration">false</boolProp>
+              </UserParameters>
+              <hashTree/>
+            </hashTree>
+          </hashTree>
+        </hashTree>
+        <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="DS_after_fec" enabled="true">
+          <boolProp name="displayJMeterProperties">false</boolProp>
+          <boolProp name="displayJMeterVariables">true</boolProp>
+          <boolProp name="displaySystemProperties">false</boolProp>
+        </DebugSampler>
+        <hashTree/>
+      </hashTree>
+      <ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="View Results in Table" enabled="true">
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+        <objProp>
+          <name>saveConfig</name>
+          <value class="SampleSaveConfiguration">
+            <time>false</time>
+            <latency>false</latency>
+            <timestamp>false</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>false</dataType>
+            <encoding>false</encoding>
+            <assertions>false</assertions>
+            <subresults>false</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>false</xml>
+            <fieldNames>true</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+          </value>
+        </objProp>
+        <stringProp name="filename">BUG_62847.csv</stringProp>
+      </ResultCollector>
+      <hashTree/>
+      <ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Simple Data Writer" enabled="true">
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+        <objProp>
+          <name>saveConfig</name>
+          <value class="SampleSaveConfiguration">
+            <time>false</time>
+            <latency>false</latency>
+            <timestamp>false</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>false</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>true</xml>
+            <fieldNames>false</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+          </value>
+        </objProp>
+        <stringProp name="filename">BUG_62847.xml</stringProp>
+      </ResultCollector>
+      <hashTree/>
+      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
+        <boolProp name="ResultCollector.error_logging">false</boolProp>
+        <objProp>
+          <name>saveConfig</name>
+          <value class="SampleSaveConfiguration">
+            <time>true</time>
+            <latency>true</latency>
+            <timestamp>true</timestamp>
+            <success>true</success>
+            <label>true</label>
+            <code>true</code>
+            <message>true</message>
+            <threadName>true</threadName>
+            <dataType>true</dataType>
+            <encoding>false</encoding>
+            <assertions>true</assertions>
+            <subresults>true</subresults>
+            <responseData>false</responseData>
+            <samplerData>false</samplerData>
+            <xml>false</xml>
+            <fieldNames>true</fieldNames>
+            <responseHeaders>false</responseHeaders>
+            <requestHeaders>false</requestHeaders>
+            <responseDataOnError>false</responseDataOnError>
+            <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
+            <assertionsResultsToSave>0</assertionsResultsToSave>
+            <bytes>true</bytes>
+            <sentBytes>true</sentBytes>
+            <url>true</url>
+            <threadCounts>true</threadCounts>
+            <idleTime>true</idleTime>
+            <connectTime>true</connectTime>
+          </value>
+        </objProp>
+        <stringProp name="filename"></stringProp>
+      </ResultCollector>
+      <hashTree/>
+    </hashTree>
+  </hashTree>
+</jmeterTestPlan>

Propchange: jmeter/trunk/bin/testfiles/BUG_62847.jmx
------------------------------------------------------------------------------
    svn:eol-style = LF

Added: jmeter/trunk/bin/testfiles/BUG_62847.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/testfiles/BUG_62847.xml?rev=1845696&view=auto
==============================================================================
--- jmeter/trunk/bin/testfiles/BUG_62847.xml (added)
+++ jmeter/trunk/bin/testfiles/BUG_62847.xml Sat Nov  3 22:05:46 2018
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testResults version="1.2">
+<sample s="true" lb="SuccessLoop" rc="200" rm="OK" tn="TG 1-1"/>
+<sample s="true" lb="DS_after_loop" rc="200" rm="OK" tn="TG 1-1"/>
+<sample s="true" lb="SuccessWhile" rc="200" rm="OK" tn="TG 2-1"/>
+<sample s="true" lb="DS_after_while" rc="200" rm="OK" tn="TG 2-1"/>
+<sample s="true" lb="Success_FEC" rc="200" rm="OK" tn="TG 3-1"/>
+<sample s="true" lb="DS_after_fec" rc="200" rm="OK" tn="TG 3-1"/>
+
+</testResults>

Propchange: jmeter/trunk/bin/testfiles/BUG_62847.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/bin/testfiles/BUG_62847.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: jmeter/trunk/build.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/build.xml?rev=1845696&r1=1845695&r2=1845696&view=diff
==============================================================================
--- jmeter/trunk/build.xml (original)
+++ jmeter/trunk/build.xml Sat Nov  3 22:05:46 2018
@@ -2824,6 +2824,11 @@ run JMeter unless all the JMeter jars ar
   <!-- Additional test scripts -->
   <target name="batch_scripts">
       <antcall target="batchtest">
+        <param name="batchtest.name" value="BUG_62847"/>
+        <param name="batchtest.jmx" value="BUG_62847.jmx"/>
+      </antcall>
+      
+      <antcall target="batchtest">
         <param name="batchtest.name" value="TestResultStatusAction"/>
         <param name="batchtest.jmx" value="TestResultStatusAction.jmx"/>
       </antcall>

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java?rev=1845696&r1=1845695&r2=1845696&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java Sat Nov  3 22:05:46 2018
@@ -199,6 +199,7 @@ public class ForeachController extends G
     // Prevent entry if nothing to do
     @Override
     public Sampler next() {
+        updateIterationIndex(getName(), loopCount);
         try {
             if (breakLoop || emptyList()) {
                 resetBreakLoop();

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java?rev=1845696&r1=1845695&r2=1845696&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java Sat Nov  3 22:05:46 2018
@@ -123,6 +123,7 @@ public class LoopController extends Gene
      */
     @Override
     public Sampler next() {
+        updateIterationIndex(getName(), loopCount);
         try {
             if(endOfLoop()) {
                 if (!getContinueForever()) {

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java?rev=1845696&r1=1845695&r2=1845696&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/WhileController.java Sat Nov  3 22:05:46 2018
@@ -108,6 +108,7 @@ public class WhileController extends Gen
      */
     @Override
     public Sampler next(){
+        updateIterationIndex(getName(), getIterCount());
         try {
             if (isFirst() && endOfLoop(false)) {
                 resetBreakLoop();

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1845696&r1=1845695&r2=1845696&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sat Nov  3 22:05:46 2018
@@ -147,6 +147,7 @@ Summary
 <h3>Controllers</h3>
 <ul>
     <li><bug>62806</bug>ModuleController cloning by Run behaves differently wether in GUI or Non GUI mode. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+    <li><bug>62847</bug>If Controller cannot use variable for index exposed by LoopController/WhileController/ForEachController</li>
 </ul>
 
 <h3>Listeners</h3>