ruby-jmeter 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/examples/basic_header.rb +5 -1
  2. data/examples/basic_user_defined_variables.rb +10 -0
  3. data/lib/ruby-jmeter/dsl/access_log_sampler.rb +3 -3
  4. data/lib/ruby-jmeter/dsl/aggregate_graph.rb +3 -3
  5. data/lib/ruby-jmeter/dsl/aggregate_report.rb +3 -3
  6. data/lib/ruby-jmeter/dsl/ajp13_sampler.rb +4 -4
  7. data/lib/ruby-jmeter/dsl/assertion_results.rb +3 -3
  8. data/lib/ruby-jmeter/dsl/beanshell_assertion.rb +3 -3
  9. data/lib/ruby-jmeter/dsl/beanshell_listener.rb +3 -3
  10. data/lib/ruby-jmeter/dsl/beanshell_postprocessor.rb +3 -3
  11. data/lib/ruby-jmeter/dsl/beanshell_preprocessor.rb +3 -3
  12. data/lib/ruby-jmeter/dsl/beanshell_sampler.rb +3 -3
  13. data/lib/ruby-jmeter/dsl/beanshell_timer.rb +3 -3
  14. data/lib/ruby-jmeter/dsl/bsf_assertion.rb +3 -3
  15. data/lib/ruby-jmeter/dsl/bsf_listener.rb +3 -3
  16. data/lib/ruby-jmeter/dsl/bsf_postprocessor.rb +3 -3
  17. data/lib/ruby-jmeter/dsl/bsf_preprocessor.rb +3 -3
  18. data/lib/ruby-jmeter/dsl/bsf_sampler.rb +3 -3
  19. data/lib/ruby-jmeter/dsl/bsf_timer.rb +3 -3
  20. data/lib/ruby-jmeter/dsl/compare_assertion.rb +3 -3
  21. data/lib/ruby-jmeter/dsl/comparison_assertion_visualizer.rb +3 -3
  22. data/lib/ruby-jmeter/dsl/constant_throughput_timer.rb +3 -3
  23. data/lib/ruby-jmeter/dsl/constant_timer.rb +3 -3
  24. data/lib/ruby-jmeter/dsl/counter.rb +3 -3
  25. data/lib/ruby-jmeter/dsl/cssjquery_extractor.rb +3 -3
  26. data/lib/ruby-jmeter/dsl/csv_data_set_config.rb +3 -3
  27. data/lib/ruby-jmeter/dsl/debug_postprocessor.rb +3 -3
  28. data/lib/ruby-jmeter/dsl/debug_sampler.rb +3 -3
  29. data/lib/ruby-jmeter/dsl/distribution_graphalpha.rb +3 -3
  30. data/lib/ruby-jmeter/dsl/duration_assertion.rb +3 -3
  31. data/lib/ruby-jmeter/dsl/foreach_controller.rb +3 -3
  32. data/lib/ruby-jmeter/dsl/ftp_request.rb +3 -3
  33. data/lib/ruby-jmeter/dsl/ftp_request_defaults.rb +3 -3
  34. data/lib/ruby-jmeter/dsl/gaussian_random_timer.rb +3 -3
  35. data/lib/ruby-jmeter/dsl/generate_summary_results.rb +3 -3
  36. data/lib/ruby-jmeter/dsl/graph_results.rb +3 -3
  37. data/lib/ruby-jmeter/dsl/html_assertion.rb +3 -3
  38. data/lib/ruby-jmeter/dsl/html_link_parser.rb +3 -3
  39. data/lib/ruby-jmeter/dsl/html_parameter_mask.rb +3 -3
  40. data/lib/ruby-jmeter/dsl/http_authorization_manager.rb +3 -3
  41. data/lib/ruby-jmeter/dsl/http_cache_manager.rb +3 -3
  42. data/lib/ruby-jmeter/dsl/http_cookie_manager.rb +3 -3
  43. data/lib/ruby-jmeter/dsl/http_header_manager.rb +3 -3
  44. data/lib/ruby-jmeter/dsl/http_request.rb +4 -4
  45. data/lib/ruby-jmeter/dsl/http_request_defaults.rb +4 -4
  46. data/lib/ruby-jmeter/dsl/http_url_rewriting_modifier.rb +3 -3
  47. data/lib/ruby-jmeter/dsl/if_controller.rb +3 -3
  48. data/lib/ruby-jmeter/dsl/include_controller.rb +3 -3
  49. data/lib/ruby-jmeter/dsl/java_request.rb +3 -3
  50. data/lib/ruby-jmeter/dsl/java_request_defaults.rb +3 -3
  51. data/lib/ruby-jmeter/dsl/jdbc_connection_configuration.rb +3 -3
  52. data/lib/ruby-jmeter/dsl/jdbc_postprocessor.rb +3 -3
  53. data/lib/ruby-jmeter/dsl/jdbc_preprocessor.rb +3 -3
  54. data/lib/ruby-jmeter/dsl/jdbc_request.rb +3 -3
  55. data/lib/ruby-jmeter/dsl/jms_pointtopoint.rb +5 -5
  56. data/lib/ruby-jmeter/dsl/jms_publisher.rb +4 -4
  57. data/lib/ruby-jmeter/dsl/jms_subscriber.rb +3 -3
  58. data/lib/ruby-jmeter/dsl/jsr223_assertion.rb +3 -3
  59. data/lib/ruby-jmeter/dsl/jsr223_listener.rb +3 -3
  60. data/lib/ruby-jmeter/dsl/jsr223_postprocessor.rb +3 -3
  61. data/lib/ruby-jmeter/dsl/jsr223_preprocessor.rb +3 -3
  62. data/lib/ruby-jmeter/dsl/jsr223_sampler.rb +3 -3
  63. data/lib/ruby-jmeter/dsl/jsr223_timer.rb +3 -3
  64. data/lib/ruby-jmeter/dsl/junit_request.rb +3 -3
  65. data/lib/ruby-jmeter/dsl/keystore_configuration.rb +3 -3
  66. data/lib/ruby-jmeter/dsl/ldap_extended_request.rb +3 -3
  67. data/lib/ruby-jmeter/dsl/ldap_extended_request_defaults.rb +3 -3
  68. data/lib/ruby-jmeter/dsl/ldap_request.rb +4 -4
  69. data/lib/ruby-jmeter/dsl/ldap_request_defaults.rb +4 -4
  70. data/lib/ruby-jmeter/dsl/login_config_element.rb +3 -3
  71. data/lib/ruby-jmeter/dsl/loop_controller.rb +3 -3
  72. data/lib/ruby-jmeter/dsl/mail_reader_sampler.rb +3 -3
  73. data/lib/ruby-jmeter/dsl/mailer_visualizer.rb +3 -3
  74. data/lib/ruby-jmeter/dsl/md5hex_assertion.rb +3 -3
  75. data/lib/ruby-jmeter/dsl/module_controller.rb +3 -3
  76. data/lib/ruby-jmeter/dsl/monitor_results.rb +3 -3
  77. data/lib/ruby-jmeter/dsl/once_only_controller.rb +3 -3
  78. data/lib/ruby-jmeter/dsl/os_process_sampler.rb +5 -5
  79. data/lib/ruby-jmeter/dsl/poisson_random_timer.rb +3 -3
  80. data/lib/ruby-jmeter/dsl/random_controller.rb +3 -3
  81. data/lib/ruby-jmeter/dsl/random_order_controller.rb +3 -3
  82. data/lib/ruby-jmeter/dsl/random_variable.rb +3 -3
  83. data/lib/ruby-jmeter/dsl/recording_controller.rb +3 -3
  84. data/lib/ruby-jmeter/dsl/regex_user_parameters.rb +3 -3
  85. data/lib/ruby-jmeter/dsl/regular_expression_extractor.rb +3 -3
  86. data/lib/ruby-jmeter/dsl/response_assertion.rb +3 -3
  87. data/lib/ruby-jmeter/dsl/response_time_graph.rb +3 -3
  88. data/lib/ruby-jmeter/dsl/result_status_action_handler.rb +3 -3
  89. data/lib/ruby-jmeter/dsl/runtime_controller.rb +3 -3
  90. data/lib/ruby-jmeter/dsl/save_responses_to_a_file.rb +3 -3
  91. data/lib/ruby-jmeter/dsl/simple_config_element.rb +3 -3
  92. data/lib/ruby-jmeter/dsl/simple_controller.rb +3 -3
  93. data/lib/ruby-jmeter/dsl/simple_data_writer.rb +3 -3
  94. data/lib/ruby-jmeter/dsl/smime_assertion.rb +3 -3
  95. data/lib/ruby-jmeter/dsl/smtp_sampler.rb +3 -3
  96. data/lib/ruby-jmeter/dsl/soapxmlrpc_request.rb +3 -3
  97. data/lib/ruby-jmeter/dsl/spline_visualizer.rb +3 -3
  98. data/lib/ruby-jmeter/dsl/summary_report.rb +3 -3
  99. data/lib/ruby-jmeter/dsl/switch_controller.rb +3 -3
  100. data/lib/ruby-jmeter/dsl/synchronizing_timer.rb +3 -3
  101. data/lib/ruby-jmeter/dsl/tcp_sampler.rb +3 -3
  102. data/lib/ruby-jmeter/dsl/tcp_sampler_config.rb +3 -3
  103. data/lib/ruby-jmeter/dsl/test_action.rb +3 -3
  104. data/lib/ruby-jmeter/dsl/test_plan.rb +4 -4
  105. data/lib/ruby-jmeter/dsl/thread_group.rb +4 -4
  106. data/lib/ruby-jmeter/dsl/throughput_controller.rb +3 -3
  107. data/lib/ruby-jmeter/dsl/transaction_controller.rb +3 -3
  108. data/lib/ruby-jmeter/dsl/uniform_random_timer.rb +3 -3
  109. data/lib/ruby-jmeter/dsl/user_defined_variables.rb +3 -3
  110. data/lib/ruby-jmeter/dsl/user_parameters.rb +3 -3
  111. data/lib/ruby-jmeter/dsl/view_results_in_table.rb +3 -3
  112. data/lib/ruby-jmeter/dsl/view_results_tree.rb +3 -3
  113. data/lib/ruby-jmeter/dsl/while_controller.rb +3 -3
  114. data/lib/ruby-jmeter/dsl/xml_assertion.rb +3 -3
  115. data/lib/ruby-jmeter/dsl/xml_schema_assertion.rb +3 -3
  116. data/lib/ruby-jmeter/dsl/xpath_assertion.rb +3 -3
  117. data/lib/ruby-jmeter/dsl/xpath_extractor.rb +3 -3
  118. data/lib/ruby-jmeter/dsl.rb +6 -2
  119. data/lib/ruby-jmeter/helpers/helper.rb +20 -3
  120. data/lib/ruby-jmeter/idl.rb +3 -3
  121. data/lib/ruby-jmeter/version.rb +1 -1
  122. data/spec/dsl_spec.rb +22 -0
  123. metadata +4 -6
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'ForeachController'
14
+ testname = params.kind_of?(Array) ? 'ForeachController' : (params[:name] || 'ForeachController')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="#{params[:name]}" enabled="true">
16
+ <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="#{testname}" enabled="true">
17
17
  <stringProp name="ForeachController.inputVal"/>
