gridinit-jmeter 0.3.2 → 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. data/Gemfile +2 -1
  2. data/README.md +51 -72
  3. data/examples/basic_assertion.rb +6 -6
  4. data/examples/basic_auth.rb +5 -5
  5. data/examples/basic_cache.rb +5 -5
  6. data/examples/basic_cookies.rb +5 -5
  7. data/examples/basic_extract.rb +4 -10
  8. data/examples/basic_gc_results.rb +12 -9
  9. data/examples/basic_google.rb +3 -3
  10. data/examples/basic_grid.rb +3 -6
  11. data/examples/basic_header.rb +12 -10
  12. data/examples/basic_ldap_ext.rb +11 -12
  13. data/examples/basic_post.rb +5 -6
  14. data/examples/basic_query_params.rb +3 -3
  15. data/examples/basic_think_time.rb +7 -4
  16. data/examples/basic_throughput_shaping_timer.rb +4 -4
  17. data/examples/etsy_login_browse.rb +21 -21
  18. data/lib/gridinit-jmeter/DSL.md +237 -0
  19. data/lib/gridinit-jmeter/{idl → dsl}/access_log_sampler.rb +4 -2
  20. data/lib/gridinit-jmeter/{idl → dsl}/aggregate_graph.rb +4 -2
  21. data/lib/gridinit-jmeter/{idl → dsl}/aggregate_report.rb +4 -2
  22. data/lib/gridinit-jmeter/{idl → dsl}/ajp13_sampler.rb +5 -3
  23. data/lib/gridinit-jmeter/{idl → dsl}/assertion_results.rb +4 -2
  24. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_assertion.rb +4 -2
  25. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_listener.rb +4 -2
  26. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_postprocessor.rb +4 -2
  27. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_preprocessor.rb +4 -2
  28. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_sampler.rb +4 -2
  29. data/lib/gridinit-jmeter/{idl → dsl}/beanshell_timer.rb +4 -2
  30. data/lib/gridinit-jmeter/{idl → dsl}/bsf_assertion.rb +4 -2
  31. data/lib/gridinit-jmeter/{idl → dsl}/bsf_listener.rb +4 -2
  32. data/lib/gridinit-jmeter/{idl → dsl}/bsf_postprocessor.rb +4 -2
  33. data/lib/gridinit-jmeter/{idl → dsl}/bsf_preprocessor.rb +4 -2
  34. data/lib/gridinit-jmeter/{idl → dsl}/bsf_sampler.rb +4 -2
  35. data/lib/gridinit-jmeter/{idl → dsl}/bsf_timer.rb +4 -2
  36. data/lib/gridinit-jmeter/{idl → dsl}/compare_assertion.rb +4 -2
  37. data/lib/gridinit-jmeter/{idl → dsl}/comparison_assertion_visualizer.rb +4 -2
  38. data/lib/gridinit-jmeter/{idl → dsl}/constant_throughput_timer.rb +4 -2
  39. data/lib/gridinit-jmeter/{idl → dsl}/constant_timer.rb +4 -2
  40. data/lib/gridinit-jmeter/{idl → dsl}/counter.rb +4 -2
  41. data/lib/gridinit-jmeter/{idl → dsl}/cssjquery_extractor.rb +4 -2
  42. data/lib/gridinit-jmeter/{idl → dsl}/csv_data_set_config.rb +4 -2
  43. data/lib/gridinit-jmeter/{idl → dsl}/debug_postprocessor.rb +4 -2
  44. data/lib/gridinit-jmeter/{idl → dsl}/debug_sampler.rb +4 -2
  45. data/lib/gridinit-jmeter/{idl → dsl}/distribution_graphalpha.rb +4 -2
  46. data/lib/gridinit-jmeter/{idl → dsl}/duration_assertion.rb +4 -2
  47. data/lib/gridinit-jmeter/{idl → dsl}/foreach_controller.rb +4 -2
  48. data/lib/gridinit-jmeter/{idl → dsl}/ftp_request.rb +4 -2
  49. data/lib/gridinit-jmeter/{idl → dsl}/ftp_request_defaults.rb +4 -2
  50. data/lib/gridinit-jmeter/{idl → dsl}/gaussian_random_timer.rb +4 -2
  51. data/lib/gridinit-jmeter/{idl → dsl}/generate_summary_results.rb +4 -2
  52. data/lib/gridinit-jmeter/{idl → dsl}/graph_results.rb +4 -2
  53. data/lib/gridinit-jmeter/{idl → dsl}/html_assertion.rb +4 -2
  54. data/lib/gridinit-jmeter/{idl → dsl}/html_link_parser.rb +4 -2
  55. data/lib/gridinit-jmeter/{idl → dsl}/html_parameter_mask.rb +4 -2
  56. data/lib/gridinit-jmeter/dsl/http_authorization_manager.rb +36 -0
  57. data/lib/gridinit-jmeter/{idl → dsl}/http_cache_manager.rb +4 -2
  58. data/lib/gridinit-jmeter/{idl → dsl}/http_cookie_manager.rb +5 -2
  59. data/lib/gridinit-jmeter/{idl → dsl}/http_header_manager.rb +10 -3
  60. data/lib/gridinit-jmeter/{idl → dsl}/http_request.rb +5 -3
  61. data/lib/gridinit-jmeter/{idl → dsl}/http_request_defaults.rb +15 -4
  62. data/lib/gridinit-jmeter/{idl → dsl}/http_url_rewriting_modifier.rb +4 -2
  63. data/lib/gridinit-jmeter/{idl → dsl}/if_controller.rb +5 -2
  64. data/lib/gridinit-jmeter/{idl → dsl}/include_controller.rb +4 -2
  65. data/lib/gridinit-jmeter/{idl → dsl}/java_request.rb +4 -2
  66. data/lib/gridinit-jmeter/{idl → dsl}/java_request_defaults.rb +4 -2
  67. data/lib/gridinit-jmeter/{idl → dsl}/jdbc_connection_configuration.rb +4 -2
  68. data/lib/gridinit-jmeter/{idl → dsl}/jdbc_postprocessor.rb +4 -2
  69. data/lib/gridinit-jmeter/{idl → dsl}/jdbc_preprocessor.rb +4 -2
  70. data/lib/gridinit-jmeter/{idl → dsl}/jdbc_request.rb +4 -2
  71. data/lib/gridinit-jmeter/{idl → dsl}/jms_pointtopoint.rb +6 -4
  72. data/lib/gridinit-jmeter/{idl → dsl}/jms_publisher.rb +5 -3
  73. data/lib/gridinit-jmeter/{idl → dsl}/jms_subscriber.rb +4 -2
  74. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_assertion.rb +4 -2
  75. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_listener.rb +4 -2
  76. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_postprocessor.rb +4 -2
  77. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_preprocessor.rb +4 -2
  78. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_sampler.rb +4 -2
  79. data/lib/gridinit-jmeter/{idl → dsl}/jsr223_timer.rb +4 -2
  80. data/lib/gridinit-jmeter/{idl → dsl}/junit_request.rb +4 -2
  81. data/lib/gridinit-jmeter/{idl → dsl}/keystore_configuration.rb +4 -2
  82. data/lib/gridinit-jmeter/{idl → dsl}/ldap_extended_request.rb +4 -2
  83. data/lib/gridinit-jmeter/{idl → dsl}/ldap_extended_request_defaults.rb +4 -2
  84. data/lib/gridinit-jmeter/{idl → dsl}/ldap_request.rb +5 -3
  85. data/lib/gridinit-jmeter/{idl → dsl}/ldap_request_defaults.rb +13 -4
  86. data/lib/gridinit-jmeter/{idl → dsl}/login_config_element.rb +4 -2
  87. data/lib/gridinit-jmeter/{idl → dsl}/loop_controller.rb +4 -2
  88. data/lib/gridinit-jmeter/{idl → dsl}/mail_reader_sampler.rb +4 -2
  89. data/lib/gridinit-jmeter/{idl → dsl}/mailer_visualizer.rb +4 -2
  90. data/lib/gridinit-jmeter/{idl → dsl}/md5hex_assertion.rb +4 -2
  91. data/lib/gridinit-jmeter/{idl → dsl}/module_controller.rb +4 -2
  92. data/lib/gridinit-jmeter/{idl → dsl}/monitor_results.rb +4 -2
  93. data/lib/gridinit-jmeter/{idl → dsl}/once_only_controller.rb +4 -2
  94. data/lib/gridinit-jmeter/{idl → dsl}/os_process_sampler.rb +6 -4
  95. data/lib/gridinit-jmeter/{idl → dsl}/poisson_random_timer.rb +4 -2
  96. data/lib/gridinit-jmeter/{idl → dsl}/random_controller.rb +4 -2
  97. data/lib/gridinit-jmeter/{idl → dsl}/random_order_controller.rb +4 -2
  98. data/lib/gridinit-jmeter/{idl → dsl}/random_variable.rb +4 -2
  99. data/lib/gridinit-jmeter/{idl → dsl}/recording_controller.rb +4 -2
  100. data/lib/gridinit-jmeter/{idl → dsl}/regex_user_parameters.rb +4 -2
  101. data/lib/gridinit-jmeter/{idl → dsl}/regular_expression_extractor.rb +5 -2
  102. data/lib/gridinit-jmeter/{idl → dsl}/response_assertion.rb +8 -3
  103. data/lib/gridinit-jmeter/{idl → dsl}/response_time_graph.rb +4 -2
  104. data/lib/gridinit-jmeter/{idl → dsl}/result_status_action_handler.rb +4 -2
  105. data/lib/gridinit-jmeter/{idl → dsl}/runtime_controller.rb +4 -2
  106. data/lib/gridinit-jmeter/{idl → dsl}/save_responses_to_a_file.rb +4 -2
  107. data/lib/gridinit-jmeter/{idl → dsl}/simple_config_element.rb +4 -2
  108. data/lib/gridinit-jmeter/{idl → dsl}/simple_controller.rb +4 -2
  109. data/lib/gridinit-jmeter/{idl → dsl}/simple_data_writer.rb +4 -2
  110. data/lib/gridinit-jmeter/{idl → dsl}/smime_assertion.rb +4 -2
  111. data/lib/gridinit-jmeter/{idl → dsl}/smtp_sampler.rb +4 -2
  112. data/lib/gridinit-jmeter/{idl → dsl}/soapxmlrpc_request.rb +4 -2
  113. data/lib/gridinit-jmeter/{idl → dsl}/spline_visualizer.rb +4 -2
  114. data/lib/gridinit-jmeter/{idl → dsl}/summary_report.rb +4 -2
  115. data/lib/gridinit-jmeter/{idl → dsl}/switch_controller.rb +4 -2
  116. data/lib/gridinit-jmeter/{idl → dsl}/synchronizing_timer.rb +4 -2
  117. data/lib/gridinit-jmeter/{idl → dsl}/tcp_sampler.rb +4 -2
  118. data/lib/gridinit-jmeter/{idl → dsl}/tcp_sampler_config.rb +4 -2
  119. data/lib/gridinit-jmeter/{idl → dsl}/test_action.rb +4 -2
  120. data/lib/gridinit-jmeter/{idl → dsl}/test_plan.rb +5 -3
  121. data/lib/gridinit-jmeter/{idl → dsl}/thread_group.rb +5 -3
  122. data/lib/gridinit-jmeter/{idl → dsl}/throughput_controller.rb +5 -3
  123. data/lib/gridinit-jmeter/{idl → dsl}/transaction_controller.rb +6 -3
  124. data/lib/gridinit-jmeter/{idl → dsl}/uniform_random_timer.rb +4 -2
  125. data/lib/gridinit-jmeter/dsl/user_defined_variables.rb +35 -0
  126. data/lib/gridinit-jmeter/{idl → dsl}/user_parameters.rb +4 -2
  127. data/lib/gridinit-jmeter/{idl → dsl}/view_results_in_table.rb +4 -2
  128. data/lib/gridinit-jmeter/{idl → dsl}/view_results_tree.rb +4 -2
  129. data/lib/gridinit-jmeter/{idl → dsl}/while_controller.rb +4 -2
  130. data/lib/gridinit-jmeter/{idl → dsl}/xml_assertion.rb +4 -2
  131. data/lib/gridinit-jmeter/{idl → dsl}/xml_schema_assertion.rb +4 -2
  132. data/lib/gridinit-jmeter/{idl → dsl}/xpath_assertion.rb +4 -2
  133. data/lib/gridinit-jmeter/{idl → dsl}/xpath_extractor.rb +4 -2
  134. data/lib/gridinit-jmeter/dsl.rb +170 -187
  135. data/lib/gridinit-jmeter/helpers/helper.rb +43 -0
  136. data/lib/gridinit-jmeter/helpers/parser.rb +109 -0
  137. data/lib/gridinit-jmeter/idl.rb +16 -6
  138. data/lib/gridinit-jmeter/idl.xml +54 -11
  139. data/lib/gridinit-jmeter/{listeners → plugins}/gc_console_status_logger.rb +0 -0
  140. data/lib/gridinit-jmeter/{listeners → plugins}/gc_latencies_over_time.rb +0 -0
  141. data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_codes_per_second.rb +0 -0
  142. data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_distribution.rb +0 -0
  143. data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_over_time.rb +0 -0
  144. data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_percentiles.rb +0 -0
  145. data/lib/gridinit-jmeter/{listeners → plugins}/gc_transactions_per_second.rb +0 -0
  146. data/lib/gridinit-jmeter/{timers/gc_throughput_shaping_timer.rb → plugins/gc_variable_throughput_timer.rb} +1 -1
  147. data/lib/gridinit-jmeter/version.rb +1 -1
  148. data/lib/gridinit-jmeter.rb +6 -105
  149. data/spec/dsl_spec.rb +377 -82
  150. metadata +131 -174
  151. data/examples/basic_proxy.rb +0 -8
  152. data/examples/basic_results.rb +0 -22
  153. data/examples/basic_run.rb +0 -12
  154. data/examples/basic_simple_data_writer.rb +0 -14
  155. data/examples/basic_stdout.rb +0 -8
  156. data/examples/basic_test_data.rb +0 -15
  157. data/examples/basic_testplan.jmx +0 -138
  158. data/examples/basic_testplan.rb +0 -44
  159. data/examples/jbhifi_now_search.rb +0 -94
  160. data/lib/gridinit-jmeter/assertions/response_assertion.rb +0 -55
  161. data/lib/gridinit-jmeter/config/auth_manager.rb +0 -26
  162. data/lib/gridinit-jmeter/config/cache_manager.rb +0 -20
  163. data/lib/gridinit-jmeter/config/cookie_manager.rb +0 -21
  164. data/lib/gridinit-jmeter/config/counter_config.rb +0 -24
  165. data/lib/gridinit-jmeter/config/header_manager.rb +0 -26
  166. data/lib/gridinit-jmeter/config/random_variable.rb +0 -24
  167. data/lib/gridinit-jmeter/config/request_defaults.rb +0 -31
  168. data/lib/gridinit-jmeter/config/user_defined_variable.rb +0 -25
  169. data/lib/gridinit-jmeter/controllers/if_controller.rb +0 -20
  170. data/lib/gridinit-jmeter/controllers/interleave.rb +0 -18
  171. data/lib/gridinit-jmeter/controllers/loop_controller.rb +0 -19
  172. data/lib/gridinit-jmeter/controllers/once_only.rb +0 -17
  173. data/lib/gridinit-jmeter/controllers/random_order.rb +0 -16
  174. data/lib/gridinit-jmeter/controllers/simple.rb +0 -17
  175. data/lib/gridinit-jmeter/controllers/switch.rb +0 -20
  176. data/lib/gridinit-jmeter/controllers/throughput.rb +0 -26
  177. data/lib/gridinit-jmeter/controllers/transaction.rb +0 -19
  178. data/lib/gridinit-jmeter/controllers/while_controller.rb +0 -18
  179. data/lib/gridinit-jmeter/helpers/dsl_helper.rb +0 -21
  180. data/lib/gridinit-jmeter/idl/http_authorization_manager.rb +0 -26
  181. data/lib/gridinit-jmeter/idl/user_defined_variables.rb +0 -26
  182. data/lib/gridinit-jmeter/listeners/aggregate_report.rb +0 -47
  183. data/lib/gridinit-jmeter/listeners/graph_visualizer.rb +0 -46
  184. data/lib/gridinit-jmeter/listeners/response_time_graph_visualizer.rb +0 -47
  185. data/lib/gridinit-jmeter/listeners/simple_data_writer.rb +0 -51
  186. data/lib/gridinit-jmeter/listeners/stat_visualizer.rb +0 -46
  187. data/lib/gridinit-jmeter/listeners/summary_report.rb +0 -46
  188. data/lib/gridinit-jmeter/listeners/table_visualizer.rb +0 -46
  189. data/lib/gridinit-jmeter/listeners/view_results_full_visualizer.rb +0 -57
  190. data/lib/gridinit-jmeter/post_processors/regex_extractor.rb +0 -34
  191. data/lib/gridinit-jmeter/post_processors/xpath_extractor.rb +0 -23
  192. data/lib/gridinit-jmeter/pre_processors/bean_shell_pre_processor.rb +0 -23
  193. data/lib/gridinit-jmeter/samplers/http_sampler.rb +0 -99
  194. data/lib/gridinit-jmeter/samplers/ldap_ext_sampler.rb +0 -36
  195. data/lib/gridinit-jmeter/samplers/soap_sampler.rb +0 -26
  196. data/lib/gridinit-jmeter/test_plan/test_plan.rb +0 -23
  197. data/lib/gridinit-jmeter/threads/thread_group.rb +0 -30
  198. data/lib/gridinit-jmeter/timers/gaussian_random_timer.rb +0 -18
