github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/app/log/command/command_test.go (about)

     1  package command_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/xtls/xray-core/app/dispatcher"
     8  	"github.com/xtls/xray-core/app/log"
     9  	. "github.com/xtls/xray-core/app/log/command"
    10  	"github.com/xtls/xray-core/app/proxyman"
    11  	_ "github.com/xtls/xray-core/app/proxyman/inbound"
    12  	_ "github.com/xtls/xray-core/app/proxyman/outbound"
    13  	"github.com/xtls/xray-core/common"
    14  	"github.com/xtls/xray-core/common/serial"
    15  	"github.com/xtls/xray-core/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  }