18
18
  <stringProp name="ForeachController.returnVal"/>
19
19
  <boolProp name="ForeachController.useSeparator">true</boolProp>
@@ -22,7 +22,7 @@ module RubyJmeter
22
22
  </ForeachController>)
23
23
  EOS
24
24
  update params
25
- update_at_xpath params if params[:update_at_xpath]
25
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
26
26
  end
27
27
  end
28
28
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'FtpRequest'
14
+ testname = params.kind_of?(Array) ? 'FtpRequest' : (params[:name] || 'FtpRequest')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="#{params[:name]}" enabled="true">
16
+ <FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="#{testname}" enabled="true">
17
17
  <stringProp name="FTPSampler.server"/>
18
18
  <stringProp name="FTPSampler.port"/>
19
19
  <stringProp name="FTPSampler.filename"/>
@@ -27,7 +27,7 @@ module RubyJmeter
27
27
  </FTPSampler>)
28
28
  EOS
29
29
  update params
30
- update_at_xpath params if params[:update_at_xpath]
30
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
31
31
  end
32
32
  end
33
33
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'FtpRequestDefaults'
14
+ testname = params.kind_of?(Array) ? 'FtpRequestDefaults' : (params[:name] || 'FtpRequestDefaults')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <ConfigTestElement guiclass="FtpConfigGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
16
+ <ConfigTestElement guiclass="FtpConfigGui" testclass="ConfigTestElement" testname="#{testname}" enabled="true">
17
17
  <stringProp name="FTPSampler.server"/>
