Skip to content

Commit 9574093

Browse files
committed
Test portability
1 parent 59c9a2a commit 9574093

File tree

3 files changed

+69
-36
lines changed

3 files changed

+69
-36
lines changed

test/instanceof.js

+20-7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
* See the License for the specific language governing permissions and
1616
* limitations under the License.
1717
*
18+
* NAME
19+
* 45. instanceof.js
20+
*
21+
* DESCRIPTION
22+
* Testing JS instanceof.
23+
*
24+
* NUMBERING RULE
25+
* Test numbers follow this numbering rule:
26+
* 1 - 20 are reserved for basic functional tests
27+
* 21 - 50 are reserved for data type supporting tests
28+
* 51 onwards are for other tests
29+
*
1830
*****************************************************************************/
1931
'use strict';
2032

@@ -40,8 +52,9 @@ if (dbConfig.externalAuth) {
4052
credential = dbConfig;
4153
}
4254

43-
describe('instanceof.js', function() {
44-
it('all constructors have been accounted for', function(done) {
55+
describe('45. instanceof.js', function() {
56+
57+
it('45.1 all constructors have been accounted for', function(done) {
4558
var cLibKeysIdx;
4659
var cLibKeys;
4760
var instKeysIdx;
@@ -78,13 +91,13 @@ describe('instanceof.js', function() {
7891
done();
7992
});
8093

81-
it('instanceof works for the oracledb instance', function(done) {
94+
it('45.2 instanceof works for the oracledb instance', function(done) {
8295
(oracledb instanceof oracledb.Oracledb).should.be.true;
8396

8497
done();
8598
});
8699

87-
it('instanceof works for pool instances', function(done) {
100+
it('45.3 instanceof works for pool instances', function(done) {
88101
oracledb.createPool(
89102
{
90103
externalAuth : credential.externalAuth,
@@ -109,7 +122,7 @@ describe('instanceof.js', function() {
109122
);
110123
});
111124

112-
it('instanceof works for connection instances', function(done) {
125+
it('45.4 instanceof works for connection instances', function(done) {
113126
oracledb.getConnection(credential, function(err, conn) {
114127
should.not.exist(err);
115128

@@ -123,7 +136,7 @@ describe('instanceof.js', function() {
123136
});
124137
});
125138

126-
it('instanceof works for resultset instances', function(done) {
139+
it('45.5 instanceof works for resultset instances', function(done) {
127140
oracledb.getConnection(credential, function(err, conn) {
128141
should.not.exist(err);
129142

@@ -152,7 +165,7 @@ describe('instanceof.js', function() {
152165
});
153166
});
154167

155-
it('instanceof works for lob instances', function(done) {
168+
it('45.6 instanceof works for lob instances', function(done) {
156169
oracledb.getConnection(credential, function(err, conn) {
157170
should.not.exist(err);
158171

test/list.txt

+18
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@
4747
2.6.1 stmtCacheSize cannot be a negative value
4848
2.6.2 stmtCacheSize can be 0
4949
2.6.3 stmtCacheSize must be a Number
50+
2.7 getConnection
51+
2.7.1 throws error if called after pool is terminated and a callback is not provided
52+
2.7.2 passes error in callback if called after pool is terminated and a callback is provided
53+
2.8 connection request queue (basic functionality)
54+
2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled
55+
2.8.2 does not generate ORA-24418 when calling getConnection if queueing is enabled
56+
2.8.3 generates NJS-040 if request is queued and queueTimeout expires
57+
2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout
58+
2.9 connection request queue (_enableStats & _logStats functionality)_logStats must be called prior to terminating pool.
59+
2.9.1 works after the pool as been terminated
60+
5061

5162
3. examples.js
5263
3.1 connect.js
@@ -447,6 +458,13 @@
447458
44.7 empty array for BIND_OUT
448459
- 44.8 maxSize option applies to each elements of an array
449460

461+
45. instanceof.js
462+
45.1 all constructors have been accounted for
463+
45.2 instanceof works for the oracledb instance
464+
45.3 instanceof works for pool instances
465+
45.4 instanceof works for connection instances
466+
45.5 instanceof works for resultset instances
467+
45.6 instanceof works for lob instances
450468

451469
51. accessTerminatedPoolAttributes.js
452470
can not access attributes of terminated pool

test/pool.js

+31-29
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ describe('2. pool.js', function(){
7979
it('2.2.1 poolMin cannot be a negative number', function(done){
8080
oracledb.createPool(
8181
{
82-
externalAuth : credential.externalAuth,
82+
externalAuth : credential.externalAuth,
8383
user : credential.user,
8484
password : credential.password,
8585
connectString : credential.connectString,
@@ -100,7 +100,7 @@ describe('2. pool.js', function(){
100100
it('2.2.2 poolMin must be a Number', function(done){
101101
oracledb.createPool(
102102
{
103-
externalAuth : credential.externalAuth,
103+
externalAuth : credential.externalAuth,
104104
user : credential.user,
105105
password : credential.password,
106106
connectString : credential.connectString,
@@ -121,7 +121,7 @@ describe('2. pool.js', function(){
121121
it('2.2.3 poolMin cannot equal to poolMax', function(done){
122122
oracledb.createPool(
123123
{
124-
externalAuth : credential.externalAuth,
124+
externalAuth : credential.externalAuth,
125125
user : credential.user,
126126
password : credential.password,
127127
connectString : credential.connectString,
@@ -144,7 +144,7 @@ describe('2. pool.js', function(){
144144
it('2.2.4 poolMin cannot greater than poolMax', function(done){
145145
oracledb.createPool(
146146
{
147-
externalAuth : credential.externalAuth,
147+
externalAuth : credential.externalAuth,
148148
user : credential.user,
149149
password : credential.password,
150150
connectString : credential.connectString,
@@ -167,7 +167,7 @@ describe('2. pool.js', function(){
167167
it('2.2.5 (poolMin + poolIncrement) cannot greater than poolMax', function(done){
168168
oracledb.createPool(
169169
{
170-
externalAuth : credential.externalAuth,
170+
externalAuth : credential.externalAuth,
171171
user : credential.user,
172172
password : credential.password,
173173
connectString : credential.connectString,
@@ -190,7 +190,7 @@ describe('2. pool.js', function(){
190190
it('2.2.6 (poolMin + poolIncrement) can equal to poolMax', function(done){
191191
oracledb.createPool(
192192
{
193-
externalAuth : credential.externalAuth,
193+
externalAuth : credential.externalAuth,
194194
user : credential.user,
195195
password : credential.password,
196196
connectString : credential.connectString,
@@ -226,7 +226,7 @@ describe('2. pool.js', function(){
226226
it('2.3.1 poolMax cannot be a negative value', function(done){
227227
oracledb.createPool(
228228
{
229-
externalAuth : credential.externalAuth,
229+
externalAuth : credential.externalAuth,
230230
user : credential.user,
231231
password : credential.password,
232232
connectString : credential.connectString,
@@ -247,7 +247,7 @@ describe('2. pool.js', function(){
247247
it('2.3.2 poolMax cannot be 0', function(done){
248248
oracledb.createPool(
249249
{
250-
externalAuth : credential.externalAuth,
250+
externalAuth : credential.externalAuth,
251251
user : credential.user,
252252
password : credential.password,
253253
connectString : credential.connectString,
@@ -268,7 +268,7 @@ describe('2. pool.js', function(){
268268
it('2.3.3 poolMax must be a number', function(done){
269269
oracledb.createPool(
270270
{
271-
externalAuth : credential.externalAuth,
271+
externalAuth : credential.externalAuth,
272272
user : credential.user,
273273
password : credential.password,
274274
connectString : credential.connectString,
@@ -289,7 +289,7 @@ describe('2. pool.js', function(){
289289
it('2.3.4 poolMax limits the pool capacity', function(done){
290290
oracledb.createPool(
291291
{
292-
externalAuth : credential.externalAuth,
292+
externalAuth : credential.externalAuth,
293293
user : credential.user,
294294
password : credential.password,
295295
connectString : credential.connectString,
@@ -351,7 +351,7 @@ describe('2. pool.js', function(){
351351
it('2.4.1 poolIncrement cannot be a negative value', function(done){
352352
oracledb.createPool(
353353
{
354-
externalAuth : credential.externalAuth,
354+
externalAuth : credential.externalAuth,
355355
user : credential.user,
356356
password : credential.password,
357357
connectString : credential.connectString,
@@ -372,7 +372,7 @@ describe('2. pool.js', function(){
372372
it('2.4.2 poolIncrement cannot be 0', function(done){
373373
oracledb.createPool(
374374
{
375-
externalAuth : credential.externalAuth,
375+
externalAuth : credential.externalAuth,
376376
user : credential.user,
377377
password : credential.password,
378378
connectString : credential.connectString,
@@ -393,7 +393,7 @@ describe('2. pool.js', function(){
393393
it('2.4.3 poolIncrement must be a Number', function(done){
394394
oracledb.createPool(
395395
{
396-
externalAuth : credential.externalAuth,
396+
externalAuth : credential.externalAuth,
397397
user : credential.user,
398398
password : credential.password,
399399
connectString : credential.connectString,
@@ -414,7 +414,7 @@ describe('2. pool.js', function(){
414414
it('2.4.4 the amount of open connections equals to poolMax when (connectionsOpen + poolIncrement) > poolMax', function(done){
415415
oracledb.createPool(
416416
{
417-
externalAuth : credential.externalAuth,
417+
externalAuth : credential.externalAuth,
418418
user : credential.user,
419419
password : credential.password,
420420
connectString : credential.connectString,
@@ -482,7 +482,7 @@ describe('2. pool.js', function(){
482482
it('2.5.1 poolTimeout cannot be a negative number', function(done){
483483
oracledb.createPool(
484484
{
485-
externalAuth : credential.externalAuth,
485+
externalAuth : credential.externalAuth,
486486
user : credential.user,
487487
password : credential.password,
488488
connectString : credential.connectString,
@@ -503,7 +503,7 @@ describe('2. pool.js', function(){
503503
it('2.5.2 poolTimeout can be 0, which disables timeout feature', function(done){
504504
oracledb.createPool(
505505
{
506-
externalAuth : credential.externalAuth,
506+
externalAuth : credential.externalAuth,
507507
user : credential.user,
508508
password : credential.password,
509509
connectString : credential.connectString,
@@ -528,7 +528,7 @@ describe('2. pool.js', function(){
528528
it('2.5.3 poolTimeout must be a number', function(done){
529529
oracledb.createPool(
530530
{
531-
externalAuth : credential.externalAuth,
531+
externalAuth : credential.externalAuth,
532532
user : credential.user,
533533
password : credential.password,
534534
connectString : credential.connectString,
@@ -552,7 +552,7 @@ describe('2. pool.js', function(){
552552
it('2.6.1 stmtCacheSize cannot be a negative value', function(done){
553553
oracledb.createPool(
554554
{
555-
externalAuth : credential.externalAuth,
555+
externalAuth : credential.externalAuth,
556556
user : credential.user,
557557
password : credential.password,
558558
connectString : credential.connectString,
@@ -573,7 +573,7 @@ describe('2. pool.js', function(){
573573
it('2.6.2 stmtCacheSize can be 0', function(done){
574574
oracledb.createPool(
575575
{
576-
externalAuth : credential.externalAuth,
576+
externalAuth : credential.externalAuth,
577577
user : credential.user,
578578
password : credential.password,
579579
connectString : credential.connectString,
@@ -597,7 +597,7 @@ describe('2. pool.js', function(){
597597
it('2.6.3 stmtCacheSize must be a Number', function(done){
598598
oracledb.createPool(
599599
{
600-
externalAuth : credential.externalAuth,
600+
externalAuth : credential.externalAuth,
601601
user : credential.user,
602602
password : credential.password,
603603
connectString : credential.connectString,
@@ -623,7 +623,7 @@ describe('2. pool.js', function(){
623623
beforeEach('get pool ready', function(done) {
624624
oracledb.createPool(
625625
{
626-
externalAuth : credential.externalAuth,
626+
externalAuth : credential.externalAuth,
627627
user : credential.user,
628628
password : credential.password,
629629
connectString : credential.connectString,
@@ -640,7 +640,7 @@ describe('2. pool.js', function(){
640640
);
641641
});
642642

643-
it('throws error if called after pool is terminated and a callback is not provided', function(done) {
643+
it('2.7.1 throws error if called after pool is terminated and a callback is not provided', function(done) {
644644
pool1.terminate(function(err) {
645645
should.not.exist(err);
646646

@@ -654,7 +654,7 @@ describe('2. pool.js', function(){
654654
});
655655
});
656656

657-
it('passes error in callback if called after pool is terminated and a callback is provided', function(done) {
657+
it('2.7.2 passes error in callback if called after pool is terminated and a callback is provided', function(done) {
658658
pool1.terminate(function(err) {
659659
should.not.exist(err);
660660

@@ -668,6 +668,8 @@ describe('2. pool.js', function(){
668668
});
669669

670670
describe('2.8 connection request queue (basic functionality)', function(){
671+
this.timeout(0);
672+
671673
function getBlockingSql(secondsToBlock) {
672674
var blockingSql = '' +
673675
'declare \n' +
@@ -688,7 +690,7 @@ describe('2. pool.js', function(){
688690
it('2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled', function(done) {
689691
oracledb.createPool(
690692
{
691-
externalAuth : credential.externalAuth,
693+
externalAuth : credential.externalAuth,
692694
user : credential.user,
693695
password : credential.password,
694696
connectString : credential.connectString,
@@ -741,7 +743,7 @@ describe('2. pool.js', function(){
741743
it('2.8.2 does not generate ORA-24418 when calling getConnection if queueing is enabled', function(done) {
742744
oracledb.createPool(
743745
{
744-
externalAuth : credential.externalAuth,
746+
externalAuth : credential.externalAuth,
745747
user : credential.user,
746748
password : credential.password,
747749
connectString : credential.connectString,
@@ -798,7 +800,7 @@ describe('2. pool.js', function(){
798800
it('2.8.3 generates NJS-040 if request is queued and queueTimeout expires', function(done) {
799801
oracledb.createPool(
800802
{
801-
externalAuth : credential.externalAuth,
803+
externalAuth : credential.externalAuth,
802804
user : credential.user,
803805
password : credential.password,
804806
connectString : credential.connectString,
@@ -852,7 +854,7 @@ describe('2. pool.js', function(){
852854
it('2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout', function(done) {
853855
oracledb.createPool(
854856
{
855-
externalAuth : credential.externalAuth,
857+
externalAuth : credential.externalAuth,
856858
user : credential.user,
857859
password : credential.password,
858860
connectString : credential.connectString,
@@ -861,7 +863,7 @@ describe('2. pool.js', function(){
861863
poolIncrement : 1,
862864
poolTimeout : 1,
863865
queueRequests : true, //default
864-
queueTimeout : 5000 //5 seconds
866+
queueTimeout : 10000 //10 seconds
865867
},
866868
function(err, pool){
867869
should.not.exist(err);
@@ -910,7 +912,7 @@ describe('2. pool.js', function(){
910912
it('2.9.1 works after the pool as been terminated', function(done) {
911913
oracledb.createPool(
912914
{
913-
externalAuth : credential.externalAuth,
915+
externalAuth : credential.externalAuth,
914916
user : credential.user,
915917
password : credential.password,
916918
connectString : credential.connectString,

0 commit comments

Comments
 (0)