Class: RubyJmeter::JavaRequest

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/ruby-jmeter/dsl/java_request.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 = {}) ⇒ JavaRequest

Returns a new instance of JavaRequest.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ruby-jmeter/dsl/java_request.rb', line 13

def initialize(params={})
  testname = params.kind_of?(Array) ? 'JavaRequest' : (params[:name] || 'JavaRequest')
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{testname}" enabled="true">
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
<collectionProp name="Arguments.arguments">
  <elementProp name="Sleep_Time" elementType="Argument">
    <stringProp name="Argument.name">Sleep_Time</stringProp>
    <stringProp name="Argument.value">100</stringProp>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="Sleep_Mask" elementType="Argument">
    <stringProp name="Argument.name">Sleep_Mask</stringProp>
    <stringProp name="Argument.value">0xFF</stringProp>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="Label" elementType="Argument">
    <stringProp name="Argument.name">Label</stringProp>
    <stringProp name="Argument.value"/>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="ResponseCode" elementType="Argument">
    <stringProp name="Argument.name">ResponseCode</stringProp>
    <stringProp name="Argument.value"/>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="ResponseMessage" elementType="Argument">
    <stringProp name="Argument.name">ResponseMessage</stringProp>
    <stringProp name="Argument.value"/>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="Status" elementType="Argument">
    <stringProp name="Argument.name">Status</stringProp>
    <stringProp name="Argument.value">OK</stringProp>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="SamplerData" elementType="Argument">
    <stringProp name="Argument.name">SamplerData</stringProp>
    <stringProp name="Argument.value"/>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
  <elementProp name="ResultData" elementType="Argument">
    <stringProp name="Argument.name">ResultData</stringProp>
    <stringProp name="Argument.value"/>
    <stringProp name="Argument.metadata">=</stringProp>
  </elementProp>
</collectionProp>
  </elementProp>
  <stringProp name="classname">org.apache.jmeter.protocol.java.test.JavaTest</stringProp>
</JavaSampler>)
  EOS
  update params
  update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



10
11
12
# File 'lib/ruby-jmeter/dsl/java_request.rb', line 10

def doc
  @doc
end