Skip to content

Commit a625753

Browse files
committed
Change test description
1 parent b80081f commit a625753

File tree

3 files changed

+73
-91
lines changed

3 files changed

+73
-91
lines changed

test/blobDMLBindAsBuffer.js

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -597,68 +597,57 @@ describe('80.blobDMLBindAsBuffer.js', function() {
597597
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
598598
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, :c) RETURNING blob INTO :lobbv";
599599

600-
async.series([
601-
function(cb) {
602-
connection.execute(
603-
sql,
604-
{
605-
i: id,
606-
c: { val: content, type: oracledb.BUFFER, dir: oracledb.BIND_IN },
607-
lobbv: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: contentLength }
608-
},
609-
function(err) {
610-
should.exist(err);
611-
// NJS-028: RAW database type is not supported with DML Returning statements
612-
(err.message).should.startWith('NJS-028:');
613-
cb();
614-
}
615-
);
600+
connection.execute(
601+
sql,
602+
{
603+
i: id,
604+
c: { val: content, type: oracledb.BUFFER, dir: oracledb.BIND_IN },
605+
lobbv: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: contentLength }
606+
},
607+
function(err) {
608+
should.exist(err);
609+
// NJS-028: RAW database type is not supported with DML Returning statements
610+
(err.message).should.startWith('NJS-028:');
611+
done();
616612
}
617-
], done);
613+
);
618614
}); // 80.1.20
619615

620616
it('80.1.21 Negative: RETURNING INTO with autocommit on', function(done) {
621617
var id = getID();
622618
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, EMPTY_BLOB()) RETURNING blob INTO :lobbv";
623619
var inFileName = './test/tree.jpg';
624620

625-
async.series([
626-
function(cb) {
627-
connection.execute(
628-
sql,
629-
{
630-
i: id,
631-
lobbv: { type: oracledb.BLOB, dir: oracledb.BIND_OUT }
632-
},
633-
{ autoCommit: true },
634-
function(err, result) {
635-
should.not.exist(err);
636-
var inStream = fs.createReadStream(inFileName);
637-
var lob = result.outBinds.lobbv[0];
638-
639-
lob.on('error', function(err) {
640-
should.exist(err);
641-
// ORA-22990: LOB locators cannot span transactions
642-
(err.message).should.startWith('ORA-22990:');
643-
});
644-
645-
inStream.on('error', function(err) {
646-
should.not.exist(err, "inStream.on 'error' event");
647-
});
648-
649-
lob.on('close', function(err) {
650-
should.not.exist(err);
651-
connection.commit( function(err) {
652-
should.not.exist(err);
653-
return cb();
654-
});
655-
});
656-
657-
inStream.pipe(lob); // copies the text to the CLOB
658-
}
659-
);
621+
connection.execute(
622+
sql,
623+
{
624+
i: id,
625+
lobbv: { type: oracledb.BLOB, dir: oracledb.BIND_OUT }
626+
},
627+
{ autoCommit: true },
628+
function(err, result) {
629+
should.not.exist(err);
630+
var inStream = fs.createReadStream(inFileName);
631+
var lob = result.outBinds.lobbv[0];
632+
633+
lob.on('error', function(err) {
634+
should.exist(err);
635+
// ORA-22990: LOB locators cannot span transactions
636+
(err.message).should.startWith('ORA-22990:');
637+
});
638+
639+
inStream.on('error', function(err) {
640+
should.not.exist(err, "inStream.on 'error' event");
641+
});
642+
643+
lob.on('close', function(err) {
644+
should.not.exist(err);
645+
done();
646+
});
647+
648+
inStream.pipe(lob); // copies the text to the CLOB
660649
}
661-
], done);
650+
);
662651
}); // 80.1.21
663652

664653
it('80.1.22 works with bind in maxSize smaller than buffer size', function(done) {

test/clobDMLBindAsString.js

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -611,43 +611,36 @@ describe('79.clobDMLBindAsString.js', function() {
611611
var sql = "INSERT INTO nodb_dml_clob_1 (id, clob) VALUES (:i, EMPTY_CLOB()) RETURNING clob INTO :lobbv";
612612
var inFileName = './test/clobexample.txt';
613613

614-
async.series([
615-
function(cb) {
616-
connection.execute(
617-
sql,
618-
{
619-
i: id,
620-
lobbv: { type: oracledb.CLOB, dir: oracledb.BIND_OUT }
621-
},
622-
{ autoCommit: true },
623-
function(err, result) {
624-
should.not.exist(err);
625-
var inStream = fs.createReadStream(inFileName);
626-
var lob = result.outBinds.lobbv[0];
627-
628-
lob.on('error', function(err) {
629-
should.exist(err);
630-
// ORA-22990: LOB locators cannot span transactions
631-
(err.message).should.startWith('ORA-22990:');
632-
});
633-
634-
inStream.on('error', function(err) {
635-
should.not.exist(err, "inStream.on 'error' event");
636-
});
637-
638-
lob.on('close', function(err) {
639-
should.not.exist(err);
640-
connection.commit( function(err) {
641-
should.not.exist(err);
642-
return cb();
643-
});
644-
});
645-
646-
inStream.pipe(lob); // copies the text to the CLOB
647-
}
648-
);
614+
connection.execute(
615+
sql,
616+
{
617+
i: id,
618+
lobbv: { type: oracledb.CLOB, dir: oracledb.BIND_OUT }
619+
},
620+
{ autoCommit: true },
621+
function(err, result) {
622+
should.not.exist(err);
623+
var inStream = fs.createReadStream(inFileName);
624+
var lob = result.outBinds.lobbv[0];
625+
626+
lob.on('error', function(err) {
627+
should.exist(err);
628+
// ORA-22990: LOB locators cannot span transactions
629+
(err.message).should.startWith('ORA-22990:');
630+
});
631+
632+
inStream.on('error', function(err) {
633+
should.not.exist(err, "inStream.on 'error' event");
634+
});
635+
636+
lob.on('close', function(err) {
637+
should.not.exist(err);
638+
done();
639+
});
640+
641+
inStream.pipe(lob); // copies the text to the CLOB
649642
}
650-
], done);
643+
);
651644
}); // 79.1.21
652645

653646
it('79.1.22 works with bind in maxSize smaller than string length', function(done) {

test/list.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,8 @@ Overview of node-oracledb functional tests
13621362
82.1.17 works with setting oracledb.maxRows > actual number of rows in the table
13631363
82.1.18 override oracledb.fetchAsString with fetchInfo set to oracledb.DEFAULT
13641364
82.1.19 works with connection.queryStream()
1365-
82.1.20 works with connection.queryStream() and oracledb.maxRows > actual number of rows in the table (506ms)
1366-
82.1.21 works with connection.queryStream() and oracledb.maxRows = actual number of rows in the table (506ms)
1365+
82.1.20 works with connection.queryStream() and oracledb.maxRows > actual number of rows in the table
1366+
82.1.21 works with connection.queryStream() and oracledb.maxRows = actual number of rows in the table
13671367
- 82.1.22 works with connection.queryStream() and oracledb.maxRows < actual number of rows in the table
13681368
82.2 fetch CLOB columns by setting oracledb.fetchAsString and outFormat = oracledb.OBJECT
13691369
82.2.1 works with NULL value

0 commit comments

Comments
 (0)