Skip to content

Commit d1a1e56

Browse files
committed
Test updates
1 parent e323df6 commit d1a1e56

File tree

4 files changed

+78
-11
lines changed

4 files changed

+78
-11
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. */
2+
3+
/******************************************************************************
4+
*
5+
* You may not use the identified files except in compliance with the Apache
6+
* License, Version 2.0 (the "License.")
7+
*
8+
* You may obtain a copy of the License at
9+
* http://www.apache.org/licenses/LICENSE-2.0.
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
*
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* The node-oracledb test suite uses 'mocha', 'should' and 'async'.
19+
* See LICENSE.md for relevant licenses.
20+
*
21+
* NAME
22+
* 223. accessPropertiesOnClosedObjects.js
23+
*
24+
* DESCRIPTION
25+
* Test accessing the properties on closed objects.
26+
*
27+
*****************************************************************************/
28+
'use strict';
29+
30+
31+
const oracledb = require('oracledb');
32+
const should = require('should');
33+
const dbconfig = require('./dbconfig.js');
34+
35+
describe('223. accessPropertiesOnClosedObjects.js', () => {
36+
37+
it('223.1 access properties of closed Connection object', async () => {
38+
try {
39+
const conn = await oracledb.getConnection(dbconfig);
40+
await conn.close();
41+
42+
let closedObjProp = conn.oracleServerVersion;
43+
should.not.exist(closedObjProp);
44+
} catch (err) {
45+
should.not.exist(err);
46+
}
47+
}); // 223.1
48+
49+
it('223.2 access properties of closed Lob object', async () => {
50+
try {
51+
const conn = await oracledb.getConnection(dbconfig);
52+
53+
const Lob = await conn.createLob(oracledb.DB_TYPE_BLOB);
54+
55+
await Lob.close();
56+
should.strictEqual(Lob.type, oracledb.DB_TYPE_BLOB);
57+
should.strictEqual(Lob.length, 0)
58+
59+
await conn.close();
60+
should.strictEqual(Lob.type, oracledb.DB_TYPE_BLOB);
61+
should.strictEqual(Lob.length, 0)
62+
} catch (err) {
63+
should.not.exist(err);
64+
}
65+
}); // 223.2
66+
});

test/callTimeout.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const assert = require('assert');
3333
const dbconfig = require('./dbconfig.js');
3434
const testsUtil = require('./testsUtil.js');
3535

36-
describe('222. callTimeout.js', () => {
36+
describe.skip('222. callTimeout.js', () => {
3737

3838
let isRunnable = true;
3939
let conn;
@@ -68,12 +68,8 @@ describe('222. callTimeout.js', () => {
6868
async () => {
6969
await conn.execute(`BEGIN DBMS_SESSION.SLEEP(:sleepsec); END;`, [DB_OP_TIME]);
7070
},
71-
/ORA-03156/
71+
/DPI-1067/
7272
);
73-
/*
74-
expect - DPI-1067: call timeout of %u ms exceeded with ORA-%d
75-
actual - ORA-03156: OCI call timed out
76-
*/
7773
} catch (err) {
7874
should.not.exist(err);
7975
}
@@ -166,7 +162,7 @@ describe('222. callTimeout.js', () => {
166162
}
167163
}); // 222.7
168164

169-
it('The callTimeout value applies to each round-trip individually', async () => {
165+
it('222.8 The callTimeout value applies to each round-trip individually', async () => {
170166
try {
171167
const TIME_OUT = 2;
172168
const DB_OP_TIME = 4;
@@ -177,7 +173,7 @@ describe('222. callTimeout.js', () => {
177173
async () => {
178174
await conn.execute(`BEGIN DBMS_SESSION.SLEEP(:sleepsec); END;`, [DB_OP_TIME]);
179175
},
180-
/ORA-03156/
176+
/DPI-1067/
181177
);
182178

183179
await conn.execute(`BEGIN DBMS_SESSION.SLEEP(:sleepsec); END;`, [1]);
@@ -188,4 +184,4 @@ describe('222. callTimeout.js', () => {
188184
should.not.exist(err);
189185
}
190186
});
191-
});
187+
});

test/list.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4630,4 +4630,8 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
46304630
222.5 callTimeout == NaN
46314631
222.6 callTimeout is a String
46324632
222.7 The callTimeout value applies not to the sum of all round-trips
4633-
The callTimeout value applies to each round-trip individually
4633+
222.8 The callTimeout value applies to each round-trip individually
4634+
4635+
223. accessPropertiesOnClosedObjects.js
4636+
223.1 access properties of closed Connection object
4637+
223.2 access properties of closed Lob object

test/opts/mocha.opts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,5 @@ test/aq3.js
247247

248248
test/examineOwnedProperties.js
249249
test/connectionClass.js
250-
test/callTimeout.js
250+
test/callTimeout.js
251+
test/accessPropertiesOnClosedObjects.js

0 commit comments

Comments
 (0)