Sha256: f805d260f3a3e66aad067e3dfa83fd805f6be83ec1b61a21a112bb5f5487f7b4

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

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

  class BeanShellAssertion
    attr_accessor :doc
    include Helper

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