Sha256: 0f535e33cbb7e73cd8d4ecb85bec5f1c7ec2c05278ad86432908ef3d2411cc26

Contents?: true

Size: 885 Bytes

Versions: 2

Compression:

Stored size: 885 Bytes

Contents

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

  class JSR223Assertion
    attr_accessor :doc
    include Helper

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