18
18
  <stringProp name="FTPSampler.port"/>
19
19
  <stringProp name="FTPSampler.filename"/>
@@ -25,7 +25,7 @@ module RubyJmeter
25
25
  </ConfigTestElement>)
26
26
  EOS
27
27
  update params
28
- update_at_xpath params if params[:update_at_xpath]
28
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
29
29
  end
30
30
  end
31
31
 
@@ -11,15 +11,15 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'GaussianRandomTimer'
14
+ testname = params.kind_of?(Array) ? 'GaussianRandomTimer' : (params[:name] || 'GaussianRandomTimer')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="#{params[:name]}" enabled="true">
16
+ <GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="#{testname}" enabled="true">
17
17
  <stringProp name="ConstantTimer.delay">300</stringProp>
18
18
  <stringProp name="RandomTimer.range">100.0</stringProp>
19
19
  </GaussianRandomTimer>)
20
20
  EOS
21
21
  update params
22
- update_at_xpath params if params[:update_at_xpath]
22
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
23
23
  end
24
24
  end
25
25
 
@@ -11,12 +11,12 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'GenerateSummaryResults'
14
+ testname = params.kind_of?(Array) ? 'GenerateSummaryResults' : (params[:name] || 'GenerateSummaryResults')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <Summariser guiclass="SummariserGui" testclass="Summariser" testname="#{params[:name]}" enabled="true"/>)
16
+ <Summariser guiclass="SummariserGui" testclass="Summariser" testname="#{testname}" enabled="true"/>)
17
17
  EOS
