Documentation
¶
Overview ¶
Package streamtest contains a common test suite for eventstream.Stream implementations.
Index ¶
Constants ¶
View Source
const ( // DefaultTestTimeout is the default test timeout. DefaultTestTimeout = 3 * time.Second // DefaultAssumeBlockingDuration is the default "assumed blocking duration". DefaultAssumeBlockingDuration = 10 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type In ¶
type In struct {
// Application is a test application that is configured to record the events
// used within the test suite.
Application configkit.RichApplication
// EventTypes is the set of event types that the test application produces.
EventTypes *sets.Set[message.Type]
// Marshaler marshals and unmarshals the test message types.
Marshaler marshaler.Marshaler
}
In is a container for values that are provided to the stream-specific "before" function.
type Out ¶
type Out struct {
// Stream is the stream under test.
Stream eventstream.Stream
// TestTimeout is the maximum duration allowed for each test.
TestTimeout time.Duration
// AssumeBlockingDuration specifies how long the tests should wait before
// assuming a call to Cursor.Next() is successfully blocking, waiting for a
// new message, as opposed to in the process of "checking" if any messages
// are already available.
AssumeBlockingDuration time.Duration
// Append is a function that appends messages to the stream.
Append func(context.Context, ...parcel.Parcel)
}
Out is a container for values that are provided by the stream-specific "before" function.
Click to show internal directories.
Click to hide internal directories.