You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It never finishes. Debuging from
jMeterEngineStd.run()
there's a moment when
invokeOrBailOut is call (in TestBeanHelper.java)
when called for method setCalcMode, value should be 3, but it is 0
And similiar thing happen with method
setThroughput
when value should be 20, but ti is 0.0
Inspecting code, I found differences in how ConstantThroughputTimer set property values, compare to other timers like ConstantTimer.
line 51
public void setDelay(String delay) {
setProperty(DELAY, delay);
}
So I tryextending ConstantThroughputTimer:
@GUIMenuSortOrder(4)
public class ConstantThroughputTimerBugSolution extends ConstantThroughputTimer {
private static final long serialVersionUID = 4;
/** Key for storing assertion-information in the jmx-file. */
public static final String THROUGHPUT_KEY = "throughput"; // $NON-NLS-1$
public static final String CALC_MODE_KEY = "calcMode"; // $NON-NLS-1$
@Override
public void setThroughput(double throughput) {
super.setThroughput(throughput); // just in case
setProperty(new DoubleProperty(THROUGHPUT_KEY, throughput));
}
@Override
public void setCalcMode(int mode) {
super.setCalcMode(mode); // just in case
setProperty(CALC_MODE_KEY, mode);
}
}
And it works just fine. Mode and Throughput have proper values, and even more, it is correctly setted up in TestPlan:
Ismagee (Bug 62675):
When implementing ConstantThroughputTimer from java code, it's properties "throughput" and "mode" are not correctly setted up.
While I do:
ConstantThroughputTimer constThroughputTimer = new ConstantThroughputTimer();
constThroughputTimer.setName("consttimer");
constThroughputTimer.setProperty(TestElement.TEST_CLASS, ConstantThroughputTimer.class.getName());
constThroughputTimer.setProperty(TestElement.GUI_CLASS, TestBeanGUI.getName());
constThroughputTimer.setEnabled(true);
constThroughputTimer.setThroughput(samplesPerMinute);
constThroughputTimer.setCalcMode(3);
// with samplesPerMinute = 20
But when I save TreePlan, those 2 props are not present:
</hashTree>
<ConstantThroughputTimer testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true"/>
<hashTree/>
And when executed with:
StandardJMeterEngine jMeterEngineStd = jmeterPlan.getJMeterEngineStd();
jMeterEngineStd.configure(jmeterPlan.getPlanTree());
jMeterEngineStd.run();
It never finishes. Debuging from
jMeterEngineStd.run()
there's a moment when
invokeOrBailOut is call (in TestBeanHelper.java)
when called for method setCalcMode, value should be 3, but it is 0
And similiar thing happen with method
setThroughput
when value should be 20, but ti is 0.0
Inspecting code, I found differences in how ConstantThroughputTimer set property values, compare to other timers like ConstantTimer.
In ConstantThroughputTimer (https://github.com/apache/jmeter/blob/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java)
lines 118
public void setThroughput(double throughput) {
this.throughput = throughput;
}
and 135
public void setCalcMode(int mode) {
this.mode = Mode.values()[mode];
}
While in ConstantTimer (https://github.com/apache/jmeter/blob/trunk/src/components/org/apache/jmeter/timers/ConstantTimer.java)
line 51
public void setDelay(String delay) {
setProperty(DELAY, delay);
}
So I tryextending ConstantThroughputTimer:
@GUIMenuSortOrder(4)
public class ConstantThroughputTimerBugSolution extends ConstantThroughputTimer {
}
And it works just fine. Mode and Throughput have proper values, and even more, it is correctly setted up in TestPlan:
</hashTree>
<ConstantThroughputTimerBugSolution testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true">
<doubleProp>
<name>throughput</name>
<value>Infinity</value>
<savedValue>0.0</savedValue>
</doubleProp>
<intProp name="calcMode">3</intProp>
</ConstantThroughputTimerBugSolution>
<hashTree/>
Exactly same problem I found with CompareAssertion, and same kind of resolve. And I saw many clases with same of property settings
Hope this help
Created attachment setCaclModeAndSetThroughtput.zip: SetCalcMode Should be 3, but is 0. Same with SetThroughput, should be 20
Severity: normal
OS: Linux
The text was updated successfully, but these errors were encountered: