gridinit-jmeter 1.0.1.pre → 1.0.2.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -182,7 +182,11 @@ module Gridinit
|
|
182
182
|
def throughput_controller(params, &block)
|
183
183
|
params[:style] = 1 if params[:percent]
|
184
184
|
params[:maxThroughput] = params[:total] || params[:percent] || 1
|
185
|
-
|
185
|
+
|
186
|
+
node = Gridinit::Jmeter::ThroughputController.new(params)
|
187
|
+
node.doc.xpath(".//FloatProperty/value").first.content = params[:maxThroughput].to_f
|
188
|
+
|
189
|
+
attach_node(node, &block)
|
186
190
|
end
|
187
191
|
|
188
192
|
alias_method :Throughput, :throughput_controller
|
data/spec/dsl_spec.rb
CHANGED
@@ -129,7 +129,7 @@ describe "DSL" do
|
|
129
129
|
let(:doc) do
|
130
130
|
test do
|
131
131
|
threads do
|
132
|
-
throughput_controller percent:
|
132
|
+
throughput_controller percent: 99 do
|
133
133
|
transaction name: "TC_01", parent: true, include_timers: true
|
134
134
|
end
|
135
135
|
end
|
@@ -140,7 +140,8 @@ describe "DSL" do
|
|
140
140
|
|
141
141
|
it 'should match on maxThroughput' do
|
142
142
|
# puts doc.to_xml indent: 2
|
143
|
-
fragment.search(".//intProp[@name='ThroughputController.maxThroughput']").text.should == '
|
143
|
+
fragment.search(".//intProp[@name='ThroughputController.maxThroughput']").text.should == '99'
|
144
|
+
fragment.search(".//FloatProperty/value").text.should == '99.0'
|
144
145
|
end
|
145
146
|
|
146
147
|
it 'should match on style' do
|