Skip to content

Commit

Permalink
arangoexport: added test for xgmml, node module xmldom
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoeter committed Feb 28, 2017
1 parent 705273b commit a0256af
Show file tree
Hide file tree
Showing 14 changed files with 2,575 additions and 10 deletions.
13 changes: 9 additions & 4 deletions LICENSES-OTHER-COMPONENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,21 @@
* GitHub: https://github.com/jshttp/type-is
* License: [MIT License](https://github.com/jshttp/type-is/blob/master/LICENSE)

#### underscore

* Project Home: http://underscorejs.org
* GitHub: https://github.com/jashkenas/underscore
* License: [MIT-style License](https://github.com/jashkenas/underscore/blob/master/LICENSE)

#### vary

* GitHub: https://github.com/jshttp/vary
* License: [MIT License](https://github.com/jshttp/vary/blob/master/LICENSE)

#### underscore
#### xmldom

* Project Home: http://underscorejs.org
* GitHub: https://github.com/jashkenas/underscore
* License: [MIT-style License](https://github.com/jashkenas/underscore/blob/master/LICENSE)
* GitHub: https://github.com/jindw/xmldom
* License: [MIT License](https://github.com/jindw/xmldom/blob/master/LICENSE)

### Frontend libraries

Expand Down
19 changes: 14 additions & 5 deletions js/client/modules/@arangodb/testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ const optionsDefaults = {
const _ = require('lodash');
const fs = require('fs');
const yaml = require('js-yaml');
const xmldom = require('xmldom');

const base64Encode = require('internal').base64Encode;
const download = require('internal').download;
Expand Down Expand Up @@ -2904,6 +2905,10 @@ testFuncs.dump = function (options) {
testFuncs.export = function (options) {
const cluster = options.cluster ? '-cluster' : '';
const tmpPath = fs.getTempPath();
const DOMParser = new xmldom.DOMParser({locator: {}, errorHandler: {
warning: function(err) { xmlErrors = err; }, error: function(err) { xmlErrors = err; }, fatalError: function(err) { xmlErrors = err; }
}});
let xmlErrors = undefined;

print(CYAN + 'export tests...' + RESET);

Expand Down Expand Up @@ -2972,13 +2977,17 @@ testFuncs.export = function (options) {
print(CYAN + Date() + ': Export data (xgmml)' + RESET);
args['type'] = 'xgmml';
args['graph-name'] = 'UnitTestsExport';
results.exportJsonl = executeAndWait(ARANGOEXPORT_BIN, toArgv(args), options);
results.exportXgmml = executeAndWait(ARANGOEXPORT_BIN, toArgv(args), options);
try {
const filesContent = fs.read(fs.join(tmpPath, 'UnitTestsExport.xgmml')).split('\n');
// validate xml need npm module for that, in progress
// results.parseJsonl = { status: true };
const filesContent = fs.read(fs.join(tmpPath, 'UnitTestsExport.xgmml'));
DOMParser.parseFromString(filesContent);
results.parseXgmml = { status: true };

if (xmlErrors !== undefined) {
results.parseXgmml = { status: false, message: xmlErrors };
}
} catch(e) {
results.parseJsonl = {status: false, message: e };
results.parseXgmml = {status: false, message: e };
}

return shutdown();
Expand Down
5 changes: 5 additions & 0 deletions js/node/node_modules/xmldom/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions js/node/node_modules/xmldom/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions js/node/node_modules/xmldom/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions js/node/node_modules/xmldom/__package__.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions js/node/node_modules/xmldom/changelog

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions js/node/node_modules/xmldom/component.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

251 changes: 251 additions & 0 deletions js/node/node_modules/xmldom/dom-parser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a0256af

Please sign in to comment.