Skip to content

Commit fb18575

Browse files
committed
Test updates
1 parent 679df54 commit fb18575

File tree

5 files changed

+369
-5
lines changed

5 files changed

+369
-5
lines changed

test/list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ Overview of node-oracledb functional tests
770770
61.4 Pool Class
771771
61.5 ResultSet Class
772772

773-
62. lobProperties.js
773+
62. lobProperties1.js
774774
62.1 chunkSize (read-only)
775775
62.2 length (read-only)
776776
62.3 pieceSize -default value is chunkSize

test/lobBind2.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,75 @@ describe("72. lobBind2.js", function() {
424424

425425
}); // 72.1.6
426426

427+
it("72.1.7 Negative - BIND_INOUT, PL/SQL", function(done) {
428+
429+
var seq = 7;
430+
var outStr = "This is a out bind string.";
431+
var proc = "CREATE OR REPLACE PROCEDURE nodb_proc_clob_inout1 \n" +
432+
" (p_num IN NUMBER, p_inout IN OUT CLOB) \n" +
433+
"AS \n" +
434+
"BEGIN \n" +
435+
" insert into nodb_tab_clob72 (id, content) values (p_num, p_inout); \n" +
436+
" select to_clob('" + outStr + "') into p_inout from dual; \n" +
437+
"END nodb_proc_clob_inout1;";
438+
439+
async.series([
440+
function(cb) {
441+
executeSQL(proc, cb);
442+
},
443+
function(cb) {
444+
connection.createLob(oracledb.CLOB, function(err, lob) {
445+
should.not.exist(err);
446+
447+
lob.on("close", function(err) {
448+
should.not.exist(err);
449+
450+
connection.commit(function(err) {
451+
should.not.exist(err);
452+
453+
return cb();
454+
});
455+
}); // close event
456+
457+
lob.on("error", function(err) {
458+
should.not.exist(err, "lob.on 'error' event.");
459+
});
460+
461+
lob.on("finish", function() {
462+
connection.execute(
463+
"begin nodb_proc_clob_inout1(:id, :io); end;",
464+
{
465+
id: seq,
466+
io: { type: oracledb.CLOB, dir: oracledb.BIND_INOUT, val: lob}
467+
},
468+
function(err) {
469+
should.exist(err);
470+
(err.message).should.startWith("NJS-049:");
471+
// NJS-049: cannot use bind direction IN OUT for temporary LOBs
472+
lob.close(function(err) {
473+
should.not.exist(err);
474+
});
475+
}
476+
);
477+
}); // finish event
478+
479+
var inStream = fs.createReadStream(inFileName);
480+
481+
inStream.on("error", function(err) {
482+
should.not.exist(err, "inStream.on 'error' event.");
483+
});
484+
485+
inStream.pipe(lob);
486+
});
487+
488+
},
489+
function(cb) {
490+
var sql = "DROP PROCEDURE nodb_proc_clob_inout1";
491+
executeSQL(sql, cb);
492+
}
493+
], done);
494+
}); // 72.1.7
495+
427496
}); // 72.1
428497

429498
describe("72.2 BLOB", function() {

test/lobProperties.js renamed to test/lobProperties1.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* See LICENSE.md for relevant licenses.
2020
*
2121
* NAME
22-
* 62. lobProperties.js
22+
* 62. lobProperties1.js
2323
*
2424
* DESCRIPTION
2525
* Testing getters and setters for LOB class.
@@ -40,9 +40,9 @@ var should = require('should');
4040
var async = require('async');
4141
var dbConfig = require('./dbconfig.js');
4242

43-
describe('62. lobProperties.js', function() {
43+
describe('62. lobProperties1.js', function() {
4444

45-
var tableName = "nodb_mylobprops";
45+
var tableName = "nodb_tab_mylobprops";
4646
var connection = null;
4747
var sqlSelect = "SELECT * FROM " + tableName + " WHERE id = :i";
4848
var defaultChunkSize = null;

0 commit comments

Comments
 (0)