|
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 |
| - it('61.3 Lob Class', function(done) { |
82 |
| - var connection = null, |
83 |
| - clob = null, |
84 |
| - blob = null; |
85 |
| - |
86 |
| - var clobTableName = "oracledb_myclobs"; |
87 |
| - var blobTableName = "oracledb_myblobs"; |
88 |
| - |
89 |
| - async.series([ |
90 |
| - function(callback) { |
91 |
| - oracledb.getConnection(credential, function(err, conn) { |
92 |
| - should.not.exist(err); |
93 |
| - connection = conn; |
94 |
| - callback(); |
95 |
| - }); |
96 |
| - }, |
97 |
| - function(callback) { |
98 |
| - callback(); |
99 |
| - }, |
100 |
| - function(callback) { |
101 |
| - connection.release( function(err) { |
102 |
| - should.not.exist(err); |
103 |
| - callback(); |
104 |
| - }); |
105 |
| - } |
106 |
| - ], done); |
107 |
| - }) |
108 |
| -}) |
109 |
| -
|
| 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 | + it('61.3 Lob Class', function(done) { |
| 82 | + var connection = null, |
| 83 | + clob = null, |
| 84 | + blob = null; |
| 85 | + |
| 86 | + var clobTableName = "oracledb_myclobs"; |
| 87 | + var blobTableName = "oracledb_myblobs"; |
| 88 | + |
| 89 | + async.series([ |
| 90 | + function(callback) { |
| 91 | + oracledb.getConnection(credential, function(err, conn) { |
| 92 | + should.not.exist(err); |
| 93 | + connection = conn; |
| 94 | + callback(); |
| 95 | + }); |
| 96 | + }, |
| 97 | + function(callback) { |
| 98 | + callback(); |
| 99 | + }, |
| 100 | + function(callback) { |
| 101 | + connection.release( function(err) { |
| 102 | + should.not.exist(err); |
| 103 | + callback(); |
| 104 | + }); |
| 105 | + } |
| 106 | + ], done); |
| 107 | + }) |
| 108 | +}) |
| 109 | + |
0 commit comments