Example #1
0
func TestLoadBalancer(t *testing.T) {
	lb := New(staticResolver{}, firstStrategy{})
	rw := dummy.NewResponseRecorder()
	req := &protocol.Request{
		Method: "foo",
	}

	sender := lb(dummy.New(rw, req))

	_, err := sender.Send("nanoTest", req)
	if err != nil {
		t.Fatalf("Unexcpected failure %s", err)
	}
}
Example #2
0
func buildTestServer(rw *dummy.ResponseWriter, req *protocol.Request) *Server {
	proto := dummy.New(rw, req)
	server := New(proto)

	return server
}