Skip to content

Commit f189de2

Browse files
committed
More example and test updates
1 parent fbeda64 commit f189de2

9 files changed

+31
-25
lines changed

examples/typehandlernum.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async function run() {
138138
v = parseFloat(v);
139139
return v;
140140
};
141-
return {type: oracledb.STRING, converter: converter};
141+
return {type: oracledb.DB_TYPE_VARCHAR, converter: converter};
142142
}
143143
}
144144
}

test/dbObject9.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ describe('208. dbObject9.js', function() {
150150
END;
151151
`;
152152

153-
(dbConfig.test.isCmanTdm ? it : it.skip)('208.2 Implicit results that fetch objects', async () => {
153+
it('208.2 Implicit results that fetch objects', async function() {
154+
if (dbConfig.test.isCmanTdm) this.skip();
154155
const result = await conn.execute(queryImpres);
155156
const rows = result.implicitResults[0];
156157
for (let i = 0; i < PEOPLE.length; i++) {
@@ -159,7 +160,8 @@ describe('208. dbObject9.js', function() {
159160
}
160161
}); // 208.2
161162

162-
(dbConfig.test.isCmanTdm ? it : it.skip)('208.3 Implicit results that fetch objects with Result Set', async () => {
163+
it('208.3 Implicit results that fetch objects with Result Set', async function() {
164+
if (dbConfig.test.isCmanTdm) this.skip();
163165
const result = await conn.execute(queryImpres, [], { resultSet: true});
164166
const rows = await result.implicitResults[0].getRows(PEOPLE.length);
165167
for (let i = 0; i < PEOPLE.length; i++) {

test/dbType01.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,30 @@ describe('226. dbType01.js', function() {
121121
assert.match(result.rows[0][0], /Typ=2 Len=2/);
122122
});
123123

124-
(dbConfig.test.isCmanTdm ? it : it.skip)('226.10 DB_TYPE_BINARY_FLOAT', async () => {
124+
it('226.10 DB_TYPE_BINARY_FLOAT', async function() {
125+
if (dbConfig.test.isCmanTdm) this.skip();
125126
const bindVal = { BIND1: {val: numInVal, type: oracledb.DB_TYPE_BINARY_FLOAT}};
126127
const result = await conn.execute(SQL, bindVal);
127128
assert.match(result.rows[0][1], /Typ=100 Len=4/);
128129
});
129130

130-
(dbConfig.test.isCmanTdm ? it : it.skip)('226.11 DB_TYPE_BINARY_DOUBLE', async () => {
131+
it('226.11 DB_TYPE_BINARY_DOUBLE', async function() {
132+
if (dbConfig.test.isCmanTdm) this.skip();
131133
const bindVal = { BIND1: {val: numInVal, type: oracledb.DB_TYPE_BINARY_DOUBLE}};
132134
const result = await conn.execute(SQL, bindVal);
133135
assert.match(result.rows[0][1], /Typ=101 Len=8/);
134136
});
135137

136-
(dbConfig.test.isCmanTdm ? it : it.skip)('226.12 Infinity, DB_TYPE_BINARY_FLOAT', async () => {
138+
it('226.12 Infinity, DB_TYPE_BINARY_FLOAT', async function() {
139+
if (dbConfig.test.isCmanTdm) this.skip();
137140
const num = 1 / 0;
138141
const bindVal = { BIND1: {val: num, type: oracledb.DB_TYPE_BINARY_FLOAT}};
139142
const result = await conn.execute(SQL, bindVal);
140143
assert.match(result.rows[0][1], /Typ=100 Len=4/);
141144
});
142145

143-
(dbConfig.test.isCmanTdm ? it : it.skip)('226.13 Infinity, DB_TYPE_BINARY_DOUBLE', async () => {
146+
it('226.13 Infinity, DB_TYPE_BINARY_DOUBLE', async function() {
147+
if (dbConfig.test.isCmanTdm) this.skip();
144148
const num = 1 / 0;
145149
const bindVal = { BIND1: {val: num, type: oracledb.DB_TYPE_BINARY_DOUBLE}};
146150
const result = await conn.execute(SQL, bindVal);

test/jsonDualityViews1.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ describe('272. jsonDualityView1.js', function() {
737737
});
738738
});
739739

740-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('272.3.11 Create view without privilege ', function() {
740+
describe('272.3.11 Create view without privilege ', function() {
741741
let connection = null;
742742
let conn = null;
743743
const pwd = testsUtil.generateRandomPassword();
@@ -753,7 +753,7 @@ describe('272. jsonDualityView1.js', function() {
753753
)`;
754754

755755
before(async function() {
756-
if (dbConfig.test.drcp) {
756+
if (dbConfig.test.drcp || dbConfig.test.isCmanTdm) {
757757
this.skip();
758758
}
759759
const credential = {
@@ -771,7 +771,7 @@ describe('272. jsonDualityView1.js', function() {
771771
});
772772

773773
after(async function() {
774-
if (dbConfig.test.drcp) {
774+
if (dbConfig.test.drcp || dbConfig.test.isCmanTdm) {
775775
return;
776776
}
777777
await connection.execute(`drop user njs_test1 cascade`);

test/jsonDualityViews2.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737
const testsUtil = require('./testsUtil.js');
3838

39-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('273. jsonDualityView2.js', function() {
39+
describe('273. jsonDualityView2.js', function() {
4040

4141
let connection = null;
4242
let dbaConn = null;
@@ -47,7 +47,7 @@ const testsUtil = require('./testsUtil.js');
4747
if (isRunnable) {
4848
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
4949
}
50-
if (!isRunnable) {
50+
if (!isRunnable || dbConfig.test.isCmanTdm) {
5151
this.skip();
5252
}
5353

@@ -70,7 +70,7 @@ const testsUtil = require('./testsUtil.js');
7070
});
7171

7272
after(async function() {
73-
if (!isRunnable) return;
73+
if (!isRunnable || dbConfig.test.isCmanTdm) return;
7474

7575
await connection.close();
7676
await dbaConn.execute(`drop user jsonDv2 CASCADE`);

test/jsonDualityViews3.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737
const testsUtil = require('./testsUtil.js');
3838

39-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('274 jsonDualityView3.js', function() {
39+
describe('274 jsonDualityView3.js', function() {
4040

4141
let connection = null;
4242
let dbaConn = null;
@@ -47,7 +47,7 @@ const testsUtil = require('./testsUtil.js');
4747
if (isRunnable) {
4848
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
4949
}
50-
if (!isRunnable) {
50+
if (!isRunnable || dbConfig.test.isCmanTdm) {
5151
this.skip();
5252
}
5353

@@ -69,7 +69,7 @@ const testsUtil = require('./testsUtil.js');
6969
});
7070

7171
after(async function() {
72-
if (!isRunnable) return;
72+
if (!isRunnable || dbConfig.test.isCmanTdm) return;
7373

7474
await connection.close();
7575
await dbaConn.execute(`drop user njs_jsonDv3 CASCADE`);

test/jsonDualityViews4.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737
const testsUtil = require('./testsUtil.js');
3838

39-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('275. jsonDualityView4.js', function() {
39+
describe('275. jsonDualityView4.js', function() {
4040

4141
let connection = null;
4242
let dbaConn = null;
@@ -47,7 +47,7 @@ const testsUtil = require('./testsUtil.js');
4747
if (isRunnable) {
4848
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
4949
}
50-
if (!isRunnable) {
50+
if (!isRunnable || dbConfig.test.isCmanTdm) {
5151
this.skip();
5252
}
5353

@@ -99,7 +99,7 @@ const testsUtil = require('./testsUtil.js');
9999
});
100100

101101
after(async function() {
102-
if (!isRunnable) return;
102+
if (!isRunnable || dbConfig.test.isCmanTdm) return;
103103

104104
await connection.execute(`drop table student PURGE`);
105105
await connection.execute(`drop table class PURGE`);

test/jsonDualityViews5.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737
const testsUtil = require('./testsUtil.js');
3838

39-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('276. jsonDualityView5.js', function() {
39+
describe('276. jsonDualityView5.js', function() {
4040

4141
let connection = null;
4242
let dbaConn = null;
@@ -47,7 +47,7 @@ const testsUtil = require('./testsUtil.js');
4747
if (isRunnable) {
4848
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
4949
}
50-
if (!isRunnable) {
50+
if (!isRunnable || dbConfig.test.isCmanTdm) {
5151
this.skip();
5252
}
5353

@@ -98,7 +98,7 @@ const testsUtil = require('./testsUtil.js');
9898
});
9999

100100
after(async function() {
101-
if (!isRunnable) return;
101+
if (!isRunnable || dbConfig.test.isCmanTdm) return;
102102

103103
//await connection.execute(`drop table student_class PURGE`);
104104
await connection.execute(`drop table student_class PURGE`);

test/jsonDualityViews6.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737
const testsUtil = require('./testsUtil.js');
3838

39-
(dbConfig.test.isCmanTdm ? describe : describe.skip)('277. jsonDualityView6.js', function() {
39+
describe('277. jsonDualityView6.js', function() {
4040

4141
let connection = null;
4242
let dbaConn = null;
4343
let isRunnable = false;
4444

4545
before(async function() {
4646
isRunnable = await testsUtil.checkPrerequisites(2100000000, 2300000000);
47-
if (dbConfig.test.drcp || !(isRunnable && dbConfig.test.DBA_PRIVILEGE)) {
47+
if (dbConfig.test.drcp || !(isRunnable && dbConfig.test.DBA_PRIVILEGE) || dbConfig.test.isCmanTdm) {
4848
this.skip();
4949
}
5050

@@ -65,7 +65,7 @@ const testsUtil = require('./testsUtil.js');
6565
});
6666

6767
after(async function() {
68-
if (dbConfig.test.drcp || !isRunnable) return;
68+
if (dbConfig.test.drcp || !isRunnable || dbConfig.test.isCmanTdm) return;
6969
await connection.close();
7070

7171
await dbaConn.execute(`drop user njs_jsonDv6 cascade`);

0 commit comments

Comments
 (0)