ruby-jmeter 2.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'ruby-jmeter'
3
+
4
+ test do
5
+ threads count: 1 do
6
+ visit name: 'Home Page', url: 'http://google.com/'
7
+
8
+ # write errors to a simple data writer with the log alias
9
+ log filename: '/var/log/flood/custom.log', error_logging: true
10
+ end
11
+ end.run(path: '/usr/share/jmeter/bin/', gui: true)
@@ -23,7 +23,7 @@ module RubyJmeter
23
23
  <stringProp name="ThreadGroup.ramp_time">1</stringProp>
24
24
  <longProp name="ThreadGroup.start_time">1366415241000</longProp>
25
25
  <longProp name="ThreadGroup.end_time">1366415241000</longProp>
26
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
26
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
27
27
  <stringProp name="ThreadGroup.duration"/>
28
28
  <stringProp name="ThreadGroup.delay"/>
29
29
  </ThreadGroup>)
@@ -255,7 +255,7 @@
255
255
  <stringProp name="ThreadGroup.ramp_time">1</stringProp>
256
256
  <longProp name="ThreadGroup.start_time">1366415241000</longProp>
257
257
  <longProp name="ThreadGroup.end_time">1366415241000</longProp>
258
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
258
+ <boolProp name="ThreadGroup.scheduler">true</boolProp>
259
259
  <stringProp name="ThreadGroup.duration"></stringProp>
260
260
  <stringProp name="ThreadGroup.delay"></stringProp>
261
261
  </ThreadGroup>
@@ -1,3 +1,3 @@
1
1
  module RubyJmeter
2
- VERSION = "2.0"
2
+ VERSION = "2.0.1"
3
3
  end
data/ruby-jmeter.gemspec CHANGED
@@ -19,4 +19,6 @@ Gem::Specification.new do |gem|
19
19
  gem.executables << 'grid'
20
20
  gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
21
  gem.require_paths = ['lib']
22
+
23
+ gem.license = 'MIT'
22
24
  end
data/spec/dsl_spec.rb CHANGED
@@ -49,6 +49,22 @@ describe "DSL" do
49
49
  end
50
50
  end
51
51
 
52
+
53
+ describe 'header manager' do
54
+ let(:doc) do
55
+ test do
56
+ header name: 'Accept', value: '*'
57
+ end.to_doc
58
+ end
59
+
60
+ let(:fragment) { doc.search("//HeaderManager").first }
61
+
62
+ it 'should match on accept' do
63
+ fragment.search(".//stringProp[@name='Header.name']").text.should == 'Accept'
64
+ fragment.search(".//stringProp[@name='Header.value']").text.should == '*'
65
+ end
66
+ end
67
+
52
68
  describe 'test plan' do
53
69
  it 'should allow to take params' do
54
70
  test_plan = test({"TestPlan.serialize_threadgroups" => "false"}) {}
@@ -73,6 +89,10 @@ describe "DSL" do
73
89
  fragment.search(".//stringProp[@name='ThreadGroup.num_threads']").text.should == '101'
74
90
  end
75
91
 
92
+ it 'should match on scheduler' do
93
+ fragment.search(".//boolProp[@name='ThreadGroup.scheduler']").text.should == 'true'
94
+ end
95
+
76
96
  it 'should match on continue_forever' do
77
97
  fragment.search(".//boolProp[@name='LoopController.continue_forever']").text.should == 'true'
78
98
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-jmeter
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-24 00:00:00.000000000 Z
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -72,6 +72,7 @@ files:
72
72
  - examples/basic_ldap_ext.rb
73
73
  - examples/basic_post.rb
74
74
  - examples/basic_query_params.rb
75
+ - examples/basic_simple_data_writer.rb
75
76
  - examples/basic_think_time.rb
76
77
  - examples/basic_throughput_controller.rb
77
78
  - examples/basic_throughput_shaping_timer.rb
@@ -218,7 +219,8 @@ files:
218
219
  - spec/spec_helper.rb
219
220
  - spec/stub.rb
220
221
  homepage: http://github.com/flood-io/ruby-jmeter
221
- licenses: []
222
+ licenses:
223
+ - MIT
222
224
  post_install_message:
223
225
  rdoc_options: []
224
226
  require_paths:
@@ -241,4 +243,7 @@ rubygems_version: 1.8.23
241
243
  signing_key:
242
244
  specification_version: 3
243
245
  summary: This is a Ruby based DSL for writing JMeter test plans
244
- test_files: []
246
+ test_files:
247
+ - spec/dsl_spec.rb
248
+ - spec/spec_helper.rb
249
+ - spec/stub.rb