@@ -12,13 +12,15 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'ConstantTimer'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="#{name}" enabled="true">
18
+ <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="ConstantTimer.delay">300</stringProp>
19
20
  </ConstantTimer>)
20
21
  EOS
21
22
  update params
23
+ update_at_xpath params if params[:update_at_xpath]
22
24
  end
23
25
  end
24
26
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'Counter'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="#{name}" enabled="true">
18
+ <CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="CounterConfig.start"/>
19
20
  <stringProp name="CounterConfig.end"/>
20
21
  <stringProp name="CounterConfig.incr"/>
@@ -24,6 +25,7 @@ module Gridinit
24
25
  </CounterConfig>)
25
26
  EOS
26
27
  update params
28
+ update_at_xpath params if params[:update_at_xpath]
27
29
  end
28
30
  end
29
31
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'CssjqueryExtractor'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <HtmlExtractor guiclass="HtmlExtractorGui" testclass="HtmlExtractor" testname="#{name}" enabled="true">
18
+ <HtmlExtractor guiclass="HtmlExtractorGui" testclass="HtmlExtractor" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="HtmlExtractor.refname"/>
19
20
  <stringProp name="HtmlExtractor.expr"/>
20
21
  <stringProp name="HtmlExtractor.attribute"/>
@@ -24,6 +25,7 @@ module Gridinit
24
25
  </HtmlExtractor>)
25
26
  EOS
26
27
  update params
28
+ update_at_xpath params if params[:update_at_xpath]
27
29
  end
28
30
  end
29
31
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'CsvDataSetConfig'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="#{name}" enabled="true">
18
+ <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="delimiter">,</stringProp>
19
20
  <stringProp name="fileEncoding"/>
20
21
  <stringProp name="filename"/>
@@ -26,6 +27,7 @@ module Gridinit
26
27
  </CSVDataSet>)
27
28
  EOS
28
29
  update params
30
+ update_at_xpath params if params[:update_at_xpath]
29
31
  end
30
32
  end
31
33
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'DebugPostprocessor'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="#{name}" enabled="true">
18
+ <DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="displayJMeterProperties">false</boolProp>
19
20
  <boolProp name="displayJMeterVariables">true</boolProp>
20
21
  <boolProp name="displaySamplerProperties">true</boolProp>
@@ -22,6 +23,7 @@ module Gridinit
22
23
  </DebugPostProcessor>)
23
24
  EOS
24
25
  update params
26
+ update_at_xpath params if params[:update_at_xpath]
25
27
  end
26
28
  end
27
29
 
@@ -12,15 +12,17 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'DebugSampler'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="#{name}" enabled="true">
18
+ <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="displayJMeterProperties">false</boolProp>
19
20
  <boolProp name="displayJMeterVariables">true</boolProp>
