Sha256: 310f78682b4d391e41a3b5bb93e45375467810d329d75a495620594ad5fed2a3

Contents?: true

Size: 853 Bytes

Versions: 2

Compression:

Stored size: 853 Bytes

Contents

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

  class BeanShellTimer
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "BeanShellTimer" : (params[:name] || "BeanShellTimer")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <BeanShellTimer guiclass="TestBeanGUI" testclass="BeanShellTimer" testname="#{testname}" enabled="true">
          <stringProp name="filename"/>
          <stringProp name="parameters"/>
          <boolProp name="resetInterpreter">false</boolProp>
          <stringProp name="script"/>
        </BeanShellTimer>
      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/bean_shell_timer.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/bean_shell_timer.rb