Sha256: a29c58eaef4743acd28b3742624b1d7e6983b09af2a5b9f1e6fa5b9946b376b9

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

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

  class HTTPCacheManager
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "HTTPCacheManager" : (params[:name] || "HTTPCacheManager")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="#{testname}" enabled="true">
          <boolProp name="clearEachIteration">false</boolProp>
          <boolProp name="useExpires">false</boolProp>
        </CacheManager>
      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/http_cache_manager.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/http_cache_manager.rb