Skip to content

Commit 87e106a

Browse files
committed
Fix test refactor merges
1 parent 14d4c44 commit 87e106a

File tree

77 files changed

+532
-865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+532
-865
lines changed

test/autoCommit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describe('7. autoCommit.js', function() {
7474

7575
after('drop table, release connection, terminate pool', async function() {
7676
await connection.execute("DROP TABLE nodb_commit_dept purge");
77-
await connection.release();
77+
await connection.close();
7878
await pool.terminate();
7979
});
8080

test/autoCommitForSelect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('8. autoCommitForSelect.js', function() {
7575
});
7676

7777
after(async function() {
78-
await connection.release();
78+
await connection.close();
7979
await anotherConnection.release();
8080
});
8181

test/bindTimestamp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('102. bindTimestamp.js', function() {
7171
after(async function() {
7272
const sql = "drop table nodb_tab_tsbind purge";
7373
await runSQL(sql);
74-
await connection.release();
74+
await connection.close();
7575
});
7676

7777
async function runSQL(sql) {

test/binding.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('4. binding.js', function() {
4949
});
5050

5151
after(async function() {
52-
await connection.release();
52+
await connection.close();
5353
});
5454

5555
it('4.1.1 VARCHAR2 binding, Object & Array formats', async function() {
@@ -213,7 +213,7 @@ describe('4. binding.js', function() {
213213
afterEach(async function() {
214214
assert(connection);
215215
await connection.execute("DROP TABLE nodb_binding1 PURGE");
216-
await connection.release();
216+
await connection.close();
217217
});
218218

219219
it('4.2.1 array binding is ok', async function() {
@@ -271,7 +271,7 @@ describe('4. binding.js', function() {
271271
afterEach(async function() {
272272
assert(connection);
273273
await connection.execute("DROP TABLE nodb_binding2 PURGE");
274-
await connection.release();
274+
await connection.close();
275275
});
276276

277277
let insert1 = 'insert into nodb_binding2 (num, str, dt) values (:0, :1, :2)';
@@ -324,7 +324,7 @@ describe('4. binding.js', function() {
324324
});
325325

326326
after(async function() {
327-
await connection.release();
327+
await connection.close();
328328
});
329329

330330
it('4.4.1 outBind & maxSize restriction', async function() {
@@ -397,7 +397,7 @@ describe('4. binding.js', function() {
397397

398398
after(async function() {
399399
await connection.execute("DROP TABLE " + tableName + " PURGE");
400-
await connection.release();
400+
await connection.close();
401401
});
402402

403403

@@ -524,7 +524,7 @@ describe('4. binding.js', function() {
524524
}); // before
525525

526526
after(async function() {
527-
await connection.release();
527+
await connection.close();
528528
}); // after
529529

530530
it('4.8.1 binding out in Object & Array formats', async function() {
@@ -709,7 +709,7 @@ describe('4. binding.js', function() {
709709

710710
after(async function() {
711711
await connection.execute("DROP TABLE nodb_empty PURGE");
712-
await connection.release();
712+
await connection.close();
713713
});
714714

715715
it('4.11.1 executing a null with bind values', async function() {

test/binding_DMLInsert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('92.binding_DMLInsert.js', function() {
5252
});
5353

5454
after(async function() {
55-
await connection.release();
55+
await connection.close();
5656
});
5757

5858
let doTest = async function(table_name, content, dbColType, bindType, nullBind, largeVal) {

test/binding_defaultBindInout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('101.binding_defaultBindInout.js', function() {
5252
});
5353

5454
after(async function() {
55-
await connection.release();
55+
await connection.close();
5656
});
5757

5858
const doTest1 = async function(table_name, procName, dbColType, content, sequence) {

test/blobDMLBindAsBuffer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('82.blobDMLBindAsBuffer.js', function() {
6565
}); // before
6666

6767
after(async function() {
68-
await connection.release();
68+
await connection.close();
6969
}); // after
7070

7171
let executeSQL = async function(sql) {

test/blobDMLReturningMultipleRowsAsBuffer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('137. blobDMLReturningMultipleRowsAsBuffer.js', function() {
6565
});
6666

6767
after(async function() {
68-
await connection.release();
68+
await connection.close();
6969
});
7070

7171
describe('137.1 BLOB DML returning multiple rows as buffer', function() {

test/blobDMLReturningMultipleRowsAsStream.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('138. blobDMLReturningMultipleRowsAsStream.js', function() {
6666
});
6767

6868
after(async function() {
69-
await connection.release();
69+
await connection.close();
7070
});
7171

7272
describe('138.1 BLOB DML returning multiple rows as stream', function() {

test/blobPlsqlBindAsBuffer_bindin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
8787

8888
after(async function() {
8989
await dropAllTable();
90-
await connection.release();
90+
await connection.close();
9191

9292
}); // after
9393

test/blobPlsqlBindAsBuffer_bindinout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('79. blobPlsqlBindAsBuffer_bindinout.js', function() {
8989
after(async function() {
9090

9191
await dropAllTable();
92-
await connection.release();
92+
await connection.close();
9393

9494
}); // after
9595

test/blobPlsqlBindAsBuffer_bindout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('78. blobPlsqlBindAsBuffer_bindout.js', function() {
9090
after(async function() {
9191

9292
await dropAllTable();
93-
await connection.release();
93+
await connection.close();
9494
}); // after
9595

9696
let setupAllTable = async function() {

test/blobStream.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('127.blobStream.js', function() {
8585
dropAllTable(cb);
8686
},
8787
function(cb) {
88-
connection.release(function(err) {
88+
connection.close(function(err) {
8989
should.not.exist(err);
9090
cb();
9191
});

test/clobDMLBindAsString.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('81. clobDMLBindAsString.js', function() {
6565
}); // before
6666

6767
after(async function() {
68-
await connection.release();
68+
await connection.close();
6969
}); // after
7070

7171
const executeSQL = async function(sql) {

test/clobDMLReturningMultipleRowsAsStream.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('135. clobDMLReturningMultipleRowsAsStream.js', function() {
7676
});
7777

7878
after(function(done) {
79-
connection.release(function(err) {
79+
connection.close(function(err) {
8080
should.not.exist(err);
8181
done();
8282
});

test/clobPlsqlString.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('60. clobPlsqlString.js', function() {
7878
);
7979
},
8080
function(callback) {
81-
connection.release(function(err) {
81+
connection.close(function(err) {
8282
should.not.exist(err);
8383
callback();
8484
});

test/connClose.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('52. connClose.js', function() {
4141
const connection = await oracledb.getConnection(dbConfig);
4242
const defaultSize = 30;
4343
assert.strictEqual(connection.stmtCacheSize, defaultSize);
44-
await connection.release();
44+
await connection.close();
4545
assert.throws(
4646
function() {
4747
connection.stmtCacheSize = 10;
@@ -53,7 +53,7 @@ describe('52. connClose.js', function() {
5353
it('52.2 can not set property, clientId, after connection closes', async function() {
5454
const connection = await oracledb.getConnection(dbConfig);
5555
assert(connection);
56-
await connection.release();
56+
await connection.close();
5757
assert.throws(
5858
function() {
5959
connection.clientId = "52.3";
@@ -65,7 +65,7 @@ describe('52. connClose.js', function() {
6565
it('52.3 can not set property, module', async function() {
6666
const connection = await oracledb.getConnection(dbConfig);
6767
assert(connection);
68-
await connection.release();
68+
await connection.close();
6969
assert.throws(
7070
function() {
7171
connection.module = "52.4";
@@ -77,7 +77,7 @@ describe('52. connClose.js', function() {
7777
it('52.4 can not set property, action', async function() {
7878
const connection = await oracledb.getConnection(dbConfig);
7979
assert(connection);
80-
await connection.release();
80+
await connection.close();
8181
assert.throws(
8282
function() {
8383
connection.module = "52.5";
@@ -89,7 +89,7 @@ describe('52. connClose.js', function() {
8989
it('52.5 can not call method, execute()', async function() {
9090
const connection = await oracledb.getConnection(dbConfig);
9191
assert(connection);
92-
await connection.release();
92+
await connection.close();
9393
await assert.rejects(
9494
async () => {
9595
await connection.execute("select sysdate from dual");
@@ -101,7 +101,7 @@ describe('52. connClose.js', function() {
101101
it('52.6 can not call method, break()', async function() {
102102
const connection = await oracledb.getConnection(dbConfig);
103103
assert(connection);
104-
await connection.release();
104+
await connection.close();
105105
await assert.rejects(
106106
async () => {
107107
await connection.break();
@@ -113,7 +113,7 @@ describe('52. connClose.js', function() {
113113
it('52.7 can not call method, commit()', async function() {
114114
const connection = await oracledb.getConnection(dbConfig);
115115
assert(connection);
116-
await connection.release();
116+
await connection.close();
117117
await assert.rejects(
118118
async () => {
119119
await connection.commit();
@@ -125,7 +125,7 @@ describe('52. connClose.js', function() {
125125
it('52.8 can not call method, createLob()', async function() {
126126
const connection = await oracledb.getConnection(dbConfig);
127127
assert(connection);
128-
await connection.release();
128+
await connection.close();
129129
await assert.rejects(
130130
async () => {
131131
await connection.createLob(oracledb.CLOB);
@@ -137,7 +137,7 @@ describe('52. connClose.js', function() {
137137
it('52.9 can not call method, queryStream()', async function() {
138138
const connection = await oracledb.getConnection(dbConfig);
139139
assert(connection);
140-
await connection.release();
140+
await connection.close();
141141
const stream = await connection.queryStream("select sysdate from dual");
142142
assert(stream);
143143

@@ -169,7 +169,7 @@ describe('52. connClose.js', function() {
169169
it('52.10 can not call release() multiple times', async function() {
170170
const connection = await oracledb.getConnection(dbConfig);
171171
assert(connection);
172-
await connection.release();
172+
await connection.close();
173173
await assert.rejects(
174174
async () => {
175175
await connection.commit();
@@ -181,7 +181,7 @@ describe('52. connClose.js', function() {
181181
it('52.11 can not call method, rollback()', async function() {
182182
const connection = await oracledb.getConnection(dbConfig);
183183
assert(connection);
184-
await connection.release();
184+
await connection.close();
185185
await assert.rejects(
186186
async () => {
187187
await connection.rollback();
@@ -193,7 +193,7 @@ describe('52. connClose.js', function() {
193193
it("52.12 can access properties of closed connection without error", async function() {
194194
const connection = await oracledb.getConnection(dbConfig);
195195
assert(connection);
196-
await connection.release();
196+
await connection.close();
197197
assert.strictEqual(connection.stmtCacheSize, undefined);
198198
assert.strictEqual(connection.oracleServerVersion, undefined);
199199
assert.strictEqual(connection.oracleServerVersionString, undefined);

test/dataTypeAssist.js

+25-28
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
*****************************************************************************/
3232
'use strict';
3333

34-
var oracledb = require('oracledb');
35-
var should = require('should');
36-
var async = require('async');
34+
const oracledb = require('oracledb');
35+
const should = require('should');
36+
const async = require('async');
3737

3838
var assist = exports;
3939

@@ -770,32 +770,29 @@ assist.insertData4sql = function(connection, tableName, array, done) {
770770
};
771771

772772
assist.sqlCreateTable = function(tableName) {
773-
// Add the NOCOMPRESS option for CREATE TABLE, so that Hybrid Columnar Compression (HCC) is disabled for tables with LONG and LONG RAW Columns
774-
// in all types of Oracle Databases. (Note: HCC is enabled in Oracle ADB-S and ADB-D by default)
775-
// When HCC is enabled, Tables with LONG and LONG RAW columns cannot be created.
776-
const noCompressOption = (assist.allDataTypeNames[tableName] === 'LONG' || assist.allDataTypeNames[tableName] === 'LONG RAW') ? " NOCOMPRESS" : "";
777-
773+
// The NOCOMPRESS option for CREATE TABLE ensures Hybrid Columnar Compression (HCC)
774+
// is disabled for tables with LONG & LONG RAW columns in all types of Oracle DB.
775+
// (Note: HCC is enabled in Oracle ADB-S and ADB-D by default)
776+
// When HCC is enabled, tables with LONG & LONG RAW columns cannot be created.
778777
var createTab =
779-
"BEGIN " +
780-
" DECLARE " +
781-
" e_table_missing EXCEPTION; " +
782-
" PRAGMA EXCEPTION_INIT(e_table_missing, -00942); " +
783-
" BEGIN " +
784-
" EXECUTE IMMEDIATE ('DROP TABLE " + tableName + " PURGE'); " +
785-
" EXCEPTION " +
786-
" WHEN e_table_missing " +
787-
" THEN NULL; " +
788-
" END; " +
789-
" EXECUTE IMMEDIATE (' " +
790-
" CREATE TABLE " + tableName + " ( " +
791-
" num NUMBER(10), " +
792-
" content " + assist.allDataTypeNames[tableName] + ", " +
793-
" CONSTRAINT " + tableName + "_pk PRIMARY KEY (num) " +
794-
" )" +
795-
noCompressOption +
796-
" '); " +
797-
"END; ";
798-
778+
`BEGIN
779+
DECLARE
780+
e_table_missing EXCEPTION;
781+
PRAGMA EXCEPTION_INIT(e_table_missing, -00942);
782+
BEGIN
783+
EXECUTE IMMEDIATE ('DROP TABLE ${tableName} PURGE');
784+
EXCEPTION
785+
WHEN e_table_missing
786+
THEN NULL;
787+
END;
788+
EXECUTE IMMEDIATE ('
789+
CREATE TABLE ${tableName} (
790+
num NUMBER(10),
791+
content ${assist.allDataTypeNames[tableName]},
792+
CONSTRAINT ${tableName}_pk PRIMARY KEY (num)
793+
) NOCOMPRESS
794+
');
795+
END; `;
799796
return createTab;
800797
};
801798

test/dataTypeChar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('22. dataTypeChar.js', function() {
5454
});
5555

5656
after('release connection', async function() {
57-
await connection.release();
57+
await connection.close();
5858
});
5959

6060
describe('22.1 testing CHAR data in various lengths', function() {

test/dataTypeFloat.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('28. dataTypeFloat.js', function() {
5454

5555
after('release connection', function(done) {
5656
oracledb.fetchAsString = [];
57-
connection.release(function(err) {
57+
connection.close(function(err) {
5858
assert.ifError(err);
5959
done();
6060
});

0 commit comments

Comments
 (0)