Skip to content

Commit 22dc387

Browse files
committed
Add test to hit NJS-028
1 parent eeb58e7 commit 22dc387

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

test/dataTypeRaw.js

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('42. dataTypeRaw.js', function() {
148148
})
149149
})
150150

151-
describe('42.3 DML Returning', function() {
151+
describe('42.3 DML Returning - Currently not support RAW', function() {
152152

153153
before('create table', function(done) {
154154
assist.createTable(connection, tableName, done);
@@ -176,12 +176,13 @@ describe('42. dataTypeRaw.js', function() {
176176
n : seq,
177177
c : { type: oracledb.BUFFER, val: bindValue, dir: oracledb.BIND_IN },
178178
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
179-
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 }
179+
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 }
180180
},
181181
{ autoCommit: true },
182182
function(err, result) {
183-
should.not.exist(err);
184-
// console.log(result);
183+
should.exist(err);
184+
(err.message).should.startWith('NJS-028');
185+
// NJS-028: raw database type is not supported with DML Returning statements
185186
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
186187
// (result.outBinds.rc[0].length).should.be.exactly(size);
187188
done();
@@ -200,11 +201,12 @@ describe('42. dataTypeRaw.js', function() {
200201
seq,
201202
{ type: oracledb.BUFFER, val: bindValue, dir: oracledb.BIND_IN },
202203
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
203-
{ type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 }
204+
{ type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 }
204205
],
205206
{ autoCommit: true },
206207
function(err, result) {
207-
should.not.exist(err);
208+
should.exist(err);
209+
(err.message).should.startWith('NJS-028');
208210
// console.log(result);
209211
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
210212
// (result.outBinds.rc[0].length).should.be.exactly(size);
@@ -224,11 +226,12 @@ describe('42. dataTypeRaw.js', function() {
224226
n : seq,
225227
c : { type: oracledb.BUFFER, val: bindValue, dir: oracledb.BIND_IN },
226228
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
227-
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: size * 2 } // should be size
229+
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: size * 2 } // should be size
228230
},
229231
{ autoCommit: true },
230232
function(err, result) {
231-
should.not.exist(err);
233+
should.exist(err);
234+
(err.message).should.startWith('NJS-028');
232235
// console.log(result);
233236
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
234237
// (result.outBinds.rc[0].length).should.be.exactly(size);
@@ -249,11 +252,12 @@ describe('42. dataTypeRaw.js', function() {
249252
n : seq,
250253
c : { type: oracledb.BUFFER, val: bindValue, dir: oracledb.BIND_IN },
251254
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
252-
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 }
255+
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 }
253256
},
254257
{ autoCommit: true },
255258
function(err, result) {
256-
should.not.exist(err);
259+
should.exist(err);
260+
(err.message).should.startWith('NJS-028');
257261
// console.log(result);
258262
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
259263
// (result.outBinds.rc[0].length).should.be.exactly(size);
@@ -271,11 +275,12 @@ describe('42. dataTypeRaw.js', function() {
271275
[
272276
seq,
273277
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
274-
{ type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 }
278+
{ type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 }
275279
],
276280
{ autoCommit: true },
277281
function(err, result) {
278-
should.not.exist(err);
282+
should.exist(err);
283+
(err.message).should.startWith('NJS-028');
279284
// console.log(result);
280285
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
281286
// (result.outBinds.rc[0].length).should.be.exactly(size);
@@ -293,11 +298,12 @@ describe('42. dataTypeRaw.js', function() {
293298
{
294299
n : seq,
295300
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT },
296-
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 }
301+
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 }
297302
},
298303
{ autoCommit: true },
299304
function(err, result) {
300-
should.not.exist(err);
305+
should.exist(err);
306+
(err.message).should.startWith('NJS-028');
301307
// console.log(result);
302308
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex'));
303309
// (result.outBinds.rc[0].length).should.be.exactly(size);
@@ -416,4 +422,4 @@ describe('42. dataTypeRaw.js', function() {
416422
})
417423
}) // 42.4
418424

419-
})
425+
})

0 commit comments

Comments
 (0)