MCPcopy
hub / github.com/mochi-mqtt/server / TestServerServeReadStoreFailure

Function TestServerServeReadStoreFailure

server_test.go:389–405  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

387}
388
389func TestServerServeReadStoreFailure(t *testing.T) {
390 s := newServer()
391 defer s.Close()
392
393 require.NotNil(t, s)
394
395 err := s.AddListener(listeners.NewMockListener("t1", ":1882"))
396 require.NoError(t, err)
397
398 hook := new(modifiedHookBase)
399 hook.failAt = 1
400 err = s.AddHook(hook, nil)
401 require.NoError(t, err)
402
403 err = s.Serve()
404 require.Error(t, err)
405}
406
407func TestServerEventLoop(t *testing.T) {
408 s := newServer()

Callers

nothing calls this directly

Calls 7

NewMockListenerFunction · 0.92
newServerFunction · 0.85
AddListenerMethod · 0.80
AddHookMethod · 0.80
ErrorMethod · 0.80
CloseMethod · 0.65
ServeMethod · 0.65

Tested by

no test coverage detected