Skip to content

Commit 4b96f37

Browse files
committed
Remove test credential definition
1 parent 8a9484d commit 4b96f37

Some content is hidden

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

56 files changed

+277
-598
lines changed

test/accessTerminatedPoolAttributes.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,20 @@ var dbConfig = require('./dbconfig.js');
3939

4040
describe('51. accessTerminatedPoolAttributes.js', function(){
4141

42-
if(dbConfig.externalAuth){
43-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
44-
} else {
45-
var credential = dbConfig;
46-
}
47-
4842
it('can not access attributes of terminated pool', function(done){
4943
oracledb.createPool(
5044
{
51-
externalAuth : credential.externalAuth,
52-
user : credential.user,
53-
password : credential.password,
54-
connectString : credential.connectString,
45+
externalAuth : dbConfig.externalAuth,
46+
user : dbConfig.user,
47+
password : dbConfig.password,
48+
connectString : dbConfig.connectString,
5549
poolMin : 2,
5650
poolMax : 10
5751
},
5852
function(err, pool){
5953
should.not.exist(err);
6054
pool.should.be.ok;
61-
if(credential.externalAuth){
55+
if(dbConfig.externalAuth){
6256
pool.connectionsOpen.should.be.exactly(0);
6357
} else {
6458
pool.connectionsOpen.should.be.exactly(pool.poolMin);

test/autoCommit.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ var dbConfig = require('./dbconfig.js');
4040

4141
describe('7. autoCommit.js', function() {
4242

43-
if(dbConfig.externalAuth){
44-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
45-
} else {
46-
var credential = dbConfig;
47-
}
48-
4943
var pool = null;
5044
var connection = null;
5145

@@ -73,10 +67,10 @@ describe('7. autoCommit.js', function() {
7367
function(callback) {
7468
oracledb.createPool(
7569
{
76-
externalAuth : credential.externalAuth,
77-
user : credential.user,
78-
password : credential.password,
79-
connectString : credential.connectString,
70+
externalAuth : dbConfig.externalAuth,
71+
user : dbConfig.user,
72+
password : dbConfig.password,
73+
connectString : dbConfig.connectString,
8074
poolMin : 3,
8175
poolMax : 7,
8276
poolIncrement : 1

test/autoCommit4nestedExecutes.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ var dbConfig = require('./dbconfig.js');
4545

4646
describe('63. autoCommit4nestedExecutes.js', function() {
4747

48-
if(dbConfig.externalAuth){
49-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
50-
} else {
51-
var credential = dbConfig;
52-
}
53-
5448
var tableName = "nodb_issue269tab";
5549
var procName = "issue269proc";
5650
var connection = null;
@@ -90,7 +84,7 @@ describe('63. autoCommit4nestedExecutes.js', function() {
9084

9185
async.series([
9286
function(cb) {
93-
oracledb.getConnection(credential, function(err, conn) {
87+
oracledb.getConnection(dbConfig, function(err, conn) {
9488
should.not.exist(err);
9589
connection = conn;
9690
cb();
@@ -172,7 +166,7 @@ describe('63. autoCommit4nestedExecutes.js', function() {
172166
async.series([
173167
function getPool(cb) {
174168
oracledb.createPool(
175-
credential,
169+
dbConfig,
176170
function(err, pooling) {
177171
should.not.exist(err);
178172
pool = pooling;

test/autoCommitForSelect.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ var dbConfig = require('./dbconfig.js');
4040

4141
describe('8. autoCommitForSelect.js', function(){
4242

43-
if(dbConfig.externalAuth){
44-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
45-
} else {
46-
var credential = dbConfig;
47-
}
48-
var connection = false;
49-
var anotherConnection = false;
43+
var connection = null;
44+
var anotherConnection = null;
5045

5146
var script =
5247
"BEGIN \
@@ -80,14 +75,14 @@ describe('8. autoCommitForSelect.js', function(){
8075
before(function(done){
8176
async.parallel([
8277
function(callback){
83-
oracledb.getConnection(credential, function(err, conn){
78+
oracledb.getConnection(dbConfig, function(err, conn){
8479
if(err) { console.error(err.message); return; }
8580
connection = conn;
8681
callback();
8782
});
8883
},
8984
function(callback){
90-
oracledb.getConnection(credential, function(err, conn){
85+
oracledb.getConnection(dbConfig, function(err, conn){
9186
if(err) { console.error(err.message); return; }
9287
anotherConnection = conn;
9388
callback();

test/binding.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,11 @@ var assist = require('./dataTypeAssist.js');
4343

4444
describe('4. binding.js', function() {
4545

46-
if(dbConfig.externalAuth){
47-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
48-
} else {
49-
var credential = dbConfig;
50-
}
51-
5246
describe('4.1 test STRING, NUMBER, ARRAY & JSON format', function() {
47+
5348
var connection = null;
5449
before(function(done) {
55-
oracledb.getConnection(credential, function(err, conn) {
50+
oracledb.getConnection(dbConfig, function(err, conn) {
5651
if(err) { console.error(err.message); return; }
5752
connection = conn;
5853
done();
@@ -352,7 +347,7 @@ describe('4. binding.js', function() {
352347
var options = { autoCommit: true, outFormat: oracledb.OBJECT };
353348

354349
beforeEach(function(done) {
355-
oracledb.getConnection(credential, function(err, conn) {
350+
oracledb.getConnection(dbConfig, function(err, conn) {
356351
should.not.exist(err);
357352
connection = conn;
358353
conn.execute(
@@ -456,7 +451,7 @@ describe('4. binding.js', function() {
456451
END; ";
457452

458453
beforeEach(function(done) {
459-
oracledb.getConnection(credential, function(err, conn) {
454+
oracledb.getConnection(dbConfig, function(err, conn) {
460455
should.not.exist(err);
461456
connection = conn;
462457
conn.execute(
@@ -591,7 +586,7 @@ describe('4. binding.js', function() {
591586
var connection = null;
592587

593588
before(function(done) {
594-
oracledb.getConnection(credential, function(err, conn) {
589+
oracledb.getConnection(dbConfig, function(err, conn) {
595590
if(err) { console.error(err.message); return; }
596591
connection = conn;
597592
done();
@@ -707,7 +702,7 @@ describe('4. binding.js', function() {
707702
var tableName = "nodb_raw";
708703

709704
before(function(done) {
710-
oracledb.getConnection(credential, function(err, conn) {
705+
oracledb.getConnection(dbConfig, function(err, conn) {
711706
if(err) { console.error(err.message); return; }
712707
connection = conn;
713708
assist.createTable(connection, tableName, done);
@@ -761,7 +756,7 @@ describe('4. binding.js', function() {
761756
var options = {};
762757

763758
oracledb.getConnection(
764-
credential,
759+
dbConfig,
765760
function(err, connection)
766761
{
767762
should.not.exist(err);

test/checkClassesTypes.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ var assist = require('./dataTypeAssist.js');
4343

4444
describe('61. checkClassesTypes.js', function() {
4545

46-
if(dbConfig.externalAuth){
47-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
48-
} else {
49-
var credential = dbConfig;
50-
}
51-
5246
it('61.1 Oracledb class', function() {
5347
var type = Object.prototype.toString.call(oracledb);
5448
type.should.eql('[object Oracledb]');
@@ -59,7 +53,7 @@ describe('61. checkClassesTypes.js', function() {
5953
[
6054
function(callback)
6155
{
62-
oracledb.getConnection(credential, callback);
56+
oracledb.getConnection(dbConfig, callback);
6357
},
6458
function(connection, callback)
6559
{
@@ -86,7 +80,7 @@ describe('61. checkClassesTypes.js', function() {
8680

8781
async.series([
8882
function getConn(callback) {
89-
oracledb.getConnection(credential, function(err, conn) {
83+
oracledb.getConnection(dbConfig, function(err, conn) {
9084
should.not.exist(err);
9185
connection = conn;
9286
callback();
@@ -167,7 +161,7 @@ describe('61. checkClassesTypes.js', function() {
167161
async.waterfall(
168162
[
169163
function(callback) {
170-
oracledb.createPool(credential, callback);
164+
oracledb.createPool(dbConfig, callback);
171165
},
172166
function(pool, callback) {
173167
var type = Object.prototype.toString.call(pool);
@@ -190,7 +184,7 @@ describe('61. checkClassesTypes.js', function() {
190184
async.waterfall(
191185
[
192186
function(callback) {
193-
oracledb.getConnection(credential, callback);
187+
oracledb.getConnection(dbConfig, callback);
194188
},
195189
function(connection, callback) {
196190
connection.execute(

test/clobPlsqlString.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,14 @@ var assist = require('./dataTypeAssist.js');
4747

4848
describe('60. clobPlsqlString.js', function() {
4949

50-
if(dbConfig.externalAuth){
51-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
52-
} else {
53-
var credential = dbConfig;
54-
}
55-
5650
var connection = null;
5751
var tableName = "nodb_myclobs";
5852

5953
before('get one connection, prepare table', function(done) {
6054
async.series([
6155
function(callback) {
6256
oracledb.getConnection(
63-
credential,
57+
dbConfig,
6458
function(err, conn) {
6559
should.not.exist(err);
6660
connection = conn;

test/columnMetadata.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,8 @@ var dbConfig = require('./dbconfig.js');
4040

4141
describe('9. columnMetadata.js', function(){
4242

43-
if(dbConfig.externalAuth){
44-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
45-
} else {
46-
var credential = dbConfig;
47-
}
43+
var connection = null;
4844

49-
var connection = false;
5045
beforeEach('get connection & create table', function(done){
5146
var makeTable =
5247
"BEGIN \
@@ -83,7 +78,8 @@ describe('9. columnMetadata.js', function(){
8378
(90, ''Executive'', 100, 1700) \
8479
'); \
8580
END; ";
86-
oracledb.getConnection(credential, function(err, conn){
81+
82+
oracledb.getConnection(dbConfig, function(err, conn){
8783
if(err) { console.error(err.message); return; }
8884
connection = conn;
8985
conn.execute(

test/connection.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,9 @@ var dbConfig = require('./dbconfig.js');
3939

4040
describe('1. connection.js', function(){
4141

42-
if(dbConfig.externalAuth){
43-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
44-
} else {
45-
var credential = dbConfig;
46-
}
47-
4842
describe('1.1 can run SQL query with different output formats', function(){
49-
var connection = false;
5043

44+
var connection = null;
5145
var script =
5246
"BEGIN \
5347
DECLARE \
@@ -78,7 +72,7 @@ describe('1. connection.js', function(){
7872
END; ";
7973

8074
before(function(done){
81-
oracledb.getConnection(credential, function(err, conn) {
75+
oracledb.getConnection(dbConfig, function(err, conn) {
8276
if(err) { console.error(err.message); return; }
8377
connection = conn;
8478
connection.execute(script, function(err) {
@@ -189,7 +183,7 @@ describe('1. connection.js', function(){
189183
var rowsAmount = 107;
190184

191185
before(function(done){
192-
oracledb.getConnection(credential, function(err, conn) {
186+
oracledb.getConnection(dbConfig, function(err, conn) {
193187
if(err) { console.error(err.message); return; }
194188
connection = conn;
195189
connection.execute(createTable, function(err) {
@@ -327,7 +321,7 @@ describe('1. connection.js', function(){
327321
+ "END; ";
328322

329323
before(function(done){
330-
oracledb.getConnection(credential, function(err, conn) {
324+
oracledb.getConnection(dbConfig, function(err, conn) {
331325
if(err) { console.error(err.message); return; }
332326
connection = conn;
333327
connection.execute(proc, function(err, result) {
@@ -409,7 +403,7 @@ describe('1. connection.js', function(){
409403
var defaultStmtCache = oracledb.stmtCacheSize; // 30
410404

411405
beforeEach('get connection and prepare table', function(done) {
412-
oracledb.getConnection(credential, function(err, conn) {
406+
oracledb.getConnection(dbConfig, function(err, conn) {
413407
if(err) { console.error(err.message); return; }
414408
connection = conn;
415409
conn.execute(
@@ -555,14 +549,14 @@ describe('1. connection.js', function(){
555549
beforeEach('get 2 connections and create the table', function(done) {
556550
async.series([
557551
function(callback) {
558-
oracledb.getConnection(credential, function(err, conn) {
552+
oracledb.getConnection(dbConfig, function(err, conn) {
559553
should.not.exist(err);
560554
conn1 = conn;
561555
callback();
562556
});
563557
},
564558
function(callback) {
565-
oracledb.getConnection(credential, function(err, conn) {
559+
oracledb.getConnection(dbConfig, function(err, conn) {
566560
should.not.exist(err);
567561
conn2 = conn;
568562
callback();
@@ -720,7 +714,7 @@ describe('1. connection.js', function(){
720714
var conn1;
721715

722716
beforeEach('get connection ready', function(done) {
723-
oracledb.getConnection(credential, function(err, conn) {
717+
oracledb.getConnection(dbConfig, function(err, conn) {
724718
should.not.exist(err);
725719
conn1 = conn;
726720
done();
@@ -892,7 +886,7 @@ describe('1. connection.js', function(){
892886

893887
describe('1.7 Close method', function() {
894888
it('1.7.1 close can be used as an alternative to release', function(done) {
895-
oracledb.getConnection(credential, function(err, conn) {
889+
oracledb.getConnection(dbConfig, function(err, conn) {
896890
should.not.exist(err);
897891

898892
conn.close(function(err) {

test/dataTypeBinaryDouble.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,11 @@ var dbConfig = require('./dbconfig.js');
4545

4646
describe('31. dataTypeBinaryDouble.js', function() {
4747

48-
if(dbConfig.externalAuth){
49-
var credential = { externalAuth: true, connectString: dbConfig.connectString };
50-
} else {
51-
var credential = dbConfig;
52-
}
53-
5448
var connection = null;
5549
var tableName = "nodb_double";
5650

5751
before('get one connection', function(done) {
58-
oracledb.getConnection(credential, function(err, conn) {
52+
oracledb.getConnection(dbConfig, function(err, conn) {
5953
should.not.exist(err);
6054
connection = conn;
6155
done();

0 commit comments

Comments
 (0)