18
18
  update params
19
- update_at_xpath params if params[:update_at_xpath]
19
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
20
20
  end
21
21
  end
22
22
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'GraphResults'
14
+ testname = params.kind_of?(Array) ? 'GraphResults' : (params[:name] || 'GraphResults')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
16
+ <ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
17
17
  <boolProp name="ResultCollector.error_logging">false</boolProp>
18
18
  <objProp>
19
19
  <name>saveConfig</name>
@@ -48,7 +48,7 @@ module RubyJmeter
48
48
  </ResultCollector>)
49
49
  EOS
50
50
  update params
51
- update_at_xpath params if params[:update_at_xpath]
51
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
52
52
  end
53
53
  end
54
54
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HtmlAssertion'
14
+ testname = params.kind_of?(Array) ? 'HtmlAssertion' : (params[:name] || 'HtmlAssertion')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <HTMLAssertion guiclass="HTMLAssertionGui" testclass="HTMLAssertion" testname="#{params[:name]}" enabled="true">
16
+ <HTMLAssertion guiclass="HTMLAssertionGui" testclass="HTMLAssertion" testname="#{testname}" enabled="true">
17
17
  <longProp name="html_assertion_error_threshold">0</longProp>
18
18
  <longProp name="html_assertion_warning_threshold">0</longProp>
19
19
  <stringProp name="html_assertion_doctype">omit</stringProp>
@@ -23,7 +23,7 @@ module RubyJmeter
23
23
  </HTMLAssertion>)
24
24
  EOS
25
25
  update params
26
- update_at_xpath params if params[:update_at_xpath]
26
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
27
27
  end
28
28
  end
29
29
 
@@ -11,12 +11,12 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HtmlLinkParser'
14
+ testname = params.kind_of?(Array) ? 'HtmlLinkParser' : (params[:name] || 'HtmlLinkParser')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <AnchorModifier guiclass="AnchorModifierGui" testclass="AnchorModifier" testname="#{params[:name]}" enabled="true"/>)
16
+ <AnchorModifier guiclass="AnchorModifierGui" testclass="AnchorModifier" testname="#{testname}" enabled="true"/>)
17
17
  EOS
18
18
  update params
