testing

package
v0.0.0-...-65247a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2014 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertCanStopWhenSending

func AssertCanStopWhenSending(c *gc.C, stopper Stopper)

AssertCanStopWhenSending ensures even when there are changes pending to be delivered by the watcher it can still stop cleanly. This is necessary to check for deadlocks in case the watcher's inner loop is blocked trying to send and its tomb is already dying.

func AssertStop

func AssertStop(c *gc.C, stopper Stopper)

func SetAgentVersion

func SetAgentVersion(st *state.State, vers version.Number) error

SetAgentVersion sets the current agent version in the state's environment configuration.

func UpdateConfig

func UpdateConfig(st *state.State, newValues map[string]interface{}) error

UpdateConfig sets the current agent version in the state's environment configuration.

Types

type NotifyWatcher

type NotifyWatcher interface {
	Changes() <-chan struct{}
}

type NotifyWatcherC

type NotifyWatcherC struct {
	*gc.C
	State   *state.State
	Watcher NotifyWatcher
}

NotifyWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan struct{}.

func NewNotifyWatcherC

func NewNotifyWatcherC(c *gc.C, st *state.State, w NotifyWatcher) NotifyWatcherC

NewNotifyWatcherC returns a NotifyWatcherC that checks for aggressive event coalescence.

func (NotifyWatcherC) AssertClosed

func (c NotifyWatcherC) AssertClosed()

func (NotifyWatcherC) AssertNoChange

func (c NotifyWatcherC) AssertNoChange()

func (NotifyWatcherC) AssertOneChange

func (c NotifyWatcherC) AssertOneChange()

type RelationUnitsWatcher

type RelationUnitsWatcher interface {
	Stop() error
	Changes() <-chan params.RelationUnitsChange
}

type RelationUnitsWatcherC

type RelationUnitsWatcherC struct {
	*gc.C
	State   *state.State
	Watcher RelationUnitsWatcher
	// contains filtered or unexported fields
}

RelationUnitsWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan params.RelationUnitsChange.

func NewRelationUnitsWatcherC

func NewRelationUnitsWatcherC(c *gc.C, st *state.State, w RelationUnitsWatcher) RelationUnitsWatcherC

NewRelationUnitsWatcherC returns a RelationUnitsWatcherC that checks for aggressive event coalescence.

func (RelationUnitsWatcherC) AssertChange

func (c RelationUnitsWatcherC) AssertChange(changed []string, departed []string)

AssertChange asserts the given changes was reported by the watcher, but does not assume there are no following changes.

func (RelationUnitsWatcherC) AssertClosed

func (c RelationUnitsWatcherC) AssertClosed()

func (RelationUnitsWatcherC) AssertNoChange

func (c RelationUnitsWatcherC) AssertNoChange()

type Stopper

type Stopper interface {
	Stop() error
}

type StringsWatcher

type StringsWatcher interface {
	Stop() error
	Changes() <-chan []string
}

type StringsWatcherC

type StringsWatcherC struct {
	*gc.C
	State   *state.State
	Watcher StringsWatcher
}

StringsWatcherC embeds a gocheck.C and adds methods to help verify the behaviour of any watcher that uses a <-chan []string.

func NewStringsWatcherC

func NewStringsWatcherC(c *gc.C, st *state.State, w StringsWatcher) StringsWatcherC

NewStringsWatcherC returns a StringsWatcherC that checks for aggressive event coalescence.

func (StringsWatcherC) AssertChange

func (c StringsWatcherC) AssertChange(expect ...string)

func (StringsWatcherC) AssertChangeInSingleEvent

func (c StringsWatcherC) AssertChangeInSingleEvent(expect ...string)

func (StringsWatcherC) AssertClosed

func (c StringsWatcherC) AssertClosed()

func (StringsWatcherC) AssertNoChange

func (c StringsWatcherC) AssertNoChange()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL