1
0
Fork 0

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

This commit is contained in:
Jan Steemann 2014-11-05 16:04:10 +01:00
commit a35cf09411
15 changed files with 384 additions and 215 deletions

View File

@ -2,7 +2,7 @@
The default installation directory is *c:\Program Files\ArangoDB-1.x.y*. During the
installation process you may change this. In the following description we will assume
that ArangoDB has been installed in the location *<ROOTDIR>*.
that ArangoDB has been installed in the location *&lt;ROOTDIR&gt;*.
You have to be careful when choosing an installation directory. You need either
write permission to this directory or you need to modify the config file for the
@ -10,17 +10,17 @@ server process. In the latter case the database directory and the Foxx directory
has to be writable by the user.
Installing for a single user: Select a different directory during
installation. For example *C:/Users/<username>/arangodb* or *C:/ArangoDB*.
installation. For example *c:\Users\&lt;Username&gt;\ArangoDB* or *c:\ArangoDB*.
Installing for multiple users: Keep the default directory. After the
installation edit the file *<ROOTDIR>/etc/arangodb/arangod.conf*. Adjust the
installation edit the file *&lt;ROOTDIR&gt;\etc\Arangodb\arangod.conf*. Adjust the
*directory* and *app-path* so that these paths point into your home directory.
[database]
directory = @HOMEDRIVE@/@HOMEPATH@/arangodb/databases
directory = @HOMEDRIVE@\@HOMEPATH@\arangodb\databases
[javascript]
app-path = @HOMEDRIVE@/@HOMEPATH@/arangodb/apps
app-path = @HOMEDRIVE@\@HOMEPATH@\arangodb\apps
Create the directories for each user that wants to use ArangoDB.
@ -28,16 +28,16 @@ Installing as Service: Keep the default directory. After the installation open
a command line as administrator (search for *cmd* and right click *run as
administrator*).
cmd> arangod --install-service
cmd&gt; arangod --install-service
INFO: adding service 'ArangoDB - the multi-purpose database' (internal 'ArangoDB')
INFO: added service with command line '"C:\Program Files (x86)\ArangoDB 1.4.4\bin\arangod.exe" --start-service'
Open the service manager and start ArangoDB. In order to enable logging
edit the file "<ROOTDIR>/etc/arangodb/arangod.conf" and uncomment the file
edit the file "<ROOTDIR>\etc\arangodb\arangod.conf" and uncomment the file
option.
[log]
file = @ROOTDIR@/var/log/arangodb/arangod.log
file = @ROOTDIR@\var\log\arangodb\arangod.log
!SUBSECTION Client, Server and Lock-Files
@ -51,9 +51,9 @@ not proceed correctly or if the server terminated unexpectedly.
!SUBSECTION Starting
To start an ArangoDB server instance with networking enabled, use the executable
*arangod.exe* located in *<ROOTDIR>/bin*. This will use the configuration
file *arangod.conf* located in *<ROOTDIR>/etc/arangodb*, which you can adjust
to your needs and use the data directory *<ROOTDIR>/var/lib/arangodb*. This
*arangod.exe* located in *&lt;ROOTDIR&gt;\bin*. This will use the configuration
file *arangod.conf* located in *&lt;ROOTDIR&gt;\etc\arangodb*, which you can adjust
to your needs and use the data directory *&lt;ROOTDIR&gt;\var\lib\arangodb*. This
is the place where all your data (databases and collections) will be stored
by default.
@ -85,7 +85,7 @@ containing the configuration files.
!SUBSECTION Using the Client
To connect to an already running ArangoDB server instance, there is a shell
*arangosh.exe* located in *<ROOTDIR>/bin*. This starts a shell which can be
*arangosh.exe* located in *&lt;ROOTDIR&gt;\bin*. This starts a shell which can be
used amongst other things to administer and query a local or remote
ArangoDB server.
@ -94,7 +94,7 @@ shell. To use it you must have a server running somewhere, e.g. by using
the *arangod.exe* executable.
*arangosh.exe* uses configuration from the file *arangosh.conf* located in
*<ROOTDIR>/etc/arangodb/*. Please adjust this to your needs if you want to
*&lt;ROOTDIR&gt;\etc\arangodb\*. Please adjust this to your needs if you want to
use different connection settings etc.
!SUBSECTION 32bit
@ -121,9 +121,9 @@ completed successfully.
To uninstall the Arango server application you can use the windows control panel
(as you would normally uninstall an application). Note however, that any data
files created by the Arango server will remain as well as the *<ROOTDIR>*
files created by the Arango server will remain as well as the *&lt;ROOTDIR&gt;*
directory. To complete the uninstallation process, remove the data files and
the *<ROOTDIR>* directory manually.
the *&lt;ROOTDIR&gt;* directory manually.
!SUBSECTION Limitations for Cygwin

View File

@ -40,6 +40,9 @@ var FoxxController = require("org/arangodb/foxx").Controller,
foxxInstallKey = joi.string().required().description(
"The _key attribute, where the information of this Foxx-Install is stored."
),
foxxMountPoint = joi.string().required().description(
"The mount point, where this Foxx is installed."
),
appname = joi.string().required();
var foxxes = new (require("lib/foxxes").Foxxes)();
@ -286,13 +289,17 @@ controller.get('/docus', function (req, res) {
*
*/
controller.get("/docu/:key",function (req, res) {
controller.get("/docu/:mount", function (req, res) {
require("console").log("Paul");
var subPath = req.path.substr(0, req.path.lastIndexOf("[") - 1),
key = req.params("key"),
path = req.protocol + "://" + req.headers.host +
"/_db/" + encodeURIComponent(req.database) + subPath + "/" + encodeURIComponent(key) + "/";
res.json(docus.listOne(path, key));
}).summary("List documentation of one foxxes.")
mount = req.params("mount"),
path = req.protocol + "://" + req.headers.host + "/_db/" + encodeURIComponent(req.database) + subPath + "/" + encodeURIComponent(mount) + "/";
require("console").log(docus.listOne(path, mount));
res.json(docus.listOne(path, mount));
}).pathParam("mount", {
type: foxxMountPoint,
allowMultiple: false
}).summary("List documentation of all foxxes.")
.notes("This function simply returns one specific"
+ " foxx and supplies the paths for the swagger documentation");
@ -301,12 +308,18 @@ controller.get("/docu/:key",function (req, res) {
* Get the Elements of the API Documentation subroutes
*
*/
controller.get('/docu/:key/*', function(req, res) {
var mountPoint = "";
underscore.each(req.suffix, function(part) {
mountPoint += "/" + part;
});
controller.get('/docu/:mount/:mountPoint', function(req, res) {
require("console").log("Blub");
require("console").log(req.params("mount"));
var mountPoint = decodeURIComponent(req.params("mountPoint"));
require("console").log(mountPoint);
res.json(docus.show(mountPoint));
}).pathParam("mount", {
type: foxxMountPoint,
allowMultiple: false
}).pathParam("mountPoint", {
type: foxxMountPoint,
allowMultiple: false
}).summary("List the API for one foxx")
.notes("This function lists the API of the foxx"
+ " running under the given mount point");

View File

@ -19,7 +19,7 @@
"api": "api",
"databases": "databases",
"applications": "applications",
"application/documentation/:key": "appDocumentation",
"application/documentation/:mount": "appDocumentation",
"graph": "graphManagement",
"userManagement": "userManagement",
"userProfile": "userProfile",
@ -242,8 +242,8 @@
this.naviView.selectMenuItem('applications-menu');
},
appDocumentation: function (key) {
var docuView = new window.AppDocumentationView({key: key});
appDocumentation: function (mount) {
var docuView = new window.AppDocumentationView({mount: mount});
docuView.render();
this.naviView.selectMenuItem('applications-menu');
},

View File

@ -13,7 +13,7 @@
initialize: function() {
var internal = require("internal");
var url = internal.arango.databasePrefix("/_admin/aardvark/docu/" + this.options.key);
var url = internal.arango.databasePrefix("/_admin/aardvark/docu/" + encodeURIComponent(this.options.mount));
this.swaggerUi = new SwaggerUi({
discoveryUrl: url,
apiKey: false,

View File

@ -208,7 +208,7 @@
showDocu: function(event) {
event.stopPropagation();
window.App.navigate(
"application/documentation/" + encodeURIComponent(this.model.get("_key")),
"application/documentation/" + encodeURIComponent(this.model.get("mount").substr(1)),
{
trigger: true
}

View File

@ -119,24 +119,18 @@
//check for invalid query names, if present change the box-shadow to red
// and disable the save functionality
var boolTemp = false;
this.customQueries.some(function(query){
if( query.name === saveName ){
var found = this.customQueries.some(function(query){
return query.name === saveName;
});
if(found){
$('#modalButton1').removeClass('button-success');
$('#modalButton1').addClass('button-warning');
$('#modalButton1').text('Update');
boolTemp = true;
}
else {
} else {
$('#modalButton1').removeClass('button-warning');
$('#modalButton1').addClass('button-success');
$('#modalButton1').text('Save');
}
if (boolTemp) {
return true;
}
});
},
clearOutput: function () {
@ -372,9 +366,9 @@
});
//old storage method
if (localStorage.getItem("customQueries")) {
var queries = JSON.parse(localStorage.getItem("customQueries"));
var item = localStorage.getItem("customQueries");
if (item) {
var queries = JSON.parse(item);
//save queries in user collections extra attribute
_.each(queries, function(oldQuery) {
self.collection.add({

View File

@ -17,13 +17,7 @@
this.currentDB = this.options.currentDB;
},
render: function () {
$(this.el).html(this.template.render({
isSystem: this.currentDB.get("isSystem")
}));
$('img.svg').each(function(){
var $img = $(this);
replaceSVG: function($img) {
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
@ -48,7 +42,16 @@
$img.replaceWith($svg);
}, 'xml');
},
render: function () {
var self = this;
$(this.el).html(this.template.render({
isSystem: this.currentDB.get("isSystem")
}));
$('img.svg').each(function() {
self.replaceSVG($(this));
});
return this;
},

View File

@ -47,42 +47,35 @@ exports.Swagger = function () {
result.swaggerVersion = "1.1";
result.basePath = basePath;
result.apis = apis;
var m;
while (res.hasNext()) {
var m = res.next().mount;
if (m === "/aardvark") {
} else {
m = res.next().mount;
if (m !== "/aardvark") {
apis.push({
path: m
});
}
}
return result;
},
};
this.listOne = function(basePath, key) {
var result = {},
res;
if (key.substr(0, 4) === "dev:") {
res = "/dev/" + key.split(":")[2];
}
else {
res = _aal.document(key).mount;
}
this.listOne = function(basePath, mount) {
var result = {};
result.swaggerVersion = "1.1";
result.basePath = basePath;
result.apis = [
{path: res}
{path: decodeURIComponent(mount)}
];
require("console").log(result);
return result;
},
};
// Get details of one specific installed foxx.
this.show = function(mount) {
require("console").log(mount);
var result = {},
apis = [],
pathes,
@ -109,6 +102,7 @@ exports.Swagger = function () {
pathes = app.routes;
for (i in pathes) {
if(pathes.hasOwnProperty(i)){
if (pathes[i].url.methods !== undefined) {
url = pathes[i].url.match;
api = {};
@ -120,7 +114,8 @@ exports.Swagger = function () {
apis.push(api);
}
}
}
return result;
}
};
};

View File

@ -32,6 +32,7 @@
"frontend/js/lib/swagger-ui.js",
"frontend/js/lib/highlight.7.3.pack.js",
"frontend/js/lib/joi.browser.js",
"frontend/js/lib/md5.js",
"test/mocks/disableEJS.js",
"frontend/js/arango/arango.js",
"frontend/js/shell/browser.js",
@ -186,6 +187,85 @@
"frontend/js/routers/router.js",
"clusterFrontend/js/routers/clusterRouter.js",
"test/specs/graphViewer/specColourMapper/colourMapperSpec.js",
"test/specs/graphViewer/specWindowObjects/domObserverFactorySpec.js",
"test/specs/graphViewer/specCommunityNode/communityNodeSpec.js",
"test/specs/graphViewer/specAdapter/interfaceSpec.js",
"test/specs/graphViewer/specAdapter/abstractAdapterSpec.js",
"test/specs/graphViewer/specAdapter/jsonAdapterSpec.js",
"test/specs/graphViewer/specAdapter/arangoAdapterSpec.js",
"test/specs/graphViewer/specAdapter/gharialAdapterSpec.js",
"test/specs/graphViewer/specAdapter/foxxAdapterSpec.js",
"test/specs/graphViewer/specAdapter/previewAdapterSpec.js",
"test/specs/graphViewer/specAdapter/arangoAdapterUISpec.js",
"test/specs/graphViewer/specAdapter/gharialAdapterUISpec.js",
"test/specs/graphViewer/specNodeShaper/nodeShaperSpec.js",
"test/specs/graphViewer/specNodeShaper/nodeShaperUISpec.js",
"test/specs/graphViewer/specEdgeShaper/edgeShaperSpec.js",
"test/specs/graphViewer/specEdgeShaper/edgeShaperUISpec.js",
"test/specs/graphViewer/specForceLayouter/forceLayouterSpec.js",
"test/specs/graphViewer/specForceLayouter/forceLayouterUISpec.js",
"test/specs/graphViewer/specEvents/eventLibrarySpec.js",
"test/specs/graphViewer/specEvents/eventDispatcherSpec.js",
"test/specs/graphViewer/specEvents/eventDispatcherUISpec.js",
"test/specs/graphViewer/specZoomManager/zoomManagerSpec.js",
"test/specs/graphViewer/specGraphViewer/graphViewerSpec.js",
"test/specs/graphViewer/specGraphViewer/graphViewerUISpec.js",
"test/specs/graphViewer/specGraphViewer/graphViewerWidgetSpec.js",
"test/specs/graphViewer/specGraphViewer/graphViewerPreviewSpec.js",
"test/specs/graphViewer/specNodeReducer/nodeReducerSpec.js",
"test/specs/graphViewer/specNodeReducer/modularityJoinerSpec.js",
"test/specs/graphViewer/specContextMenu/contextMenuSpec.js",
"test/specs/arango/arangoSpec.js",
"test/specs/models/currentDatabaseSpec.js",
"test/specs/models/clusterPlanSpec.js",
"test/specs/models/graphSpec.js",
"test/specs/models/arangoCollectionModelSpec.js",
"test/specs/models/arangoDatabaseSpec.js",
"test/specs/models/arangoDocumentSpec.js",
"test/specs/models/arangoLogModelSpec.js",
"test/specs/models/arangoStatisticsDescriptionSpec.js",
"test/specs/models/arangoStatisticsSpec.js",
"test/specs/models/arangoUsersSpec.js",
"test/specs/models/foxxSpec.js",
"test/specs/models/clusterCoordinatorSpec.js",
"test/specs/config/dygraphConfigSpec.js",
"test/specs/collections/clusterServersSpec.js",
"test/specs/collections/clusterDatabasesSpec.js",
"test/specs/collections/clusterCollectionsSpec.js",
"test/specs/collections/clusterCoordinatorsSpec.js",
"test/specs/collections/clusterShardsSpec.js",
"test/specs/collections/arangoCollectionsSpec.js",
"test/specs/collections/arangoDatabaseSpec.js",
"test/specs/collections/arangoDocumentSpec.js",
"test/specs/collections/arangoDocumentsSpec.js",
"test/specs/collections/arangoLogsSpec.js",
"test/specs/collections/arangoReplicationSpec.js",
"test/specs/collections/arangoStatisticsCollectionSpec.js",
"test/specs/collections/arangoStatisticsDescriptionCollectionSpec.js",
"test/specs/collections/arangoUsersSpec.js",
"test/specs/collections/foxxCollectionSpec.js",
"test/specs/collections/graphCollectionSpec.js",
"test/specs/collections/notificationCollectionSpec.js",
"test/specs/collections/ClusterStatisticsCollectionSpec.js",
"test/specs/views/apiViewSpec.js",
"test/specs/views/applicationsViewSpec.js",
"test/specs/views/appDocumentationViewSpec.js",
"test/specs/views/modalViewSpec.js",
"test/specs/views/editListEntryViewSpec.js",
"test/specs/views/collectionsViewSpec.js",
"test/specs/views/collectionsItemViewSpec.js",
"test/specs/views/dbSelectionViewSpec.js",
"test/specs/views/navigationViewSpec.js",
"test/specs/views/loginViewSpec.js",
"test/specs/views/userBarViewSpec.js",
"test/specs/views/documentsViewSpec.js",
"test/specs/views/documentViewSpec.js",
"test/specs/views/dashboardViewSpec.js",
"test/specs/views/graphManagementViewSpec.js",
"test/specs/views/newLogsViewSpec.js",

View File

@ -45,7 +45,7 @@ module.exports = function(karma) {
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
autoWatch: true,
// Start these browsers, currently available:
@ -64,6 +64,6 @@ module.exports = function(karma) {
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true
singleRun: false
});
};

View File

@ -694,11 +694,13 @@
target: "xyz"
};
spyOn(view, "mergeHistory");
spyOn(view, "updateTendencies");
spyOn(view, "updateLineChart");
spyOn($, "ajax").andCallFake(function (url, opt) {
expect(url).toEqual(
"abcde/_admin/aardvark/statistics/cluster?start=10000&type=short&DBserver=xyz"
);
expect(opt.async).toEqual(false);
expect(opt.async).toEqual(true);
return {
done: function (y) {
y({
@ -712,8 +714,11 @@
expect(view.mergeHistory).toHaveBeenCalledWith({
times: [1, 2, 3]
});
expect(view.updateTendencies).toHaveBeenCalled();
expect(view.isUpdating).toEqual(true);
Object.keys(view.graphs).forEach(function (f) {
expect(view.updateLineChart).toHaveBeenCalledWith(f, false);
});
});
it("prepare D3Charts", function () {
@ -1166,7 +1171,6 @@
it("startUpdating with no timer and statistics updates", function () {
spyOn(view, "getStatistics");
spyOn(view, "updateCharts");
view.isUpdating = true;
spyOn(window, "setInterval").andCallFake(
function (a) {
@ -1176,7 +1180,6 @@
view.startUpdating();
expect(window.setInterval).toHaveBeenCalled();
expect(view.getStatistics).toHaveBeenCalled();
expect(view.updateCharts).toHaveBeenCalled();
});
@ -1282,7 +1285,9 @@
}
};
spyOn(view, "startUpdating");
spyOn(view, "getStatistics");
spyOn(view, "getStatistics").andCallFake(function(cb) {
cb();
});
spyOn(view, "prepareDygraphs");
spyOn(view, "prepareD3Charts");
@ -1317,7 +1322,9 @@
}
};
spyOn(view, "startUpdating");
spyOn(view, "getStatistics");
spyOn(view, "getStatistics").andCallFake(function(cb) {
cb();
});
spyOn(view, "prepareDygraphs");
spyOn(view, "prepareD3Charts");

View File

@ -61,7 +61,45 @@
document.body.appendChild(div);
queryCollection = {
fetch: function() {}
__content: [],
fetch: function() {},
findWhere: function(ex) {
var i, k, found;
for (i = 0; i < this.__content.length; ++i) {
found = true;
for (k in ex) {
if (!ex.hasOwnProperty(k) || !this.__content[i].hasOwnProperty(k) || ex[k] !== this.__content[i][k]) {
found = false;
}
}
if (found) {
return this.__content[i];
}
}
},
each: function(func) {
return this.__content.forEach(func);
},
some: function(func) {
var res = false, i;
for (i = 0; i < this.__content.length; ++i) {
res = res || func(this.__content[i]);
}
return res;
},
remove: function(obj) {
var i;
for (i = 0; i < this.__content.length; ++i) {
if(this.__content[i] === obj) {
this.__content.splice(i, 1);
return;
}
}
},
add: function(item) {
this.__content.push(new DummyModel(item));
},
saveCollectionQueries: function() {}
};
view = new window.queryView({
@ -334,12 +372,8 @@
spyOn(view, "renderSelectboxes");
spyOn(view, "updateTable");
spyOn(localStorage, "setItem");
view.deleteAQL(e);
expect(localStorage.setItem).toHaveBeenCalledWith(
"customQueries", JSON.stringify(view.customQueries)
);
expect(view.renderSelectboxes).toHaveBeenCalled();
expect(view.updateTable).toHaveBeenCalled();
});
@ -362,13 +396,13 @@
spyOn(e, "stopPropagation");
spyOn(window.modalView, "hide");
spyOn(localStorage, "setItem");
spyOn(view, "renderSelectboxes");
spyOn(queryCollection, "add");
view.saveAQL(e);
expect(e.stopPropagation).toHaveBeenCalled();
expect(localStorage.setItem).toHaveBeenCalled();
expect(queryCollection.add).toHaveBeenCalled();
expect(view.renderSelectboxes).toHaveBeenCalled();
expect(window.modalView.hide).toHaveBeenCalled();
document.body.removeChild(div2);
@ -416,7 +450,7 @@
throw "Should be a spy";
}
};
localStorageFake = JSON.stringify(customQueries);
localStorageFake.value = JSON.stringify(customQueries);
view.initialize();
div2 = document.createElement("div");
@ -448,7 +482,7 @@
throw "Should be a spy";
}
};
localStorageFake = JSON.stringify(customQueries);
localStorageFake.value = JSON.stringify(customQueries);
view.initialize();
div2 = document.createElement("div");
@ -458,13 +492,13 @@
spyOn(e, "stopPropagation");
spyOn(window.modalView, "hide");
spyOn(localStorage, "setItem");
spyOn(view, "renderSelectboxes");
spyOn(queryCollection, "add");
view.saveAQL(e);
expect(e.stopPropagation).toHaveBeenCalled();
expect(localStorage.setItem).not.toHaveBeenCalled();
expect(queryCollection.add).not.toHaveBeenCalled();
expect(view.renderSelectboxes).not.toHaveBeenCalled();
expect(window.modalView.hide).toHaveBeenCalled();
document.body.removeChild(div2);
@ -476,7 +510,7 @@
value: "for var yx do something"
}],
returnValue;
localStorageFake = JSON.stringify(customQueries);
localStorageFake.value = JSON.stringify(customQueries);
view.initialize();
returnValue = view.getCustomQueryValueByName("hallotest");
@ -488,31 +522,26 @@
div2.id = "test123";
document.body.appendChild(div2);
localStorageFake = 5000;
localStorageFake.value = 5000;
view.initialize();
spyOn(localStorage, "getItem");
view.render();
expect(localStorage.getItem).toHaveBeenCalledWith("querySize");
expect(localStorage.getItem).toHaveBeenCalledWith("customQueries");
document.body.removeChild(div2);
});
it("should change the query size", function() {
var e = {
currentTarget: {
id: "test123"
}
};
spyOn(localStorage, "setItem");
view.changeSize(e);
expect(localStorage.setItem).toHaveBeenCalled();
});
it("submit a query and fail without a msg from server", function() {
// not finished yet
spyOn(view, "deselect");
var old = window.progressView;
window.progressView = {
show: function() {}
};
spyOn(window.progressView, "show");
view.submitQuery();
expect(view.deselect).toHaveBeenCalled();
expect(window.progressView.show).toHaveBeenCalled();
window.progressView = old;
});
it("should just run basic functionality of ace editor", function() {
@ -535,7 +564,7 @@
}
};
$('#findme').val('findme');
localStorageFake = JSON.stringify(customQueries);
localStorageFake.value = JSON.stringify(customQueries);
view.initialize();
view.importSelected(e);
@ -586,14 +615,14 @@
view.customQueries = customQueries;
spyOn(view, "sortQueries");
spyOn(arangoHelper, "escapeHtml");
spyOn(_, "escape");
view.renderSelectboxes();
expect(view.sortQueries).toHaveBeenCalled();
expect(jQueryDummy.empty).toHaveBeenCalled();
expect(jQueryDummy.append).toHaveBeenCalled();
expect(arangoHelper.escapeHtml).toHaveBeenCalled();
expect(_.escape).toHaveBeenCalled();
});

View File

@ -44,6 +44,7 @@
spyOn(view.template, "render").andReturn(1);
spyOn(view, "replaceSVG");
spyOn($.fn, "html");
spyOn($.fn, "find").andCallThrough();
spyOn($.fn, "attr").andCallThrough();
@ -57,13 +58,17 @@
view.render();
expect($.fn.html).toHaveBeenCalledWith(1);
expect($.fn.find).toHaveBeenCalledWith('svg');
expect($.fn.find).toHaveBeenCalledWith('img.svg');
expect(view.replaceSVG).toHaveBeenCalled();
/*
expect($.fn.attr).toHaveBeenCalledWith('id');
expect($.fn.attr).toHaveBeenCalledWith('class');
expect($.fn.attr).toHaveBeenCalledWith('src');
*/
expect(view.template.render).toHaveBeenCalledWith({
isSystem: true
});
});
it("should navigateBySelect", function () {

View File

@ -43,19 +43,17 @@ var colName = "perf_" + ruleName.replace(/-/g, "_");
var theCollection;
var dbdApi = function (query, plan, bindVars) {
db._query(query, bindVars);
db._query(query, bindVars).toArray();
return {};
};
var setUp = function (options) {
var loopto = options.dbcols;
var contentmultipy = options.contentmultiply;
var contentmultiply = options.contentmultiply;
var Content = Array(contentmultiply).join('abcdefghijklmnopqrstuvwxyz')
var Content = [];
for (j = 0; j < contentmultipy; j ++ ) {
Content = Content.concat(['abcdefghijklmnopqrstuvwxyz']);
}
internal.db._drop(colName);
theCollection = internal.db._create(colName);
var i, j;
@ -75,6 +73,7 @@ var setUp = function (options) {
var tearDown = function () {
internal.db._drop(colName);
require("internal").wait(0);
theCollection = null;
};
@ -103,6 +102,15 @@ var testNonIndexedPartialRead = function (testParams, testMethodStr, testMethod,
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Testcase: dump 10% of a table without using an index
////////////////////////////////////////////////////////////////////////////////
var testNonIndexedPartialReadCalcJS = function (testParams, testMethodStr, testMethod, runOptions) {
var tenPercent = (runOptions.dbcols / 10) * 9;
var query = "FOR i IN " + colName + " FILTER i.Key + 1 > " + tenPercent + " RETURN i";
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Testcase: dump a full table sorted by an unindexed key.
////////////////////////////////////////////////////////////////////////////////
@ -119,6 +127,33 @@ var testIndexedFullSort = function (testParams, testMethodStr, testMethod) {
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Testcase: dump a full table sorted by an indexed key.
////////////////////////////////////////////////////////////////////////////////
var testIndexedFullSortReverse = function (testParams, testMethodStr, testMethod) {
var query = "FOR i IN " + colName + " SORT i.indexedKey DESC RETURN i";
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Testcase: dump a full table sorted by an indexed key - use filter
/// so the old also has
////////////////////////////////////////////////////////////////////////////////
var testIndexedFullSortFilter = function (testParams, testMethodStr, testMethod) {
var query = "FOR i IN " + colName + " FILTER i.indexedKey > 0 SORT i.indexedKey RETURN i";
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Testcase: dump a full table sorted by an indexed key - use filter
/// so the old also has
////////////////////////////////////////////////////////////////////////////////
var testIndexedFullSortReverseFilter = function (testParams, testMethodStr, testMethod) {
var query = "FOR i IN " + colName + " FILTER i.indexedKey > 0 SORT i.indexedKey DESC RETURN i";
return testMethod.executeQuery(query, {}, {});
};
////////////////////////////////////////////////////////////////////////////////
/// @brief Simple join testsuite
////////////////////////////////////////////////////////////////////////////////
@ -126,12 +161,20 @@ var testIndexedFullSort = function (testParams, testMethodStr, testMethod) {
var testSuite = [
{ name: "setup", setUp: setUp, teardown: null, params: null, func: null},
{ name: "testFullRead", func: testFullRead},
{ name: "testNonIndexedPartialRead", func: testNonIndexedPartialRead},
{ name: "testNonIndexedPartialReadCalcJS", func: testNonIndexedPartialReadCalcJS},
{ name: "testNonIndexedFullSort", func: testNonIndexedFullSort},
{ name: "testIndexedFullSort", func: testIndexedFullSort},
{ name: "testIndexedFullSortReverse", func: testIndexedFullSortReverse},
{ name: "testIndexedFullSortFilter", func: testIndexedFullSortFilter},
{ name: "testIndexedFullSortReverseFilter", func: testIndexedFullSortReverseFilter},
{ name: "teardown", setUp: null, teardown: tearDown, params: null, func: null}
];
@ -141,8 +184,8 @@ var testSuite = [
////////////////////////////////////////////////////////////////////////////////
var k, l;
for (k = 4; k < 10; k++) {
for (l = 4; l < 10; l++) {
for (k = 1; k < 22; k+=5) {
for (l = 1; l < 22; l+=5) {
var testOptions = {
enableIndex: true,
dbcols: 10000 * k,