20
21
  <boolProp name="displaySystemProperties">false</boolProp>
21
22
  </DebugSampler>)
22
23
  EOS
23
24
  update params
25
+ update_at_xpath params if params[:update_at_xpath]
24
26
  end
25
27
  end
26
28
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'DistributionGraphalpha'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{name}" enabled="true">
18
+ <ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="ResultCollector.error_logging">false</boolProp>
19
20
  <objProp>
20
21
  <name>saveConfig</name>
@@ -49,6 +50,7 @@ module Gridinit
49
50
  </ResultCollector>)
50
51
  EOS
51
52
  update params
53
+ update_at_xpath params if params[:update_at_xpath]
52
54
  end
53
55
  end
54
56
 
@@ -12,13 +12,15 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'DurationAssertion'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="#{name}" enabled="true">
18
+ <DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="DurationAssertion.duration"/>
19
20
  </DurationAssertion>)
20
21
  EOS
21
22
  update params
23
+ update_at_xpath params if params[:update_at_xpath]
22
24
  end
23
25
  end
24
26
 
@@ -12,15 +12,17 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'ForeachController'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="#{name}" enabled="true">
18
+ <ForeachController guiclass="ForeachControlPanel" testclass="ForeachController" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="ForeachController.inputVal"/>
19
20
  <stringProp name="ForeachController.returnVal"/>
