Skip to content

Commit

Permalink
Test portability
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbj committed Feb 29, 2016
1 parent 59c9a2a commit 9574093
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 36 deletions.
27 changes: 20 additions & 7 deletions test/instanceof.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* NAME
* 45. instanceof.js
*
* DESCRIPTION
* Testing JS instanceof.
*
* NUMBERING RULE
* Test numbers follow this numbering rule:
* 1 - 20 are reserved for basic functional tests
* 21 - 50 are reserved for data type supporting tests
* 51 onwards are for other tests
*
*****************************************************************************/
'use strict';

Expand All @@ -40,8 +52,9 @@ if (dbConfig.externalAuth) {
credential = dbConfig;
}

describe('instanceof.js', function() {
it('all constructors have been accounted for', function(done) {
describe('45. instanceof.js', function() {

it('45.1 all constructors have been accounted for', function(done) {
var cLibKeysIdx;
var cLibKeys;
var instKeysIdx;
Expand Down Expand Up @@ -78,13 +91,13 @@ describe('instanceof.js', function() {
done();
});

it('instanceof works for the oracledb instance', function(done) {
it('45.2 instanceof works for the oracledb instance', function(done) {
(oracledb instanceof oracledb.Oracledb).should.be.true;

done();
});

it('instanceof works for pool instances', function(done) {
it('45.3 instanceof works for pool instances', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
Expand All @@ -109,7 +122,7 @@ describe('instanceof.js', function() {
);
});

it('instanceof works for connection instances', function(done) {
it('45.4 instanceof works for connection instances', function(done) {
oracledb.getConnection(credential, function(err, conn) {
should.not.exist(err);

Expand All @@ -123,7 +136,7 @@ describe('instanceof.js', function() {
});
});

it('instanceof works for resultset instances', function(done) {
it('45.5 instanceof works for resultset instances', function(done) {
oracledb.getConnection(credential, function(err, conn) {
should.not.exist(err);

Expand Down Expand Up @@ -152,7 +165,7 @@ describe('instanceof.js', function() {
});
});

it('instanceof works for lob instances', function(done) {
it('45.6 instanceof works for lob instances', function(done) {
oracledb.getConnection(credential, function(err, conn) {
should.not.exist(err);

Expand Down
18 changes: 18 additions & 0 deletions test/list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
2.6.1 stmtCacheSize cannot be a negative value
2.6.2 stmtCacheSize can be 0
2.6.3 stmtCacheSize must be a Number
2.7 getConnection
2.7.1 throws error if called after pool is terminated and a callback is not provided
2.7.2 passes error in callback if called after pool is terminated and a callback is provided
2.8 connection request queue (basic functionality)
2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled
2.8.2 does not generate ORA-24418 when calling getConnection if queueing is enabled
2.8.3 generates NJS-040 if request is queued and queueTimeout expires
2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout
2.9 connection request queue (_enableStats & _logStats functionality)_logStats must be called prior to terminating pool.
2.9.1 works after the pool as been terminated


3. examples.js
3.1 connect.js
Expand Down Expand Up @@ -447,6 +458,13 @@
44.7 empty array for BIND_OUT
- 44.8 maxSize option applies to each elements of an array

45. instanceof.js
45.1 all constructors have been accounted for
45.2 instanceof works for the oracledb instance
45.3 instanceof works for pool instances
45.4 instanceof works for connection instances
45.5 instanceof works for resultset instances
45.6 instanceof works for lob instances

51. accessTerminatedPoolAttributes.js
can not access attributes of terminated pool
Expand Down
60 changes: 31 additions & 29 deletions test/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('2. pool.js', function(){
it('2.2.1 poolMin cannot be a negative number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -100,7 +100,7 @@ describe('2. pool.js', function(){
it('2.2.2 poolMin must be a Number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -121,7 +121,7 @@ describe('2. pool.js', function(){
it('2.2.3 poolMin cannot equal to poolMax', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -144,7 +144,7 @@ describe('2. pool.js', function(){
it('2.2.4 poolMin cannot greater than poolMax', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -167,7 +167,7 @@ describe('2. pool.js', function(){
it('2.2.5 (poolMin + poolIncrement) cannot greater than poolMax', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -190,7 +190,7 @@ describe('2. pool.js', function(){
it('2.2.6 (poolMin + poolIncrement) can equal to poolMax', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -226,7 +226,7 @@ describe('2. pool.js', function(){
it('2.3.1 poolMax cannot be a negative value', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -247,7 +247,7 @@ describe('2. pool.js', function(){
it('2.3.2 poolMax cannot be 0', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -268,7 +268,7 @@ describe('2. pool.js', function(){
it('2.3.3 poolMax must be a number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -289,7 +289,7 @@ describe('2. pool.js', function(){
it('2.3.4 poolMax limits the pool capacity', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -351,7 +351,7 @@ describe('2. pool.js', function(){
it('2.4.1 poolIncrement cannot be a negative value', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -372,7 +372,7 @@ describe('2. pool.js', function(){
it('2.4.2 poolIncrement cannot be 0', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -393,7 +393,7 @@ describe('2. pool.js', function(){
it('2.4.3 poolIncrement must be a Number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -414,7 +414,7 @@ describe('2. pool.js', function(){
it('2.4.4 the amount of open connections equals to poolMax when (connectionsOpen + poolIncrement) > poolMax', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -482,7 +482,7 @@ describe('2. pool.js', function(){
it('2.5.1 poolTimeout cannot be a negative number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -503,7 +503,7 @@ describe('2. pool.js', function(){
it('2.5.2 poolTimeout can be 0, which disables timeout feature', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -528,7 +528,7 @@ describe('2. pool.js', function(){
it('2.5.3 poolTimeout must be a number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -552,7 +552,7 @@ describe('2. pool.js', function(){
it('2.6.1 stmtCacheSize cannot be a negative value', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -573,7 +573,7 @@ describe('2. pool.js', function(){
it('2.6.2 stmtCacheSize can be 0', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -597,7 +597,7 @@ describe('2. pool.js', function(){
it('2.6.3 stmtCacheSize must be a Number', function(done){
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -623,7 +623,7 @@ describe('2. pool.js', function(){
beforeEach('get pool ready', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -640,7 +640,7 @@ describe('2. pool.js', function(){
);
});

it('throws error if called after pool is terminated and a callback is not provided', function(done) {
it('2.7.1 throws error if called after pool is terminated and a callback is not provided', function(done) {
pool1.terminate(function(err) {
should.not.exist(err);

Expand All @@ -654,7 +654,7 @@ describe('2. pool.js', function(){
});
});

it('passes error in callback if called after pool is terminated and a callback is provided', function(done) {
it('2.7.2 passes error in callback if called after pool is terminated and a callback is provided', function(done) {
pool1.terminate(function(err) {
should.not.exist(err);

Expand All @@ -668,6 +668,8 @@ describe('2. pool.js', function(){
});

describe('2.8 connection request queue (basic functionality)', function(){
this.timeout(0);

function getBlockingSql(secondsToBlock) {
var blockingSql = '' +
'declare \n' +
Expand All @@ -688,7 +690,7 @@ describe('2. pool.js', function(){
it('2.8.1 generates ORA-24418 when calling getConnection if queueing is disabled', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -741,7 +743,7 @@ describe('2. pool.js', function(){
it('2.8.2 does not generate ORA-24418 when calling getConnection if queueing is enabled', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -798,7 +800,7 @@ describe('2. pool.js', function(){
it('2.8.3 generates NJS-040 if request is queued and queueTimeout expires', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down Expand Up @@ -852,7 +854,7 @@ describe('2. pool.js', function(){
it('2.8.4 does not generate NJS-040 if request is queued for less time than queueTimeout', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand All @@ -861,7 +863,7 @@ describe('2. pool.js', function(){
poolIncrement : 1,
poolTimeout : 1,
queueRequests : true, //default
queueTimeout : 5000 //5 seconds
queueTimeout : 10000 //10 seconds
},
function(err, pool){
should.not.exist(err);
Expand Down Expand Up @@ -910,7 +912,7 @@ describe('2. pool.js', function(){
it('2.9.1 works after the pool as been terminated', function(done) {
oracledb.createPool(
{
externalAuth : credential.externalAuth,
externalAuth : credential.externalAuth,
user : credential.user,
password : credential.password,
connectString : credential.connectString,
Expand Down

0 comments on commit 9574093

Please sign in to comment.