aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/karma')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CHANGELOG.md1185
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CODE_OF_CONDUCT.md13
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/LICENSE20
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/README.md121
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/bin/karma3
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.coffee66
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.js63
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.ls66
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/karma-completion.sh50
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/binary-extensions.json136
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser.js244
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_collection.js105
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_result.js25
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/cli.js237
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/completion.js164
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/config.js304
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/constants.js30
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/emitter_wrapper.js31
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/events.js88
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/executor.js55
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/file_list.js425
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/helper.js91
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/index.js5
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init.js271
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/color_schemes.js28
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/formatters.js130
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/state_machine.js141
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launcher.js169
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/base.js128
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js44
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/process.js157
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/retry.js32
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/logger.js79
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/common.js88
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/karma.js176
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/proxy.js130
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/runner.js92
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/source_files.js59
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/strip_host.js18
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/plugin.js50
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/preprocessor.js92
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporter.js110
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base.js142
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base_color.js24
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots.js48
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots_color.js10
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/multi.js18
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress.js60
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress_color.js10
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/runner.js68
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/server.js308
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/temp_dir.js31
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/watcher.js114
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/web-server.js74
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/package.json878
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.coffee22
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.js24
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/client.html114
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/context.html35
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/debug.html57
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/favicon.icobin0 -> 5430 bytes
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/karma.js407
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/wallaby.js49
63 files changed, 8014 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CHANGELOG.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CHANGELOG.md
new file mode 100644
index 00000000..e41af859
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CHANGELOG.md
@@ -0,0 +1,1185 @@
+<a name"0.12.37"></a>
+### 0.12.37 (2015-06-24)
+
+
+#### Bug Fixes
+
+* **file_list:** follow symlinks ([ee267483](https://github.com/karma-runner/karma/commit/ee267483))
+* **init:** Make the requirejs config template normalize paths ([54dcce31](https://github.com/karma-runner/karma/commit/54dcce31))
+* **middleware:** Actually serve the favicon. ([f12db639](https://github.com/karma-runner/karma/commit/f12db639))
+
+
+<a name"0.12.36"></a>
+### 0.12.36 (2015-06-04)
+
+
+#### Bug Fixes
+
+* **launcher:** Continue with exit when SIGKILL fails ([1eaccb4c](https://github.com/karma-runner/karma/commit/1eaccb4c))
+* **preprocessor:** Lookup patterns once invoked ([00a27813](https://github.com/karma-runner/karma/commit/00a27813), closes [#1340](https://github.com/karma-runner/karma/issues/1340))
+
+
+<a name"0.12.35"></a>
+### 0.12.35 (2015-05-29)
+
+
+#### Bug Fixes
+
+* **server:** Start webserver and browsers after preprocessing completed ([e0d2d239](https://github.com/karma-runner/karma/commit/e0d2d239))
+
+
+<a name"0.12.34"></a>
+### 0.12.34 (2015-05-29)
+
+
+#### Bug Fixes
+
+* **cli:** Use `bin` field in package.json ([6823926f](https://github.com/karma-runner/karma/commit/6823926f), closes [#1351](https://github.com/karma-runner/karma/issues/1351))
+* **client:** dynamic protocol for socket.io ([c986eefe](https://github.com/karma-runner/karma/commit/c986eefe), closes [#1400](https://github.com/karma-runner/karma/issues/1400))
+* **deps:** Update dependencies ([b9a4ce98](https://github.com/karma-runner/karma/commit/b9a4ce98))
+
+
+#### Features
+
+* **runner:** Use favicon in static runner pages ([6cded4f8](https://github.com/karma-runner/karma/commit/6cded4f8))
+
+
+<a name"0.12.33"></a>
+### 0.12.33 (2015-05-26)
+
+
+#### Bug Fixes
+
+* catch exceptions from SourceMapConsumer ([5d42e643](https://github.com/karma-runner/karma/commit/5d42e643))
+* Safeguard IE against console.log ([0b5ff8f6](https://github.com/karma-runner/karma/commit/0b5ff8f6), closes [#1209](https://github.com/karma-runner/karma/issues/1209))
+* **config:** Default remaining client options if any are set ([632dd5e3](https://github.com/karma-runner/karma/commit/632dd5e3), closes [#961](https://github.com/karma-runner/karma/issues/961))
+* **init:** fix test-main.(js/coffee) generation ([d8521ef4](https://github.com/karma-runner/karma/commit/d8521ef4), closes [#1120](https://github.com/karma-runner/karma/issues/1120), [#896](https://github.com/karma-runner/karma/issues/896))
+
+
+<a name="0.12.31"></a>
+### 0.12.31 (2015-01-02)
+
+
+#### Bug Fixes
+
+* **client:** Fix stringify serializing objects ([0d0972a5](http://github.com/karma-runner/karma/commit/0d0972a59e6e0354033c9fdfec72d5ddfbfe8e1e))
+
+
+<a name="0.12.30"></a>
+### 0.12.30 (2014-12-30)
+
+
+#### Bug Fixes
+
+* **socket.io:** Force 0.9.16 which works with Chrome ([840ee5f7](http://github.com/karma-runner/karma/commit/840ee5f771d547f0fd140c3728ecb92edadf835e))
+
+
+<a name="0.12.29"></a>
+### 0.12.29 (2014-12-30)
+
+
+#### Bug Fixes
+
+* **proxy:** proxy to correct port ([a483636e](http://github.com/karma-runner/karma/commit/a483636efd440c13e6db36f6b661861558464089))
+* **watcher:** Close file watchers on exit event ([71810257](http://github.com/karma-runner/karma/commit/718102572a13d7e70d1f2c0b48b6b60a766b76b2))
+
+
+<a name="0.12.28"></a>
+### 0.12.28 (2014-11-25)
+
+
+#### Bug Fixes
+
+* **server:** complete acknowledgment ([f4144b0d](http://github.com/karma-runner/karma/commit/f4144b0d2d5eafff7245301454305d2005e46449))
+
+
+<a name="0.12.27"></a>
+### 0.12.27 (2014-11-25)
+
+
+#### Bug Fixes
+
+* **browser:** don't add already active socket again on reconnect ([37a7958a](http://github.com/karma-runner/karma/commit/37a7958ae5517b8bf16e36cc90fe0b1cf0c09afd))
+* **reporter:** sourcemap not working in windows ([a9516af2](http://github.com/karma-runner/karma/commit/a9516af2af87953154e81b6080214798a9b64da5))
+
+
+<a name="0.12.26"></a>
+### 0.12.26 (2014-11-25)
+
+
+#### Bug Fixes
+
+* **cli:** override if an arg is defined multiple times ([31eb2c2c](http://github.com/karma-runner/karma/commit/31eb2c2c3ca1663eff94f0398768a9b582332a93), closes [#1192](http://github.com/karma-runner/karma/issues/1192))
+
+
+<a name="0.12.25"></a>
+### 0.12.25 (2014-11-14)
+
+
+#### Bug Fixes
+
+* add emscripten memory image as binary suffix ([f6b2b561](http://github.com/karma-runner/karma/commit/f6b2b561c5d5e083cd204df9564024cac163b611))
+* Wrap url.parse to always return an object for query property ([72452e9f](http://github.com/karma-runner/karma/commit/72452e9fce4c42dc843c1157c19c08d39e3996df), closes [#1182](http://github.com/karma-runner/karma/issues/1182))
+* **client.html:** always open debug.html in a new browser process ([d176bcf4](http://github.com/karma-runner/karma/commit/d176bcf47e9b3a7df8c6ae691f767f1012214c53))
+* **preprocessor:** calculate sha1 on content returned from a preprocessor ([6cf79557](http://github.com/karma-runner/karma/commit/6cf795576bd6d77decac68ecc4838871b6df4836), closes [#1204](http://github.com/karma-runner/karma/issues/1204))
+* **runner:** Fix typo in CSS class name for .idle ([fc5a7ce0](http://github.com/karma-runner/karma/commit/fc5a7ce0904a78ece6a9cfa29215b17bd5c1929d))
+
+
+<a name="v0.12.24"></a>
+### v0.12.24 (2014-09-30)
+
+
+#### Bug Fixes
+
+* Wrap url.parse to always return an object for query property ([72452e9f](http://github.com/karma-runner/karma/commit/72452e9fce4c42dc843c1157c19c08d39e3996df), closes [#1182](http://github.com/karma-runner/karma/issues/1182))
+
+<a name="0.12.23"></a>
+### 0.12.23 (2014-08-28)
+
+
+#### Bug Fixes
+
+* **file_list:** Incorrect response after remove and add file ([0dbc0201](http://github.com/karma-runner/karma/commit/0dbc0201b2d1f7c909f74816cc50bc68013fc70f))
+* **preprocessor:** Throw error if can't open file ([bb4edde9](http://github.com/karma-runner/karma/commit/bb4edde9f15a07e6dac0d4dc01731f1e277d34a4))
+
+
+#### Features
+
+* **init:** install coffee-script automatically ([e876db63](http://github.com/karma-runner/karma/commit/e876db63dc5c4708345f5cdc335195fe4a5b8808), closes [#1152](http://github.com/karma-runner/karma/issues/1152))
+
+
+<a name="0.12.22"></a>
+### 0.12.22 (2014-08-19)
+
+
+#### Bug Fixes
+
+* **preprocessor:** treat *.tgz, *.tbz2, *.txz & *.xz as binary ([7b642449](http://github.com/karma-runner/karma/commit/7b642449811b0c0af63147f74159c6dbb8900563))
+
+
+<a name="0.12.21"></a>
+### 0.12.21 (2014-08-05)
+
+
+#### Bug Fixes
+
+* **web-server:** cache static files ([eb5bd53f](http://github.com/karma-runner/karma/commit/eb5bd53ff0b6dc01e247fce9af01d0ed97d8c9ba))
+
+
+<a name="0.12.20"></a>
+### 0.12.20 (2014-08-05)
+
+
+#### Bug Fixes
+
+* **config:** #1113 Watching is not working properly on linux ([c91ffbc0](http://github.com/karma-runner/karma/commit/c91ffbc05f78f2c17dcc43039300cdf045e64ccc), closes [#1113](http://github.com/karma-runner/karma/issues/1113))
+* **preprocessor:**
+ * treat *.gz files as binary ([1b56932f](http://github.com/karma-runner/karma/commit/1b56932fb49e0f3793f00599e11c24f6254236f4))
+ * treat *.swf files as binary ([62d7d387](http://github.com/karma-runner/karma/commit/62d7d3873ed3e046ab24530cb20297ddad51cf85))
+
+
+<a name="0.12.19"></a>
+### 0.12.19 (2014-07-26)
+
+
+#### Bug Fixes
+
+* **proxy:** More useful proxyError log message ([96640a75](http://github.com/karma-runner/karma/commit/96640a75dab089255c0619733ca9d5f9fe80127d))
+
+
+<a name="0.12.18"></a>
+### 0.12.18 (2014-07-25)
+
+
+#### Bug Fixes
+
+* **watcher:** handle paths on Windows ([6164d869](http://github.com/karma-runner/karma/commit/6164d8699c0f07fd8fcbae88221eb35d99fb02e4))
+
+
+<a name="0.12.17"></a>
+### 0.12.17 (2014-07-11)
+
+
+#### Bug Fixes
+
+* **logging:** Summarize SKIPPED tests in debug.html. Before: hundreds of SKIPPING lines in con ([a01100f5](http://github.com/karma-runner/karma/commit/a01100f5c6404366dd4219b9bf6c3161300dc735), closes [#1111](http://github.com/karma-runner/karma/issues/1111))
+* **server:** Force clients disconnect on Windows ([28239f42](http://github.com/karma-runner/karma/commit/28239f420460bdb9dd3b71f8088a0dfc1277dca6), closes [#1109](http://github.com/karma-runner/karma/issues/1109))
+* **travis_ci:** converted node versions as string ([25ee6fc9](http://github.com/karma-runner/karma/commit/25ee6fc9c57e11a012ecc3910fcb72386a3403a1))
+
+
+#### Features
+
+* serve ePub as binary files ([82ed0c6e](http://github.com/karma-runner/karma/commit/82ed0c6e94e77757270e6694f7082eac5ef5e066))
+* **preprocessor:** add 'mp3' and 'ogg' as binary formats to avoid media corruption in the browser. ([65a0767e](http://github.com/karma-runner/karma/commit/65a0767e8024879e3a5c4557f376d8b6684530e8))
+
+
+<a name="v0.12.16"></a>
+### v0.12.16 (2014-05-10)
+
+
+#### Bug Fixes
+
+* **launcher:** cancel kill timeout when process exits cleanly ([bd662744](http://github.com/karma-runner/karma/commit/bd662744bfbe353ccb63c7a795f691d12530129c), closes [#946](http://github.com/karma-runner/karma/issues/946))
+
+<a name="v0.12.15"></a>
+### v0.12.15 (2014-05-08)
+
+
+#### Bug Fixes
+
+* **server:** don't wait for socket.io store expiration timeout ([cd30a422](http://github.com/karma-runner/karma/commit/cd30a422fbc3d9d96b9aae791063a20d02a5f195))
+
+<a name="v0.12.14"></a>
+### v0.12.14 (2014-04-27)
+
+
+#### Bug Fixes
+
+* **debug.html:** Added whitespace after 'SKIPPED' ([218ee859](http://github.com/karma-runner/karma/commit/218ee859d8c8f1c7d2f47435548030f367f1e05d))
+
+<a name="v0.12.13"></a>
+### v0.12.13 (2014-04-27)
+
+
+#### Bug Fixes
+
+* **preprocessor:** serve NaCl binaries ([1cc6a1e3](http://github.com/karma-runner/karma/commit/1cc6a1e34b24768bffdaf47fb5e36559f5dc5135))
+
+<a name="v0.12.12"></a>
+### v0.12.12 (2014-04-25)
+
+
+#### Bug Fixes
+
+* **server:** properly close flash transport ([de89cd33](http://github.com/karma-runner/karma/commit/de89cd33b772d373569d2db2e9066c6656016aa3))
+
+<a name="v0.12.11"></a>
+### v0.12.11 (2014-04-25)
+
+
+#### Bug Fixes
+
+* **preprocessor:** remove ts from binary extensions ([82698523](http://github.com/karma-runner/karma/commit/8269852304d2d420bb25a0e4bb13bba58a339f39))
+
+<a name="v0.12.10"></a>
+### v0.12.10 (2014-04-23)
+
+
+#### Bug Fixes
+
+* **server:** clear web server close timeout on clean close ([34123fed](http://github.com/karma-runner/karma/commit/34123fed2fbe99b3a9a39ad5e0a141d55decb9f6))
+
+<a name="v0.12.9"></a>
+### v0.12.9 (2014-04-14)
+
+
+#### Bug Fixes
+
+* **web-server:** strip scheme, host and port ([06a0da09](http://github.com/karma-runner/karma/commit/06a0da09320340a988513285046b577b4a7518fd))
+
+<a name="v0.12.8"></a>
+### v0.12.8 (2014-04-14)
+
+
+#### Bug Fixes
+
+* **web-server:** inline the config, when serving debug.html ([1eb36430](http://github.com/karma-runner/karma/commit/1eb36430ca26a769cd8fd2ab5a471aecb31cad9f))
+
+<a name="v0.12.7"></a>
+### v0.12.7 (2014-04-14)
+
+
+#### Bug Fixes
+
+* don't crash/terminate upon errors within chokidar ([2c389311](http://github.com/karma-runner/karma/commit/2c389311ce683646675adccf5a7b7b3160335148))
+* **preprocessor:** consider SVG files as text files, not binary files ([ff288036](http://github.com/karma-runner/karma/commit/ff2880369f0c4e8b78d95bb20365cead340f8fc9), closes [#1026](http://github.com/karma-runner/karma/issues/1026))
+
+<a name="v0.12.6"></a>
+### v0.12.6 (2014-04-09)
+
+<a name="v0.12.5"></a>
+### v0.12.5 (2014-04-08)
+
+
+#### Bug Fixes
+
+* **reporters:** format fix for console log ([d2d1377d](http://github.com/karma-runner/karma/commit/d2d1377d1be0da17196a1c82bf5584997d502b68), closes [#934](http://github.com/karma-runner/karma/issues/934))
+
+<a name="v0.12.4"></a>
+### v0.12.4 (2014-04-06)
+
+
+#### Bug Fixes
+
+* **init:** Fix type in init text ([e34465b0](http://github.com/karma-runner/karma/commit/e34465b01cc583cac9645acc98d20acbf471c856), closes [#954](http://github.com/karma-runner/karma/issues/954))
+
+<a name="v0.12.3"></a>
+### v0.12.3 (2014-04-01)
+
+
+#### Bug Fixes
+
+* **web-server:** implement a timeout on webServer.close() ([fe3dca78](http://github.com/karma-runner/karma/commit/fe3dca781def0a5f813e598fe73eb97b3f55d223), closes [#952](http://github.com/karma-runner/karma/issues/952))
+
+
+#### Features
+
+* **web-server:** run karma using multiple emulation modes, #631 ([b9a2930a](http://github.com/karma-runner/karma/commit/b9a2930a7fead5f29eb5f62b1a87739c4cf2e04b), closes [#936](http://github.com/karma-runner/karma/issues/936))
+
+<a name="v0.12.2"></a>
+### v0.12.2 (2014-03-30)
+
+<a name="v0.12.1"></a>
+### v0.12.1 (2014-03-16)
+
+
+#### Features
+
+* **preprocessor:** Adding the `dat` file extension as a recognised binary. ([be923571](http://github.com/karma-runner/karma/commit/be923571751199e0d795f620425fdf6eaf3f9818))
+
+<a name="v0.12.0"></a>
+## v0.12.0 (2014-03-10)
+
+
+#### Bug Fixes
+
+* serving binary files ([8a30cf55](http://github.com/karma-runner/karma/commit/8a30cf55751bbaec672597f4f0ed66fe8742095f), closes [#864](http://github.com/karma-runner/karma/issues/864), [#885](http://github.com/karma-runner/karma/issues/885))
+* **config:**
+ * fail if client.args is set to a non array ([fe4eaec0](http://github.com/karma-runner/karma/commit/fe4eaec09f1b7d34270dec7f948cd9441ef6fe48))
+ * allow CoffeeScript 1.7 to be used ([a1583dec](http://github.com/karma-runner/karma/commit/a1583decd97438a241f99287159da2948eb3a95f))
+* **runner:** Karma hangs when file paths have \u in them #924 ([1199fc4d](http://github.com/karma-runner/karma/commit/1199fc4d7ee7be2d48a707876ddb857544cf2fb4), closes [#924](http://github.com/karma-runner/karma/issues/924))
+* **web-server:**
+ * detach listeners after running ([3baa8e19](http://github.com/karma-runner/karma/commit/3baa8e1979003e4136e48515c0ba1815a950ca19))
+ * close webserver after running ([f9dee468](http://github.com/karma-runner/karma/commit/f9dee4681cad716b56748e275680fb09e574978c))
+
+
+#### Features
+
+* remove dependency on coffee-script ([af2d0e72](http://github.com/karma-runner/karma/commit/af2d0e72599d242c59ebefd6c3c965bf8496399e))
+* **config:** better error when Coffee/Live Script not installed ([aca84dc9](http://github.com/karma-runner/karma/commit/aca84dc9c6f4a966280bfcd080317c7c9d498f53))
+* **init:** generate test-main.(js/coffee) for RequireJS projects ([85900c93](http://github.com/karma-runner/karma/commit/85900c93f070264d71fdae6c257285767119c5c2))
+
+<a name="v0.11.14"></a>
+### v0.11.14 (2014-02-04)
+
+
+#### Features
+
+* **preprocessor:** allow preprocessor to cancel test run ([4d669bf3](http://github.com/karma-runner/karma/commit/4d669bf36b091e8808c9a280900fe19c8b2a72cc), closes [#550](http://github.com/karma-runner/karma/issues/550))
+* **reporter:** use spaces rather than tabs when formatting errors ([112becf7](http://github.com/karma-runner/karma/commit/112becf7ffa79d2519777300be0beff568114fe6))
+* **web-server:** include html files as <link rel="import"> ([03d7b106](http://github.com/karma-runner/karma/commit/03d7b1065e31e6a42e67a0eb3e22009731865648))
+
+<a name="v0.11.13"></a>
+### v0.11.13 (2014-01-19)
+
+
+#### Bug Fixes
+
+* **launcher:** compatibility with old launchers ([df557cec](http://github.com/karma-runner/karma/commit/df557cec8093de301a8d7dea4ddca8670629c0af))
+
+
+#### Features
+
+* support LiveScript configuration ([88deebe7](http://github.com/karma-runner/karma/commit/88deebe74a0b6f01e23f3ceefea5811183218600))
+
+<a name="v0.11.12"></a>
+### v0.11.12 (2013-12-25)
+
+
+#### Bug Fixes
+
+* **client:** show error if an adapter is removed ([a8b250cf](http://github.com/karma-runner/karma/commit/a8b250cf6a89cf064f67ecb1e2c040cc224d91e9))
+
+
+#### Features
+
+* **deps:** update all deps ([355a762c](http://github.com/karma-runner/karma/commit/355a762c0fd709261ff1403213bb10db6aa0a396), closes [#794](http://github.com/karma-runner/karma/issues/794))
+* **reporter:** support source maps (rewrite stack traces) ([70e4abd9](http://github.com/karma-runner/karma/commit/70e4abd9b8db6b05de557ca6e9204339a21be06b), closes [#594](http://github.com/karma-runner/karma/issues/594))
+* **watcher:** use polling on Mac ([66f50d7e](http://github.com/karma-runner/karma/commit/66f50d7e584d4cbde820e70746be3f3378440fa8))
+
+<a name="v0.11.11"></a>
+### v0.11.11 (2013-12-23)
+
+
+#### Bug Fixes
+
+* **events:** resolve async events without any listener ([4e4bba88](http://github.com/karma-runner/karma/commit/4e4bba8803d1e4f461e568cc2e2ccf82e369721d))
+* **launcher:**
+ * compatibility with Node v0.8 ([6a46be96](http://github.com/karma-runner/karma/commit/6a46be96499876e9aa0892325d783627bd1c535d))
+ * compatibility with old launchers ([ffb74800](http://github.com/karma-runner/karma/commit/ffb74800638417910f453e108c8a4c6ffabaee29))
+
+<a name="v0.11.10"></a>
+### v0.11.10 (2013-12-22)
+
+
+#### Bug Fixes
+
+* **completion:** add missin --log-level for karma init ([1e79eb55](http://github.com/karma-runner/karma/commit/1e79eb553e40530adef36b30b35a79f7a8026ddf))
+* **init:** clean the terminal if killed ([e2aa7497](http://github.com/karma-runner/karma/commit/e2aa74972ce84388a49090533e353b61bd9b16ed))
+
+
+#### Features
+
+* revert default usePolling to false ([e88fbc24](http://github.com/karma-runner/karma/commit/e88fbc24dd34e7976cae2547bad07e6f044a768b))
+* **config:**
+ * remove default preprocessors (coffee, html2js) ([ada74d55](http://github.com/karma-runner/karma/commit/ada74d55aaf02882a5e12031838404e9ade07d36))
+ * Add the abillity to supress the client console. This adds the client config opti ([4734962d](http://github.com/karma-runner/karma/commit/4734962de747c2a8eab5c8078954bd567e4b4410), closes [#744](http://github.com/karma-runner/karma/issues/744))
+ * set default host/port from env vars ([0a6a0ee4](http://github.com/karma-runner/karma/commit/0a6a0ee4dd443250521d7898ab3086e7fc4f3afc))
+ * Allow tests be to run in a new window instead of iframe ([471e3a8a](http://github.com/karma-runner/karma/commit/471e3a8a506836ba9711637d325c680cfbfff64f))
+* **init:**
+ * install karma-coffee-preprocessor ([29f5cf2d](http://github.com/karma-runner/karma/commit/29f5cf2d4b8c16a49d8528e02f781ef394e19191))
+ * add nodeunit, nunit frameworks ([b4da1a08](http://github.com/karma-runner/karma/commit/b4da1a08b98414e903440d6ec2df7e94b48daea8))
+ * install missing plugins (frameworks, launchers) ([1ba70a6f](http://github.com/karma-runner/karma/commit/1ba70a6fa673fbbb0c1750c777974662989dbf67))
+* **launcher:** log how long it took each browser to capture ([8dd54369](http://github.com/karma-runner/karma/commit/8dd54369f2ec3377ca1cf2d9c3cdacdc80a1331a))
+
+
+#### Breaking Changes
+
+* Karma does not ship with any plugin. You need to explicitly install all the plugins you need. `karma init` can help with this.
+
+Removed plugins that need to be installed explicitly are:
+
+* karma-jasmine
+* karma-requirejs
+* karma-coffee-preprocessor
+* karma-html2js-preprocessor
+* karma-chrome-launcher
+* karma-firefox-launcher
+* karma-phantomjs-launcher
+* karma-script-launcher ([e033d561](http://github.com/karma-runner/karma/commit/e033d5618a98e1f83323bb650e0eaf89c339e5b5))
+
+<a name="v0.11.9"></a>
+### v0.11.9 (2013-12-03)
+
+
+#### Features
+
+* **browser:** add browserNoActivity configuration ([bca8faad](http://github.com/karma-runner/karma/commit/bca8faad91b91baa898e3eba74fe0fa7336971c3))
+
+<a name="v0.11.8"></a>
+### v0.11.8 (2013-12-03)
+
+
+#### Bug Fixes
+
+* **reporter:** remove SHAs from stack traces ([d7c31f97](http://github.com/karma-runner/karma/commit/d7c31f97be654f08d484563282a68d59638c5693))
+* **web-server:** correct caching headers for SHAs ([bf27e80b](http://github.com/karma-runner/karma/commit/bf27e80bb8ff3e60d19b408803596145c821bae7))
+
+
+#### Features
+
+* **web-server:** disable gzip compression ([5ee886bc](http://github.com/karma-runner/karma/commit/5ee886bc16fc5a2bd08101d351027345530f87df))
+
+<a name="v0.11.7"></a>
+### v0.11.7 (2013-12-02)
+
+
+#### Bug Fixes
+
+* keep all sockets in the case an old socket will survive ([a5945ebc](http://github.com/karma-runner/karma/commit/a5945ebcf11c4b17b99c40b78d7e2946f79c77c2))
+* reuse browser instance when restarting disconnected browser ([1f1a8ebf](http://github.com/karma-runner/karma/commit/1f1a8ebf38827fe772c631de200fdfa4a705a40b))
+* **client:** redirect to redirect_url after all messages are sent ([4d05602c](http://github.com/karma-runner/karma/commit/4d05602c803a6645d6c0e9404a60ed380f0329ee))
+
+
+#### Features
+
+* **plugins:** ignore some non-plugins package names ([01776030](http://github.com/karma-runner/karma/commit/01776030a294ef051b6454c2fb9bc3f980a6d36a))
+
+<a name="v0.11.6"></a>
+### v0.11.6 (2013-12-01)
+
+
+#### Bug Fixes
+
+* **config:**
+ * ignore empty string patterns ([66c86a66](http://github.com/karma-runner/karma/commit/66c86a6689aaac82006fa47762bd86496ad76bf7))
+ * apply CLI logger options as soon as we can ([16179b08](http://github.com/karma-runner/karma/commit/16179b08021334cfab02a9dcba8d7f4bd219bc5e))
+* **preprocess:** set correct extension for the preprocessed path ([c9a64d2f](http://github.com/karma-runner/karma/commit/c9a64d2f1a94c0a7dab2fcde79696c139d958c57), closes [#843](http://github.com/karma-runner/karma/issues/843))
+
+
+#### Features
+
+* add `browserDisconnectTolerance` config option ([19590e1f](http://github.com/karma-runner/karma/commit/19590e1f66fd6c3b0d3fc9e90000c705198e0e70))
+* make autoWatch true by default ([8454898c](http://github.com/karma-runner/karma/commit/8454898c5e2b56cb81f0c808153b5f82cfac62a4))
+* **browser:** improve logging ([71b542ad](http://github.com/karma-runner/karma/commit/71b542adc6d6bd24d0ab2bb5cb0a473e1813804a))
+* **client:** show error if no adapter is included ([7213877f](http://github.com/karma-runner/karma/commit/7213877f3542a4c65d91d2dbde6633b928aba049))
+* **web-server:**
+ * use SHA hash instead of timestamps ([6e31cb24](http://github.com/karma-runner/karma/commit/6e31cb249ee5b32d91f37ea516ca0f84bddc5aa9), closes [#520](http://github.com/karma-runner/karma/issues/520))
+ * cache preprocessed files ([c786ee2e](http://github.com/karma-runner/karma/commit/c786ee2ea19d2fcef078a30cecb70d69036a4803))
+
+
+#### Breaking Changes
+
+* `autoWatch` is `true` by default. If you rely on the default value being `false`, please set it in `karma.conf.js` explicitly to `false`.
+ ([8454898c](http://github.com/karma-runner/karma/commit/8454898c5e2b56cb81f0c808153b5f82cfac62a4))
+
+<a name="v0.11.5"></a>
+### v0.11.5 (2013-11-25)
+
+
+#### Bug Fixes
+
+* do not execute already executing browsers ([00136cf6](http://github.com/karma-runner/karma/commit/00136cf6d818b9bc6e4d77504e3ce1ed3d23d611))
+
+
+#### Features
+
+* **launcher:** send SIGKILL if SIGINT does not kill the browser ([c0fa49aa](http://github.com/karma-runner/karma/commit/c0fa49aa7c56f14a3836986e8629411a72515a78))
+
+<a name="v0.11.4"></a>
+### v0.11.4 (2013-11-21)
+
+
+#### Bug Fixes
+
+* **browser:** reply "start" event ([4fde43de](http://github.com/karma-runner/karma/commit/4fde43deee22b53fcca52132c51c27f4012d2933))
+
+<a name="v0.11.3"></a>
+### v0.11.3 (2013-11-20)
+
+
+#### Bug Fixes
+
+* **config:** not append empty module if no custom launcher/rep/prep ([ee15a4e4](http://github.com/karma-runner/karma/commit/ee15a4e446e9f35949a2fdde7cbdbecdd7ca0750))
+* **watcher:** allow parentheses in a pattern ([438eb8dd](http://github.com/karma-runner/karma/commit/438eb8ddbc0b82cd5ab299f6f27f5ae3cc29a20f), closes [#728](http://github.com/karma-runner/karma/issues/728))
+
+
+#### Features
+
+* remove `karma` binary in favor of karma-cli ([c7d46270](http://github.com/karma-runner/karma/commit/c7d46270aca83ecfe78f69fa923bc574c0b5bfdc))
+* **config:** log if no config file is specified ([ce4c5646](http://github.com/karma-runner/karma/commit/ce4c5646dfff7bd40abfd1f9e51dc4f5b779bf4a))
+
+
+#### Breaking Changes
+
+* The `karma` module does not export `karma` binary anymore. The recommended way is to have local modules (karma and all the plugins that your project needs) stored in your `package.json`. You can run that particular Karma by `./node_modules/karma/bin/karma`. Or you can have `karma-cli` installed globally on your system, which enables you to use the `karma` command.
+
+The global `karma` command (installed by `karma-cli`) does look for local version of Karma (including parent directories) first and fall backs to a global one.
+
+The `bin/karma` binary does not look for any other instances of Karma and just runs the one that it belongs to.
+
+
+ ([c7d46270](http://github.com/karma-runner/karma/commit/c7d46270aca83ecfe78f69fa923bc574c0b5bfdc))
+
+<a name="v0.11.2"></a>
+### v0.11.2 (2013-11-03)
+
+
+#### Bug Fixes
+
+* **config:** use polling by default ([53978c42](http://github.com/karma-runner/karma/commit/53978c42f10088fb29d09597817c5dde58aeb32b))
+* **proxy:** handle proxied socket.io websocket transport upgrade ([fcc2a98f](http://github.com/karma-runner/karma/commit/fcc2a98f6af5f71a929130825b18db56557f29f7))
+
+<a name="v0.11.1"></a>
+### v0.11.1 (2013-10-25)
+
+
+#### Bug Fixes
+
+* launcher kill method which was throwing an error if no callback was specified bu ([5439f1cb](http://github.com/karma-runner/karma/commit/5439f1cbbdce9de0c2193171f75798587221e257))
+* **static:** Use full height for the iFrame. Fix based on PR #714. ([f95daf3c](http://github.com/karma-runner/karma/commit/f95daf3ce0af11b3c58dc09ef852ef0378b484fd))
+* **watcher:**
+ * ignore double "add" events ([6cbaac7a](http://github.com/karma-runner/karma/commit/6cbaac7aba0534c9a7688f6953c61505fcd1289c))
+ * improve watching efficiency ([6a272aa5](http://github.com/karma-runner/karma/commit/6a272aa5763eb0c728b76adc3b12bb12abc1aaca), closes [#616](http://github.com/karma-runner/karma/issues/616))
+
+
+#### Features
+
+* redirect client to "return_url" if specified ([6af2c897](http://github.com/karma-runner/karma/commit/6af2c897f3b35060a146efdef7da597ba53d8cdd))
+* **config:** add usePolling config ([18514d63](http://github.com/karma-runner/karma/commit/18514d63534c82094b231eb1e0b0e41011519183))
+* **watcher:** ignore initial "add" events ([dde1da4c](http://github.com/karma-runner/karma/commit/dde1da4c78470fec3565920df418a3786fb57797))
+
+<a name="v0.11.0"></a>
+## v0.11.0 (2013-08-26)
+
+
+#### Bug Fixes
+
+* support reconnecting for manually captured browsers ([a8ac6d2d](http://github.com/karma-runner/karma/commit/a8ac6d2d86cad3898d21f019b6fc0a5a2b99cd00))
+* **reporter:** print browser stats immediately after it finishes ([65202d87](http://github.com/karma-runner/karma/commit/65202d870fa602e70483aeebbf87d0e11d6c1017))
+
+
+#### Features
+
+* don't wait for all browsers and start executing immediately ([8647266f](http://github.com/karma-runner/karma/commit/8647266fd592fe245aaf2be964319d3026432e33), closes [#57](http://github.com/karma-runner/karma/issues/57))
+
+<a name="v0.10.2"></a>
+### v0.10.2 (2013-08-21)
+
+
+#### Bug Fixes
+
+* don't mark a browser captured if already being killed/timeouted ([21230979](http://github.com/karma-runner/karma/commit/212309795861cf599dbcc0ed60fff612ccf25cf5), closes [#88](http://github.com/karma-runner/karma/issues/88))
+
+
+#### Features
+
+* sync page unload (disconnect) ([ac9b3f01](http://github.com/karma-runner/karma/commit/ac9b3f01e88ce2cf91fc86aca9cecfdb8177a6fa))
+* buffer result messages when polling ([c4ad6970](http://github.com/karma-runner/karma/commit/c4ad69709103110a066ae1d9652af69e42434c6b))
+* allow browser to reconnect during the test run ([cbe2851b](http://github.com/karma-runner/karma/commit/cbe2851baa55312f00be420e0345283b33326266), closes [#82](http://github.com/karma-runner/karma/issues/82), [#590](http://github.com/karma-runner/karma/issues/590))
+
+<a name="v0.10.1"></a>
+### v0.10.1 (2013-08-06)
+
+
+#### Bug Fixes
+
+* **cli:** Always pass an instance of fs to processArgs. ([06532b70](http://github.com/karma-runner/karma/commit/06532b7042371f270c227a1a7f859f2dab5afac1), closes [#677](http://github.com/karma-runner/karma/issues/677))
+* **init:** set default filename ([34d49b13](http://github.com/karma-runner/karma/commit/34d49b138f3bee8f17e1e9e343012d82887f906b), closes [#680](http://github.com/karma-runner/karma/issues/680), [#681](http://github.com/karma-runner/karma/issues/681))
+
+<a name="v0.10.0"></a>
+## v0.10.0 (2013-08-06)
+
+<a name="v0.9.8"></a>
+### v0.9.8 (2013-08-05)
+
+
+#### Bug Fixes
+
+* **init:** install plugin as dev dependency ([46b7a402](http://github.com/karma-runner/karma/commit/46b7a402fb8d700b10e2d72908c309d27212b5a0))
+* **runner:** do not confuse client args with the config file ([6f158aba](http://github.com/karma-runner/karma/commit/6f158abaf923dad6878a64da2d8a3c2c56ae604f))
+
+
+#### Features
+
+* **config:** default config can be karma.conf.js or karma.conf.coffee ([d4a06f29](http://github.com/karma-runner/karma/commit/d4a06f296c4d805f2dccd85b4898766593af4d66))
+* **runner:**
+ * support config files ([449e4a1a](http://github.com/karma-runner/karma/commit/449e4a1ad8b8543f84f1953c875cfbdf5692caa7), closes [#625](http://github.com/karma-runner/karma/issues/625))
+ * add --no-refresh to disable re-globbing ([b9c670ac](http://github.com/karma-runner/karma/commit/b9c670accbde8d027bdc3e09a4080c546b05853c))
+
+<a name="v0.9.7"></a>
+### v0.9.7 (2013-07-31)
+
+
+#### Bug Fixes
+
+* **init:** trim the inputs ([b72355cb](http://github.com/karma-runner/karma/commit/b72355cbeadc8e907e48bbd7d9a11e6de17343f7), closes [#663](http://github.com/karma-runner/karma/issues/663))
+* **web-server:** correct urlRegex in custom handlers ([a641c2c1](http://github.com/karma-runner/karma/commit/a641c2c1dd0f5f1e0045e7cff1516d2820a8204e))
+
+
+#### Features
+
+* basic bash/zsh completion ([9dc1cf6a](http://github.com/karma-runner/karma/commit/9dc1cf6a6e095653fed6c79c4896c71af8af1953))
+* **runner:** allow passing changed/added/removed files ([b598106d](http://github.com/karma-runner/karma/commit/b598106de1295f3e1e58338a8eca2b60f99175c3))
+* **watcher:** make the batching delay configurable ([fa139312](http://github.com/karma-runner/karma/commit/fa139312a0fff981f11182c17ba6979dccca1105))
+
+<a name="v0.9.6"></a>
+### v0.9.6 (2013-07-28)
+
+
+#### Features
+
+* pass command line opts through to browser ([00d63d0b](http://github.com/karma-runner/karma/commit/00d63d0b965a998b04d1917d4c4421abc24cec18))
+* **web-server:** compress responses (gzip/deflate) ([8e8a2d44](http://github.com/karma-runner/karma/commit/8e8a2d4418e7abef7dca42e58bf09c95b07687b2))
+
+
+#### Breaking Changes
+
+* `runnerPort` is merged with `port`
+if you are using `karma run` with custom `--runer-port`, please change that to `--port`.
+ ([ca4c4d88](http://github.com/karma-runner/karma/commit/ca4c4d88b9a4a1992f7975aa32b37a008394847b))
+
+<a name="v0.9.5"></a>
+### v0.9.5 (2013-07-21)
+
+
+#### Bug Fixes
+
+* detect a full page reload, show error and recover ([15d80f47](http://github.com/karma-runner/karma/commit/15d80f47a227839e9b0d54aeddf49b9aa9afe8aa), closes [#27](http://github.com/karma-runner/karma/issues/27))
+* better serialization in dump/console.log ([fd46365d](http://github.com/karma-runner/karma/commit/fd46365d1fd3a9bea15c04abeb7df33a3a2d96a4), closes [#640](http://github.com/karma-runner/karma/issues/640))
+* browsers_change event always has collection as arg ([42bf787f](http://github.com/karma-runner/karma/commit/42bf787f87304e6be23dd3dac893b3c3f77d6764))
+* **init:** generate config with the new syntax ([6b27fee5](http://github.com/karma-runner/karma/commit/6b27fee5a43a7d02e706355f62fe5105b4966c43))
+* **reporter:** prevent throwing exception when null is sent to formatter ([3b49c385](http://github.com/karma-runner/karma/commit/3b49c385fcc8ef96e72be390df058bd278b40c17))
+* **watcher:** ignore fs.stat errors ([74ccc9a8](http://github.com/karma-runner/karma/commit/74ccc9a8017f869bd7bbbf8831415964110a7073))
+
+
+#### Features
+
+* capture window.alert ([284c4f5c](http://github.com/karma-runner/karma/commit/284c4f5c9c481759fe564627a00d72ba5c54e433))
+* ship html2js preprocessor as a default plugin ([37ecf416](http://github.com/karma-runner/karma/commit/37ecf41600a9b255ab3d57327cc83d64751642f5))
+* fail if zero tests executed ([5670415e](http://github.com/karma-runner/karma/commit/5670415ecdc5e54902b479c78df5c3c422855e5c), closes [#468](http://github.com/karma-runner/karma/issues/468))
+* **launcher:** normalize quoted paths ([f2155e0c](http://github.com/karma-runner/karma/commit/f2155e0c3305538c0fb95791e56f34743977a865), closes [#491](http://github.com/karma-runner/karma/issues/491))
+* **web-server:** serve css files ([4e305545](http://github.com/karma-runner/karma/commit/4e305545ddf2726c1fe65c46efd5e7c1045ac041), closes [#431](http://github.com/karma-runner/karma/issues/431))
+
+<a name="v0.9.4"></a>
+### v0.9.4 (2013-06-28)
+
+
+#### Bug Fixes
+
+* **config:**
+ * make the config changes backwards compatible ([593ad853](https://github.com/karma-runner/karma/commit/593ad853c330a7856f2112db2bfb288f67948fa6))
+ * better errors if file invalid or does not exist ([74b533be](https://github.com/karma-runner/karma/commit/74b533beb34c115f5080d412a03573d269d540aa))
+ * allow parsing the config multiple times ([78a7094e](https://github.com/karma-runner/karma/commit/78a7094e0f262c431e904f99cf356be53eee3510))
+* **launcher:** better errors when loading launchers ([504e848c](https://github.com/karma-runner/karma/commit/504e848cf66b065380fa72e07f5337ae2d6e35b5))
+* **preprocessor:**
+ * do not show duplicate warnings ([47c641f7](https://github.com/karma-runner/karma/commit/47c641f7560d28e0d9eac7ae010566d296d5b628))
+ * better errors when loading preprocessors ([3390a00b](https://github.com/karma-runner/karma/commit/3390a00b49c513a6da60f48044462118436130f8))
+* **reporter:** better errors when loading reporters ([c645c060](https://github.com/karma-runner/karma/commit/c645c060c4f381902c2005eefe5b3a7bfa63cdcc))
+
+
+#### Features
+
+* **config:** pass the config object rather than a wrapper ([d2a3c854](https://github.com/karma-runner/karma/commit/d2a3c8546dc4b10bb9194047a1c11963639f3730))
+
+
+#### Breaking Changes
+
+* please update your karma.conf.js as follows ([d2a3c854](https://github.com/karma-runner/karma/commit/d2a3c8546dc4b10bb9194047a1c11963639f3730)):
+
+```javascript
+// before:
+module.exports = function(karma) {
+ karma.configure({port: 123});
+ karma.defineLauncher('x', 'Chrome', {
+ flags: ['--disable-web-security']
+ });
+ karma.definePreprocessor('y', 'coffee', {
+ bare: false
+ });
+ karma.defineReporter('z', 'coverage', {
+ type: 'html'
+ });
+};
+
+// after:
+module.exports = function(config) {
+ config.set({
+ port: 123,
+ customLaunchers: {
+ 'x': {
+ base: 'Chrome',
+ flags: ['--disable-web-security']
+ }
+ },
+ customPreprocessors: {
+ 'y': {
+ base: 'coffee',
+ bare: false
+ }
+ },
+ customReporters: {
+ 'z': {
+ base: 'coverage',
+ type: 'html'
+ }
+ }
+ });
+};
+```
+
+<a name="v0.9.3"></a>
+### v0.9.3 (2013-06-16)
+
+
+#### Bug Fixes
+
+* capturing console.log on IE ([fa4b686a](https://github.com/karma-runner/karma/commit/fa4b686a81ad826f256a4ca63c772af7ad6e411e), closes [#329](https://github.com/karma-runner/karma/issues/329))
+* **config:** fix the warning when using old syntax ([5e55d797](https://github.com/karma-runner/karma/commit/5e55d797f7544a45c3042e301bbf71e8b830daf3))
+* **init:** generate correct indentation ([5fc17957](https://github.com/karma-runner/karma/commit/5fc17957be761c06f6ae120c5d3ba800dba8d3a4))
+* **launcher:**
+ * ignore exit code when killing/timeouting ([1029bf2d](https://github.com/karma-runner/karma/commit/1029bf2d7d3d22986aa41439d2ce4115770f4dbd), closes [#444](https://github.com/karma-runner/karma/issues/444))
+ * handle ENOENT error, do not retry ([7d790b29](https://github.com/karma-runner/karma/commit/7d790b29c09c1f3784fe648b7d5ed16add10b4ca), closes [#452](https://github.com/karma-runner/karma/issues/452))
+* **logger:** configure the logger as soon as possible ([0607d67c](https://github.com/karma-runner/karma/commit/0607d67c15eab58ce83cce14ada70a1e2a9f17e9))
+* **preprocessor:** use graceful-fs to prevent EACCESS errors ([279bcab5](https://github.com/karma-runner/karma/commit/279bcab54019a0f0af72c7c08017cf4cdefebe46), closes [#566](https://github.com/karma-runner/karma/issues/566))
+* **watcher:** watch files that match watched directory ([39401175](https://github.com/karma-runner/karma/commit/394011753b918b8db807f31da9f5c316e296cf32), closes [#521](https://github.com/karma-runner/karma/issues/521))
+
+
+#### Features
+
+* simplify loading plugins using patterns like `karma-*` ([405a5a62](https://github.com/karma-runner/karma/commit/405a5a62d2ecc47a46b2ff069bfeb624f0b06982))
+* **client:** capture all `console.*` log methods ([683e6dcb](https://github.com/karma-runner/karma/commit/683e6dcb9132de3caee39c809b5b58efe8236564))
+* **config:**
+ * make socket.io transports configurable ([bbd5eb86](https://github.com/karma-runner/karma/commit/bbd5eb8688b2bc1e3dd04910aa68fd19c5036b31))
+ * allow configurable launchers, preprocessors, reporters ([76bdac16](https://github.com/karma-runner/karma/commit/76bdac1681f012749648f5a76b4a9d96c7a5ef20), closes [#317](https://github.com/karma-runner/karma/issues/317))
+ * add warning if old constants are used ([7233c5fb](https://github.com/karma-runner/karma/commit/7233c5fb9e1c105032000bbcb9afaddf72ccbc97))
+ * require config as a regular module ([a37fd6f7](https://github.com/karma-runner/karma/commit/a37fd6f7d28036b8da5fe98634cf711cebafc1ff), closes [#304](https://github.com/karma-runner/karma/issues/304))
+* **helper:** improve useragent detection ([eb58768e](https://github.com/karma-runner/karma/commit/eb58768e32baf13b45d9649743d7ef45798ffb27))
+* **init:**
+ * generate coffee config files ([d2173717](https://github.com/karma-runner/karma/commit/d21737176c1d866a11249d626a75440b398171ce))
+ * improve the questions a bit ([baecadb2](https://github.com/karma-runner/karma/commit/baecadb2f1a8f31c233edacafb1f8a4b736ea243))
+* **proxy:** add https proxy support ([be878dc5](https://github.com/karma-runner/karma/commit/be878dc545a0dd266d5686387c976ce70f1a095c))
+
+
+#### Breaking Changes
+
+* Update your karma.conf.js to export a config function ([a37fd6f7](https://github.com/karma-runner/karma/commit/a37fd6f7d28036b8da5fe98634cf711cebafc1ff)):
+
+```javascript
+module.exports = function(karma) {
+ karma.configure({
+ autoWatch: true,
+ // ...
+ });
+};
+```
+
+<a name="v0.9.2"></a>
+### v0.9.2 (2013-04-16)
+
+
+#### Bug Fixes
+
+* better error reporting when loading plugins ([d9078a8e](https://github.com/karma-runner/karma/commit/d9078a8eca41df15f26b53e2375f722a48d0992d))
+* **config:**
+ * Separate ENOENT error handler from others ([e49dabe7](https://github.com/karma-runner/karma/commit/e49dabe783d6cfb2ee97b70ac01953e82f70f831))
+ * ensure basePath is always resolved ([2e5c5aaa](https://github.com/karma-runner/karma/commit/2e5c5aaaddc4ad4e1ee9c8fa0388d3916827f403))
+
+
+#### Features
+
+* allow inlined plugins ([3034bcf9](https://github.com/karma-runner/karma/commit/3034bcf9b074b693afab9c62856346d6f305d0c0))
+* **debug:** show skipped specs and failure details in the console ([42ab936b](https://github.com/karma-runner/karma/commit/42ab936b254983faa8ab0ee76a6278fb3aff7fa2))
+
+<a name="v0.9.1"></a>
+### v0.9.1 (2013-04-04)
+
+
+#### Bug Fixes
+
+* **init:** to not give false warning about missing requirejs ([562607a1](https://github.com/karma-runner/karma/commit/562607a16221b256c6e92ad2029154aac88eec8d))
+
+
+#### Features
+
+* ship coffee-preprocessor and requirejs as default plugins ([f34e30db](https://github.com/karma-runner/karma/commit/f34e30db4d25d484a30d12e3cb1c41069c0b263a))
+
+<a name="v0.9.0"></a>
+## v0.9.0 (2013-04-03)
+
+
+#### Bug Fixes
+
+* global error handler should propagate errors ([dec0c196](https://github.com/karma-runner/karma/commit/dec0c19651c251dcbc16c44a57775bcb37f78cf1), closes [#368](https://github.com/karma-runner/karma/issues/368))
+* **config:**
+ * Check if configFilePath is a string. Fixes #447. ([98724b6e](https://github.com/karma-runner/karma/commit/98724b6ef5a6ba60d487e7b774056832c6ca9d8c))
+ * do not change urlRoot even if proxied ([8c138b50](https://github.com/karma-runner/karma/commit/8c138b504046a3aeb230b71e1049aa60ee46905d))
+* **coverage:** always send a result object ([62c3c679](https://github.com/karma-runner/karma/commit/62c3c6790659f8f82f8a2ca5646aa424eeb28842), closes [#365](https://github.com/karma-runner/karma/issues/365))
+* **init:**
+ * generate plugins and frameworks config ([17798d55](https://github.com/karma-runner/karma/commit/17798d55988d61070f2b9f59574217208f2b497e))
+ * fix for failing "testacular init" on Windows ([0b5b3853](https://github.com/karma-runner/karma/commit/0b5b385383f13ac8f29fa6e591a8634eefa04ab7))
+* **preprocessor:** resolve relative patterns to basePath ([c608a9e5](https://github.com/karma-runner/karma/commit/c608a9e5a34a49da2971add8759a9422b74fa6fd), closes [#382](https://github.com/karma-runner/karma/issues/382))
+* **runner:** send exit code as string ([ca75aafd](https://github.com/karma-runner/karma/commit/ca75aafdf6b7b425ee151c2ae4ede37933befe1f), closes [#403](https://github.com/karma-runner/karma/issues/403))
+
+
+#### Features
+
+* display the version when starting ([39617395](https://github.com/karma-runner/karma/commit/396173952addce3f6e904310686a42b102aa53f8), closes [#391](https://github.com/karma-runner/karma/issues/391))
+* allow multiple preprocessors ([1d17c1aa](https://github.com/karma-runner/karma/commit/1d17c1aacf607d6c4269f05df97d024bc9ca994e))
+* allow plugins ([125ab4f8](https://github.com/karma-runner/karma/commit/125ab4f88a7cf49fd7df32264a9847847e2326ca))
+* **config:**
+ * always ignore the config file itself ([103bc0f8](https://github.com/karma-runner/karma/commit/103bc0f878a8870770c8a8afce0a3fbf8a516ea7))
+ * normalize string preprocessors into an array ([4dde1608](https://github.com/karma-runner/karma/commit/4dde16087d0a704a47528d44e23ace0c536d8c72))
+* **web-server:** allow custom file handlers and mime types ([2df88287](https://github.com/karma-runner/karma/commit/2df8828742041fd09c0b45d6a62ebd7552116589))
+
+
+#### Breaking Changes
+
+* reporters, launchers, preprocessors, adapters are separate plugins now, in order to use them, you need to install the npm package (probably add it as a `devDependency` into your `package.json`) and load in the `karma.conf.js` with `plugins = ['karma-jasmine', ...]`. Karma ships with couple of default plugins (karma-jasmine, karma-chrome-launcher, karma-phantomjs-launcher).
+
+* frameworks (such as jasmine, mocha, qunit) are configured using `frameworks = ['jasmine'];` instead of prepending `JASMINE_ADAPTER` into files.
+
+
+<a name="v0.8.0"></a>
+## v0.8.0 (2013-03-18)
+
+
+#### Breaking Changes
+
+* rename the project to "Karma":
+- whenever you call the "testacular" binary, change it to "karma", eg. `testacular start` becomes `karma start`.
+- if you rely on default name of the config file, change it to `karma.conf.js`.
+- if you access `__testacular__` object in the client code, change it to `__karma__`, eg. `window.__testacular__.files` becomes `window.__karma__.files`. ([026a20f7](https://github.com/karma-runner/karma/commit/026a20f7b467eb3b39c68ed509acc06e5dad58e6))
+
+<a name="v0.6.1"></a>
+### v0.6.1 (2013-03-18)
+
+
+#### Bug Fixes
+
+* **config:** do not change urlRoot even if proxied ([1be1ae1d](https://github.com/karma-runner/karma/commit/1be1ae1dc7ff7314f4ac2854815cb39d31362f14))
+* **coverage:** always send a result object ([2d210aa6](https://github.com/karma-runner/karma/commit/2d210aa6697991f2eba05de58a696c5210485c88), closes [#365](https://github.com/karma-runner/karma/issues/365))
+* **reporter.teamcity:** report spec names and proper browser name ([c8f6f5ea](https://github.com/karma-runner/karma/commit/c8f6f5ea0c5c40d37b511d51b49bd22c9da5ea86))
+
+<a name="v0.6.0"></a>
+## v0.6.0 (2013-02-22)
+
+<a name="v0.5.11"></a>
+### v0.5.11 (2013-02-21)
+
+
+#### Bug Fixes
+
+* **adapter.requirejs:** do not configure baseUrl automatically ([63f3f409](https://github.com/karma-runner/karma/commit/63f3f409ae85a5137396a7ed6537bedfe4437cb3), closes [#291](https://github.com/karma-runner/karma/issues/291))
+* **init:** add missing browsers (Opera, IE) ([f39e5645](https://github.com/karma-runner/karma/commit/f39e5645ec561c2681d907f7c1611f01911ee8fd))
+* **reporter.junit:** Add browser log output to JUnit.xml ([f108799a](https://github.com/karma-runner/karma/commit/f108799a4d8fd95b8c0250ee83c23ada25d026b9), closes [#302](https://github.com/karma-runner/karma/issues/302))
+
+
+#### Features
+
+* add Teamcity reporter ([03e700ae](https://github.com/karma-runner/karma/commit/03e700ae2234ca7ddb8f9235343e3b0c80868bbd))
+* **adapter.jasmine:** remove only last failed specs anti-feature ([435bf72c](https://github.com/karma-runner/karma/commit/435bf72cb12112462940c8114fbaa19f9de38531), closes [#148](https://github.com/karma-runner/karma/issues/148))
+* **config:** allow empty config file when called programmatically ([f3d77424](https://github.com/karma-runner/karma/commit/f3d77424009f621e1fb9d60eeec7f052ebb3c585), closes [#358](https://github.com/karma-runner/karma/issues/358))
+
+<a name="v0.5.10"></a>
+### v0.5.10 (2013-02-14)
+
+
+#### Bug Fixes
+
+* **init:** fix the logger configuration ([481dc3fd](https://github.com/karma-runner/karma/commit/481dc3fd75f45a0efa8aabdb1c71e8234b9e8a06), closes [#340](https://github.com/karma-runner/karma/issues/340))
+* **proxy:** fix crashing proxy when browser hangs connection ([1c78a01a](https://github.com/karma-runner/karma/commit/1c78a01a19411accb86f0bde9e040e5088752575))
+
+
+#### Features
+
+* set urlRoot to /__karma__/ when proxying the root ([8b4fd64d](https://github.com/karma-runner/karma/commit/8b4fd64df6b7d07b5479e43dcd8cd2aa5e1efc9c))
+* **adapter.requirejs:** normalize paths before appending timestamp ([94889e7d](https://github.com/karma-runner/karma/commit/94889e7d2de701c67a2612e3fc6a51bfae891d36))
+* update dependencies to the latest ([93f96278](https://github.com/karma-runner/karma/commit/93f9627817f2d5d9446de9935930ca85cfa7df7f), [e34d8834](https://github.com/karma-runner/karma/commit/e34d8834d69ec4e022fcd6e1be4055add96d693c))
+
+
+<a name="v0.5.9"></a>
+### v0.5.9 (2013-02-06)
+
+
+#### Bug Fixes
+
+* **adapter.requirejs:** show error if no timestamp defined for a file ([59dbdbd1](https://github.com/karma-runner/karma/commit/59dbdbd136baa87467b9b9a4cb6ce226ae87bbef))
+* **init:** fix logger configuration ([557922d7](https://github.com/karma-runner/karma/commit/557922d71941e0929f9cdc0d3794424a1f27b311))
+* **reporter:** remove newline from base reporter browser dump ([dfae18b6](https://github.com/karma-runner/karma/commit/dfae18b63b413a1e6240d00b9dc0521ac0386ec5), closes [#297](https://github.com/karma-runner/karma/issues/297))
+* **reporter.dots:** only add newline to message when needed ([dbe1155c](https://github.com/karma-runner/karma/commit/dbe1155cb57fc4caa792f83f45288238db0fc7e0)
+
+#### Features
+
+* add "debug" button to easily open debugging window ([da85aab9](https://github.com/karma-runner/karma/commit/da85aab927edd1614e4e05b136dee834344aa3cb))
+* **config:** support running on a custom hostname ([b8c5fe85](https://github.com/karma-runner/karma/commit/b8c5fe8533b13fd59cbf48972d2021069a84ae5b))
+* **reporter.junit:** add a 'skipped' tag for skipped testcases ([6286406e](https://github.com/karma-runner/karma/commit/6286406e0a36a61125ea16d6f49be07030164cb0), closes [#321](https://github.com/karma-runner/karma/issues/321))
+
+
+### v0.5.8
+* Fix #283
+* Suppress global leak for istanbul
+* Fix growl reporter to work with `testacular run`
+* Upgrade jasmine to 1.3.1
+* Fix file sorting
+* Fix #265
+* Support for more mime-types on served static files
+* Fix opening Chrome on Windows
+* Upgrade growly to 1.1.0
+
+### v0.5.7
+* Support code coverage for qunit.
+* Rename port-runner option in cli to runner-port
+* Fix proxy handler (when no proxy defined)
+* Fix #65
+
+### v0.5.6
+* Growl reporter !
+* Batch changes (eg. `git checkout` causes only single run now)
+* Handle uncaught errors and disconnect all browsers
+* Global binary prefers local versions
+
+### v0.5.5
+* Add QUnit adapter
+* Report console.log()
+
+### v0.5.4
+* Fix PhantomJS launcher
+* Fix html2js preprocessor
+* NG scenario adapter: show html output
+
+### v0.5.3
+* Add code coverage !
+
+### v0.5.2
+* Init: ask about using Require.js
+
+### v0.5.1
+* Support for Require.js
+* Fix testacular init basePath
+
+## v0.5.0
+* Add preprocessor for LiveScript
+* Fix JUnit reporter
+* Enable process global in config file
+* Add OS name in the browser name
+* NG scenario adapter: hide other outputs to make it faster
+* Allow config to be written in CoffeeScript
+* Allow espaced characters in served urls
+
+## v0.4.0 (stable)
+
+### v0.3.12
+* Allow calling run() pragmatically from JS
+
+### v0.3.11
+* Fix runner to wait for stdout, stderr
+* Make routing proxy always changeOrigin
+
+### v0.3.10
+* Fix angular-scenario adapter + junit reporter
+* Use flash socket if web socket not available
+
+### v0.3.9
+* Retry starting a browser if it does not capture
+* Update mocha to 1.5.0
+* Handle mocha's xit
+
+### v0.3.8
+* Kill browsers that don't capture in captureTimeout ms
+* Abort build if any browser fails to capture
+* Allow multiple profiles of Firefox
+
+### v0.3.7
+* Remove Travis hack
+* Fix Safari launcher
+
+### v0.3.6
+* Remove custom launcher (constructor)
+* Launcher - use random id to allow multiple instances of the same browser
+* Fix Firefox launcher (creating profile)
+* Fix killing browsers on Linux and Windows
+
+### v0.3.5
+* Fix opera launcher to create new prefs with disabling all pop-ups
+
+### v0.3.4
+* Change "reporter" config to "reporters"
+* Allow multiple reporters
+* Fix angular-scenario adapter to report proper description
+* Add JUnit xml reporter
+* Fix loading files from multiple drives on Windows
+* Fix angular-scenario adapter to report total number of tests
+
+### v0.3.3
+* Allow proxying files, not only directories
+
+### v0.3.2
+* Disable autoWatch if singleRun
+* Add custom script browser launcher
+* Fix cleaning temp folders
+
+### v0.3.1
+* Run tests on start (if watching enabled)
+* Add launcher for IE8, IE9
+
+## v0.3.0
+* Change browser binaries on linux to relative
+* Add report-slower-than to CLI options
+* Fix PhantomJS binary on Travis CI
+
+## v0.2.0 (stable)
+
+### v0.1.3
+* Launch Canary with crankshaft disabled
+* Make the captured page nicer
+
+### v0.1.2
+* Fix jasmine memory leaks
+* support __filename and __dirname in config files
+
+### v0.1.1
+* Report slow tests (add `reportSlowerThan` config option)
+* Report time in minutes if it's over 60 seconds
+* Mocha adapter: add ability to fail during beforeEach/afterEach hooks
+* Mocha adapter: add dump()
+* NG scenario adapter: failure includes step name
+* Redirect /urlRoot to /urlRoot/
+* Fix serving with urlRoot
+
+## v0.1.0
+* Adapter for AngularJS scenario runner
+* Allow serving Testacular from a subpath
+* Fix race condition in testacular run
+* Make testacular one binary (remove `testacular-run`, use `testacular run`)
+* Add support for proxies
+* Init script for generating config files (`testacular init`)
+* Start Firefox without custom profile if it fails
+* Preserve order of watched paths for easier debugging
+* Change default port to 9876
+* Require node v0.8.4+
+
+### v0.0.17
+* Fix race condition in manually triggered run
+* Fix autoWatch config
+
+### v0.0.16
+* Mocha adapter
+* Fix watching/resolving on Windows
+* Allow glob patterns
+* Watch new files
+* Watch removed files
+* Remove unused config (autoWatchInterval)
+
+### v0.0.15
+* Remove absolute paths from urls (fixes Windows issue with C:\\)
+* Add browser launcher for PhantomJS
+* Fix some more windows issues
+
+### v0.0.14
+* Allow require() inside config file
+* Allow custom browser launcher
+* Add browser launcher for Opera, Safari
+* Ignore signals on windows (not supported yet)
+
+### v0.0.13
+* Single run mode (capture browsers, run tests, exit)
+* Start browser automatically (chrome, canary, firefox)
+* Allow loading external files (urls)
+
+### v0.0.12
+* Allow console in config
+* Warning if pattern does not match any file
+
+### v0.0.11
+* Add timing (total / net - per specs)
+* Dots reporter - wrap at 80
+
+### v0.0.10
+* Add DOTS reporter
+* Add no-colors option for reporters
+* Fix web server to expose only specified files
+
+### v0.0.9
+* Proper exit code for runner
+* Dynamic port asigning (if port already in use)
+* Add log-leve, log-colors cli arguments + better --help
+* Fix some IE errors (indexOf, forEach fallbacks)
+
+### v0.0.8
+* Allow overriding configuration by cli arguments (+ --version, --help)
+* Persuade IE8 to not cache context.html
+* Exit runner if no captured browser
+* Fix delayed execution (streaming to runner)
+* Complete run if browser disconnects
+* Ignore results from previous run (after server reconnecting)
+* Server disconnects - cancel execution, clear browser info
+
+### v0.0.7
+* Rename to Testacular
+
+### v0.0.6
+* Better debug mode (no caching, no timestamps)
+* Make dump() a bit better
+* Disconnect browsers on SIGTERM (kill, killall default)
+
+### v0.0.5
+* Fix memory (some :-D) leaks
+* Add dump support
+* Add runner.html
+
+### v0.0.4
+* Progress bar reporting
+* Improve error formatting
+* Add Jasmine lib (with iit, ddescribe)
+* Reconnect client each 2sec, remove exponential growing
+
+### v0.0.3
+* Jasmine adapter: ignore last failed filter in exclusive mode
+* Jasmine adapter: add build (no global space pollution)
+
+### 0.0.2
+* Run only last failed tests (jasmine adapter)
+
+### 0.0.1
+* Initial version with only very basic features
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CODE_OF_CONDUCT.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..4ead0e1d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/CODE_OF_CONDUCT.md
@@ -0,0 +1,13 @@
+# Contributor Code of Conduct
+
+As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
+
+We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
+
+Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
+
+This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/LICENSE b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/LICENSE
new file mode 100644
index 00000000..9cc50014
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/LICENSE
@@ -0,0 +1,20 @@
+The MIT License
+
+Copyright (C) 2011-2014 Google, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/README.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/README.md
new file mode 100644
index 00000000..f3c706ef
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/README.md
@@ -0,0 +1,121 @@
+# Karma
+[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma) [![npm version](https://img.shields.io/npm/v/karma.svg?style=flat-square)](https://www.npmjs.com/package/karma) [![npm downloads](https://img.shields.io/npm/dm/karma.svg?style=flat-square)](https://www.npmjs.com/package/karma)
+
+[![Build Status](https://img.shields.io/travis/karma-runner/karma/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma) [![Code Climate](https://img.shields.io/codeclimate/github/karma-runner/karma.svg?style=flat-square)](https://codeclimate.com/github/karma-runner/karma) [![Dependency Status](https://img.shields.io/david/karma-runner/karma.svg?style=flat-square)](https://david-dm.org/karma-runner/karma) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma.svg?style=flat-square)](https://david-dm.org/karma-runner/karma#info=devDependencies)
+
+A simple tool that allows you to execute JavaScript code in multiple
+_real_ browsers.
+
+> The main purpose of Karma is to make your test-driven development easy,
+> fast, and fun.
+
+
+## Help and Support
+
+* Obligatory [documentation]
+* Quick questions:
+[![Gitter Chat](https://img.shields.io/badge/GITTER-join%20chat-green.svg?style=flat-square)](https://gitter.im/karma-runner/karma)
+* Longer questions: [Mailing List]
+* Bug reports [Issue Tracker]
+* Everything less than 140 characters: [@JsKarma] on Twitter
+
+
+
+## When should I use Karma?
+
+* You want to test code in *real* browsers.
+* You want to test code in multiple browsers (desktop, mobile,
+ tablets, etc.).
+* You want to execute your tests locally during development.
+* You want to execute your tests on a continuous integration server.
+* You want to execute your tests on every save.
+* You love your terminal.
+* You don't want your (testing) life to suck.
+* You want to use [Istanbul] to automagically generate coverage
+ reports.
+* You want to use [RequireJS] for your source files.
+
+
+## But I still want to use \_insert testing library\_
+
+Karma is not a testing framework, nor an assertion library.
+Karma just launches a HTTP server, and generates the test runner HTML file you probably already know from your favourite testing framework.
+So for testing purposes you can use pretty much anything you like. There are already plugins for most of the common testing frameworks:
+
+* [Jasmine]
+* [Mocha]
+* [QUnit]
+* and [many others](https://www.npmjs.org/browse/keyword/karma-adapter)
+
+If you can't find an adapter for your favourite framework, don't worry and write your own.
+It's not that hard and we are here to help.
+
+
+## Which Browsers can I use?
+
+All the major browsers are supported, if you want to know more see the
+[browsers] page.
+
+
+## Troubleshooting
+See [FAQ](https://karma-runner.github.io/0.12/intro/faq.html).
+
+
+## I want to use it. Where do I sign?
+
+You don't need to sign anything but here are some resources to help
+you to get started...
+
+
+### Obligatory Screencast.
+
+Every serious project has a screencast, so here is ours. Just click
+[here] and let the show begin.
+
+
+### Installation.
+
+See [installation](https://karma-runner.github.io/0.12/intro/installation.html).
+
+
+### Using it.
+
+See [configuration](https://karma-runner.github.io/0.12/intro/configuration.html).
+
+
+## This is so great. I want to help.
+
+Please, see
+[contributing](https://karma-runner.github.io/0.12/dev/contributing.html).
+
+
+## Why did you create this?
+
+Throughout the development of [AngularJS], we've been using [JSTD] for
+testing. I really think that JSTD is a great idea. Unfortunately, we
+had many problems with JSTD, so we decided to write our own test
+runner based on the same idea. We wanted a simple tool just for
+executing JavaScript tests that is both stable and fast. That's why we
+use the awesome [Socket.io] library and [Node.js].
+
+
+## My boss wants a license. So where is it?
+[MIT License](./LICENSE)
+
+
+[AngularJS]: https://angularjs.org/
+[JSTD]: https://code.google.com/p/js-test-driver/
+[Socket.io]: http://socket.io/
+[Node.js]: http://nodejs.org/
+[Jasmine]: https://github.com/karma-runner/karma-jasmine
+[Mocha]: https://github.com/karma-runner/karma-mocha
+[QUnit]: https://github.com/karma-runner/karma-qunit
+[here]: https://www.youtube.com/watch?v=MVw8N3hTfCI
+[Mailing List]: https://groups.google.com/forum/#!forum/karma-users
+[Issue Tracker]: https://github.com/karma-runner/karma/issues
+[@JsKarma]: https://twitter.com/JsKarma
+[RequireJS]: http://requirejs.org/
+[Istanbul]: https://github.com/gotwarlost/istanbul
+
+[browsers]: https://karma-runner.github.io/0.12/config/browsers.html
+[documentation]: https://karma-runner.github.io
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/bin/karma b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/bin/karma
new file mode 100644
index 00000000..19bb1e35
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/bin/karma
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+
+require('../lib/cli').run();
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.coffee b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.coffee
new file mode 100644
index 00000000..05c39992
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.coffee
@@ -0,0 +1,66 @@
+# Karma configuration
+# Generated on %DATE%
+
+module.exports = (config) ->
+ config.set
+
+ # base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '%BASE_PATH%'
+
+
+ # frameworks to use
+ # available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: [%FRAMEWORKS%]
+
+
+ # list of files / patterns to load in the browser
+ files: [%FILES%
+ ]
+
+
+ # list of files to exclude
+ exclude: [%EXCLUDE%
+ ]
+
+
+ # preprocess matching files before serving them to the browser
+ # available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: %PREPROCESSORS%
+
+
+ # test results reporter to use
+ # possible values: 'dots', 'progress'
+ # available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress']
+
+
+ # web server port
+ port: 9876
+
+
+ # enable / disable colors in the output (reporters and logs)
+ colors: true
+
+
+ # level of logging
+ # possible values:
+ # - config.LOG_DISABLE
+ # - config.LOG_ERROR
+ # - config.LOG_WARN
+ # - config.LOG_INFO
+ # - config.LOG_DEBUG
+ logLevel: config.LOG_INFO
+
+
+ # enable / disable watching file and executing tests whenever any file changes
+ autoWatch: %AUTO_WATCH%
+
+
+ # start these browsers
+ # available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: [%BROWSERS%]
+
+
+ # Continuous Integration mode
+ # if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.js
new file mode 100644
index 00000000..69d19c17
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.js
@@ -0,0 +1,63 @@
+// Karma configuration
+// Generated on %DATE%
+
+module.exports = function(config) {
+ config.set({
+
+ // base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '%BASE_PATH%',
+
+
+ // frameworks to use
+ // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: [%FRAMEWORKS%],
+
+
+ // list of files / patterns to load in the browser
+ files: [%FILES%
+ ],
+
+
+ // list of files to exclude
+ exclude: [%EXCLUDE%
+ ],
+
+
+ // preprocess matching files before serving them to the browser
+ // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: %PREPROCESSORS%,
+
+
+ // test results reporter to use
+ // possible values: 'dots', 'progress'
+ // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress'],
+
+
+ // web server port
+ port: 9876,
+
+
+ // enable / disable colors in the output (reporters and logs)
+ colors: true,
+
+
+ // level of logging
+ // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+ logLevel: config.LOG_INFO,
+
+
+ // enable / disable watching file and executing tests whenever any file changes
+ autoWatch: %AUTO_WATCH%,
+
+
+ // start these browsers
+ // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: [%BROWSERS%],
+
+
+ // Continuous Integration mode
+ // if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
+ })
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.ls b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.ls
new file mode 100644
index 00000000..b15e7842
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/config.tpl.ls
@@ -0,0 +1,66 @@
+# Karma configuration
+# Generated on %DATE%
+
+module.exports = (config) ->
+ config.set do
+
+ # base path that will be used to resolve all patterns (eg. files, exclude)
+ basePath: '%BASE_PATH%'
+
+
+ # frameworks to use
+ # available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+ frameworks: [%FRAMEWORKS%]
+
+
+ # list of files / patterns to load in the browser
+ files: [%FILES%
+ ]
+
+
+ # list of files to exclude
+ exclude: [%EXCLUDE%
+ ]
+
+
+ # preprocess matching files before serving them to the browser
+ # available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+ preprocessors: %PREPROCESSORS%
+
+
+ # test results reporter to use
+ # possible values: 'dots', 'progress'
+ # available reporters: https://npmjs.org/browse/keyword/karma-reporter
+ reporters: ['progress']
+
+
+ # web server port
+ port: 9876
+
+
+ # enable / disable colors in the output (reporters and logs)
+ colors: true
+
+
+ # level of logging
+ # possible values:
+ # - config.LOG_DISABLE
+ # - config.LOG_ERROR
+ # - config.LOG_WARN
+ # - config.LOG_INFO
+ # - config.LOG_DEBUG
+ logLevel: config.LOG_INFO
+
+
+ # enable / disable watching file and executing tests whenever any file changes
+ autoWatch: %AUTO_WATCH%
+
+
+ # satart these browsers
+ # available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+ browsers: [%BROWSERS%]
+
+
+ # Continuous Integration mode
+ # if true, Karma captures browsers, runs the tests and exits
+ singleRun: false
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/karma-completion.sh b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/karma-completion.sh
new file mode 100644
index 00000000..650c8199
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/karma-completion.sh
@@ -0,0 +1,50 @@
+###-begin-karma-completion-###
+#
+# karma command completion script
+# This is stolen from NPM. Thanks @isaac!
+#
+# Installation: karma completion >> ~/.bashrc (or ~/.zshrc)
+# Or, maybe: karma completion > /usr/local/etc/bash_completion.d/karma
+#
+
+if type complete &>/dev/null; then
+ __karma_completion () {
+ local si="$IFS"
+ IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
+ COMP_LINE="$COMP_LINE" \
+ COMP_POINT="$COMP_POINT" \
+ karma completion -- "${COMP_WORDS[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ complete -F __karma_completion karma
+elif type compdef &>/dev/null; then
+ __karma_completion() {
+ si=$IFS
+ compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+ COMP_LINE=$BUFFER \
+ COMP_POINT=0 \
+ karma completion -- "${words[@]}" \
+ 2>/dev/null)
+ IFS=$si
+ }
+ compdef __karma_completion karma
+elif type compctl &>/dev/null; then
+ __karma_completion () {
+ local cword line point words si
+ read -Ac words
+ read -cn cword
+ let cword-=1
+ read -l line
+ read -ln point
+ si="$IFS"
+ IFS=$'\n' reply=($(COMP_CWORD="$cword" \
+ COMP_LINE="$line" \
+ COMP_POINT="$point" \
+ karma completion -- "${words[@]}" \
+ 2>/dev/null)) || return $?
+ IFS="$si"
+ }
+ compctl -K __karma_completion karma
+fi
+###-end-karma-completion-###
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/binary-extensions.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/binary-extensions.json
new file mode 100644
index 00000000..eb0137f5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/binary-extensions.json
@@ -0,0 +1,136 @@
+{
+ "extensions": [
+ "adp",
+ "au",
+ "mid",
+ "mp4a",
+ "mpga",
+ "oga",
+ "s3m",
+ "sil",
+ "eol",
+ "dra",
+ "dts",
+ "dtshd",
+ "lvp",
+ "pya",
+ "ecelp4800",
+ "ecelp7470",
+ "ecelp9600",
+ "rip",
+ "weba",
+ "aac",
+ "aif",
+ "caf",
+ "flac",
+ "mka",
+ "m3u",
+ "wax",
+ "wma",
+ "wav",
+ "xm",
+ "flac",
+ "3gp",
+ "3g2",
+ "h261",
+ "h263",
+ "h264",
+ "jpgv",
+ "jpm",
+ "mj2",
+ "mp4",
+ "mpeg",
+ "ogv",
+ "qt",
+ "uvh",
+ "uvm",
+ "uvp",
+ "uvs",
+ "dvb",
+ "fvt",
+ "mxu",
+ "pyv",
+ "uvu",
+ "viv",
+ "webm",
+ "f4v",
+ "fli",
+ "flv",
+ "m4v",
+ "mkv",
+ "mng",
+ "asf",
+ "vob",
+ "wm",
+ "wmv",
+ "wmx",
+ "wvx",
+ "movie",
+ "smv",
+ "bmp",
+ "cgm",
+ "g3",
+ "gif",
+ "ief",
+ "jpg",
+ "jpeg",
+ "ktx",
+ "png",
+ "btif",
+ "sgi",
+ "tiff",
+ "psd",
+ "uvi",
+ "sub",
+ "djvu",
+ "dwg",
+ "dxf",
+ "fbs",
+ "fpx",
+ "fst",
+ "mmr",
+ "rlc",
+ "mdi",
+ "wdp",
+ "npx",
+ "wbmp",
+ "xif",
+ "webp",
+ "3ds",
+ "ras",
+ "cmx",
+ "fh",
+ "ico",
+ "pcx",
+ "pic",
+ "pnm",
+ "pbm",
+ "pgm",
+ "ppm",
+ "rgb",
+ "tga",
+ "xbm",
+ "xpm",
+ "xwd",
+ "xz",
+ "zip",
+ "rar",
+ "tar",
+ "tbz2",
+ "tgz",
+ "txz",
+ "bz2",
+ "eot",
+ "ttf",
+ "woff",
+ "dat",
+ "nexe",
+ "pexe",
+ "epub",
+ "gz",
+ "mp3",
+ "ogg",
+ "swf",
+ "mem"
+ ]
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser.js
new file mode 100644
index 00000000..f4efeaab
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser.js
@@ -0,0 +1,244 @@
+var helper = require('./helper')
+var events = require('./events')
+var logger = require('./logger')
+
+var Result = require('./browser_result')
+
+// The browser is ready to execute tests.
+var READY = 1
+
+// The browser is executing the tests/
+var EXECUTING = 2
+
+// The browser is not executing, but temporarily disconnected (waiting for reconnecting).
+var READY_DISCONNECTED = 3
+
+// The browser is executing the tests, but temporarily disconnect (waiting for reconnecting).
+var EXECUTING_DISCONNECTED = 4
+
+// The browser got permanently disconnected (being removed from the collection and destroyed).
+var DISCONNECTED = 5
+
+var Browser = function (id, fullName, /* capturedBrowsers */ collection, emitter, socket, timer,
+ /* config.browserDisconnectTimeout */ disconnectDelay,
+ /* config.browserNoActivityTimeout */ noActivityTimeout) {
+ var name = helper.browserFullNameToShort(fullName)
+ var log = logger.create(name)
+ var activeSockets = [socket]
+ var activeSocketsIds = function () {
+ return activeSockets.map(function (s) {
+ return s.id
+ }).join(', ')
+ }
+
+ var self = this
+ var pendingDisconnect
+ var disconnect = function (reason) {
+ self.state = DISCONNECTED
+ self.disconnectsCount++
+ log.warn('Disconnected (%d times)' + (reason || ''), self.disconnectsCount)
+ collection.remove(self)
+ }
+
+ var noActivityTimeoutId
+ var refreshNoActivityTimeout = noActivityTimeout ? function () {
+ clearNoActivityTimeout()
+ noActivityTimeoutId = timer.setTimeout(function () {
+ self.lastResult.totalTimeEnd()
+ self.lastResult.disconnected = true
+ disconnect(', because no message in ' + noActivityTimeout + ' ms.')
+ emitter.emit('browser_complete', self)
+ }, noActivityTimeout)
+ } : function () {}
+
+ var clearNoActivityTimeout = noActivityTimeout ? function () {
+ if (noActivityTimeoutId) {
+ timer.clearTimeout(noActivityTimeoutId)
+ noActivityTimeoutId = null
+ }
+ } : function () {}
+
+ this.id = id
+ this.fullName = fullName
+ this.name = name
+ this.state = READY
+ this.lastResult = new Result()
+ this.disconnectsCount = 0
+
+ this.init = function () {
+ collection.add(this)
+
+ events.bindAll(this, socket)
+
+ log.info('Connected on socket %s with id %s', socket.id, id)
+
+ // TODO(vojta): move to collection
+ emitter.emit('browsers_change', collection)
+
+ emitter.emit('browser_register', this)
+ }
+
+ this.isReady = function () {
+ return this.state === READY
+ }
+
+ this.toString = function () {
+ return this.name
+ }
+
+ this.onError = function (error) {
+ if (this.isReady()) {
+ return
+ }
+
+ this.lastResult.error = true
+ emitter.emit('browser_error', this, error)
+
+ refreshNoActivityTimeout()
+ }
+
+ this.onInfo = function (info) {
+ if (this.isReady()) {
+ return
+ }
+
+ // TODO(vojta): remove
+ if (helper.isDefined(info.dump)) {
+ emitter.emit('browser_log', this, info.dump, 'dump')
+ }
+
+ if (helper.isDefined(info.log)) {
+ emitter.emit('browser_log', this, info.log, info.type)
+ }
+
+ refreshNoActivityTimeout()
+ }
+
+ this.onStart = function (info) {
+ this.lastResult = new Result()
+ this.lastResult.total = info.total
+
+ if (info.total === null) {
+ log.warn('Adapter did not report total number of specs.')
+ }
+
+ emitter.emit('browser_start', this, info)
+ refreshNoActivityTimeout()
+ }
+
+ this.onComplete = function (result) {
+ if (this.isReady()) {
+ return
+ }
+
+ this.state = READY
+ this.lastResult.totalTimeEnd()
+
+ if (!this.lastResult.success) {
+ this.lastResult.error = true
+ }
+
+ emitter.emit('browsers_change', collection)
+ emitter.emit('browser_complete', this, result)
+
+ clearNoActivityTimeout()
+ }
+
+ this.onDisconnect = function (_, disconnectedSocket) {
+ activeSockets.splice(activeSockets.indexOf(disconnectedSocket), 1)
+
+ if (activeSockets.length) {
+ log.debug('Disconnected %s, still have %s', disconnectedSocket.id, activeSocketsIds())
+ return
+ }
+
+ if (this.state === READY) {
+ disconnect()
+ } else if (this.state === EXECUTING) {
+ log.debug('Disconnected during run, waiting %sms for reconnecting.', disconnectDelay)
+ this.state = EXECUTING_DISCONNECTED
+
+ pendingDisconnect = timer.setTimeout(function () {
+ self.lastResult.totalTimeEnd()
+ self.lastResult.disconnected = true
+ disconnect()
+ emitter.emit('browser_complete', self)
+ }, disconnectDelay)
+
+ clearNoActivityTimeout()
+ }
+ }
+
+ this.reconnect = function (newSocket) {
+ if (this.state === EXECUTING_DISCONNECTED) {
+ this.state = EXECUTING
+ log.debug('Reconnected on %s.', newSocket.id)
+ } else if (this.state === EXECUTING || this.state === READY) {
+ log.debug('New connection %s (already have %s)', newSocket.id, activeSocketsIds())
+ } else if (this.state === DISCONNECTED) {
+ this.state = READY
+ log.info('Connected on socket %s with id %s', newSocket.id, this.id)
+ collection.add(this)
+
+ // TODO(vojta): move to collection
+ emitter.emit('browsers_change', collection)
+
+ emitter.emit('browser_register', this)
+ }
+
+ var exists = activeSockets.some(function (s) {
+ return s.id === newSocket.id
+ })
+ if (!exists) {
+ activeSockets.push(newSocket)
+ events.bindAll(this, newSocket)
+ }
+
+ if (pendingDisconnect) {
+ timer.clearTimeout(pendingDisconnect)
+ }
+
+ refreshNoActivityTimeout()
+ }
+
+ this.onResult = function (result) {
+ if (result.length) {
+ return result.forEach(this.onResult, this)
+ }
+
+ // ignore - probably results from last run (after server disconnecting)
+ if (this.isReady()) {
+ return
+ }
+
+ this.lastResult.add(result)
+
+ emitter.emit('spec_complete', this, result)
+ refreshNoActivityTimeout()
+ }
+
+ this.serialize = function () {
+ return {
+ id: this.id,
+ name: this.name,
+ isReady: this.state === READY
+ }
+ }
+
+ this.execute = function (config) {
+ activeSockets.forEach(function (socket) {
+ socket.emit('execute', config)
+ })
+
+ this.state = EXECUTING
+ refreshNoActivityTimeout()
+ }
+}
+
+Browser.STATE_READY = READY
+Browser.STATE_EXECUTING = EXECUTING
+Browser.STATE_READY_DISCONNECTED = READY_DISCONNECTED
+Browser.STATE_EXECUTING_DISCONNECTED = EXECUTING_DISCONNECTED
+Browser.STATE_DISCONNECTED = DISCONNECTED
+
+module.exports = Browser
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_collection.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_collection.js
new file mode 100644
index 00000000..bee0a5f8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_collection.js
@@ -0,0 +1,105 @@
+var EXECUTING = require('./browser').STATE_EXECUTING
+var Result = require('./browser_result')
+
+var Collection = function (emitter, browsers) {
+ browsers = browsers || []
+
+ this.add = function (browser) {
+ browsers.push(browser)
+ emitter.emit('browsers_change', this)
+ }
+
+ this.remove = function (browser) {
+ var index = browsers.indexOf(browser)
+
+ if (index === -1) {
+ return false
+ }
+
+ browsers.splice(index, 1)
+ emitter.emit('browsers_change', this)
+
+ return true
+ }
+
+ this.getById = function (browserId) {
+ for (var i = 0; i < browsers.length; i++) {
+ if (browsers[i].id === browserId) {
+ return browsers[i]
+ }
+ }
+
+ return null
+ }
+
+ this.setAllToExecuting = function () {
+ browsers.forEach(function (browser) {
+ browser.state = EXECUTING
+ })
+
+ emitter.emit('browsers_change', this)
+ }
+
+ this.areAllReady = function (nonReadyList) {
+ nonReadyList = nonReadyList || []
+
+ browsers.forEach(function (browser) {
+ if (!browser.isReady()) {
+ nonReadyList.push(browser)
+ }
+ })
+
+ return nonReadyList.length === 0
+ }
+
+ this.serialize = function () {
+ return browsers.map(function (browser) {
+ return browser.serialize()
+ })
+ }
+
+ this.getResults = function () {
+ var results = browsers.reduce(function (previous, current) {
+ previous.success += current.lastResult.success
+ previous.failed += current.lastResult.failed
+ previous.error = previous.error || current.lastResult.error
+ previous.disconnected = previous.disconnected || current.lastResult.disconnected
+ return previous
+ }, {success: 0, failed: 0, error: false, disconnected: false, exitCode: 0})
+
+ // compute exit status code
+ results.exitCode = results.failed || results.error || results.disconnected ? 1 : 0
+
+ return results
+ }
+
+ // TODO(vojta): can we remove this? (we clear the results per browser in onBrowserStart)
+ this.clearResults = function () {
+ browsers.forEach(function (browser) {
+ browser.lastResult = new Result()
+ })
+ }
+
+ this.clone = function () {
+ return new Collection(emitter, browsers.slice())
+ }
+
+ // Array APIs
+ this.map = function (callback, context) {
+ return browsers.map(callback, context)
+ }
+
+ this.forEach = function (callback, context) {
+ return browsers.forEach(callback, context)
+ }
+
+ // this.length
+ Object.defineProperty(this, 'length', {
+ get: function () {
+ return browsers.length
+ }
+ })
+}
+Collection.$inject = ['emitter']
+
+module.exports = Collection
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_result.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_result.js
new file mode 100644
index 00000000..241e5a7d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/browser_result.js
@@ -0,0 +1,25 @@
+var Result = function () {
+ var startTime = Date.now()
+
+ this.total = this.skipped = this.failed = this.success = 0
+ this.netTime = this.totalTime = 0
+ this.disconnected = this.error = false
+
+ this.totalTimeEnd = function () {
+ this.totalTime = Date.now() - startTime
+ }
+
+ this.add = function (result) {
+ if (result.skipped) {
+ this.skipped++
+ } else if (result.success) {
+ this.success++
+ } else {
+ this.failed++
+ }
+
+ this.netTime += result.time
+ }
+}
+
+module.exports = Result
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/cli.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/cli.js
new file mode 100644
index 00000000..a12daa12
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/cli.js
@@ -0,0 +1,237 @@
+var path = require('path')
+var optimist = require('optimist')
+var helper = require('./helper')
+var constant = require('./constants')
+var fs = require('fs')
+
+var processArgs = function (argv, options, fs, path) {
+ if (argv.help) {
+ console.log(optimist.help())
+ process.exit(0)
+ }
+
+ if (argv.version) {
+ console.log('Karma version: ' + constant.VERSION)
+ process.exit(0)
+ }
+
+ // TODO(vojta): warn/throw when unknown argument (probably mispelled)
+ Object.getOwnPropertyNames(argv).forEach(function (name) {
+ var argumentValue = argv[name]
+ if (name !== '_' && name !== '$0') {
+ if (Array.isArray(argumentValue)) {
+ // If the same argument is defined multiple times, override.
+ argumentValue = argumentValue.pop()
+ }
+ options[helper.dashToCamel(name)] = argumentValue
+ }
+ })
+
+ if (helper.isString(options.autoWatch)) {
+ options.autoWatch = options.autoWatch === 'true'
+ }
+
+ if (helper.isString(options.colors)) {
+ options.colors = options.colors === 'true'
+ }
+
+ if (helper.isString(options.logLevel)) {
+ options.logLevel = constant['LOG_' + options.logLevel.toUpperCase()] || constant.LOG_DISABLE
+ }
+
+ if (helper.isString(options.singleRun)) {
+ options.singleRun = options.singleRun === 'true'
+ }
+
+ if (helper.isString(options.browsers)) {
+ options.browsers = options.browsers.split(',')
+ }
+
+ if (options.reportSlowerThan === false) {
+ options.reportSlowerThan = 0
+ }
+
+ if (helper.isString(options.reporters)) {
+ options.reporters = options.reporters.split(',')
+ }
+
+ if (helper.isString(options.removedFiles)) {
+ options.removedFiles = options.removedFiles.split(',')
+ }
+
+ if (helper.isString(options.addedFiles)) {
+ options.addedFiles = options.addedFiles.split(',')
+ }
+
+ if (helper.isString(options.changedFiles)) {
+ options.changedFiles = options.changedFiles.split(',')
+ }
+
+ if (helper.isString(options.refresh)) {
+ options.refresh = options.refresh === 'true'
+ }
+
+ var configFile = argv._.shift()
+
+ if (!configFile) {
+ // default config file (if exists)
+ if (fs.existsSync('./karma.conf.js')) {
+ configFile = './karma.conf.js'
+ } else if (fs.existsSync('./karma.conf.coffee')) {
+ configFile = './karma.conf.coffee'
+ }
+ }
+
+ options.configFile = configFile ? path.resolve(configFile) : null
+
+ return options
+}
+
+var parseClientArgs = function (argv) {
+ // extract any args after '--' as clientArgs
+ var clientArgs = []
+ argv = argv.slice(2)
+ var idx = argv.indexOf('--')
+ if (idx !== -1) {
+ clientArgs = argv.slice(idx + 1)
+ }
+ return clientArgs
+}
+
+// return only args that occur before `--`
+var argsBeforeDoubleDash = function (argv) {
+ var idx = argv.indexOf('--')
+
+ return idx === -1 ? argv : argv.slice(0, idx)
+}
+
+var describeShared = function () {
+ optimist
+ .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
+ 'Usage:\n' +
+ ' $0 <command>\n\n' +
+ 'Commands:\n' +
+ ' start [<configFile>] [<options>] Start the server / do single run.\n' +
+ ' init [<configFile>] Initialize a config file.\n' +
+ ' run [<options>] [ -- <clientArgs>] Trigger a test run.\n' +
+ ' completion Shell completion for karma.\n\n' +
+ 'Run --help with particular command to see its description and available options.')
+ .describe('help', 'Print usage and options.')
+ .describe('version', 'Print current version.')
+}
+
+var describeInit = function () {
+ optimist
+ .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
+ 'INIT - Initialize a config file.\n\n' +
+ 'Usage:\n' +
+ ' $0 init [<configFile>]')
+ .describe('log-level', '<disable | error | warn | info | debug> Level of logging.')
+ .describe('colors', 'Use colors when reporting and printing logs.')
+ .describe('no-colors', 'Do not use colors when reporting or printing logs.')
+ .describe('help', 'Print usage and options.')
+}
+
+var describeStart = function () {
+ optimist
+ .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
+ 'START - Start the server / do a single run.\n\n' +
+ 'Usage:\n' +
+ ' $0 start [<configFile>] [<options>]')
+ .describe('port', '<integer> Port where the server is running.')
+ .describe('auto-watch', 'Auto watch source files and run on change.')
+ .describe('no-auto-watch', 'Do not watch source files.')
+ .describe('log-level', '<disable | error | warn | info | debug> Level of logging.')
+ .describe('colors', 'Use colors when reporting and printing logs.')
+ .describe('no-colors', 'Do not use colors when reporting or printing logs.')
+ .describe('reporters', 'List of reporters (available: dots, progress, junit, growl, coverage).')
+ .describe('browsers', 'List of browsers to start (eg. --browsers Chrome,ChromeCanary,Firefox).')
+ .describe('capture-timeout', '<integer> Kill browser if does not capture in given time [ms].')
+ .describe('single-run', 'Run the test when browsers captured and exit.')
+ .describe('no-single-run', 'Disable single-run.')
+ .describe('report-slower-than', '<integer> Report tests that are slower than given time [ms].')
+ .describe('help', 'Print usage and options.')
+}
+
+var describeRun = function () {
+ optimist
+ .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
+ 'RUN - Run the tests (requires running server).\n\n' +
+ 'Usage:\n' +
+ ' $0 run [<configFile>] [<options>] [ -- <clientArgs>]')
+ .describe('port', '<integer> Port where the server is listening.')
+ .describe('no-refresh', 'Do not re-glob all the patterns.')
+ .describe('help', 'Print usage.')
+}
+
+var describeCompletion = function () {
+ optimist
+ .usage('Karma - Spectacular Test Runner for JavaScript.\n\n' +
+ 'COMPLETION - Bash/ZSH completion for karma.\n\n' +
+ 'Installation:\n' +
+ ' $0 completion >> ~/.bashrc\n')
+ .describe('help', 'Print usage.')
+}
+
+exports.process = function () {
+ var argv = optimist.parse(argsBeforeDoubleDash(process.argv.slice(2)))
+ var options = {
+ cmd: argv._.shift()
+ }
+
+ switch (options.cmd) {
+ case 'start':
+ describeStart()
+ break
+
+ case 'run':
+ describeRun()
+ options.clientArgs = parseClientArgs(process.argv)
+ break
+
+ case 'init':
+ describeInit()
+ break
+
+ case 'completion':
+ describeCompletion()
+ break
+
+ default:
+ describeShared()
+ if (!options.cmd) {
+ processArgs(argv, options, fs, path)
+ console.error('Command not specified.')
+ } else {
+ console.error('Unknown command "' + options.cmd + '".')
+ }
+ optimist.showHelp()
+ process.exit(1)
+ }
+
+ return processArgs(argv, options, fs, path)
+}
+
+exports.run = function () {
+ var config = exports.process()
+
+ switch (config.cmd) {
+ case 'start':
+ require('./server').start(config)
+ break
+ case 'run':
+ require('./runner').run(config)
+ break
+ case 'init':
+ require('./init').init(config)
+ break
+ case 'completion':
+ require('./completion').completion(config)
+ break
+ }
+}
+
+// just for testing
+exports.processArgs = processArgs
+exports.parseClientArgs = parseClientArgs
+exports.argsBeforeDoubleDash = argsBeforeDoubleDash
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/completion.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/completion.js
new file mode 100644
index 00000000..8a11b446
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/completion.js
@@ -0,0 +1,164 @@
+var CUSTOM = ['']
+var BOOLEAN = false
+
+var options = {
+ start: {
+ '--port': CUSTOM,
+ '--auto-watch': BOOLEAN,
+ '--no-auto-watch': BOOLEAN,
+ '--log-level': ['disable', 'debug', 'info', 'warn', 'error'],
+ '--colors': BOOLEAN,
+ '--no-colors': BOOLEAN,
+ '--reporters': ['dots', 'progress'],
+ '--no-reporters': BOOLEAN,
+ '--browsers': ['Chrome', 'ChromeCanary', 'Firefox', 'PhantomJS', 'Safari', 'Opera'],
+ '--no-browsers': BOOLEAN,
+ '--single-run': BOOLEAN,
+ '--no-single-run': BOOLEAN,
+ '--help': BOOLEAN
+ },
+ init: {
+ '--log-level': ['disable', 'debug', 'info', 'warn', 'error'],
+ '--colors': BOOLEAN,
+ '--no-colors': BOOLEAN,
+ '--help': BOOLEAN
+ },
+ run: {
+ '--no-refresh': BOOLEAN,
+ '--port': CUSTOM,
+ '--help': BOOLEAN
+ }
+}
+
+var parseEnv = function (argv, env) {
+ var words = argv.slice(5)
+
+ return {
+ words: words,
+ count: parseInt(env.COMP_CWORD, 10),
+ last: words[words.length - 1],
+ prev: words[words.length - 2]
+ }
+}
+
+var opositeWord = function (word) {
+ if (word.charAt(0) !== '-') {
+ return null
+ }
+
+ return word.substr(0, 5) === '--no-' ? '--' + word.substr(5) : '--no-' + word.substr(2)
+}
+
+var sendCompletionNoOptions = function () {}
+
+var sendCompletion = function (possibleWords, env) {
+ var regexp = new RegExp('^' + env.last)
+ var filteredWords = possibleWords.filter(function (word) {
+ return regexp.test(word) && env.words.indexOf(word) === -1 &&
+ env.words.indexOf(opositeWord(word)) === -1
+ })
+
+ if (!filteredWords.length) {
+ return sendCompletionNoOptions(env)
+ }
+
+ filteredWords.forEach(function (word) {
+ console.log(word)
+ })
+}
+
+var glob = require('glob')
+var globOpts = {
+ mark: true,
+ nocase: true
+}
+
+var sendCompletionFiles = function (env) {
+ glob(env.last + '*', globOpts, function (err, files) {
+ if (err) return console.error(err)
+
+ if (files.length === 1 && files[0].charAt(files[0].length - 1) === '/') {
+ sendCompletionFiles({last: files[0]})
+ } else {
+ console.log(files.join('\n'))
+ }
+ })
+}
+
+var sendCompletionConfirmLast = function (env) {
+ console.log(env.last)
+}
+
+var complete = function (env) {
+ if (env.count === 1) {
+ if (env.words[0].charAt(0) === '-') {
+ return sendCompletion(['--help', '--version'], env)
+ }
+
+ return sendCompletion(Object.keys(options), env)
+ }
+
+ if (env.count === 2 && env.words[1].charAt(0) !== '-') {
+ // complete files (probably karma.conf.js)
+ return sendCompletionFiles(env)
+ }
+
+ var cmdOptions = options[env.words[0]]
+ var previousOption = cmdOptions[env.prev]
+
+ if (!cmdOptions) {
+ // no completion, wrong command
+ return sendCompletionNoOptions()
+ }
+
+ if (previousOption === CUSTOM && env.last) {
+ // custom value with already filled something
+ return sendCompletionConfirmLast(env)
+ }
+
+ if (previousOption) {
+ // custom options
+ return sendCompletion(previousOption, env)
+ }
+
+ return sendCompletion(Object.keys(cmdOptions), env)
+}
+
+var completion = function () {
+ if (process.argv[3] === '--') {
+ return complete(parseEnv(process.argv, process.env))
+ }
+
+ // just print out the karma-completion.sh
+ var fs = require('fs')
+ var path = require('path')
+
+ fs.readFile(path.resolve(__dirname, '../karma-completion.sh'), 'utf8', function (err, data) {
+ if (err) return console.error(err)
+
+ process.stdout.write(data)
+ process.stdout.on('error', function (error) {
+ // Darwin is a real dick sometimes.
+ //
+ // This is necessary because the "source" or "." program in
+ // bash on OS X closes its file argument before reading
+ // from it, meaning that you get exactly 1 write, which will
+ // work most of the time, and will always raise an EPIPE.
+ //
+ // Really, one should not be tossing away EPIPE errors, or any
+ // errors, so casually. But, without this, `. <(karma completion)`
+ // can never ever work on OS X.
+ if (error.errno === 'EPIPE') {
+ error = null
+ }
+ })
+ })
+}
+
+// PUBLIC API
+exports.completion = completion
+
+// for testing
+exports.opositeWord = opositeWord
+exports.sendCompletion = sendCompletion
+exports.complete = complete
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/config.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/config.js
new file mode 100644
index 00000000..341dee5a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/config.js
@@ -0,0 +1,304 @@
+var path = require('path')
+
+var logger = require('./logger')
+var log = logger.create('config')
+var helper = require('./helper')
+var constant = require('./constants')
+
+var COFFEE_SCRIPT_AVAILABLE = false
+var LIVE_SCRIPT_AVAILABLE = false
+
+// Coffee is required here to enable config files written in coffee-script.
+// It's not directly used in this file.
+try {
+ require('coffee-script').register()
+ COFFEE_SCRIPT_AVAILABLE = true
+} catch (e) {}
+
+// LiveScript is required here to enable config files written in LiveScript.
+// It's not directly used in this file.
+try {
+ require('LiveScript')
+ LIVE_SCRIPT_AVAILABLE = true
+} catch (e) {}
+
+var Pattern = function (pattern, served, included, watched) {
+ this.pattern = pattern
+ this.served = helper.isDefined(served) ? served : true
+ this.included = helper.isDefined(included) ? included : true
+ this.watched = helper.isDefined(watched) ? watched : true
+}
+
+var UrlPattern = function (url) {
+ Pattern.call(this, url, false, true, false)
+}
+
+var createPatternObject = function (pattern) {
+ if (pattern && helper.isString(pattern)) {
+ return helper.isUrlAbsolute(pattern) ? new UrlPattern(pattern) : new Pattern(pattern)
+ }
+
+ if (helper.isObject(pattern)) {
+ if (pattern.pattern && helper.isString(pattern.pattern)) {
+ return helper.isUrlAbsolute(pattern.pattern) ?
+ new UrlPattern(pattern.pattern) :
+ new Pattern(pattern.pattern, pattern.served, pattern.included, pattern.watched)
+ }
+
+ log.warn('Invalid pattern %s!\n\tObject is missing "pattern" property.', pattern)
+ return new Pattern(null, false, false, false)
+ }
+
+ log.warn('Invalid pattern %s!\n\tExpected string or object with "pattern" property.', pattern)
+ return new Pattern(null, false, false, false)
+}
+
+var normalizeUrlRoot = function (urlRoot) {
+ var normalizedUrlRoot = urlRoot
+
+ if (normalizedUrlRoot.charAt(0) !== '/') {
+ normalizedUrlRoot = '/' + normalizedUrlRoot
+ }
+
+ if (normalizedUrlRoot.charAt(normalizedUrlRoot.length - 1) !== '/') {
+ normalizedUrlRoot = normalizedUrlRoot + '/'
+ }
+
+ if (normalizedUrlRoot !== urlRoot) {
+ log.warn('urlRoot normalized to "%s"', normalizedUrlRoot)
+ }
+
+ return normalizedUrlRoot
+}
+
+var normalizeConfig = function (config, configFilePath) {
+ var basePathResolve = function (relativePath) {
+ if (helper.isUrlAbsolute(relativePath)) {
+ return relativePath
+ }
+
+ if (!helper.isDefined(config.basePath) || !helper.isDefined(relativePath)) {
+ return ''
+ }
+ return path.resolve(config.basePath, relativePath)
+ }
+
+ var createPatternMapper = function (resolve) {
+ return function (objectPattern) {
+ objectPattern.pattern = resolve(objectPattern.pattern)
+
+ return objectPattern
+ }
+ }
+
+ if (helper.isString(configFilePath)) {
+ // resolve basePath
+ config.basePath = path.resolve(path.dirname(configFilePath), config.basePath)
+
+ // always ignore the config file itself
+ config.exclude.push(configFilePath)
+ } else {
+ config.basePath = path.resolve(config.basePath || '.')
+ }
+
+ config.files = config.files.map(createPatternObject).map(createPatternMapper(basePathResolve))
+ config.exclude = config.exclude.map(basePathResolve)
+
+ // normalize paths on windows
+ config.basePath = helper.normalizeWinPath(config.basePath)
+ config.files = config.files.map(createPatternMapper(helper.normalizeWinPath))
+ config.exclude = config.exclude.map(helper.normalizeWinPath)
+
+ // normalize urlRoot
+ config.urlRoot = normalizeUrlRoot(config.urlRoot)
+
+ if (config.proxies && config.proxies.hasOwnProperty(config.urlRoot)) {
+ log.warn('"%s" is proxied, you should probably change urlRoot to avoid conflicts',
+ config.urlRoot)
+ }
+
+ if (config.singleRun && config.autoWatch) {
+ log.debug('autoWatch set to false, because of singleRun')
+ config.autoWatch = false
+ }
+
+ if (!config.singleRun && config.browserDisconnectTolerance) {
+ log.debug('browserDisconnectTolerance set to 0, because of singleRun')
+ config.browserDisconnectTolerance = 0
+ }
+
+ if (helper.isString(config.reporters)) {
+ config.reporters = config.reporters.split(',')
+ }
+
+ if (config.client && config.client.args && !Array.isArray(config.client.args)) {
+ throw new Error('Invalid configuration: client.args must be an array of strings')
+ }
+
+ var defaultClient = config.defaultClient || {}
+ Object.keys(defaultClient).forEach(function (key) {
+ var option = config.client[key]
+ config.client[key] = helper.isDefined(option) ? option : defaultClient[key]
+ })
+
+ // normalize preprocessors
+ var preprocessors = config.preprocessors || {}
+ var normalizedPreprocessors = config.preprocessors = Object.create(null)
+
+ Object.keys(preprocessors).forEach(function (pattern) {
+ var normalizedPattern = helper.normalizeWinPath(basePathResolve(pattern))
+
+ normalizedPreprocessors[normalizedPattern] = helper.isString(preprocessors[pattern]) ?
+ [preprocessors[pattern]] : preprocessors[pattern]
+ })
+
+ // define custom launchers/preprocessors/reporters - create an inlined plugin
+ var module = Object.create(null)
+ var hasSomeInlinedPlugin = false
+ var types = ['launcher', 'preprocessor', 'reporter']
+
+ types.forEach(function (type) {
+ var definitions = config['custom' + helper.ucFirst(type) + 's'] || {}
+
+ Object.keys(definitions).forEach(function (name) {
+ var definition = definitions[name]
+
+ if (!helper.isObject(definition)) {
+ return log.warn('Can not define %s %s. Definition has to be an object.', type, name)
+ }
+
+ if (!helper.isString(definition.base)) {
+ return log.warn('Can not define %s %s. Missing base %s.', type, name, type)
+ }
+
+ var token = type + ':' + definition.base
+ var locals = {
+ args: ['value', definition]
+ }
+
+ module[type + ':' + name] = ['factory', function (injector) {
+ return injector.createChild([locals], [token]).get(token)
+ }]
+ hasSomeInlinedPlugin = true
+ })
+ })
+
+ if (hasSomeInlinedPlugin) {
+ config.plugins.push(module)
+ }
+
+ return config
+}
+
+var Config = function () {
+ var config = this
+
+ this.LOG_DISABLE = constant.LOG_DISABLE
+ this.LOG_ERROR = constant.LOG_ERROR
+ this.LOG_WARN = constant.LOG_WARN
+ this.LOG_INFO = constant.LOG_INFO
+ this.LOG_DEBUG = constant.LOG_DEBUG
+
+ this.set = function (newConfig) {
+ Object.keys(newConfig).forEach(function (key) {
+ config[key] = newConfig[key]
+ })
+ }
+
+ // DEFAULT CONFIG
+ this.frameworks = []
+ this.port = constant.DEFAULT_PORT
+ this.hostname = constant.DEFAULT_HOSTNAME
+ this.basePath = ''
+ this.files = []
+ this.exclude = []
+ this.logLevel = constant.LOG_INFO
+ this.colors = true
+ this.autoWatch = true
+ this.autoWatchBatchDelay = 250
+ this.usePolling = process.platform === 'darwin' || process.platform === 'linux'
+ this.reporters = ['progress']
+ this.singleRun = false
+ this.browsers = []
+ this.captureTimeout = 60000
+ this.proxies = {}
+ this.proxyValidateSSL = true
+ this.preprocessors = {}
+ this.urlRoot = '/'
+ this.reportSlowerThan = 0
+ this.loggers = [constant.CONSOLE_APPENDER]
+ this.transports = ['websocket', 'flashsocket', 'xhr-polling', 'jsonp-polling']
+ this.plugins = ['karma-*']
+ this.defaultClient = this.client = {
+ args: [],
+ useIframe: true,
+ captureConsole: true
+ }
+ this.browserDisconnectTimeout = 2000
+ this.browserDisconnectTolerance = 0
+ this.browserNoActivityTimeout = 10000
+}
+
+var CONFIG_SYNTAX_HELP = ' module.exports = function(config) {\n' +
+ ' config.set({\n' +
+ ' // your config\n' +
+ ' });\n' +
+ ' };\n'
+
+var parseConfig = function (configFilePath, cliOptions) {
+ var configModule
+ if (configFilePath) {
+ log.debug('Loading config %s', configFilePath)
+
+ try {
+ configModule = require(configFilePath)
+ } catch (e) {
+ if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf(configFilePath) !== -1) {
+ log.error('File %s does not exist!', configFilePath)
+ } else {
+ log.error('Invalid config file!\n ' + e.stack)
+
+ var extension = path.extname(configFilePath)
+ if (extension === '.coffee' && !COFFEE_SCRIPT_AVAILABLE) {
+ log.error('You need to install CoffeeScript.\n' +
+ ' npm install coffee-script --save-dev')
+ } else if (extension === '.ls' && !LIVE_SCRIPT_AVAILABLE) {
+ log.error('You need to install LiveScript.\n' +
+ ' npm install LiveScript --save-dev')
+ }
+ }
+ return process.exit(1)
+ }
+ if (!helper.isFunction(configModule)) {
+ log.error('Config file must export a function!\n' + CONFIG_SYNTAX_HELP)
+ return process.exit(1)
+ }
+ } else {
+ log.debug('No config file specified.')
+ // if no config file path is passed, we define a dummy config module.
+ configModule = function () {}
+ }
+
+ var config = new Config()
+
+ try {
+ configModule(config)
+ } catch (e) {
+ log.error('Error in config file!\n', e)
+ return process.exit(1)
+ }
+
+ // merge the config from config file and cliOptions (precendense)
+ config.set(cliOptions)
+
+ // configure the logger as soon as we can
+ logger.setup(config.logLevel, config.colors, config.loggers)
+
+ return normalizeConfig(config, configFilePath)
+}
+
+// PUBLIC API
+exports.parseConfig = parseConfig
+exports.Pattern = Pattern
+exports.createPatternObject = createPatternObject
+exports.Config = Config
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/constants.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/constants.js
new file mode 100644
index 00000000..dd980b37
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/constants.js
@@ -0,0 +1,30 @@
+var fs = require('fs')
+
+var pkg = JSON.parse(fs.readFileSync(__dirname + '/../package.json').toString())
+
+exports.VERSION = pkg.version
+
+exports.DEFAULT_PORT = process.env.PORT || 9876
+exports.DEFAULT_HOSTNAME = process.env.IP || 'localhost'
+
+// log levels
+exports.LOG_DISABLE = 'OFF'
+exports.LOG_ERROR = 'ERROR'
+exports.LOG_WARN = 'WARN'
+exports.LOG_INFO = 'INFO'
+exports.LOG_DEBUG = 'DEBUG'
+
+// Default patterns for the pattern layout.
+exports.COLOR_PATTERN = '%[%p [%c]: %]%m'
+exports.NO_COLOR_PATTERN = '%p [%c]: %m'
+
+// Default console appender
+exports.CONSOLE_APPENDER = {
+ type: 'console',
+ layout: {
+ type: 'pattern',
+ pattern: exports.COLOR_PATTERN
+ }
+}
+
+exports.EXIT_CODE = '\x1FEXIT'
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/emitter_wrapper.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/emitter_wrapper.js
new file mode 100644
index 00000000..7dd15d57
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/emitter_wrapper.js
@@ -0,0 +1,31 @@
+function EmitterWrapper (emitter) {
+ this.listeners = {}
+ this.emitter = emitter
+}
+
+EmitterWrapper.prototype.addListener = EmitterWrapper.prototype.on = function (event, listener) {
+ this.emitter.addListener(event, listener)
+
+ if (!this.listeners.hasOwnProperty(event)) {
+ this.listeners[event] = []
+ }
+
+ this.listeners[event].push(listener)
+
+ return this
+}
+
+EmitterWrapper.prototype.removeAllListeners = function (event) {
+ var events = event ? [event] : Object.keys(this.listeners)
+ var self = this
+ events.forEach(function (event) {
+ self.listeners[event].forEach(function (listener) {
+ self.emitter.removeListener(event, listener)
+ })
+ delete self.listeners[event]
+ })
+
+ return this
+}
+
+module.exports = EmitterWrapper
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/events.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/events.js
new file mode 100644
index 00000000..7db3b36e
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/events.js
@@ -0,0 +1,88 @@
+var events = require('events')
+var util = require('util')
+var Q = require('q')
+
+var helper = require('./helper')
+
+var bindAllEvents = function (object, context) {
+ context = context || this
+
+ var bindMethod = function (method) {
+ context.on(helper.camelToSnake(method.substr(2)), function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.push(context)
+ object[method].apply(object, args)
+ })
+ }
+
+ for (var method in object) {
+ if (helper.isFunction(object[method]) && method.substr(0, 2) === 'on') {
+ bindMethod(method)
+ }
+ }
+}
+
+var bufferEvents = function (emitter, eventsToBuffer) {
+ var listeners = []
+ var eventsToReply = []
+ var genericListener = function () {
+ eventsToReply.push(Array.prototype.slice.call(arguments))
+ }
+
+ eventsToBuffer.forEach(function (eventName) {
+ var listener = genericListener.bind(null, eventName)
+ listeners.push(listener)
+ emitter.on(eventName, listener)
+ })
+
+ return function () {
+ if (!eventsToReply) {
+ return
+ }
+
+ // remove all buffering listeners
+ listeners.forEach(function (listener, i) {
+ emitter.removeListener(eventsToBuffer[i], listener)
+ })
+
+ // reply
+ eventsToReply.forEach(function (args) {
+ events.EventEmitter.prototype.emit.apply(emitter, args)
+ })
+
+ // free-up
+ listeners = eventsToReply = null
+ }
+}
+
+// TODO(vojta): log.debug all events
+var EventEmitter = function () {
+ this.bind = bindAllEvents
+
+ this.emitAsync = function (name) {
+ // TODO(vojta): allow passing args
+ // TODO(vojta): ignore/throw if listener call done() multiple times
+ var pending = this.listeners(name).length
+ var deferred = Q.defer()
+ var done = function () {
+ if (!--pending) {
+ deferred.resolve()
+ }
+ }
+
+ this.emit(name, done)
+
+ if (!pending) {
+ deferred.resolve()
+ }
+
+ return deferred.promise
+ }
+}
+
+util.inherits(EventEmitter, events.EventEmitter)
+
+// PUBLISH
+exports.EventEmitter = EventEmitter
+exports.bindAll = bindAllEvents
+exports.bufferEvents = bufferEvents
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/executor.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/executor.js
new file mode 100644
index 00000000..a56fa1c1
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/executor.js
@@ -0,0 +1,55 @@
+var log = require('./logger').create()
+
+var Executor = function (capturedBrowsers, config, emitter) {
+ var self = this
+ var executionScheduled = false
+ var pendingCount = 0
+ var runningBrowsers
+
+ var schedule = function () {
+ var nonReady = []
+
+ if (!capturedBrowsers.length) {
+ log.warn('No captured browser, open http://%s:%s%s', config.hostname, config.port,
+ config.urlRoot)
+ return false
+ }
+
+ if (capturedBrowsers.areAllReady(nonReady)) {
+ log.debug('All browsers are ready, executing')
+ executionScheduled = false
+ capturedBrowsers.clearResults()
+ capturedBrowsers.setAllToExecuting()
+ pendingCount = capturedBrowsers.length
+ runningBrowsers = capturedBrowsers.clone()
+ emitter.emit('run_start', runningBrowsers)
+ self.socketIoSockets.emit('execute', config.client)
+ return true
+ }
+
+ log.info('Delaying execution, these browsers are not ready: ' + nonReady.join(', '))
+ executionScheduled = true
+ return false
+ }
+
+ this.schedule = schedule
+
+ this.onRunComplete = function () {
+ if (executionScheduled) {
+ schedule()
+ }
+ }
+
+ this.onBrowserComplete = function () {
+ pendingCount--
+
+ if (!pendingCount) {
+ emitter.emit('run_complete', runningBrowsers, runningBrowsers.getResults())
+ }
+ }
+
+ // bind all the events
+ emitter.bind(this)
+}
+
+module.exports = Executor
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/file_list.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/file_list.js
new file mode 100644
index 00000000..8bd86ec2
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/file_list.js
@@ -0,0 +1,425 @@
+var fs = require('fs')
+var glob = require('glob')
+var mm = require('minimatch')
+var q = require('q')
+
+var helper = require('./helper')
+var log = require('./logger').create('watcher')
+
+var createWinGlob = function (realGlob) {
+ return function (pattern, options, done) {
+ realGlob(pattern, options, function (err, results) {
+ done(err, results.map(helper.normalizeWinPath))
+ })
+ }
+}
+
+var findBucketByPath = function (buckets, path) {
+ for (var i = 0; i < buckets.length; i++) {
+ for (var j = 0; j < buckets[i].length; j++) {
+ if (buckets[i][j].originalPath === path) {
+ return [i, j]
+ }
+ }
+ }
+}
+
+if (process.platform === 'win32') {
+ glob = createWinGlob(glob)
+}
+
+var File = function (path, mtime) {
+ // used for serving (processed path, eg some/file.coffee -> some/file.coffee.js)
+ this.path = path
+
+ // original absolute path, id of the file
+ this.originalPath = path
+
+ // where the content is stored (processed)
+ this.contentPath = path
+
+ this.mtime = mtime
+ this.isUrl = false
+}
+
+var Url = function (path) {
+ this.path = path
+ this.isUrl = true
+}
+
+Url.prototype.toString = File.prototype.toString = function () {
+ return this.path
+}
+
+var GLOB_OPTS = {
+ // globDebug: true,
+ follow: true,
+ cwd: '/'
+}
+
+var byPath = function (a, b) {
+ if (a.path > b.path) {
+ return 1
+ }
+ if (a.path < b.path) {
+ return -1
+ }
+ return 0
+}
+
+// TODO(vojta): ignore changes (add/change/remove) when in the middle of refresh
+// TODO(vojta): do not glob patterns that are watched (both on init and refresh)
+var List = function (patterns, excludes, emitter, preprocess, batchInterval) {
+ var self = this
+ var pendingDeferred
+ var pendingTimeout
+
+ var errors = []
+
+ var addError = function (path) {
+ if (errors.indexOf(path) === -1) {
+ errors.push(path)
+ }
+ }
+
+ var removeError = function (path) {
+ var idx = errors.indexOf(path)
+
+ if (idx !== -1) {
+ errors.splice(idx, 1)
+ }
+ }
+
+ var resolveFiles = function (buckets) {
+ var uniqueMap = {}
+ var files = {
+ served: [],
+ included: []
+ }
+
+ buckets.forEach(function (bucket, idx) {
+ bucket.sort(byPath).forEach(function (file) {
+ if (!uniqueMap[file.path]) {
+ if (patterns[idx].served) {
+ files.served.push(file)
+ }
+
+ if (patterns[idx].included) {
+ files.included.push(file)
+ }
+
+ uniqueMap[file.path] = true
+ }
+ })
+ })
+
+ return files
+ }
+
+ var resolveDeferred = function (files) {
+ clearPendingTimeout()
+
+ if (!errors.length) {
+ pendingDeferred.resolve(files || resolveFiles(self.buckets))
+ } else {
+ pendingDeferred.reject(errors.slice())
+ }
+
+ pendingDeferred = pendingTimeout = null
+ }
+
+ var fireEventAndDefer = function () {
+ clearPendingTimeout()
+
+ if (!pendingDeferred) {
+ pendingDeferred = q.defer()
+ emitter.emit('file_list_modified', pendingDeferred.promise)
+ }
+
+ pendingTimeout = setTimeout(resolveDeferred, batchInterval)
+ }
+
+ var clearPendingTimeout = function () {
+ if (pendingTimeout) {
+ clearTimeout(pendingTimeout)
+ }
+ }
+
+ // re-glob all the patterns
+ this.refresh = function () {
+ // TODO(vojta): cancel refresh if another refresh starts
+ var buckets = self.buckets = new Array(patterns.length)
+
+ var complete = function () {
+ if (buckets !== self.buckets) {
+ return
+ }
+
+ var files = resolveFiles(buckets)
+
+ resolveDeferred(files)
+ log.debug('Resolved files:\n\t' + files.served.join('\n\t'))
+ }
+
+ // TODO(vojta): use some async helper library for this
+ var pending = 0
+ var finish = function () {
+ pending--
+
+ if (!pending) {
+ complete()
+ }
+ }
+
+ errors = []
+
+ if (!pendingDeferred) {
+ pendingDeferred = q.defer()
+ emitter.emit('file_list_modified', pendingDeferred.promise)
+ }
+
+ clearPendingTimeout()
+
+ patterns.forEach(function (patternObject, i) {
+ var pattern = patternObject.pattern
+
+ if (helper.isUrlAbsolute(pattern)) {
+ buckets[i] = [new Url(pattern)]
+ return
+ }
+
+ pending++
+ glob(pattern, GLOB_OPTS, function (err, resolvedFiles) {
+ if (err) log.warn(err)
+
+ var matchedAndNotIgnored = 0
+
+ buckets[i] = []
+
+ if (!resolvedFiles.length) {
+ log.warn('Pattern "%s" does not match any file.', pattern)
+ return finish()
+ }
+
+ // stat each file to get mtime and isDirectory
+ resolvedFiles.forEach(function (path) {
+ var matchExclude = function (excludePattern) {
+ return mm(path, excludePattern)
+ }
+
+ if (excludes.some(matchExclude)) {
+ log.debug('Excluded file "%s"', path)
+ return
+ }
+
+ pending++
+ matchedAndNotIgnored++
+ fs.stat(path, function (error, stat) {
+ if (error) {
+ log.debug('An error occured while reading "%s"', path)
+ finish()
+ } else {
+ if (!stat.isDirectory()) {
+ // TODO(vojta): reuse file objects
+ var file = new File(path, stat.mtime)
+
+ preprocess(file, function (err) {
+ buckets[i].push(file)
+
+ if (err) {
+ addError(path)
+ }
+
+ finish()
+ })
+ } else {
+ log.debug('Ignored directory "%s"', path)
+ finish()
+ }
+ }
+ })
+ })
+
+ if (!matchedAndNotIgnored) {
+ log.warn('All files matched by "%s" were excluded.', pattern)
+ }
+
+ finish()
+ })
+ })
+
+ if (!pending) {
+ process.nextTick(complete)
+ }
+
+ return pendingDeferred.promise
+ }
+
+ // set new patterns and excludes
+ // and re-glob
+ this.reload = function (newPatterns, newExcludes) {
+ patterns = newPatterns
+ excludes = newExcludes
+
+ return this.refresh()
+ }
+
+ /**
+ * Adds a new file into the list (called by watcher)
+ * - ignore excluded files
+ * - ignore files that are already in the list
+ * - get mtime (by stat)
+ * - fires "file_list_modified"
+ */
+ this.addFile = function (path, done) {
+ var buckets = this.buckets
+ var i, j
+
+ // sorry, this callback is just for easier testing
+ done = done || function () {}
+
+ // check excludes
+ for (i = 0; i < excludes.length; i++) {
+ if (mm(path, excludes[i])) {
+ log.debug('Add file "%s" ignored. Excluded by "%s".', path, excludes[i])
+ return done()
+ }
+ }
+
+ for (i = 0; i < patterns.length; i++) {
+ if (mm(path, patterns[i].pattern)) {
+ for (j = 0; j < buckets[i].length; j++) {
+ if (buckets[i][j].originalPath === path) {
+ log.debug('Add file "%s" ignored. Already in the list.', path)
+ return done()
+ }
+ }
+
+ break
+ }
+ }
+
+ if (i >= patterns.length) {
+ log.debug('Add file "%s" ignored. Does not match any pattern.', path)
+ return done()
+ }
+
+ var addedFile = new File(path)
+ buckets[i].push(addedFile)
+
+ clearPendingTimeout()
+
+ return fs.stat(path, function (err, stat) {
+ if (err) log.warn(err)
+
+ // in the case someone refresh() the list before stat callback
+ if (self.buckets === buckets) {
+ addedFile.mtime = stat.mtime
+
+ return preprocess(addedFile, function (err) {
+ // TODO(vojta): ignore if refresh/reload happens
+ log.info('Added file "%s".', path)
+
+ if (err) {
+ addError(path)
+ }
+
+ fireEventAndDefer()
+ done()
+ })
+ }
+
+ return done()
+ })
+ }
+
+ /**
+ * Update mtime of a file (called by watcher)
+ * - ignore if file is not in the list
+ * - ignore if mtime has not changed
+ * - fire "file_list_modified"
+ */
+ this.changeFile = function (path, done) {
+ var buckets = this.buckets
+
+ // sorry, this callback is just for easier testing
+ done = done || function () {}
+
+ var indices = findBucketByPath(buckets, path) || []
+
+ var i = indices[0]
+ var j = indices[1]
+
+ if (i === undefined || !buckets[i]) {
+ log.debug('Changed file "%s" ignored. Does not match any file in the list.', path)
+ return done()
+ }
+
+ var changedFile = buckets[i][j]
+ return fs.stat(path, function (err, stat) {
+ // https://github.com/paulmillr/chokidar/issues/11
+ if (err || !stat) {
+ return self.removeFile(path, done)
+ }
+
+ if (self.buckets === buckets && stat.mtime > changedFile.mtime) {
+ log.info('Changed file "%s".', path)
+ changedFile.mtime = stat.mtime
+ // TODO(vojta): THIS CAN MAKE FILES INCONSISTENT
+ // if batched change is resolved before preprocessing is finished, the file can be in
+ // inconsistent state, when the promise is resolved.
+ // Solutions:
+ // 1/ the preprocessor should not change the object in place, but create a copy that would
+ // be eventually merged into the original file, here in the callback, synchronously.
+ // 2/ delay the promise resolution - wait for any changeFile operations to finish
+ return preprocess(changedFile, function (err) {
+ if (err) {
+ addError(path)
+ } else {
+ removeError(path)
+ }
+
+ // TODO(vojta): ignore if refresh/reload happens
+ fireEventAndDefer()
+ done()
+ })
+ }
+
+ return done()
+ })
+ }
+
+ /**
+ * Remove a file from the list (called by watcher)
+ * - ignore if file is not in the list
+ * - fire "file_list_modified"
+ */
+ this.removeFile = function (path, done) {
+ var buckets = this.buckets
+
+ // sorry, this callback is just for easier testing
+ done = done || function () {}
+
+ for (var i = 0; i < buckets.length; i++) {
+ for (var j = 0; j < buckets[i].length; j++) {
+ if (buckets[i][j].originalPath === path) {
+ buckets[i].splice(j, 1)
+ log.info('Removed file "%s".', path)
+ removeError(path)
+ fireEventAndDefer()
+ return done()
+ }
+ }
+ }
+
+ log.debug('Removed file "%s" ignored. Does not match any file in the list.', path)
+ return done()
+ }
+}
+List.$inject = ['config.files', 'config.exclude', 'emitter', 'preprocess',
+ 'config.autoWatchBatchDelay']
+
+// PUBLIC
+exports.List = List
+exports.File = File
+exports.Url = Url
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/helper.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/helper.js
new file mode 100644
index 00000000..044877d5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/helper.js
@@ -0,0 +1,91 @@
+var fs = require('fs')
+var path = require('path')
+var _ = require('lodash')
+var useragent = require('useragent')
+
+exports.browserFullNameToShort = function (fullName) {
+ var agent = useragent.parse(fullName)
+ return agent.toAgent() + ' (' + agent.os + ')'
+}
+
+exports.isDefined = function (value) {
+ return !_.isUndefined(value)
+}
+
+exports.isFunction = _.isFunction
+exports.isString = _.isString
+exports.isObject = _.isObject
+exports.isArray = _.isArray
+
+var ABS_URL = /^https?:\/\//
+exports.isUrlAbsolute = function (url) {
+ return ABS_URL.test(url)
+}
+
+exports.camelToSnake = function (camelCase) {
+ return camelCase.replace(/[A-Z]/g, function (match, pos) {
+ return (pos > 0 ? '_' : '') + match.toLowerCase()
+ })
+}
+
+exports.ucFirst = function (word) {
+ return word.charAt(0).toUpperCase() + word.substr(1)
+}
+
+exports.dashToCamel = function (dash) {
+ var words = dash.split('-')
+ return words.shift() + words.map(exports.ucFirst).join('')
+}
+
+exports.arrayRemove = function (collection, item) {
+ var idx = collection.indexOf(item)
+
+ if (idx !== -1) {
+ collection.splice(idx, 1)
+ return true
+ }
+
+ return false
+}
+
+exports.merge = function () {
+ var args = Array.prototype.slice.call(arguments, 0)
+ args.unshift({})
+ return _.merge.apply({}, args)
+}
+
+exports.formatTimeInterval = function (time) {
+ var mins = Math.floor(time / 60000)
+ var secs = (time - mins * 60000) / 1000
+ var str = secs + (secs === 1 ? ' sec' : ' secs')
+
+ if (mins) {
+ str = mins + (mins === 1 ? ' min ' : ' mins ') + str
+ }
+
+ return str
+}
+
+var replaceWinPath = function (path) {
+ return exports.isDefined(path) ? path.replace(/\\/g, '/') : path
+}
+
+exports.normalizeWinPath = process.platform === 'win32' ? replaceWinPath : _.identity
+
+exports.mkdirIfNotExists = function mkdir (directory, done) {
+ // TODO(vojta): handle if it's a file
+ /* eslint-disable handle-callback-err */
+ fs.stat(directory, function (err, stat) {
+ if (stat && stat.isDirectory()) {
+ done()
+ } else {
+ mkdir(path.dirname(directory), function () {
+ fs.mkdir(directory, done)
+ })
+ }
+ })
+ /* eslint-enable handle-callback-err */
+}
+
+// export lodash
+exports._ = _
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/index.js
new file mode 100644
index 00000000..f0da7f00
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/index.js
@@ -0,0 +1,5 @@
+// index module
+exports.VERSION = require('./constants').VERSION
+exports.server = require('./server')
+exports.runner = require('./runner')
+exports.launcher = require('./launcher')
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init.js
new file mode 100644
index 00000000..9faa2bd8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init.js
@@ -0,0 +1,271 @@
+var readline = require('readline')
+var path = require('path')
+var glob = require('glob')
+var mm = require('minimatch')
+var exec = require('child_process').exec
+
+var helper = require('./helper')
+var logger = require('./logger')
+var constant = require('./constants')
+
+var log = logger.create('init')
+
+var StateMachine = require('./init/state_machine')
+var COLOR_SCHEME = require('./init/color_schemes')
+var formatters = require('./init/formatters')
+
+// TODO(vojta): coverage
+// TODO(vojta): html preprocessors
+// TODO(vojta): SauceLabs
+// TODO(vojta): BrowserStack
+
+var logQueue = []
+var printLogQueue = function () {
+ while (logQueue.length) {
+ logQueue.shift()()
+ }
+}
+
+var NODE_MODULES_DIR = path.resolve(__dirname, '../..')
+
+// Karma is not in node_modules, probably a symlink,
+// use current working dir.
+if (!/node_modules$/.test(NODE_MODULES_DIR)) {
+ NODE_MODULES_DIR = path.resolve('node_modules')
+}
+
+var installPackage = function (pkgName) {
+ // Do not install if already installed.
+ try {
+ require(NODE_MODULES_DIR + '/' + pkgName)
+ return
+ } catch (e) {}
+
+ log.debug('Missing plugin "%s". Installing...', pkgName)
+
+ var options = {
+ cwd: path.resolve(NODE_MODULES_DIR, '..')
+ }
+
+ exec('npm install ' + pkgName + ' --save-dev', options, function (err, stdout, stderr) {
+ // Put the logs into the queue and print them after answering current question.
+ // Otherwise the log would clobber the interactive terminal.
+ logQueue.push(function () {
+ if (!err) {
+ log.debug('%s successfully installed.', pkgName)
+ } else if (/is not in the npm registry/.test(stderr)) {
+ log.warn('Failed to install "%s". It is not in the NPM registry!\n' +
+ ' Please install it manually.', pkgName)
+ } else if (/Error: EACCES/.test(stderr)) {
+ log.warn('Failed to install "%s". No permissions to write in %s!\n' +
+ ' Please install it manually.', pkgName, options.cwd)
+ } else {
+ log.warn('Failed to install "%s"\n Please install it manually.', pkgName)
+ }
+ })
+ })
+}
+
+var validatePattern = function (pattern) {
+ if (!glob.sync(pattern).length) {
+ log.warn('There is no file matching this pattern.\n')
+ }
+}
+
+var validateBrowser = function (name) {
+ // TODO(vojta): check if the path resolves to a binary
+ installPackage('karma-' + name.toLowerCase().replace('canary', '') + '-launcher')
+}
+
+var validateFramework = function (name) {
+ installPackage('karma-' + name)
+}
+
+var validateRequireJs = function (useRequire) {
+ if (useRequire) {
+ validateFramework('requirejs')
+ }
+}
+
+var questions = [{
+ id: 'framework',
+ question: 'Which testing framework do you want to use ?',
+ hint: 'Press tab to list possible options. Enter to move to the next question.',
+ options: ['jasmine', 'mocha', 'qunit', 'nodeunit', 'nunit', ''],
+ validate: validateFramework
+}, {
+ id: 'requirejs',
+ question: 'Do you want to use Require.js ?',
+ hint: 'This will add Require.js plugin.\n' +
+ 'Press tab to list possible options. Enter to move to the next question.',
+ options: ['no', 'yes'],
+ validate: validateRequireJs,
+ boolean: true
+}, {
+ id: 'browsers',
+ question: 'Do you want to capture any browsers automatically ?',
+ hint: 'Press tab to list possible options. Enter empty string to move to the next question.',
+ options: ['Chrome', 'ChromeCanary', 'Firefox', 'Safari', 'PhantomJS', 'Opera', 'IE', ''],
+ validate: validateBrowser,
+ multiple: true
+}, {
+ id: 'files',
+ question: 'What is the location of your source and test files ?',
+ hint: 'You can use glob patterns, eg. "js/*.js" or "test/**/*Spec.js".\n' +
+ 'Enter empty string to move to the next question.',
+ multiple: true,
+ validate: validatePattern
+}, {
+ id: 'exclude',
+ question: 'Should any of the files included by the previous patterns be excluded ?',
+ hint: 'You can use glob patterns, eg. "**/*.swp".\n' +
+ 'Enter empty string to move to the next question.',
+ multiple: true,
+ validate: validatePattern
+}, {
+ id: 'generateTestMain',
+ question: 'Do you wanna generate a bootstrap file for RequireJS?',
+ hint: 'This will generate test-main.js/coffee that configures RequireJS and starts the tests.',
+ options: ['no', 'yes'],
+ boolean: true,
+ condition: function (answers) {
+ return answers.requirejs
+ }
+}, {
+ id: 'includedFiles',
+ question: 'Which files do you want to include with <script> tag ?',
+ hint: 'This should be a script that bootstraps your test by configuring Require.js and ' +
+ 'kicking __karma__.start(), probably your test-main.js file.\n' +
+ 'Enter empty string to move to the next question.',
+ multiple: true,
+ validate: validatePattern,
+ condition: function (answers) {
+ return answers.requirejs && !answers.generateTestMain
+ }
+}, {
+ id: 'autoWatch',
+ question: 'Do you want Karma to watch all the files and run the tests on change ?',
+ hint: 'Press tab to list possible options.',
+ options: ['yes', 'no'],
+ boolean: true
+}]
+
+var getBasePath = function (configFilePath, cwd) {
+ var configParts = path.dirname(configFilePath).split(path.sep)
+ var cwdParts = cwd.split(path.sep)
+ var base = []
+
+ while (configParts.length && configParts[0] === cwdParts[0]) {
+ configParts.shift()
+ cwdParts.shift()
+ }
+
+ while (configParts.length) {
+ var part = configParts.shift()
+ if (part === '..') {
+ base.unshift(cwdParts.pop())
+ } else if (part !== '.') {
+ base.unshift('..')
+ }
+ }
+
+ return base.join(path.sep)
+}
+
+var processAnswers = function (answers, basePath, testMainFile) {
+ var processedAnswers = {
+ basePath: basePath,
+ files: answers.files,
+ onlyServedFiles: [],
+ exclude: answers.exclude,
+ autoWatch: answers.autoWatch,
+ generateTestMain: answers.generateTestMain,
+ browsers: answers.browsers,
+ frameworks: [],
+ preprocessors: {}
+ }
+
+ if (answers.framework) {
+ processedAnswers.frameworks.push(answers.framework)
+ }
+
+ if (answers.requirejs) {
+ processedAnswers.frameworks.push('requirejs')
+ processedAnswers.files = answers.includedFiles || []
+ processedAnswers.onlyServedFiles = answers.files
+
+ if (answers.generateTestMain) {
+ processedAnswers.files.push(testMainFile)
+ }
+ }
+
+ var allPatterns = answers.files.concat(answers.includedFiles || [])
+ if (allPatterns.some(function (pattern) {
+ return mm(pattern, '**/*.coffee')
+ })) {
+ installPackage('karma-coffee-preprocessor')
+ processedAnswers.preprocessors['**/*.coffee'] = ['coffee']
+ }
+
+ return processedAnswers
+}
+
+exports.init = function (config) {
+ var useColors = true
+ var logLevel = constant.LOG_INFO
+ var colorScheme = COLOR_SCHEME.ON
+
+ if (helper.isDefined(config.colors)) {
+ colorScheme = config.colors ? COLOR_SCHEME.ON : COLOR_SCHEME.OFF
+ useColors = config.colors
+ }
+
+ if (helper.isDefined(config.logLevel)) {
+ logLevel = config.logLevel
+ }
+
+ logger.setup(logLevel, useColors)
+
+ // need to be registered before creating readlineInterface
+ process.stdin.on('keypress', function (s, key) {
+ sm.onKeypress(key)
+ })
+
+ var rli = readline.createInterface(process.stdin, process.stdout)
+ var sm = new StateMachine(rli, colorScheme)
+
+ rli.on('line', sm.onLine.bind(sm))
+
+ // clean colors
+ rli.on('SIGINT', function () {
+ sm.kill()
+ process.exit(0)
+ })
+
+ sm.on('next_question', printLogQueue)
+
+ sm.process(questions, function (answers) {
+ var cwd = process.cwd()
+ var configFile = config.configFile || 'karma.conf.js'
+ var isCoffee = path.extname(configFile) === '.coffee'
+ var testMainFile = isCoffee ? 'test-main.coffee' : 'test-main.js'
+ var formatter = formatters.createForPath(configFile)
+ var processedAnswers = processAnswers(answers, getBasePath(configFile, cwd), testMainFile)
+ var configFilePath = path.resolve(cwd, configFile)
+ var testMainFilePath = path.resolve(cwd, testMainFile)
+
+ if (isCoffee) {
+ installPackage('coffee-script')
+ }
+
+ if (processedAnswers.generateTestMain) {
+ formatter.writeRequirejsConfigFile(testMainFilePath)
+ console.log(colorScheme.success(
+ 'RequireJS bootstrap file generated at "' + testMainFilePath + '".\n'
+ ))
+ }
+
+ formatter.writeConfigFile(configFilePath, processedAnswers)
+ console.log(colorScheme.success('Config file generated at "' + configFilePath + '".\n'))
+ })
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/color_schemes.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/color_schemes.js
new file mode 100644
index 00000000..3ff78079
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/color_schemes.js
@@ -0,0 +1,28 @@
+var COLORS_ON = {
+ RESET: '\x1B[39m',
+ ANSWER: '\x1B[36m', // NYAN
+ SUCCESS: '\x1B[32m', // GREEN
+ QUESTION: '\x1B[1m', // BOLD
+ question: function (str) {
+ return this.QUESTION + str + '\x1B[22m'
+ },
+ success: function (str) {
+ return this.SUCCESS + str + this.RESET
+ }
+}
+
+var COLORS_OFF = {
+ RESET: '',
+ ANSWER: '',
+ SUCCESS: '',
+ QUESTION: '',
+ question: function (str) {
+ return str
+ },
+ success: function (str) {
+ return str
+ }
+}
+
+exports.ON = COLORS_ON
+exports.OFF = COLORS_OFF
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/formatters.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/formatters.js
new file mode 100644
index 00000000..78cd6fe7
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/formatters.js
@@ -0,0 +1,130 @@
+var fs = require('fs')
+var util = require('util')
+
+var JS_TEMPLATE_PATH = __dirname + '/../../config.tpl.js'
+var COFFEE_TEMPLATE_PATH = __dirname + '/../../config.tpl.coffee'
+var JS_REQUIREJS_TEMPLATE_PATH = __dirname + '/../../requirejs.config.tpl.js'
+var COFFEE_REQUIREJS_TEMPLATE_PATH = __dirname + '/../../requirejs.config.tpl.coffee'
+var COFFEE_REGEXP = /\.coffee$/
+var LIVE_TEMPLATE_PATH = __dirname + '/../../config.tpl.ls'
+var LIVE_REGEXP = /\.ls$/
+
+var isCoffeeFile = function (filename) {
+ return COFFEE_REGEXP.test(filename)
+}
+
+var isLiveFile = function (filename) {
+ return LIVE_REGEXP.test(filename)
+}
+
+var JavaScriptFormatter = function () {
+ var quote = function (value) {
+ return "'" + value + "'"
+ }
+
+ var quoteNonIncludedPattern = function (value) {
+ return util.format('{pattern: %s, included: false}', quote(value))
+ }
+
+ var pad = function (str, pad) {
+ return str.replace(/\n/g, '\n' + pad).replace(/\s+$/gm, '')
+ }
+
+ var formatQuottedList = function (list) {
+ return list.map(quote).join(', ')
+ }
+
+ this.TEMPLATE_FILE_PATH = JS_TEMPLATE_PATH
+ this.REQUIREJS_TEMPLATE_FILE = JS_REQUIREJS_TEMPLATE_PATH
+
+ this.formatFiles = function (includedFiles, onlyServedFiles) {
+ var files = includedFiles.map(quote)
+
+ onlyServedFiles.forEach(function (onlyServedFile) {
+ files.push(quoteNonIncludedPattern(onlyServedFile))
+ })
+
+ files = files.map(function (file) {
+ return '\n ' + file
+ })
+
+ return files.join(',')
+ }
+
+ this.formatPreprocessors = function (preprocessors) {
+ var lines = []
+ Object.keys(preprocessors).forEach(function (pattern) {
+ lines.push(' ' + quote(pattern) + ': [' + formatQuottedList(preprocessors[pattern]) + ']')
+ })
+
+ return pad('{\n' + lines.join(',\n') + '\n}', ' ')
+ }
+
+ this.formatFrameworks = formatQuottedList
+
+ this.formatBrowsers = formatQuottedList
+
+ this.formatAnswers = function (answers) {
+ return {
+ DATE: new Date(),
+ BASE_PATH: answers.basePath,
+ FRAMEWORKS: this.formatFrameworks(answers.frameworks),
+ FILES: this.formatFiles(answers.files, answers.onlyServedFiles),
+ EXCLUDE: this.formatFiles(answers.exclude, []),
+ AUTO_WATCH: answers.autoWatch ? 'true' : 'false',
+ BROWSERS: this.formatBrowsers(answers.browsers),
+ PREPROCESSORS: this.formatPreprocessors(answers.preprocessors)
+ }
+ }
+
+ this.generateConfigFile = function (answers) {
+ var template = fs.readFileSync(this.TEMPLATE_FILE_PATH).toString()
+ var replacements = this.formatAnswers(answers)
+
+ return template.replace(/%(.*)%/g, function (a, key) {
+ return replacements[key]
+ })
+ }
+
+ this.writeConfigFile = function (path, answers) {
+ fs.writeFileSync(path, this.generateConfigFile(answers))
+ }
+
+ this.generateRequirejsConfigFile = function () {
+ var template = fs.readFileSync(this.REQUIREJS_TEMPLATE_FILE).toString()
+ return template
+ }
+
+ this.writeRequirejsConfigFile = function (path) {
+ fs.writeFileSync(path, this.generateRequirejsConfigFile())
+ }
+}
+
+var CoffeeFormatter = function () {
+ JavaScriptFormatter.call(this)
+
+ this.TEMPLATE_FILE_PATH = COFFEE_TEMPLATE_PATH
+ this.REQUIREJS_TEMPLATE_FILE = COFFEE_REQUIREJS_TEMPLATE_PATH
+}
+
+var LiveFormatter = function () {
+ JavaScriptFormatter.call(this)
+
+ this.TEMPLATE_FILE_PATH = LIVE_TEMPLATE_PATH
+}
+
+exports.JavaScript = JavaScriptFormatter
+exports.Coffee = CoffeeFormatter
+exports.Live = LiveFormatter
+
+exports.createForPath = function (path) {
+ if (isCoffeeFile(path)) {
+ return new CoffeeFormatter()
+ }
+
+ if (isLiveFile(path)) {
+ return new LiveFormatter()
+ }
+
+ return new JavaScriptFormatter()
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/state_machine.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/state_machine.js
new file mode 100644
index 00000000..3761a65d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/init/state_machine.js
@@ -0,0 +1,141 @@
+var util = require('util')
+var EventEmitter = require('events').EventEmitter
+
+var StateMachine = function (rli, colors) {
+ var questions
+ var currentQuestion
+ var answers
+ var currentOptions
+ var currentOptionsPointer
+ var currentQuestionId
+ var done
+
+ EventEmitter.call(this)
+
+ var showPrompt = function () {
+ rli.write(colors.ANSWER)
+ rli.prompt()
+ }
+
+ this.onKeypress = function (key) {
+ if (!currentOptions || !key) {
+ return
+ }
+
+ if (key.name === 'tab' || key.name === 'right' || key.name === 'down') {
+ this.suggestNextOption()
+ } else if (key.name === 'left' || key.name === 'up') {
+ currentOptionsPointer = currentOptionsPointer + currentOptions.length - 2
+ this.suggestNextOption()
+ }
+
+ if (!key.ctrl && !key.meta && key.name !== 'enter' && key.name !== 'return') {
+ key.name = 'escape'
+ }
+ }
+
+ this.suggestNextOption = function () {
+ if (!currentOptions) {
+ return
+ }
+
+ currentOptionsPointer = (currentOptionsPointer + 1) % currentOptions.length
+ rli._deleteLineLeft()
+ rli._deleteLineRight()
+ rli.write(currentOptions[currentOptionsPointer])
+ }
+
+ this.kill = function () {
+ currentOptions = null
+ currentQuestionId = null
+ rli.write('\n' + colors.RESET + '\n')
+ rli.close()
+ }
+
+ this.onLine = function (line) {
+ if (currentQuestionId) {
+ rli.write(colors.RESET)
+ line = line.trim().replace(colors.ANSWER, '').replace(colors.RESET, '')
+
+ if (currentOptions) {
+ currentOptionsPointer = currentOptions.indexOf(line)
+ if (currentOptionsPointer === -1) {
+ return
+ }
+ }
+
+ if (line === '') {
+ line = null
+ }
+
+ if (currentQuestion.boolean) {
+ line = (line === 'yes' || line === 'true' || line === 'on')
+ }
+
+ if (line !== null && currentQuestion.validate) {
+ currentQuestion.validate(line)
+ }
+
+ if (currentQuestion.multiple) {
+ answers[currentQuestionId] = answers[currentQuestionId] || []
+ if (line !== null) {
+ answers[currentQuestionId].push(line)
+ showPrompt()
+
+ if (currentOptions) {
+ currentOptions.splice(currentOptionsPointer, 1)
+ currentOptionsPointer = -1
+ }
+ } else {
+ this.nextQuestion()
+ }
+ } else {
+ answers[currentQuestionId] = line
+ this.nextQuestion()
+ }
+ }
+ }
+
+ this.nextQuestion = function () {
+ currentQuestion = questions.shift()
+
+ while (currentQuestion && currentQuestion.condition && !currentQuestion.condition(answers)) {
+ currentQuestion = questions.shift()
+ }
+
+ this.emit('next_question', currentQuestion)
+
+ if (currentQuestion) {
+ currentQuestionId = null
+
+ rli.write('\n' + colors.question(currentQuestion.question) + '\n')
+ rli.write(currentQuestion.hint + '\n')
+ showPrompt()
+
+ currentOptions = currentQuestion.options || null
+ currentOptionsPointer = -1
+ currentQuestionId = currentQuestion.id
+
+ this.suggestNextOption()
+ } else {
+ currentQuestionId = null
+ currentOptions = null
+
+ // end
+ this.kill()
+ done(answers)
+ }
+ }
+
+ this.process = function (_questions, _done) {
+ questions = _questions
+ answers = {}
+ done = _done
+
+ this.nextQuestion()
+ }
+}
+
+util.inherits(StateMachine, EventEmitter)
+
+module.exports = StateMachine
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launcher.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launcher.js
new file mode 100644
index 00000000..39b531c8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launcher.js
@@ -0,0 +1,169 @@
+var log = require('./logger').create('launcher')
+var q = require('q')
+
+var baseDecorator = require('./launchers/base').decoratorFactory
+var captureTimeoutDecorator = require('./launchers/capture_timeout').decoratorFactory
+var retryDecorator = require('./launchers/retry').decoratorFactory
+var processDecorator = require('./launchers/process').decoratorFactory
+
+// TODO(vojta): remove once nobody uses it
+var baseBrowserDecoratorFactory = function (baseLauncherDecorator, captureTimeoutLauncherDecorator,
+ retryLauncherDecorator, processLauncherDecorator) {
+ return function (launcher) {
+ baseLauncherDecorator(launcher)
+ captureTimeoutLauncherDecorator(launcher)
+ retryLauncherDecorator(launcher)
+ processLauncherDecorator(launcher)
+ }
+}
+
+var Launcher = function (emitter, injector) {
+ var browsers = []
+ var lastStartTime
+
+ var getBrowserById = function (id) {
+ for (var i = 0; i < browsers.length; i++) {
+ if (browsers[i].id === id) {
+ return browsers[i]
+ }
+ }
+
+ return null
+ }
+
+ this.launch = function (names, hostname, port, urlRoot) {
+ var browser
+ var url = 'http://' + hostname + ':' + port + urlRoot
+
+ lastStartTime = Date.now()
+
+ names.forEach(function (name) {
+ var locals = {
+ id: ['value', Launcher.generateId()],
+ name: ['value', name],
+ baseLauncherDecorator: ['factory', baseDecorator],
+ captureTimeoutLauncherDecorator: ['factory', captureTimeoutDecorator],
+ retryLauncherDecorator: ['factory', retryDecorator],
+ processLauncherDecorator: ['factory', processDecorator],
+ baseBrowserDecorator: ['factory', baseBrowserDecoratorFactory]
+ }
+
+ // TODO(vojta): determine script from name
+ if (name.indexOf('/') !== -1) {
+ name = 'Script'
+ }
+
+ try {
+ browser = injector.createChild([locals], ['launcher:' + name]).get('launcher:' + name)
+ } catch (e) {
+ if (e.message.indexOf('No provider for "launcher:' + name + '"') !== -1) {
+ log.warn('Can not load "%s", it is not registered!\n ' +
+ 'Perhaps you are missing some plugin?', name)
+ } else {
+ log.warn('Can not load "%s"!\n ' + e.stack, name)
+ }
+
+ return
+ }
+
+ // TODO(vojta): remove in v1.0 (BC for old launchers)
+ if (!browser.forceKill) {
+ browser.forceKill = function () {
+ var deferred = q.defer()
+ this.kill(function () {
+ deferred.resolve()
+ })
+ return deferred.promise
+ }
+
+ browser.restart = function () {
+ var self = this
+ this.kill(function () {
+ self.start(url)
+ })
+ }
+ }
+
+ log.info('Starting browser %s', browser.name)
+ browser.start(url)
+ browsers.push(browser)
+ })
+
+ return browsers
+ }
+
+ this.launch.$inject = ['config.browsers', 'config.hostname', 'config.port', 'config.urlRoot']
+
+ this.kill = function (id, callback) {
+ var browser = getBrowserById(id)
+ callback = callback || function () {}
+
+ if (!browser) {
+ process.nextTick(callback)
+ return false
+ }
+
+ browser.forceKill().then(callback)
+ return true
+ }
+
+ this.restart = function (id) {
+ var browser = getBrowserById(id)
+
+ if (!browser) {
+ return false
+ }
+
+ browser.restart()
+ return true
+ }
+
+ this.killAll = function (callback) {
+ log.debug('Disconnecting all browsers')
+
+ var remaining = 0
+ var finish = function () {
+ remaining--
+ if (!remaining && callback) {
+ callback()
+ }
+ }
+
+ if (!browsers.length) {
+ return process.nextTick(callback)
+ }
+
+ browsers.forEach(function (browser) {
+ remaining++
+ browser.forceKill().then(finish)
+ })
+ }
+
+ this.areAllCaptured = function () {
+ return !browsers.some(function (browser) {
+ return !browser.isCaptured()
+ })
+ }
+
+ this.markCaptured = function (id) {
+ browsers.forEach(function (browser) {
+ if (browser.id === id) {
+ browser.markCaptured()
+ log.debug('%s (id %s) captured in %d secs', browser.name, browser.id,
+ (Date.now() - lastStartTime) / 1000)
+ }
+ })
+ }
+
+ // register events
+ emitter.on('exit', this.killAll)
+}
+
+Launcher.$inject = ['emitter', 'injector']
+
+Launcher.generateId = function () {
+ return '' + Math.floor(Math.random() * 100000000)
+}
+
+// PUBLISH
+exports.Launcher = Launcher
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/base.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/base.js
new file mode 100644
index 00000000..146a851c
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/base.js
@@ -0,0 +1,128 @@
+var KarmaEventEmitter = require('../events').EventEmitter
+var EventEmitter = require('events').EventEmitter
+var q = require('q')
+var log = require('../logger').create('launcher')
+
+var BEING_CAPTURED = 1
+var CAPTURED = 2
+var BEING_KILLED = 3
+var FINISHED = 4
+var RESTARTING = 5
+var BEING_FORCE_KILLED = 6
+
+/**
+ * Base launcher that any custom launcher extends.
+ */
+var BaseLauncher = function (id, emitter) {
+ if (this.start) {
+ return
+ }
+
+ // TODO(vojta): figure out how to do inheritance with DI
+ Object.keys(EventEmitter.prototype).forEach(function (method) {
+ this[method] = EventEmitter.prototype[method]
+ }, this)
+ KarmaEventEmitter.call(this)
+
+ this.id = id
+ this.state = null
+ this.error = null
+
+ var self = this
+ var killingPromise
+ var previousUrl
+
+ this.start = function (url) {
+ previousUrl = url
+
+ this.error = null
+ this.state = BEING_CAPTURED
+ this.emit('start', url + '?id=' + this.id)
+ }
+
+ this.kill = function () {
+ // Already killed, or being killed.
+ if (killingPromise) {
+ return killingPromise
+ }
+
+ killingPromise = this.emitAsync('kill').then(function () {
+ self.state = FINISHED
+ })
+
+ this.state = BEING_KILLED
+
+ return killingPromise
+ }
+
+ this.forceKill = function () {
+ this.kill()
+ this.state = BEING_FORCE_KILLED
+
+ return killingPromise
+ }
+
+ this.restart = function () {
+ if (this.state === BEING_FORCE_KILLED) {
+ return
+ }
+
+ if (!killingPromise) {
+ killingPromise = this.emitAsync('kill')
+ }
+
+ killingPromise.then(function () {
+ if (self.state === BEING_FORCE_KILLED) {
+ self.state = FINISHED
+ } else {
+ killingPromise = null
+ log.debug('Restarting %s', self.name)
+ self.start(previousUrl)
+ }
+ })
+
+ self.state = RESTARTING
+ }
+
+ this.markCaptured = function () {
+ if (this.state === BEING_CAPTURED) {
+ this.state = CAPTURED
+ }
+ }
+
+ this.isCaptured = function () {
+ return this.state === CAPTURED
+ }
+
+ this.toString = function () {
+ return this.name
+ }
+
+ this._done = function (error) {
+ killingPromise = killingPromise || q()
+
+ this.error = this.error || error
+ this.emit('done')
+
+ if (this.error && this.state !== BEING_FORCE_KILLED && this.state !== RESTARTING) {
+ emitter.emit('browser_process_failure', this)
+ }
+
+ this.state = FINISHED
+ }
+
+ this.STATE_BEING_CAPTURED = BEING_CAPTURED
+ this.STATE_CAPTURED = CAPTURED
+ this.STATE_BEING_KILLED = BEING_KILLED
+ this.STATE_FINISHED = FINISHED
+ this.STATE_RESTARTING = RESTARTING
+ this.STATE_BEING_FORCE_KILLED = BEING_FORCE_KILLED
+}
+
+BaseLauncher.decoratorFactory = function (id, emitter) {
+ return function (launcher) {
+ BaseLauncher.call(launcher, id, emitter)
+ }
+}
+
+module.exports = BaseLauncher
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js
new file mode 100644
index 00000000..fe0e166d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/capture_timeout.js
@@ -0,0 +1,44 @@
+var log = require('../logger').create('launcher')
+
+/**
+ * Kill browser if it does not capture in given `captureTimeout`.
+ */
+var CaptureTimeoutLauncher = function (timer, captureTimeout) {
+ if (!captureTimeout) {
+ return
+ }
+
+ var self = this
+ var pendingTimeoutId = null
+
+ this.on('start', function () {
+ pendingTimeoutId = timer.setTimeout(function () {
+ pendingTimeoutId = null
+ if (self.state !== self.STATE_BEING_CAPTURED) {
+ return
+ }
+
+ log.warn('%s have not captured in %d ms, killing.', self.name, captureTimeout)
+ self.error = 'timeout'
+ self.kill()
+ }, captureTimeout)
+ })
+
+ this.on('done', function () {
+ if (pendingTimeoutId) {
+ timer.clearTimeout(pendingTimeoutId)
+ pendingTimeoutId = null
+ }
+ })
+}
+
+CaptureTimeoutLauncher.decoratorFactory = function (timer,
+ /* config.captureTimeout */ captureTimeout) {
+ return function (launcher) {
+ CaptureTimeoutLauncher.call(launcher, timer, captureTimeout)
+ }
+}
+
+CaptureTimeoutLauncher.decoratorFactory.$inject = ['timer', 'config.captureTimeout']
+
+module.exports = CaptureTimeoutLauncher
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/process.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/process.js
new file mode 100644
index 00000000..a561a533
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/process.js
@@ -0,0 +1,157 @@
+var path = require('path')
+var log = require('../logger').create('launcher')
+var env = process.env
+
+var ProcessLauncher = function (spawn, tempDir, timer) {
+ var self = this
+ var onExitCallback
+ var killTimeout = 2000
+
+ this._tempDir = tempDir.getPath('/karma-' + this.id.toString())
+
+ this.on('start', function (url) {
+ tempDir.create(self._tempDir)
+ self._start(url)
+ })
+
+ this.on('kill', function (done) {
+ if (!self._process) {
+ return process.nextTick(done)
+ }
+
+ onExitCallback = done
+ self._process.kill()
+ self._killTimer = timer.setTimeout(self._onKillTimeout, killTimeout)
+ })
+
+ this._start = function (url) {
+ self._execCommand(self._getCommand(), self._getOptions(url))
+ }
+
+ this._getCommand = function () {
+ return env[self.ENV_CMD] || self.DEFAULT_CMD[process.platform]
+ }
+
+ this._getOptions = function (url) {
+ return [url]
+ }
+
+ // Normalize the command, remove quotes (spawn does not like them).
+ this._normalizeCommand = function (cmd) {
+ if (cmd.charAt(0) === cmd.charAt(cmd.length - 1) && '\'`"'.indexOf(cmd.charAt(0)) !== -1) {
+ cmd = cmd.substring(1, cmd.length - 1)
+ log.warn('The path should not be quoted.\n Normalized the path to %s', cmd)
+ }
+
+ return path.normalize(cmd)
+ }
+
+ this._execCommand = function (cmd, args) {
+ if (!cmd) {
+ log.error('No binary for %s browser on your platform.\n ' +
+ 'Please, set "%s" env variable.', self.name, self.ENV_CMD)
+
+ // disable restarting
+ self._retryLimit = -1
+
+ return self._clearTempDirAndReportDone('no binary')
+ }
+
+ cmd = this._normalizeCommand(cmd)
+
+ log.debug(cmd + ' ' + args.join(' '))
+ self._process = spawn(cmd, args)
+
+ var errorOutput = ''
+
+ self._process.on('close', function (code) {
+ self._onProcessExit(code, errorOutput)
+ })
+
+ self._process.on('error', function (err) {
+ if (err.code === 'ENOENT') {
+ self._retryLimit = -1
+ errorOutput = 'Can not find the binary ' + cmd + '\n\t' +
+ 'Please set env variable ' + self.ENV_CMD
+ } else {
+ errorOutput += err.toString()
+ }
+ })
+
+ // Node 0.8 does not emit the error
+ if (process.versions.node.indexOf('0.8') === 0) {
+ self._process.stderr.on('data', function (data) {
+ var msg = data.toString()
+
+ if (msg.indexOf('No such file or directory') !== -1) {
+ self._retryLimit = -1
+ errorOutput = 'Can not find the binary ' + cmd + '\n\t' +
+ 'Please set env variable ' + self.ENV_CMD
+ } else {
+ errorOutput += msg
+ }
+ })
+ }
+ }
+
+ this._onProcessExit = function (code, errorOutput) {
+ log.debug('Process %s exited with code %d', self.name, code)
+
+ var error = null
+
+ if (self.state === self.STATE_BEING_CAPTURED) {
+ log.error('Cannot start %s\n\t%s', self.name, errorOutput)
+ error = 'cannot start'
+ }
+
+ if (self.state === self.STATE_CAPTURED) {
+ log.error('%s crashed.\n\t%s', self.name, errorOutput)
+ error = 'crashed'
+ }
+
+ self._process = null
+ if (self._killTimer) {
+ timer.clearTimeout(self._killTimer)
+ self._killTimer = null
+ }
+ self._clearTempDirAndReportDone(error)
+ }
+
+ this._clearTempDirAndReportDone = function (error) {
+ tempDir.remove(self._tempDir, function () {
+ self._done(error)
+ if (onExitCallback) {
+ onExitCallback()
+ onExitCallback = null
+ }
+ })
+ }
+
+ this._onKillTimeout = function () {
+ if (self.state !== self.STATE_BEING_KILLED) {
+ return
+ }
+
+ log.warn('%s was not killed in %d ms, sending SIGKILL.', self.name, killTimeout)
+ self._process.kill('SIGKILL')
+
+ // NOTE: https://github.com/karma-runner/karma/pull/1184
+ // NOTE: SIGKILL is just a signal. Processes should never ignore it, but they can.
+ // If a process gets into a state where it doesn't respond in a reasonable amout of time
+ // Karma should warn, and continue as though the kill succeeded.
+ // This a certainly suboptimal, but it is better than having the test harness hang waiting
+ // for a zombie child process to exit.
+ self._killTimer = timer.setTimeout(function () {
+ log.warn('%s was not killed by SIGKILL in %d ms, continuing.', self.name, killTimeout)
+ self._onProcessExit(-1, '')
+ }, killTimeout)
+ }
+}
+
+ProcessLauncher.decoratorFactory = function (timer) {
+ return function (launcher) {
+ ProcessLauncher.call(launcher, require('child_process').spawn, require('../temp_dir'), timer)
+ }
+}
+
+module.exports = ProcessLauncher
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/retry.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/retry.js
new file mode 100644
index 00000000..3df67c8e
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/launchers/retry.js
@@ -0,0 +1,32 @@
+var log = require('../logger').create('launcher')
+
+var RetryLauncher = function (retryLimit) {
+ var self = this
+
+ this._retryLimit = retryLimit
+
+ this.on('done', function () {
+ if (!self.error) {
+ return
+ }
+
+ if (self._retryLimit > 0) {
+ var attempt = retryLimit - self._retryLimit + 1
+ log.info('Trying to start %s again (%d/%d).', self.name, attempt, retryLimit)
+ self.restart()
+ self._retryLimit--
+ } else if (self._retryLimit === 0) {
+ log.error('%s failed %d times (%s). Giving up.', self.name, retryLimit, self.error)
+ } else {
+ log.debug('%s failed (%s). Not restarting.', self.name, self.error)
+ }
+ })
+}
+
+RetryLauncher.decoratorFactory = function () {
+ return function (launcher) {
+ RetryLauncher.call(launcher, 2)
+ }
+}
+
+module.exports = RetryLauncher
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/logger.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/logger.js
new file mode 100644
index 00000000..2c40bc32
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/logger.js
@@ -0,0 +1,79 @@
+// This is the **logger** module for *Karma*. It uses
+// [log4js](https://github.com/nomiddlename/log4js-node) to handle and
+// configure all logging that happens inside of *Karma*.
+
+// ### Helpers and Setup
+
+var log4js = require('log4js')
+var helper = require('./helper')
+var constant = require('./constants')
+
+// Special Wrapper for Socket.io :(
+var LogWrapper = function (name, level) {
+ this.logger = log4js.getLogger(name)
+ this.logger.setLevel(level)
+}
+var levels = ['error', 'warn', 'info', 'debug']
+
+levels.forEach(function (level) {
+ LogWrapper.prototype[level] = function () {
+ this.logger[level].apply(this.logger, arguments)
+ }
+})
+
+// #### Public Functions
+
+// Setup the logger by passing in the configuration options. It needs
+// three argumentes:
+//
+// setup(logLevel, colors, appenders)
+//
+// * `logLevel`: *String* Defines the global log level.
+// * `colors`: *Boolean* Use colors in the stdout or not.
+// * `appenders`: *Array* This will be passed as appenders to log4js
+// to allow for fine grained configuration of log4js. For more information
+// see https://github.com/nomiddlename/log4js-node.
+var setup = function (level, colors, appenders) {
+ // Turn color on/off on the console appenders with pattern layout
+ var pattern = colors ? constant.COLOR_PATTERN : constant.NO_COLOR_PATTERN
+
+ // If there are no appenders use the default one
+ appenders = helper.isDefined(appenders) ? appenders : [constant.CONSOLE_APPENDER]
+
+ appenders = appenders.map(function (appender) {
+ if (appender.type === 'console') {
+ if (helper.isDefined(appender.layout) && appender.layout.type === 'pattern') {
+ appender.layout.pattern = pattern
+ }
+ }
+ return appender
+ })
+
+ // Pass the values to log4js
+ log4js.setGlobalLogLevel(level)
+ log4js.configure({
+ appenders: appenders
+ })
+}
+
+// Create a new logger. There are two optional arguments
+// * `name`, which defaults to `karma` and
+// If the `name = 'socket.io'` this will create a special wrapper
+// to be used as a logger for socket.io.
+// * `level`, which defaults to the global level.
+var create = function (name, level) {
+ if (name === 'socket.io') {
+ return new LogWrapper('socket.io', level)
+ } else {
+ var logger = log4js.getLogger(name || 'karma')
+ if (helper.isDefined(level)) {
+ logger.setLevel(level)
+ }
+ return logger
+ }
+}
+
+// #### Publish
+
+exports.create = create
+exports.setup = setup
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/common.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/common.js
new file mode 100644
index 00000000..2e37475d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/common.js
@@ -0,0 +1,88 @@
+/**
+ * This module contains some common helpers shared between middlewares
+ */
+
+var mime = require('mime')
+var log = require('../logger').create('web-server')
+
+var PromiseContainer = function () {
+ var promise
+
+ this.then = function (success, error) {
+ return promise.then(success, error)
+ }
+
+ this.set = function (newPromise) {
+ promise = newPromise
+ }
+}
+
+var serve404 = function (response, path) {
+ log.warn('404: ' + path)
+ response.writeHead(404)
+ return response.end('NOT FOUND')
+}
+
+var createServeFile = function (fs, directory) {
+ var cache = Object.create(null)
+
+ return function (filepath, response, transform, content) {
+ var responseData
+
+ if (directory) {
+ filepath = directory + filepath
+ }
+
+ if (!content && cache[filepath]) {
+ content = cache[filepath]
+ }
+
+ // serve from cache
+ if (content) {
+ response.setHeader('Content-Type', mime.lookup(filepath, 'text/plain'))
+
+ // call custom transform fn to transform the data
+ responseData = transform && transform(content) || content
+
+ response.writeHead(200)
+
+ log.debug('serving (cached): ' + filepath)
+ return response.end(responseData)
+ }
+
+ return fs.readFile(filepath, function (error, data) {
+ if (error) {
+ return serve404(response, filepath)
+ }
+
+ cache[filepath] = data.toString()
+
+ response.setHeader('Content-Type', mime.lookup(filepath, 'text/plain'))
+
+ // call custom transform fn to transform the data
+ responseData = transform && transform(data.toString()) || data
+
+ response.writeHead(200)
+
+ log.debug('serving: ' + filepath)
+ return response.end(responseData)
+ })
+ }
+}
+
+var setNoCacheHeaders = function (response) {
+ response.setHeader('Cache-Control', 'no-cache')
+ response.setHeader('Pragma', 'no-cache')
+ response.setHeader('Expires', (new Date(0)).toString())
+}
+
+var setHeavyCacheHeaders = function (response) {
+ response.setHeader('Cache-Control', ['public', 'max-age=31536000'])
+}
+
+// PUBLIC API
+exports.PromiseContainer = PromiseContainer
+exports.createServeFile = createServeFile
+exports.setNoCacheHeaders = setNoCacheHeaders
+exports.setHeavyCacheHeaders = setHeavyCacheHeaders
+exports.serve404 = serve404
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/karma.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/karma.js
new file mode 100644
index 00000000..a9186fa6
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/karma.js
@@ -0,0 +1,176 @@
+/**
+ * Karma middleware is responsible for serving:
+ * - client.html (the entrypoint for capturing a browser)
+ * - debug.html
+ * - context.html (the execution context, loaded within an iframe)
+ * - karma.js
+ *
+ * The main part is generating context.html, as it contains:
+ * - generating mappings
+ * - including <script> and <link> tags
+ * - setting propert caching headers
+ */
+
+var path = require('path')
+var util = require('util')
+var url = require('url')
+
+var urlparse = function (urlStr) {
+ var urlObj = url.parse(urlStr, true)
+ urlObj.query = urlObj.query || {}
+ return urlObj
+}
+
+var common = require('./common')
+
+var VERSION = require('../constants').VERSION
+var SCRIPT_TAG = '<script type="%s" src="%s"></script>'
+var LINK_TAG_CSS = '<link type="text/css" href="%s" rel="stylesheet">'
+var LINK_TAG_HTML = '<link href="%s" rel="import">'
+var SCRIPT_TYPE = {
+ '.js': 'text/javascript',
+ '.dart': 'application/dart'
+}
+
+var filePathToUrlPath = function (filePath, basePath) {
+ if (filePath.indexOf(basePath) === 0) {
+ return '/base' + filePath.substr(basePath.length)
+ }
+
+ return '/absolute' + filePath
+}
+
+var getXUACompatibleMetaElement = function (url) {
+ var tag = ''
+ var urlObj = urlparse(url)
+ if (urlObj.query['x-ua-compatible']) {
+ tag = '\n<meta http-equiv="X-UA-Compatible" content="' +
+ urlObj.query['x-ua-compatible'] + '"/>'
+ }
+ return tag
+}
+
+var getXUACompatibleUrl = function (url) {
+ var value = ''
+ var urlObj = urlparse(url)
+ if (urlObj.query['x-ua-compatible']) {
+ value = '?x-ua-compatible=' + encodeURIComponent(urlObj.query['x-ua-compatible'])
+ }
+ return value
+}
+
+var createKarmaMiddleware = function (filesPromise, serveStaticFile,
+ /* config.basePath */ basePath, /* config.urlRoot */ urlRoot, /* config.client */ client) {
+ return function (request, response, next) {
+ var requestUrl = request.normalizedUrl.replace(/\?.*/, '')
+
+ // redirect /__karma__ to /__karma__ (trailing slash)
+ if (requestUrl === urlRoot.substr(0, urlRoot.length - 1)) {
+ response.setHeader('Location', urlRoot)
+ response.writeHead(301)
+ return response.end('MOVED PERMANENTLY')
+ }
+
+ // ignore urls outside urlRoot
+ if (requestUrl.indexOf(urlRoot) !== 0) {
+ return next()
+ }
+
+ // remove urlRoot prefix
+ requestUrl = requestUrl.substr(urlRoot.length - 1)
+
+ // serve client.html
+ if (requestUrl === '/') {
+ return serveStaticFile('/client.html', response, function (data) {
+ return data
+ .replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
+ .replace('%X_UA_COMPATIBLE_URL%', getXUACompatibleUrl(request.url))
+ })
+ }
+
+ // serve karma.js
+ if (requestUrl === '/karma.js') {
+ return serveStaticFile(requestUrl, response, function (data) {
+ return data.replace('%KARMA_URL_ROOT%', urlRoot)
+ .replace('%KARMA_VERSION%', VERSION)
+ })
+ }
+
+ // serve the favicon
+ if (requestUrl === '/favicon.ico') {
+ return serveStaticFile(requestUrl, response)
+ }
+
+ // serve context.html - execution context within the iframe
+ // or debug.html - execution context without channel to the server
+ if (requestUrl === '/context.html' || requestUrl === '/debug.html') {
+ return filesPromise.then(function (files) {
+ serveStaticFile(requestUrl, response, function (data) {
+ common.setNoCacheHeaders(response)
+
+ var scriptTags = files.included.map(function (file) {
+ var filePath = file.path
+ var fileExt = path.extname(filePath)
+
+ if (!file.isUrl) {
+ // TODO(vojta): serve these files from within urlRoot as well
+ filePath = filePathToUrlPath(filePath, basePath)
+
+ if (requestUrl === '/context.html') {
+ filePath += '?' + file.sha
+ }
+ }
+
+ if (fileExt === '.css') {
+ return util.format(LINK_TAG_CSS, filePath)
+ }
+
+ if (fileExt === '.html') {
+ return util.format(LINK_TAG_HTML, filePath)
+ }
+
+ return util.format(SCRIPT_TAG, SCRIPT_TYPE[fileExt] || 'text/javascript', filePath)
+ })
+
+ // TODO(vojta): don't compute if it's not in the template
+ var mappings = files.served.map(function (file) {
+ // Windows paths contain backslashes and generate bad IDs if not escaped
+ var filePath = filePathToUrlPath(file.path, basePath).replace(/\\/g, '\\\\')
+
+ return util.format(" '%s': '%s'", filePath, file.sha)
+ })
+
+ var clientConfig = ''
+
+ if (requestUrl === '/debug.html') {
+ clientConfig = 'window.__karma__.config = ' + JSON.stringify(client) + ';\n'
+ }
+
+ mappings = 'window.__karma__.files = {\n' + mappings.join(',\n') + '\n};\n'
+
+ return data
+ .replace('%SCRIPTS%', scriptTags.join('\n'))
+ .replace('%CLIENT_CONFIG%', clientConfig)
+ .replace('%MAPPINGS%', mappings)
+ .replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
+ })
+ }, function (errorFiles) {
+ serveStaticFile(requestUrl, response, function (data) {
+ common.setNoCacheHeaders(response)
+ return data.replace('%SCRIPTS%', '').replace('%CLIENT_CONFIG%', '').replace('%MAPPINGS%',
+ 'window.__karma__.error("TEST RUN WAS CANCELLED because ' +
+ (errorFiles.length > 1 ? 'these files contain' : 'this file contains') +
+ ' some errors:\\n ' + errorFiles.join('\\n ') + '");')
+ })
+ })
+ }
+
+ return next()
+ }
+}
+
+createKarmaMiddleware.$inject = ['filesPromise', 'serveStaticFile',
+ 'config.basePath', 'config.urlRoot', 'config.client']
+
+// PUBLIC API
+exports.create = createKarmaMiddleware
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/proxy.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/proxy.js
new file mode 100644
index 00000000..a3e9f001
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/proxy.js
@@ -0,0 +1,130 @@
+var url = require('url')
+var httpProxy = require('http-proxy')
+
+var log = require('../logger').create('proxy')
+
+var parseProxyConfig = function (proxies, config) {
+ var proxyConfig = {}
+ var endsWithSlash = function (str) {
+ return str.substr(-1) === '/'
+ }
+
+ if (!proxies) {
+ return proxyConfig
+ }
+
+ Object.keys(proxies).forEach(function (proxyPath) {
+ var proxyUrl = proxies[proxyPath]
+ var proxyDetails = url.parse(proxyUrl)
+ var pathname = proxyDetails.pathname
+
+ // normalize the proxies config
+ // should we move this to lib/config.js ?
+ if (endsWithSlash(proxyPath) && !endsWithSlash(proxyUrl)) {
+ log.warn('proxy "%s" normalized to "%s"', proxyUrl, proxyUrl + '/')
+ proxyUrl += '/'
+ pathname += '/'
+ }
+
+ if (!endsWithSlash(proxyPath) && endsWithSlash(proxyUrl)) {
+ log.warn('proxy "%s" normalized to "%s"', proxyPath, proxyPath + '/')
+ proxyPath += '/'
+ }
+
+ if (pathname === '/' && !endsWithSlash(proxyUrl)) {
+ pathname = ''
+ }
+
+ proxyConfig[proxyPath] = {
+ host: proxyDetails.hostname,
+ port: proxyDetails.port,
+ baseProxyUrl: pathname,
+ https: proxyDetails.protocol === 'https:'
+ }
+
+ if (!proxyConfig[proxyPath].port) {
+ if (!proxyConfig[proxyPath].host) {
+ proxyConfig[proxyPath].host = config.hostname
+ proxyConfig[proxyPath].port = config.port
+ } else {
+ proxyConfig[proxyPath].port = proxyConfig[proxyPath].https ? '443' : '80'
+ }
+ }
+ })
+
+ return proxyConfig
+}
+
+/**
+ * Returns a handler which understands the proxies and its redirects, along with the proxy to use
+ * @param proxy A http-proxy.RoutingProxy object with the proxyRequest method
+ * @param proxies a map of routes to proxy url
+ * @return {Function} handler function
+ */
+var createProxyHandler = function (proxy, proxyConfig, proxyValidateSSL, urlRoot, config) {
+ var proxies = parseProxyConfig(proxyConfig, config)
+ var proxiesList = Object.keys(proxies).sort().reverse()
+
+ if (!proxiesList.length) {
+ var nullProxy = function createNullProxy (request, response, next) {
+ return next()
+ }
+ nullProxy.upgrade = function upgradeNullProxy () {}
+ return nullProxy
+ }
+
+ proxy.on('proxyError', function (err, req) {
+ if (err.code === 'ECONNRESET' && req.socket.destroyed) {
+ log.debug('failed to proxy %s (browser hung up the socket)', req.url)
+ } else {
+ log.warn('failed to proxy %s (%s)', req.url, err.message)
+ }
+ })
+
+ var middleware = function createProxy (request, response, next) {
+ for (var i = 0; i < proxiesList.length; i++) {
+ if (request.url.indexOf(proxiesList[i]) === 0) {
+ var proxiedUrl = proxies[proxiesList[i]]
+
+ log.debug('proxying request - %s to %s:%s', request.url, proxiedUrl.host, proxiedUrl.port)
+ request.url = request.url.replace(proxiesList[i], proxiedUrl.baseProxyUrl)
+ proxy.proxyRequest(request, response, {
+ host: proxiedUrl.host,
+ port: proxiedUrl.port,
+ target: {https: proxiedUrl.https, rejectUnauthorized: proxyValidateSSL}
+ })
+ return
+ }
+ }
+
+ return next()
+ }
+
+ middleware.upgrade = function upgradeProxy (request, socket, head) {
+ // special-case karma's route to avoid upgrading it
+ if (request.url.indexOf(urlRoot) === 0) {
+ log.debug('NOT upgrading proxyWebSocketRequest %s', request.url)
+ return
+ }
+ for (var i = 0; i < proxiesList.length; i++) {
+ if (request.url.indexOf(proxiesList[i]) === 0) {
+ var proxiedUrl = proxies[proxiesList[i]]
+ log.debug('upgrade proxyWebSocketRequest %s to %s:%s',
+ request.url, proxiedUrl.host, proxiedUrl.port)
+ proxy.proxyWebSocketRequest(request, socket, head,
+ {host: proxiedUrl.host, port: proxiedUrl.port})
+ }
+ }
+ }
+
+ return middleware
+}
+
+var createProxyHandlerFactory = function (/* config */ config, /* config.proxies */ proxies,
+ /* config.proxyValidateSSL */ validateSSL) {
+ return createProxyHandler(new httpProxy.RoutingProxy({changeOrigin: true}),
+ proxies, validateSSL, config.urlRoot, config)
+}
+createProxyHandlerFactory.$inject = ['config', 'config.proxies', 'config.proxyValidateSSL']
+
+exports.create = createProxyHandlerFactory
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/runner.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/runner.js
new file mode 100644
index 00000000..36c8055b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/runner.js
@@ -0,0 +1,92 @@
+/**
+ * Runner middleware is reponsible for communication with `karma run`.
+ *
+ * It basically triggers a test run and streams stdout back.
+ */
+
+var path = require('path')
+var helper = require('../helper')
+var log = require('../logger').create()
+var constant = require('../constants')
+var json = require('connect').json()
+
+// TODO(vojta): disable when single-run mode
+var createRunnerMiddleware = function (emitter, fileList, capturedBrowsers, reporter, executor,
+ /* config.hostname */ hostname, /* config.port */ port, /* config.urlRoot */ urlRoot, config) {
+ return function (request, response, next) {
+ if (request.url !== '/__run__' && request.url !== urlRoot + 'run') {
+ return next()
+ }
+
+ log.debug('Execution (fired by runner)')
+ response.writeHead(200)
+
+ if (!capturedBrowsers.length) {
+ var url = 'http://' + hostname + ':' + port + urlRoot
+
+ return response.end('No captured browser, open ' + url + '\n')
+ }
+
+ json(request, response, function () {
+ if (!capturedBrowsers.areAllReady([])) {
+ response.write('Waiting for previous execution...\n')
+ }
+
+ emitter.once('run_start', function () {
+ var responseWrite = response.write.bind(response)
+
+ reporter.addAdapter(responseWrite)
+
+ // clean up, close runner response
+ emitter.once('run_complete', function (browsers, results) {
+ reporter.removeAdapter(responseWrite)
+ response.end(constant.EXIT_CODE + results.exitCode)
+ })
+ })
+
+ var data = request.body
+ log.debug('Setting client.args to ', data.args)
+ config.client.args = data.args
+
+ var fullRefresh = true
+
+ if (helper.isArray(data.changedFiles)) {
+ data.changedFiles.forEach(function (filepath) {
+ fileList.changeFile(path.resolve(config.basePath, filepath))
+ fullRefresh = false
+ })
+ }
+
+ if (helper.isArray(data.addedFiles)) {
+ data.addedFiles.forEach(function (filepath) {
+ fileList.addFile(path.resolve(config.basePath, filepath))
+ fullRefresh = false
+ })
+ }
+
+ if (helper.isArray(data.removedFiles)) {
+ data.removedFiles.forEach(function (filepath) {
+ fileList.removeFile(path.resolve(config.basePath, filepath))
+ fullRefresh = false
+ })
+ }
+
+ if (fullRefresh && data.refresh !== false) {
+ log.debug('Refreshing all the files / patterns')
+ fileList.refresh()
+
+ if (!config.autoWatch) {
+ executor.schedule()
+ }
+ } else {
+ executor.schedule()
+ }
+ })
+ }
+}
+
+createRunnerMiddleware.$inject = ['emitter', 'fileList', 'capturedBrowsers', 'reporter', 'executor',
+ 'config.hostname', 'config.port', 'config.urlRoot', 'config']
+
+// PUBLIC API
+exports.create = createRunnerMiddleware
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/source_files.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/source_files.js
new file mode 100644
index 00000000..95d4c032
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/source_files.js
@@ -0,0 +1,59 @@
+/**
+ * Source Files middleware is responsible for serving all the source files under the test.
+ */
+
+var querystring = require('querystring')
+var common = require('./common')
+var pause = require('connect').utils.pause
+
+var findByPath = function (files, path) {
+ for (var i = 0; i < files.length; i++) {
+ if (files[i].path === path) {
+ return files[i]
+ }
+ }
+
+ return null
+}
+
+var createSourceFilesMiddleware = function (filesPromise, serveFile,
+ /* config.basePath */ basePath) {
+ return function (request, response, next) {
+ // TODO(vojta): serve files under urlRoot (also update the formatError)
+ var requestedFilePath = querystring.unescape(request.url)
+ .replace(/\?.*$/, '')
+ .replace(/^\/absolute/, '')
+ .replace(/^\/base/, basePath)
+
+ // Need to pause the request because of proxying, see:
+ // https://groups.google.com/forum/#!topic/q-continuum/xr8znxc_K5E/discussion
+ // TODO(vojta): remove once we don't care about Node 0.8
+ var pausedRequest = pause(request)
+
+ return filesPromise.then(function (files) {
+ // TODO(vojta): change served to be a map rather then an array
+ var file = findByPath(files.served, requestedFilePath)
+
+ if (file) {
+ serveFile(file.contentPath || file.path, response, function () {
+ if (/\?\w+/.test(request.url)) {
+ // files with timestamps - cache one year, rely on timestamps
+ common.setHeavyCacheHeaders(response)
+ } else {
+ // without timestamps - no cache (debug)
+ common.setNoCacheHeaders(response)
+ }
+ }, file.content)
+ } else {
+ next()
+ }
+
+ pausedRequest.resume()
+ })
+ }
+}
+
+createSourceFilesMiddleware.$inject = ['filesPromise', 'serveFile', 'config.basePath']
+
+// PUBLIC API
+exports.create = createSourceFilesMiddleware
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/strip_host.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/strip_host.js
new file mode 100644
index 00000000..6851b779
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/middleware/strip_host.js
@@ -0,0 +1,18 @@
+/**
+ * Strip host middleware is responsible for stripping hostname from request path
+ * This to handle requests that uses (normally over proxies) an absolutURI as request path
+ */
+
+var createStripHostMiddleware = function () {
+ return function (request, response, next) {
+ function stripHostFromUrl (url) {
+ return url.replace(/^http[s]?:\/\/([a-z\-\.\:\d]+)\//, '/')
+ }
+
+ request.normalizedUrl = stripHostFromUrl(request.url) || request.url
+ next()
+ }
+}
+
+// PUBLIC API
+exports.create = createStripHostMiddleware
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/plugin.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/plugin.js
new file mode 100644
index 00000000..e91e21e4
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/plugin.js
@@ -0,0 +1,50 @@
+var fs = require('fs')
+var path = require('path')
+
+var helper = require('./helper')
+var log = require('./logger').create('plugin')
+
+var IGNORED_PACKAGES = ['karma-cli', 'karma-runner.github.com']
+
+exports.resolve = function (plugins) {
+ var modules = []
+
+ var requirePlugin = function (name) {
+ log.debug('Loading plugin %s.', name)
+ try {
+ modules.push(require(name))
+ } catch (e) {
+ if (e.code === 'MODULE_NOT_FOUND' && e.message.indexOf(name) !== -1) {
+ log.warn('Cannot find plugin "%s".\n Did you forget to install it ?\n' +
+ ' npm install %s --save-dev', name, name)
+ } else {
+ log.warn('Error during loading "%s" plugin:\n %s', name, e.message)
+ }
+ }
+ }
+
+ plugins.forEach(function (plugin) {
+ if (helper.isString(plugin)) {
+ if (plugin.indexOf('*') !== -1) {
+ var pluginDirectory = path.normalize(__dirname + '/../..')
+ var regexp = new RegExp('^' + plugin.replace('*', '.*'))
+
+ log.debug('Loading %s from %s', plugin, pluginDirectory)
+ fs.readdirSync(pluginDirectory).filter(function (pluginName) {
+ return IGNORED_PACKAGES.indexOf(pluginName) === -1 && regexp.test(pluginName)
+ }).forEach(function (pluginName) {
+ requirePlugin(pluginDirectory + '/' + pluginName)
+ })
+ } else {
+ requirePlugin(plugin)
+ }
+ } else if (helper.isObject(plugin)) {
+ log.debug('Loading inlined plugin (defining %s).', Object.keys(plugin).join(', '))
+ modules.push(plugin)
+ } else {
+ log.warn('Invalid plugin %s', plugin)
+ }
+ })
+
+ return modules
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/preprocessor.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/preprocessor.js
new file mode 100644
index 00000000..c11689f3
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/preprocessor.js
@@ -0,0 +1,92 @@
+var path = require('path')
+var fs = require('graceful-fs')
+var crypto = require('crypto')
+var mm = require('minimatch')
+var extensions = require('./binary-extensions.json').extensions
+
+var log = require('./logger').create('preprocess')
+
+var sha1 = function (data) {
+ var hash = crypto.createHash('sha1')
+ hash.update(data)
+ return hash.digest('hex')
+}
+
+var isBinary = Object.create(null)
+extensions.forEach(function (extension) {
+ isBinary['.' + extension] = true
+})
+
+// TODO(vojta): instantiate preprocessors at the start to show warnings immediately
+var createPreprocessor = function (config, basePath, injector) {
+ var alreadyDisplayedWarnings = Object.create(null)
+
+ return function (file, done) {
+ var patterns = Object.keys(config)
+ var thisFileIsBinary = isBinary[path.extname(file.originalPath)]
+ var preprocessors = []
+ var nextPreprocessor = function (error, content) {
+ // normalize B-C
+ if (arguments.length === 1 && typeof error === 'string') {
+ content = error
+ error = null
+ }
+
+ if (error) {
+ file.content = null
+ file.contentPath = null
+ return done(error)
+ }
+
+ if (!preprocessors.length) {
+ file.contentPath = null
+ file.content = content
+ file.sha = sha1(content)
+ return done()
+ }
+
+ preprocessors.shift()(content, file, nextPreprocessor)
+ }
+ var instantiatePreprocessor = function (name) {
+ if (alreadyDisplayedWarnings[name]) {
+ return
+ }
+
+ try {
+ preprocessors.push(injector.get('preprocessor:' + name))
+ } catch (e) {
+ if (e.message.indexOf('No provider for "preprocessor:' + name + '"') !== -1) {
+ log.warn('Can not load "%s", it is not registered!\n ' +
+ 'Perhaps you are missing some plugin?', name)
+ } else {
+ log.warn('Can not load "%s"!\n ' + e.stack, name)
+ }
+
+ alreadyDisplayedWarnings[name] = true
+ }
+ }
+
+ // collects matching preprocessors
+ // TODO(vojta): should we cache this ?
+ for (var i = 0; i < patterns.length; i++) {
+ if (mm(file.originalPath, patterns[i])) {
+ if (thisFileIsBinary) {
+ log.warn('Ignoring preprocessing (%s) %s because it is a binary file.',
+ config[patterns[i]].join(', '), file.originalPath)
+ } else {
+ config[patterns[i]].forEach(instantiatePreprocessor)
+ }
+ }
+ }
+
+ return fs.readFile(file.originalPath, function (err, buffer) {
+ if (err) {
+ throw err
+ }
+ nextPreprocessor(null, thisFileIsBinary ? buffer : buffer.toString())
+ })
+ }
+}
+createPreprocessor.$inject = ['config.preprocessors', 'config.basePath', 'injector']
+
+exports.createPreprocessor = createPreprocessor
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporter.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporter.js
new file mode 100644
index 00000000..f2e80a5a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporter.js
@@ -0,0 +1,110 @@
+var util = require('util')
+var log = require('./logger').create('reporter')
+var MultiReporter = require('./reporters/multi')
+var baseReporterDecoratorFactory = require('./reporters/base').decoratorFactory
+var SourceMapConsumer = require('source-map').SourceMapConsumer
+
+var createErrorFormatter = function (basePath, emitter, SourceMapConsumer) {
+ var lastServedFiles = []
+
+ emitter.on('file_list_modified', function (filesPromise) {
+ filesPromise.then(function (files) {
+ lastServedFiles = files.served
+ })
+ })
+
+ var findFile = function (path) {
+ for (var i = 0; i < lastServedFiles.length; i++) {
+ if (lastServedFiles[i].path === path) {
+ return lastServedFiles[i]
+ }
+ }
+ return null
+ }
+
+ var URL_REGEXP = new RegExp('http:\\/\\/[^\\/]*\\/' +
+ '(base|absolute)' + // prefix
+ '((?:[A-z]\\:)?[^\\?\\s\\:]*)' + // path
+ '(\\?\\w*)?' + // sha
+ '(\\:(\\d+))?' + // line
+ '(\\:(\\d+))?' + // column
+ '', 'g')
+
+ return function (msg, indentation) {
+ // remove domain and timestamp from source files
+ // and resolve base path / absolute path urls into absolute path
+ msg = (msg || '').replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) {
+ if (prefix === 'base') {
+ path = basePath + path
+ }
+
+ var file = findFile(path)
+
+ if (file && file.sourceMap) {
+ line = parseInt(line || '0', 10)
+ column = parseInt(column || '0', 10)
+
+ var smc = new SourceMapConsumer(file.sourceMap)
+ try {
+ var original = smc.originalPositionFor({line: line, column: column})
+
+ return util.format('%s:%d:%d <- %s:%d:%d', path, line, column, original.source,
+ original.line, original.column)
+ } catch (e) {
+ log.warn('SourceMap position not found for trace: %s', msg)
+ // Fall back to non-source-mapped formatting.
+ }
+ }
+
+ return path + (line ? ':' + line : '') + (column ? ':' + column : '')
+ })
+
+ // indent every line
+ if (indentation) {
+ msg = indentation + msg.replace(/\n/g, '\n' + indentation)
+ }
+
+ return msg + '\n'
+ }
+}
+
+var createReporters = function (names, config, emitter, injector) {
+ var errorFormatter = createErrorFormatter(config.basePath, emitter, SourceMapConsumer)
+ var reporters = []
+
+ // TODO(vojta): instantiate all reporters through DI
+ names.forEach(function (name) {
+ if (['dots', 'progress'].indexOf(name) !== -1) {
+ var Cls = require('./reporters/' + name + (config.colors ? '_color' : ''))
+ return reporters.push(new Cls(errorFormatter, config.reportSlowerThan))
+ }
+
+ var locals = {
+ baseReporterDecorator: ['factory', baseReporterDecoratorFactory],
+ formatError: ['value', errorFormatter]
+ }
+
+ try {
+ reporters.push(injector.createChild([locals], ['reporter:' + name]).get('reporter:' + name))
+ } catch (e) {
+ if (e.message.indexOf('No provider for "reporter:' + name + '"') !== -1) {
+ log.warn('Can not load "%s", it is not registered!\n ' +
+ 'Perhaps you are missing some plugin?', name)
+ } else {
+ log.warn('Can not load "%s"!\n ' + e.stack, name)
+ }
+ }
+ })
+
+ // bind all reporters
+ reporters.forEach(function (reporter) {
+ emitter.bind(reporter)
+ })
+
+ return new MultiReporter(reporters)
+}
+
+createReporters.$inject = ['config.reporters', 'config', 'emitter', 'injector']
+
+// PUBLISH
+exports.createReporters = createReporters
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base.js
new file mode 100644
index 00000000..9316c766
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base.js
@@ -0,0 +1,142 @@
+var util = require('util')
+
+var helper = require('../helper')
+
+var BaseReporter = function (formatError, reportSlow, adapter) {
+ this.adapters = [adapter || process.stdout.write.bind(process.stdout)]
+
+ this.onRunStart = function () {
+ this._browsers = []
+ }
+
+ this.onBrowserStart = function (browser) {
+ this._browsers.push(browser)
+ }
+
+ this.renderBrowser = function (browser) {
+ var results = browser.lastResult
+ var totalExecuted = results.success + results.failed
+ var msg = util.format('%s: Executed %d of %d', browser, totalExecuted, results.total)
+
+ if (results.failed) {
+ msg += util.format(this.X_FAILED, results.failed)
+ }
+
+ if (results.skipped) {
+ msg += util.format(' (skipped %d)', results.skipped)
+ }
+
+ if (browser.isReady) {
+ if (results.disconnected) {
+ msg += this.FINISHED_DISCONNECTED
+ } else if (results.error) {
+ msg += this.FINISHED_ERROR
+ } else if (!results.failed) {
+ msg += this.FINISHED_SUCCESS
+ }
+
+ msg += util.format(' (%s / %s)', helper.formatTimeInterval(results.totalTime),
+ helper.formatTimeInterval(results.netTime))
+ }
+
+ return msg
+ }
+
+ this.renderBrowser = this.renderBrowser.bind(this)
+
+ this.write = function () {
+ var msg = util.format.apply(null, Array.prototype.slice.call(arguments))
+
+ this.adapters.forEach(function (adapter) {
+ adapter(msg)
+ })
+ }
+
+ this.writeCommonMsg = this.write
+
+ this.onBrowserError = function (browser, error) {
+ this.writeCommonMsg(util.format(this.ERROR, browser) + formatError(error, ' '))
+ }
+
+ this.onBrowserLog = function (browser, log, type) {
+ if (!helper.isString(log)) {
+ // TODO(vojta): change util to new syntax (config object)
+ log = util.inspect(log, false, undefined, this.USE_COLORS)
+ }
+
+ if (this._browsers && this._browsers.length === 1) {
+ this.writeCommonMsg(util.format(this.LOG_SINGLE_BROWSER, type.toUpperCase(), log))
+ } else {
+ this.writeCommonMsg(util.format(this.LOG_MULTI_BROWSER, browser, type.toUpperCase(), log))
+ }
+ }
+
+ this.onSpecComplete = function (browser, result) {
+ if (result.skipped) {
+ this.specSkipped(browser, result)
+ } else if (result.success) {
+ this.specSuccess(browser, result)
+ } else {
+ this.specFailure(browser, result)
+ }
+
+ if (reportSlow && result.time > reportSlow) {
+ var specName = result.suite.join(' ') + ' ' + result.description
+ var time = helper.formatTimeInterval(result.time)
+
+ this.writeCommonMsg(util.format(this.SPEC_SLOW, browser, time, specName))
+ }
+ }
+
+ this.specSuccess = this.specSkipped = function () {}
+
+ this.specFailure = function (browser, result) {
+ var specName = result.suite.join(' ') + ' ' + result.description
+ var msg = util.format(this.SPEC_FAILURE, browser, specName)
+
+ result.log.forEach(function (log) {
+ msg += formatError(log, '\t')
+ })
+
+ this.writeCommonMsg(msg)
+ }
+
+ this.onRunComplete = function (browsers, results) {
+ if (browsers.length > 1 && !results.error && !results.disconnected) {
+ if (!results.failed) {
+ this.write(this.TOTAL_SUCCESS, results.success)
+ } else {
+ this.write(this.TOTAL_FAILED, results.failed, results.success)
+ }
+ }
+ }
+
+ this.USE_COLORS = false
+
+ this.LOG_SINGLE_BROWSER = '%s: %s\n'
+ this.LOG_MULTI_BROWSER = '%s %s: %s\n'
+
+ this.SPEC_FAILURE = '%s %s FAILED' + '\n'
+ this.SPEC_SLOW = '%s SLOW %s: %s\n'
+ this.ERROR = '%s ERROR\n'
+
+ this.FINISHED_ERROR = ' ERROR'
+ this.FINISHED_SUCCESS = ' SUCCESS'
+ this.FINISHED_DISCONNECTED = ' DISCONNECTED'
+
+ this.X_FAILED = ' (%d FAILED)'
+
+ this.TOTAL_SUCCESS = 'TOTAL: %d SUCCESS\n'
+ this.TOTAL_FAILED = 'TOTAL: %d FAILED, %d SUCCESS\n'
+}
+
+BaseReporter.decoratorFactory = function (formatError, reportSlow) {
+ return function (self) {
+ BaseReporter.call(self, formatError, reportSlow)
+ }
+}
+
+BaseReporter.decoratorFactory.$inject = ['formatError', 'config.reportSlowerThan']
+
+// PUBLISH
+module.exports = BaseReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base_color.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base_color.js
new file mode 100644
index 00000000..d25abbc5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/base_color.js
@@ -0,0 +1,24 @@
+require('colors')
+
+var BaseColorReporter = function () {
+ this.USE_COLORS = true
+
+ this.LOG_SINGLE_BROWSER = '%s: ' + '%s'.cyan + '\n'
+ this.LOG_MULTI_BROWSER = '%s %s: ' + '%s'.cyan + '\n'
+
+ this.SPEC_FAILURE = '%s %s FAILED'.red + '\n'
+ this.SPEC_SLOW = '%s SLOW %s: %s'.yellow + '\n'
+ this.ERROR = '%s ERROR'.red + '\n'
+
+ this.FINISHED_ERROR = ' ERROR'.red
+ this.FINISHED_SUCCESS = ' SUCCESS'.green
+ this.FINISHED_DISCONNECTED = ' DISCONNECTED'.red
+
+ this.X_FAILED = ' (%d FAILED)'.red
+
+ this.TOTAL_SUCCESS = 'TOTAL: %d SUCCESS'.green + '\n'
+ this.TOTAL_FAILED = 'TOTAL: %d FAILED, %d SUCCESS'.red + '\n'
+}
+
+// PUBLISH
+module.exports = BaseColorReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots.js
new file mode 100644
index 00000000..cd80b304
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots.js
@@ -0,0 +1,48 @@
+var BaseReporter = require('./base')
+
+var DotsReporter = function (formatError, reportSlow) {
+ BaseReporter.call(this, formatError, reportSlow)
+
+ var DOTS_WRAP = 80
+
+ this.onRunStart = function () {
+ this._browsers = []
+ this._dotsCount = 0
+ }
+
+ this.onBrowserStart = function (browser) {
+ this._browsers.push(browser)
+ }
+
+ this.writeCommonMsg = function (msg) {
+ if (this._dotsCount) {
+ this._dotsCount = 0
+ msg = '\n' + msg
+ }
+
+ this.write(msg)
+
+ }
+
+ this.specSuccess = function () {
+ this._dotsCount = (this._dotsCount + 1) % DOTS_WRAP
+ this.write(this._dotsCount ? '.' : '.\n')
+ }
+
+ this.onBrowserComplete = function (browser) {
+ this.writeCommonMsg(this.renderBrowser(browser) + '\n')
+ }
+
+ this.onRunComplete = function (browsers, results) {
+ if (browsers.length > 1 && !results.disconnected && !results.error) {
+ if (!results.failed) {
+ this.write(this.TOTAL_SUCCESS, results.success)
+ } else {
+ this.write(this.TOTAL_FAILED, results.failed, results.success)
+ }
+ }
+ }
+}
+
+// PUBLISH
+module.exports = DotsReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots_color.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots_color.js
new file mode 100644
index 00000000..ab42637c
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/dots_color.js
@@ -0,0 +1,10 @@
+var DotsReporter = require('./dots')
+var BaseColorReporter = require('./base_color')
+
+var DotsColorReporter = function (formatError, reportSlow) {
+ DotsReporter.call(this, formatError, reportSlow)
+ BaseColorReporter.call(this)
+}
+
+// PUBLISH
+module.exports = DotsColorReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/multi.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/multi.js
new file mode 100644
index 00000000..eba03f6a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/multi.js
@@ -0,0 +1,18 @@
+var helper = require('../helper')
+
+var MultiReporter = function (reporters) {
+ this.addAdapter = function (adapter) {
+ reporters.forEach(function (reporter) {
+ reporter.adapters.push(adapter)
+ })
+ }
+
+ this.removeAdapter = function (adapter) {
+ reporters.forEach(function (reporter) {
+ helper.arrayRemove(reporter.adapters, adapter)
+ })
+ }
+}
+
+// PUBLISH
+module.exports = MultiReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress.js
new file mode 100644
index 00000000..9b5f2108
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress.js
@@ -0,0 +1,60 @@
+var BaseReporter = require('./base')
+
+var ProgressReporter = function (formatError, reportSlow) {
+ BaseReporter.call(this, formatError, reportSlow)
+
+ this.writeCommonMsg = function (msg) {
+ this.write(this._remove() + msg + this._render())
+ }
+
+ this.specSuccess = function () {
+ this.write(this._refresh())
+ }
+
+ this.onBrowserComplete = function () {
+ this.write(this._refresh())
+ }
+
+ this.onRunStart = function () {
+ this._browsers = []
+ this._isRendered = false
+ }
+
+ this.onBrowserStart = function (browser) {
+ this._browsers.push(browser)
+
+ if (this._isRendered) {
+ this.write('\n')
+ }
+
+ this.write(this._refresh())
+ }
+
+ this._remove = function () {
+ if (!this._isRendered) {
+ return ''
+ }
+
+ var cmd = ''
+ this._browsers.forEach(function () {
+ cmd += '\x1B[1A' + '\x1B[2K'
+ })
+
+ this._isRendered = false
+
+ return cmd
+ }
+
+ this._render = function () {
+ this._isRendered = true
+
+ return this._browsers.map(this.renderBrowser).join('\n') + '\n'
+ }
+
+ this._refresh = function () {
+ return this._remove() + this._render()
+ }
+}
+
+// PUBLISH
+module.exports = ProgressReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress_color.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress_color.js
new file mode 100644
index 00000000..7d59f783
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/reporters/progress_color.js
@@ -0,0 +1,10 @@
+var ProgressReporter = require('./progress')
+var BaseColorReporter = require('./base_color')
+
+var ProgressColorReporter = function (formatError, reportSlow) {
+ ProgressReporter.call(this, formatError, reportSlow)
+ BaseColorReporter.call(this)
+}
+
+// PUBLISH
+module.exports = ProgressColorReporter
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/runner.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/runner.js
new file mode 100644
index 00000000..136dd9bf
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/runner.js
@@ -0,0 +1,68 @@
+var http = require('http')
+
+var constant = require('./constants')
+var helper = require('./helper')
+var cfg = require('./config')
+
+var parseExitCode = function (buffer, defaultCode) {
+ var tailPos = buffer.length - Buffer.byteLength(constant.EXIT_CODE) - 1
+
+ if (tailPos < 0) {
+ return defaultCode
+ }
+
+ // tail buffer which might contain the message
+ var tail = buffer.slice(tailPos)
+ var tailStr = tail.toString()
+ if (tailStr.substr(0, tailStr.length - 1) === constant.EXIT_CODE) {
+ tail.fill('\x00')
+ return parseInt(tailStr.substr(-1), 10)
+ }
+
+ return defaultCode
+}
+
+// TODO(vojta): read config file (port, host, urlRoot)
+exports.run = function (config, done) {
+ done = helper.isFunction(done) ? done : process.exit
+ config = cfg.parseConfig(config.configFile, config)
+
+ var exitCode = 1
+ var options = {
+ hostname: config.hostname,
+ path: config.urlRoot + 'run',
+ port: config.port,
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }
+
+ var request = http.request(options, function (response) {
+ response.on('data', function (buffer) {
+ exitCode = parseExitCode(buffer, exitCode)
+ process.stdout.write(buffer)
+ })
+
+ response.on('end', function () {
+ done(exitCode)
+ })
+ })
+
+ request.on('error', function (e) {
+ if (e.code === 'ECONNREFUSED') {
+ console.error('There is no server listening on port %d', options.port)
+ done(1)
+ } else {
+ throw e
+ }
+ })
+
+ request.end(JSON.stringify({
+ args: config.clientArgs,
+ removedFiles: config.removedFiles,
+ changedFiles: config.changedFiles,
+ addedFiles: config.addedFiles,
+ refresh: config.refresh
+ }))
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/server.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/server.js
new file mode 100644
index 00000000..0ba41f4a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/server.js
@@ -0,0 +1,308 @@
+var io = require('socket.io')
+var di = require('di')
+
+var cfg = require('./config')
+var logger = require('./logger')
+var constant = require('./constants')
+var watcher = require('./watcher')
+var plugin = require('./plugin')
+
+var ws = require('./web-server')
+var preprocessor = require('./preprocessor')
+var Launcher = require('./launcher').Launcher
+var FileList = require('./file_list').List
+var reporter = require('./reporter')
+var helper = require('./helper')
+var events = require('./events')
+var EventEmitter = events.EventEmitter
+var Executor = require('./executor')
+var Browser = require('./browser')
+var BrowserCollection = require('./browser_collection')
+var EmitterWrapper = require('./emitter_wrapper')
+var processWrapper = new EmitterWrapper(process)
+
+var log = logger.create()
+
+var start = function (injector, config, launcher, globalEmitter, preprocess, fileList, webServer,
+ capturedBrowsers, socketServer, executor, done) {
+ config.frameworks.forEach(function (framework) {
+ injector.get('framework:' + framework)
+ })
+
+ // A map of launched browsers.
+ var singleRunDoneBrowsers = Object.create(null)
+
+ // Passing fake event emitter, so that it does not emit on the global,
+ // we don't care about these changes.
+ var singleRunBrowsers = new BrowserCollection(new EventEmitter())
+
+ // Some browsers did not get captured.
+ var singleRunBrowserNotCaptured = false
+
+ webServer.on('error', function (e) {
+ if (e.code === 'EADDRINUSE') {
+ log.warn('Port %d in use', config.port)
+ config.port++
+ webServer.listen(config.port)
+ } else {
+ throw e
+ }
+ })
+
+ var afterPreprocess = function () {
+ if (config.autoWatch) {
+ injector.invoke(watcher.watch)
+ }
+
+ webServer.listen(config.port, function () {
+ log.info('Karma v%s server started at http://%s:%s%s', constant.VERSION, config.hostname,
+ config.port, config.urlRoot)
+
+ if (config.browsers && config.browsers.length) {
+ injector.invoke(launcher.launch, launcher).forEach(function (browserLauncher) {
+ singleRunDoneBrowsers[browserLauncher.id] = false
+ })
+ }
+ })
+ }
+
+ fileList.refresh().then(afterPreprocess, afterPreprocess)
+
+ globalEmitter.on('browsers_change', function () {
+ // TODO(vojta): send only to interested browsers
+ socketServer.sockets.emit('info', capturedBrowsers.serialize())
+ })
+
+ globalEmitter.on('browser_register', function (browser) {
+ launcher.markCaptured(browser.id)
+
+ // TODO(vojta): This is lame, browser can get captured and then crash (before other browsers get
+ // captured).
+ if (config.autoWatch && launcher.areAllCaptured()) {
+ executor.schedule()
+ }
+ })
+
+ var EVENTS_TO_REPLY = ['start', 'info', 'error', 'result', 'complete']
+ socketServer.sockets.on('connection', function (socket) {
+ log.debug('A browser has connected on socket ' + socket.id)
+
+ var replySocketEvents = events.bufferEvents(socket, EVENTS_TO_REPLY)
+
+ socket.on('complete', function (data, ack) {
+ ack()
+ })
+
+ socket.on('register', function (info) {
+ var newBrowser
+ var isRestart
+
+ if (info.id) {
+ newBrowser = capturedBrowsers.getById(info.id) || singleRunBrowsers.getById(info.id)
+ }
+
+ if (newBrowser) {
+ isRestart = newBrowser.state === Browser.STATE_DISCONNECTED
+ newBrowser.reconnect(socket)
+
+ // We are restarting a previously disconnected browser.
+ if (isRestart && config.singleRun) {
+ newBrowser.execute(config.client)
+ }
+ } else {
+ newBrowser = injector.createChild([{
+ id: ['value', info.id || null],
+ fullName: ['value', info.name],
+ socket: ['value', socket]
+ }]).instantiate(Browser)
+
+ newBrowser.init()
+
+ // execute in this browser immediately
+ if (config.singleRun) {
+ newBrowser.execute(config.client)
+ singleRunBrowsers.add(newBrowser)
+ }
+ }
+
+ replySocketEvents()
+ })
+ })
+
+ var emitRunCompleteIfAllBrowsersDone = function () {
+ // all browsers done
+ var isDone = Object.keys(singleRunDoneBrowsers).reduce(function (isDone, id) {
+ return isDone && singleRunDoneBrowsers[id]
+ }, true)
+
+ if (isDone) {
+ var results = singleRunBrowsers.getResults()
+ if (singleRunBrowserNotCaptured) {
+ results.exitCode = 1
+ }
+
+ globalEmitter.emit('run_complete', singleRunBrowsers, results)
+ }
+ }
+
+ if (config.singleRun) {
+ globalEmitter.on('browser_complete', function (completedBrowser) {
+ if (completedBrowser.lastResult.disconnected &&
+ completedBrowser.disconnectsCount <= config.browserDisconnectTolerance) {
+ log.info('Restarting %s (%d of %d attempts)', completedBrowser.name,
+ completedBrowser.disconnectsCount, config.browserDisconnectTolerance)
+ if (!launcher.restart(completedBrowser.id)) {
+ singleRunDoneBrowsers[completedBrowser.id] = true
+ emitRunCompleteIfAllBrowsersDone()
+ }
+ } else {
+ singleRunDoneBrowsers[completedBrowser.id] = true
+
+ if (launcher.kill(completedBrowser.id)) {
+ // workaround to supress "disconnect" warning
+ completedBrowser.state = Browser.STATE_DISCONNECTED
+ }
+
+ emitRunCompleteIfAllBrowsersDone()
+ }
+ })
+
+ globalEmitter.on('browser_process_failure', function (browserLauncher) {
+ singleRunDoneBrowsers[browserLauncher.id] = true
+ singleRunBrowserNotCaptured = true
+
+ emitRunCompleteIfAllBrowsersDone()
+ })
+
+ globalEmitter.on('run_complete', function (browsers, results) {
+ log.debug('Run complete, exiting.')
+ disconnectBrowsers(results.exitCode)
+ })
+
+ globalEmitter.emit('run_start', singleRunBrowsers)
+ }
+
+ if (config.autoWatch) {
+ globalEmitter.on('file_list_modified', function () {
+ log.debug('List of files has changed, trying to execute')
+ executor.schedule()
+ })
+ }
+
+ var webServerCloseTimeout = 3000
+ var disconnectBrowsers = function (code) {
+ // Slightly hacky way of removing disconnect listeners
+ // to suppress "browser disconnect" warnings
+ // TODO(vojta): change the client to not send the event (if disconnected by purpose)
+ var sockets = socketServer.sockets.sockets
+ Object.getOwnPropertyNames(sockets).forEach(function (key) {
+ var socket = sockets[key]
+ socket.removeAllListeners('disconnect')
+ if (!socket.disconnected) {
+ socket.disconnect()
+ }
+ })
+
+ var removeAllListenersDone = false
+ var removeAllListeners = function () {
+ // make sure we don't execute cleanup twice
+ if (removeAllListenersDone) {
+ return
+ }
+ removeAllListenersDone = true
+ webServer.removeAllListeners()
+ processWrapper.removeAllListeners()
+ done(code || 0)
+ }
+
+ globalEmitter.emitAsync('exit').then(function () {
+ // don't wait forever on webServer.close() because
+ // pending client connections prevent it from closing.
+ var closeTimeout = setTimeout(removeAllListeners, webServerCloseTimeout)
+
+ // shutdown the server...
+ webServer.close(function () {
+ clearTimeout(closeTimeout)
+ removeAllListeners()
+ })
+
+ // shutdown socket.io flash transport, if defined
+ if (socketServer.flashPolicyServer) {
+ socketServer.flashPolicyServer.close()
+ }
+ })
+ }
+
+ try {
+ processWrapper.on('SIGINT', disconnectBrowsers)
+ processWrapper.on('SIGTERM', disconnectBrowsers)
+ } catch (e) {
+ // Windows doesn't support signals yet, so they simply don't get this handling.
+ // https://github.com/joyent/node/issues/1553
+ }
+
+ // Handle all unhandled exceptions, so we don't just exit but
+ // disconnect the browsers before exiting.
+ processWrapper.on('uncaughtException', function (error) {
+ log.error(error)
+ disconnectBrowsers(1)
+ })
+}
+start.$inject = ['injector', 'config', 'launcher', 'emitter', 'preprocess', 'fileList',
+ 'webServer', 'capturedBrowsers', 'socketServer', 'executor', 'done']
+
+var createSocketIoServer = function (webServer, executor, config) {
+ var server = io.listen(webServer, {
+ // avoid destroying http upgrades from socket.io to get proxied websockets working
+ 'destroy upgrade': false,
+ // socket.io has a timeout (15s by default) before destroying a store (a data structure where
+ // data associated with a socket are stored). Unfortunately this timeout is not cleared
+ // properly on socket.io shutdown and this timeout prevents karma from exiting cleanly.
+ // We change this timeout to 0 to make Karma exit just after all tests were executed.
+ 'client store expiration': 0,
+ logger: logger.create('socket.io', constant.LOG_ERROR),
+ resource: config.urlRoot + 'socket.io',
+ transports: config.transports
+ })
+
+ // hack to overcome circular dependency
+ executor.socketIoSockets = server.sockets
+
+ return server
+}
+
+exports.start = function (cliOptions, done) {
+ // apply the default logger config (and config from CLI) as soon as we can
+ logger.setup(cliOptions.logLevel || constant.LOG_INFO,
+ helper.isDefined(cliOptions.colors) ? cliOptions.colors : true, [constant.CONSOLE_APPENDER])
+
+ var config = cfg.parseConfig(cliOptions.configFile, cliOptions)
+ var modules = [{
+ helper: ['value', helper],
+ logger: ['value', logger],
+ done: ['value', done || process.exit],
+ emitter: ['type', EventEmitter],
+ launcher: ['type', Launcher],
+ config: ['value', config],
+ preprocess: ['factory', preprocessor.createPreprocessor],
+ fileList: ['type', FileList],
+ webServer: ['factory', ws.create],
+ socketServer: ['factory', createSocketIoServer],
+ executor: ['type', Executor],
+ // TODO(vojta): remove
+ customFileHandlers: ['value', []],
+ // TODO(vojta): remove, once karma-dart does not rely on it
+ customScriptTypes: ['value', []],
+ reporter: ['factory', reporter.createReporters],
+ capturedBrowsers: ['type', BrowserCollection],
+ args: ['value', {}],
+ timer: ['value', {setTimeout: setTimeout, clearTimeout: clearTimeout}]
+ }]
+
+ // load the plugins
+ modules = modules.concat(plugin.resolve(config.plugins))
+
+ var injector = new di.Injector(modules)
+
+ injector.invoke(start)
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/temp_dir.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/temp_dir.js
new file mode 100644
index 00000000..f938add0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/temp_dir.js
@@ -0,0 +1,31 @@
+var path = require('path')
+var fs = require('fs')
+var os = require('os')
+var rimraf = require('rimraf')
+var log = require('./logger').create('temp-dir')
+
+// Node v0.8 uses tmpDir(), v0.10 uses tmpdir().
+var TEMP_DIR = os.tmpdir ? os.tmpdir() : os.tmpDir()
+
+module.exports = {
+ getPath: function (suffix) {
+ return path.normalize(TEMP_DIR + suffix)
+ },
+
+ create: function (path) {
+ log.debug('Creating temp dir at %s', path)
+
+ try {
+ fs.mkdirSync(path)
+ } catch (e) {
+ log.warn('Failed to create a temp dir at %s', path)
+ }
+
+ return path
+ },
+
+ remove: function (path, done) {
+ log.debug('Cleaning temp dir %s', path)
+ rimraf(path, done)
+ }
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/watcher.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/watcher.js
new file mode 100644
index 00000000..388691c8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/watcher.js
@@ -0,0 +1,114 @@
+var chokidar = require('chokidar')
+var mm = require('minimatch')
+
+var helper = require('./helper')
+var log = require('./logger').create('watcher')
+
+var DIR_SEP = require('path').sep
+
+// Get parent folder, that be watched (does not contain any special globbing character)
+var baseDirFromPattern = function (pattern) {
+ return pattern
+ .replace(/[\/\\][^\/\\]*\*.*$/, '') // remove parts with *
+ .replace(/[\/\\][^\/\\]*[\!\+]\(.*$/, '') // remove parts with !(...) and +(...)
+ .replace(/[\/\\][^\/\\]*\)\?.*$/, '') || DIR_SEP // remove parts with (...)?
+}
+
+var watchPatterns = function (patterns, watcher) {
+ // filter only unique non url patterns paths
+ var pathsToWatch = []
+ var uniqueMap = {}
+ var path
+
+ patterns.forEach(function (pattern) {
+ path = baseDirFromPattern(pattern)
+ if (!uniqueMap[path]) {
+ uniqueMap[path] = true
+ pathsToWatch.push(path)
+ }
+ })
+
+ // watch only common parents, no sub paths
+ pathsToWatch.forEach(function (path) {
+ if (!pathsToWatch.some(function (p) {
+ return p !== path && path.substr(0, p.length + 1) === p + DIR_SEP
+ })) {
+ watcher.add(path)
+ log.debug('Watching "%s"', path)
+ }
+ })
+}
+
+// Function to test if a path should be ignored by chokidar.
+var createIgnore = function (patterns, excludes) {
+ return function (path, stat) {
+ if (!stat || stat.isDirectory()) {
+ return false
+ }
+
+ // Check if the path matches any of the watched patterns.
+ if (!patterns.some(function (pattern) {
+ return mm(path, pattern, {dot: true})
+ })) {
+ return true
+ }
+
+ // Check if the path matches any of the exclude patterns.
+ if (excludes.some(function (pattern) {
+ return mm(path, pattern, {dot: true})
+ })) {
+ return true
+ }
+
+ return false
+ }
+}
+
+var onlyWatchedTrue = function (pattern) {
+ return pattern.watched
+}
+
+var getWatchedPatterns = function (patternObjects) {
+ return patternObjects.filter(onlyWatchedTrue).map(function (patternObject) {
+ return patternObject.pattern
+ })
+}
+
+exports.watch = function (patterns, excludes, fileList, usePolling, emitter) {
+ var watchedPatterns = getWatchedPatterns(patterns)
+ var options = {
+ usePolling: usePolling,
+ ignorePermissionErrors: true,
+ ignoreInitial: true,
+ ignored: createIgnore(watchedPatterns, excludes)
+ }
+ var chokidarWatcher = new chokidar.FSWatcher(options)
+
+ watchPatterns(watchedPatterns, chokidarWatcher)
+
+ var bind = function (fn) {
+ return function (path) {
+ return fn.call(fileList, helper.normalizeWinPath(path))
+ }
+ }
+
+ // register events
+ chokidarWatcher.on('add', bind(fileList.addFile))
+ .on('change', bind(fileList.changeFile))
+ .on('unlink', bind(fileList.removeFile))
+ // If we don't subscribe; unhandled errors from Chokidar will bring Karma down
+ // (see GH Issue #959)
+ .on('error', function (e) {
+ log.debug(e)
+ })
+
+ emitter.on('exit', function (done) {
+ chokidarWatcher.close()
+ done()
+ })
+
+ return chokidarWatcher
+}
+
+exports.watch.$inject = ['config.files', 'config.exclude', 'fileList', 'config.usePolling',
+ 'emitter']
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/web-server.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/web-server.js
new file mode 100644
index 00000000..dfda9695
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/lib/web-server.js
@@ -0,0 +1,74 @@
+var fs = require('fs')
+var http = require('http')
+var path = require('path')
+var connect = require('connect')
+
+var common = require('./middleware/common')
+var runnerMiddleware = require('./middleware/runner')
+var stripHostMiddleware = require('./middleware/strip_host')
+var karmaMiddleware = require('./middleware/karma')
+var sourceFilesMiddleware = require('./middleware/source_files')
+var proxyMiddleware = require('./middleware/proxy')
+
+var log = require('./logger').create('web-server')
+
+var createCustomHandler = function (customFileHandlers, /* config.basePath */ basePath) {
+ return function (request, response, next) {
+ for (var i = 0; i < customFileHandlers.length; i++) {
+ if (customFileHandlers[i].urlRegex.test(request.url)) {
+ return customFileHandlers[i].handler(request, response, 'fake/static', 'fake/adapter',
+ basePath, 'fake/root')
+ }
+ }
+
+ return next()
+ }
+}
+
+createCustomHandler.$inject = ['customFileHandlers', 'config.basePath']
+
+var createWebServer = function (injector, emitter) {
+ var serveStaticFile = common.createServeFile(fs, path.normalize(__dirname + '/../static'))
+ var serveFile = common.createServeFile(fs)
+ var filesPromise = new common.PromiseContainer()
+
+ emitter.on('file_list_modified', function (files) {
+ filesPromise.set(files)
+ })
+
+ // locals for webserver module
+ // NOTE(vojta): figure out how to do this with DI
+ injector = injector.createChild([{
+ serveFile: ['value', serveFile],
+ serveStaticFile: ['value', serveStaticFile],
+ filesPromise: ['value', filesPromise]
+ }])
+
+ var proxyMiddlewareInstance = injector.invoke(proxyMiddleware.create)
+
+ var handler = connect()
+ .use(injector.invoke(runnerMiddleware.create))
+ .use(injector.invoke(stripHostMiddleware.create))
+ .use(injector.invoke(karmaMiddleware.create))
+ .use(injector.invoke(sourceFilesMiddleware.create))
+ // TODO(vojta): extract the proxy into a plugin
+ .use(proxyMiddlewareInstance)
+ // TODO(vojta): remove, this is only here because of karma-dart
+ // we need a better way of custom handlers
+ .use(injector.invoke(createCustomHandler))
+ .use(function (request, response) {
+ common.serve404(response, request.url)
+ })
+
+ var server = http.createServer(handler)
+
+ server.on('upgrade', function (req, socket, head) {
+ log.debug('upgrade %s', req.url)
+ proxyMiddlewareInstance.upgrade(req, socket, head)
+ })
+
+ return server
+}
+
+// PUBLIC API
+exports.create = createWebServer
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/package.json
new file mode 100644
index 00000000..656ab35b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/package.json
@@ -0,0 +1,878 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "karma@~0.12.0",
+ "scope": null,
+ "escapedName": "karma",
+ "name": "karma",
+ "rawSpec": "~0.12.0",
+ "spec": ">=0.12.0 <0.13.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket"
+ ]
+ ],
+ "_from": "karma@>=0.12.0 <0.13.0",
+ "_id": "karma@0.12.37",
+ "_inCache": true,
+ "_location": "/karma",
+ "_nodeVersion": "0.10.38",
+ "_npmUser": {
+ "name": "dignifiedquire",
+ "email": "dignifiedquire@gmail.com"
+ },
+ "_npmVersion": "2.11.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "karma@~0.12.0",
+ "scope": null,
+ "escapedName": "karma",
+ "name": "karma",
+ "rawSpec": "~0.12.0",
+ "spec": ">=0.12.0 <0.13.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "#DEV:/"
+ ],
+ "_resolved": "https://registry.npmjs.org/karma/-/karma-0.12.37.tgz",
+ "_shasum": "1a9f7fdeccd69de2e835e04edbac2ecd3fa645e4",
+ "_shrinkwrap": null,
+ "_spec": "karma@~0.12.0",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket",
+ "author": {
+ "name": "Vojta JĂ­na",
+ "email": "vojta.jina@gmail.com"
+ },
+ "bin": {
+ "karma": "./bin/karma"
+ },
+ "bugs": {
+ "url": "https://github.com/karma-runner/karma/issues"
+ },
+ "contributors": [
+ {
+ "name": "Friedel Ziegelmayer",
+ "email": "friedel.ziegelmayer@gmail.com"
+ },
+ {
+ "name": "Karma Bot",
+ "email": "karmarunnerbot@gmail.com"
+ },
+ {
+ "name": "Maksim Ryzhikov",
+ "email": "rv.maksim@gmail.com"
+ },
+ {
+ "name": "dignifiedquire",
+ "email": "friedel.ziegelmayer@gmail.com"
+ },
+ {
+ "name": "taichi",
+ "email": "ryushi@gmail.com"
+ },
+ {
+ "name": "Liam Newman",
+ "email": "bitwiseman@gmail.com"
+ },
+ {
+ "name": "Ciro Nunes",
+ "email": "ciroanunes@gmail.com"
+ },
+ {
+ "name": "Tim Cuthbertson",
+ "email": "tim@gfxmonk.net"
+ },
+ {
+ "name": "Shyam Seshadri",
+ "email": "shyamseshadri@gmail.com"
+ },
+ {
+ "name": "Robo",
+ "email": "hop2deep@gmail.com"
+ },
+ {
+ "name": "Pawel Kozlowski",
+ "email": "pkozlowski.opensource@gmail.com"
+ },
+ {
+ "name": "joshjb84",
+ "email": "joshjb84@hotmail.com"
+ },
+ {
+ "name": "Kim Joar Bekkelund",
+ "email": "kjbekkelund@gmail.com"
+ },
+ {
+ "name": "Daniel Aleksandersen",
+ "email": "code@daniel.priv.no"
+ },
+ {
+ "name": "Ilya Volodin",
+ "email": "ivolodin@vistaprint.com"
+ },
+ {
+ "name": "Iristyle",
+ "email": "Iristyle@github"
+ },
+ {
+ "name": "Brian Ford",
+ "email": "btford@umich.edu"
+ },
+ {
+ "name": "Marcello Nuccio",
+ "email": "marcello.nuccio@gmail.com"
+ },
+ {
+ "name": "Mark Ethan Trostler",
+ "email": "mark@zzo.com"
+ },
+ {
+ "name": "Jeff Jewiss",
+ "email": "jeffjewiss@gmail.com"
+ },
+ {
+ "name": "Aymeric Beaumet",
+ "email": "aymeric@beaumet.me"
+ },
+ {
+ "name": "Andrew Martin",
+ "email": "sublimino@gmail.com"
+ },
+ {
+ "name": "pavelgj",
+ "email": "pavelgj@gmail.com"
+ },
+ {
+ "name": "sylvain-hamel",
+ "email": "sylvainhamel0@gmail.com"
+ },
+ {
+ "name": "ChangZhuo Chen",
+ "email": "czchen@gmail.com",
+ "url": "陳昌倬"
+ },
+ {
+ "name": "James Ford",
+ "email": "jford@psyked.co.uk"
+ },
+ {
+ "name": "Bulat Shakirzyanov",
+ "email": "mallluhuct@gmail.com"
+ },
+ {
+ "name": "Igor Minar",
+ "email": "iiminar@gmail.com"
+ },
+ {
+ "name": "Thomas Parisot",
+ "email": "thomas@oncle-tom.net"
+ },
+ {
+ "name": "Sylvain Hamel",
+ "email": "sylvainhamel0@gmail.com"
+ },
+ {
+ "name": "Igor Minar",
+ "email": "igor@angularjs.org"
+ },
+ {
+ "name": "rdodev",
+ "email": "rubenoz@gmail.com"
+ },
+ {
+ "name": "Roarke Gaskill",
+ "email": "roarke.gaskill@gmail.com"
+ },
+ {
+ "name": "Jonathan Freeman",
+ "email": "freethejazz@gmail.com"
+ },
+ {
+ "name": "Steve Mao",
+ "email": "steve.mao@healthinteract.com.au"
+ },
+ {
+ "name": "karmarunnerbot",
+ "email": "karmarunnerbot@gmail.com"
+ },
+ {
+ "name": "Ethan J. Brown",
+ "email": "ethan_j_brown@hotmail.com"
+ },
+ {
+ "name": "Nick Malaguti",
+ "email": "nmalaguti@palantir.com"
+ },
+ {
+ "name": "Hugues Malphettes",
+ "email": "hmalphettes@gmail.com"
+ },
+ {
+ "name": "Luke Page",
+ "email": "luke.a.page@gmail.com"
+ },
+ {
+ "name": "Parashuram",
+ "email": "code@r.nparashuram.com"
+ },
+ {
+ "name": "Vladimir Starkov",
+ "email": "iamstarkov@users.noreply.github.com"
+ },
+ {
+ "name": "Jonas Pommerening",
+ "email": "jonas.pommerening@aixigo.de"
+ },
+ {
+ "name": "PatrickJS",
+ "email": "github@gdi2290.com"
+ },
+ {
+ "name": "ngiebel",
+ "email": "ngiebel@starkinvestments.com"
+ },
+ {
+ "name": "Mark Trostler",
+ "email": "mark@zzo.com"
+ },
+ {
+ "name": "Jeff Lage",
+ "email": "jefflage@me.com"
+ },
+ {
+ "name": "Joe Lencioni",
+ "email": "joe.lencioni@brigade.com"
+ },
+ {
+ "name": "Johannes Gorset",
+ "email": "jgorset@gmail.com"
+ },
+ {
+ "name": "Jon Bretman",
+ "email": "jon.bretman@gmail.com"
+ },
+ {
+ "name": "Julian Connor",
+ "email": "julian.connor@venmo.com"
+ },
+ {
+ "name": "Karl Lindmark",
+ "email": "karl.lindmark@ninetwozero.com"
+ },
+ {
+ "name": "Karolis Narkevicius",
+ "email": "karolis.n@gmail.com"
+ },
+ {
+ "name": "Keats",
+ "email": "balthek@gmail.com"
+ },
+ {
+ "name": "Keith Cirkel",
+ "email": "github@keithcirkel.co.uk"
+ },
+ {
+ "name": "Kevin Ortman",
+ "email": "kevin_ortman@msn.com"
+ },
+ {
+ "name": "Lukasz Zatorski",
+ "email": "lzatorski@gmail.com"
+ },
+ {
+ "name": "Marko Anastasov",
+ "email": "marko@renderedtext.com"
+ },
+ {
+ "name": "Martin Geisler",
+ "email": "martin@geisler.net"
+ },
+ {
+ "name": "Martin Jul",
+ "email": "martin@mjul.com"
+ },
+ {
+ "name": "Martin Lemanski",
+ "email": "martin.lemanski@gmx.at"
+ },
+ {
+ "name": "Matias Niemelàˆ",
+ "email": "matias@yearofmoo.com"
+ },
+ {
+ "name": "Matthew Machuga",
+ "email": "machuga@gmail.com"
+ },
+ {
+ "name": "Matti Paksula",
+ "email": "matti.paksula@iki.fi"
+ },
+ {
+ "name": "Mattijs Kneppers",
+ "email": "mattijs@arttech.nl"
+ },
+ {
+ "name": "Merrick Christensen",
+ "email": "merrick.christensen@gmail.com"
+ },
+ {
+ "name": "MichaÅ‚ GoÅ‚è¨biowski",
+ "email": "m.goleb@gmail.com"
+ },
+ {
+ "name": "Milan Aleksic",
+ "email": "milanaleksic@gmail.com"
+ },
+ {
+ "name": "Mohamed Eltuhamy",
+ "email": "tuhamy@gmail.com"
+ },
+ {
+ "name": "Nick Carter",
+ "email": "thynctank@thynctank.com"
+ },
+ {
+ "name": "Nick Payne",
+ "email": "nick@kurai.co.uk"
+ },
+ {
+ "name": "Nick Williams",
+ "email": "mr.nicksta@gmail.com"
+ },
+ {
+ "name": "Nicolas Artman",
+ "email": "nicolasartman@users.noreply.github.com"
+ },
+ {
+ "name": "Nicolas Ferrero",
+ "email": "ferrero.nicolas@gmail.com"
+ },
+ {
+ "name": "Nish",
+ "email": "nishantpatel611@gmail.com"
+ },
+ {
+ "name": "Nuno Job",
+ "email": "nunojobpinto@gmail.com"
+ },
+ {
+ "name": "OniOni",
+ "email": "mathieu.c.sabourin@gmail.com"
+ },
+ {
+ "name": "OpenShift guest",
+ "email": "mrpatan@gmail.com"
+ },
+ {
+ "name": "Parashuram",
+ "email": "code@nparashuram.com"
+ },
+ {
+ "name": "Pascal Hartig",
+ "email": "phartig@rdrei.net"
+ },
+ {
+ "name": "Patrick Lussan",
+ "email": "patrick.lussan@componize.com"
+ },
+ {
+ "name": "Patrik Henningsson",
+ "email": "patrik.henningsson@gmail.com"
+ },
+ {
+ "name": "Pete Bacon Darwin",
+ "email": "pete@bacondarwin.com"
+ },
+ {
+ "name": "Pete Swan",
+ "email": "pete@indabamusic.com"
+ },
+ {
+ "name": "Peter McAlpine",
+ "email": "peter.mcalpine@arcticwolf.com"
+ },
+ {
+ "name": "Peter Yates",
+ "email": "pd.yates@gmail.com"
+ },
+ {
+ "name": "Philip Harrison",
+ "email": "philip@mailharrison.com"
+ },
+ {
+ "name": "Remy Sharp",
+ "email": "remy@remysharp.com"
+ },
+ {
+ "name": "Roarke Gaskill",
+ "email": "rgaskill@nexvex.com"
+ },
+ {
+ "name": "Rob Cherry",
+ "email": "rcherry@reverbnation.com"
+ },
+ {
+ "name": "Rob Dodson",
+ "email": "lets.email.rob@gmail.com"
+ },
+ {
+ "name": "RĂ©mi",
+ "email": "r3mi@users.sourceforge.net"
+ },
+ {
+ "name": "Sahat Yalkabov",
+ "email": "sakhat@gmail.com"
+ },
+ {
+ "name": "Sammy Jelin",
+ "email": "sjelin@gmail.com"
+ },
+ {
+ "name": "Shane Osbourne",
+ "email": "shane.osbourne8@gmail.com"
+ },
+ {
+ "name": "Simen Bekkhus",
+ "email": "sbekkhus91@gmail.com"
+ },
+ {
+ "name": "Slava Kotiya",
+ "email": "sk@nexttuesday.de"
+ },
+ {
+ "name": "Thomas Parisot",
+ "email": "thomas.parisot@bbc.co.uk"
+ },
+ {
+ "name": "Tim Olshansky",
+ "email": "tim.olshansky@gmail.com"
+ },
+ {
+ "name": "Timo Tijhof",
+ "email": "krinklemail@gmail.com"
+ },
+ {
+ "name": "Tom MacWright",
+ "email": "tom@macwright.org"
+ },
+ {
+ "name": "Tyler Akins",
+ "email": "fidian@rumkin.com"
+ },
+ {
+ "name": "Vasily Ostanin",
+ "email": "bazilio91@gmail.com"
+ },
+ {
+ "name": "Veronica Lynn",
+ "email": "veronica.lynn@redjack.com"
+ },
+ {
+ "name": "Vincent Taverna",
+ "email": "vinnymac@gmail.com"
+ },
+ {
+ "name": "Wizek",
+ "email": "123.wizek@gmail.com"
+ },
+ {
+ "name": "Yi Wang",
+ "email": "e@yi-wang.me"
+ },
+ {
+ "name": "Yvonne Yip",
+ "email": "ykyyip@google.com"
+ },
+ {
+ "name": "Zhang zhengzheng",
+ "email": "code@tychio.net"
+ },
+ {
+ "name": "adamnation",
+ "email": "arowe@illumina.com"
+ },
+ {
+ "name": "ahaurw01",
+ "email": "ahaurwitz@gmail.com"
+ },
+ {
+ "name": "ashaffer",
+ "email": "darawk@gmail.com"
+ },
+ {
+ "name": "compact",
+ "email": "compact@users.noreply.github.com"
+ },
+ {
+ "name": "cy6erskunk",
+ "email": "cyberskunk@gmail.com"
+ },
+ {
+ "name": "david-garcia-nete",
+ "email": "david.garcia.nete@gmail.com"
+ },
+ {
+ "name": "deepak1556",
+ "email": "hop2deep@gmail.com"
+ },
+ {
+ "name": "dorey",
+ "email": "dorey415@gmail.com"
+ },
+ {
+ "name": "hrgdavor",
+ "email": "hrgdavor@gmail.com"
+ },
+ {
+ "name": "ianjobling",
+ "email": "ijobling@codio.com"
+ },
+ {
+ "name": "inf3rno",
+ "email": "laszlo.janszky@gmail.com"
+ },
+ {
+ "name": "johnjbarton",
+ "email": "johnjbarton@johnjbarton.com"
+ },
+ {
+ "name": "lanshunfang",
+ "email": "lanshunfang@gmail.com"
+ },
+ {
+ "name": "maik",
+ "email": "mauk@gulli.com"
+ },
+ {
+ "name": "mdemo",
+ "email": "mengdesen09@qq.com"
+ },
+ {
+ "name": "nathanfaucett",
+ "email": "nathanfaucett@gmail.com"
+ },
+ {
+ "name": "u812",
+ "email": "0u812@github.com"
+ },
+ {
+ "name": "toran billups",
+ "email": "toranb@gmail.com"
+ },
+ {
+ "name": "Alexander Shtuchkin",
+ "email": "ashtuchkin@gmail.com"
+ },
+ {
+ "name": "Anders Ekdahl",
+ "email": "anders.ekdahl@gmail.com"
+ },
+ {
+ "name": "Anders Janmyr",
+ "email": "anders.janmyr@sonymobile.com"
+ },
+ {
+ "name": "Andrew Fischer",
+ "email": "afischer@shutterfly.com"
+ },
+ {
+ "name": "Andy Joslin",
+ "email": "andytjoslin@gmail.com"
+ },
+ {
+ "name": "Anton Usmansky",
+ "email": "cody0@yandex-team.ru"
+ },
+ {
+ "name": "AvnerCohen",
+ "email": "israbirding@gmail.com"
+ },
+ {
+ "name": "Awad Mackie",
+ "email": "firesock.serwalek@gmail.com"
+ },
+ {
+ "name": "Basemm",
+ "email": "BAsM.Egy@gmail.com"
+ },
+ {
+ "name": "Benoit Charbonnier",
+ "email": "benoit.charbonnier@gmail.com"
+ },
+ {
+ "name": "Breno Calazans",
+ "email": "breno@vtex.com.br"
+ },
+ {
+ "name": "Brian Donovan",
+ "email": "donovan@squareup.com"
+ },
+ {
+ "name": "Brian Donovan",
+ "email": "me@brian-donovan.com"
+ },
+ {
+ "name": "Carl Goldberg",
+ "email": "carlgoldberg1236@gmail.com"
+ },
+ {
+ "name": "Chad Smith",
+ "email": "chad@configit.com"
+ },
+ {
+ "name": "Chris Dawson",
+ "email": "xrdawson@gmail.com"
+ },
+ {
+ "name": "Christopher Hiller",
+ "email": "chiller@badwing.com"
+ },
+ {
+ "name": "Ciro S. Costa",
+ "email": "ciro.costa@usp.br"
+ },
+ {
+ "name": "Dan Thareja",
+ "email": "danthareja@gmail.com"
+ },
+ {
+ "name": "Danny Croft",
+ "email": "danny.croft@yahoo.co.uk"
+ },
+ {
+ "name": "Danny Tuppeny",
+ "email": "danny@tuppeny.com"
+ },
+ {
+ "name": "David Jensen",
+ "email": "david@frode.(none)",
+ "url": "none"
+ },
+ {
+ "name": "David M. Karr",
+ "email": "dk068x@att.com"
+ },
+ {
+ "name": "David Souther",
+ "email": "davidsouther@gmail.com"
+ },
+ {
+ "name": "Dillon",
+ "email": "mdillon@reachmail.com"
+ },
+ {
+ "name": "Dmitrii Abramov",
+ "email": "dabramov@yahoo-inc.com"
+ },
+ {
+ "name": "ERt",
+ "email": "ert.wroc@gmail.com"
+ },
+ {
+ "name": "Ed Rooth",
+ "email": "ed.rooth@rackspace.com"
+ },
+ {
+ "name": "Eddie Monge",
+ "email": "eddie@eddiemonge.com"
+ },
+ {
+ "name": "Edward Hutchins",
+ "email": "eahutchins@gmail.com"
+ },
+ {
+ "name": "Eldar Jafarov",
+ "email": "djkojb@gmail.com"
+ },
+ {
+ "name": "Eric Baer",
+ "email": "me@ericbaer.com"
+ },
+ {
+ "name": "Filipe Guerra",
+ "email": "alias.mac@gmail.com"
+ },
+ {
+ "name": "Franck Garcia",
+ "email": "garcia.franck@gmail.com"
+ },
+ {
+ "name": "Fred Sauer",
+ "email": "fredsa@google.com"
+ },
+ {
+ "name": "Frederic Hemberger",
+ "email": "mail@frederic-hemberger.de"
+ },
+ {
+ "name": "Fredrik Bonander",
+ "email": "carl.fredrik.bonander@gmail.com"
+ },
+ {
+ "name": "Gavin Aiken",
+ "email": "gavin@aiken.org.uk"
+ },
+ {
+ "name": "Geert Van Laethem",
+ "email": "geert.van.laethem@pandora.be"
+ },
+ {
+ "name": "Greg Thornton",
+ "email": "xdissent@me.com"
+ },
+ {
+ "name": "Igor Lima",
+ "email": "lima.igorribeiro@gmail.com"
+ },
+ {
+ "name": "Jack Tarantino",
+ "email": "jacopo.tarantino@gmail.com"
+ },
+ {
+ "name": "Jakub Z",
+ "email": "jakzale@gmail.com"
+ },
+ {
+ "name": "James Shore",
+ "email": "jshore@jamesshore.com"
+ },
+ {
+ "name": "Jan Molak",
+ "email": "jan.molak@smartcodeltd.co.uk"
+ },
+ {
+ "name": "Jeff Froom",
+ "email": "jeff@jfroom.com"
+ }
+ ],
+ "dependencies": {
+ "chokidar": "^1.0.1",
+ "colors": "^1.1.0",
+ "connect": "^2.29.2",
+ "di": "^0.0.1",
+ "glob": "^5.0.6",
+ "graceful-fs": "^3.0.6",
+ "http-proxy": "^0.10",
+ "lodash": "^3.8.0",
+ "log4js": "^0.6.25",
+ "mime": "^1.3.4",
+ "minimatch": "^2.0.7",
+ "optimist": "^0.6.1",
+ "q": "^1.4.1",
+ "rimraf": "^2.3.3",
+ "socket.io": "0.9.16",
+ "source-map": "^0.4.2",
+ "useragent": "^2.1.6"
+ },
+ "description": "Spectacular Test Runner for JavaScript.",
+ "devDependencies": {
+ "LiveScript": "^1.3.0",
+ "chai": "^2.3.0",
+ "chai-as-promised": "^5.0.0",
+ "coffee-errors": "^0.8.6",
+ "coffee-script": "^1.9.2",
+ "cucumber": "^0.4.7",
+ "eslint": "^0.22.1",
+ "eslint-config-standard": "^2.0.1",
+ "eslint-plugin-react": "^2.5.0",
+ "grunt": "^0.4",
+ "grunt-auto-release": "^0.0.6",
+ "grunt-browserify": "^3.8.0",
+ "grunt-bump": "^0.3.1",
+ "grunt-coffeelint": "^0.0.13",
+ "grunt-contrib-watch": "^0.6.1",
+ "grunt-conventional-changelog": "^1.2.2",
+ "grunt-cucumberjs": "^0.7.0",
+ "grunt-eslint": "^14.0.0",
+ "grunt-mocha-test": "^0.12.7",
+ "grunt-npm": "0.0.2",
+ "karma-browserstack-launcher": "*",
+ "karma-chrome-launcher": "*",
+ "karma-coffee-preprocessor": "*",
+ "karma-commonjs": "*",
+ "karma-coverage": "*",
+ "karma-firefox-launcher": "*",
+ "karma-growl-reporter": "*",
+ "karma-html2js-preprocessor": "*",
+ "karma-jasmine": "^0.1.5",
+ "karma-junit-reporter": "*",
+ "karma-live-preprocessor": "*",
+ "karma-mocha": "*",
+ "karma-ng-scenario": "*",
+ "karma-phantomjs-launcher": "*",
+ "karma-qunit": "*",
+ "karma-requirejs": "*",
+ "karma-sauce-launcher": "*",
+ "karma-script-launcher": "^0.1.0",
+ "load-grunt-tasks": "^3.1.0",
+ "mkdirp": "^0.5.0",
+ "mocha": "^2.2.5",
+ "mocks": "^0.0.15",
+ "sinon": "^1.14.1",
+ "sinon-chai": "^2.7.0",
+ "timer-shim": "^0.3.0",
+ "which": "^1.1.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "1a9f7fdeccd69de2e835e04edbac2ecd3fa645e4",
+ "tarball": "https://registry.npmjs.org/karma/-/karma-0.12.37.tgz"
+ },
+ "engines": {
+ "node": ">=0.8 <=0.12 || >=1 <=2"
+ },
+ "gitHead": "e72e106a9790092b9b746548cb6221cb76c41013",
+ "homepage": "http://karma-runner.github.io/",
+ "keywords": [
+ "karma",
+ "spectacular",
+ "runner",
+ "karma",
+ "js",
+ "javascript",
+ "testing",
+ "test",
+ "remote",
+ "execution"
+ ],
+ "license": "MIT",
+ "main": "./lib/index",
+ "maintainers": [
+ {
+ "name": "vojtajina",
+ "email": "vojta.jina+npm@gmail.com"
+ },
+ {
+ "name": "karmarunnerbot",
+ "email": "karmarunnerbot@gmail.com"
+ },
+ {
+ "name": "zzo",
+ "email": "mark@zzo.com"
+ },
+ {
+ "name": "dignifiedquire",
+ "email": "dignifiedquire@gmail.com"
+ }
+ ],
+ "name": "karma",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/karma-runner/karma.git"
+ },
+ "scripts": {},
+ "version": "0.12.37",
+ "warnings": [
+ {
+ "code": "ENOTSUP",
+ "required": {
+ "node": ">=0.8 <=0.12 || >=1 <=2"
+ },
+ "pkgid": "karma@0.12.37"
+ }
+ ]
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.coffee b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.coffee
new file mode 100644
index 00000000..39edb5ea
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.coffee
@@ -0,0 +1,22 @@
+allTestFiles = []
+TEST_REGEXP = /(spec|test)(\.coffee)?(\.js)?$/i
+
+# Get a list of all the test files to include
+Object.keys(window.__karma__.files).forEach (file) ->
+
+ if TEST_REGEXP.test(file)
+ # Normalize paths to RequireJS module names.
+ # If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
+ # then do not normalize the paths
+ allTestFiles.push file.replace(/^\/base\/|\.js$/g, '')
+ return
+
+require.config
+ # Karma serves files under /base, which is the basePath from your config file
+ baseUrl: "/base"
+
+ # dynamically load all test files
+ deps: allTestFiles
+
+ # we have to kickoff jasmine, as it is asynchronous
+ callback: window.__karma__.start
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.js
new file mode 100644
index 00000000..c2173ad6
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/requirejs.config.tpl.js
@@ -0,0 +1,24 @@
+var allTestFiles = [];
+var TEST_REGEXP = /(spec|test)\.js$/i;
+
+// Get a list of all the test files to include
+Object.keys(window.__karma__.files).forEach(function(file) {
+ if (TEST_REGEXP.test(file)) {
+ // Normalize paths to RequireJS module names.
+ // If you require sub-dependencies of test files to be loaded as-is (requiring file extension)
+ // then do not normalize the paths
+ var normalizedTestModule = file.replace(/^\/base\/|\.js$/g, '');
+ allTestFiles.push(normalizedTestModule);
+ }
+});
+
+require.config({
+ // Karma serves files under /base, which is the basePath from your config file
+ baseUrl: '/base',
+
+ // dynamically load all test files
+ deps: allTestFiles,
+
+ // we have to kickoff jasmine, as it is asynchronous
+ callback: window.__karma__.start
+});
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/client.html b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/client.html
new file mode 100644
index 00000000..8462e980
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/client.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<!--
+The entry point for client. This file is loaded just once when the client is captured.
+It contains socket.io and all the communication logic.
+-->
+<html>
+<head>
+%X_UA_COMPATIBLE%
+ <title>Karma</title>
+ <link href="favicon.ico" rel="icon" type="image/x-icon">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ iframe {
+ height: 100%;
+ width: 100%;
+ border: 0;
+ }
+
+ html, body {
+ height: 100%;
+ padding: 0;
+ margin: 0;
+
+ font-family: sans-serif;
+ }
+
+ .offline {
+ background: #DDD;
+ }
+
+ .online {
+ background: #6C4;
+ }
+
+ .idle {
+ }
+
+ .executing {
+ background: #F99;
+ }
+
+ #banner {
+ padding: 5px 10px;
+ }
+
+ h1 {
+ font-size: 1.8em;
+ margin: 0;
+ padding: 0;
+ }
+
+ ul {
+ margin: 0;
+ padding: 0;
+
+ list-style: none;
+ }
+
+ li {
+ padding: 5px 12px;
+ }
+
+ .btn-debug {
+ float: right;
+ }
+
+ .offline .btn-debug {
+ display: none;
+ }
+
+ .btn-debug {
+ -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
+ box-shadow:inset 0px 1px 0px 0px #ffffff;
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6) );
+ background:-moz-linear-gradient( center top, #ffffff 5%, #f6f6f6 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6');
+ background-color:#ffffff;
+ -moz-border-radius:6px;
+ -webkit-border-radius:6px;
+ border-radius:6px;
+ border:1px solid #dcdcdc;
+ display:inline-block;
+ color:#666666;
+ font-family:arial;
+ font-size:15px;
+ font-weight:bold;
+ padding:6px 24px;
+ text-decoration:none;
+ text-shadow:1px 1px 0px #ffffff;
+ }
+
+ .btn-debug:hover {
+ background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff) );
+ background:-moz-linear-gradient( center top, #f6f6f6 5%, #ffffff 100% );
+ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff');
+ background-color:#f6f6f6;
+ }
+ </style>
+</head>
+<body>
+ <div id="banner" class="offline">
+ <a href="debug.html%X_UA_COMPATIBLE_URL%" target="_blank" rel="noreferrer" class="btn-debug">DEBUG</a>
+ <h1 id="title">Karma - starting</h1>
+ </div>
+
+ <ul id="browsers"></ul>
+
+ <iframe id="context" src="about:blank" width="100%" height="100%"></iframe>
+
+ <script src="socket.io/socket.io.js"></script>
+ <script src="karma.js"></script>
+</body>
+</html>
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/context.html b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/context.html
new file mode 100644
index 00000000..64420c66
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/context.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<!--
+This is the execution context.
+Loaded within the iframe.
+Reloaded before every execution run.
+-->
+<html>
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+ <!-- The scripts need to be at the end of body, so that some test running frameworks
+ (Angular Scenario, for example) need the body to be loaded so that it can insert its magic
+ into it. If it is before body, then it fails to find the body and crashes and burns in an epic
+ manner. -->
+ <script type="text/javascript">
+ // sets window.__karma__ and overrides console and error handling
+ // Use window.opener if this was opened by someone else - in a new window
+ if (window.opener) {
+ window.opener.karma.setupContext(window);
+ } else {
+ window.parent.karma.setupContext(window);
+ }
+
+ // All served files with the latest timestamps
+ %MAPPINGS%
+ </script>
+ <!-- Dynamically replaced with <script> tags -->
+ %SCRIPTS%
+ <script type="text/javascript">
+ window.__karma__.loaded();
+ </script>
+</body>
+</html>
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/debug.html b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/debug.html
new file mode 100644
index 00000000..a11f16e5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/debug.html
@@ -0,0 +1,57 @@
+<!doctype html>
+<!--
+This file is almost the same as context.html - loads all source files,
+but its purpose is to be loaded in the main frame (not within an iframe),
+just for immediate execution, without reporting to Karma server.
+-->
+<html>
+<head>
+%X_UA_COMPATIBLE%
+ <title>Karma DEBUG RUNNER</title>
+ <link href="favicon.ico" rel="icon" type="image/x-icon" />
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+ <!-- The scripts need to be at the end of body, so that some test running frameworks
+ (Angular Scenario, for example) need the body to be loaded so that it can insert its magic
+ into it. If it is before body, then it fails to find the body and crashes and burns in an epic
+ manner. -->
+ <script type="text/javascript">
+ window.__karma__ = {
+ info: function(info) {
+ if (info.dump && window.console) window.console.log(info.dump);
+ },
+ complete: function() {
+ if (window.console) window.console.log('Skipped ' + this.skipped + ' tests');
+ },
+ store: function() {},
+ skipped: 0,
+ result: window.console ? function(result) {
+ if (result.skipped) {
+ this.skipped++;
+ return;
+ }
+ var msg = result.success ? 'SUCCESS ' : 'FAILED ';
+ window.console.log(msg + result.suite.join(' ') + ' ' + result.description);
+
+ for (var i = 0; i < result.log.length; i++) {
+ window.console.error(result.log[i]);
+ }
+ } : function() {},
+ loaded: function() {
+ this.start();
+ }
+ };
+
+ %CLIENT_CONFIG%
+
+ // All served files with the latest timestamps
+ %MAPPINGS%
+ </script>
+ <!-- Dynamically replaced with <script> tags -->
+ %SCRIPTS%
+ <script type="text/javascript">
+ window.__karma__.loaded();
+ </script>
+</body>
+</html>
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/favicon.ico b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/favicon.ico
new file mode 100644
index 00000000..c70744a8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/favicon.ico
Binary files differ
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/karma.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/karma.js
new file mode 100644
index 00000000..0ea9028a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/static/karma.js
@@ -0,0 +1,407 @@
+(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+module.exports = {
+ VERSION: '%KARMA_VERSION%',
+ KARMA_URL_ROOT: '%KARMA_URL_ROOT%',
+ CONTEXT_URL: 'context.html'
+}
+
+},{}],2:[function(require,module,exports){
+var stringify = require('./stringify')
+var constant = require('./constants')
+var util = require('./util')
+
+/* jshint unused: false */
+var Karma = function (socket, iframe, opener, navigator, location) {
+ var hasError = false
+ var startEmitted = false
+ var reloadingContext = false
+ var store = {}
+ var self = this
+ var queryParams = util.parseQueryParams(location.search)
+ var browserId = queryParams.id || util.generateId('manual-')
+ var returnUrl = queryParams['return_url' + ''] || null
+ var currentTransport
+
+ var resultsBufferLimit = 1
+ var resultsBuffer = []
+
+ this.VERSION = constant.VERSION
+ this.config = {}
+
+ var childWindow = null
+ var navigateContextTo = function (url) {
+ if (self.config.useIframe === false) {
+ if (childWindow === null || childWindow.closed === true) {
+ // If this is the first time we are opening the window, or the window is closed
+ childWindow = opener('about:blank')
+ }
+ childWindow.location = url
+ } else {
+ iframe.src = url
+ }
+ }
+
+ this.setupContext = function (contextWindow) {
+ if (hasError) {
+ return
+ }
+
+ var getConsole = function (currentWindow) {
+ return currentWindow.console || {
+ log: function () {},
+ info: function () {},
+ warn: function () {},
+ error: function () {},
+ debug: function () {}
+ }
+ }
+
+ contextWindow.__karma__ = this
+
+ // This causes memory leak in Chrome (17.0.963.66)
+ contextWindow.onerror = function () {
+ return contextWindow.__karma__.error.apply(contextWindow.__karma__, arguments)
+ }
+
+ contextWindow.onbeforeunload = function (e, b) {
+ if (!reloadingContext) {
+ // TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL)
+ contextWindow.__karma__.error('Some of your tests did a full page reload!')
+ }
+ }
+
+ if (self.config.captureConsole) {
+ // patch the console
+ var localConsole = contextWindow.console = getConsole(contextWindow)
+ var logMethods = ['log', 'info', 'warn', 'error', 'debug']
+ var patchConsoleMethod = function (method) {
+ var orig = localConsole[method]
+ if (!orig) {
+ return
+ }
+ localConsole[method] = function () {
+ self.log(method, arguments)
+ return Function.prototype.apply.call(orig, localConsole, arguments)
+ }
+ }
+ for (var i = 0; i < logMethods.length; i++) {
+ patchConsoleMethod(logMethods[i])
+ }
+ }
+
+ contextWindow.dump = function () {
+ self.log('dump', arguments)
+ }
+
+ contextWindow.alert = function (msg) {
+ self.log('alert', [msg])
+ }
+ }
+
+ this.log = function (type, args) {
+ var values = []
+
+ for (var i = 0; i < args.length; i++) {
+ values.push(this.stringify(args[i], 3))
+ }
+
+ this.info({log: values.join(', '), type: type})
+ }
+
+ this.stringify = stringify
+
+ var clearContext = function () {
+ reloadingContext = true
+ navigateContextTo('about:blank')
+ }
+
+ // error during js file loading (most likely syntax error)
+ // we are not going to execute at all
+ this.error = function (msg, url, line) {
+ hasError = true
+ socket.emit('error', url ? msg + '\nat ' + url + (line ? ':' + line : '') : msg)
+ this.complete()
+ return false
+ }
+
+ this.result = function (result) {
+ if (!startEmitted) {
+ socket.emit('start', {total: null})
+ startEmitted = true
+ }
+
+ if (resultsBufferLimit === 1) {
+ return socket.emit('result', result)
+ }
+
+ resultsBuffer.push(result)
+
+ if (resultsBuffer.length === resultsBufferLimit) {
+ socket.emit('result', resultsBuffer)
+ resultsBuffer = []
+ }
+ }
+
+ this.complete = function (result) {
+ if (resultsBuffer.length) {
+ socket.emit('result', resultsBuffer)
+ resultsBuffer = []
+ }
+
+ // give the browser some time to breath, there could be a page reload, but because a bunch of
+ // tests could run in the same event loop, we wouldn't notice.
+ setTimeout(function () {
+ clearContext()
+ }, 0)
+
+ socket.emit('complete', result || {}, function () {
+ if (returnUrl) {
+ location.href = returnUrl
+ }
+ })
+ }
+
+ this.info = function (info) {
+ // TODO(vojta): introduce special API for this
+ if (!startEmitted && util.isDefined(info.total)) {
+ socket.emit('start', info)
+ startEmitted = true
+ } else {
+ socket.emit('info', info)
+ }
+ }
+
+ var UNIMPLEMENTED_START = function () {
+ this.error('You need to include some adapter that implements __karma__.start method!')
+ }
+
+ // all files loaded, let's start the execution
+ this.loaded = function () {
+ // has error -> cancel
+ if (!hasError) {
+ this.start(this.config)
+ }
+
+ // remove reference to child iframe
+ this.start = UNIMPLEMENTED_START
+ }
+
+ this.store = function (key, value) {
+ if (util.isUndefined(value)) {
+ return store[key]
+ }
+
+ if (util.instanceOf(value, 'Array')) {
+ var s = store[key] = []
+ for (var i = 0; i < value.length; i++) {
+ s.push(value[i])
+ }
+ } else {
+ // TODO(vojta): clone objects + deep
+ store[key] = value
+ }
+ }
+
+ // supposed to be overriden by the context
+ // TODO(vojta): support multiple callbacks (queue)
+ this.start = UNIMPLEMENTED_START
+
+ socket.on('execute', function (cfg) {
+ // reset hasError and reload the iframe
+ hasError = false
+ startEmitted = false
+ reloadingContext = false
+ self.config = cfg
+ navigateContextTo(constant.CONTEXT_URL)
+
+ // clear the console before run
+ // works only on FF (Safari, Chrome do not allow to clear console from js source)
+ if (window.console && window.console.clear) {
+ window.console.clear()
+ }
+ })
+
+ // report browser name, id
+ socket.on('connect', function () {
+ currentTransport = socket.socket.transport.name
+
+ // TODO(vojta): make resultsBufferLimit configurable
+ if (currentTransport === 'websocket' || currentTransport === 'flashsocket') {
+ resultsBufferLimit = 1
+ } else {
+ resultsBufferLimit = 50
+ }
+
+ socket.emit('register', {
+ name: navigator.userAgent,
+ id: browserId
+ })
+ })
+}
+
+module.exports = Karma
+
+},{"./constants":1,"./stringify":4,"./util":6}],3:[function(require,module,exports){
+/* global io */
+/* eslint-disable no-new */
+
+var Karma = require('./karma')
+var StatusUpdater = require('./updater')
+var util = require('./util')
+
+var KARMA_URL_ROOT = require('./constants').KARMA_URL_ROOT
+
+// connect socket.io
+// https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO
+var socket = io.connect(location.protocol + '//' + location.host, {
+ 'reconnection delay': 500,
+ 'reconnection limit': 2000,
+ 'resource': KARMA_URL_ROOT.substr(1) + 'socket.io',
+ 'sync disconnect on unload': true,
+ 'max reconnection attempts': Infinity
+})
+
+// instantiate the updater of the view
+new StatusUpdater(socket, util.elm('title'), util.elm('banner'), util.elm('browsers'))
+window.karma = new Karma(socket, util.elm('context'), window.open,
+ window.navigator, window.location)
+
+},{"./constants":1,"./karma":2,"./updater":5,"./util":6}],4:[function(require,module,exports){
+var instanceOf = require('./util').instanceOf
+
+var stringify = function stringify (obj, depth) {
+ if (depth === 0) {
+ return '...'
+ }
+
+ if (obj === null) {
+ return 'null'
+ }
+
+ switch (typeof obj) {
+ case 'string':
+ return "'" + obj + "'"
+ case 'undefined':
+ return 'undefined'
+ case 'function':
+ return obj.toString().replace(/\{[\s\S]*\}/, '{ ... }')
+ case 'boolean':
+ return obj ? 'true' : 'false'
+ case 'object':
+ var strs = []
+ if (instanceOf(obj, 'Array')) {
+ strs.push('[')
+ for (var i = 0, ii = obj.length; i < ii; i++) {
+ if (i) {
+ strs.push(', ')
+ }
+ strs.push(stringify(obj[i], depth - 1))
+ }
+ strs.push(']')
+ } else if (instanceOf(obj, 'Date')) {
+ return obj.toString()
+ } else if (instanceOf(obj, 'Text')) {
+ return obj.nodeValue
+ } else if (instanceOf(obj, 'Comment')) {
+ return '<!--' + obj.nodeValue + '-->'
+ } else if (obj.outerHTML) {
+ return obj.outerHTML
+ } else {
+ var constructor = 'Object'
+ if (obj.constructor && typeof obj.constructor === 'function') {
+ constructor = obj.constructor.name
+ }
+
+ strs.push(constructor)
+ strs.push('{')
+ var first = true
+ for (var key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ if (first) {
+ first = false
+ } else {
+ strs.push(', ')
+ }
+
+ strs.push(key + ': ' + stringify(obj[key], depth - 1))
+ }
+ }
+ strs.push('}')
+ }
+ return strs.join('')
+ default:
+ return obj
+ }
+}
+
+module.exports = stringify
+
+},{"./util":6}],5:[function(require,module,exports){
+var VERSION = require('./constants').VERSION
+
+var StatusUpdater = function (socket, titleElement, bannerElement, browsersElement) {
+ var updateBrowsersInfo = function (browsers) {
+ var items = [], status
+ for (var i = 0; i < browsers.length; i++) {
+ status = browsers[i].isReady ? 'idle' : 'executing'
+ items.push('<li class="' + status + '">' + browsers[i].name + ' is ' + status + '</li>')
+ }
+ browsersElement.innerHTML = items.join('\n')
+ }
+
+ var updateBanner = function (status) {
+ return function (param) {
+ var paramStatus = param ? status.replace('$', param) : status
+ titleElement.innerHTML = 'Karma v' + VERSION + ' - ' + paramStatus
+ bannerElement.className = status === 'connected' ? 'online' : 'offline'
+ }
+ }
+
+ socket.on('connect', updateBanner('connected'))
+ socket.on('disconnect', updateBanner('disconnected'))
+ socket.on('reconnecting', updateBanner('reconnecting in $ ms...'))
+ socket.on('reconnect', updateBanner('connected'))
+ socket.on('reconnect_failed', updateBanner('failed to reconnect'))
+ socket.on('info', updateBrowsersInfo)
+ socket.on('disconnect', function () {
+ updateBrowsersInfo([])
+ })
+}
+
+module.exports = StatusUpdater
+
+},{"./constants":1}],6:[function(require,module,exports){
+exports.instanceOf = function (value, constructorName) {
+ return Object.prototype.toString.apply(value) === '[object ' + constructorName + ']'
+}
+
+exports.elm = function (id) {
+ return document.getElementById(id)
+}
+
+exports.generateId = function (prefix) {
+ return prefix + Math.floor(Math.random() * 10000)
+}
+
+exports.isUndefined = function (value) {
+ return typeof value === 'undefined'
+}
+
+exports.isDefined = function (value) {
+ return !exports.isUndefined(value)
+}
+
+exports.parseQueryParams = function (locationSearch) {
+ var params = {}
+ var pairs = locationSearch.substr(1).split('&')
+ var keyValue
+
+ for (var i = 0; i < pairs.length; i++) {
+ keyValue = pairs[i].split('=')
+ params[decodeURIComponent(keyValue[0])] = decodeURIComponent(keyValue[1])
+ }
+
+ return params
+}
+
+},{}]},{},[3]);
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/wallaby.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/wallaby.js
new file mode 100644
index 00000000..209ff7f6
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma/wallaby.js
@@ -0,0 +1,49 @@
+module.exports = function () {
+ return {
+ files: [
+ {
+ pattern: 'package.json',
+ instrument: false
+ },
+ {
+ pattern: 'config.tpl.js',
+ instrument: false
+ },
+ 'lib/**/*.js',
+ 'test/unit/**/*.js',
+ 'test/unit/mocha-globals.coffee'
+ ],
+
+ tests: [
+ 'test/unit/**/*.spec.coffee'
+ ],
+
+ bootstrap: function (w) {
+ var path = require('path');
+ var mocha = w.testFramework;
+
+ mocha.suite.on('pre-require', function () {
+
+ // always passing wallaby.js globals to mocks.loadFile
+ var mocks = require('mocks');
+ var loadFile = mocks.loadFile;
+ mocks.loadFile = function (filePath, mocks, globals, mockNested) {
+ mocks = mocks || {};
+ globals = globals || {};
+ globals.$_$wp = global.$_$wp;
+ globals.$_$w = global.$_$w;
+ globals.$_$wf = global.$_$wf;
+ globals.$_$tracer = global.$_$tracer;
+ return loadFile(filePath, mocks, globals, mockNested);
+ };
+
+ // loading mocha-globals for each run
+ require(path.join(process.cwd(), 'test/unit/mocha-globals'));
+ });
+ },
+
+ env: {
+ type: 'node'
+ }
+ };
+}; \ No newline at end of file