Sha256: cc937534e6927f8ed735edbad89b15c128caa34eaf4a87c9a94f83bd1762c68a

Contents?: true

Size: 1.53 KB

Versions: 35

Compression:

Stored size: 1.53 KB

Contents

module RubyJmeter
  class DSL
    def http_request_defaults(params={}, &block)
      node = RubyJmeter::HttpRequestDefaults.new(params)
      attach_node(node, &block)
    end
  end

  class HttpRequestDefaults
    attr_accessor :doc
    include Helper

    def initialize(params={})
      testname = params.kind_of?(Array) ? 'HttpRequestDefaults' : (params[:name] || 'HttpRequestDefaults')
      @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="#{testname}" enabled="true">
  <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
    <collectionProp name="Arguments.arguments"/>
  </elementProp>
  <stringProp name="HTTPSampler.domain"/>
  <stringProp name="HTTPSampler.port"/>
  <stringProp name="HTTPSampler.connect_timeout"/>
  <stringProp name="HTTPSampler.response_timeout"/>
  <stringProp name="HTTPSampler.protocol"/>
  <stringProp name="HTTPSampler.contentEncoding"/>
  <stringProp name="HTTPSampler.path">/</stringProp>
  <stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
  <boolProp name="HTTPSampler.image_parser">true</boolProp>
  <boolProp name="HTTPSampler.concurrentDwn">true</boolProp>
  <stringProp name="HTTPSampler.concurrentPool">4</stringProp>
  <stringProp name="HTTPSampler.embedded_url_re"/>
</ConfigTestElement>)
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ruby-jmeter-2.13.10 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.9 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.8 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.7 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.6 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.5 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.4 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.3 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.2 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.1 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.13.0 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.5 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.4 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.3 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.2 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.1 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.12.0 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.11.22 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.11.21 lib/ruby-jmeter/dsl/http_request_defaults.rb
ruby-jmeter-2.11.20 lib/ruby-jmeter/dsl/http_request_defaults.rb