github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/app/log/command/command_test.go (about) 1 package command_test 2 3 import ( 4 "context" 5 "testing" 6 7 "github.com/xmplusdev/xmcore/app/dispatcher" 8 "github.com/xmplusdev/xmcore/app/log" 9 . "github.com/xmplusdev/xmcore/app/log/command" 10 "github.com/xmplusdev/xmcore/app/proxyman" 11 _ "github.com/xmplusdev/xmcore/app/proxyman/inbound" 12 _ "github.com/xmplusdev/xmcore/app/proxyman/outbound" 13 "github.com/xmplusdev/xmcore/common" 14 "github.com/xmplusdev/xmcore/common/serial" 15 "github.com/xmplusdev/xmcore/core" 16 ) 17 18 func TestLoggerRestart(t *testing.T) { 19 v, err := core.New(&core.Config{ 20 App: []*serial.TypedMessage{ 21 serial.ToTypedMessage(&log.Config{}), 22 serial.ToTypedMessage(&dispatcher.Config{}), 23 serial.ToTypedMessage(&proxyman.InboundConfig{}), 24 serial.ToTypedMessage(&proxyman.OutboundConfig{}), 25 }, 26 }) 27 common.Must(err) 28 common.Must(v.Start()) 29 30 server := &LoggerServer{ 31 V: v, 32 } 33 common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{})) 34 }