Skip to content

Commit 22beb7d

Browse files
committed
Improve version attribute tests
1 parent 70d4fcd commit 22beb7d

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

test/binding.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,7 @@ describe('4. binding.js', function() {
681681
{ o: { type: oracledb.STRING, dir : oracledb.BIND_OUT } },
682682
function (err, result) {
683683
should.exist(err);
684+
// ORA-06502: PL/SQL: numeric or value error
684685
err.message.should.startWith('ORA-06502:');
685686
// console.log(result.outBinds.o.length);
686687
done();

test/list.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,24 +455,26 @@
455455
58.1.5 maxRows
456456
58.1.6 prefetchRows
457457
58.1.7 autoCommit
458-
58.1.8 version
458+
58.1.8 version (read-only)
459459
58.1.9 connClass
460460
58.1.10 externalAuth
461461
58.1.11 fetchAsString
462462
58.1.12 outFormat
463463
58.1.13 lobPrefetchSize
464+
58.1.14 oracleClientVersion (read-only)
464465
58.2 pool properties
465466
58.2.1 poolMin
466467
58.2.2 poolMax
467468
58.2.3 poolIncrement
468469
58.2.4 poolTimeout
469470
58.2.5 stmtCacheSize
470471
58.3 connection properties
471-
58.3.1 Connection object intial toString values
472-
58.3.2 stmtCacheSize
473-
58.3.3 clientId
474-
58.3.4 action
475-
58.3.5 module
472+
58.3.1 Connection object initial toString values
473+
58.3.2 stmtCacheSize (read-only)
474+
58.3.3 clientId (write-only)
475+
58.3.4 action (write-only)
476+
58.3.5 module (write-only)
477+
58.3.6 oracleServerVersion (read-only)
476478

477479
59. lob.js
478480
59.1 CLOB data

test/properties.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ describe('58. properties.js', function() {
144144
(oracledb.autoCommit).should.eql( !defaultValues.autoCommit );
145145
})
146146

147-
it('58.1.8 version', function() {
147+
it('58.1.8 version (read-only)', function() {
148148
(oracledb.version).should.be.a.Number;
149149

150150
try {
@@ -193,8 +193,16 @@ describe('58. properties.js', function() {
193193
(oracledb.lobPrefetchSize).should.eql(defaultValues.lobPrefetchSize + 1);
194194
})
195195

196-
it('58.1.14 oracleClientVersion', function () {
197-
var t = oracledb.oracleClientVersion ;
196+
it('58.1.14 oracleClientVersion (read-only)', function () {
197+
var t = oracledb.oracleClientVersion ;
198+
t.should.be.a.Number;
199+
200+
try {
201+
oracledb.oracleClientVersion++;
202+
} catch(err) {
203+
should.exist(err);
204+
(err.message).should.startWith('NJS-014');
205+
}
198206
} );
199207

200208
}) // 58.1
@@ -299,7 +307,7 @@ describe('58. properties.js', function() {
299307
});
300308
})
301309

302-
it('58.3.1 Connection object intial toString values', function() {
310+
it('58.3.1 Connection object initial toString values', function() {
303311
connection.should.be.an.Object;
304312

305313
should.equal(connection.action, null);
@@ -310,7 +318,7 @@ describe('58. properties.js', function() {
310318
(connection.stmtCacheSize).should.be.greaterThan(0);
311319
})
312320

313-
it('58.3.2 stmtCacheSize', function() {
321+
it('58.3.2 stmtCacheSize (read-only)', function() {
314322
var t = connection.stmtCacheSize;
315323
t.should.be.a.Number;
316324

@@ -322,7 +330,7 @@ describe('58. properties.js', function() {
322330
}
323331
})
324332

325-
it('58.3.3 clientId', function() {
333+
it('58.3.3 clientId (write-only)', function() {
326334
try {
327335
var t = connection.clientId;
328336
} catch(err) {
@@ -340,7 +348,7 @@ describe('58. properties.js', function() {
340348
connection.clientId = "103.3";
341349
})
342350

343-
it('58.3.4 action', function() {
351+
it('58.3.4 action (write-only)', function() {
344352

345353
try {
346354
var t = connection.action;
@@ -359,7 +367,7 @@ describe('58. properties.js', function() {
359367
connection.action = "103.3 action";
360368
})
361369

362-
it('58.3.5 module', function() {
370+
it('58.3.5 module (write-only)', function() {
363371

364372
try {
365373
var t = connection.module;
@@ -378,12 +386,16 @@ describe('58. properties.js', function() {
378386
connection.module = "103.3 module";
379387
})
380388

381-
it ('58.3.6 oracleServerVersion', function () {
389+
it('58.3.6 oracleServerVersion (read-only)', function () {
390+
var t = connection.oracleServerVersion;
391+
t.should.be.a.Number;
392+
382393
try {
383-
var t = connection.oracleServerVersion;
394+
connection.oracleServerVersion++;
384395
}
385-
catch (err ) {
396+
catch (err) {
386397
should.exist ( err );
398+
(err.message).should.startWith('NJS-014');
387399
}
388400
});
389401

0 commit comments

Comments
 (0)