Skip to content

Commit 2ebf26e

Browse files
committed
Add queryStream() tests
1 parent ddfc2d0 commit 2ebf26e

8 files changed

+2700
-1966
lines changed

test/blobDMLBindAsBuffer.js

Lines changed: 77 additions & 77 deletions
Large diffs are not rendered by default.

test/blobPlsqlBindAsBuffer.js

Lines changed: 135 additions & 135 deletions
Large diffs are not rendered by default.

test/clobDMLBindAsString.js

Lines changed: 77 additions & 77 deletions
Large diffs are not rendered by default.

test/fetchBlobAsBuffer.js

Lines changed: 915 additions & 553 deletions
Large diffs are not rendered by default.

test/fetchClobAsString.js

Lines changed: 911 additions & 555 deletions
Large diffs are not rendered by default.

test/list.txt

Lines changed: 523 additions & 507 deletions
Large diffs are not rendered by default.

test/lobBindAsStringBuffer.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* See LICENSE.md for relevant licenses.
2020
*
2121
* NAME
22-
* 76. lobBindAsStringBuffer.js
22+
* 78. lobBindAsStringBuffer.js
2323
*
2424
* DESCRIPTION
2525
* Testing CLOB/BLOB binding as String/Buffer.
@@ -40,7 +40,7 @@ var dbConfig = require('./dbconfig.js');
4040
var fs = require('fs');
4141
var random = require('./random.js');
4242

