ruby-jmeter 2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. data/.gitattributes +22 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +27 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +333 -0
  7. data/Rakefile +6 -0
  8. data/bin/grid +25 -0
  9. data/examples/basic_assertion.rb +13 -0
  10. data/examples/basic_auth.rb +11 -0
  11. data/examples/basic_cache.rb +11 -0
  12. data/examples/basic_cookies.rb +11 -0
  13. data/examples/basic_extract.rb +10 -0
  14. data/examples/basic_gc_dummy_sampler.rb +10 -0
  15. data/examples/basic_gc_results.rb +23 -0
  16. data/examples/basic_google.rb +8 -0
  17. data/examples/basic_grid.rb +8 -0
  18. data/examples/basic_header.rb +19 -0
  19. data/examples/basic_ldap_ext.rb +16 -0
  20. data/examples/basic_post.rb +15 -0
  21. data/examples/basic_query_params.rb +8 -0
  22. data/examples/basic_think_time.rb +15 -0
  23. data/examples/basic_throughput_controller.rb +14 -0
  24. data/examples/basic_throughput_shaping_timer.rb +21 -0
  25. data/examples/etsy_login_browse.rb +64 -0
  26. data/lib/ruby-jmeter.rb +18 -0
  27. data/lib/ruby-jmeter/DSL.md +237 -0
  28. data/lib/ruby-jmeter/dsl.rb +419 -0
  29. data/lib/ruby-jmeter/dsl/access_log_sampler.rb +32 -0
  30. data/lib/ruby-jmeter/dsl/aggregate_graph.rb +55 -0
  31. data/lib/ruby-jmeter/dsl/aggregate_report.rb +55 -0
  32. data/lib/ruby-jmeter/dsl/ajp13_sampler.rb +41 -0
  33. data/lib/ruby-jmeter/dsl/assertion_results.rb +55 -0
  34. data/lib/ruby-jmeter/dsl/beanshell_assertion.rb +28 -0
  35. data/lib/ruby-jmeter/dsl/beanshell_listener.rb +28 -0
  36. data/lib/ruby-jmeter/dsl/beanshell_postprocessor.rb +28 -0
  37. data/lib/ruby-jmeter/dsl/beanshell_preprocessor.rb +28 -0
  38. data/lib/ruby-jmeter/dsl/beanshell_sampler.rb +28 -0
  39. data/lib/ruby-jmeter/dsl/beanshell_timer.rb +28 -0
  40. data/lib/ruby-jmeter/dsl/bsf_assertion.rb +28 -0
  41. data/lib/ruby-jmeter/dsl/bsf_listener.rb +28 -0
  42. data/lib/ruby-jmeter/dsl/bsf_postprocessor.rb +28 -0
  43. data/lib/ruby-jmeter/dsl/bsf_preprocessor.rb +28 -0
  44. data/lib/ruby-jmeter/dsl/bsf_sampler.rb +28 -0
  45. data/lib/ruby-jmeter/dsl/bsf_timer.rb +28 -0
  46. data/lib/ruby-jmeter/dsl/compare_assertion.rb +27 -0
  47. data/lib/ruby-jmeter/dsl/comparison_assertion_visualizer.rb +55 -0
  48. data/lib/ruby-jmeter/dsl/constant_throughput_timer.rb +30 -0
  49. data/lib/ruby-jmeter/dsl/constant_timer.rb +25 -0
  50. data/lib/ruby-jmeter/dsl/counter.rb +31 -0
  51. data/lib/ruby-jmeter/dsl/cssjquery_extractor.rb +30 -0
  52. data/lib/ruby-jmeter/dsl/csv_data_set_config.rb +32 -0
  53. data/lib/ruby-jmeter/dsl/debug_postprocessor.rb +28 -0
  54. data/lib/ruby-jmeter/dsl/debug_sampler.rb +27 -0
  55. data/lib/ruby-jmeter/dsl/distribution_graphalpha.rb +55 -0
  56. data/lib/ruby-jmeter/dsl/duration_assertion.rb +25 -0
  57. data/lib/ruby-jmeter/dsl/foreach_controller.rb +29 -0
  58. data/lib/ruby-jmeter/dsl/ftp_request.rb +34 -0
  59. data/lib/ruby-jmeter/dsl/ftp_request_defaults.rb +32 -0
  60. data/lib/ruby-jmeter/dsl/gaussian_random_timer.rb +26 -0
  61. data/lib/ruby-jmeter/dsl/generate_summary_results.rb +23 -0
  62. data/lib/ruby-jmeter/dsl/graph_results.rb +55 -0
  63. data/lib/ruby-jmeter/dsl/html_assertion.rb +30 -0
  64. data/lib/ruby-jmeter/dsl/html_link_parser.rb +23 -0
  65. data/lib/ruby-jmeter/dsl/html_parameter_mask.rb +32 -0
  66. data/lib/ruby-jmeter/dsl/http_authorization_manager.rb +33 -0
  67. data/lib/ruby-jmeter/dsl/http_cache_manager.rb +26 -0
  68. data/lib/ruby-jmeter/dsl/http_cookie_manager.rb +27 -0
  69. data/lib/ruby-jmeter/dsl/http_header_manager.rb +30 -0
  70. data/lib/ruby-jmeter/dsl/http_request.rb +41 -0
  71. data/lib/ruby-jmeter/dsl/http_request_defaults.rb +44 -0
  72. data/lib/ruby-jmeter/dsl/http_url_rewriting_modifier.rb +29 -0
  73. data/lib/ruby-jmeter/dsl/if_controller.rb +27 -0
  74. data/lib/ruby-jmeter/dsl/include_controller.rb +25 -0
  75. data/lib/ruby-jmeter/dsl/java_request.rb +69 -0
  76. data/lib/ruby-jmeter/dsl/java_request_defaults.rb +69 -0
  77. data/lib/ruby-jmeter/dsl/jdbc_connection_configuration.rb +37 -0
  78. data/lib/ruby-jmeter/dsl/jdbc_postprocessor.rb +31 -0
  79. data/lib/ruby-jmeter/dsl/jdbc_preprocessor.rb +31 -0
  80. data/lib/ruby-jmeter/dsl/jdbc_request.rb +31 -0
  81. data/lib/ruby-jmeter/dsl/jms_pointtopoint.rb +40 -0
  82. data/lib/ruby-jmeter/dsl/jms_publisher.rb +41 -0
  83. data/lib/ruby-jmeter/dsl/jms_subscriber.rb +35 -0
  84. data/lib/ruby-jmeter/dsl/jsr223_assertion.rb +29 -0
  85. data/lib/ruby-jmeter/dsl/jsr223_listener.rb +29 -0
  86. data/lib/ruby-jmeter/dsl/jsr223_postprocessor.rb +29 -0
  87. data/lib/ruby-jmeter/dsl/jsr223_preprocessor.rb +29 -0
  88. data/lib/ruby-jmeter/dsl/jsr223_sampler.rb +29 -0
  89. data/lib/ruby-jmeter/dsl/jsr223_timer.rb +29 -0
  90. data/lib/ruby-jmeter/dsl/junit_request.rb +37 -0
  91. data/lib/ruby-jmeter/dsl/keystore_configuration.rb +27 -0
  92. data/lib/ruby-jmeter/dsl/ldap_extended_request.rb +42 -0
  93. data/lib/ruby-jmeter/dsl/ldap_extended_request_defaults.rb +42 -0
  94. data/lib/ruby-jmeter/dsl/ldap_request.rb +35 -0
  95. data/lib/ruby-jmeter/dsl/ldap_request_defaults.rb +40 -0
  96. data/lib/ruby-jmeter/dsl/login_config_element.rb +26 -0
  97. data/lib/ruby-jmeter/dsl/loop_controller.rb +26 -0
  98. data/lib/ruby-jmeter/dsl/mail_reader_sampler.rb +37 -0
  99. data/lib/ruby-jmeter/dsl/mailer_visualizer.rb +64 -0
  100. data/lib/ruby-jmeter/dsl/md5hex_assertion.rb +25 -0
  101. data/lib/ruby-jmeter/dsl/module_controller.rb +23 -0
  102. data/lib/ruby-jmeter/dsl/monitor_results.rb +55 -0
  103. data/lib/ruby-jmeter/dsl/once_only_controller.rb +23 -0
  104. data/lib/ruby-jmeter/dsl/os_process_sampler.rb +34 -0
  105. data/lib/ruby-jmeter/dsl/poisson_random_timer.rb +26 -0
  106. data/lib/ruby-jmeter/dsl/random_controller.rb +25 -0
  107. data/lib/ruby-jmeter/dsl/random_order_controller.rb +23 -0
  108. data/lib/ruby-jmeter/dsl/random_variable.rb +30 -0
  109. data/lib/ruby-jmeter/dsl/recording_controller.rb +23 -0
  110. data/lib/ruby-jmeter/dsl/regex_user_parameters.rb +27 -0
  111. data/lib/ruby-jmeter/dsl/regular_expression_extractor.rb +31 -0
  112. data/lib/ruby-jmeter/dsl/response_assertion.rb +31 -0
  113. data/lib/ruby-jmeter/dsl/response_time_graph.rb +55 -0
  114. data/lib/ruby-jmeter/dsl/result_status_action_handler.rb +25 -0
  115. data/lib/ruby-jmeter/dsl/runtime_controller.rb +25 -0
  116. data/lib/ruby-jmeter/dsl/save_responses_to_a_file.rb +29 -0
  117. data/lib/ruby-jmeter/dsl/simple_config_element.rb +23 -0
  118. data/lib/ruby-jmeter/dsl/simple_controller.rb +23 -0
  119. data/lib/ruby-jmeter/dsl/simple_data_writer.rb +55 -0
  120. data/lib/ruby-jmeter/dsl/smime_assertion.rb +35 -0
  121. data/lib/ruby-jmeter/dsl/smtp_sampler.rb +51 -0
  122. data/lib/ruby-jmeter/dsl/soapxmlrpc_request.rb +33 -0
  123. data/lib/ruby-jmeter/dsl/spline_visualizer.rb +55 -0
  124. data/lib/ruby-jmeter/dsl/summary_report.rb +55 -0
  125. data/lib/ruby-jmeter/dsl/switch_controller.rb +25 -0
  126. data/lib/ruby-jmeter/dsl/synchronizing_timer.rb +25 -0
  127. data/lib/ruby-jmeter/dsl/tcp_sampler.rb +33 -0
  128. data/lib/ruby-jmeter/dsl/tcp_sampler_config.rb +31 -0
  129. data/lib/ruby-jmeter/dsl/test_action.rb +27 -0
  130. data/lib/ruby-jmeter/dsl/test_plan.rb +31 -0
  131. data/lib/ruby-jmeter/dsl/thread_group.rb +36 -0
  132. data/lib/ruby-jmeter/dsl/throughput_controller.rb +32 -0
  133. data/lib/ruby-jmeter/dsl/transaction_controller.rb +26 -0
  134. data/lib/ruby-jmeter/dsl/uniform_random_timer.rb +26 -0
  135. data/lib/ruby-jmeter/dsl/user_defined_variables.rb +32 -0
  136. data/lib/ruby-jmeter/dsl/user_parameters.rb +29 -0
  137. data/lib/ruby-jmeter/dsl/view_results_in_table.rb +55 -0
  138. data/lib/ruby-jmeter/dsl/view_results_tree.rb +55 -0
  139. data/lib/ruby-jmeter/dsl/while_controller.rb +25 -0
  140. data/lib/ruby-jmeter/dsl/xml_assertion.rb +23 -0
  141. data/lib/ruby-jmeter/dsl/xml_schema_assertion.rb +25 -0
  142. data/lib/ruby-jmeter/dsl/xpath_assertion.rb +30 -0
  143. data/lib/ruby-jmeter/dsl/xpath_extractor.rb +30 -0
  144. data/lib/ruby-jmeter/helpers/fallback_content_proxy.rb +54 -0
  145. data/lib/ruby-jmeter/helpers/helper.rb +41 -0
  146. data/lib/ruby-jmeter/helpers/jmeter.properties +28 -0
  147. data/lib/ruby-jmeter/helpers/logger-colors.rb +48 -0
  148. data/lib/ruby-jmeter/helpers/parser.rb +106 -0
  149. data/lib/ruby-jmeter/helpers/strip-heredoc.rb +5 -0
  150. data/lib/ruby-jmeter/helpers/user-agents.rb +27 -0
  151. data/lib/ruby-jmeter/idl.rb +70 -0
  152. data/lib/ruby-jmeter/idl.xml +1513 -0
  153. data/lib/ruby-jmeter/plugins/gc_console_status_logger.rb +14 -0
  154. data/lib/ruby-jmeter/plugins/gc_dummy_sampler.rb +23 -0
  155. data/lib/ruby-jmeter/plugins/gc_latencies_over_time.rb +48 -0
  156. data/lib/ruby-jmeter/plugins/gc_response_codes_per_second.rb +48 -0
  157. data/lib/ruby-jmeter/plugins/gc_response_times_distribution.rb +47 -0
  158. data/lib/ruby-jmeter/plugins/gc_response_times_over_time.rb +48 -0
  159. data/lib/ruby-jmeter/plugins/gc_response_times_percentiles.rb +48 -0
  160. data/lib/ruby-jmeter/plugins/gc_transactions_per_second.rb +48 -0
  161. data/lib/ruby-jmeter/plugins/gc_variable_throughput_timer.rb +26 -0
  162. data/lib/ruby-jmeter/version.rb +3 -0
  163. data/ruby-jmeter.gemspec +22 -0
  164. data/spec/dsl_spec.rb +491 -0
  165. data/spec/spec_helper.rb +10 -0
  166. data/spec/stub.rb +31 -0
  167. metadata +244 -0