19
- update_at_xpath params if params[:update_at_xpath]
19
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
20
20
  end
21
21
  end
22
22
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HtmlParameterMask'
14
+ testname = params.kind_of?(Array) ? 'HtmlParameterMask' : (params[:name] || 'HtmlParameterMask')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <ParamModifier guiclass="ParamModifierGui" testclass="ParamModifier" testname="#{params[:name]}" enabled="true">
16
+ <ParamModifier guiclass="ParamModifierGui" testclass="ParamModifier" testname="#{testname}" enabled="true">
17
17
  <elementProp name="ParamModifier.mask" elementType="ParamMask">
18
18
  <stringProp name="ParamModifier.field_name"/>
19
19
  <stringProp name="ParamModifier.prefix"/>
@@ -25,7 +25,7 @@ module RubyJmeter
25
25
  </ParamModifier>)
26
26
  EOS
27
27
  update params
28
- update_at_xpath params if params[:update_at_xpath]
28
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
29
29
  end
30
30
  end
31
31
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpAuthorizationManager'
14
+ testname = params.kind_of?(Array) ? 'HttpAuthorizationManager' : (params[:name] || 'HttpAuthorizationManager')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="#{params[:name]}" enabled="true">
16
+ <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="#{testname}" enabled="true">
17
17
  <collectionProp name="AuthManager.auth_list">
18
18
  <elementProp name="" elementType="Authorization">
19
19
  <stringProp name="Authorization.url"/>
@@ -26,7 +26,7 @@ module RubyJmeter
26
26
  </AuthManager>)
27
27
  EOS
28
28
  update params
29
- update_at_xpath params if params[:update_at_xpath]
29
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
30
30
  end
31
31
  end
32
32
 
@@ -11,15 +11,15 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpCacheManager'
14
+ testname = params.kind_of?(Array) ? 'HttpCacheManager' : (params[:name] || 'HttpCacheManager')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="#{params[:name]}" enabled="true">
16
+ <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="#{testname}" enabled="true">
17
17
  <boolProp name="clearEachIteration">false</boolProp>
18
18
  <boolProp name="useExpires">false</boolProp>
19
19
  </CacheManager>)
20
20
  EOS
21
21
  update params
22
- update_at_xpath params if params[:update_at_xpath]
22
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
23
23
  end
24
24
  end
25
25
 
@@ -11,16 +11,16 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpCookieManager'
14
+ testname = params.kind_of?(Array) ? 'HttpCookieManager' : (params[:name] || 'HttpCookieManager')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="#{params[:name]}" enabled="true">
16
+ <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="#{testname}" enabled="true">
17
17
  <collectionProp name="CookieManager.cookies"/>
18
18
  <boolProp name="CookieManager.clearEachIteration">false</boolProp>
19
19
  <stringProp name="CookieManager.policy">default</stringProp>
20
20
  </CookieManager>)
21
21
  EOS
22
22
  update params
23
- update_at_xpath params if params[:update_at_xpath]
23
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
24
24
  end
25
25
  end
26
26
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpHeaderManager'
14
+ testname = params.kind_of?(Array) ? 'HttpHeaderManager' : (params[:name] || 'HttpHeaderManager')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="#{params[:name]}" enabled="true">
16
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="#{testname}" enabled="true">
17
17
  <collectionProp name="HeaderManager.headers">
18
18
  <elementProp name="" elementType="Header">
19
19
  <stringProp name="Header.name"/>
@@ -23,7 +23,7 @@ module RubyJmeter
23
23
  </HeaderManager>)
24
24
  EOS
25
25
  update params
26
- update_at_xpath params if params[:update_at_xpath]
26
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
27
27
  end
28
28
  end
29
29
 
@@ -11,10 +11,10 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpRequest'
14
+ testname = params.kind_of?(Array) ? 'HttpRequest' : (params[:name] || 'HttpRequest')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="#{params[:name]}" enabled="true">
17
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
16
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="#{testname}" enabled="true">
17
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
18
18
  <collectionProp name="Arguments.arguments"/>
19
19
  </elementProp>
20
20
  <stringProp name="HTTPSampler.domain"/>
@@ -34,7 +34,7 @@ module RubyJmeter
34
34
  </HTTPSamplerProxy>)
