mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the MIT License.
|
|
// If a copy of the MIT was not distributed with this file,
|
|
// You can obtain one at https://github.com/gogf/gf.
|
|
|
|
package gins
|
|
|
|
//func Test_Server(t *testing.T) {
|
|
// gtest.C(t, func(t *gtest.T) {
|
|
// var (
|
|
// config = Config().GetAdapter().(*gcfg.AdapterFile)
|
|
// searchingPaths = config.GetPaths()
|
|
// serverConfigDir = gtest.DataPath("server")
|
|
// )
|
|
// t.AssertNE(serverConfigDir, "")
|
|
// t.AssertNil(config.SetPath(serverConfigDir))
|
|
// defer func() {
|
|
// t.AssertNil(config.SetPath(searchingPaths[0]))
|
|
// if len(searchingPaths) > 1 {
|
|
// t.AssertNil(config.AddPath(searchingPaths[1:]...))
|
|
// }
|
|
// }()
|
|
//
|
|
// localInstances.Clear()
|
|
// defer localInstances.Clear()
|
|
//
|
|
// config.Clear()
|
|
// defer config.Clear()
|
|
//
|
|
// s := Server("tempByInstanceName")
|
|
// s.BindHandler("/", func(r *ghttp.Request) {
|
|
// r.Response.Write("hello")
|
|
// })
|
|
// s.SetDumpRouterMap(false)
|
|
// t.AssertNil(s.Start())
|
|
// defer t.AssertNil(s.Shutdown())
|
|
//
|
|
// content := HttpClient().GetContent(gctx.New(), `http://127.0.0.1:8003/`)
|
|
// t.Assert(content, `hello`)
|
|
// })
|
|
//}
|