20
21
  <boolProp name="ForeachController.useSeparator">true</boolProp>
21
22
  </ForeachController>)
22
23
  EOS
23
24
  update params
25
+ update_at_xpath params if params[:update_at_xpath]
24
26
  end
25
27
  end
26
28
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'FtpRequest'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="#{name}" enabled="true">
18
+ <FTPSampler guiclass="FtpTestSamplerGui" testclass="FTPSampler" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="FTPSampler.server"/>
19
20
  <stringProp name="FTPSampler.port"/>
20
21
  <stringProp name="FTPSampler.filename"/>
@@ -28,6 +29,7 @@ module Gridinit
28
29
  </FTPSampler>)
29
30
  EOS
30
31
  update params
32
+ update_at_xpath params if params[:update_at_xpath]
31
33
  end
32
34
  end
33
35
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'FtpRequestDefaults'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ConfigTestElement guiclass="FtpConfigGui" testclass="ConfigTestElement" testname="#{name}" enabled="true">
18
+ <ConfigTestElement guiclass="FtpConfigGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="FTPSampler.server"/>
19
20
  <stringProp name="FTPSampler.port"/>
20
21
  <stringProp name="FTPSampler.filename"/>
@@ -26,6 +27,7 @@ module Gridinit
26
27
  </ConfigTestElement>)
