Skip to content

Commit c1ef162

Browse files
author
Maksim Konovalov
committed
pool: make round-robin tests for public API
1 parent f8c753c commit c1ef162

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pool/round_robin_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
package pool
1+
package pool_test
22

33
import (
44
"testing"
55

66
"github.com/tarantool/go-tarantool/v2"
7+
"github.com/tarantool/go-tarantool/v2/pool"
78
)
89

910
const (
@@ -12,7 +13,7 @@ const (
1213
)
1314

1415
func TestRoundRobinAddDelete(t *testing.T) {
15-
rr := NewRoundRobinStrategy(10)
16+
rr := pool.NewRoundRobinStrategy(10)
1617

1718
addrs := []string{validAddr1, validAddr2}
1819
conns := []*tarantool.Connection{&tarantool.Connection{}, &tarantool.Connection{}}
@@ -26,13 +27,13 @@ func TestRoundRobinAddDelete(t *testing.T) {
2627
t.Errorf("Unexpected connection on address %s", addr)
2728
}
2829
}
29-
if !IsEmpty(rr) {
30+
if !pool.IsEmpty(rr) {
3031
t.Errorf("RoundRobin does not empty")
3132
}
3233
}
3334

3435
func TestRoundRobinAddDuplicateDelete(t *testing.T) {
35-
rr := NewRoundRobinStrategy(10)
36+
rr := pool.NewRoundRobinStrategy(10)
3637

3738
conn1 := &tarantool.Connection{}
3839
conn2 := &tarantool.Connection{}
@@ -43,7 +44,7 @@ func TestRoundRobinAddDuplicateDelete(t *testing.T) {
4344
if rr.DeleteConnection(validAddr1) != conn2 {
4445
t.Errorf("Unexpected deleted connection")
4546
}
46-
if !IsEmpty(rr) {
47+
if !pool.IsEmpty(rr) {
4748
t.Errorf("RoundRobin does not empty")
4849
}
4950
if rr.DeleteConnection(validAddr1) != nil {
@@ -52,7 +53,7 @@ func TestRoundRobinAddDuplicateDelete(t *testing.T) {
5253
}
5354

5455
func TestRoundRobinGetNextConnection(t *testing.T) {
55-
rr := NewRoundRobinStrategy(10)
56+
rr := pool.NewRoundRobinStrategy(10)
5657

5758
addrs := []string{validAddr1, validAddr2}
5859
conns := []*tarantool.Connection{&tarantool.Connection{}, &tarantool.Connection{}}
@@ -70,7 +71,7 @@ func TestRoundRobinGetNextConnection(t *testing.T) {
7071
}
7172

7273
func TestRoundRobinStrategy_GetConnections(t *testing.T) {
73-
rr := NewRoundRobinStrategy(10)
74+
rr := pool.NewRoundRobinStrategy(10)
7475

7576
addrs := []string{validAddr1, validAddr2}
7677
conns := []*tarantool.Connection{&tarantool.Connection{}, &tarantool.Connection{}}

0 commit comments

Comments
 (0)