From a62575394569805aafaafb4b79db2573c3deb52f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 16 Mar 2017 15:27:24 +1100 Subject: [PATCH] Change test description --- test/blobDMLBindAsBuffer.js | 87 ++++++++++++++++--------------------- test/clobDMLBindAsString.js | 57 +++++++++++------------- test/list.txt | 4 +- 3 files changed, 65 insertions(+), 83 deletions(-) diff --git a/test/blobDMLBindAsBuffer.js b/test/blobDMLBindAsBuffer.js index d78ee35f..0241a327 100644 --- a/test/blobDMLBindAsBuffer.js +++ b/test/blobDMLBindAsBuffer.js @@ -597,24 +597,20 @@ describe('80.blobDMLBindAsBuffer.js', function() { var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8"); var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, :c) RETURNING blob INTO :lobbv"; - async.series([ - function(cb) { - connection.execute( - sql, - { - i: id, - c: { val: content, type: oracledb.BUFFER, dir: oracledb.BIND_IN }, - lobbv: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: contentLength } - }, - function(err) { - should.exist(err); - // NJS-028: RAW database type is not supported with DML Returning statements - (err.message).should.startWith('NJS-028:'); - cb(); - } - ); + connection.execute( + sql, + { + i: id, + c: { val: content, type: oracledb.BUFFER, dir: oracledb.BIND_IN }, + lobbv: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: contentLength } + }, + function(err) { + should.exist(err); + // NJS-028: RAW database type is not supported with DML Returning statements + (err.message).should.startWith('NJS-028:'); + done(); } - ], done); + ); }); // 80.1.20 it('80.1.21 Negative: RETURNING INTO with autocommit on', function(done) { @@ -622,43 +618,36 @@ describe('80.blobDMLBindAsBuffer.js', function() { var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, EMPTY_BLOB()) RETURNING blob INTO :lobbv"; var inFileName = './test/tree.jpg'; - async.series([ - function(cb) { - connection.execute( - sql, - { - i: id, - lobbv: { type: oracledb.BLOB, dir: oracledb.BIND_OUT } - }, - { autoCommit: true }, - function(err, result) { - should.not.exist(err); - var inStream = fs.createReadStream(inFileName); - var lob = result.outBinds.lobbv[0]; + connection.execute( + sql, + { + i: id, + lobbv: { type: oracledb.BLOB, dir: oracledb.BIND_OUT } + }, + { autoCommit: true }, + function(err, result) { + should.not.exist(err); + var inStream = fs.createReadStream(inFileName); + var lob = result.outBinds.lobbv[0]; - lob.on('error', function(err) { - should.exist(err); - // ORA-22990: LOB locators cannot span transactions - (err.message).should.startWith('ORA-22990:'); - }); + lob.on('error', function(err) { + should.exist(err); + // ORA-22990: LOB locators cannot span transactions + (err.message).should.startWith('ORA-22990:'); + }); - inStream.on('error', function(err) { - should.not.exist(err, "inStream.on 'error' event"); - }); + inStream.on('error', function(err) { + should.not.exist(err, "inStream.on 'error' event"); + }); - lob.on('close', function(err) { - should.not.exist(err); - connection.commit( function(err) { - should.not.exist(err); - return cb(); - }); - }); + lob.on('close', function(err) { + should.not.exist(err); + done(); + }); - inStream.pipe(lob); // copies the text to the CLOB - } - ); + inStream.pipe(lob); // copies the text to the CLOB } - ], done); + ); }); // 80.1.21 it('80.1.22 works with bind in maxSize smaller than buffer size', function(done) { diff --git a/test/clobDMLBindAsString.js b/test/clobDMLBindAsString.js index 080a139c..19a912b9 100644 --- a/test/clobDMLBindAsString.js +++ b/test/clobDMLBindAsString.js @@ -611,43 +611,36 @@ describe('79.clobDMLBindAsString.js', function() { var sql = "INSERT INTO nodb_dml_clob_1 (id, clob) VALUES (:i, EMPTY_CLOB()) RETURNING clob INTO :lobbv"; var inFileName = './test/clobexample.txt'; - async.series([ - function(cb) { - connection.execute( - sql, - { - i: id, - lobbv: { type: oracledb.CLOB, dir: oracledb.BIND_OUT } - }, - { autoCommit: true }, - function(err, result) { - should.not.exist(err); - var inStream = fs.createReadStream(inFileName); - var lob = result.outBinds.lobbv[0]; + connection.execute( + sql, + { + i: id, + lobbv: { type: oracledb.CLOB, dir: oracledb.BIND_OUT } + }, + { autoCommit: true }, + function(err, result) { + should.not.exist(err); + var inStream = fs.createReadStream(inFileName); + var lob = result.outBinds.lobbv[0]; - lob.on('error', function(err) { - should.exist(err); - // ORA-22990: LOB locators cannot span transactions - (err.message).should.startWith('ORA-22990:'); - }); + lob.on('error', function(err) { + should.exist(err); + // ORA-22990: LOB locators cannot span transactions + (err.message).should.startWith('ORA-22990:'); + }); - inStream.on('error', function(err) { - should.not.exist(err, "inStream.on 'error' event"); - }); + inStream.on('error', function(err) { + should.not.exist(err, "inStream.on 'error' event"); + }); - lob.on('close', function(err) { - should.not.exist(err); - connection.commit( function(err) { - should.not.exist(err); - return cb(); - }); - }); + lob.on('close', function(err) { + should.not.exist(err); + done(); + }); - inStream.pipe(lob); // copies the text to the CLOB - } - ); + inStream.pipe(lob); // copies the text to the CLOB } - ], done); + ); }); // 79.1.21 it('79.1.22 works with bind in maxSize smaller than string length', function(done) { diff --git a/test/list.txt b/test/list.txt index 1c3c9883..16a0e519 100644 --- a/test/list.txt +++ b/test/list.txt @@ -1362,8 +1362,8 @@ Overview of node-oracledb functional tests 82.1.17 works with setting oracledb.maxRows > actual number of rows in the table 82.1.18 override oracledb.fetchAsString with fetchInfo set to oracledb.DEFAULT 82.1.19 works with connection.queryStream() - 82.1.20 works with connection.queryStream() and oracledb.maxRows > actual number of rows in the table (506ms) - 82.1.21 works with connection.queryStream() and oracledb.maxRows = actual number of rows in the table (506ms) + 82.1.20 works with connection.queryStream() and oracledb.maxRows > actual number of rows in the table + 82.1.21 works with connection.queryStream() and oracledb.maxRows = actual number of rows in the table - 82.1.22 works with connection.queryStream() and oracledb.maxRows < actual number of rows in the table 82.2 fetch CLOB columns by setting oracledb.fetchAsString and outFormat = oracledb.OBJECT 82.2.1 works with NULL value