27
28
  EOS
28
29
  update params
30
+ update_at_xpath params if params[:update_at_xpath]
29
31
  end
30
32
  end
31
33
 
@@ -12,14 +12,16 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'GaussianRandomTimer'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="#{name}" enabled="true">
18
+ <GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="ConstantTimer.delay">300</stringProp>
19
20
  <stringProp name="RandomTimer.range">100.0</stringProp>
20
21
  </GaussianRandomTimer>)
21
22
  EOS
22
23
  update params
24
+ update_at_xpath params if params[:update_at_xpath]
23
25
  end
24
26
  end
25
27
 
@@ -12,11 +12,13 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'GenerateSummaryResults'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <Summariser guiclass="SummariserGui" testclass="Summariser" testname="#{name}" enabled="true"/>)
18
+ <Summariser guiclass="SummariserGui" testclass="Summariser" testname="#{params[:name]}" enabled="true"/>)
18
19
  EOS
19
20
  update params
21
+ update_at_xpath params if params[:update_at_xpath]
20
22
  end
21
23
  end
22
24
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'GraphResults'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="#{name}" enabled="true">
18
+ <ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="ResultCollector.error_logging">false</boolProp>
19
20
  <objProp>
20
21
  <name>saveConfig</name>
@@ -49,6 +50,7 @@ module Gridinit
49
50
  </ResultCollector>)
50
51
  EOS
51
52
  update params
53
+ update_at_xpath params if params[:update_at_xpath]
52
54
  end
53
55
  end
54
56
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HtmlAssertion'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <HTMLAssertion guiclass="HTMLAssertionGui" testclass="HTMLAssertion" testname="#{name}" enabled="true">
18
+ <HTMLAssertion guiclass="HTMLAssertionGui" testclass="HTMLAssertion" testname="#{params[:name]}" enabled="true">
18
19
  <longProp name="html_assertion_error_threshold">0</longProp>
19
20
  <longProp name="html_assertion_warning_threshold">0</longProp>
20
21
  <stringProp name="html_assertion_doctype">omit</stringProp>
@@ -24,6 +25,7 @@ module Gridinit
24
25
  </HTMLAssertion>)
25
26
  EOS
26
27
  update params
28
+ update_at_xpath params if params[:update_at_xpath]
27
29
  end
28
30
  end
29
31
 
@@ -12,11 +12,13 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HtmlLinkParser'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <AnchorModifier guiclass="AnchorModifierGui" testclass="AnchorModifier" testname="#{name}" enabled="true"/>)
18
+ <AnchorModifier guiclass="AnchorModifierGui" testclass="AnchorModifier" testname="#{params[:name]}" enabled="true"/>)
18
19
  EOS
19
20
  update params
21
+ update_at_xpath params if params[:update_at_xpath]
20
22
  end
21
23
  end
22
24
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HtmlParameterMask'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ParamModifier guiclass="ParamModifierGui" testclass="ParamModifier" testname="#{name}" enabled="true">
18
+ <ParamModifier guiclass="ParamModifierGui" testclass="ParamModifier" testname="#{params[:name]}" enabled="true">
18
19
  <elementProp name="ParamModifier.mask" elementType="ParamMask">
19
20
  <stringProp name="ParamModifier.field_name"/>
20
21
  <stringProp name="ParamModifier.prefix"/>
@@ -26,6 +27,7 @@ module Gridinit
26
27
  </ParamModifier>)
27
28
  EOS
28
29
  update params
