import "istio.io/istio/galley/pkg/config/testing/fixtures"
accumulator.go expect.go filters.go listener.go source.go transformer.go
CheckContainEvents checks that the expected elements are all contained within the actual events list (order independent).
CheckEqual checks that o1 and o2 are equal. If not, returns an error with the diff.
Expect calls gomega.Eventually to wait until the accumulator accumulated specified events.
ExpectContainEvents calls CheckContainEvents and fails the test if an error is returned.
ExpectEqual calls CheckEqual and fails the test if it returns an error.
ExpectEventsEventually waits for the Accumulator.Events() to contain the expected events.
ExpectEventsWithoutOriginsEventually waits for the Accumulator.EventsWithoutOrigins() to contain the expected events.
ExpectFilter works similar to Expect, except it filters out events based on the given function.
func ExpectFullSync(t *testing.T, acc *Accumulator, c collection.Schema)
ExpectFullSync expects the given full sync event.
func ExpectNone(t *testing.T, acc *Accumulator)
ExpectNone expects no events to arrive.
NoFullSync filters FullSync events and returns.
NoVersions strips the versions from the given events
Sort events in a stable order.
type Accumulator struct {
// contains filtered or unexported fields
}
Accumulator accumulates events that is dispatched to it.
func (a *Accumulator) Clear()
Clear all currently accummulated events.
func (a *Accumulator) Events() []event.Event
Events return current set of accumulated events.
func (a *Accumulator) EventsWithoutOrigins() []event.Event
EventsWithoutOrigins calls Events, strips the origin fields from the embedded resources and returns result.
func (a *Accumulator) Handle(e event.Event)
Handle implements event.Handler
func (a *Accumulator) String() string
FilterFn is a function for filtering events
Chain filters back to back
Listener is a simple event.Dispatcher implementation for testing.
Dispatch implements event.Listener
Source is a test implementation of event.Source
Dispatch implements event.Dispatcher
Handle has the source send the specified event to its handler
Running indicates whether the Source is currently running or not.
Start implements event.Source
Stop implements event.Source
type Transformer struct { Handlers map[collection.Name]*sourceAndHandler Started bool InputCollections collection.Schemas OutputCollections collection.Schemas // contains filtered or unexported fields }
Transformer implements event.Transformer for testing purposes.
func NewTransformer(inputs, outputs collection.Schemas, handlerFn func(tr *Transformer, e event.Event)) *Transformer
NewTransformer returns a new fixture.Transformer.
func (t *Transformer) DispatchFor(c collection.Schema, h event.Handler)
DispatchFor implements event.Transformer
func (t *Transformer) Handle(e event.Event)
Handle implements event.Transformer
func (t *Transformer) Inputs() collection.Schemas
Inputs implements event.Transformer
func (t *Transformer) Outputs() collection.Schemas
Outputs implements event.Transformer
func (t *Transformer) Publish(c collection.Name, e event.Event)
Publish a message to the given collection
func (t *Transformer) Start()
Start implements event.Transformer
func (t *Transformer) Stop()
Stop implements event.Transformer
Package fixtures imports 11 packages (graph). Updated 2020-09-02. Refresh now. Tools for package owners.