github.com/v2fly/v2ray-core/v5@v5.16.2-0.20240507031116-8191faa6e095/app/log/command/command_test.go (about)

     1  package command_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"google.golang.org/protobuf/types/known/anypb"
     8  
     9  	core "github.com/v2fly/v2ray-core/v5"
    10  	"github.com/v2fly/v2ray-core/v5/app/dispatcher"
    11  	"github.com/v2fly/v2ray-core/v5/app/log"
    12  	. "github.com/v2fly/v2ray-core/v5/app/log/command"
    13  	"github.com/v2fly/v2ray-core/v5/app/proxyman"
    14  	_ "github.com/v2fly/v2ray-core/v5/app/proxyman/inbound"
    15  	_ "github.com/v2fly/v2ray-core/v5/app/proxyman/outbound"
    16  	"github.com/v2fly/v2ray-core/v5/common"
    17  	"github.com/v2fly/v2ray-core/v5/common/serial"
    18  )
    19  
    20  func TestLoggerRestart(t *testing.T) {
    21  	v, err := core.New(&core.Config{
    22  		App: []*anypb.Any{
    23  			serial.ToTypedMessage(&log.Config{}),
    24  			serial.ToTypedMessage(&dispatcher.Config{}),
    25  			serial.ToTypedMessage(&proxyman.InboundConfig{}),
    26  			serial.ToTypedMessage(&proxyman.OutboundConfig{}),
    27  		},
    28  	})
    29  	common.Must(err)
    30  	common.Must(v.Start())
    31  
    32  	server := &LoggerServer{
    33  		V: v,
    34  	}
    35  	common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{}))
    36  }