@@ -1999,31 +1999,11 @@ describe('routing driver with stub server', () => {
19991999 } ) ;
20002000
20012001 it ( 'should rediscover using older getServers procedure when server is old' , done => {
2002- if ( ! boltStub . supported ) {
2003- done ( ) ;
2004- return ;
2005- }
2006-
2007- const router = boltStub . start ( './test/resources/boltstub/acquire_endpoints_old_routing_procedure.script' , 9001 ) ;
2008- const reader = boltStub . start ( './test/resources/boltstub/read_server.script' , 9005 ) ;
2009-
2010- boltStub . run ( ( ) => {
2011- const driver = boltStub . newDriver ( 'bolt+routing://127.0.0.1:9001' ) ;
2002+ testDiscoveryAndReadQueryInAutoCommitTx ( './test/resources/boltstub/acquire_endpoints_old_routing_procedure.script' , { } , done ) ;
2003+ } ) ;
20122004
2013- const session = driver . session ( READ ) ;
2014- session . run ( 'MATCH (n) RETURN n.name' ) . then ( result => {
2015- expect ( result . records . map ( record => record . get ( 0 ) ) ) . toEqual ( [ 'Bob' , 'Alice' , 'Tina' ] ) ;
2016- session . close ( ) ;
2017- driver . close ( ) ;
2018- router . exit ( code1 => {
2019- reader . exit ( code2 => {
2020- expect ( code1 ) . toEqual ( 0 ) ;
2021- expect ( code2 ) . toEqual ( 0 ) ;
2022- done ( ) ;
2023- } ) ;
2024- } ) ;
2025- } ) . catch ( done . fail ) ;
2026- } ) ;
2005+ it ( 'should connect to cluster when disableLosslessIntegers is on' , done => {
2006+ testDiscoveryAndReadQueryInAutoCommitTx ( './test/resources/boltstub/acquire_endpoints.script' , { disableLosslessIntegers : true } , done ) ;
20272007 } ) ;
20282008
20292009 function testAddressPurgeOnDatabaseError ( query , accessMode , done ) {
@@ -2114,6 +2094,34 @@ describe('routing driver with stub server', () => {
21142094 } ) ;
21152095 }
21162096
2097+ function testDiscoveryAndReadQueryInAutoCommitTx ( routerScript , driverConfig , done ) {
2098+ if ( ! boltStub . supported ) {
2099+ done ( ) ;
2100+ return ;
2101+ }
2102+
2103+ const router = boltStub . start ( routerScript , 9001 ) ;
2104+ const reader = boltStub . start ( './test/resources/boltstub/read_server.script' , 9005 ) ;
2105+
2106+ boltStub . run ( ( ) => {
2107+ const driver = boltStub . newDriver ( 'bolt+routing://127.0.0.1:9001' , driverConfig ) ;
2108+
2109+ const session = driver . session ( READ ) ;
2110+ session . run ( 'MATCH (n) RETURN n.name' ) . then ( result => {
2111+ expect ( result . records . map ( record => record . get ( 0 ) ) ) . toEqual ( [ 'Bob' , 'Alice' , 'Tina' ] ) ;
2112+ session . close ( ) ;
2113+ driver . close ( ) ;
2114+ router . exit ( code1 => {
2115+ reader . exit ( code2 => {
2116+ expect ( code1 ) . toEqual ( 0 ) ;
2117+ expect ( code2 ) . toEqual ( 0 ) ;
2118+ done ( ) ;
2119+ } ) ;
2120+ } ) ;
2121+ } ) . catch ( done . fail ) ;
2122+ } ) ;
2123+ }
2124+
21172125 function testForProtocolError ( scriptFile , done ) {
21182126 if ( ! boltStub . supported ) {
21192127 done ( ) ;
0 commit comments