ruby-jmeter 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/basic_header.rb +5 -1
- data/examples/basic_user_defined_variables.rb +10 -0
- data/lib/ruby-jmeter/dsl/access_log_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/aggregate_graph.rb +3 -3
- data/lib/ruby-jmeter/dsl/aggregate_report.rb +3 -3
- data/lib/ruby-jmeter/dsl/ajp13_sampler.rb +4 -4
- data/lib/ruby-jmeter/dsl/assertion_results.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_listener.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_postprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_preprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/beanshell_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_listener.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_postprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_preprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/bsf_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/compare_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/comparison_assertion_visualizer.rb +3 -3
- data/lib/ruby-jmeter/dsl/constant_throughput_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/constant_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/counter.rb +3 -3
- data/lib/ruby-jmeter/dsl/cssjquery_extractor.rb +3 -3
- data/lib/ruby-jmeter/dsl/csv_data_set_config.rb +3 -3
- data/lib/ruby-jmeter/dsl/debug_postprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/debug_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/distribution_graphalpha.rb +3 -3
- data/lib/ruby-jmeter/dsl/duration_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/foreach_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/ftp_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/ftp_request_defaults.rb +3 -3
- data/lib/ruby-jmeter/dsl/gaussian_random_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/generate_summary_results.rb +3 -3
- data/lib/ruby-jmeter/dsl/graph_results.rb +3 -3
- data/lib/ruby-jmeter/dsl/html_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/html_link_parser.rb +3 -3
- data/lib/ruby-jmeter/dsl/html_parameter_mask.rb +3 -3
- data/lib/ruby-jmeter/dsl/http_authorization_manager.rb +3 -3
- data/lib/ruby-jmeter/dsl/http_cache_manager.rb +3 -3
- data/lib/ruby-jmeter/dsl/http_cookie_manager.rb +3 -3
- data/lib/ruby-jmeter/dsl/http_header_manager.rb +3 -3
- data/lib/ruby-jmeter/dsl/http_request.rb +4 -4
- data/lib/ruby-jmeter/dsl/http_request_defaults.rb +4 -4
- data/lib/ruby-jmeter/dsl/http_url_rewriting_modifier.rb +3 -3
- data/lib/ruby-jmeter/dsl/if_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/include_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/java_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/java_request_defaults.rb +3 -3
- data/lib/ruby-jmeter/dsl/jdbc_connection_configuration.rb +3 -3
- data/lib/ruby-jmeter/dsl/jdbc_postprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/jdbc_preprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/jdbc_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/jms_pointtopoint.rb +5 -5
- data/lib/ruby-jmeter/dsl/jms_publisher.rb +4 -4
- data/lib/ruby-jmeter/dsl/jms_subscriber.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_listener.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_postprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_preprocessor.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/jsr223_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/junit_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/keystore_configuration.rb +3 -3
- data/lib/ruby-jmeter/dsl/ldap_extended_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/ldap_extended_request_defaults.rb +3 -3
- data/lib/ruby-jmeter/dsl/ldap_request.rb +4 -4
- data/lib/ruby-jmeter/dsl/ldap_request_defaults.rb +4 -4
- data/lib/ruby-jmeter/dsl/login_config_element.rb +3 -3
- data/lib/ruby-jmeter/dsl/loop_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/mail_reader_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/mailer_visualizer.rb +3 -3
- data/lib/ruby-jmeter/dsl/md5hex_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/module_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/monitor_results.rb +3 -3
- data/lib/ruby-jmeter/dsl/once_only_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/os_process_sampler.rb +5 -5
- data/lib/ruby-jmeter/dsl/poisson_random_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/random_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/random_order_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/random_variable.rb +3 -3
- data/lib/ruby-jmeter/dsl/recording_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/regex_user_parameters.rb +3 -3
- data/lib/ruby-jmeter/dsl/regular_expression_extractor.rb +3 -3
- data/lib/ruby-jmeter/dsl/response_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/response_time_graph.rb +3 -3
- data/lib/ruby-jmeter/dsl/result_status_action_handler.rb +3 -3
- data/lib/ruby-jmeter/dsl/runtime_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/save_responses_to_a_file.rb +3 -3
- data/lib/ruby-jmeter/dsl/simple_config_element.rb +3 -3
- data/lib/ruby-jmeter/dsl/simple_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/simple_data_writer.rb +3 -3
- data/lib/ruby-jmeter/dsl/smime_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/smtp_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/soapxmlrpc_request.rb +3 -3
- data/lib/ruby-jmeter/dsl/spline_visualizer.rb +3 -3
- data/lib/ruby-jmeter/dsl/summary_report.rb +3 -3
- data/lib/ruby-jmeter/dsl/switch_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/synchronizing_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/tcp_sampler.rb +3 -3
- data/lib/ruby-jmeter/dsl/tcp_sampler_config.rb +3 -3
- data/lib/ruby-jmeter/dsl/test_action.rb +3 -3
- data/lib/ruby-jmeter/dsl/test_plan.rb +4 -4
- data/lib/ruby-jmeter/dsl/thread_group.rb +4 -4
- data/lib/ruby-jmeter/dsl/throughput_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/transaction_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/uniform_random_timer.rb +3 -3
- data/lib/ruby-jmeter/dsl/user_defined_variables.rb +3 -3
- data/lib/ruby-jmeter/dsl/user_parameters.rb +3 -3
- data/lib/ruby-jmeter/dsl/view_results_in_table.rb +3 -3
- data/lib/ruby-jmeter/dsl/view_results_tree.rb +3 -3
- data/lib/ruby-jmeter/dsl/while_controller.rb +3 -3
- data/lib/ruby-jmeter/dsl/xml_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/xml_schema_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/xpath_assertion.rb +3 -3
- data/lib/ruby-jmeter/dsl/xpath_extractor.rb +3 -3
- data/lib/ruby-jmeter/dsl.rb +6 -2
- data/lib/ruby-jmeter/helpers/helper.rb +20 -3
- data/lib/ruby-jmeter/idl.rb +3 -3
- data/lib/ruby-jmeter/version.rb +1 -1
- data/spec/dsl_spec.rb +22 -0
- metadata +4 -6
data/examples/basic_header.rb
CHANGED
@@ -2,7 +2,11 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
require 'ruby-jmeter'
|
3
3
|
|
4
4
|
test do
|
5
|
-
header
|
5
|
+
# header with multiple values
|
6
|
+
header [
|
7
|
+
{ name: 'Accept', value: '*' },
|
8
|
+
{ name: 'User-Agent', value: 'Test' }
|
9
|
+
]
|
6
10
|
|
7
11
|
with_user_agent :iphone
|
8
12
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
require 'ruby-jmeter'
|
3
|
+
|
4
|
+
test do
|
5
|
+
# user defined with multiple values
|
6
|
+
variables [
|
7
|
+
{ name: 'email', value: 'support@flood.io' },
|
8
|
+
{ name: 'password', value: 'password' }
|
9
|
+
]
|
10
|
+
end.run(path: '/usr/share/jmeter/bin/', gui: true)
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'AccessLogSampler' : (params[:name] || 'AccessLogSampler')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<AccessLogSampler guiclass="TestBeanGUI" testclass="AccessLogSampler" testname="#{
|
16
|
+
<AccessLogSampler guiclass="TestBeanGUI" testclass="AccessLogSampler" testname="#{testname}" enabled="true">
|
17
17
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
18
18
|
<collectionProp name="Arguments.arguments"/>
|
19
19
|
</elementProp>
|
@@ -25,7 +25,7 @@ module RubyJmeter
|
|
25
25
|
</AccessLogSampler>)
|
26
26
|
EOS
|
27
27
|
update params
|
28
|
-
update_at_xpath params if params[:update_at_xpath]
|
28
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'AggregateGraph' : (params[:name] || 'AggregateGraph')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="#{
|
16
|
+
<ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
18
|
<objProp>
|
19
19
|
<name>saveConfig</name>
|
@@ -48,7 +48,7 @@ module RubyJmeter
|
|
48
48
|
</ResultCollector>)
|
49
49
|
EOS
|
50
50
|
update params
|
51
|
-
update_at_xpath params if params[:update_at_xpath]
|
51
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'AggregateReport' : (params[:name] || 'AggregateReport')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="#{
|
16
|
+
<ResultCollector guiclass="StatVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
18
|
<objProp>
|
19
19
|
<name>saveConfig</name>
|
@@ -48,7 +48,7 @@ module RubyJmeter
|
|
48
48
|
</ResultCollector>)
|
49
49
|
EOS
|
50
50
|
update params
|
51
|
-
update_at_xpath params if params[:update_at_xpath]
|
51
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -11,10 +11,10 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'Ajp13Sampler' : (params[:name] || 'Ajp13Sampler')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<AjpSampler guiclass="AjpSamplerGui" testclass="AjpSampler" testname="#{
|
17
|
-
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{
|
16
|
+
<AjpSampler guiclass="AjpSamplerGui" testclass="AjpSampler" testname="#{testname}" enabled="true">
|
17
|
+
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="#{testname}" enabled="true">
|
18
18
|
<collectionProp name="Arguments.arguments"/>
|
19
19
|
</elementProp>
|
20
20
|
<stringProp name="HTTPSampler.domain"/>
|
@@ -34,7 +34,7 @@ module RubyJmeter
|
|
34
34
|
</AjpSampler>)
|
35
35
|
EOS
|
36
36
|
update params
|
37
|
-
update_at_xpath params if params[:update_at_xpath]
|
37
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'AssertionResults' : (params[:name] || 'AssertionResults')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="#{
|
16
|
+
<ResultCollector guiclass="AssertionVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
18
|
<objProp>
|
19
19
|
<name>saveConfig</name>
|
@@ -48,7 +48,7 @@ module RubyJmeter
|
|
48
48
|
</ResultCollector>)
|
49
49
|
EOS
|
50
50
|
update params
|
51
|
-
update_at_xpath params if params[:update_at_xpath]
|
51
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellAssertion' : (params[:name] || 'BeanshellAssertion')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="#{
|
16
|
+
<BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="BeanShellAssertion.query"/>
|
18
18
|
<stringProp name="BeanShellAssertion.filename"/>
|
19
19
|
<stringProp name="BeanShellAssertion.parameters"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellAssertion>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellListener' : (params[:name] || 'BeanshellListener')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellListener guiclass="TestBeanGUI" testclass="BeanShellListener" testname="#{
|
16
|
+
<BeanShellListener guiclass="TestBeanGUI" testclass="BeanShellListener" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<boolProp name="resetInterpreter">false</boolProp>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellListener>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellPostprocessor' : (params[:name] || 'BeanshellPostprocessor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="#{
|
16
|
+
<BeanShellPostProcessor guiclass="TestBeanGUI" testclass="BeanShellPostProcessor" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<boolProp name="resetInterpreter">false</boolProp>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellPostProcessor>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellPreprocessor' : (params[:name] || 'BeanshellPreprocessor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="#{
|
16
|
+
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<boolProp name="resetInterpreter">false</boolProp>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellPreProcessor>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellSampler' : (params[:name] || 'BeanshellSampler')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="#{
|
16
|
+
<BeanShellSampler guiclass="BeanShellSamplerGui" testclass="BeanShellSampler" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="BeanShellSampler.query"/>
|
18
18
|
<stringProp name="BeanShellSampler.filename"/>
|
19
19
|
<stringProp name="BeanShellSampler.parameters"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellSampler>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BeanshellTimer' : (params[:name] || 'BeanshellTimer')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BeanShellTimer guiclass="TestBeanGUI" testclass="BeanShellTimer" testname="#{
|
16
|
+
<BeanShellTimer guiclass="TestBeanGUI" testclass="BeanShellTimer" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<boolProp name="resetInterpreter">false</boolProp>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BeanShellTimer>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfAssertion' : (params[:name] || 'BsfAssertion')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFAssertion guiclass="TestBeanGUI" testclass="BSFAssertion" testname="#{
|
16
|
+
<BSFAssertion guiclass="TestBeanGUI" testclass="BSFAssertion" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFAssertion>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfListener' : (params[:name] || 'BsfListener')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFListener guiclass="TestBeanGUI" testclass="BSFListener" testname="#{
|
16
|
+
<BSFListener guiclass="TestBeanGUI" testclass="BSFListener" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFListener>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfPostprocessor' : (params[:name] || 'BsfPostprocessor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFPostProcessor guiclass="TestBeanGUI" testclass="BSFPostProcessor" testname="#{
|
16
|
+
<BSFPostProcessor guiclass="TestBeanGUI" testclass="BSFPostProcessor" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFPostProcessor>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfPreprocessor' : (params[:name] || 'BsfPreprocessor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFPreProcessor guiclass="TestBeanGUI" testclass="BSFPreProcessor" testname="#{
|
16
|
+
<BSFPreProcessor guiclass="TestBeanGUI" testclass="BSFPreProcessor" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFPreProcessor>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfSampler' : (params[:name] || 'BsfSampler')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFSampler guiclass="TestBeanGUI" testclass="BSFSampler" testname="#{
|
16
|
+
<BSFSampler guiclass="TestBeanGUI" testclass="BSFSampler" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFSampler>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'BsfTimer' : (params[:name] || 'BsfTimer')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<BSFTimer guiclass="TestBeanGUI" testclass="BSFTimer" testname="#{
|
16
|
+
<BSFTimer guiclass="TestBeanGUI" testclass="BSFTimer" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="filename"/>
|
18
18
|
<stringProp name="parameters"/>
|
19
19
|
<stringProp name="script"/>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</BSFTimer>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,16 +11,16 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'CompareAssertion' : (params[:name] || 'CompareAssertion')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<CompareAssertion guiclass="TestBeanGUI" testclass="CompareAssertion" testname="#{
|
16
|
+
<CompareAssertion guiclass="TestBeanGUI" testclass="CompareAssertion" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="compareContent">true</boolProp>
|
18
18
|
<longProp name="compareTime">-1</longProp>
|
19
19
|
<collectionProp name="stringsToSkip"/>
|
20
20
|
</CompareAssertion>)
|
21
21
|
EOS
|
22
22
|
update params
|
23
|
-
update_at_xpath params if params[:update_at_xpath]
|
23
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'ComparisonAssertionVisualizer' : (params[:name] || 'ComparisonAssertionVisualizer')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ResultCollector guiclass="ComparisonVisualizer" testclass="ResultCollector" testname="#{
|
16
|
+
<ResultCollector guiclass="ComparisonVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
18
|
<objProp>
|
19
19
|
<name>saveConfig</name>
|
@@ -48,7 +48,7 @@ module RubyJmeter
|
|
48
48
|
</ResultCollector>)
|
49
49
|
EOS
|
50
50
|
update params
|
51
|
-
update_at_xpath params if params[:update_at_xpath]
|
51
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'ConstantThroughputTimer' : (params[:name] || 'ConstantThroughputTimer')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="#{
|
16
|
+
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="calcMode">this thread only</stringProp>
|
18
18
|
<doubleProp>
|
19
19
|
<name>throughput</name>
|
@@ -23,7 +23,7 @@ module RubyJmeter
|
|
23
23
|
</ConstantThroughputTimer>)
|
24
24
|
EOS
|
25
25
|
update params
|
26
|
-
update_at_xpath params if params[:update_at_xpath]
|
26
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -11,14 +11,14 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'ConstantTimer' : (params[:name] || 'ConstantTimer')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="#{
|
16
|
+
<ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="ConstantTimer.delay">300</stringProp>
|
18
18
|
</ConstantTimer>)
|
19
19
|
EOS
|
20
20
|
update params
|
21
|
-
update_at_xpath params if params[:update_at_xpath]
|
21
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'Counter' : (params[:name] || 'Counter')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="#{
|
16
|
+
<CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="CounterConfig.start"/>
|
18
18
|
<stringProp name="CounterConfig.end"/>
|
19
19
|
<stringProp name="CounterConfig.incr"/>
|
@@ -24,7 +24,7 @@ module RubyJmeter
|
|
24
24
|
</CounterConfig>)
|
25
25
|
EOS
|
26
26
|
update params
|
27
|
-
update_at_xpath params if params[:update_at_xpath]
|
27
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'CssjqueryExtractor' : (params[:name] || 'CssjqueryExtractor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<HtmlExtractor guiclass="HtmlExtractorGui" testclass="HtmlExtractor" testname="#{
|
16
|
+
<HtmlExtractor guiclass="HtmlExtractorGui" testclass="HtmlExtractor" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="HtmlExtractor.refname"/>
|
18
18
|
<stringProp name="HtmlExtractor.expr"/>
|
19
19
|
<stringProp name="HtmlExtractor.attribute"/>
|
@@ -23,7 +23,7 @@ module RubyJmeter
|
|
23
23
|
</HtmlExtractor>)
|
24
24
|
EOS
|
25
25
|
update params
|
26
|
-
update_at_xpath params if params[:update_at_xpath]
|
26
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'CsvDataSetConfig' : (params[:name] || 'CsvDataSetConfig')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="#{
|
16
|
+
<CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="delimiter">,</stringProp>
|
18
18
|
<stringProp name="fileEncoding"/>
|
19
19
|
<stringProp name="filename"/>
|
@@ -25,7 +25,7 @@ module RubyJmeter
|
|
25
25
|
</CSVDataSet>)
|
26
26
|
EOS
|
27
27
|
update params
|
28
|
-
update_at_xpath params if params[:update_at_xpath]
|
28
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'DebugPostprocessor' : (params[:name] || 'DebugPostprocessor')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="#{
|
16
|
+
<DebugPostProcessor guiclass="TestBeanGUI" testclass="DebugPostProcessor" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="displayJMeterProperties">false</boolProp>
|
18
18
|
<boolProp name="displayJMeterVariables">true</boolProp>
|
19
19
|
<boolProp name="displaySamplerProperties">true</boolProp>
|
@@ -21,7 +21,7 @@ module RubyJmeter
|
|
21
21
|
</DebugPostProcessor>)
|
22
22
|
EOS
|
23
23
|
update params
|
24
|
-
update_at_xpath params if params[:update_at_xpath]
|
24
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -11,16 +11,16 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'DebugSampler' : (params[:name] || 'DebugSampler')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="#{
|
16
|
+
<DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="displayJMeterProperties">false</boolProp>
|
18
18
|
<boolProp name="displayJMeterVariables">true</boolProp>
|
19
19
|
<boolProp name="displaySystemProperties">false</boolProp>
|
20
20
|
</DebugSampler>)
|
21
21
|
EOS
|
22
22
|
update params
|
23
|
-
update_at_xpath params if params[:update_at_xpath]
|
23
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -11,9 +11,9 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'DistributionGraphalpha' : (params[:name] || 'DistributionGraphalpha')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{
|
16
|
+
<ResultCollector guiclass="DistributionGraphVisualizer" testclass="ResultCollector" testname="#{testname}" enabled="true">
|
17
17
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
18
18
|
<objProp>
|
19
19
|
<name>saveConfig</name>
|
@@ -48,7 +48,7 @@ module RubyJmeter
|
|
48
48
|
</ResultCollector>)
|
49
49
|
EOS
|
50
50
|
update params
|
51
|
-
update_at_xpath params if params[:update_at_xpath]
|
51
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -11,14 +11,14 @@ module RubyJmeter
|
|
11
11
|
include Helper
|
12
12
|
|
13
13
|
def initialize(params={})
|
14
|
-
params[:name]
|
14
|
+
testname = params.kind_of?(Array) ? 'DurationAssertion' : (params[:name] || 'DurationAssertion')
|
15
15
|
@doc = Nokogiri::XML(<<-EOS.strip_heredoc)
|
16
|
-
<DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="#{
|
16
|
+
<DurationAssertion guiclass="DurationAssertionGui" testclass="DurationAssertion" testname="#{testname}" enabled="true">
|
17
17
|
<stringProp name="DurationAssertion.duration"/>
|
18
18
|
</DurationAssertion>)
|
19
19
|
EOS
|
20
20
|
update params
|
21
|
-
update_at_xpath params if params[:update_at_xpath]
|
21
|
+
update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|