35
35
  EOS
36
36
  update params
37
- update_at_xpath params if params[:update_at_xpath]
37
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
38
38
  end
39
39
  end
40
40
 
@@ -11,10 +11,10 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpRequestDefaults'
14
+ testname = params.kind_of?(Array) ? 'HttpRequestDefaults' : (params[:name] || 'HttpRequestDefaults')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
17
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
16
+ <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="#{testname}" enabled="true">
17
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
18
18
  <collectionProp name="Arguments.arguments"/>
19
19
  </elementProp>
20
20
  <stringProp name="HTTPSampler.domain"/>
@@ -37,7 +37,7 @@ module RubyJmeter
37
37
  </ConfigTestElement>)
38
38
  EOS
39
39
  update params
40
- update_at_xpath params if params[:update_at_xpath]
40
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
41
41
  end
42
42
  end
43
43
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'HttpUrlRewritingModifier'
14
+ testname = params.kind_of?(Array) ? 'HttpUrlRewritingModifier' : (params[:name] || 'HttpUrlRewritingModifier')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <URLRewritingModifier guiclass="URLRewritingModifierGui" testclass="URLRewritingModifier" testname="#{params[:name]}" enabled="true">
16
+ <URLRewritingModifier guiclass="URLRewritingModifierGui" testclass="URLRewritingModifier" testname="#{testname}" enabled="true">
17
17
  <stringProp name="argument_name"/>
18
18
  <boolProp name="path_extension">false</boolProp>
19
19
  <boolProp name="path_extension_no_equals">false</boolProp>
@@ -22,7 +22,7 @@ module RubyJmeter
22
22
  </URLRewritingModifier>)
23
23
  EOS
24
24
  update params
25
- update_at_xpath params if params[:update_at_xpath]
25
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
26
26
  end
27
27
  end
28
28
 
@@ -11,16 +11,16 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'IfController'
14
+ testname = params.kind_of?(Array) ? 'IfController' : (params[:name] || 'IfController')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{params[:name]}" enabled="true">
16
+ <IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{testname}" enabled="true">
17
17
  <stringProp name="IfController.condition"/>
18
18
  <boolProp name="IfController.evaluateAll">false</boolProp>
19
19
  <boolProp name="IfController.useExpression">false</boolProp>
20
20
  </IfController>)
21
21
  EOS
22
22
  update params
23
- update_at_xpath params if params[:update_at_xpath]
23
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
24
24
  end
25
25
  end
26
26
 
@@ -11,14 +11,14 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'IncludeController'
14
+ testname = params.kind_of?(Array) ? 'IncludeController' : (params[:name] || 'IncludeController')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <IncludeController guiclass="IncludeControllerGui" testclass="IncludeController" testname="#{params[:name]}" enabled="true">
16
+ <IncludeController guiclass="IncludeControllerGui" testclass="IncludeController" testname="#{testname}" enabled="true">
17
17
  <stringProp name="IncludeController.includepath"/>
18
18
  </IncludeController>)
19
19
  EOS
20
20
  update params
21
- update_at_xpath params if params[:update_at_xpath]
21
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
22
22
  end
23
23
  end
24
24
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JavaRequest'
14
+ testname = params.kind_of?(Array) ? 'JavaRequest' : (params[:name] || 'JavaRequest')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{params[:name]}" enabled="true">
16
+ <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{testname}" enabled="true">
17
17
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
18
18
  <collectionProp name="Arguments.arguments">
19
19
  <elementProp name="Sleep_Time" elementType="Argument">
@@ -62,7 +62,7 @@ module RubyJmeter
62
62
  </JavaSampler>)
63
63
  EOS
64
64
  update params
65
- update_at_xpath params if params[:update_at_xpath]
65
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
66
66
  end
67
67
  end
68
68
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JavaRequestDefaults'
14
+ testname = params.kind_of?(Array) ? 'JavaRequestDefaults' : (params[:name] || 'JavaRequestDefaults')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JavaConfig guiclass="JavaConfigGui" testclass="JavaConfig" testname="#{params[:name]}" enabled="true">
16
+ <JavaConfig guiclass="JavaConfigGui" testclass="JavaConfig" testname="#{testname}" enabled="true">
17
17
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
18
18
  <collectionProp name="Arguments.arguments">
