gridinit-jmeter 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/examples/basic_grid.rb +1 -1
- data/lib/gridinit-jmeter/dsl.rb +7 -5
- data/lib/gridinit-jmeter/version.rb +1 -1
- data/spec/dsl_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTdmZWFkNzRhM2YyY2E5MDc4NDcxZjljNzFmMDlhOGY2NjZhYWU3YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmJjODI4ZjMzY2U0OTQ2NDc4YjMxZGNmZjAzMzY3ZmMyMGE4NzY0Yg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmZjMDFjNWZjZjRmNWQ1MjQ1N2RjYzBjZGQwNGQ5YTViMjNhZjhlNjIwNTI5
|
10
|
+
MDRkZTlkNTcxZjMzNjZiYmUwMWU4NjJmODgyNThlZDZiMTNmNzAxMTNlNDE2
|
11
|
+
N2I4YTc4MDczZTdmZjE0N2FkOWUxNzZlNTA4NzEzNzg5MTBiMTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGUxZjYwYjNiOTI0MDFlMmZiNDY3OTFiN2JmMWJkODc2OTJkNDAzYzI4MTFh
|
14
|
+
ZDBhZjg1NmZmMmEwYmUyNjgyYzc4YmZlYzVhNjI5YTNkZWQ3MzI4YTgxNjZm
|
15
|
+
ODY5MGZhODM4NzUyZWI1YWVhYTVmOTcxODJkYWEzN2NkY2QwYTE=
|
data/.gitignore
CHANGED
data/examples/basic_grid.rb
CHANGED
data/lib/gridinit-jmeter/dsl.rb
CHANGED
@@ -6,7 +6,7 @@ module Gridinit
|
|
6
6
|
include Parser
|
7
7
|
attr_accessor :root
|
8
8
|
|
9
|
-
def initialize
|
9
|
+
def initialize(params = {})
|
10
10
|
@root = Nokogiri::XML(<<-EOF.strip_heredoc)
|
11
11
|
<?xml version="1.0" encoding="UTF-8"?>
|
12
12
|
<jmeterTestPlan version="1.2" properties="2.1">
|
@@ -14,7 +14,7 @@ module Gridinit
|
|
14
14
|
</hashTree>
|
15
15
|
</jmeterTestPlan>
|
16
16
|
EOF
|
17
|
-
node = Gridinit::Jmeter::TestPlan.new
|
17
|
+
node = Gridinit::Jmeter::TestPlan.new(params)
|
18
18
|
|
19
19
|
@current_node = @root.at_xpath("//jmeterTestPlan/hashTree")
|
20
20
|
@current_node = attach_to_last(node)
|
@@ -217,6 +217,8 @@ module Gridinit
|
|
217
217
|
|
218
218
|
alias_method :bsh_pre, :beanshell_preprocessor
|
219
219
|
|
220
|
+
alias_method :bsh_post, :beanshell_postprocessor
|
221
|
+
|
220
222
|
def extract(params, &block)
|
221
223
|
node = if params[:regex]
|
222
224
|
params[:refname] = params[:name]
|
@@ -358,7 +360,7 @@ module Gridinit
|
|
358
360
|
end
|
359
361
|
RestClient.proxy = params[:proxy] if params[:proxy]
|
360
362
|
begin
|
361
|
-
file = Tempfile.new('jmeter')
|
363
|
+
file = Tempfile.new(['jmeter', '.jmx'])
|
362
364
|
file.write(doc.to_xml(:indent => 2))
|
363
365
|
file.rewind
|
364
366
|
response = RestClient.post "http://#{params[:endpoint] ? params[:endpoint] : 'gridinit.com'}/api?token=#{token}®ion=#{params[:region]}",
|
@@ -418,6 +420,6 @@ module Gridinit
|
|
418
420
|
end
|
419
421
|
end
|
420
422
|
|
421
|
-
def test(&block)
|
422
|
-
Gridinit.dsl_eval(Gridinit::Jmeter::ExtendedDSL.new, &block)
|
423
|
+
def test(params = {}, &block)
|
424
|
+
Gridinit.dsl_eval(Gridinit::Jmeter::ExtendedDSL.new(params), &block)
|
423
425
|
end
|
data/spec/dsl_spec.rb
CHANGED
@@ -49,6 +49,16 @@ describe "DSL" do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
describe 'test plan' do
|
53
|
+
it 'should allow to take params' do
|
54
|
+
test_plan = test({"TestPlan.serialize_threadgroups" => "false"}) {}
|
55
|
+
test_plan.to_doc.search("boolProp[@name='TestPlan.serialize_threadgroups']").text.should == "false"
|
56
|
+
|
57
|
+
test_plan = test({"TestPlan.serialize_threadgroups" => "true"}) {}
|
58
|
+
test_plan.to_doc.search("boolProp[@name='TestPlan.serialize_threadgroups']").text.should == "true"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
52
62
|
|
53
63
|
describe 'thread groups' do
|
54
64
|
let(:doc) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gridinit-jmeter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Koopmans
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|