forked from oracle/node-oracledb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataTypeFloat.js
103 lines (90 loc) · 2.95 KB
/
dataTypeFloat.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. */
/******************************************************************************
*
* You may not use the identified files except in compliance with the Apache
* License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
* The node-oracledb test suite uses 'mocha', 'should' and 'async'.
* See LICENSE.md for relevant licenses.
*
* NAME
* 28. dataTypeFloat.js
*
* DESCRIPTION
* Testing Oracle data type support - FLOAT.
*
* NUMBERING RULE
* Test numbers follow this numbering rule:
* 1 - 20 are reserved for basic functional tests
* 21 - 50 are reserved for data type supporting tests
* 51 onwards are for other tests
*
*****************************************************************************/
'use strict';
var oracledb = require('oracledb');
var should = require('should');
var assist = require('./dataTypeAssist.js');
var dbConfig = require('./dbconfig.js');
describe('28. dataTypeFloat.js', function() {
var connection = null;
var tableName = "nodb_float";
var numbers = assist.data.numbers;
before('get one connection', function(done) {
oracledb.getConnection(
{
user: dbConfig.user,
password: dbConfig.password,
connectString: dbConfig.connectString
},
function(err, conn) {
should.not.exist(err);
connection = conn;
done();
}
);
})
after('release connection', function(done) {
connection.release( function(err) {
should.not.exist(err);
done();
});
})
describe('28.1 testing FLOAT data type', function() {
before('create table, insert data',function(done) {
assist.setUp(connection, tableName, numbers, done);
})
after(function(done) {
connection.execute(
"DROP table " + tableName,
function(err) {
should.not.exist(err);
done();
}
);
})
it('28.1.1 works well with SELECT query', function(done) {
assist.dataTypeSupport(connection, tableName, numbers, done);
})
it('28.1.2 works well with result set', function(done) {
assist.verifyResultSet(connection, tableName, numbers, done);
})
it('28.1.3 works well with REF Cursor', function(done) {
assist.verifyRefCursor(connection, tableName, numbers, done);
})
})
describe('28.2 stores null value correctly', function() {
it('28.2.1 testing Null, Empty string and Undefined', function(done) {
assist.verifyNullValues(connection, tableName, done);
})
})
})