19
19
  <elementProp name="Sleep_Time" elementType="Argument">
@@ -62,7 +62,7 @@ module RubyJmeter
62
62
  </JavaConfig>)
63
63
  EOS
64
64
  update params
65
- update_at_xpath params if params[:update_at_xpath]
65
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
66
66
  end
67
67
  end
68
68
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JdbcConnectionConfiguration'
14
+ testname = params.kind_of?(Array) ? 'JdbcConnectionConfiguration' : (params[:name] || 'JdbcConnectionConfiguration')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="#{params[:name]}" enabled="true">
16
+ <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="#{testname}" enabled="true">
17
17
  <boolProp name="autocommit">true</boolProp>
18
18
  <stringProp name="checkQuery">Select 1</stringProp>
19
19
  <stringProp name="connectionAge">5000</stringProp>
@@ -30,7 +30,7 @@ module RubyJmeter
30
30
  </JDBCDataSource>)
31
31
  EOS
32
32
  update params
33
- update_at_xpath params if params[:update_at_xpath]
33
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
34
34
  end
35
35
  end
36
36
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JdbcPostprocessor'
14
+ testname = params.kind_of?(Array) ? 'JdbcPostprocessor' : (params[:name] || 'JdbcPostprocessor')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JDBCPostProcessor guiclass="TestBeanGUI" testclass="JDBCPostProcessor" testname="#{params[:name]}" enabled="true">
16
+ <JDBCPostProcessor guiclass="TestBeanGUI" testclass="JDBCPostProcessor" testname="#{testname}" enabled="true">
17
17
  <stringProp name="dataSource"/>
18
18
  <stringProp name="query"/>
19
19
  <stringProp name="queryArguments"/>
@@ -24,7 +24,7 @@ module RubyJmeter
24
24
  </JDBCPostProcessor>)
25
25
  EOS
26
26
  update params
27
- update_at_xpath params if params[:update_at_xpath]
27
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
28
28
  end
29
29
  end
30
30
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JdbcPreprocessor'
14
+ testname = params.kind_of?(Array) ? 'JdbcPreprocessor' : (params[:name] || 'JdbcPreprocessor')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JDBCPreProcessor guiclass="TestBeanGUI" testclass="JDBCPreProcessor" testname="#{params[:name]}" enabled="true">
16
+ <JDBCPreProcessor guiclass="TestBeanGUI" testclass="JDBCPreProcessor" testname="#{testname}" enabled="true">
17
17
  <stringProp name="dataSource"/>
18
18
  <stringProp name="query"/>
19
19
  <stringProp name="queryArguments"/>
@@ -24,7 +24,7 @@ module RubyJmeter
24
24
  </JDBCPreProcessor>)
25
25
  EOS
26
26
  update params
27
- update_at_xpath params if params[:update_at_xpath]
27
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
28
28
  end
29
29
  end
30
30
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JdbcRequest'
14
+ testname = params.kind_of?(Array) ? 'JdbcRequest' : (params[:name] || 'JdbcRequest')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="#{params[:name]}" enabled="true">
16
+ <JDBCSampler guiclass="TestBeanGUI" testclass="JDBCSampler" testname="#{testname}" enabled="true">
17
17
  <stringProp name="dataSource"/>
18
18
  <stringProp name="query"/>
19
19
  <stringProp name="queryArguments"/>
@@ -24,7 +24,7 @@ module RubyJmeter
24
24
  </JDBCSampler>)
25
25
  EOS
26
26
  update params
27
- update_at_xpath params if params[:update_at_xpath]
27
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
28
28
  end
29
29
  end
30
30
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JmsPointtopoint'
14
+ testname = params.kind_of?(Array) ? 'JmsPointtopoint' : (params[:name] || 'JmsPointtopoint')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JMSSampler guiclass="JMSSamplerGui" testclass="JMSSampler" testname="#{params[:name]}" enabled="true">
16
+ <JMSSampler guiclass="JMSSamplerGui" testclass="JMSSampler" testname="#{testname}" enabled="true">
17
17
  <stringProp name="JMSSampler.queueconnectionfactory"/>
