func newServers(assert audit.Assertion, ports ...int) request.Servers {
	// Preparation.
	logger.SetLevel(logger.LevelDebug)
	cfgStr := "{etc {basepath /}{default-domain testing}{default-resource item}}"
	cfg, err := etc.ReadString(cfgStr)
	assert.Nil(err)
	servers := request.NewServers()
	// Start and register each server.
	for i, port := range ports {
		mux := rest.NewMultiplexer(context.Background(), cfg)
		h := NewTestHandler(i, assert)
		err = mux.Register("testing", "item", h)
		assert.Nil(err)
		err = mux.Register("testing", "items", h)
		assert.Nil(err)
		address := fmt.Sprintf(":%d", port)
		go func() {
			http.ListenAndServe(address, mux)
		}()
		servers.Add("testing", "http://localhost"+address, nil)
	}
	time.Sleep(5 * time.Millisecond)
	return servers
}
// newServers starts the server map for the requests.
newServers starts the server map for the requests.
// newServers starts the server map for the requests .
func newServers(assert audit.Assertion, ports ...int) request.Servers {
	logger.SetLevel(logger.LevelDebug)
	cfgStr := "{etc {basepath /}{default-domain testing}{default-resource item}}"
	cfg, err := etc.ReadString(cfgStr)
	assert.Nil(err)
	servers := request.NewServers()
	for i, port := range ports {
		mux := rest.NewMultiplexer(context.Background(), cfg)
		h := NewTestHandler(i, assert)
		err = mux.Register("testing", "item", h)
		assert.Nil(err)
		err = mux.Register("testing", "items", h)
		assert.Nil(err)
		address := fmt.Sprintf(":%d", port)
		go func() {
			http.ListenAndServe(address, mux)
		}()
		servers.Add("testing", "http://localhost"+address, nil)
	}
	time.Sleep(5 * time.Millisecond)
	return servers
}
func newServers ( assert audit . Assertion , ports ... int ) request . Servers { logger . SetLevel ( logger . LevelDebug ) cfgStr := " " cfg , err := etc . ReadString ( cfgStr ) assert . Nil ( err ) servers := request . NewServers ( ) for i , port := range ports { mux := rest . NewMultiplexer ( context . Background ( ) , cfg ) h := NewTestHandler ( i , assert ) err = mux . Register ( " " , " " , h ) assert . Nil ( err ) err = mux . Register ( " " , " " , h ) assert . Nil ( err ) address := fmt . Sprintf ( " " , port ) go func ( ) { http . ListenAndServe ( address , mux ) } ( ) servers . Add ( " " , " " + address , nil ) } time . Sleep ( 5 * time . Millisecond ) return servers }
newServers starts the server map for the requests.
newServers starts the server map for the requests .
// Preparation. // Start and register each server.