Class: RubyJmeter::Plugins::DummySampler

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/ruby-jmeter/plugins/dummy_sampler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#enabled, #enabled_disabled, #update, #update_at_xpath, #update_collection

Constructor Details

#initialize(params = {}) ⇒ DummySampler

Returns a new instance of DummySampler.


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ruby-jmeter/plugins/dummy_sampler.rb', line 6

def initialize(params={})
  testname = params.kind_of?(Array) ? 'DummySampler' : (params[:name] || 'DummySampler')
  @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
    <kg.apc.jmeter.samplers.DummySampler guiclass="kg.apc.jmeter.samplers.DummySamplerGui" testclass="kg.apc.jmeter.samplers.DummySampler" testname="#{testname}" enabled="true">
    <boolProp name="WAITING">true</boolProp>
    <boolProp name="SUCCESFULL">true</boolProp>
    <stringProp name="RESPONSE_CODE">200</stringProp>
    <stringProp name="RESPONSE_MESSAGE">OK</stringProp>
    <stringProp name="REQUEST_DATA"></stringProp>
    <stringProp name="RESPONSE_DATA"></stringProp>
    <stringProp name="RESPONSE_TIME">0</stringProp>
    <stringProp name="LATENCY">0</stringProp>
  </kg.apc.jmeter.samplers.DummySampler>
  EOF
  upcased_params = {}
  params.each {|k,v| upcased_params[k.to_s.upcase] = v}
  update upcased_params
end

Instance Attribute Details

#docObject

Returns the value of attribute doc


4
5
6
# File 'lib/ruby-jmeter/plugins/dummy_sampler.rb', line 4

def doc
  @doc
end