Sha256: a823147ab082d627c839e85973c2adadb530ec4563d6d20d23c5e9fa6fbbd52d

Contents?: true

Size: 909 Bytes

Versions: 2

Compression:

Stored size: 909 Bytes

Contents

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

  class JSR223Preprocessor
    attr_accessor :doc
    include Helper

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