43-
describe('76.lobBindAsStringBuffer.js', function() {
43+
describe('78.lobBindAsStringBuffer.js', function() {
4444
var connection = null;
4545
var node6plus = false; // assume node runtime version is lower than 6
4646

@@ -336,14 +336,14 @@ describe('76.lobBindAsStringBuffer.js', function() {
336336
);
337337
};
338338

339-
describe('76.1 Multiple LOBs, BIND_IN', function() {
340-
var proc = "CREATE OR REPLACE PROCEDURE nodb_lobs_in_761 (id IN NUMBER, clob_in IN CLOB, blob_in IN BLOB)\n" +
339+
describe('78.1 Multiple LOBs, BIND_IN', function() {
340+
var proc = "CREATE OR REPLACE PROCEDURE nodb_lobs_in_781 (id IN NUMBER, clob_in IN CLOB, blob_in IN BLOB)\n" +
341341
"AS \n" +
342342
"BEGIN \n" +
343343
" insert into nodb_tab_lobs_in (id, clob, blob) values (id, clob_in, blob_in); \n" +
344-
"END nodb_lobs_in_761; ";
345-
var sqlRun = "BEGIN nodb_lobs_in_761 (:i, :c, :b); END;";
346-
var proc_drop = "DROP PROCEDURE nodb_lobs_in_761";
344+
"END nodb_lobs_in_781; ";
345+
var sqlRun = "BEGIN nodb_lobs_in_781 (:i, :c, :b); END;";
346+
var proc_drop = "DROP PROCEDURE nodb_lobs_in_781";
347347

348348
before(function(done) {
349349
executeSQL(proc, done);
@@ -353,8 +353,8 @@ describe('76.lobBindAsStringBuffer.js', function() {
353353
executeSQL(proc_drop, done);
354354
}); // after
355355

356-
it('76.1.1 PLSQL, CLOB&BLOB, bind a string and a buffer', function(done) {
357-
var specialStr = "76.1.1";
356+
it('78.1.1 PLSQL, CLOB&BLOB, bind a string and a buffer', function(done) {
357+
var specialStr = "78.1.1";
358358
var length = 50000;
359359
var bigStr = random.getRandomString(length, specialStr);
360360
var bigBuffer = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
@@ -386,13 +386,13 @@ describe('76.lobBindAsStringBuffer.js', function() {
386386
verifyBlobValueWithBuffer(sql_2, bigBuffer, specialStr, cb);
387387
}
388388
], done);
389-
}); // 76.1.1
389+
}); // 78.1.1
390390

391-
it('76.1.2 PLSQL, CLOB&BLOB, bind a string and a JPG file', function(done) {
391+
it('78.1.2 PLSQL, CLOB&BLOB, bind a string and a JPG file', function(done) {
392392
var preparedCLOBID = 701;
393393
var sequence = 2;
394394
var size = 40000;
395-
var specialStr = "76.1.2";
395+
var specialStr = "78.1.2";
396396
var bigStr = random.getRandomString(size, specialStr);
397397

398398
async.series([
@@ -432,13 +432,13 @@ describe('76.lobBindAsStringBuffer.js', function() {
432432
verifyBlobValueWithFileData(sql_2, cb);
433433
}
434434
], done);
435-
}); // 76.1.2
435+
}); // 78.1.2
436436

437-
it('76.1.3 PLSQL, CLOB&BLOB, bind a txt file and a Buffer', function(done) {
437+
it('78.1.3 PLSQL, CLOB&BLOB, bind a txt file and a Buffer', function(done) {
438438
var preparedCLOBID = 200;
439439
var sequence = 303;
440440
var size = 40000;
441-
var specialStr = "76.1.3";
441+
var specialStr = "78.1.3";
442442
var bigStr = random.getRandomString(size, specialStr);
443443
var bigBuffer = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
444444

@@ -481,18 +481,18 @@ describe('76.lobBindAsStringBuffer.js', function() {
481481
verifyBlobValueWithBuffer(sql_2, bigBuffer, specialStr,cb);
482482
}
483483
], done);
484-
}); // 76.1.3
484+
}); // 78.1.3
485485

486-
}); // 76.1
486+
}); // 78.1
487487

488-
describe('76.2 Multiple LOBs, BIND_OUT', function() {
489-
var proc = "CREATE OR REPLACE PROCEDURE nodb_lobs_out_762 (lob_id IN NUMBER, clob OUT CLOB, blob OUT BLOB) \n" +
488+
describe('78.2 Multiple LOBs, BIND_OUT', function() {
489+
var proc = "CREATE OR REPLACE PROCEDURE nodb_lobs_out_782 (lob_id IN NUMBER, clob OUT CLOB, blob OUT BLOB) \n" +
490490
"AS \n" +
491491
"BEGIN \n" +
492492
" select clob, blob into clob, blob from nodb_tab_lobs_in where id = lob_id; \n" +
493-
"END nodb_lobs_out_762; ";
494-
var sqlRun = "BEGIN nodb_lobs_out_762 (:i, :c, :b); END;";
495-
var proc_drop = "DROP PROCEDURE nodb_lobs_out_762";
493+
"END nodb_lobs_out_782; ";
494+
var sqlRun = "BEGIN nodb_lobs_out_782 (:i, :c, :b); END;";
495+
var proc_drop = "DROP PROCEDURE nodb_lobs_out_782";
496496

497497
before(function(done) {
498498
executeSQL(proc, done);
@@ -521,9 +521,9 @@ describe('76.lobBindAsStringBuffer.js', function() {
521521
);
522522
};
523523

524-
it('76.2.1 PLSQL, CLOB&BLOB, bind a string and a buffer', function(done) {
524+
it('78.2.1 PLSQL, CLOB&BLOB, bind a string and a buffer', function(done) {
525525
var length = 50000;
526-
var specialStr = "76.2.1";
526+
var specialStr = "78.2.1";
527527
var sequence = 311;
528528
var bigStr = random.getRandomString(length, specialStr);
529529
var bigBuffer = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
@@ -565,11 +565,11 @@ describe('76.lobBindAsStringBuffer.js', function() {
565565
}
566566
], done);
567567

568-
}); // 76.2.1
568+
}); // 78.2.1
569569

570-
it('76.2.2 PLSQL, CLOB&BLOB, bind a string and a JPG file', function(done) {
570+
it('78.2.2 PLSQL, CLOB&BLOB, bind a string and a JPG file', function(done) {
571571
var size = 40000;
572-
var specialStr = "76.2.2";
572+
var specialStr = "78.2.2";
573573
var bigStr = random.getRandomString(size, specialStr);
574574
var sequence = 312;
575575
var bindVar = {
@@ -644,11 +644,11 @@ describe('76.lobBindAsStringBuffer.js', function() {
644644
}
645645
], done);
646646

647-
}); // 76.2.2
647+
}); // 78.2.2
648648

649-
it('76.2.3 PLSQL, CLOB&BLOB, bind a txt file and a buffer', function(done) {
649+
it('78.2.3 PLSQL, CLOB&BLOB, bind a txt file and a buffer', function(done) {
650650
var size = 40000;
651-
var specialStr = "76.2.3";
651+
var specialStr = "78.2.3";
652652
var bigStr = random.getRandomString(size, specialStr);
653653
var bigBuffer = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
654654
var sequence = 313;
@@ -719,19 +719,19 @@ describe('76.lobBindAsStringBuffer.js', function() {
719719
});
720720
}
721721
], done);
722-
}); // 76.2.3
722+
}); // 78.2.3
723723

724-
}); // 76.2
724+
}); // 78.2
725725

726-
describe('76.3 Multiple LOBs, BIND_INOUT', function() {
727-
var lobs_proc_inout = "CREATE OR REPLACE PROCEDURE nodb_lobs_in_out_763 (clob IN OUT CLOB, blob IN OUT BLOB) \n" +
726+
describe('78.3 Multiple LOBs, BIND_INOUT', function() {
727+
var lobs_proc_inout = "CREATE OR REPLACE PROCEDURE nodb_lobs_in_out_783 (clob IN OUT CLOB, blob IN OUT BLOB) \n" +
728728
"AS \n" +
729729
"BEGIN \n" +
730730
" clob := clob; \n" +
731731
" blob := blob; \n" +
732-
"END nodb_lobs_in_out_763;";
733-
var sqlRun = "begin nodb_lobs_in_out_763(:clob, :blob); end;";
734-
var proc_drop = "DROP PROCEDURE nodb_lobs_in_out_763";
732+
"END nodb_lobs_in_out_783;";
733+
var sqlRun = "begin nodb_lobs_in_out_783(:clob, :blob); end;";
734+
var proc_drop = "DROP PROCEDURE nodb_lobs_in_out_783";
735735

736736
before(function(done) {
737737
executeSQL(lobs_proc_inout, done);
@@ -741,8 +741,8 @@ describe('76.lobBindAsStringBuffer.js', function() {
741741
executeSQL(proc_drop, done);
742742
}); // after
743743

744-
it('76.3.1 PLSQL, BIND_INOUT, bind a 32K string and a 32K buffer', function(done) {
745-
var specialStr = "76.3.1";
744+
it('78.3.1 PLSQL, BIND_INOUT, bind a 32K string and a 32K buffer', function(done) {
745+
var specialStr = "78.3.1";
746746
var size = 32768;
747747
var bigStr = random.getRandomString(size, specialStr);
748748
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
@@ -772,10 +772,10 @@ describe('76.lobBindAsStringBuffer.js', function() {
772772
);
773773
}
774774
], done);
775-
}); // 76.3.1
775+
}); // 78.3.1
776776

777-
it('76.3.2 PLSQL, BIND_INOUT, bind a 64K - 1 string and a 64K - 1 buffer', function(done) {
778-
var specialStr = "76.3.2";
777+
it('78.3.2 PLSQL, BIND_INOUT, bind a (64K - 1) string and a (64K - 1) buffer', function(done) {
778+
var specialStr = "78.3.2";
779779
var size = 65535;
780780
var bigStr = random.getRandomString(size, specialStr);
781781
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
@@ -805,8 +805,8 @@ describe('76.lobBindAsStringBuffer.js', function() {
805805
);
806806
}
807807
], done);
808-
}); // 76.3.2
808+
}); // 78.3.2
809809

810-
}); // 76.3
810+
}); // 78.3
811811

812812
});

