Skip to content

Commit 8db863f

Browse files
committed
Sync tests and fix missed merges
1 parent db600cb commit 8db863f

34 files changed

+35330
-0
lines changed

test/blobDMLBindAsBuffer.js

Lines changed: 755 additions & 0 deletions
Large diffs are not rendered by default.

test/blobPlsqlBindAsBuffer_bindin.js

Lines changed: 1479 additions & 0 deletions
Large diffs are not rendered by default.

test/blobPlsqlBindAsBuffer_bindinout.js

Lines changed: 1318 additions & 0 deletions
Large diffs are not rendered by default.

test/blobPlsqlBindAsBuffer_bindout.js

Lines changed: 1610 additions & 0 deletions
Large diffs are not rendered by default.

test/clobDMLBindAsString.js

Lines changed: 742 additions & 0 deletions
Large diffs are not rendered by default.

test/clobPlsqlBindAsString_bindin.js

Lines changed: 1594 additions & 0 deletions
Large diffs are not rendered by default.

test/clobPlsqlBindAsString_bindinout.js

Lines changed: 1337 additions & 0 deletions
Large diffs are not rendered by default.

test/clobPlsqlBindAsString_bindout.js

Lines changed: 1570 additions & 0 deletions
Large diffs are not rendered by default.

test/constants.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* Copyright (c) 2016, 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+
* 18. constants.js
23+
*
24+
* DESCRIPTION
25+
* Check the mapping between names and numbers of oracledb constants.
26+
*
27+
* NUMBERING RULE
28+
* Test numbers follow this numbering rule:
29+
* 1 - 20 are reserved for basic functional tests
30+
* 21 - 50 are reserved for data type supporting tests
31+
* 51 onwards are for other tests
32+
*
33+
*****************************************************************************/
34+
'use strict';
35+
36+
var oracledb = require('oracledb');
37+
var should = require('should');
38+
39+
describe('18. constants.js', function() {
40+
41+
it('18.1 dbTypes maps correctly between names and numbers', function() {
42+
43+
should.exist(oracledb);
44+
(oracledb.DB_TYPE_VARCHAR).should.be.exactly(1);
45+
(oracledb.DB_TYPE_NUMBER).should.be.exactly(2);
46+
(oracledb.DB_TYPE_DATE).should.be.exactly(12);
47+
(oracledb.DB_TYPE_RAW).should.be.exactly(23);
48+
(oracledb.DB_TYPE_CHAR).should.be.exactly(96);
49+
(oracledb.DB_TYPE_BINARY_FLOAT).should.be.exactly(100);
50+
(oracledb.DB_TYPE_BINARY_DOUBLE).should.be.exactly(101);
51+
(oracledb.DB_TYPE_ROWID).should.be.exactly(104);
52+
(oracledb.DB_TYPE_CLOB).should.be.exactly(112);
53+
(oracledb.DB_TYPE_BLOB).should.be.exactly(113);
54+
(oracledb.DB_TYPE_TIMESTAMP).should.be.exactly(187);
55+
(oracledb.DB_TYPE_TIMESTAMP_TZ).should.be.exactly(188);
56+
(oracledb.DB_TYPE_TIMESTAMP_LTZ).should.be.exactly(232);
57+
58+
});
59+
60+
it('18.2 jsTypes maps correctly', function() {
61+
62+
(oracledb.DEFAULT).should.be.exactly(0);
63+
(oracledb.STRING).should.be.exactly(2001);
64+
(oracledb.NUMBER).should.be.exactly(2002);
65+
(oracledb.DATE).should.be.exactly(2003);
66+
(oracledb.CURSOR).should.be.exactly(2004);
67+
(oracledb.BUFFER).should.be.exactly(2005);
68+
(oracledb.CLOB).should.be.exactly(2006);
69+
(oracledb.BLOB).should.be.exactly(2007);
70+
71+
});
72+
73+
it('18.3 binding contants maps correctly', function() {
74+
75+
(oracledb.BIND_IN).should.be.exactly(3001);
76+
(oracledb.BIND_INOUT).should.be.exactly(3002);
77+
(oracledb.BIND_OUT).should.be.exactly(3003);
78+
(oracledb.ARRAY).should.be.exactly(4001);
79+
(oracledb.OBJECT).should.be.exactly(4002);
80+
81+
});
82+
83+
});

test/devnull.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* Copyright (c) 2016, 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+
* devnull.js
23+
*
24+
* DESCRIPTION
25+
* /dev/null for Node streams
26+
*
27+
*****************************************************************************/
28+
'use strict';
29+
30+
var stream = require('stream');
31+
var util = require('util');
32+
33+
module.exports = DevNull;
34+
35+
// step 2 - to call the Writable constructor in our own constructor
36+
function DevNull(opts) {
37+
if ( !(this instanceof DevNull) ) return new DevNull(opts);
38+
39+
opts = opts || {};
40+
stream.Writable.call(this, opts);
41+
42+
}
43+
44+
// step 1 - to extend the Writable Class
45+
util.inherits(DevNull, stream.Writable);
46+
47+
// step 3 -define a '_write()' method in the prototype of our stream object
48+
DevNull.prototype._write = function(chunk, encoding, cb) {
49+
setImmediate(cb);
50+
};

0 commit comments

Comments
 (0)