1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Michael Hackstein 2014-02-01 09:47:28 +01:00
commit 0ee6183d3d
40 changed files with 274 additions and 139 deletions

View File

@ -447,16 +447,18 @@ bool RestDocumentHandler::readDocument () {
/// @RESTRETURNCODE{200}
/// is returned if the document was found
///
/// @RESTRETURNCODE{404}
/// is returned if the document or collection was not found
///
/// @RESTRETURNCODE{304}
/// is returned if the "If-None-Match" header is given and the document has
/// the same version
///
/// @RESTRETURNCODE{404}
/// is returned if the document or collection was not found
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///
/// @EXAMPLES
///
@ -773,7 +775,9 @@ bool RestDocumentHandler::readAllDocuments () {
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///
/// @EXAMPLES
///
@ -922,7 +926,9 @@ bool RestDocumentHandler::checkDocument () {
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///
/// @EXAMPLES
///
@ -1114,7 +1120,9 @@ bool RestDocumentHandler::replaceDocument () {
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///
/// @EXAMPLES
///
@ -1378,8 +1386,10 @@ bool RestDocumentHandler::modifyDocument (bool isPatch) {
/// The response body contains an error document in this case.
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the current
/// document has a different version
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///
/// @EXAMPLES
///

View File

@ -357,16 +357,18 @@ bool RestEdgeHandler::createDocument () {
/// @RESTRETURNCODE{200}
/// is returned if the edge was found
///
/// @RESTRETURNCODE{404}
/// is returned if the edge or collection was not found
///
/// @RESTRETURNCODE{304}
/// is returned if the "If-None-Match" header is given and the edge has
/// the same version
///
/// @RESTRETURNCODE{404}
/// is returned if the edge or collection was not found
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found
/// edge has a different version
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@ -424,16 +426,18 @@ bool RestEdgeHandler::createDocument () {
/// @RESTRETURNCODE{200}
/// is returned if the edge document was found
///
/// @RESTRETURNCODE{404}
/// is returned if the edge document or collection was not found
///
/// @RESTRETURNCODE{304}
/// is returned if the "If-None-Match" header is given and the edge document has
/// same version
///
/// @RESTRETURNCODE{404}
/// is returned if the edge document or collection was not found
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found edge
/// document has a different version
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@ -555,8 +559,10 @@ bool RestEdgeHandler::createDocument () {
/// is returned if the collection or the edge document was not found
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found edge
/// document has a different version
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
///////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@ -655,8 +661,10 @@ bool RestEdgeHandler::createDocument () {
/// is returned if the collection or the edge document was not found
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the found edge
/// document has a different version
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
@ -716,8 +724,10 @@ bool RestEdgeHandler::createDocument () {
/// The response body contains an error document in this case.
///
/// @RESTRETURNCODE{412}
/// is returned if a "If-Match" header or `rev` is given and the current edge
/// document has a different version
/// is returned if a "If-Match" header or `rev` is given and the found
/// document has a different version. The response will also contain the found
/// document's current revision in the `_rev` attribute. Additionally, the
/// attributes `_id` and `_key` will be returned.
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

View File

@ -50,10 +50,13 @@ JAVASCRIPT_JSLINT = \
`find @srcdir@/js/common/modules/org -name "*.js"` \
`find @srcdir@/js/client/modules -name "*.js"` \
`find @srcdir@/js/server/modules -name "*.js"` \
`find @srcdir@/js/client/tests -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/models -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/views -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/collections -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/routers -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/arango -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/shell -name "*.js"` \
\
@srcdir@/js/client/client.js \
@srcdir@/js/server/server.js \

View File

@ -3,6 +3,40 @@
(function() {
"use strict";
window.versionHelper = {
fromString: function (s) {
var parts = s.replace(/-[a-zA-Z0-9_\-]*$/g, '').split('.');
return {
major: parseInt(parts[0], 10) || 0,
minor: parseInt(parts[1], 10) || 0,
patch: parseInt(parts[2], 10) || 0
};
},
toString: function (v) {
return v.major + '.' + v.minor + '.' + v.patch;
},
toStringMainLine: function (v) {
return v.major + '.' + v.minor;
},
compareVersions: function (l, r) {
if (l.major === r.major) {
if (l.minor === r.minor) {
if (l.patch === r.patch) {
return 0;
}
return l.patch - r.patch;
}
return l.minor - r.minor;
}
return l.major - r.major;
},
compareVersionStrings: function (l, r) {
l = window.versionHelper.fromString(l);
r = window.versionHelper.fromString(r);
return window.versionHelper.compareVersions(l, r);
}
};
window.arangoHelper = {
lastNotificationMessage: null,
@ -71,12 +105,12 @@
$.gritter.removeAll();
this.lastNotificationMessage = null;
},
arangoNotification: function (message) {
arangoNotification: function (message, time) {
var returnVal = false;
$.gritter.add({
title: "Notice:",
text: message,
time: 3000,
time: time || 3000,
before_open: function(){
returnVal = true;
}

View File

@ -76,6 +76,8 @@
collection: window.arangoCollectionsStore
});
// this.initVersionCheck();
var self = this;
$(window).resize(function() {
self.handleResize();
@ -83,6 +85,97 @@
this.handleResize();
},
/*
initVersionCheck: function () {
// this checks for version updates
var self = this;
var versionCheck = function () {
$.ajax({
async: true,
crossDomain: true,
dataType: "jsonp",
url: "https://www.arangodb.org/repositories/versions.php?callback=parseVersions",
success: function (json) {
if (typeof json !== 'object') {
return;
}
// turn our own version string into a version object
var currentVersion = window.versionHelper.fromString(self.footerView.system.version);
// get our mainline version
var mainLine = window.versionHelper.toStringMainLine(currentVersion);
var mainLines = Object.keys(json).sort(window.versionHelper.compareVersionStrings);
var latestMainLine;
mainLines.forEach(function (l) {
if (json[l].stable) {
if (window.versionHelper.compareVersionStrings(l, mainLine) > 0) {
latestMainLine = json[l];
}
}
});
var update;
if (latestMainLine !== undefined &&
Object.keys(latestMainLine.versions.length > 0) {
var mainLineVersions = Object.keys(latestMainLine.versions);
mainLineVersions = mainLineVersions.sort(window.versionHelper.compareVersionStrings);
var latest = mainLineVersions[mainLineVersions.length - 1];
update = {
type: "major",
version: latest,
changes: latestMainLine.versions[latest].changes
};
}
// check which stable mainline versions are available remotely
if (update === undefined &&
json.hasOwnProperty(mainLine) &&
json[mainLine].stable &&
json[mainLine].hasOwnProperty("versions") &&
Object.keys(json[mainLine].versions).length > 0) {
// sort by version numbers
var mainLineVersions = Object.keys(json[mainLine].versions);
mainLineVersions = mainLineVersions.sort(window.versionHelper.compareVersionStrings);
var latest = mainLineVersions[mainLineVersions.length - 1];
var result = window.versionHelper.compareVersions(
currentVersion,
window.versionHelper.fromString(latest)
);
if (result < 0) {
update = {
type: "minor",
version: latest,
changes: json[mainLine].versions[latest].changes
};
}
}
if (update !== undefined) {
var msg = "A newer version of ArangoDB (" + update.version +
") has become available. You may want to check the " +
"changelog at <a href=\"" + update.changes + "\">" +
update.changes + "</a>";
arangoHelper.arangoNotification(msg, 15000);
}
},
error: function () {
// re-schedule the version check
window.setTimeout(versionCheck, 60000);
}
});
};
window.setTimeout(versionCheck, 5000);
},
*/
logsAllowed: function () {
return (window.databaseName === '_system');
},

View File

@ -1,3 +1,8 @@
/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */
/*global require, assertEqual, assertNotEqual,
print, print_plain, COMPARE_STRING, NORMALIZE_STRING,
help, start_pager, stop_pager, start_pretty_print, stop_pretty_print, start_color_print, stop_color_print */
////////////////////////////////////////////////////////////////////////////////
/// @brief tests for client-specific functionality
///
@ -25,6 +30,8 @@
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
(function () {
var jsunity = require("jsunity");
var db = require("org/arangodb").db;
@ -153,8 +160,8 @@ function clientTestSuite () {
////////////////////////////////////////////////////////////////////////////////
testICU_Compare : function () {
nfc = "Gr\u00FC\u00DF Gott.";
nfd = "Gru\u0308\u00DF Gott.";
var nfc = "Gr\u00FC\u00DF Gott.";
var nfd = "Gru\u0308\u00DF Gott.";
assertNotEqual(nfc, nfd);
assertNotEqual(COMPARE_STRING(nfc, nfd), true);
@ -165,8 +172,8 @@ function clientTestSuite () {
////////////////////////////////////////////////////////////////////////////////
testICU_Normalize : function () {
nfc = "Gr\u00FC\u00DF Gott.";
nfd = "Gru\u0308\u00DF Gott.";
var nfc = "Gr\u00FC\u00DF Gott.";
var nfd = "Gru\u0308\u00DF Gott.";
assertNotEqual(nfc, nfd);
assertEqual(NORMALIZE_STRING(nfd), nfc);
@ -179,15 +186,15 @@ function clientTestSuite () {
testICU_Compare_Skiplist_Sorting : function () {
db._create("ICU_SORTED");
db["ICU_SORTED"].ensureSkiplist("test");
db["ICU_SORTED"].save({ test : "äää" });
db["ICU_SORTED"].save({ test : "aaa" });
db["ICU_SORTED"].save({ test : "aab" });
db["ICU_SORTED"].save({ test : "äaa" });
db["ICU_SORTED"].save({ test : "äää" });
db["ICU_SORTED"].save({ test : "Aaa" });
db.ICU_SORTED.ensureSkiplist("test");
db.ICU_SORTED.save({ test : "äää" });
db.ICU_SORTED.save({ test : "aaa" });
db.ICU_SORTED.save({ test : "aab" });
db.ICU_SORTED.save({ test : "äaa" });
db.ICU_SORTED.save({ test : "äää" });
db.ICU_SORTED.save({ test : "Aaa" });
var y = db["ICU_SORTED"].range("test", "A", "z") ;
var y = db.ICU_SORTED.range("test", "A", "z") ;
assertEqual(y.next().test, "Aaa");
assertEqual(y.next().test, "aaa");
@ -208,6 +215,8 @@ jsunity.run(clientTestSuite);
return jsunity.done();
}());
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"

View File

@ -1,5 +1,8 @@
/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */
/*global require, fail, assertTrue */
////////////////////////////////////////////////////////////////////////////////
/// @brief test the foxx manager
/// @brief test the authentication
///
/// @file
///
@ -25,6 +28,7 @@
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
(function () {
var jsunity = require("jsunity");
var arango = require("org/arangodb").arango;
var db = require("internal").db;
@ -241,9 +245,9 @@ function AuthSuite () {
jsunity.run(AuthSuite);
return jsunity.done();
}());
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"
// End:

View File

@ -1,3 +1,6 @@
/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */
/*global require, fail, assertTrue, assertEqual */
////////////////////////////////////////////////////////////////////////////////
/// @brief test the endpoints
///
@ -25,6 +28,8 @@
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
(function () {
var jsunity = require("jsunity");
var arangodb = require("org/arangodb");
var arango = arangodb.arango;
@ -166,7 +171,7 @@ function EndpointsSuite () {
fail();
}
catch (err1) {
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err1.errorNum)
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err1.errorNum);
}
try {
@ -175,7 +180,7 @@ function EndpointsSuite () {
fail();
}
catch (err2) {
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err2.errorNum)
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err2.errorNum);
}
try {
@ -184,7 +189,7 @@ function EndpointsSuite () {
fail();
}
catch (err3) {
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err3.errorNum)
assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err3.errorNum);
}
},
@ -257,7 +262,7 @@ function EndpointsSuite () {
var base = 30000 + parseInt(Math.random() * 10000, 10);
// create a few endpoints
db._configureEndpoint("tcp://127.0.0.1:" + (base + 0), [ ]);
db._configureEndpoint("tcp://127.0.0.1:" + (base), [ ]);
db._configureEndpoint("tcp://127.0.0.1:" + (base + 1), [ "UnitTestsDatabase0" ]);
db._configureEndpoint("tcp://127.0.0.1:" + (base + 2), [ "UnitTestsDatabase1" ]);
db._configureEndpoint("tcp://127.0.0.1:" + (base + 3), [ "UnitTestsDatabase0", "UnitTestsDatabase1" ]);
@ -290,7 +295,7 @@ function EndpointsSuite () {
[ "UnitTestsDatabase1", "UnitTestsDatabase1" ]
];
test("tcp://127.0.0.1:" + (base + 0), endpoints);
test("tcp://127.0.0.1:" + (base), endpoints);
endpoints = [
[ "", "UnitTestsDatabase0" ],
@ -354,7 +359,7 @@ function EndpointsSuite () {
fail();
}
catch (err2) {
assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err2.errorNum)
assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err2.errorNum);
}
// _configureEndpoint is forbidden
@ -364,7 +369,7 @@ function EndpointsSuite () {
fail();
}
catch (err3) {
assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err3.errorNum)
assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err3.errorNum);
}
}
@ -382,6 +387,7 @@ function EndpointsSuite () {
jsunity.run(EndpointsSuite);
return jsunity.done();
}());
// Local Variables:
// mode: outline-minor

View File

@ -1,3 +1,6 @@
/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */
/*global require, fail, assertTrue, assertFalse, assertEqual, assertMatch, assertNotNull */
////////////////////////////////////////////////////////////////////////////////
/// @brief test the foxx manager
///
@ -25,6 +28,7 @@
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
(function () {
var jsunity = require("jsunity");
var fm = require("org/arangodb/foxx/manager");
var arango = require("org/arangodb").arango;
@ -119,8 +123,8 @@ function FoxxManagerSuite () {
assertTrue(entry.hasOwnProperty("description"));
assertTrue(entry.hasOwnProperty("version"));
assertTrue(entry.hasOwnProperty("path"));
return;
}
return;
}
fail();
@ -185,7 +189,7 @@ function FoxxManagerSuite () {
assertTrue(entry.hasOwnProperty("author"));
assertTrue(entry.hasOwnProperty("versions"));
versions = entry.versions;
var version;
for (version in entry.versions) {
if (entry.versions.hasOwnProperty(version)) {
@ -302,7 +306,7 @@ function FoxxManagerSuite () {
try {
fm.uninstall("/itz");
}
catch (err) {
catch (err1) {
}
try {
@ -310,7 +314,7 @@ function FoxxManagerSuite () {
fm.uninstall("/itz");
fail();
}
catch (err) {
catch (err2) {
}
},
@ -361,7 +365,7 @@ function FoxxManagerSuite () {
try {
fm.uninstall("/itz");
}
catch (err) {
catch (err1) {
}
try {
@ -369,7 +373,7 @@ function FoxxManagerSuite () {
fm.unmount("/itz");
fail();
}
catch (err) {
catch (err2) {
}
},
@ -408,6 +412,8 @@ jsunity.run(FoxxManagerSuite);
return jsunity.done();
}());
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"

View File

@ -89,7 +89,7 @@ function CollectionVolatileSuite () {
testCreationError : function () {
try {
// cannot set isVolatile and waitForSync at the same time
var c = internal.db._create(cn, { isVolatile : true, waitForSync : true });
internal.db._create(cn, { isVolatile : true, waitForSync : true });
fail();
}
catch (err) {

View File

@ -870,7 +870,7 @@ function CollectionSuite () {
db._drop(cn1);
db._drop(cn2);
var c1 = db._create(cn1);
var c2 = db._create(cn2);
db._create(cn2);
try {
c1.rename(cn2);
@ -1506,8 +1506,8 @@ function CollectionDbSuite () {
db._drop(cn1);
db._drop(cn2);
var c1 = db._createDocumentCollection(cn1);
var c2 = db._createEdgeCollection(cn2);
db._createDocumentCollection(cn1);
db._createEdgeCollection(cn2);
var collections = db._collections();
for (var i in collections) {

View File

@ -133,7 +133,7 @@ function DownloadSuite () {
////////////////////////////////////////////////////////////////////////////////
testGetErrorNoReturn : function () {
var result, response = internal.download(buildUrl("?foo=1&bar=baz&code=404"), undefined, { }, tempName );
var response = internal.download(buildUrl("?foo=1&bar=baz&code=404"), undefined, { }, tempName );
assertEqual(404, response.code);
@ -287,7 +287,7 @@ function DownloadSuite () {
////////////////////////////////////////////////////////////////////////////////
testHead : function () {
var result, response = internal.download(buildUrl(""), undefined, { method: "head" });
var response = internal.download(buildUrl(""), undefined, { method: "head" });
assertEqual(200, response.code);

View File

@ -28,7 +28,6 @@
var jsunity = require("jsunity");
var fs = require("fs");
var internal = require("internal");
// -----------------------------------------------------------------------------
// --SECTION-- filesystem

View File

@ -32,8 +32,6 @@ var jsunity = require("jsunity");
var console = require("console");
var Helper = require("org/arangodb/test-helper").Helper;
// -----------------------------------------------------------------------------
// --SECTION-- collection methods
// -----------------------------------------------------------------------------

View File

@ -37,7 +37,6 @@
////////////////////////////////////////////////////////////////////////////////
var jsunity = require("jsunity"),
Helper = require("org/arangodb/test-helper").Helper,
console = require("console");
// -----------------------------------------------------------------------------

View File

@ -75,10 +75,10 @@ function GraphTraversalSuite () {
var v2 = g.addVertex("v2");
var v3 = g.addVertex("v3");
var v4 = g.addVertex("v4");
var e1 = g.addEdge(v1, v2, "v1v2");
var e3 = g.addEdge(v2, v3, "v2v3");
var e4 = g.addEdge(v1, v4, "v1v4");
var e5 = g.addEdge(v4, v3, "v4v3");
g.addEdge(v1, v2, "v1v2");
g.addEdge(v2, v3, "v2v3");
g.addEdge(v1, v4, "v1v4");
g.addEdge(v4, v3, "v4v3");
},
////////////////////////////////////////////////////////////////////////////////

View File

@ -30,7 +30,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var console = require("console");
var errors = internal.errors;
// -----------------------------------------------------------------------------
@ -158,15 +157,15 @@ function HashIndexSuite() {
var d1 = collection.save({ a : 1, b : 1 })._id;
var d2 = collection.save({ a : 2, b : 1 })._id;
var d3 = collection.save({ a : 3, b : 1 })._id;
var d4 = collection.save({ a : 4, b : 1 })._id;
var d5 = collection.save({ a : 4, b : 2 })._id;
collection.save({ a : 3, b : 1 })._id;
collection.save({ a : 4, b : 1 })._id;
collection.save({ a : 4, b : 2 })._id;
var d6 = collection.save({ a : 1, b : 1 })._id;
var d7 = collection.save({ a : 1 })._id;
var d8 = collection.save({ a : 1 })._id;
var d9 = collection.save({ a : null, b : 1 })._id;
var d10 = collection.save({ a : null, b : 1 })._id;
collection.save({ a : null, b : 1 })._id;
collection.save({ a : null, b : 1 })._id;
var d11 = collection.save({ c : 1 })._id;
var d12 = collection.save({ c : 1 })._id;
@ -214,9 +213,9 @@ function HashIndexSuite() {
testReadDocumentsUnloaded : function () {
var idx = collection.ensureHashIndex("a");
var d1 = collection.save({ a : 1, b : 1 })._id;
collection.save({ a : 1, b : 1 })._id;
var d2 = collection.save({ a : 2, b : 1 })._id;
var d3 = collection.save({ a : 3, b : 1 })._id;
collection.save({ a : 3, b : 1 })._id;
collection.unload();
internal.wait(4);

View File

@ -549,7 +549,7 @@ function GeoIndexErrorHandlingSuite() {
var d2 = collection.save({ loc : null });
var d3 = collection.save({ loc : [0] });
var d4 = collection.save({ loc : [ -100, -200 ] });
var d5 = collection.save({ loc : [ -10, -20 ]});
collection.save({ loc : [ -10, -20 ]});
assertEqual(1, collection.near(0,0).toArray().length);

View File

@ -175,7 +175,7 @@ function indexSuite() {
testGetNonExistingIndexes : function () {
[ "2444334000000", "9999999999999" ].forEach(function (id) {
try {
var idx = collection.index(id);
collection.index(id);
fail();
}
catch (err) {

View File

@ -73,7 +73,7 @@ function StatementSuite () {
testConstructNoQuery : function () {
try {
var st = new ArangoStatement(db);
new ArangoStatement(db);
fail();
}
catch (e) {
@ -396,8 +396,8 @@ function StatementSuite () {
var st = new ArangoStatement(db, { query : "for u in [ 1 ] return @value" });
st.bind("list", [ 1, 2, 3 ]);
try {
var result = st.execute();
assertFalse(true);
st.execute();
fail();
}
catch (e) {
assertEqual(1551, e.errorNum);
@ -413,7 +413,7 @@ function StatementSuite () {
st.bind("value", 1);
try {
st.bind("value", 1);
assertFalse(true);
fail();
}
catch (e) {
}

View File

@ -162,10 +162,10 @@ function UniqueConstraintSuite() {
assertEqual(true, idx.isNewlyCreated);
var d1 = collection.save({ a : 1, b : 1 })._id;
var d2 = collection.save({ a : 2, b : 1 })._id;
var d3 = collection.save({ a : 3, b : 1 })._id;
var d4 = collection.save({ a : 4, b : 1 })._id;
var d5 = collection.save({ a : 4, b : 2 })._id;
collection.save({ a : 2, b : 1 })._id;
collection.save({ a : 3, b : 1 })._id;
collection.save({ a : 4, b : 1 })._id;
collection.save({ a : 4, b : 2 })._id;
collection.save({ a : 1 });
collection.save({ a : 1 });

View File

@ -29,7 +29,6 @@
////////////////////////////////////////////////////////////////////////////////
var jsunity = require("jsunity");
var arangodb = require("org/arangodb");
var internal = require("internal");
// -----------------------------------------------------------------------------

View File

@ -134,8 +134,8 @@ function ahuacatlCrossCollection () {
var d1 = vertex1.save({ _key: "test1", a: 1 });
var d2 = vertex1.save({ _key: "test2", a: 2 });
var d3 = vertex2.save({ _key: "test3", a: 3 });
var e1 = edge.save(d1._id, d2._id, { });
var e2 = edge.save(d2._id, d3._id, { });
edge.save(d1._id, d2._id, { });
edge.save(d2._id, d3._id, { });
var actual = getQueryResults("FOR t IN TRAVERSAL(" + vn1 + ", " + en + ", " + JSON.stringify(d1._id) + ", 'outbound', { }) RETURN t");
assertEqual(3, actual.length);
@ -153,8 +153,8 @@ function ahuacatlCrossCollection () {
var d1 = vertex1.save({ _key: "test1", a: 1 });
var d2 = vertex2.save({ _key: "test2", a: 2 });
var d3 = vertex2.save({ _key: "test3", a: 3 });
var e1 = edge.save(d1._id, d2._id, { });
var e2 = edge.save(d2._id, d3._id, { });
edge.save(d1._id, d2._id, { });
edge.save(d2._id, d3._id, { });
var actual = getQueryResults("FOR t IN TRAVERSAL(" + vn1 + ", " + en + ", " + JSON.stringify(d2._id) + ", 'outbound', { }) RETURN t");
assertEqual(2, actual.length);

View File

@ -1179,7 +1179,7 @@ function ahuacatlFunctionsTestSuite () {
////////////////////////////////////////////////////////////////////////////////
testKeep : function () {
var actual, expected;
var actual;
actual = getQueryResults("FOR i IN [ { }, { foo: 1, bar: 2, moo: 3, goof: 4, bang: 5, meow: 6 }, { foo: 0, goof: 1, meow: 2 }, { foo: null }, { foo: true }, { goof: null } ] RETURN KEEP(i, 'foo', 'bar', 'baz', [ 'meow' ], [ ])");
assertEqual([ { }, { bar: 2, foo: 1, meow: 6 }, { foo: 0, meow: 2 }, { foo: null }, { foo: true }, { } ], actual);
@ -1993,7 +1993,7 @@ function ahuacatlFunctionsTestSuite () {
actual = getQueryResults("RETURN DOCUMENT(CONCAT(\"" + cn + "\", \"bart\"))");
assertEqual([ null ], actual);
var d3 = cx.save({ _key: "foo", value: "bar" });
cx.save({ _key: "foo", value: "bar" });
expected = [ { value: "bar" } ];
actual = getQueryResults("RETURN DOCUMENT(CONCAT(\"" + cn + "\", \"foo\"))");
assertEqual([ null ], actual);
@ -2112,7 +2112,7 @@ function ahuacatlFunctionsTestSuite () {
var cn = "UnitTestsAhuacatlFunctions";
internal.db._drop(cn);
var cx = internal.db._create(cn);
internal.db._create(cn);
var expected, actual;

View File

@ -30,7 +30,6 @@ var jsunity = require("jsunity");
var helper = require("org/arangodb/aql-helper");
var getQueryResults = helper.getQueryResults;
var getQueryExplanation = helper.getQueryExplanation;
var errors = internal.errors;
////////////////////////////////////////////////////////////////////////////////
/// @brief test suite

View File

@ -36,7 +36,6 @@ var getQueryExplanation = helper.getQueryExplanation;
////////////////////////////////////////////////////////////////////////////////
function ahuacatlSkiplistTestSuite () {
var errors = internal.errors;
var skiplist;
return {

View File

@ -37,8 +37,6 @@ var internal = require("internal");
////////////////////////////////////////////////////////////////////////////////
function CompactionSuite () {
var ERRORS = require("internal").errors;
return {
////////////////////////////////////////////////////////////////////////////////

View File

@ -81,7 +81,6 @@ function ReplicationSuite () {
var masterState = replication.logger.state();
assertTrue(masterState.state.running);
var lastTick = masterState.state.lastLogTick;
replication.logger.stop();
masterState = replication.logger.state();
@ -183,7 +182,7 @@ function ReplicationSuite () {
};
try {
replication.applier.properties();
replication.applier.properties(configuration);
}
catch (err) {
require("internal").print(err);
@ -203,7 +202,7 @@ function ReplicationSuite () {
};
try {
replication.applier.properties();
replication.applier.properties(configuration);
}
catch (err) {
assertEqual(errors.ERROR_HTTP_UNAUTHORIZED.code, err.errorNum);
@ -222,7 +221,7 @@ function ReplicationSuite () {
};
try {
replication.applier.properties();
replication.applier.properties(configuration);
}
catch (err) {
assertEqual(errors.ERROR_HTTP_UNAUTHORIZED.code, err.errorNum);
@ -512,7 +511,7 @@ function ReplicationSuite () {
testTransaction3 : function () {
compare(
function (state) {
var c = db._create(cn), i;
db._create(cn);
db._executeTransaction({
collections: {
@ -546,7 +545,7 @@ function ReplicationSuite () {
testTransaction4 : function () {
compare(
function (state) {
var c = db._create(cn), i;
db._create(cn);
db._executeTransaction({
collections: {
@ -592,7 +591,7 @@ function ReplicationSuite () {
testTransactionBig : function () {
compare(
function (state) {
var c = db._create(cn), i;
db._create(cn);
db._executeTransaction({
collections: {

View File

@ -38,7 +38,6 @@ var jsunity = require("jsunity");
////////////////////////////////////////////////////////////////////////////////
function routingSuiteSingle () {
var errors = internal.errors;
var cn = "_routing";
return {

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////////////
/// @brief test the collection interface
/// @brief test the random document selector
///
/// @file
///
@ -28,7 +28,6 @@
var jsunity = require("jsunity");
var arangodb = require("org/arangodb");
var internal = require("internal");
var db = arangodb.db;
// -----------------------------------------------------------------------------

View File

@ -35,7 +35,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var console = require("console");
// -----------------------------------------------------------------------------
// --SECTION-- basic methods
@ -46,7 +45,6 @@ var console = require("console");
////////////////////////////////////////////////////////////////////////////////
function BitarrayIndexSuite() {
var ERRORS = internal.errors;
var cn = "UnitTestsCollectionBitarray";
var collection = null;

View File

@ -27,8 +27,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var arangodb = require("org/arangodb");
var ERRORS = arangodb.errors;
// -----------------------------------------------------------------------------
// --SECTION-- database methods

View File

@ -1,11 +1,9 @@
require("internal").flushModuleCache();
var jsunity = require("jsunity"),
arangodb = require("org/arangodb"),
db = arangodb.db;
var jsunity = require("jsunity");
function BaseMiddlewareSpec () {
var BaseMiddleware, request, response, options, next;
var request, response, options, next;
return {
setUp: function () {

View File

@ -51,7 +51,7 @@ function PreprocessSpec () {
// Low level Spec Suite for the Transform prototype
function PreprocessorSpec () {
var i, result, testFileWithSingleJSDoc, testFileWithJSDocAndMultiline, processedLineOne;
var i, testFileWithSingleJSDoc, testFileWithJSDocAndMultiline, processedLineOne;
return {
setUp: function () {

View File

@ -7,7 +7,6 @@ var jsunity = require("jsunity"),
stub_and_mock = require("org/arangodb/stub_and_mock"),
stub = stub_and_mock.stub,
allow = stub_and_mock.allow,
expect = stub_and_mock.expect,
mockConstructor = stub_and_mock.mockConstructor;
fakeContext = {
@ -343,9 +342,7 @@ function DocumentationAndConstraintsSpec () {
},
testAddBodyParam: function () {
var determinedName,
determinedType,
paramName = stub(),
var paramName = stub(),
description = stub(),
ModelPrototype = stub(),
jsonSchema = { id: 'a', required: [], properties: {} };
@ -366,9 +363,7 @@ function DocumentationAndConstraintsSpec () {
},
testDefineBodyParamAddsJSONSchemaToModels: function () {
var determinedName,
determinedType,
paramName = stub(),
var paramName = stub(),
description = stub(),
ModelPrototype = stub(),
jsonSchema = { id: 'a', required: [], properties: {} };

View File

@ -25,7 +25,6 @@
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
var console = require("console");
var internal = require("internal");
var jsunity = require("jsunity");

View File

@ -30,8 +30,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var console = require("console");
var errors = internal.errors;
// -----------------------------------------------------------------------------
// --SECTION-- basic methods
@ -42,7 +40,6 @@ var errors = internal.errors;
////////////////////////////////////////////////////////////////////////////////
function SkipListCorrSuite() {
var ERRORS = internal.errors;
var cn = "UnitTestsCollectionSkiplistCorr";
var coll = null;
var helper = require("org/arangodb/aql-helper");

View File

@ -30,8 +30,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var console = require("console");
var errors = internal.errors;
// -----------------------------------------------------------------------------
// --SECTION-- basic methods
@ -42,7 +40,6 @@ var errors = internal.errors;
////////////////////////////////////////////////////////////////////////////////
function SkipListSuite() {
var ERRORS = internal.errors;
var cn = "UnitTestsCollectionSkiplist";
var collection = null;

View File

@ -30,8 +30,6 @@
var jsunity = require("jsunity");
var internal = require("internal");
var console = require("console");
var errors = internal.errors;
// -----------------------------------------------------------------------------
// --SECTION-- basic methods
@ -42,7 +40,6 @@ var errors = internal.errors;
////////////////////////////////////////////////////////////////////////////////
function SkipListPerfSuite() {
var ERRORS = internal.errors;
var cn = "UnitTestsCollectionSkiplistPerf";
var collection = null;

View File

@ -151,8 +151,6 @@ function transactionInvocationSuite () {
////////////////////////////////////////////////////////////////////////////////
testReturnValues : function () {
var result;
var tests = [
{ expected: 1, trx: { collections: { }, action: function () { return 1; } } },
{ expected: undefined, trx: { collections: { }, action: function () { } } },
@ -2850,8 +2848,6 @@ function transactionCountSuite () {
write: [ cn1 ]
},
action : function () {
var d1;
c1.save({ _key: "baz" });
assertEqual(3, c1.count());
@ -2883,8 +2879,6 @@ function transactionCountSuite () {
write: [ cn1 ]
},
action : function () {
var d1;
c1.save({ _key: "baz" });
assertEqual(3, c1.count());