Skip to content

Commit 8d867b1

Browse files
committed
Add tests for properties of LOB and resultSet
1 parent dae7b2b commit 8d867b1

File tree

3 files changed

+464
-21
lines changed

3 files changed

+464
-21
lines changed

test/checkClassesTypes.js

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
2+
3+
/******************************************************************************
4+
*
5+
* You may not use the identified files except in compliance with the Apache
6+
* License, Version 2.0 (the "License.")
7+
*
8+
* You may obtain a copy of the License at
9+
* http://www.apache.org/licenses/LICENSE-2.0.
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
*
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* The node-oracledb test suite uses 'mocha', 'should' and 'async'.
19+
* See LICENSE.md for relevant licenses.
20+
*
21+
* NAME
22+
* 61. checkClassesTypes.js
23+
*
24+
* DESCRIPTION
25+
*
26+
* Check the types of all the classes we defined.
27+
*
28+
* NUMBERING RULE
29+
* Test numbers follow this numbering rule:
30+
* 1 - 20 are reserved for basic functional tests
31+
* 21 - 50 are reserved for data type supporting tests
32+
* 51 onwards are for other tests
33+
*
34+
*****************************************************************************/
35+
'use strict';
36+
37+
var oracledb = require('oracledb');
38+
var should = require('should');
39+
var async = require('async');
40+
var dbConfig = require('./dbConfig.js');
41+
42+
describe('61. checkClassesTypes.js', function() {
43+
44+
if(dbConfig.externalAuth){
45+
var credential = { externalAuth: true, connectString: dbConfig.connectString };
46+
} else {
47+
var credential = dbConfig;
48+
}
49+
50+
it('61.1 Oracledb class', function() {
51+
var type = Object.prototype.toString.call(oracledb);
52+
type.should.eql('[object Oracledb]');
53+
})
54+
55+
it('61.2 Connection class', function(done) {
56+
async.waterfall(
57+
[
58+
function(callback)
59+
{
60+
oracledb.getConnection(credential, callback);
61+
},
62+
function(connection, callback)
63+
{
64+
var type = Object.prototype.toString.call(connection);
65+
type.should.eql('[object Connection]');
66+
callback(null, connection);
67+
},
68+
function(connection, callback)
69+
{
70+
connection.release( callback );
71+
}
72+
],
73+
function(err)
74+
{
75+
should.not.exist(err);
76+
done();
77+
}
78+
);
79+
})
80+
})
81+

test/list.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@
461461
57.2 testing nested cursor support - REF Cursor
462462

463463
58. properties.js
464-
58.1 oracledb properties
464+
58.1 Oracledb Class
465465
58.1.1 poolMin
466466
58.1.2 poolMax
467467
58.1.3 poolIncrement
@@ -476,19 +476,30 @@
476476
58.1.12 outFormat
477477
58.1.13 lobPrefetchSize
478478
58.1.14 oracleClientVersion (read-only)
479-
58.2 pool properties
479+
58.2 Pool Class
480480
58.2.1 poolMin
481481
58.2.2 poolMax
482482
58.2.3 poolIncrement
483483
58.2.4 poolTimeout
484484
58.2.5 stmtCacheSize
485-
58.3 connection properties
485+
58.3 Connection Class
486486
58.3.1 Connection object initial toString values
487487
58.3.2 stmtCacheSize (read-only)
488488
58.3.3 clientId (write-only)
489489
58.3.4 action (write-only)
490490
58.3.5 module (write-only)
491491
58.3.6 oracleServerVersion (read-only)
492+
58.4 Lob Class
493+
58.4.1 chunkSize (read-only)
494+
58.4.2 length (read-only)
495+
58.4.3 pieceSize - default value is chunkSize
496+
58.4.4 pieceSize - can be increased
497+
58.4.5 pieceSize - can be decreased
498+
58.4.6 pieceSize - can be zero
499+
58.4.6 pieceSize - cannot be less than zero
500+
58.4.7 type (read-only)
501+
58.5 ResultSet Class
502+
58.5.1 metaData (read-only)
492503

493504
59. lobResultSet.js
494505
59.1 CLOB data
@@ -497,3 +508,5 @@
497508
60. clobPlsqlString.js
498509
60.1 PL/SQL OUT CLOB parameters can also be bound as STRING
499510
60.2 The returned length is limited to the maximum size
511+
512+
61.

0 commit comments

Comments
 (0)