node-oracledb/test
Christopher Jones 02f74fabf0 Made public methods overwritable in new JavaScript layer 2016-03-01 08:38:52 +11:00
..
README.md Update test README 2016-02-29 13:20:39 +11:00
accessTerminatedPoolAttributes.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
autoCommit.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
autoCommit4nestedExecutes.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
autoCommitForSelect.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
binding.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
checkClassesTypes.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
clobPlsqlString.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
clobexample.txt Update URL to reflect changed OTN hierarchy 2015-11-15 08:28:11 +11:00
columnMetadata.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
connection.js Added JavaScript wrapper around C++ classes. Added connection pool queue 2016-02-29 13:48:48 +11:00
dataTypeAssist.js Added support for RAW data type by @bjouhier 2015-09-25 18:10:55 +10:00
dataTypeBinaryDouble.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeBinaryFloat.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeBlob.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeChar.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeClob.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeDate.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeFloat.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeFloat2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeNchar.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeNumber.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeNumber2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeNvarchar2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeRaw.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeRowid.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp1.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp3.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp4.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp5.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeTimestamp6.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dataTypeVarchar2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
dbConfig.js Update tests for new functionality 2015-08-17 16:19:36 +10:00
dmlReturning.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
examples.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
externalAuthentication.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
fetchAs.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
fuzzydinosaur.jpg Update tests for new functionality 2015-08-17 16:19:36 +10:00
getConnAfterPoolTerminate.js Added JavaScript wrapper around C++ classes. Added connection pool queue 2016-02-29 13:48:48 +11:00
instanceof.js Test portability 2016-03-01 00:48:06 +11:00
list.txt Made public methods overwritable in new JavaScript layer 2016-03-01 08:38:52 +11:00
lobProperties.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
lobResultSet.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
nestedCursor.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
nullColumnValues.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
plsqlBinding1.js Add tests 2016-02-29 13:34:34 +11:00
plsqlBinding2.js Add tests 2016-02-29 13:34:34 +11:00
pool.js Test portability 2016-03-01 00:48:06 +11:00
poolTimeout.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
poolValidityAfterFailingTerminate.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
properties.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
releaseAfterFailingTerminate.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
resultSet1.js Remove timeout limit to make test more portable 2016-02-29 13:38:23 +11:00
resultSet2.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
sqlWithWarnings.js Add PL/SQL Array bind null and maxSize tests. Rename dbConfig.js to dbconfig.js. 2016-02-29 13:19:26 +11:00
uninitializedLob.js Add test comment. Convert to Unix EOL 2016-02-29 13:42:12 +11:00
writableProperties.js Made public methods overwritable in new JavaScript layer 2016-03-01 08:38:52 +11:00

README.md

Testing node-oracledb

Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.

You may not use the identified files except in compliance with the Apache License, Version 2.0 (the "License.")

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

The node-oracledb test suite uses 'mocha', 'should' and 'async'. See LICENSE.md for relevant licenses.

1. Preparations for running tests

1.1 Create a working directory

mkdir <some-directory> 
cd <some-directory>

1.2 Install node-oracledb

See INSTALL for installation requirements and more details.

Install with:

npm install oracledb

Alternatively use a GitHub clone:

git clone https://github.com/oracle/node-oracledb.git
npm install node-oracledb

1.3 Install test-dependent modules

The test suite uses mocha, async and should.

cd <some-directory>/node_modules/oracledb 
npm install

Note: Running npm install within oracledb/ directory will recompile oracledb module and install all its dependent modules which are listed in devDependencies field in package.json file. So 'mocha', 'async' and 'should' modules are installed by this command.

1.4 Configure Database credentials

The database credentials for node-oracledb test suite are defined in dbconfig.js file. You can set the credentials via environment variables or dbconfig.js file. Change the credentials to a user who has privileges to connect and create tables.

vi <some-directory>/node_modules/oracledb/test/dbconfig.js
module.exports = {
  user          : process.env.NODE_ORACLEDB_USER || "hr",
  password      : process.env.NODE_ORACLEDB_PASSWORD || "welcome",
  connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl",
  externalAuth  : process.env.NODE_ORACLEDB_EXTERNALAUTH ? true : false
};

To use external authentication, set the externalAuth property to true. Also make sure Oracle Database and the authentication service have been appropriately configured. See Documentation for External Authentication for more details.

2. Running tests

2.1 Run the complete test suite

On Unix-like systems

cd <some-directory>/node_modules/oracledb 
npm test

This calls the test script defined in oracledb/package.json.

On Windows

cd <some-directory>/node_modules/oracledb 
npm run-script testWindows

This calls the testWindows script defined in oracledb/package.json. See npm scripts for more infomation about how npm handles the "scripts" field of package.json.

2.2 Run specified test(s)

cd <some-directory>/node_modules/oracledb 
<mocha-executable-file-directory>/mocha test/<test-names>

See mochajs.org for more information on running tests with mocha.

3. Adding Tests

See CONTRIBUTING for general information on contribution requirements.

For easy correlation between results and test code, each test is assigned a number. The following number ranges have been chosen:

  • 1 - 20 are reserved for basic functional tests
  • 21 - 50 are reserved for data type supporting tests
  • 51 onwards are for other tests

4. Test List

See test/list.txt for the list of existing tests.