30
+ update_at_xpath params if params[:update_at_xpath]
29
31
  end
30
32
  end
31
33
 
@@ -0,0 +1,36 @@
1
+ module Gridinit
2
+ module Jmeter
3
+
4
+ class DSL
5
+ def http_authorization_manager(params={}, &block)
6
+ node = Gridinit::Jmeter::HttpAuthorizationManager.new(params)
7
+ attach_node(node, &block)
8
+ end
9
+ end
10
+
11
+ class HttpAuthorizationManager
12
+ attr_accessor :doc
13
+ include Helper
14
+
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpAuthorizationManager'
17
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
18
+ <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="#{params[:name]}" enabled="true">
19
+ <collectionProp name="AuthManager.auth_list">
20
+ <elementProp name="" elementType="Authorization">
21
+ <stringProp name="Authorization.url"/>
22
+ <stringProp name="Authorization.username"/>
23
+ <stringProp name="Authorization.password"/>
24
+ <stringProp name="Authorization.domain"/>
25
+ <stringProp name="Authorization.realm"/>
26
+ </elementProp>
27
+ </collectionProp>
28
+ </AuthManager>)
29
+ EOS
30
+ update params
31
+ update_at_xpath params if params[:update_at_xpath]
32
+ end
33
+ end
34
+
35
+ end
36
+ end
@@ -12,14 +12,16 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpCacheManager'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="#{name}" enabled="true">
18
+ <CacheManager guiclass="CacheManagerGui" testclass="CacheManager" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="clearEachIteration">false</boolProp>
19
20
  <boolProp name="useExpires">false</boolProp>
20
21
  </CacheManager>)
21
22
  EOS
22
23
  update params
24
+ update_at_xpath params if params[:update_at_xpath]
23
25
  end
24
26
  end
25
27
 
@@ -12,14 +12,17 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpCookieManager'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="#{name}" enabled="true">
18
+ <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="#{params[:name]}" enabled="true">
18
19
  <collectionProp name="CookieManager.cookies"/>
19
20
  <boolProp name="CookieManager.clearEachIteration">false</boolProp>
21
+ <stringProp name="CookieManager.policy">default</stringProp>
20
22
  </CookieManager>)
21
23
  EOS
22
24
  update params
25
+ update_at_xpath params if params[:update_at_xpath]
23
26
  end
24
27
  end
25
28
 
@@ -12,13 +12,20 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpHeaderManager'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="#{name}" enabled="true">
18
- <collectionProp name="HeaderManager.headers"/>
18
+ <HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="#{params[:name]}" enabled="true">
19
+ <collectionProp name="HeaderManager.headers">
20
+ <elementProp name="" elementType="Header">
21
+ <stringProp name="Header.name"/>
22
+ <stringProp name="Header.value"/>
23
+ </elementProp>
24
+ </collectionProp>
19
25
  </HeaderManager>)
20
26
  EOS
21
27
  update params
28
+ update_at_xpath params if params[:update_at_xpath]
22
29
  end
23
30
  end
24
31
 
@@ -12,10 +12,11 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpRequest'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="#{name}" enabled="true">
18
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{name}" enabled="true">
18
+ <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="#{params[:name]}" enabled="true">
19
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
19
20
  <collectionProp name="Arguments.arguments"/>
20
21
  </elementProp>
21
22
  <stringProp name="HTTPSampler.domain"/>
@@ -35,6 +36,7 @@ module Gridinit
35
36
  </HTTPSamplerProxy>)
36
37
  EOS
37
38
  update params
39
+ update_at_xpath params if params[:update_at_xpath]
38
40
  end
39
41
  end
40
42
 
@@ -12,10 +12,11 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpRequestDefaults'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="#{name}" enabled="true">
18
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{name}" enabled="true">
18
+ <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
19
+ <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
19
20
  <collectionProp name="Arguments.arguments"/>
20
21
  </elementProp>
21
22
  <stringProp name="HTTPSampler.domain"/>
@@ -24,11 +25,21 @@ module Gridinit
24
25
  <stringProp name="HTTPSampler.response_timeout"/>
25
26
  <stringProp name="HTTPSampler.protocol"/>
26
27
  <stringProp name="HTTPSampler.contentEncoding"/>
