Methods
public class
public instance
Included modules
- Gibbler::Complex
- Familia
- Common::PrivacyMethods
- Familia::Stamps
Attributes
plans | [R] |
Public class methods
from_hash
(*args)
[show source]
# File lib/stella/testplan.rb, line 143 def from_hash(*args) me = super(*args) me.usecases.collect! { |uc| Stella::Usecase.from_hash(uc) } me end
global
()
[show source]
# File lib/stella/testplan.rb, line 166 def global @global ||= {} @global end
global?
(name)
[show source]
# File lib/stella/testplan.rb, line 163 def global?(name) global.has_key?(name) end
inherited
(obj)
[show source]
# File lib/stella/testplan.rb, line 139 def inherited obj super obj.extend ClassMethods end
plan
(klass,v=nil)
[show source]
# File lib/stella/testplan.rb, line 152 def plan(klass,v=nil) # Store the class as a string. Ruby calls Object#hash before setting # the hash key which conflicts with Familia::Object.hash. plans[klass.to_s] = v unless v.nil? plans[klass.to_s] rescue NameError => ex nil end
plan?
(name)
[show source]
# File lib/stella/testplan.rb, line 160 def plan?(name) !plan(name).nil? end
Public instance methods
checkup
(base_uri, opts={})
[show source]
# File lib/stella/testplan.rb, line 101 def checkup base_uri, opts={} opts[:base_uri] = base_uri run Stella::Engine::Checkup, opts end
cust
()
[show source]
# File lib/stella/testplan.rb, line 73 def cust @cust ||= Customer.from_redis @custid @cust || Customer.anonymous end
destroy!
()
[show source]
# File lib/stella/testplan.rb, line 92 def destroy! raise BS::Problem, "Monitor exists #{index}" if MonitorInfo.exists?(index) host.testplans.rem self unless host.nil? cust.testplans.rem self unless cust.nil? super end
favicon?
()
[show source]
# File lib/stella/testplan.rb, line 52 def favicon?() !@favicon.nil? && !@favicon.empty? end
first_request
()
[show source]
# File lib/stella/testplan.rb, line 57 def first_request return if @usecases.empty? @usecases.first.requests.first end
freeze
()
[show source]
# File lib/stella/testplan.rb, line 61 def freeze return if frozen? @usecases.each { |uc| uc.freeze } @id &&= Gibbler::Digest.new(@id || self.digest) super self end
host
()
[show source]
# File lib/stella/testplan.rb, line 84 def host h = @host.nil? || frozen? ? HostInfo.load_or_create(hostid) : @host frozen? ? h : (@host=h) end
hostid
()
[show source]
# File lib/stella/testplan.rb, line 88 def hostid h = (@hostid.nil? || frozen?) && first_request ? Stella.canonical_host(first_request.uri) : @hostid frozen? ? h : (@hostid=h) end
init
(uri=nil)
[show source]
# File lib/stella/testplan.rb, line 40 def init(uri=nil) preprocess if uri req = Stella::RequestTemplate.new :get, Stella.canonical_uri(uri) @usecases << Stella::Usecase.new(req) end end
monitor
()
[show source]
# File lib/stella/testplan.rb, line 77 def monitor MonitorInfo.from_redis @id end
monitored?
()
[show source]
# File lib/stella/testplan.rb, line 80 def monitored? mon = monitor mon && mon.enabled end
owner?
(guess)
[show source]
# File lib/stella/testplan.rb, line 98 def owner?(guess) custid != nil && cust.custid?(guess) end
postprocess
()
[show source]
# File lib/stella/testplan.rb, line 68 def postprocess @id &&= Gibbler::Digest.new(@id) @notify ||= false @notify &&= false if @notify == 'false' end
preprocess
()
[show source]
# File lib/stella/testplan.rb, line 53 def preprocess @usecases ||= [] @privacy = false if @privacy.nil? end
run
(engine, opts={})
[show source]
# File lib/stella/testplan.rb, line 105 def run engine, opts={} testrun = Stella::Testrun.new self, engine.mode, opts engine.run testrun end