package main

import (
	"fmt"
	"path"
	"testing"
)

func TestOperationServer(t *testing.T) {
	fmt.Println(path.Join("a", "b", "/"))
	fmt.Println(path.Join("a", "b/"))
	fmt.Println(path.Join("a", "b/", "/"))
	fmt.Println(path.Join("a", "b/", "/", "/"))

	//	token, _ := getMicrosoftAuthoizationToken("30330e18-f407-4e35-a6d6-b734b9fe9ee9", "VTr8Q~VBAUAOSmFiHM~bjgszYXBm9nuGBQCk8cLq")
	//go func() {
	//time.Sleep(2 * time.Second)
	// testver := fmt.Sprintf("%d.%d.%d", time.Now().Hour(), time.Now().Minute(), time.Now().Second())

	// svr.Operation().Deploy(server.MakeDeployRequest(
	// 	common.DeployRequest{
	// 		Name:    "warehouse",
	// 		Version: testver,
	// 		Url:     "https://actionsquare.s3.ap-northeast-2.amazonaws.com/warehouse.zip?response-content-disposition=inline&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEK7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaDmFwLW5vcnRoZWFzdC0yIkcwRQIgeYQKZXvVQsYEZNoWzxSRVjsKHzhq5VhIHVIaLpsUpssCIQCeZn8tfVM9jIjiKp62RPwEnb9oGR8T7apbsnqnntNlJCqGAwiH%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F8BEAIaDDU0OTY2MjkyMDczOCIMeHddxdoH6Xfz68ZqKtoCwVyCYH45tC7aDBpkl%2FsGRPYlhUVy84h%2FVQx4Bu8hvgu3Y3fYSceAFgFWv%2FE3HpvrHD8AY42UsaHPBCd7tmlyydqnPoOr%2F5rjUCAmHXziGV7oAcO3HIbobbjO1rf3W2tQf7FSGbfPyxFdRhoObRz3sQi%2FcmYLKZWPS9UZRuWOSh2J3HHOoEdAIDq38eYxtVl1OEKxPIjfeJHTzmOOmvoOFBOzrY9HJyABcYxvmtOUvR6469Qf5r%2FTe%2BvuL1NQsYyBKwukcSxHcGbg7t%2BNeDTE%2FUS9lL7VYMEZlhfA1WSADbvAcYEu7cv7MENJ44XmAEHnC6zWIvDNqwK9FCfJrpALIJhbXqv%2FU%2Ft%2B5udZT1TXDDqp1se%2FBRLg8NyplcN4E8z6Qt%2F9pNSm1flhORHJsaPzk2ZfGeqvFvZGv1oBigwA6eJ3WCNl2hHhLkiSBg%2BvFwXA1KxxH9U8Nkl7EjDp7JmhBjqzAqPqVamph2PzNkEszr52GH69m90pjYkNTLM4nwMuGdo1f5%2BOm%2FVloBjBCh6OpTSK3XH67zEMZE0tFQ7qmqu2d69EY8Frt749G3RSNPeKptuIKxhBYF692an9nYUXiVH8OJkey0LDMbwWDaVfSZyOiYr%2FmeiVK0eRdK3C0JGwP%2BT6vUHBL1Agi5MH0dKvmlHwzvl%2BuqArgw7ZdOx%2BJsFHRD%2FqA87B5qPuvxPXkAO5qgwZfUW9MAxdh5hxcc9kNfmryYuVWD1DM%2BvRsRF2TsUqeffucajpQ7lhvN6rspDPMltD3VHFX82Hv12nqU7pHwtNLSO0D43W4JCmOJA8TFqhCkY4zCFDok0lx3x6b8w%2F4GptjvCo1c4HG9LAurTNK8HOb3XkYdmPwKOHaqMNajMsKZoohb0%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230331T060558Z&X-Amz-SignedHeaders=host&X-Amz-Expires=43199&X-Amz-Credential=ASIAX76TWSAROTUEDRGM%2F20230331%2Fap-northeast-2%2Fs3%2Faws4_request&X-Amz-Signature=aa6cc8aac808a066ea0c25e57b3a220cb6b2eb6118f6fb28974cb6e3c34e59d0",
	// 		//			AccessToken: token,
	// 	},
	// 	[]string{"mountain"},
	// ))

	// time.Sleep(2 * time.Second)
	// svr.Operation().Start(server.MakeStartRequest(
	// 	common.StartRequest{
	// 		Name:    "warehouse",
	// 		Version: "latest",
	// 		Args:    "biglocal.exe -port=8090 -dev",
	// 	},
	// 	[]string{"mountain"},
	// ))
	// time.Sleep(25 * time.Second)
	// svr.Operation().Restart(server.MakeRestartRequest(
	// 	common.RestartRequest{
	// 		Name:    "warehouse",
	// 		Version: "latest",
	// 	},
	// 	[]string{"mountain"},
	// ))

	// time.Sleep(5 * time.Second)
	// svr.Operation().Stop(server.MakeStopRequest(
	// 	common.StopRequest{
	// 		Name:    "warehouse",
	// 		Version: "latest",
	// 		Pid:     0,
	// 	},
	// 	[]string{"mountain"},
	// ))

	// svr.Operation().Upload(server.MakeUploadRequest(
	// 	common.UploadRequest{
	// 		Name:    "warehouse",
	// 		Version: "latest",
	// 		Url:     "http://localhost",
	// 		Filter:  "logs/*.log",
	// 	},
	// 	[]string{"mountain"},
	// ))
	// time.Sleep(5 * time.Second)
	// svr.Operation().Withdraw(server.MakeWithdrawRequest(
	// 	common.WithdrawRequest{
	// 		Name:    "warehouse",
	// 		Version: testver,
	// 	},
	// 	nil,
	// ))
	//}()
}
