Skip to content

Commit 0052190

Browse files
committed
Lint testfiles
1 parent 9fddf23 commit 0052190

File tree

9 files changed

+1184
-1512
lines changed

9 files changed

+1184
-1512
lines changed

test/cqn.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const should = require('should');
4444
const dbconfig = require('./dbconfig.js');
4545
const testsUtil = require('./testsUtil.js');
4646

47-
let REGULAR_CALLBACK_TIMEOUT = 10;
4847
let REGULAR_CALLBACK_TIMEOUT_MS = 10000;
4948

5049
const PACKAGE_USER = dbconfig.user.toUpperCase();
@@ -153,7 +152,7 @@ describe.skip('185. cqn.js', function () {
153152
* times: Number of times to perform the insert, by default is 1
154153
*/
155154
async function insertStringIntoTestTable(requestedValue, conn=undefined, tableName="cqn_test_table", isCommitRequired=true, times=1) {
156-
let createNewConnection = !Boolean(conn);
155+
let createNewConnection = !conn;
157156
for (let i = 0; i < times; i++) {
158157
try {
159158
if (createNewConnection) conn = await oracledb.getConnection(dbconfig);
@@ -174,7 +173,7 @@ describe.skip('185. cqn.js', function () {
174173
}
175174

176175
async function updateTimestampsOfTestTable(str, conn=undefined, times=1) {
177-
let createNewConnection = !Boolean(conn);
176+
let createNewConnection = !conn;
178177
for (let i = 0; i < times; i++) {
179178
try {
180179
if (createNewConnection) conn = await oracledb.getConnection(dbconfig);
@@ -300,8 +299,7 @@ describe.skip('185. cqn.js', function () {
300299
" '); \n" +
301300
"END; ";
302301
await conn.execute(sql);
303-
REGULAR_CALLBACK_TIMEOUT_MS = await testsUtil.measureNetworkRoundTripTime() * 2;
304-
REGULAR_CALLBACK_TIMEOUT = Math.ceil(REGULAR_CALLBACK_TIMEOUT_MS/1000);
302+
305303
} catch (err) {
306304
should.not.exist(err);
307305
} finally {
@@ -336,7 +334,7 @@ describe.skip('185. cqn.js', function () {
336334
const subscribeOptions = {
337335
sql: "select * from cqn_test_table",
338336
callback: cqnEventCallback,
339-
}
337+
};
340338
await conn.subscribe('sub1', subscribeOptions);
341339
} catch (err) {
342340
should.not.exist(err);
@@ -362,7 +360,7 @@ describe.skip('185. cqn.js', function () {
362360
const subscribeOptions = {
363361
sql: "select * from cqn_test_table",
364362
callback: cqnEventCallback,
365-
}
363+
};
366364
await conn.subscribe('sub1', subscribeOptions);
367365
await insertStringIntoTestTable('testStr1', conn);
368366
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -397,7 +395,7 @@ describe.skip('185. cqn.js', function () {
397395
const subscribeOptions = {
398396
sql: "select * from cqn_test_table",
399397
callback: cqnEventCallback,
400-
}
398+
};
401399
await conn.subscribe('sub1', subscribeOptions);
402400
await insertStringIntoTestTable('testStr1');
403401
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -435,7 +433,7 @@ describe.skip('185. cqn.js', function () {
435433
ipAddress: localIPAddress[0].address,
436434
port: 0, // Assign a random port by OS
437435
callback: cqnEventCallback,
438-
}
436+
};
439437
await conn.subscribe('sub1', subscribeOptions);
440438
await insertStringIntoTestTable('testStr1', conn);
441439
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -470,7 +468,7 @@ describe.skip('185. cqn.js', function () {
470468
sql: "select * from cqn_test_table",
471469
timeout: 1,
472470
callback: cqnEventCallback,
473-
}
471+
};
474472
await conn.subscribe('sub1', subscribeOptions);
475473
await sleep(REGULAR_CALLBACK_TIMEOUT_MS < 1000? 4000: REGULAR_CALLBACK_TIMEOUT_MS * 4);
476474
const msg = callbackMsg.pop();
@@ -480,7 +478,7 @@ describe.skip('185. cqn.js', function () {
480478
unsubscribeFailed = false;
481479
} catch (err) {
482480
should.not.exist(err);
483-
clearInterval(interval);
481+
clearInterval();
484482
} finally {
485483
if (conn) {
486484
try {
@@ -504,7 +502,7 @@ describe.skip('185. cqn.js', function () {
504502
sql: "select * from cqn_test_table",
505503
operations: oracledb.CQN_OPCODE_INSERT,
506504
callback: cqnEventCallback,
507-
}
505+
};
508506
await conn.subscribe('sub1', subscribeOptions);
509507
await insertStringIntoTestTable('testStr1');
510508
await updateTimestampsOfTestTable('testStr1', conn);
@@ -545,7 +543,7 @@ describe.skip('185. cqn.js', function () {
545543
groupingClass: oracledb.SUBSCR_GROUPING_CLASS_TIME,
546544
groupingValue: 2,
547545
callback: cqnEventCallback,
548-
}
546+
};
549547
await conn.subscribe('sub1', subscribeOptions);
550548
await conn.subscribe('sub1', { sql: "select * from cqn_test_table_2" });
551549
await insertStringIntoTestTable('testStr1', conn);
@@ -587,7 +585,7 @@ describe.skip('185. cqn.js', function () {
587585
groupingType: oracledb.SUBSCR_GROUPING_TYPE_LAST,
588586
groupingValue: 2,
589587
callback: cqnEventCallback,
590-
}
588+
};
591589
await conn.subscribe('sub1', subscribeOptions);
592590
await conn.subscribe('sub1', { sql: "select * from cqn_test_table_2" });
593591
await insertStringIntoTestTable('testStr1', conn);
@@ -625,7 +623,7 @@ describe.skip('185. cqn.js', function () {
625623
const subscribeOptions = {
626624
sql: "select requested_value from cqn_test_table",
627625
callback: cqnEventCallback,
628-
}
626+
};
629627
await conn.subscribe('sub1', subscribeOptions);
630628
await updateTimestampsOfTestTable('testStr1', conn);
631629
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -663,7 +661,7 @@ describe.skip('185. cqn.js', function () {
663661
sql: "select requested_value from cqn_test_table",
664662
qos: oracledb.SUBSCR_QOS_QUERY,
665663
callback: cqnEventCallback,
666-
}
664+
};
667665
await conn.subscribe('sub1', subscribeOptions);
668666
await updateTimestampsOfTestTable('testStr1', conn);
669667
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -693,7 +691,7 @@ describe.skip('185. cqn.js', function () {
693691
sql: "select requested_value from cqn_test_table where requested_value != 'testStr10'",
694692
qos: oracledb.SUBSCR_QOS_QUERY,
695693
callback: cqnEventCallback,
696-
}
694+
};
697695
await conn.subscribe('sub1', subscribeOptions);
698696
for (let i = 1; i < 12; i++) {
699697
await conn.subscribe('sub1', { sql: `select requested_value from cqn_test_table where requested_value != 'testStr1${i}'` });
@@ -735,7 +733,7 @@ describe.skip('185. cqn.js', function () {
735733
sql: "select n.requested_value from cqn_test_table n, cqn_test_table_2 s where n.requested_value = s.requested_value",
736734
qos: oracledb.SUBSCR_QOS_QUERY,
737735
callback: cqnEventCallback,
738-
}
736+
};
739737
await conn.subscribe('sub1', subscribeOptions);
740738
await insertStringIntoTestTable('testStr1', conn, undefined, false);
741739
await insertStringIntoTestTable('testStr1', conn, 'cqn_test_table_2');
@@ -775,7 +773,7 @@ describe.skip('185. cqn.js', function () {
775773
const subscribeOptions = {
776774
sql: "select * from cqn_test_table",
777775
callback: cqnEventCallback,
778-
}
776+
};
779777
await conn.subscribe('sub1', subscribeOptions);
780778
conn2 = await oracledb.getConnection({
781779
...dbconfig,
@@ -881,7 +879,7 @@ describe.skip('185. cqn.js', function () {
881879
sql: "select requested_value from cqn_test_table",
882880
qos: oracledb.SUBSCR_QOS_DEREG_NFY,
883881
callback: cqnEventCallback,
884-
}
882+
};
885883
await conn.subscribe('sub1', subscribeOptions);
886884
await insertStringIntoTestTable('testStr1', conn);
887885
await sleep(REGULAR_CALLBACK_TIMEOUT_MS);
@@ -918,7 +916,7 @@ describe.skip('185. cqn.js', function () {
918916
const subscribeOptions = {
919917
sql: "select * from cqn_test_table",
920918
callback: cqnEventCallback,
921-
}
919+
};
922920
await conn.subscribe('sub1', subscribeOptions);
923921
await conn.unsubscribe('sub1');
924922
await testsUtil.assertThrowsAsync(async () => {
@@ -948,7 +946,7 @@ describe.skip('185. cqn.js', function () {
948946
const subscribeOptions = {
949947
sql: "select * from cqn_test_table",
950948
callback: cqnEventCallback,
951-
}
949+
};
952950
await testsUtil.assertThrowsAsync(async () => {
953951
await conn.subscribe('sub1', subscribeOptions);
954952
}, /ORA-29972:/); // ORA-29972: user does not have privilege to change/ create registration

0 commit comments

Comments
 (0)