18
18
  <stringProp name="JMSSampler.SendQueue"/>
19
19
  <stringProp name="JMSSampler.ReceiveQueue"/>
@@ -24,16 +24,16 @@ module RubyJmeter
24
24
  <stringProp name="HTTPSamper.xml_data"/>
25
25
  <stringProp name="JMSSampler.initialContextFactory"/>
26
26
  <stringProp name="JMSSampler.contextProviderUrl"/>
27
- <elementProp name="JMSSampler.jndiProperties" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
27
+ <elementProp name="JMSSampler.jndiProperties" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
28
28
  <collectionProp name="Arguments.arguments"/>
29
29
  </elementProp>
30
- <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
30
+ <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
31
31
  <collectionProp name="Arguments.arguments"/>
32
32
  </elementProp>
33
33
  </JMSSampler>)
34
34
  EOS
35
35
  update params
36
- update_at_xpath params if params[:update_at_xpath]
36
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
37
37
  end
38
38
  end
39
39
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JmsPublisher'
14
+ testname = params.kind_of?(Array) ? 'JmsPublisher' : (params[:name] || 'JmsPublisher')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <PublisherSampler guiclass="JMSPublisherGui" testclass="PublisherSampler" testname="#{params[:name]}" enabled="true">
16
+ <PublisherSampler guiclass="JMSPublisherGui" testclass="PublisherSampler" testname="#{testname}" enabled="true">
17
17
  <stringProp name="jms.jndi_properties">false</stringProp>
18
18
  <stringProp name="jms.initial_context_factory"/>
19
19
  <stringProp name="jms.provider_url"/>
@@ -28,13 +28,13 @@ module RubyJmeter
28
28
  <stringProp name="jms.config_msg_type">jms_text_message</stringProp>
29
29
  <stringProp name="jms.iterations">1</stringProp>
30
30
  <boolProp name="jms.authenticate">false</boolProp>
31
- <elementProp name="jms.jmsProperties" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
31
+ <elementProp name="jms.jmsProperties" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
32
32
  <collectionProp name="Arguments.arguments"/>
33
33
  </elementProp>
34
34
  </PublisherSampler>)
35
35
  EOS
36
36
  update params
37
- update_at_xpath params if params[:update_at_xpath]
37
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
38
38
  end
39
39
  end
40
40
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'JmsSubscriber'
14
+ testname = params.kind_of?(Array) ? 'JmsSubscriber' : (params[:name] || 'JmsSubscriber')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <SubscriberSampler guiclass="JMSSubscriberGui" testclass="SubscriberSampler" testname="#{params[:name]}" enabled="true">
16
+ <SubscriberSampler guiclass="JMSSubscriberGui" testclass="SubscriberSampler" testname="#{testname}" enabled="true">
17
17
  <stringProp name="jms.jndi_properties">false</stringProp>
18
18
  <stringProp name="jms.initial_context_factory"/>
19
19
  <stringProp name="jms.provider_url"/>
@@ -28,7 +28,7 @@ module RubyJmeter
28
28
  </SubscriberSampler>)
29
29
  EOS
30
30
  update params
31
- update_at_xpath params if params[:update_at_xpath]
31
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
32
32
  end
33
33
  end
34
34
 
@@ -11,9 +11,9 @@ module RubyJmeter
11
11
  include Helper
12
12
 
13
13
  def initialize(params={})
14
- params[:name] ||= 'Jsr223Assertion'
14
+ testname = params.kind_of?(Array) ? 'Jsr223Assertion' : (params[:name] || 'Jsr223Assertion')
15
15
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
- <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="#{params[:name]}" enabled="true">
16
+ <JSR223Assertion guiclass="TestBeanGUI" testclass="JSR223Assertion" testname="#{testname}" enabled="true">
17
17
  <stringProp name="scriptLanguage"/>
18
18
  <stringProp name="parameters"/>
19
19
  <stringProp name="filename"/>
@@ -22,7 +22,7 @@ module RubyJmeter
22
22
  </JSR223Assertion>)
23
23
  EOS
24
24
  update params
25
- update_at_xpath params if params[:update_at_xpath]
25
+ update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
26
26
  end
27
27
  end
28
28