Documentation
¶
Overview ¶
Package testutil contains shared test functionality
Index ¶
- func AssertEmptyString(t *testing.T, s string)
- func AssertError(t *testing.T, err error)
- func AssertErrorMessageContains(t *testing.T, err error, msg string, args ...interface{})
- func AssertFalse(t *testing.T, b bool)
- func AssertIntEqual(t *testing.T, ai, ei int)
- func AssertLen(t *testing.T, x interface{}, el int)
- func AssertNeo4jError(t *testing.T, err error)
- func AssertNextOnlyError(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNextOnlyRecord(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNextOnlySummary(t *testing.T, rec *db.Record, sum *db.Summary, err error)
- func AssertNil(t *testing.T, x interface{})
- func AssertNoError(t *testing.T, err error)
- func AssertNotNil(t *testing.T, x interface{})
- func AssertSameType(t *testing.T, x, y interface{})
- func AssertSliceEqual(t *testing.T, x, y interface{})
- func AssertStringContain(t *testing.T, s, sub string)
- func AssertStringEqual(t *testing.T, as, es string)
- func AssertStringNotEmpty(t *testing.T, s string)
- func AssertTrue(t *testing.T, b bool)
- func AssertWriteSucceeds(t *testing.T, w io.Writer, b []byte)
- type ConnFake
- func (c *ConnFake) Birthdate() time.Time
- func (c *ConnFake) Bookmark() string
- func (c *ConnFake) Buffer(streamHandle db.StreamHandle) error
- func (c *ConnFake) Close()
- func (c *ConnFake) ConnId() string
- func (c *ConnFake) Consume(streamHandle db.StreamHandle) (*db.Summary, error)
- func (c *ConnFake) ForceReset() error
- func (c *ConnFake) GetRoutingTable(context map[string]string, bookmarks []string, ...) (*db.RoutingTable, error)
- func (c *ConnFake) IsAlive() bool
- func (c *ConnFake) Keys(streamHandle db.StreamHandle) ([]string, error)
- func (c *ConnFake) Next(streamHandle db.StreamHandle) (*db.Record, *db.Summary, error)
- func (c *ConnFake) Reset()
- func (c *ConnFake) Run(runCommand db.Command, txConfig db.TxConfig) (db.StreamHandle, error)
- func (c *ConnFake) RunTx(tx db.TxHandle, runCommand db.Command) (db.StreamHandle, error)
- func (c *ConnFake) SelectDatabase(database string)
- func (c *ConnFake) ServerName() string
- func (c *ConnFake) ServerVersion() string
- func (c *ConnFake) SetBoltLogger(_ log.BoltLogger)
- func (c *ConnFake) TxBegin(txConfig db.TxConfig) (db.TxHandle, error)
- func (c *ConnFake) TxCommit(tx db.TxHandle) error
- func (c *ConnFake) TxRollback(tx db.TxHandle) error
- type Next
- type PoolFake
- type RecordedTx
- type RouterFake
- func (r *RouterFake) CleanUp()
- func (r *RouterFake) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, ...) (string, error)
- func (r *RouterFake) Invalidate(database string)
- func (r *RouterFake) Readers(ctx context.Context, bookmarks []string, database string, log log.BoltLogger) ([]string, error)
- func (r *RouterFake) Writers(ctx context.Context, bookmarks []string, database string, log log.BoltLogger) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEmptyString ¶
func AssertError ¶
func AssertErrorMessageContains ¶ added in v4.4.0
func AssertFalse ¶
func AssertIntEqual ¶
func AssertNeo4jError ¶
func AssertNextOnlyError ¶
func AssertNextOnlyRecord ¶
func AssertNextOnlySummary ¶
func AssertNoError ¶
func AssertNotNil ¶
func AssertSameType ¶
func AssertSliceEqual ¶
func AssertStringContain ¶
func AssertStringEqual ¶
func AssertStringNotEmpty ¶
func AssertTrue ¶
Types ¶
type ConnFake ¶
type ConnFake struct { Name string Version string Alive bool Birth time.Time Table *db.RoutingTable Err error Id int TxBeginErr error TxBeginHandle db.TxHandle RunErr error RunStream db.StreamHandle RunTxErr error RunTxStream db.StreamHandle Nexts []Next Bookm string TxCommitErr error TxCommitHook func() TxRollbackErr error ResetHook func() ConsumeSum *db.Summary ConsumeErr error ConsumeHook func() RecordedTxs []RecordedTx // Appended to by Run/TxBegin BufferErr error BufferHook func() ForceResetHook func() error DatabaseName string }
func (*ConnFake) ForceReset ¶ added in v4.2.3
func (*ConnFake) GetRoutingTable ¶
func (*ConnFake) SelectDatabase ¶ added in v4.4.0
func (*ConnFake) ServerName ¶
func (*ConnFake) ServerVersion ¶
func (*ConnFake) SetBoltLogger ¶ added in v4.3.0
func (c *ConnFake) SetBoltLogger(_ log.BoltLogger)
type PoolFake ¶
type PoolFake struct { BorrowConn idb.Connection BorrowErr error ReturnHook func() CleanUpHook func() }
func (*PoolFake) Borrow ¶
func (p *PoolFake) Borrow(ctx context.Context, serverNames []string, wait bool, _ log.BoltLogger) (idb.Connection, error)
func (*PoolFake) Return ¶
func (p *PoolFake) Return(c idb.Connection)
type RecordedTx ¶
type RouterFake ¶
type RouterFake struct { Invalidated bool InvalidatedDb string ReadersRet []string ReadersHook func(bookmarks []string, database string) ([]string, error) WritersRet []string WritersHook func(bookmarks []string, database string) ([]string, error) Err error CleanUpHook func() GetNameOfDefaultDbHook func(user string) (string, error) }
func (*RouterFake) CleanUp ¶
func (r *RouterFake) CleanUp()
func (*RouterFake) GetNameOfDefaultDatabase ¶ added in v4.4.0
func (r *RouterFake) GetNameOfDefaultDatabase(ctx context.Context, bookmarks []string, user string, boltLogger log.BoltLogger) (string, error)
func (*RouterFake) Invalidate ¶
func (r *RouterFake) Invalidate(database string)
Click to show internal directories.
Click to hide internal directories.