@@ -0,0 +1,35 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def ldap_request(params={}, &block)
4
+ node = RubyJmeter::LdapRequest.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class LdapRequest
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'LdapRequest'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <LDAPSampler guiclass="LdapTestSamplerGui" testclass="LDAPSampler" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="servername"/>
18
+ <stringProp name="port"/>
19
+ <stringProp name="rootdn"/>
20
+ <boolProp name="user_defined">false</boolProp>
21
+ <stringProp name="test">add</stringProp>
22
+ <stringProp name="base_entry_dn"/>
23
+ <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
24
+ <collectionProp name="Arguments.arguments"/>
25
+ </elementProp>
26
+ <stringProp name="ConfigTestElement.username"/>
27
+ <stringProp name="ConfigTestElement.password"/>
28
+ </LDAPSampler>)
29
+ EOS
30
+ update params
31
+ update_at_xpath params if params[:update_at_xpath]
32
+ end
33
+ end
34
+
35
+ end
@@ -0,0 +1,40 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def ldap_request_defaults(params={}, &block)
4
+ node = RubyJmeter::LdapRequestDefaults.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class LdapRequestDefaults
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'LdapRequestDefaults'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <ConfigTestElement guiclass="LdapConfigGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="servername"/>
18
+ <stringProp name="port"/>
19
+ <stringProp name="rootdn"/>
20
+ <boolProp name="user_defined">false</boolProp>
21
+ <stringProp name="test">add</stringProp>
22
+ <stringProp name="base_entry_dn"/>
23
+ <elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
24
+ <collectionProp name="Arguments.arguments">
25
+ <elementProp name="testguid" elementType="Argument">
26
+ <stringProp name="Argument.name"/>
27
+ <stringProp name="Argument.value"/>
28
+ <stringProp name="Argument.metadata">=</stringProp>
29
+ </elementProp>
30
+ </collectionProp>
31
+ <stringProp name="TestPlan.comments"/>
32
+ </elementProp>
33
+ </ConfigTestElement>)
34
+ EOS
35
+ update params
36
+ update_at_xpath params if params[:update_at_xpath]
37
+ end
38
+ end
39
+
40
+ end
@@ -0,0 +1,26 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def login_config_element(params={}, &block)
4
+ node = RubyJmeter::LoginConfigElement.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class LoginConfigElement
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'LoginConfigElement'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <ConfigTestElement guiclass="LoginConfigGui" testclass="ConfigTestElement" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="ConfigTestElement.username"/>
18
+ <stringProp name="ConfigTestElement.password"/>
19
+ </ConfigTestElement>)
20
+ EOS
21
+ update params
22
+ update_at_xpath params if params[:update_at_xpath]
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,26 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def loop_controller(params={}, &block)
4
+ node = RubyJmeter::LoopController.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class LoopController
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'LoopController'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="#{params[:name]}" enabled="true">
17
+ <boolProp name="LoopController.continue_forever">true</boolProp>
18
+ <stringProp name="LoopController.loops">1</stringProp>
19
+ </LoopController>)
20
+ EOS
21
+ update params
22
+ update_at_xpath params if params[:update_at_xpath]
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,37 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def mail_reader_sampler(params={}, &block)
4
+ node = RubyJmeter::MailReaderSampler.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class MailReaderSampler
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'MailReaderSampler'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <MailReaderSampler guiclass="MailReaderSamplerGui" testclass="MailReaderSampler" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="host_type">pop3</stringProp>
18
+ <stringProp name="folder">INBOX</stringProp>
19
+ <stringProp name="host"/>
20
+ <stringProp name="username"/>
21
+ <stringProp name="password"/>
22
+ <intProp name="num_messages">-1</intProp>
23
+ <boolProp name="delete">false</boolProp>
24
+ <stringProp name="SMTPSampler.useSSL">false</stringProp>
25
+ <stringProp name="SMTPSampler.useStartTLS">false</stringProp>
26
+ <stringProp name="SMTPSampler.trustAllCerts">false</stringProp>
27
+ <stringProp name="SMTPSampler.enforceStartTLS">false</stringProp>
28
+ <stringProp name="SMTPSampler.useLocalTrustStore">false</stringProp>
29
+ <stringProp name="SMTPSampler.trustStoreToUse"/>
30
+ </MailReaderSampler>)
31
+ EOS
32
+ update params
33
+ update_at_xpath params if params[:update_at_xpath]
34
+ end
35
+ end
36
+
37
+ end
@@ -0,0 +1,64 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def mailer_visualizer(params={}, &block)
4
+ node = RubyJmeter::MailerVisualizer.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class MailerVisualizer
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'MailerVisualizer'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <MailerResultCollector guiclass="MailerVisualizer" testclass="MailerResultCollector" testname="#{params[:name]}" enabled="true">
17
+ <boolProp name="ResultCollector.error_logging">false</boolProp>
18
+ <objProp>
19
+ <name>saveConfig</name>
20
+ <value class="SampleSaveConfiguration">
21
+ <time>true</time>
22
+ <latency>true</latency>
23
+ <timestamp>true</timestamp>
24
+ <success>true</success>
25
+ <label>true</label>
26
+ <code>true</code>
27
+ <message>false</message>
28
+ <threadName>true</threadName>
29
+ <dataType>false</dataType>
30
+ <encoding>false</encoding>
31
+ <assertions>false</assertions>
32
+ <subresults>false</subresults>
33
+ <responseData>false</responseData>
34
+ <samplerData>false</samplerData>
35
+ <xml>false</xml>
36
+ <fieldNames>false</fieldNames>
37
+ <responseHeaders>false</responseHeaders>
38
+ <requestHeaders>false</requestHeaders>
39
+ <responseDataOnError>false</responseDataOnError>
40
+ <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
41
+ <assertionsResultsToSave>0</assertionsResultsToSave>
42
+ <bytes>true</bytes>
43
+ <threadCounts>true</threadCounts>
44
+ <sampleCount>true</sampleCount>
45
+ </value>
46
+ </objProp>
47
+ <elementProp name="MailerResultCollector.mailer_model" elementType="MailerModel">
48
+ <stringProp name="MailerModel.successLimit">2</stringProp>
49
+ <stringProp name="MailerModel.failureLimit">2</stringProp>
50
+ <stringProp name="MailerModel.failureSubject"/>
51
+ <stringProp name="MailerModel.fromAddress"/>
52
+ <stringProp name="MailerModel.smtpHost"/>
53
+ <stringProp name="MailerModel.successSubject"/>
54
+ <stringProp name="MailerModel.addressie"/>
55
+ </elementProp>
56
+ <stringProp name="filename"/>
57
+ </MailerResultCollector>)
58
+ EOS
59
+ update params
60
+ update_at_xpath params if params[:update_at_xpath]
61
+ end
62
+ end
63
+
64
+ end
@@ -0,0 +1,25 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def md5hex_assertion(params={}, &block)
4
+ node = RubyJmeter::Md5hexAssertion.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class Md5hexAssertion
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'Md5hexAssertion'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <MD5HexAssertion guiclass="MD5HexAssertionGUI" testclass="MD5HexAssertion" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="MD5HexAssertion.size"/>
18
+ </MD5HexAssertion>)
19
+ EOS
20
+ update params
21
+ update_at_xpath params if params[:update_at_xpath]
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,23 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def module_controller(params={}, &block)
4
+ node = RubyJmeter::ModuleController.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class ModuleController
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'ModuleController'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <ModuleController guiclass="ModuleControllerGui" testclass="ModuleController" testname="#{params[:name]}" enabled="true"/>)
17
+ EOS
18
+ update params
19
+ update_at_xpath params if params[:update_at_xpath]
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,55 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def monitor_results(params={}, &block)
4
+ node = RubyJmeter::MonitorResults.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class MonitorResults
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'MonitorResults'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <ResultCollector guiclass="MonitorHealthVisualizer" testclass="ResultCollector" testname="#{params[:name]}" enabled="true">
17
+ <boolProp name="ResultCollector.error_logging">false</boolProp>
18
+ <objProp>
19
+ <name>saveConfig</name>
20
+ <value class="SampleSaveConfiguration">
21
+ <time>true</time>
22
+ <latency>true</latency>
23
+ <timestamp>true</timestamp>
24
+ <success>true</success>
25
+ <label>true</label>
26
+ <code>true</code>
27
+ <message>false</message>
28
+ <threadName>true</threadName>
29
+ <dataType>false</dataType>
30
+ <encoding>false</encoding>
31
+ <assertions>false</assertions>
32
+ <subresults>false</subresults>
33
+ <responseData>false</responseData>
34
+ <samplerData>false</samplerData>
35
+ <xml>false</xml>
36
+ <fieldNames>false</fieldNames>
37
+ <responseHeaders>false</responseHeaders>
38
+ <requestHeaders>false</requestHeaders>
39
+ <responseDataOnError>false</responseDataOnError>
40
+ <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
41
+ <assertionsResultsToSave>0</assertionsResultsToSave>
42
+ <bytes>true</bytes>
43
+ <threadCounts>true</threadCounts>
44
+ <sampleCount>true</sampleCount>
45
+ </value>
46
+ </objProp>
47
+ <stringProp name="filename"/>
48
+ </ResultCollector>)
49
+ EOS
50
+ update params
51
+ update_at_xpath params if params[:update_at_xpath]
52
+ end
53
+ end
54
+
55
+ end
@@ -0,0 +1,23 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def once_only_controller(params={}, &block)
4
+ node = RubyJmeter::OnceOnlyController.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class OnceOnlyController
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'OnceOnlyController'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="#{params[:name]}" enabled="true"/>)
17
+ EOS
18
+ update params
19
+ update_at_xpath params if params[:update_at_xpath]
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,34 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def os_process_sampler(params={}, &block)
4
+ node = RubyJmeter::OsProcessSampler.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class OsProcessSampler
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'OsProcessSampler'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <SystemSampler guiclass="SystemSamplerGui" testclass="SystemSampler" testname="#{params[:name]}" enabled="true">
17
+ <boolProp name="SystemSampler.checkReturnCode">false</boolProp>
18
+ <stringProp name="SystemSampler.expectedReturnCode">0</stringProp>
19
+ <stringProp name="SystemSampler.command"/>
20
+ <elementProp name="SystemSampler.arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
21
+ <collectionProp name="Arguments.arguments"/>
22
+ </elementProp>
23
+ <elementProp name="SystemSampler.environment" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="#{params[:name]}" enabled="true">
24
+ <collectionProp name="Arguments.arguments"/>
25
+ </elementProp>
26
+ <stringProp name="SystemSampler.directory"/>
27
+ </SystemSampler>)
28
+ EOS
29
+ update params
30
+ update_at_xpath params if params[:update_at_xpath]
31
+ end
32
+ end
33
+
34
+ end
@@ -0,0 +1,26 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def poisson_random_timer(params={}, &block)
4
+ node = RubyJmeter::PoissonRandomTimer.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class PoissonRandomTimer
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'PoissonRandomTimer'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <PoissonRandomTimer guiclass="PoissonRandomTimerGui" testclass="PoissonRandomTimer" testname="#{params[:name]}" enabled="true">
17
+ <stringProp name="ConstantTimer.delay">300</stringProp>
18
+ <stringProp name="RandomTimer.range">100</stringProp>
19
+ </PoissonRandomTimer>)
20
+ EOS
21
+ update params
22
+ update_at_xpath params if params[:update_at_xpath]
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,25 @@
1
+ module RubyJmeter
2
+ class DSL
3
+ def random_controller(params={}, &block)
4
+ node = RubyJmeter::RandomController.new(params)
5
+ attach_node(node, &block)
6
+ end
7
+ end
8
+
9
+ class RandomController
10
+ attr_accessor :doc
11
+ include Helper
12
+
13
+ def initialize(params={})
14
+ params[:name] ||= 'RandomController'
15
+ @doc = Nokogiri::XML(<<-EOS.strip_heredoc)
16
+ <RandomController guiclass="RandomControlGui" testclass="RandomController" testname="#{params[:name]}" enabled="true">
17
+ <intProp name="InterleaveControl.style">1</intProp>
18
+ </RandomController>)
19
+ EOS
20
+ update params
21
+ update_at_xpath params if params[:update_at_xpath]
22
+ end
23
+ end
24
+
25
+ end