(t *testing.T)
| 135 | } |
| 136 | |
| 137 | func TestServer(t *testing.T) { |
| 138 | s := NewServer() |
| 139 | |
| 140 | s.SetOnConnStart(DoConnectionBegin) |
| 141 | s.SetOnConnStop(DoConnectionLost) |
| 142 | |
| 143 | s.AddRouter(1, &PingRouter{}) |
| 144 | s.AddRouter(2, &HelloRouter{}) |
| 145 | |
| 146 | go ClientTest(1) |
| 147 | go ClientTest(2) |
| 148 | |
| 149 | go s.Serve() |
| 150 | |
| 151 | select { |
| 152 | case <-time.After(time.Second * 10): |
| 153 | return |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func TestServerDeadLock(t *testing.T) { |
| 158 | s := NewServer() |
nothing calls this directly
no test coverage detected