Skip to content

Commit b540468

Browse files
committed
Test updates for 11.2 and also CDBs
1 parent eb17c29 commit b540468

20 files changed

+79
-50
lines changed

test/booleanBind.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@ const oracledb = require('oracledb');
3030
const should = require('should');
3131
const assert = require('assert');
3232
const dbconfig = require('./dbconfig.js');
33+
const testsUtil = require('./testsUtil.js');
3334

34-
describe('224. booleanBind.js', () => {
35+
describe('224. booleanBind.js', function() {
3536

3637
let conn;
38+
let isRunnable = false;
39+
3740
const pkgName = 'NODB_PKG_TEST_BOOLEANS';
38-
before(async () => {
41+
before(async function() {
42+
isRunnable = await testsUtil.checkPrerequisites(1200000000, 1200000000);
43+
if(!isRunnable) {
44+
this.skip();
45+
}
46+
3947
let plsqlPkg =`
4048
create or replace package ${pkgName} as
4149
@@ -140,7 +148,11 @@ describe('224. booleanBind.js', () => {
140148
}
141149
}); // before()
142150

143-
after(async() => {
151+
after(async function() {
152+
if(!isRunnable) {
153+
return;
154+
}
155+
144156
try {
145157
let plsql = `drop package ${pkgName}`;
146158
await conn.execute(plsql);
@@ -150,7 +162,7 @@ describe('224. booleanBind.js', () => {
150162
}
151163
}); // after()
152164

153-
it('224.1 IN bind boolean value', async() => {
165+
it('224.1 IN bind boolean value', async function() {
154166

155167
let binds = {
156168
inval: true,
@@ -166,7 +178,7 @@ describe('224. booleanBind.js', () => {
166178
}
167179
}); // 224.1
168180

169-
it('224.2 IN bind value "false"', async () => {
181+
it('224.2 IN bind value "false"', async function() {
170182
let binds = {
171183
inval: false,
172184
outval: { dir: oracledb.BIND_OUT, type: oracledb.STRING, maxSize: 10 }
@@ -181,7 +193,7 @@ describe('224. booleanBind.js', () => {
181193
}
182194
}); // 224.2
183195

184-
it('224.3 IN bind value "null"', async () => {
196+
it('224.3 IN bind value "null"', async function() {
185197
let binds = {
186198
inval: { type: oracledb.DB_TYPE_BOOLEAN, val: null },
187199
outval: { dir: oracledb.BIND_OUT, type: oracledb.STRING, maxSize: 10 }
@@ -196,7 +208,7 @@ describe('224. booleanBind.js', () => {
196208
}
197209
}); // 224.3
198210

199-
it('224.4 Negative - IN bind value type mismatch', async () => {
211+
it('224.4 Negative - IN bind value type mismatch', async function() {
200212
let binds = {
201213
inval: { type: oracledb.DB_TYPE_BOOLEAN, val: 123 },
202214
outval: { dir: oracledb.BIND_OUT, type: oracledb.STRING, maxSize: 10 }
@@ -205,7 +217,7 @@ describe('224. booleanBind.js', () => {
205217

206218
try {
207219
await assert.rejects(
208-
async () => {
220+
async function() {
209221
await conn.execute(sql, binds);
210222
},
211223
/NJS-011/
@@ -215,7 +227,7 @@ describe('224. booleanBind.js', () => {
215227
}
216228
});
217229

218-
it('224.5 OUT bind value "false"', async () => {
230+
it('224.5 OUT bind value "false"', async function() {
219231
let binds = {
220232
inval: 12,
221233
outval: { dir: oracledb.BIND_OUT, type: oracledb.DB_TYPE_BOOLEAN }
@@ -230,7 +242,7 @@ describe('224. booleanBind.js', () => {
230242
}
231243
}); // 224.5
232244

233-
it('224.6 OUT bind value "true"', async () => {
245+
it('224.6 OUT bind value "true"', async function() {
234246
let binds = {
235247
inval: 9,
236248
outval: { dir: oracledb.BIND_OUT, type: oracledb.DB_TYPE_BOOLEAN }
@@ -245,7 +257,7 @@ describe('224. booleanBind.js', () => {
245257
}
246258
}); // 224.6
247259

248-
it('224.7 IN bind array with boolean data', async () => {
260+
it('224.7 IN bind array with boolean data', async function() {
249261
try {
250262
const cls = await conn.getDbObjectClass(`${pkgName}.UDT_BOOLEANLIST`);
251263
const arr = new cls([true, false, true, true, false, true, false, true]);
@@ -261,7 +273,7 @@ describe('224. booleanBind.js', () => {
261273
}
262274
}); // 224.7
263275

264-
it('224.8 OUT bind array with boolean data', async () => {
276+
it('224.8 OUT bind array with boolean data', async function() {
265277
try {
266278
const cls = await conn.getDbObjectClass(`${pkgName}.UDT_BOOLEANLIST`);
267279
const arr = new cls([true, false, true, true, false, true, false, true]);
@@ -277,7 +289,7 @@ describe('224. booleanBind.js', () => {
277289
}
278290
}); // 224.8
279291

280-
it('224.9 INOUT bind record with boolean data', async () => {
292+
it('224.9 INOUT bind record with boolean data', async function() {
281293
try {
282294
const cls = await conn.getDbObjectClass(`${pkgName}.UDT_DEMORECORD`);
283295
const obj = new cls();

test/dbObject18.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const assert = require('assert');
3232

3333
describe('242. dbObject18.js', () => {
3434

35-
describe('242.1 set oracledb.dbObjectAsPojon', () => {
35+
describe('242.1 set oracledb.dbObjectAsPojo', () => {
3636

3737
before(async () => {
3838
// Default value of oracledb.dbObjectAsPojo should be false
@@ -82,7 +82,7 @@ describe('242. dbObject18.js', () => {
8282
} catch (err) {
8383
should.not.exist(err);
8484
should.strictEqual(oracledb.dbObjectAsPojo, true);
85-
console.log(oracledb.dbObjectAsPojo);
85+
// console.log(oracledb.dbObjectAsPojo);
8686
}
8787
}); // 242.1.4
8888

test/list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4745,7 +4745,7 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
47454745
240.4 PL/SQL syntax error
47464746

47474747
242. dbObject18.js
4748-
242.1 set oracledb.dbObjectAsPojon
4748+
242.1 set oracledb.dbObjectAsPojo
47494749
242.1.1 oracledb.dbObjectAsPojo could be set without connection
47504750
242.1.2 oracledb.dbObjectAsPojo could be set without connection
47514751
242.1.3 set oracledb.dbObjectAsPojo to value of oracledb.autoCommit

test/soda1.js

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,11 @@ describe('164. soda1.js', () => {
4040
if (!runnable) {
4141
this.skip();
4242
return;
43-
} else {
44-
45-
try {
46-
47-
let credential = {
48-
user: dbconfig.test.DBA_user,
49-
password: dbconfig.test.DBA_password,
50-
connectString: dbconfig.connectString,
51-
privilege: oracledb.SYSDBA
52-
};
53-
const connAsDBA = await oracledb.getConnection(credential);
54-
55-
let sql = `GRANT SODA_APP TO ${dbconfig.user}`;
56-
await connAsDBA.execute(sql);
57-
58-
try{
59-
sql = `CREATE TABLESPACE tbs_nodesoda DATAFILE 'tbs_nodesoda.dbf' SIZE 300M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO`;
60-
await connAsDBA.execute(sql);
61-
} catch(err){
62-
// console.log(err);
63-
}
64-
65-
sql = `ALTER USER ${dbconfig.user} QUOTA UNLIMITED ON tbs_nodesoda`;
66-
await connAsDBA.execute(sql);
67-
68-
sql = `ALTER USER ${dbconfig.user} default tablespace tbs_nodesoda`;
69-
await connAsDBA.execute(sql);
70-
71-
} catch (err) {
72-
should.not.exist(err);
73-
}
74-
75-
}
43+
}
7644

7745
await sodaUtil.cleanup();
46+
47+
await sodaUtil.grantPrivilege();
7848
});
7949

8050
it('164.1 getSodaDatabase() creates a sodaDatabase Object', async () => {

test/soda10.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ describe('178. soda10.js', () => {
5151
}
5252

5353
await sodaUtil.cleanup();
54+
await sodaUtil.grantPrivilege();
5455

5556
}); // before()
5657

test/soda11.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe('179. soda11.js', () => {
4545
}
4646

4747
await sodaUtil.cleanup();
48+
await sodaUtil.grantPrivilege();
4849
});
4950

5051
it('179.1 create collection with metadata', async () => {

test/soda12.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('230. soda12.js', () => {
5454
}
5555

5656
await sodaUtil.cleanup();
57+
await sodaUtil.grantPrivilege();
5758
}); // before()
5859

5960
function getMetadata(tableName) {

test/soda13.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ describe('231. soda13.js', () => {
5454
}
5555

5656
await sodaUtil.cleanup();
57+
await sodaUtil.grantPrivilege();
5758
}); // before()
5859

5960
it('231.1 example case', async () => {

test/soda14.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ describe('238. soda14.js', () => {
6161
}
6262

6363
await sodaUtil.cleanup();
64+
await sodaUtil.grantPrivilege();
6465

6566
try {
6667
conn = await oracledb.getConnection(dbconfig);

test/soda2.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ describe('165. soda2.js', () => {
4343
}
4444

4545
await sodaUtil.cleanup();
46+
await sodaUtil.grantPrivilege();
4647
});
4748

4849
it('165.1 create two sodaDatabase objects which point to the same instance', async () => {

0 commit comments

Comments
 (0)