### Home Classes Methods

### In Files

- lib/stella/testplan.rb

### Parent

Storable

### Namespace

- MODULE Stella::Testplan::ClassMethods

### Methods

- ::from_hash
- ::global
- ::global?
- ::inherited
- ::plan
- ::plan?
- #checkup
- #cust
- #destroy!
- #favicon?
- #first_request
- #freeze
- #host
- #hostid
- #id
- #init
- #monitor
- #monitored?
- #owner?
- #planid
- #postprocess
- #preprocess
- #run

### Included Modules

- Gibbler::Complex
- Familia
- Stella::Common::PrivacyMethods
- Familia::Stamps

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Stella::Testplan

### Attributes

plans[R]

### Public Class Methods

from_hash(*args) click to toggle 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() click to toggle source

    # File lib/stella/testplan.rb, line 166
    def global
      @global ||= {}
      @global
    end

global?(name) click to toggle source

    # File lib/stella/testplan.rb, line 163
    def global?(name)
      global.has_key?(name)
    end

inherited(obj) click to toggle source

    # File lib/stella/testplan.rb, line 139
    def inherited obj
      super
      obj.extend ClassMethods
    end

plan(klass,v=nil) click to toggle 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) click to toggle source

    # File lib/stella/testplan.rb, line 160
    def plan?(name)
      !plan(name).nil?
    end

### Public Instance Methods

checkup(base_uri, opts={}) click to toggle 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() click to toggle source

    # File lib/stella/testplan.rb, line 73
    def cust
      @cust ||= Customer.from_redis @custid
      @cust || Customer.anonymous
    end

destroy!() click to toggle 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?() click to toggle source

    # File lib/stella/testplan.rb, line 52
    def favicon?() !@favicon.nil? && !@favicon.empty? end

first_request() click to toggle source

    # File lib/stella/testplan.rb, line 57
    def first_request
      return if @usecases.empty?
      @usecases.first.requests.first
    end

freeze() click to toggle 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() click to toggle 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() click to toggle 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

id() click to toggle source

    # File lib/stella/testplan.rb, line 47
    def id
      @id ||= gibbler
      @id
    end

Also aliased as: planid
init(uri=nil) click to toggle 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() click to toggle source

    # File lib/stella/testplan.rb, line 77
    def monitor
      MonitorInfo.from_redis @id
    end

monitored?() click to toggle source

    # File lib/stella/testplan.rb, line 80
    def monitored?
      mon = monitor
      mon && mon.enabled
    end

owner?(guess) click to toggle source

    # File lib/stella/testplan.rb, line 98
    def owner?(guess)
      custid != nil && cust.custid?(guess)
    end

planid() click to toggle source
Alias for: id
postprocess() click to toggle source

    # File lib/stella/testplan.rb, line 68
    def postprocess
      @id &&= Gibbler::Digest.new(@id)
      @notify ||= false
      @notify &&= false if @notify == 'false'
    end

preprocess() click to toggle source

    # File lib/stella/testplan.rb, line 53
    def preprocess
      @usecases ||= []
      @privacy = false if @privacy.nil?
    end

run(engine, opts={}) click to toggle source

    # File lib/stella/testplan.rb, line 105
    def run engine, opts={}
      testrun = Stella::Testrun.new self, engine.mode, opts
      engine.run testrun
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.