test/lobProperties2.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */
1+
/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. */
22

33
/******************************************************************************
44
*
@@ -19,7 +19,7 @@
1919
* See LICENSE.md for relevant licenses.
2020
*
2121
* NAME
22-
* 79. lobProperties2.js
22+
* 81. lobProperties2.js
2323
*
2424
* DESCRIPTION
2525
* Testing the properties of LOB that created by createLob().
@@ -38,7 +38,7 @@ var should = require('should');
3838
var async = require('async');
3939
var dbConfig = require('./dbconfig.js');
4040

41-
describe("79. lobProperties2.js", function() {
41+
describe("81. lobProperties2.js", function() {
4242

4343
var connection;
4444

@@ -80,11 +80,11 @@ describe("79. lobProperties2.js", function() {
8080
});
8181
}; // checkChunkSize
8282

83-
it("79.1 CLOB: chunkSize (read-only)", function(done) {
83+
it("81.1 CLOB: chunkSize (read-only)", function(done) {
8484
checkChunkSize(oracledb.CLOB, done);
8585
});
8686

87-
it("79.2 BLOB: chunkSize (read-only)", function(done) {
87+
it("81.2 BLOB: chunkSize (read-only)", function(done) {
8888
checkChunkSize(oracledb.BLOB, done);
8989
});
9090

@@ -110,11 +110,11 @@ describe("79. lobProperties2.js", function() {
110110
});
111111
}; // checkLength
112112

113-
it("79.3 CLOB: length (read-only)", function(done) {
113+
it("81.3 CLOB: length (read-only)", function(done) {
114114
checkLength(oracledb.CLOB, done);
115115
});
116116

117-
it("79.4 BLOB: length (read-only)", function(done) {
117+
it("81.4 BLOB: length (read-only)", function(done) {
118118
checkLength(oracledb.BLOB, done);
119119
});
120120

@@ -140,15 +140,15 @@ describe("79. lobProperties2.js", function() {
140140
});
141141
}; // checkType
142142

143-
it("79.5 CLOB: type (read-only)", function(done) {
143+
it("81.5 CLOB: type (read-only)", function(done) {
144144
checkType(oracledb.CLOB, done);
145145
});
146146

147-
it("79.6 BLOB: type (read-only)", function(done) {
147+
it("81.6 BLOB: type (read-only)", function(done) {
148148
checkType(oracledb.CLOB, done);
149149
});
150150

151-
describe("79.7 pieceSize", function() {
151+
describe("81.7 pieceSize", function() {
152152

153153
var defaultChunkSize;
154154
var clob, blob;
@@ -186,7 +186,7 @@ describe("79. lobProperties2.js", function() {
186186
], done);
187187
}); // after
188188

189-
it("79.7.1 default value is chunkSize", function(done) {
189+
it("81.7.1 default value is chunkSize", function(done) {
190190
var t1 = clob.pieceSize,
191191
t2 = blob.pieceSize;
192192

@@ -195,7 +195,7 @@ describe("79. lobProperties2.js", function() {
195195
done();
196196
});
197197

198-
it("79.7.2 can be increased", function(done) {
198+
it("81.7.2 can be increased", function(done) {
199199
var newValue = clob.pieceSize * 5;
200200

201201
clob.pieceSize = clob.pieceSize * 5;
@@ -210,7 +210,7 @@ describe("79. lobProperties2.js", function() {
210210
done();
211211
});
212212

213-
it("79.7.3 can be decreased", function(done) {
213+
it("81.7.3 can be decreased", function(done) {
214214
if (defaultChunkSize <= 500) {
215215
console.log('As default chunkSize is too small, this case is not applicable');
216216
} else {
@@ -228,7 +228,7 @@ describe("79. lobProperties2.js", function() {
228228
return done();
229229
});
230230

231-
it("79.7.4 can be zero", function(done) {
231+
it("81.7.4 can be zero", function(done) {
232232
clob.pieceSize = 0;
233233
blob.pieceSize = 0;
234234

@@ -242,7 +242,7 @@ describe("79. lobProperties2.js", function() {
242242
done();
243243
});
244244

245-
it("79.7.5 cannot be less than zero", function(done) {
245+
it("81.7.5 cannot be less than zero", function(done) {
246246
try {
247247
clob.pieceSize = -100;
248248
} catch(err) {
@@ -258,7 +258,7 @@ describe("79. lobProperties2.js", function() {
258258
done();
259259
});
260260

261-
it("79.7.6 cannot be null", function(done) {
261+
it("81.7.6 cannot be null", function(done) {
262262
try {
263263
clob.pieceSize = null;
264264
} catch(err) {
@@ -274,7 +274,7 @@ describe("79. lobProperties2.js", function() {
274274
done();
275275
});
276276

277-
it("79.7.7 must be a number", function(done) {
277+
it("81.7.7 must be a number", function(done) {
278278
try {
279279
clob.pieceSize = NaN;
280280
} catch(err) {
@@ -289,6 +289,6 @@ describe("79. lobProperties2.js", function() {
289289

290290
done();
291291
});
292-
}); // 79.7
292+
}); // 81.7
293293

294294
});

0 commit comments

Comments
 (0)