solutious-stella 0.6.0 → 0.7.0.001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/CHANGES.txt +3 -15
  2. data/LICENSE.txt +1 -1
  3. data/README.rdoc +90 -60
  4. data/Rakefile +32 -42
  5. data/bin/stella +138 -0
  6. data/examples/basic/listing_ids.csv +7 -0
  7. data/examples/basic/plan.rb +71 -0
  8. data/lib/stella.rb +57 -104
  9. data/lib/stella/cli.rb +66 -0
  10. data/lib/stella/client.rb +197 -0
  11. data/lib/stella/config.rb +87 -0
  12. data/lib/stella/data.rb +85 -0
  13. data/lib/stella/data/http.rb +2 -257
  14. data/lib/stella/data/http/body.rb +15 -0
  15. data/lib/stella/data/http/request.rb +116 -0
  16. data/lib/stella/data/http/response.rb +92 -0
  17. data/lib/stella/dsl.rb +5 -0
  18. data/lib/stella/engine.rb +55 -0
  19. data/lib/stella/engine/functional.rb +39 -0
  20. data/lib/stella/engine/load.rb +106 -0
  21. data/lib/stella/exceptions.rb +15 -0
  22. data/lib/stella/guidelines.rb +18 -0
  23. data/lib/stella/mixins.rb +2 -0
  24. data/lib/stella/stats.rb +3 -7
  25. data/lib/stella/testplan.rb +95 -220
  26. data/lib/stella/testplan/stats.rb +26 -0
  27. data/lib/stella/testplan/usecase.rb +67 -0
  28. data/lib/stella/utils.rb +126 -0
  29. data/lib/{util → stella/utils}/httputil.rb +0 -0
  30. data/lib/stella/version.rb +15 -0
  31. data/lib/threadify.rb +0 -6
  32. data/stella.gemspec +43 -49
  33. data/support/example_webapp.rb +246 -0
  34. data/support/useragents.txt +75 -0
  35. metadata +66 -31
  36. data/bin/example_test.rb +0 -82
  37. data/bin/example_webapp.rb +0 -63
  38. data/lib/logger.rb +0 -79
  39. data/lib/stella/clients.rb +0 -161
  40. data/lib/stella/command/base.rb +0 -20
  41. data/lib/stella/command/form.rb +0 -36
  42. data/lib/stella/command/get.rb +0 -44
  43. data/lib/stella/common.rb +0 -53
  44. data/lib/stella/crypto.rb +0 -88
  45. data/lib/stella/data/domain.rb +0 -82
  46. data/lib/stella/environment.rb +0 -66
  47. data/lib/stella/functest.rb +0 -105
  48. data/lib/stella/loadtest.rb +0 -186
  49. data/lib/stella/testrunner.rb +0 -64
  50. data/lib/storable.rb +0 -280
  51. data/lib/timeunits.rb +0 -65
  52. data/tryouts/drb/drb_test.rb +0 -65
  53. data/tryouts/drb/open4.rb +0 -19
  54. data/tryouts/drb/slave.rb +0 -27
  55. data/tryouts/oo_tryout.rb +0 -30
