diff --git a/gulpfile.babel.js b/gulpfile.babel.js index dffca8398..9778a3a1b 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -36,7 +36,6 @@ var fs = require("fs-extra"); var runSequence = require('run-sequence'); var path = require('path'); var minimist = require('minimist'); -var cucumber = require('gulp-cucumber'); var install = require("gulp-install"); var file = require('gulp-file'); var semver = require('semver'); @@ -153,7 +152,7 @@ gulp.task('install-driver-into-sandbox', ['nodejs'], function(){ }); gulp.task('test', function (cb) { - runSequence('run-ts-declaration-tests', 'test-nodejs', 'test-browser', 'run-tck', function (err) { + runSequence('run-ts-declaration-tests', 'test-nodejs', 'test-browser', function (err) { if (err) { var exitCode = 2; console.log('[FAIL] test task failed - exiting with code ' + exitCode); @@ -213,23 +212,6 @@ gulp.task('watch-n-test', ['test-nodejs'], function () { return gulp.watch(['src/**/*.js', "test/**/*.js"], ['test-nodejs'] ); }); -var featureFiles = 'https://s3-eu-west-1.amazonaws.com/remoting.neotechnology.com/driver-compliance/tck.tar.gz'; -var featureHome = './build/tck'; - -gulp.task('download-tck', function() { - return download(featureFiles) - .pipe(decompress({strip: 1})) - .pipe(gulp.dest(featureHome)); -}); - -gulp.task('run-tck', ['download-tck', 'nodejs'], function() { - return gulp.src(featureHome + "/*").pipe(cucumber({ - 'steps': 'test/v1/tck/steps/*.js', - 'format': 'progress', - 'tags' : ['~@fixed_session_pool', '~@db', '~@equality', '~@streaming_and_cursor_navigation'] - })).on('end', logActiveNodeHandles); -}); - /** Set the project version, controls package.json and version.js */ gulp.task('set', function() { // Get the --version arg from command line diff --git a/package-lock.json b/package-lock.json index 11967c053..f00af9110 100644 --- a/package-lock.json +++ b/package-lock.json @@ -216,12 +216,6 @@ "dev": true, "optional": true }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, "acorn": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", @@ -673,7 +667,7 @@ "async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha1-skWiPKcZMAROxT+kaqAKPofGphA=", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { "lodash": "^4.17.10" @@ -781,7 +775,7 @@ "babel-core": { "version": "6.26.3", "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", - "integrity": "sha1-suLwnjQtDwyI4vAuBneUEl51wgc=", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { "babel-code-frame": "^6.26.0", @@ -1281,7 +1275,7 @@ "babel-preset-env": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha1-3qefpOvriDzTXasH4mDBycBN93o=", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "^6.22.0", @@ -2553,29 +2547,6 @@ "cssom": "0.3.x" } }, - "cucumber": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/cucumber/-/cucumber-0.8.1.tgz", - "integrity": "sha1-pgpaafEtFXxqWZgS0Fgbh+5xCfc=", - "dev": true, - "requires": { - "colors": "1.1.2", - "cucumber-html": "0.2.3", - "duration": "^0.2.0", - "gherkin": "2.12.2", - "nopt": "3.0.4", - "stack-chain": "1.3.3", - "underscore": "1.8.3", - "underscore.string": "3.2.2", - "walkdir": "0.0.10" - } - }, - "cucumber-html": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/cucumber-html/-/cucumber-html-0.2.3.tgz", - "integrity": "sha1-eyqf7SFXLF0l1L1MvHU3onKxapM=", - "dev": true - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -2597,15 +2568,6 @@ "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", "dev": true }, - "d": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", - "integrity": "sha1-2hhMU10Y2O57oqoim5FACfrhEwk=", - "dev": true, - "requires": { - "es5-ext": "~0.10.2" - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -3400,16 +3362,6 @@ } } }, - "duration": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/duration/-/duration-0.2.0.tgz", - "integrity": "sha1-X5xN+q//ZV3phhEu/iXFl43YUUY=", - "dev": true, - "requires": { - "d": "~0.1.1", - "es5-ext": "~0.10.2" - } - }, "ecc-jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", @@ -3526,39 +3478,6 @@ "is-arrayish": "^0.2.1" } }, - "es5-ext": { - "version": "0.10.43", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.43.tgz", - "integrity": "sha512-cZd1vezWuTM5qMlasKWqQFioFKwO352nVBzhOTMUf/pKQl5Gcq5EdJzqtSNXKnFQSCJDiQZjCYlYbnzFB657OA==", - "dev": true, - "requires": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.1", - "next-tick": "1" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - }, - "dependencies": { - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "^0.10.9" - } - } - } - }, "es6-promise": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", @@ -3574,27 +3493,6 @@ "es6-promise": "^4.0.3" } }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - }, - "dependencies": { - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "^0.10.9" - } - } - } - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -3633,7 +3531,7 @@ "esdoc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/esdoc/-/esdoc-1.1.0.tgz", - "integrity": "sha1-B9QOv3kXZM1TeSnCkRHiCoV2JPM=", + "integrity": "sha512-vsUcp52XJkOWg9m1vDYplGZN2iDzvmjDL5M/Mp8qkoDG3p2s0yIQCIjKR5wfPBaM3eV14a6zhQNYiNTCVzPnxA==", "dev": true, "requires": { "babel-generator": "6.26.1", @@ -3652,7 +3550,7 @@ "fs-extra": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-5.0.0.tgz", - "integrity": "sha1-QU0BEM3QZwVzTQVWUsVBEmDDGr0=", + "integrity": "sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -3721,7 +3619,7 @@ "esdoc-importpath-plugin": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/esdoc-importpath-plugin/-/esdoc-importpath-plugin-1.0.2.tgz", - "integrity": "sha1-UpzPLIQCNSYNAalQJKVzHvYnR3U=", + "integrity": "sha512-o9/EIk8YyufjzDBrTZu7/6he2No515b51Nnd8QGzXvdTM+rekQjZ7wxVjcqTUQ68bbYLFKqaxZBNltYUbD5aUQ==", "dev": true }, "esdoc-integrate-manual-plugin": { @@ -4529,27 +4427,27 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "resolved": false, "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, @@ -4560,13 +4458,13 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { @@ -4576,39 +4474,39 @@ }, "chownr": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "resolved": false, "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "resolved": false, "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, @@ -4618,28 +4516,28 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "resolved": false, "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "resolved": false, "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -4649,14 +4547,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -4673,7 +4571,7 @@ }, "glob": { "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "resolved": false, "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, @@ -4688,14 +4586,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "resolved": false, "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, @@ -4705,7 +4603,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "resolved": false, "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -4715,7 +4613,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -4726,20 +4624,20 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "resolved": false, "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { @@ -4748,14 +4646,14 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { @@ -4764,13 +4662,13 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "minipass": { "version": "2.2.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", + "resolved": false, "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, "requires": { @@ -4780,7 +4678,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", + "resolved": false, "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, @@ -4790,7 +4688,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -4799,14 +4697,14 @@ }, "ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "resolved": false, "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz", + "resolved": false, "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, @@ -4818,7 +4716,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz", + "resolved": false, "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, @@ -4837,7 +4735,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "resolved": false, "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -4848,14 +4746,14 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz", + "resolved": false, "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz", + "resolved": false, "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, @@ -4866,7 +4764,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -4879,20 +4777,20 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { @@ -4901,21 +4799,21 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -4926,21 +4824,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "resolved": false, "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", + "resolved": false, "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, @@ -4953,7 +4851,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": false, "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -4962,7 +4860,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": false, "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -4978,7 +4876,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "resolved": false, "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, @@ -4988,48 +4886,48 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "resolved": false, "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "resolved": false, "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -5040,7 +4938,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": false, "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -5050,7 +4948,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { @@ -5059,14 +4957,14 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz", + "resolved": false, "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, @@ -5082,14 +4980,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "resolved": false, "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, @@ -5099,13 +4997,13 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "resolved": false, "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } @@ -5212,12 +5110,6 @@ "assert-plus": "^1.0.0" } }, - "gherkin": { - "version": "2.12.2", - "resolved": "https://registry.npmjs.org/gherkin/-/gherkin-2.12.2.tgz", - "integrity": "sha1-PHRUfkZhNKDvg/YUsa38SJtw3GI=", - "dev": true - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -5496,7 +5388,7 @@ "gulp-babel": { "version": "6.1.3", "resolved": "https://registry.npmjs.org/gulp-babel/-/gulp-babel-6.1.3.tgz", - "integrity": "sha1-Wq2Kyw22t/Lwvhnu7pUo8gZN9jE=", + "integrity": "sha512-tm15R3rt4gO59WXCuqrwf4QXJM9VIJC+0J2NPYSC6xZn+cZRD5y5RPGAiHaDxCJq7Rz5BDljlrk3cEjWADF+wQ==", "dev": true, "requires": { "babel-core": "^6.23.1", @@ -5517,47 +5409,6 @@ "stream-array": "^1.0.1" } }, - "gulp-cucumber": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/gulp-cucumber/-/gulp-cucumber-0.0.14.tgz", - "integrity": "sha1-GHujkQqJyWWZY+WQTsZWC24jCqM=", - "dev": true, - "requires": { - "cucumber": "^0.8.*", - "simple-glob": "~0.1.0", - "through2": "^0.6.3" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - } - } - }, "gulp-decompress": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gulp-decompress/-/gulp-decompress-1.2.0.tgz", @@ -6021,7 +5872,7 @@ "gulp-typescript": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-3.2.4.tgz", - "integrity": "sha1-F8a5QQeLAsBSKXTtbJY6sZCSCkc=", + "integrity": "sha512-bZosNvbUGzFA4bjjWoUPyjU5vfgJSzlYKkU0Jutbsrj+td8yvtqxethhqfzB9MwyamaUODIuidj5gIytZ523Bw==", "dev": true, "requires": { "gulp-util": "~3.0.7", @@ -7246,7 +7097,7 @@ "jasmine-console-reporter": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/jasmine-console-reporter/-/jasmine-console-reporter-2.0.1.tgz", - "integrity": "sha1-nNhbS6m9gd1FgX6+AW8oPo2/bXs=", + "integrity": "sha512-Q9pQ18NI+Oz9+kRmvcmM8oDTgiIoAESMRpO/DsyCOwIqktc7onsev6vKLmf3h+UP3AuX7xBB6xlREoV4jMOlzw==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -7256,7 +7107,7 @@ "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -7265,7 +7116,7 @@ "chalk": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha1-GMSasWoDe26wFSzIPjRxM4IVtm4=", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -7745,7 +7596,7 @@ "karma-chrome-launcher": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=", + "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", "dev": true, "requires": { "fs-access": "^1.0.0", @@ -7755,7 +7606,7 @@ "karma-edge-launcher": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/karma-edge-launcher/-/karma-edge-launcher-0.4.2.tgz", - "integrity": "sha1-PZUpsJsTyQnF887uEtAOf5qYmz0=", + "integrity": "sha512-YAJZb1fmRcxNhMIWYsjLuxwODBjh2cSHgTW/jkVmdpGguJjLbs9ZgIK/tEJsMQcBLUkO+yO4LBbqYxqgGW2HIw==", "dev": true, "requires": { "edge-launcher": "1.2.2" @@ -7764,7 +7615,7 @@ "karma-firefox-launcher": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.1.0.tgz", - "integrity": "sha1-LEcDBFLwRTHrfRPU/HZpYwu5Mzk=", + "integrity": "sha512-LbZ5/XlIXLeQ3cqnCbYLn+rOVhuMIK9aZwlP6eOLGzWdo1UVp7t6CN3DP4SafiRLjexKwHeKHDm0c38Mtd3VxA==", "dev": true }, "karma-ie-launcher": { @@ -8913,12 +8764,6 @@ "dev": true, "optional": true }, - "next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", - "dev": true - }, "node-libs-browser": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", @@ -9101,15 +8946,6 @@ "integrity": "sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U=", "dev": true }, - "nopt": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.4.tgz", - "integrity": "sha1-3WO8nHKm5Ohbhc3AyjFFmPrO3l4=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -10544,57 +10380,6 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, - "simple-glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/simple-glob/-/simple-glob-0.1.1.tgz", - "integrity": "sha1-KCv6AS1yBmQ99h00xrueTOP9dxQ=", - "dev": true, - "requires": { - "glob": "~3.2.8", - "lodash": "~2.4.1", - "minimatch": "~0.2.14" - }, - "dependencies": { - "glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", - "dev": true, - "requires": { - "inherits": "2", - "minimatch": "0.3" - }, - "dependencies": { - "minimatch": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", - "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", - "dev": true, - "requires": { - "lru-cache": "2", - "sigmund": "~1.0.0" - } - } - } - }, - "lodash": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", - "integrity": "sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2", - "sigmund": "~1.0.0" - } - } - } - }, "slack-node": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/slack-node/-/slack-node-0.2.0.tgz", @@ -10899,12 +10684,6 @@ "safe-buffer": "^5.1.1" } }, - "stack-chain": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/stack-chain/-/stack-chain-1.3.3.tgz", - "integrity": "sha1-8pZpFivT40NXMzNxAbva6hzegxo=", - "dev": true - }, "stat-mode": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-0.2.2.tgz", @@ -11608,18 +11387,6 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "underscore.string": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.2.tgz", - "integrity": "sha1-TtR+nq+ldaKL0fe8alux2TArsRs=", - "dev": true - }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -11740,7 +11507,7 @@ "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "requires": { "punycode": "^2.1.0" } @@ -12072,12 +11839,6 @@ "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", "dev": true }, - "walkdir": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.10.tgz", - "integrity": "sha1-NgN8q2Y7XhwBZgB7X3uRizJ5pU8=", - "dev": true - }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", diff --git a/package.json b/package.json index 2b397c471..9c46f53eb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "start-neo4j": "gulp start-neo4j", "stop-neo4j": "gulp stop-neo4j", "run-stress-tests": "gulp run-stress-tests", - "run-tck": "gulp run-tck", "run-ts-declaration-tests": "gulp run-ts-declaration-tests", "docs": "esdoc -c esdoc.json", "versionRelease": "gulp set --version $VERSION && npm version $VERSION --no-git-tag-version", @@ -43,7 +42,6 @@ "gulp": "^3.9.1", "gulp-babel": "^6.1.3", "gulp-batch": "^1.0.5", - "gulp-cucumber": "0.0.14", "gulp-decompress": "^1.2.0", "gulp-download": "^0.0.1", "gulp-file": "^0.3.0", diff --git a/test/resources/derived.cert b/test/resources/derived.cert deleted file mode 100644 index 27f607cbd..000000000 --- a/test/resources/derived.cert +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDQzCCAisCAQEwDQYJKoZIhvcNAQEFBQAwdDELMAkGA1UEBhMCU0UxEzARBgNV -BAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 -ZDELMAkGA1UEAxMCY2ExIDAeBgkqhkiG9w0BCQEWEWR1bW15QGV4YW1wbGUuY29t -MCAXDTE2MDQwNjA3NDcwOVoYDzQ3NTQwMzAzMDc0NzA5WjBZMQswCQYDVQQGEwJT -RTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 -cyBQdHkgTHRkMRIwEAYDVQQDEwlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUA -A4IBDwAwggEKAoIBAQC/TV9r/CeZ7vQrNIZyjk3DSiGvUMLl22bvNsrqDm3MNhix -WvypiDv8zt+VtyUsba860u7P3/fnQqv/wFaNIaPqIc3C/jr7w/ITqhEdvHv/NlLk -9so4ehtogCJg8vZ4Xwg/Sa5XCfNwP89yORjhCjWF0s9n+GczSXUi/KuYe2tkL7w/ -gIG6jgjl9Kz1NIBysqcgVM3pclFVGVkUN7KoLK+jy+uW0X0ZEm5NXNO7UIcpp4Gi -+IvEqIbpL1j7oTx9JLflPG3XED97uGdWR4zwaifiSPzc8H6JAUhnmprLpmN71Uv9 -P2cB3z5YXbB2GRa44trqvVdem549SzecGnf5IUYBAgMBAAEwDQYJKoZIhvcNAQEF -BQADggEBADBGFnt6AKwy33BGcthMeTlMlkZ9XYx9GUHi9uD9bF+kNIiO7zSMQ4Pg -tA8pgY7jfqpvRb+yCXCc42Pgwbw7BUp15Xpxwogxb5GsWq7e8MdSt56fTtZyxx7G -VVTdBbM0kyqSqe1ap6MjQTkzu+GuBnXO+YRHtTA3LhxW63hstw3cyezMg5ABt4gU -+K89B1/uNRus2CEcJXi0rzWWt3eW18Yjzc0nLnTRol0FT3ZBkxgeOfxIjZCPKjG1 -DWCnZlOH4BU/v0WRuMDAIi0J8NS0nPWvY+CKwCMMVzBQik1gcR1nh4HvrkKXSe+i -klDr1OENbgIt6yJds+hMaeweGWTxYhY= ------END CERTIFICATE----- diff --git a/test/resources/derived.key b/test/resources/derived.key deleted file mode 100644 index babd0c7fc..000000000 --- a/test/resources/derived.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEoQIBAAKCAQEAv01fa/wnme70KzSGco5Nw0ohr1DC5dtm7zbK6g5tzDYYsVr8 -qYg7/M7flbclLG2vOtLuz9/350Kr/8BWjSGj6iHNwv46+8PyE6oRHbx7/zZS5PbK -OHobaIAiYPL2eF8IP0muVwnzcD/PcjkY4Qo1hdLPZ/hnM0l1IvyrmHtrZC+8P4CB -uo4I5fSs9TSAcrKnIFTN6XJRVRlZFDeyqCyvo8vrltF9GRJuTVzTu1CHKaeBoviL -xKiG6S9Y+6E8fSS35Txt1xA/e7hnVkeM8Gon4kj83PB+iQFIZ5qay6Zje9VL/T9n -Ad8+WF2wdhkWuOLa6r1XXpuePUs3nBp3+SFGAQIDAQABAoIBAApSUmOxJzHXArWS -D+7+XpO63DZpVRqxy8v8WNZoEOSDxrFLB3beMt5hCw844niTMnEqEFiG7Qk9P6p8 -5i6XMhDf4gozTVtoJxeIhYPlN4t9kttntWF2tSPeRfyVH1c/SWKgxxdLIidcSgUP -r5f0xQ6DYU1qyaaqv/czSs7fWdv932Szq6cuUHe3VJzNlYZWkMzDNNZ8+WYXd/0L -d1BtDqMVTVJ4RJmIZNDy1aVTM4FiOPj1OKaoF4KsOrVAZUYrtVVBB8K9zgpv/hEh -klQflCPDJnVSLehlbMB1UYj/1VU+Xzd3LmTd2uFgoZrRnZzR7wAun7e7+M1AhDdH -jJwha0ECgYEA8AooT8qtRtvPT2QbhNmhrKypA/omMqiAMod8oaoyjdk1swaUVEuo -+udlOar4RX9heSjBqnzLeHNrn/v7WdJl1esv0OXz/J7mSC64i6KXyVzEdzIPMA1a -O66yNebzuQDswtfGH7mXEMxdNvLrNg+BSP3tihOAjTMS6e60I3SXVScCgYEAzAWh -JZFUCpSV/kf2EColT+4rGACKrhcbBvJq0rzKtOTxs/JLtNW8+RfNbEvwha1VgCN3 -od5l4IET1wJRuH1/f3IPJVtHEHS1tIDHg8mhHpG7Yk2Vx1io/mVa7bPyf0C4uDeL -Y16QA+auA7AfXeEEC2ac10ImnIj3VBAq+L1xFJcCf3NUbgnoV1i0Q+bhMleiOQu9 -6Xb/uVqdmvqsHjWOkLuWoTZi8uGNeKMUio4qlx7NFQghjOtdCmXVDuDPMPT3Ifam -CVNVKOU3c207BXARrtwQtlSOuL1drPz/8p/zVyaMSzVSdt7HTM3FYwQDsv9Gc9ee -KYMt25X79Bpxlhty6UMCgYALhYHdMkDRvCRgUMYHkam7wtJyL42lWS6wjL4Vmo3D -+23e4J7/3lYmpv510DAMDIbYjqgx3vJX5FIvgTUGOygZFWLflDEGL+EXCXK68YcE -x+wSGBmOQWaBv02MQO4/23LTDGf1u6BcaAmJsceDsLJexnOzAExX6LA28hbLJz+c -jwKBgQCdwuOFISVM9S6aNa8OZFvlBLLmKnLWGZcdu1oNzYNQ4oPfh/FwGI3Ke+tW -SdbdSYgxFwfrGyI7slVSoOgFqhDHEPyYTPBwQ0ismK9p7Ap4fTyrV2FHO6DyGNbW -EIwUp6V85h9icDC1zMvFRLhPSTlHcjIZjg1xZJFKtwyzBzmtSA== ------END RSA PRIVATE KEY----- diff --git a/test/resources/other.cert b/test/resources/other.cert deleted file mode 100644 index 3c5cd0edb..000000000 --- a/test/resources/other.cert +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBpjCCAQ+gAwIBAgIJAIDjBHb55oY0MA0GCSqGSIb3DQEBDQUAMBQxEjAQBgNV -BAMMCWxvY2FsaG9zdDAgFw0xNTA0MDcwNzAwMjRaGA85OTk5MTIzMTIzNTk1OVow -FDESMBAGA1UEAwwJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB -gQCl8RnRaMMy8K78YGfqK50Vp6DI5plxE8s6xwPwzEazhhg2LJWkBRJN702mRnvt -QU+WUFoGop0Gz70jWeAriUQze9psN4ZuO72Um5HTNgFj/+u+pPfr2aeSJBqQIQdc -CoVGt4qx8A9vmUnxKJpR74tIPJchsflHSXbXLbP6SPXKkQIDAQABMA0GCSqGSIb3 -DQEBDQUAA4GBACVEIX+Y7dhVVLueu+dsUsTFeOM410/yNmyrglvCcNnyIQPSOmWF -js8ulTINzECESK1bFgnE0LA66haI/ozH5WPFrDOI7upx1KhBtRGWA3Bn7UCWytyH -OSCfejPcW9uPfgBxPeUeww1+ZOipw8qJwaFSkthnXSyHGjfvZb+Zbb1y ------END CERTIFICATE----- diff --git a/test/resources/other.key b/test/resources/other.key deleted file mode 100644 index b1402415f..000000000 --- a/test/resources/other.key +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAKXxGdFowzLwrvxg -Z+ornRWnoMjmmXETyzrHA/DMRrOGGDYslaQFEk3vTaZGe+1BT5ZQWgainQbPvSNZ -4CuJRDN72mw3hm47vZSbkdM2AWP/676k9+vZp5IkGpAhB1wKhUa3irHwD2+ZSfEo -mlHvi0g8lyGx+UdJdtcts/pI9cqRAgMBAAECgYAbuH8boGibZeGVf3VchRSkvW/6 -n6saXLgihYR/AWD+NHRu+Fu3HrHEGynZkQS6yaJF9f5UBW496Q4rjaQJIdEmk0xg -LUjdaPc5+iWCzxfW+LQpRsANKRBrurhQDQRw74dVfVkTII3nzmvVrplzjS5ABShK -9sHw6L45elSS5T5JwQJBAOZULFp0hCK5bloV4h4vU8+zaOWM+LpH4GOvFTT+yTtV -VAZQrt5NFa9YuRVbvM/qLAXSQHYWrznfBA5/UOHFkj0CQQC4b9BVVEKJhYfHV4j6 -A946n1yx0w3Y0Bo/h8GCJH6Da1FU8WtSFfYbPhnOnIhvXvRKB5DpRjbpK9XqN9At -Q4LlAkAjSfg1r65jB5gRs1Ken0+u/eTvbqbZG5QUkcmlAfhg39Ts1sXEB3lwER7i -V9jY3h76kVkQ/q7AJhwgAH+q57NdAkAgGtaZA+HRLn1EJeiiHKpCahsomSR/6Tmo -dWkpzlB3b+bocl3MHCaK93RmkrjtKgo8GLUQ5jgIvqit7KlAN9BBAkAE525Aw0VD -1lGJclWjuTZAGD4+MSttIJ1ZtHU8QShNBHMe7CUsPtRypXn4WToLVc3Ya53cGGcT -1BQEchduOUpF ------END PRIVATE KEY----- diff --git a/test/resources/root.cert b/test/resources/root.cert deleted file mode 100644 index 023c49ec3..000000000 --- a/test/resources/root.cert +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDZjCCAk4CCQCvDqKVXw2uvTANBgkqhkiG9w0BAQUFADB0MQswCQYDVQQGEwJT -RTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 -cyBQdHkgTHRkMQswCQYDVQQDEwJjYTEgMB4GCSqGSIb3DQEJARYRZHVtbXlAZXhh -bXBsZS5jb20wIBcNMTYwNDA2MDc0NjQ2WhgPNDc1NDAzMDMwNzQ2NDZaMHQxCzAJ -BgNVBAYTAlNFMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5l -dCBXaWRnaXRzIFB0eSBMdGQxCzAJBgNVBAMTAmNhMSAwHgYJKoZIhvcNAQkBFhFk -dW1teUBleGFtcGxlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ANmZyHSsDT6o2I+5tc4itWu2E9vbCiWx8AkVKQ162QP5ZSwoPzf76RnDDY0U3LCV -BDblI/reB/7ABc1mo6eBNNjL0vqT6jyMykml9ErhQIQslmq+SI4GE2Hjl51hTM/f -FxJIIh2AjxJs1nAZxm9P9oEF9Q45mc5Fyi0tkfR9O98a1vDn9kEb5SryUvEVWUlH -ly57KpmhmjLv5hwOdvyFdkPWMeGfrERTWFiiyB+FM/52Tl9knsKzh515WiuViRyp -68k9SfHkOaZnuxY5ziP+Y2y+Njtr15hP7s4IKd5M7wCLIL082xvPYadH0r0blx6/ -oIRRZAPjslRebmvX7TIMM18CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAUy2KghZH -YrD7BVUtDS5XzpW0hSq5uFZy4P76uHTaA0V11r3hZ5bqhiojk0YxvcOlwlEpE/90 -XKczVF9jLSyWcJQ/ArU9u34k90jzTgF+A7BcInUxXviouNnPvB93ofwHAZCQcLDW -IPNKrOvsaHr/mKtRwTqoS/lQ6uVpLAofdly6C4h0U6AQFxOfUswjoqKLmk665xCP -SyEVBzqUX5MlXbSzEncILRzTKXVA9Qz1YEDWIded1bv4D/VJRgnxwKCl/QDVTx58 -9SDwG1brdJIAdzxybAJuTVv+ieEFot4IC9Jyz8athOPyFu7oQyfDJOVnLQGVmkeP -UHPW/w32r+np9Q== ------END CERTIFICATE----- diff --git a/test/resources/root.key b/test/resources/root.key deleted file mode 100644 index 2f0d3820b..000000000 --- a/test/resources/root.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEA2ZnIdKwNPqjYj7m1ziK1a7YT29sKJbHwCRUpDXrZA/llLCg/ -N/vpGcMNjRTcsJUENuUj+t4H/sAFzWajp4E02MvS+pPqPIzKSaX0SuFAhCyWar5I -jgYTYeOXnWFMz98XEkgiHYCPEmzWcBnGb0/2gQX1DjmZzkXKLS2R9H073xrW8Of2 -QRvlKvJS8RVZSUeXLnsqmaGaMu/mHA52/IV2Q9Yx4Z+sRFNYWKLIH4Uz/nZOX2Se -wrOHnXlaK5WJHKnryT1J8eQ5pme7FjnOI/5jbL42O2vXmE/uzggp3kzvAIsgvTzb -G89hp0fSvRuXHr+ghFFkA+OyVF5ua9ftMgwzXwIDAQABAoIBAEe9uug0fV1mP5gL -K1Sd/uBXNG7s5YiOBMyJzHIkSX5U8DVBw64KgMy8kTAta6FQUAZlP5qLL2mfF4qj -x1sHb0v2z0VMFRMHe/4SF9vELgglxyXEPJmOiT9h0O/TT4bNT4b4fz7ozsLNXVmy -NcknPOdG9odNGFd4jPKeLpvD2kRwseeyELdXtqKrG2NmP0t4k76Jrlr9gjt31jkj -uxXVoEuoyL4PSA/O+8Sl3igO7JqlzXeQrAfeUOMkwyNieaE2KT9vKsGwZM9Pchfj -WIxqYM8e4FrvY0FUfqC/yo/4cgaRofhreqN/Y+v0y921n+It9rD+h5LeqHvoOGMB -w5gQBtECgYEA/GbdyJpGIx2kW3qZIexPtTSu4aPk2Edl7J6isnGkI0dr0I+YC6Bd -+1fqINkvBWytYBRI9rwcTOYGTxdCOyJ2g3DJeLVX0CRn4TaYNEnyhs5GYaL/Dyrs -OGC1Ef0M08zF2KWDq/BCcxdULr9Wk8mLVZJG/c9JVqW8V7j9dMllPGcCgYEA3LPp -Nlfi+APgaEwb9GzbpXdz9ZbfNXlY1SoJAwvBIa7bhh9I019hsdbFlPhvXOmAtDjQ -JFQkytSTcbqUz+T+zw+L8xB10uxPALsoahJQO+gbciQCaMII39hFiRQgLQiHiQTn -RbeX+yocC179Eh8YoRG1Ln3MF4aUGsKDwmzl9kkCgYEAnzpFr8ejd4O7q/oroLrz -jd0udiputAJWym9JNEl8wsTLv0bXJH6Gy4kqqo5Ym5NzzKj/XqhNMjXqxPpnTebv -3PvKHdxJCYXuAqXuXw5HccOvouiw/2CUpPxdPnvlG7iTF5lS96UaRoDxGoyakaET -xWgCYRvjqEXmC3EodASZWQECgYEAuQlVw6wXrNyDLq5w2ZLS7H2kCQl/BnRAmCdv -+s/GEplpj593DVBwtgtdCDLqGzniIDdpuquZVTy4iadm0I4rXCqqqRTp0/cvnWtM -zPGhtzg4mo+6PV5A1nuagP0QpPD7wVMNG5R7paZ+cMIo5yKPIauY/euWSzsXvP/M -PBvVCZECgYEAvUO9DYgAOgpeVbsVJKH77cbOjy/wcRZvnIfWT3k4WKEYkw39Rzio -mn8jqS/YJKWXqRVlJ/2IEv3b4TxqIBZQ1dQs6C/PM6iUQIcXalZ62PAQtubO4YI+ -GMgXfHTMmBG+2XnQkP/fNgJ9AjK2m9b7mC50E18wfaN6tk1WmnCRYSw= ------END RSA PRIVATE KEY----- diff --git a/test/v1/session.test.js b/test/v1/session.test.js index 4a65e016c..d2473afa4 100644 --- a/test/v1/session.test.js +++ b/test/v1/session.test.js @@ -234,10 +234,6 @@ describe('session', () => { }); it('should expose server info on successful query', done => { - if (!serverIs31OrLater(done)) { - return; - } - // Given const statement = 'RETURN 1'; @@ -252,11 +248,7 @@ describe('session', () => { }); }); - it('should expose execution time information when using 3.1 and onwards', done => { - if (!serverIs31OrLater(done)) { - return; - } - + it('should expose execution time information', done => { // Given const statement = 'UNWIND range(1,10000) AS n RETURN n AS number'; // When & Then @@ -359,7 +351,8 @@ describe('session', () => { session.beginTransaction(); // Then - expect(session.beginTransaction).toThrow(); + expect(()=>session.beginTransaction()).toThrowError( + /You cannot begin a transaction on a session with an open transaction/); }); it('should return lots of data', done => { @@ -579,9 +572,6 @@ describe('session', () => { }); it('should update last bookmark after every read tx commit', done => { - if (!serverIs31OrLater(done)) { - return; - } // new session without initial bookmark session = driver.session(); @@ -601,9 +591,6 @@ describe('session', () => { }); it('should update last bookmark after every write tx commit', done => { - if (!serverIs31OrLater(done)) { - return; - } const bookmarkBefore = session.lastBookmark(); @@ -621,9 +608,6 @@ describe('session', () => { }); it('should not lose last bookmark after run', done => { - if (!serverIs31OrLater(done)) { - return; - } const tx = session.beginTransaction(); tx.run('CREATE ()').then(() => { @@ -640,10 +624,6 @@ describe('session', () => { }); it('should commit read transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } - // new session without initial bookmark session = driver.session(); expect(session.lastBookmark()).toBeNull(); @@ -659,10 +639,6 @@ describe('session', () => { }); it('should commit write transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } - const bookmarkBefore = session.lastBookmark(); const resultPromise = session.writeTransaction(tx => tx.run('CREATE (n:Node {id: 42}) RETURN n.id AS answer')); @@ -683,10 +659,6 @@ describe('session', () => { }); it('should not commit already committed read transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } - const resultPromise = session.readTransaction(tx => { return new Promise((resolve, reject) => { tx.run('RETURN 42 AS answer').then(result => { @@ -712,10 +684,6 @@ describe('session', () => { }); it('should not commit already committed write transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } - const resultPromise = session.readTransaction(tx => { return new Promise((resolve, reject) => { tx.run('CREATE (n:Node {id: 42}) RETURN n.id AS answer').then(result => { @@ -745,9 +713,6 @@ describe('session', () => { }); it('should not commit rolled back read transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } const bookmarkBefore = session.lastBookmark(); const resultPromise = session.readTransaction(tx => { @@ -770,9 +735,6 @@ describe('session', () => { }); it('should not commit rolled back write transaction', done => { - if (!serverIs31OrLater(done)) { - return; - } const bookmarkBefore = session.lastBookmark(); const resultPromise = session.readTransaction(tx => { @@ -799,10 +761,6 @@ describe('session', () => { }); it('should interrupt query waiting on a lock when closed', done => { - if (!serverIs31OrLater(done)) { - // locks are transaction termination aware by default only in 3.1+ - return; - } session.run('CREATE ()').then(() => { session.close(() => { @@ -836,10 +794,6 @@ describe('session', () => { }); it('should interrupt transaction waiting on a lock when closed', done => { - if (!serverIs31OrLater(done)) { - // locks are transaction termination aware by default only in 3.1+ - return; - } session.run('CREATE ()').then(() => { session.close(() => { @@ -874,10 +828,6 @@ describe('session', () => { }); it('should interrupt transaction function waiting on a lock when closed', done => { - if (!serverIs31OrLater(done)) { - // locks are transaction termination aware by default only in 3.1+ - return; - } session.run('CREATE ()').then(() => { session.close(() => { @@ -945,10 +895,6 @@ describe('session', () => { }); it('should send multiple bookmarks', async () => { - if (!serverIs31OrLater()) { - return; - } - const nodeCount = 17; const bookmarks = []; for (let i = 0; i < nodeCount; i++) { @@ -1163,16 +1109,6 @@ describe('session', () => { }); } - function serverIs31OrLater(done) { - if (serverVersion.compareTo(VERSION_3_1_0) < 0) { - if (done && typeof done === 'function') { - done(); - } - return false; - } - return true; - } - function countNodes(label, propertyKey, propertyValue) { return new Promise((resolve, reject) => { session.run(`MATCH (n: ${label} {${propertyKey}: ${propertyValue}}) RETURN count(n) AS count`).then(result => { diff --git a/test/v1/summary.test.js b/test/v1/summary.test.js new file mode 100644 index 000000000..34132ca65 --- /dev/null +++ b/test/v1/summary.test.js @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2002-2019 "Neo4j," + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with 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. + */ + +import neo4j from '../../src/v1'; +import sharedNeo4j from '../internal/shared-neo4j'; + +describe('result summary', () => { + + let driver, session; + + beforeEach(done => { + driver = neo4j.driver('bolt://localhost', sharedNeo4j.authToken); + session = driver.session(); + + session.run("MATCH (n) DETACH DELETE n").then(done); + }); + + afterEach(() => { + driver.close(); + }); + + it('should get result summary', done => { + // When & Then + session.run("CREATE (p:Person { Name: 'Test'})").then(result => { + let summary = result.summary; + + expect(summary.statement.text).toBe("CREATE (p:Person { Name: 'Test'})"); + expect(summary.statement.parameters).toEqual({}); + + expect(summary.statementType).toBe("w"); + expect(summary.plan).toBe(false); + expect(summary.profile).toBe(false); + expect(summary.notifications).toEqual([]); + expect(summary.resultConsumedAfter).toBeDefined(); + expect(summary.resultAvailableAfter).toBeDefined(); + + let counters = summary.counters; + expect(counters.nodesCreated()).toBe(1); + expect(counters.nodesDeleted()).toBe(0); + expect(counters.relationshipsCreated()).toBe(0); + expect(counters.relationshipsDeleted()).toBe(0); + expect(counters.propertiesSet()).toBe(1); + expect(counters.labelsAdded()).toBe(1); + expect(counters.labelsRemoved()).toBe(0); + expect(counters.indexesAdded()).toBe(0); + expect(counters.indexesRemoved()).toBe(0); + expect(counters.constraintsAdded()).toBe(0); + expect(counters.constraintsRemoved()).toBe(0); + done(); + }); + }); + + it('should get plan from summary', done => { + session.run("EXPLAIN MATCH (n) RETURN 1").then(result => { + let summary = result.summary; + expect(summary.plan).toBeDefined(); + expect(summary.profile).toBe(false); + + let plan = summary.plan; + expect(plan.arguments).toBeDefined(); + expect(plan.children).toBeDefined(); + expect(plan.identifiers).toBeDefined(); + expect(plan.operatorType).toBeDefined(); + done(); + }); + }); + + it('should get profile from summary', done => { + session.run("PROFILE RETURN 1").then(result => { + let summary = result.summary; + expect(summary.plan).toBeDefined(); + expect(summary.profile).toBeDefined(); + + let profile = summary.profile; + let plan = summary.plan; + + verifyProfileAndPlanAreEqual(profile, plan); + + expect(profile.dbHits).toBe(0); + expect(profile.rows).toBe(1); + + done(); + }); + }); + + it('should get notifications from summary', done => { + session.run("EXPLAIN MATCH (n), (m) RETURN n, m").then(result => { + let summary = result.summary; + expect(summary.notifications).toBeDefined(); + expect(summary.notifications.length).toBe(1); + let notification = summary.notifications[0]; + + expect(notification.code).toBeDefined(); + expect(notification.title).toBeDefined(); + expect(notification.description).toBeDefined(); + expect(notification.severity).toBeDefined(); + expect(notification.position).toBeDefined(); + + done(); + }); + }); + + function verifyProfileAndPlanAreEqual(profile, plan) { + expect(profile.arguments).toBe(plan.arguments); + expect(profile.identifiers).toBe(plan.identifiers); + expect(profile.operatorType).toBe(plan.operatorType); + + if (!profile.children || !plan.children ) + { + expect(profile.children).toBeUndefined(); + expect(plan.children).toBeUndefined(); + } + else + { + expect(profile.children).toBeDefined(); + expect(plan.children).toBeDefined(); + + // recursively calling the same method to verify they are equal + verifyProfileAndPlanAreEqual(profile.children, plan.children); + } + } +}); diff --git a/test/v1/tck/steps/authsteps.js b/test/v1/tck/steps/authsteps.js deleted file mode 100644 index 9ec97b164..000000000 --- a/test/v1/tck/steps/authsteps.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var util = require("./util"); -var sharedNeo4j = require("../../../internal/shared-neo4j").default; - -module.exports = function () { - - this.Given(/^a driver is configured with auth enabled and correct password is provided$/, function () { - if (this.driver) { - this.driver.close(); - } - this.driver = neo4j.driver("bolt://localhost", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password)); - }); - - this.Then(/^reading and writing to the database should be possible$/, function (callback) { - var driver = this.driver; - var session = driver.session(); - session.run('CREATE (:label1)').then(function () { - closeDriver(driver); - callback(); - }).catch(function (err) { - closeDriver(driver); - callback(new Error('Rejected Promise: ' + err)); - }); - }); - - this.Given(/^a driver is configured with auth enabled and the wrong password is provided$/, function () { - closeDriver(this.driver); - this.driver = neo4j.driver("bolt://localhost", neo4j.auth.basic(sharedNeo4j.username, "wrong")); - this.driver.session(); - }); - - this.Then(/^reading and writing to the database should not be possible$/, {timeout:5000}, function (callback) { - - var self = this; - this.driver.onError = function (err) { - closeDriver(self.driver); - self.err = err; - callback(); - }; - - var session = this.driver.session(); - session.run("CREATE (:label1)").then( function( ) { - closeDriver(self.driver); - callback(new Error("Should not be able to run session!")); - }).catch( function(err) { - closeDriver(self.driver); - callback(); - }); - }); - - this.Then(/^a `Protocol Error` is raised$/, function () { - var message = this.err.message; - var code = this.err.code; - - var expectedStartOfMessage = 'The client is unauthorized due to authentication failure.'; - var expectedCode = 'Neo.ClientError.Security.Unauthorized'; - - if (message.indexOf(expectedStartOfMessage) != 0) { - throw new Error("Wrong error message. Expected: '" + expectedStartOfMessage + "'. Got: '" + message + "'"); - } - - if (code.indexOf(expectedCode) != 0) { - throw new Error("Wrong error code. Expected: '" + expectedCode + "'. Got: '" + code + "'"); - } - }); - - function closeDriver(driver) { - if (driver) { - driver.close(); - } - } -}; diff --git a/test/v1/tck/steps/environment.js b/test/v1/tck/steps/environment.js deleted file mode 100644 index 364bd8357..000000000 --- a/test/v1/tck/steps/environment.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var fs = require("fs"); -var sharedNeo4j = require("../../../internal/shared-neo4j").default; - -module.exports = function () { - - var driver = undefined; - - var failedScenarios = []; - - this.registerHandler("BeforeFeatures", function(event, next) { - driver = neo4j.driver("bolt://localhost", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password)); - - return next() - }); - - this.Before("@reset_database", function( scenario, callback ) { - this.driver = driver; - this.session = this.driver.session(); - this.session.run("MATCH (n) DETACH DELETE n").then( function( ) { - callback(); - }); - }); - - this.Before("@tls", function( scenario ) { - - this.knownHosts1 = "known_hosts1"; - this.knownHosts2 = "known_hosts2"; - _deleteFile(this.knownHosts1); - _deleteFile(this.knownHosts2); - }); - - this.Before("~@reset_database", "~@tls", function( scenario, callback ) { - this.driver = driver; - this.session = this.driver.session(); - callback(); - }); - - this.Before("@equality_test", function( scenario ) { - this.savedValues = {}; - }); - - this.After("~@error_reporting",function (scenario, callback) { - if (this.session) { - this.session.close(); - } - if (!scenario.isSuccessful()) { - failedScenarios.push(scenario) - } - - _deleteFile(this.knownHosts1); - _deleteFile(this.knownHosts2); - callback(); - }); - - this.registerHandler('AfterFeatures', function (event, callback) { - if (driver) { - driver.close(); - } - if (failedScenarios.length) { - for ( var i = 0; i < failedScenarios.length; i++) { - console.log("FAILED! Scenario: " + failedScenarios[i].getName()); - console.log("With Exception: " + failedScenarios[i].getException() + "\n"); - } - return process.exit(2); - } - callback(); - }); - - function _deleteFile(fname) { - if (!fname) return; - - try { - fs.lstatSync(fname); - fs.unlinkSync(fname); - } - catch (e) { - // ignore - } - } -}; diff --git a/test/v1/tck/steps/erroreportingsteps.js b/test/v1/tck/steps/erroreportingsteps.js deleted file mode 100644 index 7124d27d7..000000000 --- a/test/v1/tck/steps/erroreportingsteps.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var util = require("./util"); -var sharedNeo4j = require("../../../internal/shared-neo4j").default; - -module.exports = function () { - - this.Given(/^I have a driver$/, function () { - }); - - this.When(/^I start a `Transaction` through a session$/, function () { - this.transaction = this.session.beginTransaction() - }); - - this.When(/^`run` a query with that same session without closing the transaction first$/, function (callback) { - var self = this; - this.session.run("CREATE (:n)").then(function(result) {callback()}).catch(function(err) {self.error = err; callback()}) - }); - - this.Then(/^it throws a `ClientException`$/, function (table) { - var expected = table.rows()[0][0]; - if (!this.error) { - throw new Error("Expected an error but got none.") - } - if (this.error.message.indexOf(expected) != 0) { - if (!(expected == "Unsupported URI scheme:" || expected == "Unable to connect to" )) - { - throw new Error("Error messages do not match. Given: '" + this.error.message + "'. Expected: '" + expected + "'"); - } - } - }); - - this.When(/^I start a new `Transaction` with the same session before closing the previous$/, function () { - try { - this.session.beginTransaction(); - } catch (e) { - this.error = e; - } - - }); - - this.When(/^I run a non valid cypher statement$/, function (callback) { - var self = this; - this.session.run("CRETE (:n)").then(function(result) {callback()}).catch(function(err) {self.error = err; callback()}) - }); - - this.When(/^I set up a driver to an incorrect port$/, function (callback) { - var self = this; - var driver = neo4j.driver("bolt://localhost:7777", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password)); - var session = driver.session(); - session.run('RETURN 1') - .catch(error => { - self.error = error; - }) - .then(() => { - driver.close(); - callback(); - }); - }); - - this.When(/^I set up a driver with wrong scheme$/, function (callback) { - try { - neo4j.driver("wrong://localhost:7474", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password)); - } catch (e){ - this.error = e; - callback(); - } - }); - -}; diff --git a/test/v1/tck/steps/matchacceptencesteps.js b/test/v1/tck/steps/matchacceptencesteps.js deleted file mode 100644 index 4840223f8..000000000 --- a/test/v1/tck/steps/matchacceptencesteps.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var util = require("./util") - -module.exports = function () { - - this.Given(/^init: (.*)$/, function (statement) { - return this.session.run(statement); - }); - - this.When(/^running: (.*)$/, function (statement) { - this.rc = this.session.run(statement); - }); - - this.When(/^running parametrized: (.*)$/, function (statement, table) { - var param = util.literalTableToTestObject(table.hashes())[0]; - this.rc = this.session.run(statement, param); - }); - - - this.Then(/^result:$/, function (table, callback) { - this.expectedResults = util.literalTableToTestObject(table.hashes()); - var self = this; - var errorCallback = function(err) {callback(new Error("Rejected Promise: " + err))}; - var successCallback = function(res) { - var givenResults = []; - var expectedPrint = printable(self.expectedResults); - for (var i = 0 ; i < res.records.length; i++) { - givenResults.push(getTestObject(res.records[i])); - } - if ( givenResults.length != self.expectedResults.length) { - callback(new Error("Given and expected length of result array does not match.\n" + - "Given length: " + givenResults.length + " Expected length" + self.expectedResults.length + "\n" + - "Given: " + printable(givenResults) + " Expected: " + expectedPrint)); - } - if (!compareResults(givenResults, self.expectedResults) ) { - callback(new Error("Given and expected results does not match: " + printable(givenResults) + " Expected " + expectedPrint)); - } - callback(); - }; - this.rc.then(successCallback).catch(errorCallback); - }); - - - function compareResults(given, expected) { - if (! (typeof given === "object" && given instanceof Array) ) { - throw new Error("Should be type Array") - } - if (! (typeof expected === "object" && expected instanceof Array) ) { - throw new Error("Should be type Array") - } - for (var i = 0 ; i < given.length ; i++ ) { - var sizeExpected = expected.length; - for ( var j = 0 ; j < expected.length ; j++ ) { - if ( compareResultObjects(given[i], expected[j]) ) { - expected.splice(j,1); - break; - } - } - if (sizeExpected === expected.length) { - return false; - } - } - return true; - } - - function compareResultObjects(given, expected) { - var keys = Object.keys(given); - var keysExpected = Object.keys(expected); - keys.sort(); - keysExpected.sort(); - if (!util.compareValues(keys, keysExpected)) { - return false; - } - for ( var i = 0 ; i < keys.length ; i++ ) { - if (!util.compareValues(given[keys[i]], expected[keys[i]])) - { - return false; - } - } - return true; - - } - - function getTestObject(rels) { - var result = {}; - rels.forEach(function( rel, key ) { - if (typeof rel === "object" && rel instanceof Array) { - var relArray = []; - for (var i in rel) { - relArray.push(getTestValue(rel[i])); - } - result[key] = relArray; - } - else { - result[key] = getTestValue(rel); - } - }); - return result; - } - - function getTestValue(val) { - if ( val === null) { - return val; - } - var con = val.constructor.name.toLowerCase(); - if (con === util.NODE) { - return stripNode(val); - } - else if (con === util.RELATIONSHIP) { - return stripRelationship(val); - } - else if (con === util.PATH) { - return stripPath(val); - } - else { - return val; - } - } - - function stripRelationship(rel) { - rel.start = neo4j.int(0); - rel.end = neo4j.int(0); - rel.identity = neo4j.int(0); - return rel; - } - - function stripNode(node) { - node.identity = neo4j.int(0); - return node; - } - - function stripPath(path) { - var id = 0; - var startid = neo4j.int(path.start.identity.toString()); - var segments = path.segments; - var segment; - for (var i = 0; i < segments.length; i++) { - segment = segments[i]; - var relationship = segment.relationship; - var endId = neo4j.int(segment.end.identity.toString()); - relationship.identity = neo4j.int(0); - segment.start.identity = neo4j.int(id++); - segment.end.identity = neo4j.int(id); - - if (relationship.start.equals(startid) && relationship.end.equals(endId)) { - relationship.start = segment.start.identity; - relationship.end = segment.end.identity; - } - else if (relationship.end.equals(startid) && relationship.start.equals(endId)) { - relationship.end = segment.start.identity; - relationship.start = segment.end.identity; - } - else { - throw new Error("Path segment does not make sense") - } - startid = endId; - } - path.start.identity = neo4j.int(0); - path.end.identity = neo4j.int(id); - return path; - } - - function printable(array) { - return JSON.stringify(array); - } -}; diff --git a/test/v1/tck/steps/resultapisteps.js b/test/v1/tck/steps/resultapisteps.js deleted file mode 100644 index 8863c5386..000000000 --- a/test/v1/tck/steps/resultapisteps.js +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var resultSummary = require("../../../../lib/v1/result-summary"); -var util = require("./util") - -module.exports = function () { - - this.When(/^the `Statement Result` is consumed a `Result Summary` is returned$/, function (callback) { - var self = this; - this.rc.then(function(res) { - self.summary = res.summary; - callback(); - }).catch(function(err) {callback(new Error("Rejected Promise: " + err))}); - }); - - this.Then(/^the `Statement Result` is closed$/, function () { - //No result cursor in JavaScript Driver - }); - - this.When(/^I request a `Statement` from the `Result Summary`$/, function () { - this.statement = this.summary.statement - }); - - this.Then(/^requesting the `Statement` as text should give: (.*)$/, function (statementText) { - if (this.statement.text != statementText) { - throw Error("'" + this.statement.text + "' does not match expected text: '" + statementText + "'") - } - }); - - this.Then(/^requesting the `Statement` parameter should give: (.*)$/, function (statementParam) { - var param = util.literalValueToTestValue(statementParam); - if (typeof this.statement.parameters === 'undefined') { - this.statement.parameters = {} - } - if (!util.compareValues(this.statement.parameters, param)) { - throw Error("Params does not match! Got: " + this.statement.parameters + " Expected: " + param); - } - }); - - this.Then(/^requesting `Counters` from `Result Summary` should give$/, function (table) { - var counters = this.summary.counters; - for ( var i = 0 ; i < table.hashes().length; i++) { - var statistic = table.hashes()[i].counter; - var expected = util.literalValueToTestValueNormalIntegers(table.hashes()[i].result); - var given = getStatistic(statistic, counters) - if (!util.compareValues(given, expected)) { - throw Error("Statistics for: " + statistic + " does not match. Expected: '" + expected + "' Given: '" + given + "'"); - } - } - }); - - this.Then(/^requesting the `Statement Type` should give (.*)$/, function (type) { - var type = getStatementTypeFromString(type); - if (this.summary.statementType != type) - { - throw Error("statementType does not match. Expected: '" + type + "' Given: '" + this.summary.statementType + "'"); - } - }); - - this.Then(/^the `Result Summary` has a `Plan`$/, function () { - if(! this.summary.hasPlan()) { - throw Error("Expected summary to have a `plan`. It did not..."); - } - }); - - this.Then(/^the `Result Summary` does not have a `Plan`$/, function () { - if(this.summary.hasPlan()) { - throw Error("Expected summary to NOT have a `plan`. It did not..."); - } - }); - - this.Then(/^the `Result Summary` has a `Profile`$/, function () { - if(! this.summary.hasProfile()) { - throw Error("Expected summary to have a `profile plan`. It did not..."); - } - }); - - this.Then(/^the `Result Summary` does not have a `Profile`$/, function () { - if( this.summary.hasProfile()) { - throw Error("Expected summary to NOT have a `profile plan`. It did..."); - } - }); - - this.Then(/^requesting the `Plan` it contains$/, function (table) { - checkPlanExact(table, this.summary.plan) - }); - - this.Then(/^the `Plan` also contains method calls for:$/, function (table) { - checkPlan(table, this.summary.plan) - }); - - this.Then(/^requesting the `Profile` it contains:$/, function (table) { - checkPlanExact(table, this.summary.profile) -}); - -this.Then(/^the `Profile` also contains method calls for:$/, function (table) { - checkPlan(table, this.summary.profile) -}); - -this.Then(/^the `Result Summary` `Notifications` is empty$/, function () { - if (! this.summary.notifications.length == 0) { - throw Error("Expected no notifications. Got: " + this.summary.notifications.length) - } -}); - -this.Then(/^the `Result Summary` `Notifications` has one notification with$/, function (table) { - - var expected = {}; - if (this.summary.notifications.length > 1) { - throw Error("Expected only one notification. Got: " + this.summary.notifications.length) - } - var givenNotification = this.summary.notifications[0]; - var given = {} - for ( var i = 0 ; i < table.hashes().length; i++) { - var key = table.hashes()[i]['key'] - expected[key] = util.literalValueToTestValueNormalIntegers(table.hashes()[i]['value']); - given[key] = givenNotification[key] - } - if (Object.keys(givenNotification).length !== Object.keys(given).length) { - throw Error("Keys do not match with expected. Got: " + Object.keys(givenNotification) + " Expected: " + Object.keys(given)) - } - - // Do not compare notification positions. They differ by Neo4j database version - delete expected['position']; - delete given['position']; - - if (!util.compareValues(expected, given)) { - throw Error("Summary notifications does not match. Expected: '" + util.printable(expected) + "' Given: '" + util.printable(givenNotification) + "'"); - } -}); - - function checkPlanExact(table, plan) - { - for ( var i = 0 ; i < table.hashes().length; i++) { - var dataKey = getPlanParam(table.hashes()[i]["plan method"]) - var given = plan[dataKey]; - if (given === undefined || given === null || given === NaN) { - throw Error("Plans `" + dataKey + "` has no content! Got: " + given); - } - } - } - - function checkPlan(table, plan) - { - for ( var i = 0 ; i < table.hashes().length; i++) { - var dataKey = getPlanParam(table.hashes()[i]["plan method"]) - var given = plan[dataKey]; - if (given === undefined || given === null || given === NaN) { - throw Error("Plans `" + dataKey + "` has no content! Got: " + given); - } - } - } - - function getPlanParam(key) { - if (key == 'operator type') { - return 'operatorType' - } - if (key == 'db hits') { - return 'dbHits' - } - if (key == 'records') { - return 'rows' - } - else { - return key - } - } - - function getStatementTypeFromString(type) { - if (type == 'read write') { - return resultSummary.statementType.READ_WRITE; - } - if (type == 'read only') { - return resultSummary.statementType.READ_ONLY; - } - if (type == 'write only') { - return resultSummary.statementType.WRITE_ONLY; - } - if (type == 'schema write') { - return resultSummary.statementType.SCHEMA_WRITE; - } - throw Error("No statement type mapping of: " + type) - } - - function getStatistic(statementString, counters) { - if (statementString == 'nodes created') { - return counters.nodesCreated(); - } - if (statementString == 'nodes deleted') { - return counters.nodesDeleted(); - } - if (statementString == 'relationships created') { - return counters.relationshipsCreated(); - } - if (statementString == 'relationships deleted') { - return counters.relationshipsDeleted(); - } - if (statementString == 'properties set') { - return counters.propertiesSet(); - } - if (statementString == 'labels added') { - return counters.labelsAdded(); - } - if (statementString == 'labels removed') { - return counters.labelsRemoved(); - } - if (statementString == 'indexes added') { - return counters.indexesAdded(); - } - if (statementString == 'indexes removed') { - return counters.indexesRemoved(); - } - if (statementString == 'constraints added') { - return counters.constraintsAdded(); - } - if (statementString == 'constraints removed') { - return counters.constraintsRemoved(); - } - if (statementString == 'contains updates') { - return counters.containsUpdates(); - } - throw Error("No statistics mapping of: " + statementString) - } - -}; diff --git a/test/v1/tck/steps/tlssteps.js b/test/v1/tck/steps/tlssteps.js deleted file mode 100644 index 2eaee3afa..000000000 --- a/test/v1/tck/steps/tlssteps.js +++ /dev/null @@ -1,195 +0,0 @@ -var neo4j = require("../../../../lib/v1"); -var util = require("./util"); -var sharedNeo4j = require("../../../internal/shared-neo4j").default; - -var CALLBACK_TIMEOUT = 60 * 1000; - -module.exports = function () { - - this.Given(/^a running Neo(\d+)j Database$/, {timeout: CALLBACK_TIMEOUT}, function (ignored, callback) { - if (this.driver1) this.driver1.close(); - if (this.driver2) this.driver2.close(); - util.changeCertificates('./test/resources/derived.key', './test/resources/derived.cert'); - util.restart(); - callback(); - }); - - this.When(/^I connect via a TLS\-enabled transport for the first time for the given hostname and port$/, function (callback) { - this.driver1 = _connectWithHostFile(this.knownHosts1); - callback(); - }); - - this.Then(/^sessions should simply work$/, {timeout: CALLBACK_TIMEOUT}, function (callback) { - var self = this; - var session = self.driver1.session(); - session.run("RETURN 1").then(function (result) { - session.close(); - _closeDrivers(self.driver1, self.driver2); - callback(); - }).catch(function (error) { - _closeDrivers(self.driver1, self.driver2); - console.log(error); - }); - }); - - this.Given(/^a running Neo(\d+)j Database that I have connected to with a TLS\-enabled transport in the past$/, - {timeout: CALLBACK_TIMEOUT}, function (arg1, callback) { - util.changeCertificates('./test/resources/derived.key', './test/resources/derived.cert'); - var self = this; - util.restart(); - var driver = _connectWithHostFile(self.knownHosts1); - driver.session().run("RETURN 1").then(function (result) { - driver.close(); - callback(); - }); - }); - - this.When(/^I connect via a TLS\-enabled transport again$/, function (callback) { - this.driver1 = _connectWithHostFile(this.knownHosts1); - callback(); - }); - - this.Given(/^the database has changed which certificate it uses$/, {timeout: CALLBACK_TIMEOUT}, function (callback) { - util.changeCertificates('./test/resources/other.key', './test/resources/other.cert'); - util.restart(); - callback(); - }); - - this.Then(/^creating sessions should fail$/, {timeout: CALLBACK_TIMEOUT}, function (callback) { - var session = this.driver1.session(); - var self = this; - session.run("RETURN 1") - .then(function(res) { - _closeDrivers(self.driver1, self.driver2); - console.log(res); - }) - .catch(function (error) { - self.error = error; - session.close(); - _closeDrivers(self.driver1, self.driver2); - callback(); - }); - }); - - this.Then(/^I should get a helpful error explaining that the certificate has changed$/, function (string, callback) { - - var expected = "Database encryption certificate has changed, and no longer matches the " + - "certificate stored for localhost:7687 in `known_hosts1`. As a security precaution, this driver will not " + - "automatically trust the new certificate, because doing so would allow an attacker to pretend to be the " + - "Neo4j instance we want to connect to. The certificate provided by the server looks like: [object Object]. " + - "If you trust that this certificate is valid, simply remove the line starting with localhost:7687 in `known_hosts1`, " + - "and the driver will update the file with the new certificate. You can configure which file the driver should use " + - "to store this information by setting `knownHosts` to another path in your driver configuration - " + - "and you can disable encryption there as well using `encrypted:\"ENCRYPTION_OFF\"`."; - - _closeDrivers(this.driver1, this.driver2); - - if (this.error.message !== expected) { - callback(new Error("Given and expected results does not match: " + this.error.message + " Expected " + expected)); - } else { - callback(); - } - }); - - this.Given(/^two drivers$/, function (callback) { - callback(); - }); - - this.When(/^I configure one of them to use a different location for its known hosts storage$/, function (callback) { - this.driver1 = _connectWithHostFile(this.knownHosts1); - this.driver2 = _connectWithHostFile(this.knownHosts2); - callback(); - }); - - this.Then(/^the two drivers should not interfere with one another's known hosts files$/, function (callback) { - var session1 = this.driver1.session(); - var self = this; - session1.run("RETURN 1").then(function (result) { - session1.close(); - var session2 = self.driver2.session(); - session2.run("RETURN 1").then(function (result) { - session2.close(); - _closeDrivers(self.driver1, self.driver2); - callback(); - }); - }); - }); - - this.Given(/^a driver configured to use a trusted certificate$/, function (callback) { - this.config = { - encrypted: "ENCRYPTION_ON", - trust: "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES", - knownHosts: this.knownHosts1, - trustedCertificates: ['./test/resources/root.cert'] - }; - - callback(); - }); - - this.Given(/^a running Neo(\d+)j Database using a certificate signed by the same trusted certificate$/, - {timeout: CALLBACK_TIMEOUT}, function (arg1, callback) { - util.changeCertificates('./test/resources/derived.key', './test/resources/derived.cert'); - util.restart(); - callback(); - }); - - this.When(/^I connect via a TLS\-enabled transport$/, function (callback) { - this.driver1 = neo4j.driver("bolt://localhost", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password), this.config); - callback(); - }); - - this.Given(/^a running Neo(\d+)j Database using that exact trusted certificate$/, {timeout: CALLBACK_TIMEOUT}, function (arg1, callback) { - //will have to hack a little bit here since the root cert cannot be used by the server since its - //common name is not set to localhost - this.config = { - encrypted: "ENCRYPTION_ON", - trust: "TRUST_CUSTOM_CA_SIGNED_CERTIFICATES", - knownHosts: this.knownHosts1, - trustedCertificates: [util.neo4jCert] - }; - - util.changeCertificates('./test/resources/other.key', './test/resources/other.cert'); - util.restart(); - callback(); - }); - - this.Given(/^a running Neo(\d+)j Database using a certificate not signed by the trusted certificate$/, {timeout: CALLBACK_TIMEOUT}, - function (arg1, callback) { - util.changeCertificates('./test/resources/other.key', './test/resources/other.cert'); - util.restart(); - callback(); - }); - - this.Then(/^I should get a helpful error explaining that no trusted certificate found$/, function (callback) { - var expected = "Server certificate is not trusted. If you trust the database you are connecting to, add the signing " + - "certificate, or the server certificate, to the list of certificates trusted by this driver using " + - "`neo4j.v1.driver(.., { trustedCertificates:['path/to/certificate.crt']}). This is a security measure to protect " + - "against man-in-the-middle attacks. If you are just trying Neo4j out and are not concerned about encryption, " + - "simply disable it using `encrypted=\"ENCRYPTION_OFF\"` in the driver options. Socket responded with: DEPTH_ZERO_SELF_SIGNED_CERT"; - - _closeDrivers(this.driver1, this.driver2); - - if (this.error.message !== expected) { - callback(new Error("Given and expected results does not match: " + this.error.message + " Expected " + expected)); - } else { - callback(); - } - }); - - function _connectWithHostFile(hostFile) { - return neo4j.driver("bolt://localhost", neo4j.auth.basic(sharedNeo4j.username, sharedNeo4j.password), { - trust: "TRUST_ON_FIRST_USE", - knownHosts: hostFile, - encrypted: "ENCRYPTION_ON" - }); - } - - function _closeDrivers() { - for (var i = 0; i < arguments.length; i++) { - var driver = arguments[i]; - if (driver) { - driver.close(); - } - } - } -}; diff --git a/test/v1/tck/steps/tyepesystemsteps.js b/test/v1/tck/steps/tyepesystemsteps.js deleted file mode 100644 index cc6f41aab..000000000 --- a/test/v1/tck/steps/tyepesystemsteps.js +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var util = require("./util"); - -module.exports = function () { - - this.Given(/^A running database$/, function () { - return this.session.run("RETURN 1 AS one"); - }); - - this.Given(/^a String of size (\d+)$/, function (size) { - this.expectedValue = stringOfSize(size); - }); - - this.Given(/^a List of size (\d+) and type (.*)$/, function (size, type) { - var list = []; - for(var i = 0; i < size; i++ ) { - if (type.toLowerCase() === util.STRING) { - list.push(stringOfSize(3)); - } - else if (type.toLowerCase() === util.INT) { - list.push(randomInt()); - } - else if (type.toLowerCase() === util.BOOL) { - list.push(randomBool()); - } - else if (type.toLowerCase() === util.FLOAT) { - list.push(randomFloat()); - } - else if (type.toLowerCase() === util.NULL) { - list.push(null); - } - else { - throw new Error("No such type: " + type); - } - } - this.expectedValue = list; - }); - - this.Given(/^a Map of size (\d+) and type (.*)$/, function (size, type) { - var map = {}; - for(var i = 0; i < size; i++ ) { - if (type.toLowerCase() === util.STRING) { - map["a" + util.sizeOfObject(this.M)] = stringOfSize(3); - } - else if (type.toLowerCase() === util.INT) { - map["a" + util.sizeOfObject(this.M)] = randomInt(); - } - else if (type.toLowerCase() === util.BOOL) { - map["a" + util.sizeOfObject(this.M)] = randomBool(); - } - else if (type.toLowerCase() === util.FLOAT) { - map["a" + util.sizeOfObject(this.M)] = randomFloat(); - } - else if (type.toLowerCase() === util.NULL) { - map["a" + util.sizeOfObject(this.M)] = null; - } - else { - throw new Error("No such type: " + type); - } - } - this.expectedValue = map; - }); - - this.Given(/^a value (.*)$/, function (input) { - this.expectedValue = util.literalValueToTestValue(input); - }); - - this.Given(/^a list containing$/, function (table) { - var rows = table.rows() - this.expectedValue = []; - for (var i = 0, len = rows.length; i < len; i++) { - this.expectedValue.push(util.literalValueToTestValue(rows[i])); - } - }); - - this.When(/^adding this list to itself$/, function () { - var clone = []; - for (var i = 0, len = this.expectedValue.length; i < len; i++) { - clone.push(util.clone(this.expectedValue[i])); - } - this.expectedValue.push([]); - }); - - this.Given(/^a map containing$/, function (table) { - var rows = table.rows() - this.expectedValue = {} - for (var i = 0, len = rows.length; i < len; i++) { - var key = util.literalValueToTestValue(rows[i][0]) - var value = util.literalValueToTestValue(rows[i][1]) - this.expectedValue[key] = value; - } - }); - - this.Given(/^adding this map to itself with key "(.*)"$/, function (key) { - var clone = util.clone(this.expectedValue); - this.expectedValue[key] = clone; - }); - - this.When(/^the driver asks the server to echo this value back$/, function () { - echoExpectedValue.call(this); - }); - - this.When(/^the driver asks the server to echo this list back$/, function () { - echoExpectedValue.call(this); - }); - - this.When(/^the driver asks the server to echo this map back$/, function () { - echoExpectedValue.call(this); - }); - - - this.Then(/^the value given in the result should be the same as what was sent$/, function (callback) { - var self = this; - var errorCallback = function(err) {callback(new Error("Rejected Promise: " + err))} - var successCallback = function(res) { - if(res.records.length != 1 || res.records[0].length != 1) { - callback(new Error("Expected the statement to return a single record, single field record. Got: " + res.records.length + " records and: " + res.records[0].length + " values")); - } - - if (!util.compareValues(res.records[0].get('x'), self.expectedValue)) { - callback(new Error("Expected the statement to return same as what was sent. Got: " + res.records[0].get('x') + " Expected: " + self.expectedValue)); - } - callback(); - }; - this.withParamPromise.then(successCallback).catch(errorCallback); - this.withLiteralPromise.then(successCallback).catch(errorCallback); - }); - - function stringOfSize(size) { - var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - return new Array(size).join().split(',').map(function() { return chars.charAt(Math.floor(Math.random() * chars.length)); }).join(''); - } - - function randomBool() - { - return Math.random() >= 0.5 - } - - function randomInt() - { - return neo4j.int(Math.floor(Math.random() * (2147483647 + 2147483648 + 1)) - 2147483648); - } - - function randomFloat() - { - return Math.random() - } - - function toParameter(type, value) { - - if (type.toLowerCase() === STRING) { - return value.toString(); - } - if (type.toLowerCase() === INT) { - return neo4j.int(value); - } - if (type.toLowerCase() === BOOL) { - return Boolean(value); - } - if (type.toLowerCase() === FLOAT) { - return parseFloat(value); - } - if (type.toLowerCase() === NULL) { - return null; - } - else { - throw new Error("Cannot conversion of type:" + type + " has not been implemented" ); - } - } - - function jsToCypherLiteral(jsVal) { - if( typeof jsVal === "string" || jsVal instanceof String ) { - return '"' + jsVal + '"'; - } - else if( neo4j.isInt(jsVal) ) { - return jsVal.toString(); - } - else if( typeof jsVal === "boolean") { - return jsVal.toString(); - } - //number is float - else if( typeof jsVal === "number") { - var f = jsVal.toString(); - if (!(f.indexOf("e") != -1 || f.indexOf("E") != -1)) { - if (f.indexOf(".") == -1) { - return jsVal.toFixed(1).toString(); - } - } - return f.replace("+", ""); - } - else if( jsVal === undefined || jsVal === null) { - return 'Null'; - } - else if( typeof jsVal === "object" && jsVal instanceof Array ) { - var list = "["; - for(var i = 0; i < jsVal.length; i++ ) { - list += jsToCypherLiteral(jsVal[i]); - if ( i < jsVal.length -1) { - list += ","; - } - } - return list += "]"; - } - else if( typeof jsVal === "object" && jsVal instanceof Object ) { - var map = "{" - for(var key in jsVal) { - var new_key = key; - map += new_key + ":" + jsToCypherLiteral(jsVal[key]); - map += ","; - } - map = map.slice(0,-1); - return map += "}"; - } - else { - throw new Error("Cannot convert " + jsVal); - } - } - - function echoExpectedValue() { - this.withParamPromise = this.session.run("RETURN {x} as x", {x:this.expectedValue}); - this.withLiteralPromise = this.session.run("RETURN "+jsToCypherLiteral(this.expectedValue)+" as x"); - } - -}; diff --git a/test/v1/tck/steps/util.js b/test/v1/tck/steps/util.js deleted file mode 100644 index 4705569c6..000000000 --- a/test/v1/tck/steps/util.js +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Copyright (c) 2002-2019 "Neo4j," - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with 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. - */ - -var neo4j = require("../../../../lib/v1"); -var sharedNeo4j = require("../../../internal/shared-neo4j").default; - -const INT = 'integer'; -const FLOAT = 'float'; -const STRING = 'string'; -const BOOL = 'boolean'; -const NULL = 'null'; -const RELATIONSHIP = 'relationship'; -const NODE = 'node'; -const PATH = 'path'; - -var fs = require('fs'); -var path = require('path'); - -var neo4jHome = path.join('build', 'neo4j'); -var neo4jCert = sharedNeo4j.neo4jCertPath(neo4jHome); -var neo4jKey = sharedNeo4j.neo4jKeyPath(neo4jHome); - -function literalTableToTestObject(literalResults) { - var resultValues = []; - for ( var i = 0 ; i < literalResults.length ; i++) { - resultValues.push(literalLineToObjects(literalResults[i])); - } - return resultValues; -} - -function literalLineToObjects(resultRow) { - var resultObject = {}; - for ( var key in resultRow) - { - resultObject[key] = literalValueToTestValue(resultRow[key]); - } - return resultObject; -} - -function literalValueToTestValueNormalIntegers(values) { - return literalValueToTestObject(values, false) -} - -function literalValueToTestValue(values) { - return literalValueToTestObject(values, true) -} - -function literalValueToTestObject(values, bigInt) { - if (isLiteralArray(values)) { - values = getLiteralArray(values); - } - if (isLiteralMap(values)) { - return parseMap(values, bigInt); - } - if (values instanceof Array) { - var res = []; - for (var i in values) { - res.push(literalValueToTestValue(values[i])); - } - } - else { - var res = convertValue(values, bigInt); - } - return res; -} - -function convertValue(value, bigInt) { - if (value === NULL) { - return null; - } - else if (value === "true" || value === "false"){ - return Boolean(value); - } - else if (value.charAt(0) === '"' && value.charAt(value.length-1) === '"') { - return value.substring(1, value.length-1); - } - else if (value.indexOf('[:') === 0 && value.indexOf(']') === value.length-1) { - return createUndirectedRelationship(value); - } - else if (value.indexOf('(') === 0 && value.indexOf(')') === value.length-1) { - return createNode(value); - } - else if (value.indexOf('<(') === 0 && value.indexOf(')>') === value.length-2) { - return createPath(value); - } - if (value.match( "^(-?[0-9]+)$")) { - if (bigInt) - { - return neo4j.int(value) - } - else { - return parseInt(value) - } - } - return parseFloat(value); -} - - -function createUndirectedRelationship(val) { - var base = createBaseRelationship(val); - return base; -} - -function createDirectedRelationship(val, n1, n2) { - var base = createBaseRelationship(val); - if (val.indexOf("->") <0 ) { - base.end = n1; - base.start = n2; - } - else if (val.indexOf("<-") <0 ) { - base.start = n1; - base.end = n2; - } - else { - throw new Error("Not a directed relationship: " + val); - } - return base; -} - -function createBaseRelationship(val) { - var rel = {} - val = val.substring(val.indexOf("[")); - val = val.substring(0, val.indexOf("]")); - rel.properties = getProperties(val); - rel.type = getType(val); - rel.identity = neo4j.int(0); - rel.start = neo4j.int(0); - rel.end = neo4j.int(0); - return rel; -} - -function createNode(val) { - var node = {} - val = val.substring(val.indexOf("(")); - val = val.substring(0, val.indexOf(")")); - node.properties = getProperties(val); - node.labels = getLabels(val); - node.identity = neo4j.int(0); - return node; -} - -function createPath(val) { - var path = {} - val = val.substring(1, val.length -1); - var entities = parseNodesAndRelationshipsFromPath(val); - path.start = entities[0]; - path.end = entities[entities.length-1]; - path.length = (entities.length - 1) / 2; - path.segments = []; - if (entities.length > 2) { - for (var i = 0; i < entities.length-2; i+=2) { - var segment = {"start": entities[i], - "end": entities[i+2], - "relationship": entities[i+1]}; - path.segments.push(segment); - } - } - return path; -} - -function parseNodesAndRelationshipsFromPath(val) { - var first = val.split(")"); - var nodesAndRels = []; - var id = 0; - for (var i = 0; i < first.length-1 ; i++) { - var second = first[i].split("("); - var node = createNode("(" + second[1] + ")"); - node.identity = neo4j.int(id++); - if (i > 0) { - var rel= createDirectedRelationship(second[0], nodesAndRels[nodesAndRels.length-1].identity, node.identity) - nodesAndRels.push(rel); - } - nodesAndRels.push(node); - } - return nodesAndRels; -} - -function parseMap(val, bigInt) { - if (bigInt) - { - return JSON.parse(val, function(k, v) { - if (Number.isInteger(v)) { - return neo4j.int(v); - } - return v; - }); - } - else { - return JSON.parse(val); - } -} - -function getProperties(val) { - var startIndex = val.indexOf("{"); - var endIndex = val.indexOf("}"); - if (!(startIndex >= 0 && endIndex >= 0)) { - return {}; - } - val = val.substring(startIndex, endIndex + 1); - return parseMap(val, true) -} - -function printable(array) { - return JSON.stringify(array); -} - -function getType(val) { - var labels = getLabels(val); - if (labels.length > 1) { - throw new Error("Should be single type. Found many: " + labels) - } - if (labels.length === 0) { - return []; - } - return labels[0]; -} - -function getLabels(val) { - var startIndex = val.indexOf("{"); - var endIndex = val.indexOf("}"); - if ((startIndex >= 0 && endIndex >= 0)) { - val = val.substring(0, startIndex) + val.substring(endIndex + 1, val.length); - } - val = val.substring(val.indexOf(":"), val.length); - if (val.indexOf(" ") > 0) { - val = val.substring(0, val.indexOf(" ")); - } - if ( val.indexOf(":") < 0) { - return []; - } - var labels = val.split(":") - labels.splice(0, labels.length-1); - return labels; -} - - -function isLiteralArray(result) { - if (result[0] == '[' && result[result.length - 1] == ']') - { - if (result[1] != ":") { - return true; - } - } - return false; -} - -function isLiteralMap(result) { - return result[0] == '{' && result[result.length - 1] == '}'; -} - -function getLiteralArray(result) { - result = result.substring(1, result.length - 1); - return result.split(', '); -} - -function compareValues(given, expected) { - if(given === undefined || expected === undefined) { - throw new Error("Got undefined"); - } - if (neo4j.isInt(given)) { - if (given.equals(expected)) { - return true; - } - } - else if (typeof given === "object" && given instanceof Array){ - if (sizeOfObject(given) != sizeOfObject(expected)) return false; - for (var i = 0; i < given.length; ++i) { - if (!compareValues(given[i], expected[i])) { - return false; - } - } - return true; - } - else if (typeof given === "object" && given instanceof Object){ - if (given.length != expected.length) return false; - var keys = Object.keys(given); - var keysExpected = Object.keys(expected); - keys.sort(); - keysExpected.sort(); - if (!compareValues(keys, keysExpected)) { - return false; - } - for (var key in given) { - if (typeof expected[key] == "undefined") return false; - if (!compareValues(given[key], expected[key])) { - return false; - } - } - return true; - } - else if (given === expected) { - return true; - } - return false; -} - -function sizeOfObject(obj) { - var size = 0, key; - for (key in obj) { - if (obj.hasOwnProperty(key)) size++; - } - return size; -} - -function clone(obj) { - if (null == obj || "object" != typeof obj) return obj; - if (obj.constructor.name.toLowerCase() === INT ) return obj; - var copy = obj.constructor(); - for (var attr in obj) { - if (obj.hasOwnProperty(attr)) { - copy[attr] = clone(obj[attr]); - } - } - return copy; -} - -Number.isInteger = Number.isInteger || function(value) { - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; - -function changeCertificates(keyFile, certFile) { - var key = fs.readFileSync(keyFile); - fs.writeFileSync(neo4jKey, key); - var cert = fs.readFileSync(certFile); - fs.writeFileSync(neo4jCert, cert); -} - -function restart() { - sharedNeo4j.restart(neo4jHome); -} - -module.exports = { - literalTableToTestObject: literalTableToTestObject, - literalValueToTestValueNormalIntegers : literalValueToTestValueNormalIntegers, - literalValueToTestValue: literalValueToTestValue, - compareValues: compareValues, - sizeOfObject: sizeOfObject, - clone: clone, - printable: printable, - changeCertificates: changeCertificates, - restart: restart, - neo4jCert: neo4jCert, - INT: INT, - FLOAT: FLOAT, - STRING: STRING, - BOOL: BOOL, - NULL: NULL, - NODE: NODE, - RELATIONSHIP: RELATIONSHIP, - PATH: PATH -}; diff --git a/test/v1/transaction.test.js b/test/v1/transaction.test.js index 407a30e58..46b03584b 100644 --- a/test/v1/transaction.test.js +++ b/test/v1/transaction.test.js @@ -16,9 +16,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import neo4j from '../../src/v1'; +import neo4j, {Neo4jError} from '../../src/v1'; import sharedNeo4j from '../internal/shared-neo4j'; import {ServerVersion, VERSION_3_1_0} from '../../src/v1/internal/server-version'; +import {newError} from "../../src/v1/error"; describe('transaction', () => { @@ -62,10 +63,7 @@ describe('transaction', () => { }).catch(console.log); }); - it('should populate resultAvailableAfter for transaction#run when using 3.1 and onwards', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } + it('should populate resultAvailableAfter for transaction#run', done => { const tx = session.beginTransaction(); tx.run("CREATE (:TXNode1)").then(result => { tx.commit().then(() => { @@ -229,10 +227,6 @@ describe('transaction', () => { }); it('should provide bookmark on commit', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - // new session without initial bookmark session = driver.session(); expect(session.lastBookmark()).toBeNull(); @@ -249,10 +243,6 @@ describe('transaction', () => { }); it('should have bookmark when tx is rolled back', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - // new session without initial bookmark session = driver.session(); expect(session.lastBookmark()).toBeNull(); @@ -284,10 +274,6 @@ describe('transaction', () => { }); it('should have no bookmark when tx fails', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - // new session without initial bookmark session = driver.session(); expect(session.lastBookmark()).toBeNull(); @@ -319,10 +305,6 @@ describe('transaction', () => { }); it('should fail for invalid bookmark', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - const invalidBookmark = 'hi, this is an invalid bookmark'; const tx = session.beginTransaction(invalidBookmark); tx.run('RETURN 1').catch(error => { @@ -332,10 +314,6 @@ describe('transaction', () => { }); it('should fail to run query for unreachable bookmark', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - const tx1 = session.beginTransaction(); tx1.run('CREATE ()').then(result => { expect(result.summary.counters.nodesCreated()).toBe(1); @@ -404,10 +382,6 @@ describe('transaction', () => { }); it('should expose server info on successful query', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - const statement = 'RETURN 1'; const tx = session.beginTransaction(); @@ -421,10 +395,6 @@ describe('transaction', () => { }); it('should expose server info on successful query using observer', done => { - if (neo4jVersionOlderThan31(done)) { - return; - } - // Given const statement = 'RETURN 1'; @@ -549,14 +519,6 @@ describe('transaction', () => { expect(session.lastBookmark()).not.toBeNull(); } - function neo4jVersionOlderThan31(done) { - if (serverVersion.compareTo(VERSION_3_1_0) < 0) { - done(); - return true; - } - return false; - } - function testConnectionTimeout(encrypted, done) { const boltUri = 'bolt://10.0.0.0'; // use non-routable IP address which never responds const config = {encrypted: encrypted, connectionTimeout: 1000}; diff --git a/test/v1/types.test.js b/test/v1/types.test.js index e87b0851e..dad2b70dd 100644 --- a/test/v1/types.test.js +++ b/test/v1/types.test.js @@ -22,6 +22,10 @@ import sharedNeo4j from '../internal/shared-neo4j'; import _ from 'lodash'; import {ServerVersion, VERSION_3_2_0} from '../../src/v1/internal/server-version'; +describe('null value', () => { + it('should support null', testValue(null)); +}); + describe('floating point values', () => { it('should support float 1.0 ', testValue(1)); it('should support float 0.0 ', testValue(0.0)); @@ -48,6 +52,7 @@ describe('string values', () => { it('should support empty string ', testValue('')); it('should support simple string ', testValue('abcdefghijklmnopqrstuvwxyz')); it('should support awesome string ', testValue('All makt åt Tengil, vår befriare.')); + it('should support long string', testValue('*'.repeat(10000))) }); describe('list values', () => { @@ -58,12 +63,24 @@ describe('list values', () => { it('should support string lists ', testValue(['', 'hello!'])); it('should support list lists ', testValue([[], [1, 2, 3]])); it('should support map lists ', testValue([{}, {a: 12}])); + it('should support long list', testValue(Array.from({length: 1000}, (v, i) => i))) }); describe('map values', () => { it('should support empty maps ', testValue({})); it('should support basic maps ', testValue({a: 1, b: {}, c: [], d: {e: 1}})); it('should support sparse maps ', testValue({foo: undefined, bar: null}, {bar: null})); + + function longMap() { + const map = {}; + for (let i = 0; i < 1000; i ++ ) + { + map["key"+i]=i; + } + return map; + } + + it('should support long maps', testValue(longMap())) }); describe('node values', () => {