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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjhmMTliMGZhYjJlOWE4NDQ1ODIxZDU5ZmE4ZGYzNmNlNGFmM2ViYQ==
4
+ YTdmZWFkNzRhM2YyY2E5MDc4NDcxZjljNzFmMDlhOGY2NjZhYWU3YQ==
5
5
  data.tar.gz: !binary |-
6
- MTgwYzA5MGRlZjFmYjk5NmIwYjc4NDdmMjY2MjI4OTYwMGY5MTE5NQ==
6
+ YmJjODI4ZjMzY2U0OTQ2NDc4YjMxZGNmZjAzMzY3ZmMyMGE4NzY0Yg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWZlY2E1NzJiZmY3NzUyMWE1MDM3MjQyMjE3OWVlZjAyMDNiZDI5MjEzNzRi
10
- MzdjNWZkNTE4YTE3ZmI4MTQzMjRlNGVhOTc2OTQ3NDVmMTUyZWZhYzQ5MmNj
11
- N2M5MTYzYTc3NzYxOWQ3ZWFjMDRiZjcyNWY3NTAyMTM4ZWY3ZDM=
9
+ ZmZjMDFjNWZjZjRmNWQ1MjQ1N2RjYzBjZGQwNGQ5YTViMjNhZjhlNjIwNTI5
10
+ MDRkZTlkNTcxZjMzNjZiYmUwMWU4NjJmODgyNThlZDZiMTNmNzAxMTNlNDE2
11
+ N2I4YTc4MDczZTdmZjE0N2FkOWUxNzZlNTA4NzEzNzg5MTBiMTU=
12
12
  data.tar.gz: !binary |-
13
- Y2ZkNmFhY2JhMWNjZTFmMTg4MjBhMWFhZjMzMzA5NzJmMTU5NTA4ZmRiZWQz
14
- NzAwNWM3MjQ1M2Q4ZjFlMTc3N2I5OWRlZjlmNjdkMWJhNjljM2NmMTI3ZWQw
15
- NWNhNmIwNDA3OWMwMWZiMjcwYzQ1NjZmNTE4NDkyNWJkZDI3NGQ=
13
+ OGUxZjYwYjNiOTI0MDFlMmZiNDY3OTFiN2JmMWJkODc2OTJkNDAzYzI4MTFh
14
+ ZDBhZjg1NmZmMmEwYmUyNjgyYzc4YmZlYzVhNjI5YTNkZWQ3MzI4YTgxNjZm
15
+ ODY5MGZhODM4NzUyZWI1YWVhYTVmOTcxODJkYWEzN2NkY2QwYTE=
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .idea
6
7
  Gemfile.lock
7
8
  InstalledFiles
8
9
  _yardoc
@@ -5,4 +5,4 @@ test do
5
5
  threads count: 1 do
6
6
  visit name: 'Home Page', url: 'http://google.com/'
7
7
  end
8
- end.grid('4dy-zJLEIgpYkKe6p6JhSQ', {:region => 'ap_southeast_1'})
8
+ end.grid('6CnGKgaTRU62LspdTFbr', {region: 'us-west-2', endpoint: '127.0.0.1:3000'})
@@ -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}&region=#{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
@@ -1,5 +1,5 @@
1
1
  module Gridinit
2
2
  module Jmeter
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  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.5
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-02 00:00:00.000000000 Z
11
+ date: 2013-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client