@@ -1,65 +0,0 @@
1
- # From: http://codeforpeople.com/lib/ruby/timeunits/timeunits-0.0.2/lib/timeunits.rb
2
- # ... with fix for Ruby 1.9.1
3
-
4
- unless $__timeunits__
5
- $__timeunits__ = File.expand_path __FILE__
6
-
7
- class Time
8
- module Units
9
- VERSION = "0.0.3" # Changed from 0.0.1 (should have been 0.0.2)
10
-
11
- def __less__() "/" end
12
- def __more__() "*" end
13
- def microseconds() Float(self.send(__more__,(10 ** -6))) end
14
- def milliseconds() Float(self.send(__more__,(10 ** -3))) end
15
- def seconds() self end
16
- def minutes() seconds.send(__more__,60) end
17
- def hours() minutes.send(__more__,60) end
18
- def days() hours.send(__more__,24) end
19
- def weeks() days.send(__more__,7) end
20
- def months() weeks.send(__more__,4) end
21
- #def years() months.send(__more__,12) end
22
- def years() days.send(__more__,365) end
23
- def decades() years.send(__more__,10) end
24
- def centuries() decades.send(__more__,10) end
25
- instance_methods.select{|m| m !~ /__/}.each do |plural|
26
- singular = plural.to_s.chop # Added .to_s for
27
- alias_method singular, plural
28
- end
29
- end
30
- module DiffUnits
31
- include ::Time::Units
32
- def __less__() "*" end
33
- def __more__() "/" end
34
- end
35
- alias_method "__delta__", "-" unless respond_to? "__delta__"
36
- def - other
37
- ret = __delta__ other
38
- ret.extend DiffUnits
39
- ret
40
- end
41
- end
42
- class Numeric
43
- include ::Time::Units
44
- end
45
-
46
- end
47
-
48
-
49
- if $0 == __FILE__
50
- require "yaml"
51
- require "time"
52
-
53
- now = Time::now
54
-
55
- a = now
56
- y 'a' => a
57
-
58
- b = now + 2.hours + 2.minutes
59
- y 'b' => b
60
-
61
- d = b - a
62
- %w( seconds minutes hours days ).each do |unit|
63
- y "d.#{ unit }" => d.send(unit)
64
- end
65
- end
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env ruby -w
2
- # simple_client.rb
3
- # A simple DRb client
4
-
5
- require 'drb'
6
-
7
- DRb.start_service
8
-
9
- # attach to the DRb server via a URI given on the command line
10
- remote_array = DRbObject.new [], ARGV.shift
11
-
12
- puts remote_array.size
13
-
14
- remote_array << 1
15
-
16
- puts remote_array.size
17
-
18
- __END__
19
- # Fastthread patches: http://blog.phusion.nl/2009/02/02/getting-ready-for-ruby-191/
20
- # <link rel="canonical" href="http://www.seomoz.org/blog">
21
-
22
- require 'rubygems'
23
- require 'eventmachine'
24
-
25
- module Echo
26
- def receive_data data
27
- send_data data
28
- end
29
- end
30
-
31
- EM.run {
32
- EM.start_server "0.0.0.0", 10000, Echo
33
- }
34
-
35
-
36
-
37
- __END__
38
- class DSL
39
- # Get a metaclass for this class
40
- def self.metaclass; class << self; self; end; end
41
-
42
- metaclass.instance_eval do
43
- define_method( :'POST /api/suggestions.json' ) do |val|
44
- puts val
45
- end
46
- end
47
-
48
-
49
- end
50
-
51
- class Runner
52
- attr_accessor :poop
53
- def hi
54
- @poop = :rock
55
- end
56
- end
57
-
58
- c=Runner.new
59
-
60
- c.instance_eval do
61
- hi
62
- puts @poop
63
- end
64
-
65
- #DSL.send(:'POST /api/suggestions.json', :hi)
@@ -1,19 +0,0 @@
1
- $: << '/usr/jruby-1.1.6/lib/ruby/gems/1.8/gems/open4-0.9.6/lib/'
2
-
3
-
4
- require "open4"
5
-
6
-
7
- pid, stdin, stdout, stderr = Open4::popen4 "sh"
8
-
9
- stdin.puts "echo 42.out"
10
- stdin.puts "echo 42.err 1>&2"
11
- stdin.close
12
-
13
- ignored, status = Process::waitpid2 pid
14
-
15
- puts "pid : #{ pid }"
16
- puts "stdout : #{ stdout.read.strip }"
17
- puts "stderr : #{ stderr.read.strip }"
18
- puts "status : #{ status.inspect }"
19
- puts "exitstatus : #{ status.exitstatus }"
@@ -1,27 +0,0 @@
1
-
2
- # See: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/227105
3
- # See: http://jsgoecke.wordpress.com/2009/01/30/using-drb-with-adhearsion/
4
- # See: http://docs.adhearsion.com/display/adhearsion/Using+DRb
5
-
6
- $: << 'lib'
7
-
8
- require 'rubygems'
9
- require 'slave'
10
- #
11
- # simple usage is simply to stand up a server object as a slave. you do not
12
- # need to wait for the server, join it, etc. it will die when the parent
13
- # process dies - even under 'kill -9' conditions
14
- #
15
- class Server
16
- def add_two n
17
- n + 2
18
- end
19
- end
20
-
21
- slave = Slave.new :object => Server.new
22
-
23
- server = slave.object
24
- p server.add_two(40) #=> 42
25
-
26
- slave.shutdown
27
- sleep 20
@@ -1,30 +0,0 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) # Make sure our local lib is first in line
2
-
3
- require 'yaml'
4
-
5
- require 'stella'
6
-
7
-
8
- tp = Stella::TestPlan.new(:oo_tryout)
9
- tp.protocol = :http
10
- tp.servers << "localhost:3114"
11
-
12
- # STEP 1
13
- req = Stella::Data::HTTPRequest.new("/upload", :POST)
14
- req.body = "a.pdf", "bill"
15
- req.add_header "X-Stella", "Yay!"
16
- req.add_response(200, 201) do |headers, body|
17
- puts headers["Set-Cookie"]
18
- puts body.inspect
19
- data = YAML::load(body)
20
- @product_id = data['id']
21
- puts "ID: #{@product_id}"
22
- end
23
- tp.add_request(req)
24
-
25
-
26
- ft = Stella::FunctionalTest.new(:oo_tryout)
27
- ft.testplan = tp
28
- ft.run
29
-
30
-