"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nsqd/http_test.go" between
nsq-1.2.0.tar.gz and nsq-1.2.1.tar.gz

About: nsq is a realtime distributed and and decentralized messaging platform.

http_test.go  (nsq-1.2.0):http_test.go  (nsq-1.2.1)
skipping to change at line 528 skipping to change at line 528
sub(t, conn, topicName, "ch") sub(t, conn, topicName, "ch")
var d struct { var d struct {
Topics []struct { Topics []struct {
Channels []struct { Channels []struct {
ClientCount int `json:"client_count"` ClientCount int `json:"client_count"`
Clients []struct { Clients []struct {
} `json:"clients"` } `json:"clients"`
} `json:"channels"` } `json:"channels"`
} `json:"topics"` } `json:"topics"`
Memory *struct{} `json:"memory,omitempty"`
} }
endpoint := fmt.Sprintf("http://127.0.0.1:%d/stats?format=json", httpAddr .Port) endpoint := fmt.Sprintf("http://127.0.0.1:%d/stats?format=json", httpAddr .Port)
err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d) err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d)
test.Nil(t, err) test.Nil(t, err)
test.Equal(t, 1, len(d.Topics[0].Channels[0].Clients)) test.Equal(t, 1, len(d.Topics[0].Channels[0].Clients))
test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount) test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount)
test.NotNil(t, d.Memory)
endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_cli ents=true", httpAddr.Port) endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_cli ents=true", httpAddr.Port)
err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d) err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d)
test.Nil(t, err) test.Nil(t, err)
test.Equal(t, 1, len(d.Topics[0].Channels[0].Clients)) test.Equal(t, 1, len(d.Topics[0].Channels[0].Clients))
test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount) test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount)
endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_cli ents=false", httpAddr.Port) endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_cli ents=false", httpAddr.Port)
err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d) err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo int, &d)
test.Nil(t, err) test.Nil(t, err)
test.Equal(t, 0, len(d.Topics[0].Channels[0].Clients)) test.Equal(t, 0, len(d.Topics[0].Channels[0].Clients))
test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount) test.Equal(t, 1, d.Topics[0].Channels[0].ClientCount)
endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_mem
=true", httpAddr.Port)
err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo
int, &d)
test.Nil(t, err)
test.NotNil(t, d.Memory)
d.Memory = nil
endpoint = fmt.Sprintf("http://127.0.0.1:%d/stats?format=json&include_mem
=false", httpAddr.Port)
err = http_api.NewClient(nil, ConnectTimeout, RequestTimeout).GETV1(endpo
int, &d)
test.Nil(t, err)
test.Nil(t, d.Memory)
} }
func TestHTTPgetStatusJSON(t *testing.T) { func TestHTTPgetStatusJSON(t *testing.T) {
testTime := time.Now() testTime := time.Now()
opts := NewOptions() opts := NewOptions()
opts.Logger = test.NewTestLogger(t) opts.Logger = test.NewTestLogger(t)
_, httpAddr, nsqd := mustStartNSQD(opts) _, httpAddr, nsqd := mustStartNSQD(opts)
defer os.RemoveAll(opts.DataPath) defer os.RemoveAll(opts.DataPath)
defer nsqd.Exit() defer nsqd.Exit()
 End of changes. 3 change blocks. 
0 lines changed or deleted 19 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)