Class: RubyJmeter::Plugins::RedisDataSet

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

Returns a new instance of RedisDataSet.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ruby-jmeter/plugins/redis_data_set.rb', line 6

def initialize(params={})
  testname = params.kind_of?(Array) ? 'Redis Data Set Config' : (params[:name] || 'Redis Data Set Config')
  params[:getMode] ||= "1" unless params[:remove] == true
  @doc = Nokogiri::XML(<<-XML.strip_heredoc)
    <kg.apc.jmeter.config.redis.RedisDataSet guiclass="TestBeanGUI" testclass="kg.apc.jmeter.config.redis.RedisDataSet" testname="#{testname}" enabled="true">
      <stringProp name="database">0</stringProp>
      <stringProp name="delimiter">,</stringProp>
      <intProp name="getMode">0</intProp>
      <stringProp name="host"></stringProp
      <intProp name="maxActive">20</intProp>
      <intProp name="maxIdle">10</intProp>
      <longProp name="maxWait">30000</longProp>
      <longProp name="minEvictableIdleTimeMillis">60000</longProp>
      <intProp name="minIdle">0</intProp>
      <intProp name="numTestsPerEvictionRun">0</intProp>
      <stringProp name="password"></stringProp>
      <stringProp name="port">6379</stringProp>
      <stringProp name="redisKey"></stringProp>
      <longProp name="softMinEvictableIdleTimeMillis">60000</longProp>
      <boolProp name="testOnBorrow">false</boolProp>
      <boolProp name="testOnReturn">false</boolProp>
      <boolProp name="testWhileIdle">false</boolProp>
      <longProp name="timeBetweenEvictionRunsMillis">30000</longProp>
      <stringProp name="timeout">2000</stringProp>
      <stringProp name="variableNames"></stringProp>
      <intProp name="whenExhaustedAction">2</intProp>
    </kg.apc.jmeter.config.redis.RedisDataSet>
  XML
  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.



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

def doc
  @doc
end