Skip to content

Commit ab9f89f

Browse files
authored
Merge pull request #33 from ali-ince/1.7-minor-changes
Couple of minor changes
2 parents 520f8ab + 5c13505 commit ab9f89f

File tree

6 files changed

+253
-28
lines changed

6 files changed

+253
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ core
2020
.glide/
2121

2222
build
23+
vendor

neo4j/Gopkg.lock

Lines changed: 175 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

neo4j/Gopkg.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Gopkg.toml example
2+
#
3+
# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4+
# for detailed Gopkg.toml documentation.
5+
#
6+
# required = ["github.com/user/thing/cmd/thing"]
7+
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8+
#
9+
# [[constraint]]
10+
# name = "github.com/user/project"
11+
# version = "1.0.0"
12+
#
13+
# [[constraint]]
14+
# name = "github.com/user/project2"
15+
# branch = "dev"
16+
# source = "github.com/myfork/project2"
17+
#
18+
# [[override]]
19+
# name = "github.com/x/y"
20+
# version = "2.4.0"
21+
#
22+
# [prune]
23+
# non-go = false
24+
# go-tests = true
25+
# unused-packages = true
26+
27+
28+
[[constraint]]
29+
name = "github.com/golang/mock"
30+
version = "1.1.1"
31+
32+
[[constraint]]
33+
name = "github.com/neo4j-drivers/gobolt"
34+
version = "1.7.x"
35+
36+
[[constraint]]
37+
name = "github.com/onsi/ginkgo"
38+
version = "1.6.0"
39+
40+
[[constraint]]
41+
name = "github.com/onsi/gomega"
42+
version = "1.4.2"
43+
44+
[[constraint]]
45+
name = "github.com/pkg/errors"
46+
version = "0.8.0"
47+
48+
[prune]
49+
go-tests = true
50+
unused-packages = true

neo4j/gobolt_driver.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ func configToGoboltConfig(config *Config) *gobolt.Config {
4646
MaxConnLifetime: config.MaxConnectionLifetime,
4747
ConnAcquisitionTimeout: config.ConnectionAcquisitionTimeout,
4848
SockConnectTimeout: config.SocketConnectTimeout,
49-
SockRecvTimeout: 0,
50-
SockSendTimeout: 0,
5149
SockKeepalive: config.SocketKeepalive,
5250
ValueHandlers: []gobolt.ValueHandler{
5351
&nodeValueHandler{},

neo4j/test-integration/timeout_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ var _ = Describe("Timeout and Lifetime", func() {
9494
Expect(log.Infos).Should(ContainElement(ContainSubstring("reached its maximum lifetime")))
9595
})
9696

97-
XIt("should timeout connection when SocketConnectTimeout is hit", func() {
97+
It("should timeout connection when SocketConnectTimeout is hit", func() {
9898
var err error
9999
var driver neo4j.Driver
100100
var session neo4j.Session
101101

102-
driver, err = neo4j.NewDriver("bolt://192.168.0.0:8080", server.AuthToken(), server.Config(), func(config *neo4j.Config) {
102+
driver, err = neo4j.NewDriver("bolt://10.255.255.1:8080", server.AuthToken(), server.Config(), func(config *neo4j.Config) {
103103
config.Log = log
104-
config.SocketConnectTimeout = 5 * time.Second
104+
config.SocketConnectTimeout = 1 * time.Second
105105
})
106106
Expect(err).To(BeNil())
107107
Expect(driver).NotTo(BeNil())

neo4j/test-integration/types_test.go

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ package test_integration
2222
import (
2323
"github.com/neo4j/neo4j-go-driver/neo4j"
2424
"github.com/neo4j/neo4j-go-driver/neo4j/test-integration/control"
25+
"math/rand"
2526

2627
. "github.com/onsi/ginkgo"
2728
. "github.com/onsi/gomega"
@@ -252,29 +253,29 @@ var _ = Describe("Types", func() {
252253
Expect(result.Err()).To(BeNil())
253254
})
254255

255-
//It("should be able to send and receive large string property", func() {
256-
// var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
257-
//
258-
// randSeq := func (n int) string {
259-
// b := make([]rune, n)
260-
// for i := range b {
261-
// b[i] = letters[rand.Intn(len(letters))]
262-
// }
263-
// return string(b)
264-
// }
265-
//
266-
// value := randSeq(20 * 1024)
267-
//
268-
// result, err = session.Run("CREATE (n {value: $value}) RETURN n.value", &map[string]interface{}{"value": value})
269-
// Expect(err).To(BeNil())
270-
//
271-
// if result.Next() {
272-
// Expect(result.Record().GetByIndex(0)).To(BeAssignableToTypeOf(""))
273-
// Expect(result.Record().GetByIndex(0)).To(Equal(value))
274-
// }
275-
// Expect(result.Next()).To(BeFalse())
276-
// Expect(result.Err()).To(BeNil())
277-
//})
256+
It("should be able to send and receive large string property", func() {
257+
var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
258+
259+
randSeq := func(n int) string {
260+
b := make([]rune, n)
261+
for i := range b {
262+
b[i] = letters[rand.Intn(len(letters))]
263+
}
264+
return string(b)
265+
}
266+
267+
value := randSeq(20 * 1024)
268+
269+
result, err = session.Run("CREATE (n {value: $value}) RETURN n.value", map[string]interface{}{"value": value})
270+
Expect(err).To(BeNil())
271+
272+
if result.Next() {
273+
Expect(result.Record().GetByIndex(0)).To(BeAssignableToTypeOf(""))
274+
Expect(result.Record().GetByIndex(0)).To(Equal(value))
275+
}
276+
Expect(result.Next()).To(BeFalse())
277+
Expect(result.Err()).To(BeNil())
278+
})
278279

279280
It("should be able to receive a node with properties", func() {
280281
result, err = session.Run("CREATE (n:Person:Manager {id: 1, name: 'a name'}) RETURN n", nil)

0 commit comments

Comments
 (0)