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.
- data/Gemfile +2 -1
- data/README.md +51 -72
- data/examples/basic_assertion.rb +6 -6
- data/examples/basic_auth.rb +5 -5
- data/examples/basic_cache.rb +5 -5
- data/examples/basic_cookies.rb +5 -5
- data/examples/basic_extract.rb +4 -10
- data/examples/basic_gc_results.rb +12 -9
- data/examples/basic_google.rb +3 -3
- data/examples/basic_grid.rb +3 -6
- data/examples/basic_header.rb +12 -10
- data/examples/basic_ldap_ext.rb +11 -12
- data/examples/basic_post.rb +5 -6
- data/examples/basic_query_params.rb +3 -3
- data/examples/basic_think_time.rb +7 -4
- data/examples/basic_throughput_shaping_timer.rb +4 -4
- data/examples/etsy_login_browse.rb +21 -21
- data/lib/gridinit-jmeter/DSL.md +237 -0
- data/lib/gridinit-jmeter/{idl → dsl}/access_log_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/aggregate_graph.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/aggregate_report.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ajp13_sampler.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/assertion_results.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_listener.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_postprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_preprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/beanshell_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_listener.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_postprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_preprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/bsf_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/compare_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/comparison_assertion_visualizer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/constant_throughput_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/constant_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/counter.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/cssjquery_extractor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/csv_data_set_config.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/debug_postprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/debug_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/distribution_graphalpha.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/duration_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/foreach_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ftp_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ftp_request_defaults.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/gaussian_random_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/generate_summary_results.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/graph_results.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/html_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/html_link_parser.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/html_parameter_mask.rb +4 -2
- data/lib/gridinit-jmeter/dsl/http_authorization_manager.rb +36 -0
- data/lib/gridinit-jmeter/{idl → dsl}/http_cache_manager.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/http_cookie_manager.rb +5 -2
- data/lib/gridinit-jmeter/{idl → dsl}/http_header_manager.rb +10 -3
- data/lib/gridinit-jmeter/{idl → dsl}/http_request.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/http_request_defaults.rb +15 -4
- data/lib/gridinit-jmeter/{idl → dsl}/http_url_rewriting_modifier.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/if_controller.rb +5 -2
- data/lib/gridinit-jmeter/{idl → dsl}/include_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/java_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/java_request_defaults.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jdbc_connection_configuration.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jdbc_postprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jdbc_preprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jdbc_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jms_pointtopoint.rb +6 -4
- data/lib/gridinit-jmeter/{idl → dsl}/jms_publisher.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/jms_subscriber.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_listener.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_postprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_preprocessor.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/jsr223_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/junit_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/keystore_configuration.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ldap_extended_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ldap_extended_request_defaults.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/ldap_request.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/ldap_request_defaults.rb +13 -4
- data/lib/gridinit-jmeter/{idl → dsl}/login_config_element.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/loop_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/mail_reader_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/mailer_visualizer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/md5hex_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/module_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/monitor_results.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/once_only_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/os_process_sampler.rb +6 -4
- data/lib/gridinit-jmeter/{idl → dsl}/poisson_random_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/random_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/random_order_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/random_variable.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/recording_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/regex_user_parameters.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/regular_expression_extractor.rb +5 -2
- data/lib/gridinit-jmeter/{idl → dsl}/response_assertion.rb +8 -3
- data/lib/gridinit-jmeter/{idl → dsl}/response_time_graph.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/result_status_action_handler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/runtime_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/save_responses_to_a_file.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/simple_config_element.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/simple_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/simple_data_writer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/smime_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/smtp_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/soapxmlrpc_request.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/spline_visualizer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/summary_report.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/switch_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/synchronizing_timer.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/tcp_sampler.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/tcp_sampler_config.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/test_action.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/test_plan.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/thread_group.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/throughput_controller.rb +5 -3
- data/lib/gridinit-jmeter/{idl → dsl}/transaction_controller.rb +6 -3
- data/lib/gridinit-jmeter/{idl → dsl}/uniform_random_timer.rb +4 -2
- data/lib/gridinit-jmeter/dsl/user_defined_variables.rb +35 -0
- data/lib/gridinit-jmeter/{idl → dsl}/user_parameters.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/view_results_in_table.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/view_results_tree.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/while_controller.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/xml_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/xml_schema_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/xpath_assertion.rb +4 -2
- data/lib/gridinit-jmeter/{idl → dsl}/xpath_extractor.rb +4 -2
- data/lib/gridinit-jmeter/dsl.rb +170 -187
- data/lib/gridinit-jmeter/helpers/helper.rb +43 -0
- data/lib/gridinit-jmeter/helpers/parser.rb +109 -0
- data/lib/gridinit-jmeter/idl.rb +16 -6
- data/lib/gridinit-jmeter/idl.xml +54 -11
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_console_status_logger.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_latencies_over_time.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_codes_per_second.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_distribution.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_over_time.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_response_times_percentiles.rb +0 -0
- data/lib/gridinit-jmeter/{listeners → plugins}/gc_transactions_per_second.rb +0 -0
- data/lib/gridinit-jmeter/{timers/gc_throughput_shaping_timer.rb → plugins/gc_variable_throughput_timer.rb} +1 -1
- data/lib/gridinit-jmeter/version.rb +1 -1
- data/lib/gridinit-jmeter.rb +6 -105
- data/spec/dsl_spec.rb +377 -82
- metadata +131 -174
- data/examples/basic_proxy.rb +0 -8
- data/examples/basic_results.rb +0 -22
- data/examples/basic_run.rb +0 -12
- data/examples/basic_simple_data_writer.rb +0 -14
- data/examples/basic_stdout.rb +0 -8
- data/examples/basic_test_data.rb +0 -15
- data/examples/basic_testplan.jmx +0 -138
- data/examples/basic_testplan.rb +0 -44
- data/examples/jbhifi_now_search.rb +0 -94
- data/lib/gridinit-jmeter/assertions/response_assertion.rb +0 -55
- data/lib/gridinit-jmeter/config/auth_manager.rb +0 -26
- data/lib/gridinit-jmeter/config/cache_manager.rb +0 -20
- data/lib/gridinit-jmeter/config/cookie_manager.rb +0 -21
- data/lib/gridinit-jmeter/config/counter_config.rb +0 -24
- data/lib/gridinit-jmeter/config/header_manager.rb +0 -26
- data/lib/gridinit-jmeter/config/random_variable.rb +0 -24
- data/lib/gridinit-jmeter/config/request_defaults.rb +0 -31
- data/lib/gridinit-jmeter/config/user_defined_variable.rb +0 -25
- data/lib/gridinit-jmeter/controllers/if_controller.rb +0 -20
- data/lib/gridinit-jmeter/controllers/interleave.rb +0 -18
- data/lib/gridinit-jmeter/controllers/loop_controller.rb +0 -19
- data/lib/gridinit-jmeter/controllers/once_only.rb +0 -17
- data/lib/gridinit-jmeter/controllers/random_order.rb +0 -16
- data/lib/gridinit-jmeter/controllers/simple.rb +0 -17
- data/lib/gridinit-jmeter/controllers/switch.rb +0 -20
- data/lib/gridinit-jmeter/controllers/throughput.rb +0 -26
- data/lib/gridinit-jmeter/controllers/transaction.rb +0 -19
- data/lib/gridinit-jmeter/controllers/while_controller.rb +0 -18
- data/lib/gridinit-jmeter/helpers/dsl_helper.rb +0 -21
- data/lib/gridinit-jmeter/idl/http_authorization_manager.rb +0 -26
- data/lib/gridinit-jmeter/idl/user_defined_variables.rb +0 -26
- data/lib/gridinit-jmeter/listeners/aggregate_report.rb +0 -47
- data/lib/gridinit-jmeter/listeners/graph_visualizer.rb +0 -46
- data/lib/gridinit-jmeter/listeners/response_time_graph_visualizer.rb +0 -47
- data/lib/gridinit-jmeter/listeners/simple_data_writer.rb +0 -51
- data/lib/gridinit-jmeter/listeners/stat_visualizer.rb +0 -46
- data/lib/gridinit-jmeter/listeners/summary_report.rb +0 -46
- data/lib/gridinit-jmeter/listeners/table_visualizer.rb +0 -46
- data/lib/gridinit-jmeter/listeners/view_results_full_visualizer.rb +0 -57
- data/lib/gridinit-jmeter/post_processors/regex_extractor.rb +0 -34
- data/lib/gridinit-jmeter/post_processors/xpath_extractor.rb +0 -23
- data/lib/gridinit-jmeter/pre_processors/bean_shell_pre_processor.rb +0 -23
- data/lib/gridinit-jmeter/samplers/http_sampler.rb +0 -99
- data/lib/gridinit-jmeter/samplers/ldap_ext_sampler.rb +0 -36
- data/lib/gridinit-jmeter/samplers/soap_sampler.rb +0 -26
- data/lib/gridinit-jmeter/test_plan/test_plan.rb +0 -23
- data/lib/gridinit-jmeter/threads/thread_group.rb +0 -30
- data/lib/gridinit-jmeter/timers/gaussian_random_timer.rb +0 -18
@@ -12,9 +12,10 @@ module Gridinit
|
|
12
12
|
attr_accessor :doc
|
13
13
|
include Helper
|
14
14
|
|
15
|
-
def initialize(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'UserParameters'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="#{name}" enabled="true">
|
18
|
+
<UserParameters guiclass="UserParametersGui" testclass="UserParameters" testname="#{params[:name]}" enabled="true">
|
18
19
|
<collectionProp name="UserParameters.names"/>
|
19
20
|
<collectionProp name="UserParameters.thread_values">
|
20
21
|
<collectionProp name="1"/>
|
@@ -23,6 +24,7 @@ module Gridinit
|
|
23
24
|
</UserParameters>)
|
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,9 +12,10 @@ module Gridinit
|
|
12
12
|
attr_accessor :doc
|
13
13
|
include Helper
|
14
14
|
|
15
|
-
def initialize(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'ViewResultsInTable'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<ResultCollector guiclass="TableVisualizer" testclass="ResultCollector" testname="#{name}" enabled="true">
|
18
|
+
<ResultCollector guiclass="TableVisualizer" 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(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'ViewResultsTree'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="#{name}" enabled="true">
|
18
|
+
<ResultCollector guiclass="ViewResultsFullVisualizer" 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(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'WhileController'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="#{name}" enabled="true">
|
18
|
+
<WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="#{params[:name]}" enabled="true">
|
18
19
|
<stringProp name="WhileController.condition"/>
|
19
20
|
</WhileController>)
|
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,11 +12,13 @@ module Gridinit
|
|
12
12
|
attr_accessor :doc
|
13
13
|
include Helper
|
14
14
|
|
15
|
-
def initialize(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'XmlAssertion'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<XMLAssertion guiclass="XMLAssertionGui" testclass="XMLAssertion" testname="#{name}" enabled="true"/>)
|
18
|
+
<XMLAssertion guiclass="XMLAssertionGui" testclass="XMLAssertion" 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,13 +12,15 @@ module Gridinit
|
|
12
12
|
attr_accessor :doc
|
13
13
|
include Helper
|
14
14
|
|
15
|
-
def initialize(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'XmlSchemaAssertion'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<XMLSchemaAssertion guiclass="XMLSchemaAssertionGUI" testclass="XMLSchemaAssertion" testname="#{name}" enabled="true">
|
18
|
+
<XMLSchemaAssertion guiclass="XMLSchemaAssertionGUI" testclass="XMLSchemaAssertion" testname="#{params[:name]}" enabled="true">
|
18
19
|
<stringProp name="xmlschema_assertion_filename"/>
|
19
20
|
</XMLSchemaAssertion>)
|
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(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'XpathAssertion'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<XPathAssertion guiclass="XPathAssertionGui" testclass="XPathAssertion" testname="#{name}" enabled="true">
|
18
|
+
<XPathAssertion guiclass="XPathAssertionGui" testclass="XPathAssertion" testname="#{params[:name]}" enabled="true">
|
18
19
|
<boolProp name="XPath.negate">false</boolProp>
|
19
20
|
<stringProp name="XPath.xpath">/</stringProp>
|
20
21
|
<boolProp name="XPath.validate">false</boolProp>
|
@@ -24,6 +25,7 @@ module Gridinit
|
|
24
25
|
</XPathAssertion>)
|
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(
|
15
|
+
def initialize(params={})
|
16
|
+
params[:name] ||= 'XpathExtractor'
|
16
17
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
17
|
-
<XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="#{name}" enabled="true">
|
18
|
+
<XPathExtractor guiclass="XPathExtractorGui" testclass="XPathExtractor" testname="#{params[:name]}" enabled="true">
|
18
19
|
<stringProp name="XPathExtractor.default"/>
|
19
20
|
<stringProp name="XPathExtractor.refname"/>
|
20
21
|
<stringProp name="XPathExtractor.xpathQuery"/>
|
@@ -24,6 +25,7 @@ module Gridinit
|
|
24
25
|
</XPathExtractor>)
|
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
|
|
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -1,22 +1,9 @@
|
|
1
1
|
module Gridinit
|
2
2
|
|
3
|
-
def dsl_eval(dsl, &block)
|
4
|
-
block_context = eval("self", block.binding)
|
5
|
-
proxy_context = Gridinit::Jmeter::FallbackContextProxy.new(dsl, block_context)
|
6
|
-
begin
|
7
|
-
block_context.instance_variables.each { |ivar| proxy_context.instance_variable_set(ivar, block_context.instance_variable_get(ivar)) }
|
8
|
-
proxy_context.instance_eval(&block)
|
9
|
-
ensure
|
10
|
-
block_context.instance_variables.each { |ivar| block_context.instance_variable_set(ivar, proxy_context.instance_variable_get(ivar)) }
|
11
|
-
end
|
12
|
-
dsl
|
13
|
-
end
|
14
|
-
|
15
|
-
module_function :dsl_eval
|
16
|
-
|
17
3
|
module Jmeter
|
18
4
|
|
19
|
-
class DSL
|
5
|
+
class ExtendedDSL < DSL
|
6
|
+
include Parser
|
20
7
|
attr_accessor :root
|
21
8
|
|
22
9
|
def initialize
|
@@ -29,295 +16,291 @@ module Gridinit
|
|
29
16
|
EOF
|
30
17
|
node = Gridinit::Jmeter::TestPlan.new
|
31
18
|
|
32
|
-
|
33
19
|
@current_node = @root.at_xpath("//jmeterTestPlan/hashTree")
|
34
20
|
@current_node = attach_to_last(node)
|
35
21
|
|
36
|
-
variables
|
37
|
-
|
38
|
-
|
39
|
-
:comments => 'The testguid variable is mandatory when running on the Grid.') {}
|
22
|
+
variables :name => 'testguid',
|
23
|
+
:value => '${__P(testguid,${__time(,)})}',
|
24
|
+
:comments => 'Gridinit testguid automatically generated by DSL'
|
40
25
|
end
|
41
26
|
|
42
|
-
|
43
|
-
|
44
|
-
attach_node(node, &block)
|
45
|
-
end
|
27
|
+
##
|
28
|
+
# Config Elements
|
46
29
|
|
47
|
-
def
|
48
|
-
|
49
|
-
|
30
|
+
def user_defined_variables(params, &block)
|
31
|
+
params['Argument.name'] = params[:name]
|
32
|
+
super
|
50
33
|
end
|
51
34
|
|
52
|
-
|
53
|
-
node = Gridinit::Jmeter::CookieManager.new(params)
|
54
|
-
attach_node(node, &block)
|
55
|
-
end
|
35
|
+
alias_method :variables, :user_defined_variables
|
56
36
|
|
57
|
-
|
58
|
-
node = Gridinit::Jmeter::CacheManager.new(params)
|
59
|
-
attach_node(node, &block)
|
60
|
-
end
|
37
|
+
alias_method :defaults, :http_request_defaults
|
61
38
|
|
62
|
-
def
|
63
|
-
|
64
|
-
|
39
|
+
def http_cookie_manager(params={}, &block)
|
40
|
+
params[:clearEachIteration] = true if params.keys.include? 'clear_each_iteration'
|
41
|
+
super
|
65
42
|
end
|
66
43
|
|
67
|
-
|
68
|
-
node = Gridinit::Jmeter::HeaderManager.new(
|
69
|
-
params.merge('X-Requested-With' => 'XMLHttpRequest')
|
70
|
-
)
|
71
|
-
attach_node(node, &block)
|
72
|
-
end
|
44
|
+
alias_method :cookies, :http_cookie_manager
|
73
45
|
|
74
|
-
def
|
75
|
-
|
76
|
-
|
77
|
-
)
|
78
|
-
attach_node(node, &block)
|
46
|
+
def http_cache_manager(params={}, &block)
|
47
|
+
params[:clearEachIteration] = true if params.keys.include? 'clear_each_iteration'
|
48
|
+
super
|
79
49
|
end
|
80
50
|
|
81
|
-
|
82
|
-
node = Gridinit::Jmeter::AuthManager.new(params)
|
83
|
-
attach_node(node, &block)
|
84
|
-
end
|
51
|
+
alias_method :cache, :http_cache_manager
|
85
52
|
|
86
|
-
def
|
87
|
-
|
88
|
-
|
53
|
+
def with_user_agent(device)
|
54
|
+
http_header_manager name: 'User-Agent',
|
55
|
+
value: Gridinit::Jmeter::UserAgent.new(device).string
|
89
56
|
end
|
90
57
|
|
91
|
-
def
|
92
|
-
|
93
|
-
|
58
|
+
def http_header_manager(params, &block)
|
59
|
+
params['Header.name'] = params[:name]
|
60
|
+
super
|
94
61
|
end
|
95
62
|
|
96
|
-
|
97
|
-
params[:condition] = "'${#{var}}'.length > 0"
|
98
|
-
node = Gridinit::Jmeter::IfController.new("if #{var}", params)
|
99
|
-
attach_node(node, &block)
|
100
|
-
end
|
63
|
+
alias_method :header, :http_header_manager
|
101
64
|
|
102
|
-
|
103
|
-
node = Gridinit::Jmeter::OnceOnly.new(name, params)
|
104
|
-
attach_node(node, &block)
|
105
|
-
end
|
65
|
+
alias_method :auth, :http_authorization_manager
|
106
66
|
|
107
|
-
def
|
108
|
-
|
67
|
+
def thread_group(*args, &block)
|
68
|
+
params = args.shift || {}
|
69
|
+
params = { count: params }.merge(args.shift || {}) if params.class == Fixnum
|
70
|
+
params[:num_threads] = params[:count] || 1
|
71
|
+
params[:ramp_time] = params[:rampup] || (params[:num_threads]/2.0).ceil
|
72
|
+
params[:start_time] = params[:start_time] || Time.now.to_i * 1000
|
73
|
+
params[:end_time] = params[:end_time] || Time.now.to_i * 1000
|
74
|
+
params[:duration] ||= 60
|
75
|
+
params[:continue_forever] ||= false
|
76
|
+
params[:loops] = -1 if params[:continue_forever]
|
77
|
+
node = Gridinit::Jmeter::ThreadGroup.new(params)
|
109
78
|
attach_node(node, &block)
|
110
79
|
end
|
111
80
|
|
112
|
-
|
113
|
-
node = Gridinit::Jmeter::IfController.new(name, condition, params)
|
114
|
-
attach_node(node, &block)
|
115
|
-
end
|
81
|
+
alias_method :threads, :thread_group
|
116
82
|
|
117
|
-
|
118
|
-
|
119
|
-
attach_node(node, &block)
|
120
|
-
end
|
83
|
+
##
|
84
|
+
# HTTP Samplers
|
121
85
|
|
122
|
-
def
|
123
|
-
|
86
|
+
def get(*args, &block)
|
87
|
+
params = args.shift || {}
|
88
|
+
params = { url: params }.merge(args.shift || {}) if params.class == String
|
89
|
+
params[:method] ||= 'GET'
|
90
|
+
params[:name] ||= params[:url]
|
91
|
+
parse_http_request(params)
|
92
|
+
node = Gridinit::Jmeter::HttpRequest.new(params)
|
124
93
|
attach_node(node, &block)
|
125
94
|
end
|
126
95
|
|
127
|
-
|
128
|
-
node = Gridinit::Jmeter::WhileController.new(condition, params)
|
129
|
-
attach_node(node, &block)
|
130
|
-
end
|
96
|
+
alias_method :visit, :get
|
131
97
|
|
132
|
-
def
|
133
|
-
|
98
|
+
def post(*args, &block)
|
99
|
+
params = args.shift || {}
|
100
|
+
params = { url: params }.merge(args.shift || {}) if params.class == String
|
101
|
+
params[:method] ||= 'POST'
|
102
|
+
params[:name] ||= params[:url]
|
103
|
+
parse_http_request(params)
|
104
|
+
node = Gridinit::Jmeter::HttpRequest.new(params)
|
134
105
|
attach_node(node, &block)
|
135
106
|
end
|
136
107
|
|
137
|
-
|
138
|
-
node = Gridinit::Jmeter::RandomVariableConfig.new(name, min, max, params)
|
139
|
-
attach_node(node, &block)
|
140
|
-
end
|
108
|
+
alias_method :submit, :post
|
141
109
|
|
142
|
-
def
|
143
|
-
|
110
|
+
def delete(*args, &block)
|
111
|
+
params = args.shift || {}
|
112
|
+
params = { url: params }.merge(args.shift || {}) if params.class == String
|
113
|
+
params[:method] ||= 'DELETE'
|
114
|
+
params[:name] ||= params[:url]
|
115
|
+
parse_http_request(params)
|
116
|
+
node = Gridinit::Jmeter::HttpRequest.new(params)
|
144
117
|
attach_node(node, &block)
|
145
118
|
end
|
146
119
|
|
147
|
-
def
|
148
|
-
|
120
|
+
def put(*args, &block)
|
121
|
+
params = args.shift || {}
|
122
|
+
params = { url: params }.merge(args.shift || {}) if params.class == String
|
123
|
+
params[:method] ||= 'PUT'
|
124
|
+
params[:name] ||= params[:url]
|
125
|
+
parse_http_request(params)
|
126
|
+
node = Gridinit::Jmeter::HttpRequest.new(params)
|
149
127
|
attach_node(node, &block)
|
150
128
|
end
|
151
129
|
|
152
|
-
def
|
153
|
-
|
154
|
-
|
130
|
+
def with_xhr
|
131
|
+
http_header_manager name: 'X-Requested-With',
|
132
|
+
value: 'XMLHttpRequest'
|
155
133
|
end
|
156
134
|
|
157
|
-
|
158
|
-
|
159
|
-
attach_node(node, &block)
|
160
|
-
end
|
135
|
+
##
|
136
|
+
# Other Samplers
|
161
137
|
|
162
|
-
def
|
163
|
-
params[:method] ||= '
|
164
|
-
|
165
|
-
node = Gridinit::Jmeter::HttpSampler.new(name, url, params)
|
166
|
-
attach_node(node, &block)
|
138
|
+
def soapxmlrpc_request(params, &block)
|
139
|
+
params[:method] ||= 'POST'
|
140
|
+
super
|
167
141
|
end
|
168
142
|
|
169
|
-
|
170
|
-
params[:method] = 'POST' if params[:method] == nil
|
171
|
-
node = Gridinit::Jmeter::SoapSampler.new(name, params)
|
172
|
-
attach_to_last(node, caller)
|
173
|
-
self.instance_exec(&block) if block
|
174
|
-
end
|
143
|
+
alias_method :soap, :soapxmlrpc_request
|
175
144
|
|
176
|
-
alias_method :
|
145
|
+
alias_method :ldap, :ldap_request
|
177
146
|
|
178
|
-
|
179
|
-
params[:method] ||= 'POST'
|
180
|
-
node = Gridinit::Jmeter::HttpSampler.new(name, url, params)
|
181
|
-
attach_node(node, &block)
|
182
|
-
end
|
147
|
+
alias_method :ldap_ext, :ldap_extended_request
|
183
148
|
|
184
|
-
alias_method :
|
149
|
+
alias_method :ldap_extended, :ldap_extended_request
|
185
150
|
|
186
|
-
def delete(name="HTTP Request", url="", params={}, &block)
|
187
|
-
params[:method] ||= 'DELETE'
|
188
|
-
node = Gridinit::Jmeter::HttpSampler.new(name, url, params)
|
189
|
-
attach_node(node, &block)
|
190
|
-
end
|
191
151
|
|
192
|
-
|
193
|
-
|
194
|
-
node = Gridinit::Jmeter::HttpSampler.new(name, url, params)
|
195
|
-
attach_node(node, &block)
|
196
|
-
end
|
152
|
+
##
|
153
|
+
# Controllers
|
197
154
|
|
198
|
-
def
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
else
|
205
|
-
Gridinit::Jmeter::RegexExtractor.new(*args)
|
206
|
-
end
|
155
|
+
def transaction_controller(*args, &block)
|
156
|
+
params = args.shift || {}
|
157
|
+
params = { name: params }.merge(args.shift || {}) if params.class == String
|
158
|
+
params[:parent] ||= true
|
159
|
+
params[:includeTimers] = params[:include_timers] || false
|
160
|
+
node = Gridinit::Jmeter::TransactionController.new(params)
|
207
161
|
attach_node(node, &block)
|
208
162
|
end
|
209
163
|
|
210
|
-
alias_method :
|
164
|
+
alias_method :transaction, :transaction_controller
|
211
165
|
|
212
|
-
def
|
213
|
-
|
166
|
+
def exists(variable, &block)
|
167
|
+
params ||= {}
|
168
|
+
params[:condition] = "'${#{variable}}'.length > 0"
|
169
|
+
node = Gridinit::Jmeter::IfController.new(params)
|
214
170
|
attach_node(node, &block)
|
215
171
|
end
|
216
172
|
|
217
|
-
alias_method :
|
173
|
+
alias_method :If, :if_controller
|
218
174
|
|
219
|
-
def
|
220
|
-
|
221
|
-
|
175
|
+
def loop_controller(params, &block)
|
176
|
+
params[:loops] = params[:count] || 1
|
177
|
+
super
|
222
178
|
end
|
223
179
|
|
224
|
-
alias_method :
|
180
|
+
alias_method :Loop, :loop_controller
|
225
181
|
|
226
|
-
|
227
|
-
node = Gridinit::Jmeter::ViewResultsFullVisualizer.new(name, params)
|
228
|
-
attach_node(node, &block)
|
229
|
-
end
|
182
|
+
alias_method :Throughput, :throughput_controller
|
230
183
|
|
231
|
-
alias_method :
|
184
|
+
alias_method :Switch, :switch_controller
|
232
185
|
|
233
|
-
|
234
|
-
node = Gridinit::Jmeter::TableVisualizer.new(name, params)
|
235
|
-
attach_node(node, &block)
|
236
|
-
end
|
186
|
+
alias_method :While, :while_controller
|
237
187
|
|
238
|
-
|
239
|
-
node = Gridinit::Jmeter::GraphVisualizer.new(name, params)
|
240
|
-
attach_node(node, &block)
|
241
|
-
end
|
188
|
+
alias_method :Interleave, :random_controller
|
242
189
|
|
243
|
-
|
244
|
-
node = Gridinit::Jmeter::StatVisualizer.new(name, params)
|
245
|
-
attach_node(node, &block)
|
246
|
-
end
|
190
|
+
alias_method :Random_order, :random_order_controller
|
247
191
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
192
|
+
alias_method :Simple, :simple_controller
|
193
|
+
|
194
|
+
alias_method :Once, :once_only_controller
|
195
|
+
|
196
|
+
##
|
197
|
+
# Listeners
|
198
|
+
|
199
|
+
alias_method :view_results, :view_results_tree
|
252
200
|
|
253
201
|
alias_method :log, :simple_data_writer
|
254
202
|
|
255
|
-
|
256
|
-
|
257
|
-
|
203
|
+
alias_method :response_graph, :response_time_graph
|
204
|
+
|
205
|
+
##
|
206
|
+
# Other Elements
|
207
|
+
|
208
|
+
def beanshell_preprocessor(params, &block)
|
209
|
+
params[:script] = "<![CDATA[#{params[:script]}]]>"
|
210
|
+
super
|
258
211
|
end
|
259
212
|
|
260
|
-
alias_method :
|
213
|
+
alias_method :bsh_pre, :beanshell_preprocessor
|
261
214
|
|
262
|
-
def
|
263
|
-
node =
|
215
|
+
def extract(params, &block)
|
216
|
+
node = if params[:regex]
|
217
|
+
params[:refname] = params[:name]
|
218
|
+
params[:regex] = params[:regex] #CGI.escapeHTML
|
219
|
+
params[:template] = params[:template] || "$1$"
|
220
|
+
Gridinit::Jmeter::RegularExpressionExtractor.new(params)
|
221
|
+
else
|
222
|
+
params[:refname] = params[:name]
|
223
|
+
params[:xpathQuery] = params[:xpath]
|
224
|
+
Gridinit::Jmeter::XpathExtractor.new(params)
|
225
|
+
end
|
264
226
|
attach_node(node, &block)
|
265
227
|
end
|
266
228
|
|
267
|
-
|
268
|
-
|
229
|
+
alias_method :web_reg_save_param, :extract
|
230
|
+
|
231
|
+
def random_timer(delay=0, range=0, &block)
|
232
|
+
params={}
|
233
|
+
params[:delay] = delay
|
234
|
+
params[:range] = range
|
235
|
+
node = Gridinit::Jmeter::GaussianRandomTimer.new(params)
|
269
236
|
attach_node(node, &block)
|
270
237
|
end
|
271
238
|
|
272
|
-
|
273
|
-
|
239
|
+
alias_method :think_time, :random_timer
|
240
|
+
|
241
|
+
def response_assertion(params={}, &block)
|
242
|
+
params[:test_type] = parse_test_type(params)
|
243
|
+
params[:match] = params.values.first
|
244
|
+
node = Gridinit::Jmeter::ResponseAssertion.new(params)
|
245
|
+
node.doc.xpath("//stringProp[@name='Assertion.scope']").remove if
|
246
|
+
params[:scope] == 'main' || params['scope'] == 'main'
|
274
247
|
attach_node(node, &block)
|
275
248
|
end
|
276
249
|
|
277
|
-
|
250
|
+
alias_method :assert, :response_assertion
|
251
|
+
|
252
|
+
alias_method :web_reg_find, :response_assertion
|
253
|
+
|
254
|
+
##
|
255
|
+
# JMeter Plugins
|
256
|
+
|
257
|
+
def response_codes_per_second(name="jp@gc - Response Codes per Second", params={}, &block)
|
278
258
|
node = Gridinit::Jmeter::GCResponseCodesPerSecond.new(name, params)
|
279
259
|
attach_node(node, &block)
|
280
260
|
end
|
281
261
|
|
282
|
-
def
|
262
|
+
def response_times_distribution(name="jp@gc - Response Times Distribution", params={}, &block)
|
283
263
|
node = Gridinit::Jmeter::GCResponseTimesDistribution.new(name, params)
|
284
264
|
attach_node(node, &block)
|
285
265
|
end
|
286
266
|
|
287
|
-
def
|
267
|
+
def response_times_over_time(name="jp@gc - Response Times Over Time", params={}, &block)
|
288
268
|
node = Gridinit::Jmeter::GCResponseTimesOverTime.new(name, params)
|
289
269
|
attach_node(node, &block)
|
290
270
|
end
|
291
271
|
|
292
|
-
def
|
272
|
+
def response_times_percentiles(name="jp@gc - Response Times Percentiles", params={}, &block)
|
293
273
|
node = Gridinit::Jmeter::GCResponseTimesPercentiles.new(name, params)
|
294
274
|
attach_node(node, &block)
|
295
275
|
end
|
296
276
|
|
297
|
-
def
|
277
|
+
def transactions_per_second(name="jp@gc - Transactions per Second", params={}, &block)
|
298
278
|
node = Gridinit::Jmeter::GCTransactionsPerSecond.new(name, params)
|
299
279
|
attach_node(node, &block)
|
300
280
|
end
|
301
281
|
|
302
|
-
def
|
282
|
+
def latencies_over_time(name="jp@gc - Response Latencies Over Time", params={}, &block)
|
303
283
|
node = Gridinit::Jmeter::GCLatenciesOverTime.new(name, params)
|
304
284
|
attach_node(node, &block)
|
305
285
|
end
|
306
286
|
|
307
|
-
def
|
287
|
+
def console_status_logger(name="jp@gc - Console Status Logger", params={}, &block)
|
308
288
|
node = Gridinit::Jmeter::GCConsoleStatusLogger.new(name, params)
|
309
289
|
attach_node(node, &block)
|
310
290
|
end
|
311
291
|
|
312
|
-
alias_method :console, :
|
292
|
+
alias_method :console, :console_status_logger
|
313
293
|
|
314
294
|
def throughput_shaper(name="jp@gc - Throughput Shaping Timer", steps=[], params={}, &block)
|
315
|
-
node = Gridinit::Jmeter::
|
295
|
+
node = Gridinit::Jmeter::GCThroughputShapingTimer.new(name, steps)
|
316
296
|
attach_node(node, &block)
|
317
297
|
end
|
318
298
|
|
319
299
|
alias_method :shaper, :throughput_shaper
|
320
300
|
|
301
|
+
|
302
|
+
# API Methods
|
303
|
+
|
321
304
|
def out(params={})
|
322
305
|
puts doc.to_xml(:indent => 2)
|
323
306
|
end
|
@@ -425,5 +408,5 @@ module Gridinit
|
|
425
408
|
end
|
426
409
|
|
427
410
|
def test(&block)
|
428
|
-
Gridinit.dsl_eval(Gridinit::Jmeter::
|
411
|
+
Gridinit.dsl_eval(Gridinit::Jmeter::ExtendedDSL.new, &block)
|
429
412
|
end
|