Skip to content

Commit 936ddb8

Browse files
committed
Tidy tests. Exclude non portable test
1 parent 1236f4b commit 936ddb8

File tree

4 files changed

+19
-145
lines changed

4 files changed

+19
-145
lines changed

test/list.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,13 +1075,16 @@ Overview of node-oracledb functional tests
10751075
72.1.2 BIND_IN, PL/SQL, a txt file
10761076
72.1.3 Negative - invalid type
10771077
72.1.4 Negative - invalid value
1078-
72.1.5 Negative - inconsistent datatypes
1079-
72.1.6 DML - UPDATE statement
1078+
72.1.5 DML - UPDATE statement
1079+
72.1.6 promise test of createLob()
10801080
72.2 BLOB
10811081
72.2.1 BIND_IN, DML, a jpg file
10821082
72.2.2 BIND_IN, PL/SQL, a jpg file
10831083
72.2.3 Negative - inconsistent datatypes
10841084
72.2.4 Negative - not providing first parameter
1085+
72.2.5 promise test of createLob()
1086+
72.2.6 Negative - call lob.close() twice
1087+
72.2.7 Negative - call lob.close() after closing lob
10851088

10861089
73. poolPing.js
10871090
73.1 the default value of poolPingInterval is 60

test/lobBind1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ describe('71. lobBind1.js', function() {
583583

584584
var seq = 7;
585585
var inStr = "I love the sunshine today!",
586-
outStr = "A new day has come.";
586+
outStr = "A new day has come.";
587587

588588
var proc = "CREATE OR REPLACE PROCEDURE nodb_proc_clob_inout1 \n" +
589589
" (p_num IN NUMBER, p_inout IN OUT CLOB) \n" +
@@ -1346,7 +1346,7 @@ describe('71. lobBind1.js', function() {
13461346
outBufID = 70;
13471347

13481348
var inBuf = assist.createBuffer(10),
1349-
outBuf = assist.createBuffer(100);
1349+
outBuf = assist.createBuffer(100);
13501350

13511351
var proc = "CREATE OR REPLACE PROCEDURE nodb_proc_blob_inout1 \n" +
13521352
" (p_in IN NUMBER, p_outbufid IN NUMBER, p_inout IN OUT BLOB) \n" +

test/lobBind2.js

Lines changed: 11 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -298,62 +298,10 @@ describe("72. lobBind2.js", function() {
298298

299299
}); // 72.1.4
300300

301-
it("72.1.5 Negative - inconsistent datatypes", function(done) {
302301

303-
var seq = 5;
304-
305-
async.series([
306-
function(cb) {
307-
connection.createLob(oracledb.BLOB, function(err, lob) {
308-
should.not.exist(err);
309-
310-
lob.on("close", function(err) {
311-
should.not.exist(err);
312-
313-
connection.commit(function(err) {
314-
should.not.exist(err);
315-
316-
return cb();
317-
});
318-
}); // close event
319-
320-
lob.on("error", function(err) {
321-
should.not.exist(err, "lob.on 'error' event.");
322-
});
323-
324-
lob.on("finish", function() {
325-
connection.execute(
326-
"insert into nodb_tab_clob72 (id, content) values (:id, :bindvar)",
327-
{ id: seq, bindvar: lob},
328-
function(err) {
329-
should.exist(err);
330-
(err.message).should.startWith("ORA-00932:");
331-
// ORA-00932: inconsistent datatypes: expected CLOB got BLOB
332-
333-
lob.close(function(err) {
334-
should.not.exist(err);
335-
});
336-
}
337-
);
338-
}); // finish event
339-
340-
var inStream = fs.createReadStream(inFileName);
302+
it("72.1.5 DML - UPDATE statement", function(done) {
341303

342-
inStream.on("error", function(err) {
343-
should.not.exist(err, "inStream.on 'error' event.");
344-
});
345-
346-
inStream.pipe(lob);
347-
348-
}); // createLob()
349-
}
350-
], done);
351-
352-
}); // 72.1.5
353-
354-
it("72.1.6 DML - UPDATE statement", function(done) {
355-
356-
var seq = 6;
304+
var seq = 5;
357305

358306
async.series([
359307
function(cb) {
@@ -419,11 +367,11 @@ describe("72. lobBind2.js", function() {
419367
}
420368
], done);
421369

422-
}); // 72.1.6
370+
}); // 72.1.5
423371

424-
it("72.1.7 promise test of createLob()", function(done) {
372+
it("72.1.6 promise test of createLob()", function(done) {
425373

426-
var seq = 7;
374+
var seq = 6;
427375

428376
if (oracledb.Promise) {
429377
connection.createLob(oracledb.CLOB)
@@ -474,7 +422,7 @@ describe("72. lobBind2.js", function() {
474422
return done();
475423
}
476424

477-
}); // 72.1.7
425+
}); // 72.1.6
478426

479427
}); // 72.1
480428

@@ -805,85 +753,9 @@ describe("72. lobBind2.js", function() {
805753

806754
}); // 72.2.5
807755

808-
it("72.2.6 Negative - createLob() without lob.close()", function(done) {
756+
it.skip("72.2.6 Negative - call lob.close() twice", function(done) {
809757

810758
var seq = 6000;
811-
var connHandler, lobHandler;
812-
813-
async.series([
814-
function(cb) {
815-
oracledb.getConnection(
816-
dbConfig,
817-
function(err, conn) {
818-
should.not.exist(err);
819-
connHandler = conn;
820-
821-
cb();
822-
}
823-
);
824-
},
825-
function(cb) {
826-
connHandler.createLob(oracledb.BLOB, function(err, lob) {
827-
should.not.exist(err);
828-
829-
lobHandler = lob;
830-
831-
lob.on("error", function(err) {
832-
should.not.exist(err, "lob.on 'error' event.");
833-
});
834-
835-
lob.on("finish", function() {
836-
connHandler.execute(
837-
"insert into nodb_tab_blob72 (id, content) values (:id, :bindvar)",
838-
{ id: seq, bindvar: lob },
839-
function(err) {
840-
should.not.exist(err);
841-
842-
cb()
843-
}
844-
); // execute()
845-
}); // finish event
846-
847-
var inStream = fs.createReadStream(jpgFileName);
848-
inStream.on("error", function(err) {
849-
should.not.exist(err, "inStream.on 'error' event.");
850-
});
851-
852-
inStream.pipe(lob);
853-
854-
});
855-
},
856-
function(cb) {
857-
connHandler.close(function(err) {
858-
should.exist(err);
859-
(err.message).should.startWith('NJS-050:');
860-
// NJS-050: cannot release connection with active temporary LOBs created by createLob()
861-
cb();
862-
});
863-
},
864-
function(cb) {
865-
lobHandler.close(function(err) {
866-
should.not.exist(err);
867-
868-
});
869-
870-
lobHandler.on("close", function(err) {
871-
should.not.exist(err);
872-
873-
connHandler.commit(function(err) {
874-
should.not.exist(err);
875-
876-
return cb();
877-
});
878-
}); // close event
879-
}
880-
], done);
881-
882-
}); // 72.2.6
883-
884-
it.skip("72.2.7 Negative - call lob.close() twice", function(done) {
885-
886-
var seq = 7000;
887759

888760
async.series([
889761
function(cb) {
@@ -939,11 +811,11 @@ describe("72. lobBind2.js", function() {
939811
}
940812
], done);
941813

942-
}); // 72.2.7
814+
}); // 72.2.6
943815

944-
it.skip("72.2.8 Negative - call lob.close() after closing lob", function(done) {
816+
it.skip("72.2.7 Negative - call lob.close() after closing lob", function(done) {
945817

946-
var seq = 8000;
818+
var seq = 7000;
947819

948820
async.series([
949821
function(cb) {
@@ -999,7 +871,7 @@ describe("72. lobBind2.js", function() {
999871
}
1000872
], done);
1001873

1002-
}); // 72.2.8
874+
}); // 72.2.7
1003875

1004876
}); // 72.2
1005877

test/lobBindAsStringBuffer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ describe('74.lobBindAsStringBuffer.js', function() {
16671667
var bigStr_1 = getRandomString(size_1, specialStr);
16681668
var bigStr_2 = getRandomString(size_2, specialStr);
16691669
var bufferStr_1 = node6plus ? Buffer.from(bigStr_1, "utf-8") : new Buffer(bigStr_1, "utf-8");
1670-
var bufferStr_2 = node6plus ? Buffer.from(bigStr_2, "utf-8") : new Buffer(bigStr_2, "utf-8");;
1670+
var bufferStr_2 = node6plus ? Buffer.from(bigStr_2, "utf-8") : new Buffer(bigStr_2, "utf-8");
16711671
var sequence = 100;
16721672
var bindVar = {
16731673
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
@@ -1799,7 +1799,6 @@ describe('74.lobBindAsStringBuffer.js', function() {
17991799
var specialStr = "74.10.2";
18001800
var size_1 = 32768;
18011801
var sequence = 101;
1802-
var size_1 = 32768;
18031802
var bindVar = {
18041803
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
18051804
b1: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: size_1 },

0 commit comments

Comments
 (0)