Skip to content

Commit e0e344e

Browse files
committed
Update tests to use unique object names
1 parent f302a4a commit e0e344e

File tree

7 files changed

+263
-245
lines changed

7 files changed

+263
-245
lines changed

test/binding.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('4. binding.js', function() {
6464
it('4.1.1 VARCHAR2 binding, Object & Array formats', function(done) {
6565
async.series([
6666
function(callback) {
67-
var proc = "CREATE OR REPLACE PROCEDURE nodb_testproc (p_out OUT VARCHAR2) \
67+
var proc = "CREATE OR REPLACE PROCEDURE nodb_bindproc1 (p_out OUT VARCHAR2) \
6868
AS \
6969
BEGIN \
7070
p_out := 'abcdef'; \
@@ -80,7 +80,7 @@ describe('4. binding.js', function() {
8080
},
8181
function(callback) {
8282
connection.execute(
83-
"BEGIN nodb_testproc(:o); END;",
83+
"BEGIN nodb_bindproc1(:o); END;",
8484
{
8585
o: { type: oracledb.STRING, dir: oracledb.BIND_OUT }
8686
},
@@ -94,7 +94,7 @@ describe('4. binding.js', function() {
9494
},
9595
function(callback) {
9696
connection.execute(
97-
"BEGIN nodb_testproc(:o); END;",
97+
"BEGIN nodb_bindproc1(:o); END;",
9898
[
9999
{ type: oracledb.STRING, dir: oracledb.BIND_OUT }
100100
],
@@ -108,7 +108,7 @@ describe('4. binding.js', function() {
108108
},
109109
function(callback) {
110110
connection.execute(
111-
"DROP PROCEDURE nodb_testproc",
111+
"DROP PROCEDURE nodb_bindproc1",
112112
function(err) {
113113
should.not.exist(err);
114114
callback();
@@ -121,7 +121,7 @@ describe('4. binding.js', function() {
121121
it('4.1.2 NUMBER binding, Object & Array formats', function(done) {
122122
async.series([
123123
function(callback) {
124-
var proc = "CREATE OR REPLACE PROCEDURE nodb_testproc (p_out OUT NUMBER) \
124+
var proc = "CREATE OR REPLACE PROCEDURE nodb_bindproc2 (p_out OUT NUMBER) \
125125
AS \
126126
BEGIN \
127127
p_out := 10010; \
@@ -137,7 +137,7 @@ describe('4. binding.js', function() {
137137
},
138138
function(callback) {
139139
connection.execute(
140-
"BEGIN nodb_testproc(:o); END;",
140+
"BEGIN nodb_bindproc2(:o); END;",
141141
{
142142
o: { type: oracledb.NUMBER, dir: oracledb.BIND_OUT }
143143
},
@@ -151,7 +151,7 @@ describe('4. binding.js', function() {
151151
},
152152
function(callback) {
153153
connection.execute(
154-
"BEGIN nodb_testproc(:o); END;",
154+
"BEGIN nodb_bindproc2(:o); END;",
155155
[
156156
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT }
157157
],
@@ -165,7 +165,7 @@ describe('4. binding.js', function() {
165165
},
166166
function(callback) {
167167
connection.execute(
168-
"DROP PROCEDURE nodb_testproc",
168+
"DROP PROCEDURE nodb_bindproc2",
169169
function(err) {
170170
should.not.exist(err);
171171
callback();
@@ -178,7 +178,7 @@ describe('4. binding.js', function() {
178178
it('4.1.3 Multiple binding values, Object & Array formats', function(done) {
179179
async.series([
180180
function(callback) {
181-
var proc = "CREATE OR REPLACE PROCEDURE nodb_testproc (p_in IN VARCHAR2, p_inout IN OUT VARCHAR2, p_out OUT NUMBER) \
181+
var proc = "CREATE OR REPLACE PROCEDURE nodb_bindproc3 (p_in IN VARCHAR2, p_inout IN OUT VARCHAR2, p_out OUT NUMBER) \
182182
AS \
183183
BEGIN \
184184
p_inout := p_in || ' ' || p_inout; \
@@ -195,7 +195,7 @@ describe('4. binding.js', function() {
195195
},
196196
function(callback) {
197197
connection.execute(
198-
"BEGIN nodb_testproc(:i, :io, :o); END;",
198+
"BEGIN nodb_bindproc3(:i, :io, :o); END;",
199199
{
200200
i: 'Alan', // bind type is determined from the data type
201201
io: { val: 'Turing', dir : oracledb.BIND_INOUT },
@@ -211,7 +211,7 @@ describe('4. binding.js', function() {
211211
},
212212
function(callback) {
213213
connection.execute(
214-
"BEGIN nodb_testproc(:i, :io, :o); END;",
214+
"BEGIN nodb_bindproc3(:i, :io, :o); END;",
215215
[
216216
'Alan', // bind type is determined from the data type
217217
{ val: 'Turing', dir : oracledb.BIND_INOUT },
@@ -227,7 +227,7 @@ describe('4. binding.js', function() {
227227
},
228228
function(callback) {
229229
connection.execute(
230-
"DROP PROCEDURE nodb_testproc",
230+
"DROP PROCEDURE nodb_bindproc3",
231231
function(err) {
232232
should.not.exist(err);
233233
callback();
@@ -240,7 +240,7 @@ describe('4. binding.js', function() {
240240
it('4.1.4 Multiple binding values, Change binding order', function(done) {
241241
async.series([
242242
function(callback) {
243-
var proc = "CREATE OR REPLACE PROCEDURE nodb_testproc (p_inout IN OUT VARCHAR2, p_out OUT NUMBER, p_in IN VARCHAR2) \
243+
var proc = "CREATE OR REPLACE PROCEDURE nodb_bindproc4 (p_inout IN OUT VARCHAR2, p_out OUT NUMBER, p_in IN VARCHAR2) \
244244
AS \
245245
BEGIN \
246246
p_inout := p_in || ' ' || p_inout; \
@@ -257,7 +257,7 @@ describe('4. binding.js', function() {
257257
},
258258
function(callback) {
259259
connection.execute(
260-
"BEGIN nodb_testproc(:io, :o, :i); END;",
260+
"BEGIN nodb_bindproc4(:io, :o, :i); END;",
261261
{
262262
i: 'Alan', // bind type is determined from the data type
263263
io: { val: 'Turing', dir : oracledb.BIND_INOUT },
@@ -273,7 +273,7 @@ describe('4. binding.js', function() {
273273
},
274274
function(callback) {
275275
connection.execute(
276-
"BEGIN nodb_testproc(:io, :o, :i); END;",
276+
"BEGIN nodb_bindproc4(:io, :o, :i); END;",
277277
[
278278
{ val: 'Turing', dir : oracledb.BIND_INOUT },
279279
{ type: oracledb.NUMBER, dir : oracledb.BIND_OUT },
@@ -289,7 +289,7 @@ describe('4. binding.js', function() {
289289
},
290290
function(callback) {
291291
connection.execute(
292-
"DROP PROCEDURE nodb_testproc",
292+
"DROP PROCEDURE nodb_bindproc4",
293293
function(err) {
294294
should.not.exist(err);
295295
callback();
@@ -329,19 +329,19 @@ describe('4. binding.js', function() {
329329
e_table_missing EXCEPTION; \
330330
PRAGMA EXCEPTION_INIT(e_table_missing, -00942); \
331331
BEGIN \
332-
EXECUTE IMMEDIATE ('DROP TABLE nodb_binding'); \
332+
EXECUTE IMMEDIATE ('DROP TABLE nodb_binding1'); \
333333
EXCEPTION \
334334
WHEN e_table_missing \
335335
THEN NULL; \
336336
END; \
337337
EXECUTE IMMEDIATE (' \
338-
CREATE TABLE nodb_binding ( \
338+
CREATE TABLE nodb_binding1 ( \
339339
id NUMBER(4), \
340340
name VARCHAR2(32) \
341341
) \
342342
'); \
343343
END; ";
344-
var insert = 'insert into nodb_binding (id, name) values (:0, :1) returning id into :2';
344+
var insert = 'insert into nodb_binding1 (id, name) values (:0, :1) returning id into :2';
345345
var param1 = [ 1, 'changjie', { type: oracledb.NUMBER, dir: oracledb.BIND_OUT } ];
346346
var param2 = [ 2, 'changjie', { ignored_name: { type: oracledb.NUMBER, dir: oracledb.BIND_OUT } } ];
347347
var options = { autoCommit: true, outFormat: oracledb.OBJECT };
@@ -363,7 +363,7 @@ describe('4. binding.js', function() {
363363
afterEach(function(done) {
364364
connection.should.be.ok();
365365
connection.execute(
366-
"DROP TABLE nodb_binding",
366+
"DROP TABLE nodb_binding1",
367367
function(err) {
368368
should.not.exist(err);
369369
connection.release(function(err) {
@@ -385,7 +385,7 @@ describe('4. binding.js', function() {
385385
result.outBinds[0].should.eql([1]);
386386
// console.log(result);
387387
connection.execute(
388-
"SELECT * FROM nodb_binding ORDER BY id",
388+
"SELECT * FROM nodb_binding1 ORDER BY id",
389389
[],
390390
options,
391391
function(err, result) {
@@ -410,7 +410,7 @@ describe('4. binding.js', function() {
410410
(err.message).should.startWith('NJS-044');
411411
// NJS-044: named JSON object is not expected in this context
412412
connection.execute(
413-
"SELECT * FROM nodb_binding ORDER BY id",
413+
"SELECT * FROM nodb_binding1 ORDER BY id",
414414
[],
415415
options,
416416
function(err, result) {
@@ -433,13 +433,13 @@ describe('4. binding.js', function() {
433433
e_table_missing EXCEPTION; \
434434
PRAGMA EXCEPTION_INIT(e_table_missing, -00942); \
435435
BEGIN \
436-
EXECUTE IMMEDIATE ('DROP TABLE nodb_binding'); \
436+
EXECUTE IMMEDIATE ('DROP TABLE nodb_binding2'); \
437437
EXCEPTION \
438438
WHEN e_table_missing \
439439
THEN NULL; \
440440
END; \
441441
EXECUTE IMMEDIATE (' \
442-
CREATE TABLE nodb_binding ( \
442+
CREATE TABLE nodb_binding2 ( \
443443
num NUMBER(4), \
444444
str VARCHAR2(32), \
445445
dt DATE \
@@ -464,7 +464,7 @@ describe('4. binding.js', function() {
464464
afterEach(function(done) {
465465
connection.should.be.ok();
466466
connection.execute(
467-
"DROP TABLE nodb_binding",
467+
"DROP TABLE nodb_binding2",
468468
function(err) {
469469
should.not.exist(err);
470470
connection.release(function(err) {
@@ -475,8 +475,8 @@ describe('4. binding.js', function() {
475475
);
476476
})
477477

478-
var insert1 = 'insert into nodb_binding (num, str, dt) values (:0, :1, :2)';
479-
var insert2 = 'insert into nodb_binding (num, str, dt) values (:0, :1, :2) returning num into :3';
478+
var insert1 = 'insert into nodb_binding2 (num, str, dt) values (:0, :1, :2)';
479+
var insert2 = 'insert into nodb_binding2 (num, str, dt) values (:0, :1, :2) returning num into :3';
480480
var param1 = { 0: 123, 1: 'str', 2: new Date() };
481481
var param2 = { 0: 123, 1: 'str', 2: new Date(), 3: { type: oracledb.NUMBER, dir: oracledb.BIND_OUT } };
482482
var param3 = [ 123, 'str', new Date() ];
@@ -493,7 +493,7 @@ describe('4. binding.js', function() {
493493
should.not.exist(err);
494494
result.rowsAffected.should.be.exactly(1);
495495
connection.execute(
496-
"SELECT * FROM nodb_binding ORDER BY num",
496+
"SELECT * FROM nodb_binding2 ORDER BY num",
497497
[],
498498
options,
499499
function(err, result) {
@@ -517,7 +517,7 @@ describe('4. binding.js', function() {
517517
//console.log(result);
518518
result.outBinds.should.eql({ '3': [123] });
519519
connection.execute(
520-
"SELECT * FROM nodb_binding ORDER BY num",
520+
"SELECT * FROM nodb_binding2 ORDER BY num",
521521
[],
522522
options,
523523
function(err, result) {
@@ -540,7 +540,7 @@ describe('4. binding.js', function() {
540540
result.rowsAffected.should.be.exactly(1);
541541
// console.log(result);
542542
connection.execute(
543-
"SELECT * FROM nodb_binding ORDER BY num",
543+
"SELECT * FROM nodb_binding2 ORDER BY num",
544544
[],
545545
options,
546546
function(err, result) {
@@ -564,7 +564,7 @@ describe('4. binding.js', function() {
564564
// console.log(result);
565565
result.outBinds[0].should.eql([123]);
566566
connection.execute(
567-
"SELECT * FROM nodb_binding ORDER BY num",
567+
"SELECT * FROM nodb_binding2 ORDER BY num",
568568
[],
569569
options,
570570
function(err, result) {
@@ -600,7 +600,7 @@ describe('4. binding.js', function() {
600600
it('4.4.1 outBind & maxSize restriction', function(done) {
601601
async.series([
602602
function(callback) {
603-
var proc = "CREATE OR REPLACE PROCEDURE nodb_testproc (p_out OUT VARCHAR2) \
603+
var proc = "CREATE OR REPLACE PROCEDURE nodb_bindproc4 (p_out OUT VARCHAR2) \
604604
AS \
605605
BEGIN \
606606
p_out := 'ABCDEF GHIJK LMNOP QRSTU'; \
@@ -616,7 +616,7 @@ describe('4. binding.js', function() {
616616
},
617617
function(callback) {
618618
connection.execute(
619-
"BEGIN nodb_testproc(:o); END;",
619+
"BEGIN nodb_bindproc4(:o); END;",
620620
{
621621
o: { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize:2 }
622622
},
@@ -631,7 +631,7 @@ describe('4. binding.js', function() {
631631
},
632632
function(callback) {
633633
connection.execute(
634-
"BEGIN nodb_testproc(:o); END;",
634+
"BEGIN nodb_bindproc4(:o); END;",
635635
[
636636
{ type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize:22 }
637637
],
@@ -646,7 +646,7 @@ describe('4. binding.js', function() {
646646
},
647647
function(callback) {
648648
connection.execute(
649-
"DROP PROCEDURE nodb_testproc",
649+
"DROP PROCEDURE nodb_bindproc4",
650650
function(err) {
651651
should.not.exist(err);
652652
callback();

0 commit comments

Comments
 (0)