Sha256: 04e9520b228bf5899ca268089afa84da042cedadae32a460fa89f19fa174e358

Contents?: true

Size: 816 Bytes

Versions: 2

Compression:

Stored size: 816 Bytes

Contents

module JmeterPerf
  class DSL
    def loop_controller(params = {}, &)
      node = JmeterPerf::LoopController.new(params)
      attach_node(node, &)
    end
  end

  class LoopController
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "LoopController" : (params[:name] || "LoopController")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="#{testname}" enabled="true">
          <boolProp name="LoopController.continue_forever">true</boolProp>
          <stringProp name="LoopController.loops">1</stringProp>
        </LoopController>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/loop_controller.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/loop_controller.rb