Skip to content

Commit 3e7e1c8

Browse files
committed
Concentrate external authentication cases into one test file
1 parent 96aa889 commit 3e7e1c8

Some content is hidden

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

60 files changed

+1231
-691
lines changed

test/accessTerminatedPoolAttributes.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ describe('51. accessTerminatedPoolAttributes.js', function(){
4242
it('can not access attributes of terminated pool', function(done){
4343
oracledb.createPool(
4444
{
45-
externalAuth : dbConfig.externalAuth,
4645
user : dbConfig.user,
4746
password : dbConfig.password,
4847
connectString : dbConfig.connectString,
@@ -52,12 +51,7 @@ describe('51. accessTerminatedPoolAttributes.js', function(){
5251
function(err, pool){
5352
should.not.exist(err);
5453
pool.should.be.ok();
55-
if(dbConfig.externalAuth){
56-
pool.connectionsOpen.should.be.exactly(0);
57-
} else {
58-
pool.connectionsOpen.should.be.exactly(pool.poolMin);
59-
}
60-
//(pool.connectionsOpen).should.eql(2);
54+
pool.connectionsOpen.should.be.exactly(pool.poolMin);
6155
(pool.connectionsInUse).should.eql(0);
6256

6357
pool.getConnection( function(err, connection){

test/autoCommit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ describe('7. autoCommit.js', function() {
6767
function(callback) {
6868
oracledb.createPool(
6969
{
70-
externalAuth : dbConfig.externalAuth,
7170
user : dbConfig.user,
7271
password : dbConfig.password,
7372
connectString : dbConfig.connectString,

test/autoCommit4nestedExecutes.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ describe('63. autoCommit4nestedExecutes.js', function() {
4949
var procName = "issue269proc";
5050
var connection = null;
5151

52+
var credentials = {
53+
user: dbConfig.user,
54+
password: dbConfig.password,
55+
connectString: dbConfig.connectString
56+
};
57+
5258
before('prepare table and procedure', function(done) {
5359

5460
var sqlCreateTab =
@@ -84,7 +90,7 @@ describe('63. autoCommit4nestedExecutes.js', function() {
8490

8591
async.series([
8692
function(cb) {
87-
oracledb.getConnection(dbConfig, function(err, conn) {
93+
oracledb.getConnection(credentials, function(err, conn) {
8894
should.not.exist(err);
8995
connection = conn;
9096
cb();
@@ -166,7 +172,7 @@ describe('63. autoCommit4nestedExecutes.js', function() {
166172
async.series([
167173
function getPool(cb) {
168174
oracledb.createPool(
169-
dbConfig,
175+
credentials,
170176
function(err, pooling) {
171177
should.not.exist(err);
172178
pool = pooling;

test/autoCommitForSelect.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,35 @@ describe('8. autoCommitForSelect.js', function(){
7373
END; ";
7474

7575
before(function(done){
76+
7677
async.parallel([
7778
function(callback){
78-
oracledb.getConnection(dbConfig, function(err, conn){
79-
if(err) { console.error(err.message); return; }
80-
connection = conn;
81-
callback();
82-
});
79+
oracledb.getConnection(
80+
{
81+
user: dbConfig.user,
82+
password: dbConfig.password,
83+
connectString: dbConfig.connectString
84+
},
85+
function(err, conn) {
86+
should.not.exist(err);
87+
connection = conn;
88+
callback();
89+
}
90+
);
8391
},
8492
function(callback){
85-
oracledb.getConnection(dbConfig, function(err, conn){
86-
if(err) { console.error(err.message); return; }
87-
anotherConnection = conn;
88-
callback();
89-
});
93+
oracledb.getConnection(
94+
{
95+
user: dbConfig.user,
96+
password: dbConfig.password,
97+
connectString: dbConfig.connectString
98+
},
99+
function(err, conn) {
100+
should.not.exist(err);
101+
anotherConnection = conn;
102+
callback();
103+
}
104+
);
90105
}
91106
], done);
92107
})

test/binding.js

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

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

46+
var credentials = {
47+
user: dbConfig.user,
48+
password: dbConfig.password,
49+
connectString: dbConfig.connectString
50+
};
51+
4652
describe('4.1 test STRING, NUMBER, ARRAY & JSON format', function() {
4753

4854
var connection = null;
4955
before(function(done) {
50-
oracledb.getConnection(dbConfig, function(err, conn) {
56+
oracledb.getConnection(credentials, function(err, conn) {
5157
if(err) { console.error(err.message); return; }
5258
connection = conn;
5359
done();
@@ -347,7 +353,7 @@ describe('4. binding.js', function() {
347353
var options = { autoCommit: true, outFormat: oracledb.OBJECT };
348354

349355
beforeEach(function(done) {
350-
oracledb.getConnection(dbConfig, function(err, conn) {
356+
oracledb.getConnection(credentials, function(err, conn) {
351357
should.not.exist(err);
352358
connection = conn;
353359
conn.execute(
@@ -448,7 +454,7 @@ describe('4. binding.js', function() {
448454
END; ";
449455

450456
beforeEach(function(done) {
451-
oracledb.getConnection(dbConfig, function(err, conn) {
457+
oracledb.getConnection(credentials, function(err, conn) {
452458
should.not.exist(err);
453459
connection = conn;
454460
conn.execute(
@@ -583,7 +589,7 @@ describe('4. binding.js', function() {
583589
var connection = null;
584590

585591
before(function(done) {
586-
oracledb.getConnection(dbConfig, function(err, conn) {
592+
oracledb.getConnection(credentials, function(err, conn) {
587593
if(err) { console.error(err.message); return; }
588594
connection = conn;
589595
done();
@@ -699,7 +705,7 @@ describe('4. binding.js', function() {
699705
var tableName = "nodb_raw";
700706

701707
before(function(done) {
702-
oracledb.getConnection(dbConfig, function(err, conn) {
708+
oracledb.getConnection(credentials, function(err, conn) {
703709
if(err) { console.error(err.message); return; }
704710
connection = conn;
705711
assist.createTable(connection, tableName, done);
@@ -752,7 +758,7 @@ describe('4. binding.js', function() {
752758
var options = {};
753759

754760
oracledb.getConnection(
755-
dbConfig,
761+
credentials,
756762
function(err, connection)
757763
{
758764
should.not.exist(err);
@@ -786,7 +792,7 @@ describe('4. binding.js', function() {
786792
var binds = [ 1, 456 ];
787793

788794
oracledb.getConnection (
789-
dbConfig,
795+
credentials,
790796
function (err, connection ){
791797

792798
should.not.exist ( err ) ;
@@ -808,7 +814,7 @@ describe('4. binding.js', function() {
808814
var binds = [ 1, { val : 456 } ];
809815

810816
oracledb.getConnection (
811-
dbConfig,
817+
credentials,
812818
function (err, connection ){
813819

814820
should.not.exist ( err ) ;
@@ -829,7 +835,7 @@ describe('4. binding.js', function() {
829835
var binds = [ {val : 1}, 456 ];
830836

831837
oracledb.getConnection (
832-
dbConfig,
838+
credentials,
833839
function (err, connection ){
834840

835841
should.not.exist ( err ) ;
@@ -850,7 +856,7 @@ describe('4. binding.js', function() {
850856
var binds = [ {val : 1}, {val : 456 } ];
851857

852858
oracledb.getConnection (
853-
dbConfig,
859+
credentials,
854860
function (err, connection ){
855861

856862
should.not.exist ( err ) ;
@@ -871,7 +877,7 @@ describe('4. binding.js', function() {
871877
var binds = [ {val : 1}, { c: {val : 456 } } ];
872878

873879
oracledb.getConnection (
874-
dbConfig,
880+
credentials,
875881
function (err, connection ){
876882
should.not.exist ( err ) ;
877883
connection.execute (
@@ -891,7 +897,7 @@ describe('4. binding.js', function() {
891897
var binds = [ { b: {val : 1} }, {val : 456 } ];
892898

893899
oracledb.getConnection (
894-
dbConfig,
900+
credentials,
895901
function (err, connection ){
896902
should.not.exist ( err ) ;
897903
connection.execute (
@@ -911,7 +917,7 @@ describe('4. binding.js', function() {
911917
var binds = [ { b: {val : 1} }, { c: {val : 456 } } ];
912918

913919
oracledb.getConnection (
914-
dbConfig,
920+
credentials,
915921
function (err, connection ){
916922
should.not.exist ( err ) ;
917923
connection.execute (

test/checkClassesTypes.js

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

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

46+
var credentials = {
47+
user: dbConfig.user,
48+
password: dbConfig.password,
49+
connectString: dbConfig.connectString
50+
};
51+
4652
it('61.1 Oracledb class', function() {
4753
var type = Object.prototype.toString.call(oracledb);
4854
type.should.eql('[object Oracledb]');
@@ -53,7 +59,7 @@ describe('61. checkClassesTypes.js', function() {
5359
[
5460
function(callback)
5561
{
56-
oracledb.getConnection(dbConfig, callback);
62+
oracledb.getConnection(credentials, callback);
5763
},
5864
function(connection, callback)
5965
{
@@ -80,7 +86,7 @@ describe('61. checkClassesTypes.js', function() {
8086

8187
async.series([
8288
function getConn(callback) {
83-
oracledb.getConnection(dbConfig, function(err, conn) {
89+
oracledb.getConnection(credentials, function(err, conn) {
8490
should.not.exist(err);
8591
connection = conn;
8692
callback();
@@ -161,7 +167,7 @@ describe('61. checkClassesTypes.js', function() {
161167
async.waterfall(
162168
[
163169
function(callback) {
164-
oracledb.createPool(dbConfig, callback);
170+
oracledb.createPool(credentials, callback);
165171
},
166172
function(pool, callback) {
167173
var type = Object.prototype.toString.call(pool);
@@ -184,7 +190,7 @@ describe('61. checkClassesTypes.js', function() {
184190
async.waterfall(
185191
[
186192
function(callback) {
187-
oracledb.getConnection(dbConfig, callback);
193+
oracledb.getConnection(credentials, callback);
188194
},
189195
function(connection, callback) {
190196
connection.execute(

test/clobPlsqlString.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ describe('60. clobPlsqlString.js', function() {
5454
async.series([
5555
function(callback) {
5656
oracledb.getConnection(
57-
dbConfig,
57+
{
58+
user: dbConfig.user,
59+
password: dbConfig.password,
60+
connectString: dbConfig.connectString
61+
},
5862
function(err, conn) {
5963
should.not.exist(err);
6064
connection = conn;

test/columnMetadata.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,18 @@ describe('9. columnMetadata.js', function(){
4242

4343
var connection = null;
4444
before('get a connection', function(done) {
45-
oracledb.getConnection(dbConfig, function(err, conn) {
46-
should.not.exist(err);
47-
connection = conn;
48-
done();
49-
});
45+
oracledb.getConnection(
46+
{
47+
user: dbConfig.user,
48+
password: dbConfig.password,
49+
connectString: dbConfig.connectString
50+
},
51+
function(err, conn) {
52+
should.not.exist(err);
53+
connection = conn;
54+
done();
55+
}
56+
);
5057
})
5158

5259
after('release the connection', function(done) {

0 commit comments

Comments
 (0)