27
- <stringProp name="HTTPSampler.path"/>
28
+ <stringProp name="HTTPSampler.path">/</stringProp>
29
+ <stringProp name="HTTPSampler.method">GET</stringProp>
30
+ <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
31
+ <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
32
+ <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
33
+ <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
34
+ <boolProp name="HTTPSampler.monitor">false</boolProp>
35
+ <boolProp name="HTTPSampler.image_parser">false</boolProp>
36
+ <stringProp name="HTTPSampler.embedded_url_re"/>
37
+ <boolProp name="HTTPSampler.concurrentDwn">false</boolProp>
28
38
  <stringProp name="HTTPSampler.concurrentPool">4</stringProp>
29
39
  </ConfigTestElement>)
30
40
  EOS
31
41
  update params
42
+ update_at_xpath params if params[:update_at_xpath]
32
43
  end
33
44
  end
34
45
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'HttpUrlRewritingModifier'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <URLRewritingModifier guiclass="URLRewritingModifierGui" testclass="URLRewritingModifier" testname="#{name}" enabled="true">
18
+ <URLRewritingModifier guiclass="URLRewritingModifierGui" testclass="URLRewritingModifier" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="argument_name"/>
19
20
  <boolProp name="path_extension">false</boolProp>
20
21
  <boolProp name="path_extension_no_equals">false</boolProp>
@@ -23,6 +24,7 @@ module Gridinit
23
24
  </URLRewritingModifier>)
24
25
  EOS
25
26
  update params
27
+ update_at_xpath params if params[:update_at_xpath]
26
28
  end
27
29
  end
28
30
 
@@ -12,14 +12,17 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'IfController'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{name}" enabled="true">
18
+ <IfController guiclass="IfControllerPanel" testclass="IfController" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="IfController.condition"/>
19
20
  <boolProp name="IfController.evaluateAll">false</boolProp>
21
+ <boolProp name="IfController.useExpression">false</boolProp>
20
22
  </IfController>)
21
23
  EOS
22
24
  update params
25
+ update_at_xpath params if params[:update_at_xpath]
23
26
  end
24
27
  end
25
28
 
@@ -12,13 +12,15 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'IncludeController'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <IncludeController guiclass="IncludeControllerGui" testclass="IncludeController" testname="#{name}" enabled="true">
18
+ <IncludeController guiclass="IncludeControllerGui" testclass="IncludeController" testname="#{params[:name]}" enabled="true">
18
19
  <stringProp name="IncludeController.includepath"/>
19
20
  </IncludeController>)
20
21
  EOS
21
22
  update params
23
+ update_at_xpath params if params[:update_at_xpath]
22
24
  end
23
25
  end
24
26
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'JavaRequest'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{name}" enabled="true">
18
+ <JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="#{params[:name]}" enabled="true">
18
19
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
19
20
  <collectionProp name="Arguments.arguments">
20
21
  <elementProp name="Sleep_Time" elementType="Argument">
@@ -63,6 +64,7 @@ module Gridinit
63
64
  </JavaSampler>)
64
65
  EOS
65
66
  update params
67
+ update_at_xpath params if params[:update_at_xpath]
66
68
  end
67
69
  end
68
70
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'JavaRequestDefaults'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <JavaConfig guiclass="JavaConfigGui" testclass="JavaConfig" testname="#{name}" enabled="true">
18
+ <JavaConfig guiclass="JavaConfigGui" testclass="JavaConfig" testname="#{params[:name]}" enabled="true">
18
19
  <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
19
20
  <collectionProp name="Arguments.arguments">
20
21
  <elementProp name="Sleep_Time" elementType="Argument">
@@ -63,6 +64,7 @@ module Gridinit
63
64
  </JavaConfig>)
64
65
  EOS
65
66
  update params
67
+ update_at_xpath params if params[:update_at_xpath]
66
68
  end
67
69
  end
68
70
 
@@ -12,9 +12,10 @@ module Gridinit
12
12
  attr_accessor :doc
13
13
  include Helper
14
14
 
15
- def initialize(name, params={})
15
+ def initialize(params={})
16
+ params[:name] ||= 'JdbcConnectionConfiguration'
16
17
  @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
17
- <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="#{name}" enabled="true">
18
+ <JDBCDataSource guiclass="TestBeanGUI" testclass="JDBCDataSource" testname="#{params[:name]}" enabled="true">
18
19
  <boolProp name="autocommit">true</boolProp>
19
20
  <stringProp name="checkQuery">Select 1</stringProp>
20
21
  <stringProp name="connectionAge">5000</stringProp>
@@ -31,6 +32,7 @@ module Gridinit
31
32
  </JDBCDataSource>)
32
33
  EOS
33
34
  update params
35
+ update_at_xpath params if params[:update_at_xpath]
34
36
  end
35
37
  end
36
38