File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -879,4 +879,66 @@ describe('1. connection.js', function(){
879
879
880
880
} ) ; // 1.8
881
881
882
+ describe ( '1.9 Ping method' , function ( ) {
883
+
884
+ it ( '1.9.1 ping() checks the connection is usable' , function ( done ) {
885
+ var conn ;
886
+ async . series ( [
887
+ function ( cb ) {
888
+ oracledb . getConnection (
889
+ dbConfig ,
890
+ function ( err , connection ) {
891
+ should . not . exist ( err ) ;
892
+ conn = connection ;
893
+ cb ( ) ;
894
+ }
895
+ ) ;
896
+ } ,
897
+ function ( cb ) {
898
+ conn . ping ( function ( err ) {
899
+ should . not . exist ( err ) ;
900
+ cb ( ) ;
901
+ } ) ;
902
+ } ,
903
+ function ( cb ) {
904
+ conn . close ( function ( err ) {
905
+ should . not . exist ( err ) ;
906
+ cb ( ) ;
907
+ } ) ;
908
+ }
909
+ ] , done ) ;
910
+ } ) ; // 1.9.1
911
+
912
+ it ( '1.9.2 closed connection' , function ( done ) {
913
+ var conn ;
914
+ async . series ( [
915
+ function ( cb ) {
916
+ oracledb . getConnection (
917
+ dbConfig ,
918
+ function ( err , connection ) {
919
+ should . not . exist ( err ) ;
920
+ conn = connection ;
921
+ cb ( ) ;
922
+ }
923
+ ) ;
924
+ } , function ( cb ) {
925
+ conn . close ( function ( err ) {
926
+ should . not . exist ( err ) ;
927
+ cb ( ) ;
928
+ } ) ;
929
+ } ,
930
+ function ( cb ) {
931
+ conn . ping ( function ( err ) {
932
+ should . exist ( err ) ;
933
+ should . strictEqual (
934
+ err . message ,
935
+ "NJS-003: invalid connection"
936
+ ) ;
937
+ cb ( ) ;
938
+ } ) ;
939
+ } ,
940
+ ] , done ) ;
941
+ } ) ; // 1.9.2
942
+ } ) ; // 1.9
943
+
882
944
} ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ Overview of node-oracledb functional tests
31
31
1.8.3 Negative value - random constants
32
32
1.8.4 Negative value - NaN
33
33
1.8.5 gets ignored when acquiring a connection from Pool
34
+ 1.9 Ping method
35
+ 1.9.1 ping() checks the connection is usable
36
+ 1.9.2 closed connection
34
37
35
38
2. pool.js
36
39
2.1 default values
You can’t perform that action at this time.
0 commit comments