More test case updates

This commit is contained in:
Sharad Chandran R 2023-05-24 08:39:59 +05:30
parent f2993a933f
commit c6d26dabe7
2 changed files with 13 additions and 11 deletions

View File

@ -93,8 +93,10 @@ The test suite uses [mocha](https://www.npmjs.com/package/mocha),
Set the following environment variables to provide credentials for the test suite.
* `NODE_ORACLEDB_USER` provides the username of the schema user which you used for testing.
Use the username prefix 'NJS_' when creating a new user inside the test suite. Test suite does create such users.
* `NODE_ORACLEDB_PASSWORD` provides the password of the schema user which you used for testing.
if you're generating a password for the user, use the predefined function testsUtil.generateRandomPassword.
* `NODE_ORACLEDB_CONNECTIONSTRING` provides the connection string that points to your database's location.
@ -242,6 +244,6 @@ dbaccess = (description=(RETRY_COUNT=20)(RETRY_DELAY=3)
### <a name="ORA-03114"></a> 5.4 ORA-03114: not connected to ORACLE
We firstly encoutered this error with `test/callTimeout.js`. It uses some hard-coded variables as assertion condition, which may lead to assertion fail in slow network situation.
We first encoutered this error with `test/callTimeout.js`. It uses some hard-coded variables as assertion condition, which may lead to assertion fail in slow network situation.
The solution is commenting out this line `sqlnet.recv_timeout=<minutes>` from `sqlnet.ora` file.

View File

@ -294,7 +294,7 @@ describe('162. getStmtInfo.js', function() {
it('162.28 PL/SQL block bindname following newline character', async function() {
const sql = `
-- COMMENTS
select :object_name_in as object_name,
select :Öobject_name_in as object_name,
'COMMENT' as object_type,
:schema_name_in as schema_name
from dual
@ -306,26 +306,26 @@ describe('162. getStmtInfo.js', function() {
owner
from all_constraints
where owner = :schema_name_in
and table_name = :object_name_in
and table_name = :Öobject_name_in
and constraint_type = 'R'
union all
-- RLS CONTEXTS
select :object_name_in as object_name,
select :Öobject_name_in as object_name,
'RLS_CONTEXT' as object_type,
:schema_name_in as schema_name
from dual
union all
-- RLS GROUP
select :object_name_in as object_name,
select :Öobject_name_in as object_name,
'RLS_GROUP' as object_type,
:schema_name_in as schema_name
from dual
union all
-- RLS POLICY
select :object_name_in as object_name,
select :Öobject_name_in as object_name,
'RLS_POLICY' as object_type,
:schema_name_in as schema_name
from dual
@ -337,7 +337,7 @@ describe('162. getStmtInfo.js', function() {
owner
from all_constraints
where owner = :schema_name_in
and table_name = :object_name_in
and table_name = :Öobject_name_in
and constraint_type != 'R'
union all
@ -347,7 +347,7 @@ describe('162. getStmtInfo.js', function() {
owner
from all_indexes
where table_owner = :schema_name_in
and table_name = :object_name_in
and table_name = :Öobject_name_in
union all
-- TRIGGERS
@ -356,18 +356,18 @@ describe('162. getStmtInfo.js', function() {
owner
from all_triggers
where table_owner = :schema_name_in
and table_name = :object_name_in
and table_name = :Öobject_name_in
and base_object_type = 'TABLE'
union all
-- OBJECTS GRANTS AS GRANTOR
select :object_name_in,
select :Öobject_name_in,
'OBJECT_GRANT_AS_GRANTOR',
:schema_name_in
from dual`;
const connection = await oracledb.getConnection(dbConfig);
const info = await connection.getStatementInfo(sql);
assert.deepStrictEqual(info.bindNames, ['OBJECT_NAME_IN', 'SCHEMA_NAME_IN']);
assert.deepStrictEqual(info.bindNames, ['ÖOBJECT_NAME_IN', 'SCHEMA_NAME_IN']);
await connection.close();
}); // 162.28
});