From 11736660d8a2d6e4f785f80ffbd7cd8c23fcaecb Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Tue, 2 Feb 2016 14:41:34 +0100 Subject: [PATCH 1/3] removed namespace --- arangod/RestHandler/RestAdminLogHandler.cpp | 1 - arangod/RestHandler/RestAdminLogHandler.h | 2 -- arangod/RestHandler/RestBaseHandler.h | 2 -- arangod/RestHandler/RestDebugHandler.cpp | 1 - arangod/RestHandler/RestHandlerCreator.h | 3 --- arangod/RestHandler/RestJobHandler.cpp | 1 - arangod/RestHandler/RestJobHandler.h | 3 --- arangod/RestHandler/RestShutdownHandler.cpp | 1 - arangod/RestHandler/RestShutdownHandler.h | 2 -- arangod/RestHandler/RestVersionHandler.cpp | 1 - arangod/RestHandler/RestVersionHandler.h | 2 +- arangod/RestHandler/WorkMonitorHandler.cpp | 2 -- arangod/RestHandler/WorkMonitorHandler.h | 2 +- arangod/RestServer/ArangoServer.cpp | 9 ++++----- 14 files changed, 6 insertions(+), 26 deletions(-) diff --git a/arangod/RestHandler/RestAdminLogHandler.cpp b/arangod/RestHandler/RestAdminLogHandler.cpp index 3405080eca..951847ba48 100644 --- a/arangod/RestHandler/RestAdminLogHandler.cpp +++ b/arangod/RestHandler/RestAdminLogHandler.cpp @@ -32,7 +32,6 @@ using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; -using namespace arangodb::admin; //////////////////////////////////////////////////////////////////////////////// /// @brief sort ascending diff --git a/arangod/RestHandler/RestAdminLogHandler.h b/arangod/RestHandler/RestAdminLogHandler.h index 88b06b1646..1f776b400f 100644 --- a/arangod/RestHandler/RestAdminLogHandler.h +++ b/arangod/RestHandler/RestAdminLogHandler.h @@ -28,7 +28,6 @@ #include "RestHandler/RestBaseHandler.h" namespace arangodb { -namespace admin { //////////////////////////////////////////////////////////////////////////////// /// @brief admin log request handler @@ -48,6 +47,5 @@ class RestAdminLogHandler : public RestBaseHandler { status_t execute() override; }; } -} #endif diff --git a/arangod/RestHandler/RestBaseHandler.h b/arangod/RestHandler/RestBaseHandler.h index bbe7c95601..b0e7823aac 100644 --- a/arangod/RestHandler/RestBaseHandler.h +++ b/arangod/RestHandler/RestBaseHandler.h @@ -36,7 +36,6 @@ namespace arangodb { namespace velocypack { class Slice; } -namespace admin { //////////////////////////////////////////////////////////////////////////////// /// @brief default handler for error handling and json in-/output @@ -102,6 +101,5 @@ class RestBaseHandler : public rest::HttpHandler { virtual void generateOOMError(); }; } -} #endif diff --git a/arangod/RestHandler/RestDebugHandler.cpp b/arangod/RestHandler/RestDebugHandler.cpp index 6c360a5828..32e46f556c 100644 --- a/arangod/RestHandler/RestDebugHandler.cpp +++ b/arangod/RestHandler/RestDebugHandler.cpp @@ -31,7 +31,6 @@ using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; -using namespace arangodb::admin; //////////////////////////////////////////////////////////////////////////////// /// @brief ArangoDB server diff --git a/arangod/RestHandler/RestHandlerCreator.h b/arangod/RestHandler/RestHandlerCreator.h index e0d2b90244..d6ffbbe6b6 100644 --- a/arangod/RestHandler/RestHandlerCreator.h +++ b/arangod/RestHandler/RestHandlerCreator.h @@ -32,8 +32,6 @@ class HttpHandler; class HttpRequest; } -namespace admin { - //////////////////////////////////////////////////////////////////////////////// /// @brief creator function //////////////////////////////////////////////////////////////////////////////// @@ -67,6 +65,5 @@ class RestHandlerCreator : public H { } }; } -} #endif diff --git a/arangod/RestHandler/RestJobHandler.cpp b/arangod/RestHandler/RestJobHandler.cpp index 0907857400..69aabb5ce3 100644 --- a/arangod/RestHandler/RestJobHandler.cpp +++ b/arangod/RestHandler/RestJobHandler.cpp @@ -32,7 +32,6 @@ #include #include -using namespace arangodb::admin; using namespace arangodb::basics; using namespace arangodb::rest; diff --git a/arangod/RestHandler/RestJobHandler.h b/arangod/RestHandler/RestJobHandler.h index 9d7bdbf00f..9d6c0a8b36 100644 --- a/arangod/RestHandler/RestJobHandler.h +++ b/arangod/RestHandler/RestJobHandler.h @@ -34,8 +34,6 @@ class AsyncJobManager; class Dispatcher; } -namespace admin { - //////////////////////////////////////////////////////////////////////////////// /// @brief job control request handler //////////////////////////////////////////////////////////////////////////////// @@ -104,6 +102,5 @@ class RestJobHandler : public RestBaseHandler { rest::AsyncJobManager* _jobManager; }; } -} #endif diff --git a/arangod/RestHandler/RestShutdownHandler.cpp b/arangod/RestHandler/RestShutdownHandler.cpp index ab65165c40..2a5de0cd4a 100644 --- a/arangod/RestHandler/RestShutdownHandler.cpp +++ b/arangod/RestHandler/RestShutdownHandler.cpp @@ -28,7 +28,6 @@ #include #include -using namespace arangodb::admin; using namespace arangodb::rest; RestShutdownHandler::RestShutdownHandler(arangodb::rest::HttpRequest* request, diff --git a/arangod/RestHandler/RestShutdownHandler.h b/arangod/RestHandler/RestShutdownHandler.h index a7e5b9bd1e..ee9ab09359 100644 --- a/arangod/RestHandler/RestShutdownHandler.h +++ b/arangod/RestHandler/RestShutdownHandler.h @@ -30,7 +30,6 @@ #include "RestHandler/RestBaseHandler.h" namespace arangodb { -namespace admin { //////////////////////////////////////////////////////////////////////////////// /// @brief shutdown request handler @@ -57,6 +56,5 @@ class RestShutdownHandler : public RestBaseHandler { arangodb::rest::ApplicationServer* _applicationServer; }; } -} #endif diff --git a/arangod/RestHandler/RestVersionHandler.cpp b/arangod/RestHandler/RestVersionHandler.cpp index c29226b46a..93e121d238 100644 --- a/arangod/RestHandler/RestVersionHandler.cpp +++ b/arangod/RestHandler/RestVersionHandler.cpp @@ -34,7 +34,6 @@ using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; -using namespace arangodb::admin; //////////////////////////////////////////////////////////////////////////////// /// @brief ArangoDB server diff --git a/arangod/RestHandler/RestVersionHandler.h b/arangod/RestHandler/RestVersionHandler.h index 3a7444ef13..13c15c0166 100644 --- a/arangod/RestHandler/RestVersionHandler.h +++ b/arangod/RestHandler/RestVersionHandler.h @@ -32,7 +32,7 @@ namespace arangodb { /// @brief version request handler //////////////////////////////////////////////////////////////////////////////// -class RestVersionHandler : public arangodb::admin::RestBaseHandler { +class RestVersionHandler : public arangodb::RestBaseHandler { public: explicit RestVersionHandler(arangodb::rest::HttpRequest*); diff --git a/arangod/RestHandler/WorkMonitorHandler.cpp b/arangod/RestHandler/WorkMonitorHandler.cpp index cd14fbfd7b..952a63449f 100644 --- a/arangod/RestHandler/WorkMonitorHandler.cpp +++ b/arangod/RestHandler/WorkMonitorHandler.cpp @@ -36,8 +36,6 @@ WorkMonitorHandler::WorkMonitorHandler(HttpRequest* request) bool WorkMonitorHandler::isDirect() const { return true; } -#include - HttpHandler::status_t WorkMonitorHandler::execute() { WorkMonitor::requestWorkOverview(_taskId); return status_t(HANDLER_ASYNC); diff --git a/arangod/RestHandler/WorkMonitorHandler.h b/arangod/RestHandler/WorkMonitorHandler.h index 93cceb1f80..b02ae9ac89 100644 --- a/arangod/RestHandler/WorkMonitorHandler.h +++ b/arangod/RestHandler/WorkMonitorHandler.h @@ -31,7 +31,7 @@ namespace arangodb { /// @brief version request handler //////////////////////////////////////////////////////////////////////////////// -class WorkMonitorHandler : public arangodb::admin::RestBaseHandler { +class WorkMonitorHandler : public arangodb::RestBaseHandler { public: explicit WorkMonitorHandler(arangodb::rest::HttpRequest*); diff --git a/arangod/RestServer/ArangoServer.cpp b/arangod/RestServer/ArangoServer.cpp index a21c173b81..333b60e189 100644 --- a/arangod/RestServer/ArangoServer.cpp +++ b/arangod/RestServer/ArangoServer.cpp @@ -92,7 +92,6 @@ using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; -using namespace arangodb::admin; bool ALLOW_USE_DATABASE_IN_REST_ACTIONS; @@ -216,7 +215,7 @@ void ArangoServer::defineHandlers(HttpHandlerFactory* factory) { // And now some handlers which are registered in both /_api and /_admin factory->addPrefixHandler( "/_api/job", - RestHandlerCreator::createData< + RestHandlerCreator::createData< std::pair*>, _pairForJobHandler); @@ -227,7 +226,7 @@ void ArangoServer::defineHandlers(HttpHandlerFactory* factory) { // And now the _admin handlers factory->addPrefixHandler( "/_admin/job", - RestHandlerCreator::createData< + RestHandlerCreator::createData< std::pair*>, _pairForJobHandler); @@ -238,7 +237,7 @@ void ArangoServer::defineHandlers(HttpHandlerFactory* factory) { // further admin handlers factory->addHandler( "/_admin/log", - RestHandlerCreator::createNoData, + RestHandlerCreator::createNoData, nullptr); factory->addHandler("/_admin/work-monitor", @@ -254,7 +253,7 @@ void ArangoServer::defineHandlers(HttpHandlerFactory* factory) { factory->addPrefixHandler( "/_admin/shutdown", - RestHandlerCreator::createData< + RestHandlerCreator::createData< void*>, static_cast(_applicationServer)); } From e9dbd6f648d19694bd80313f238b95d921a11bcd Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Tue, 2 Feb 2016 14:45:08 +0100 Subject: [PATCH 2/3] fixed test for significant attribute --- UnitTests/unittest.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/UnitTests/unittest.js b/UnitTests/unittest.js index 27dc44fab7..015c938dfd 100644 --- a/UnitTests/unittest.js +++ b/UnitTests/unittest.js @@ -73,13 +73,17 @@ function resultsToXml(results, baseName, cluster) { return (internalMembers.indexOf(b) === -1) && a.hasOwnProperty(b); }; - for (let testrun in results) { - if (isSignificant(results, testrun)) { - for (let test in results[testrun]) { - let run = results[test]; + for (let resultName in results) { + if (isSignificant(results, resultName)) { + let run = results[resultName]; - if (isSignificant(run, test) && !run[test].hasOwnProperty('skipped')) { - const current = run[test]; + for (let runName in run) { + if (isSignificant(run, runName)) { + const current = run[runName]; + + if (current.skipped) { + continue; + } let xml = buildXml(); let failuresFound = ""; @@ -91,7 +95,7 @@ function resultsToXml(results, baseName, cluster) { xml.elem("testsuite", { errors: 0, failures: failuresFound, - name: clprefix + test, + name: clprefix + runName, tests: current.total, time: current.duration }); @@ -118,7 +122,7 @@ function resultsToXml(results, baseName, cluster) { if (!current.status) { xml.elem("testcase", { - name: 'all tests in ' + clprefix + test, + name: 'all tests in ' + clprefix + runName, time: current.duration }, false); @@ -133,7 +137,7 @@ function resultsToXml(results, baseName, cluster) { xml.elem("/testsuite"); const fn = makePathGeneric(baseName + clprefix + - testrun + '_' + test + ".xml").join('_'); + resultName + '_' + runName + ".xml").join('_'); fs.write("out/" + fn, xml.join("")); } From bfd5d6614ac8b56ecf5009c99606e4e6564fcc93 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Tue, 2 Feb 2016 15:10:44 +0100 Subject: [PATCH 3/3] fixed namespace usage --- arangod/Cluster/RestShardHandler.h | 2 +- arangod/RestHandler/RestBaseHandler.cpp | 2 +- arangod/RestHandler/RestJobHandler.cpp | 1 + arangod/RestHandler/RestShutdownHandler.cpp | 1 + arangod/RestHandler/RestVocbaseBaseHandler.h | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arangod/Cluster/RestShardHandler.h b/arangod/Cluster/RestShardHandler.h index 40dae44387..41dce98456 100644 --- a/arangod/Cluster/RestShardHandler.h +++ b/arangod/Cluster/RestShardHandler.h @@ -36,7 +36,7 @@ class Dispatcher; /// @brief shard control request handler //////////////////////////////////////////////////////////////////////////////// -class RestShardHandler : public admin::RestBaseHandler { +class RestShardHandler : public RestBaseHandler { public: RestShardHandler(rest::HttpRequest* request, rest::Dispatcher*); diff --git a/arangod/RestHandler/RestBaseHandler.cpp b/arangod/RestHandler/RestBaseHandler.cpp index d46238f84b..ac8d6c600e 100644 --- a/arangod/RestHandler/RestBaseHandler.cpp +++ b/arangod/RestHandler/RestBaseHandler.cpp @@ -31,9 +31,9 @@ #include #include +using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; -using namespace arangodb::admin; RestBaseHandler::RestBaseHandler(HttpRequest* request) : HttpHandler(request) {} diff --git a/arangod/RestHandler/RestJobHandler.cpp b/arangod/RestHandler/RestJobHandler.cpp index 69aabb5ce3..f92e560ac0 100644 --- a/arangod/RestHandler/RestJobHandler.cpp +++ b/arangod/RestHandler/RestJobHandler.cpp @@ -32,6 +32,7 @@ #include #include +using namespace arangodb; using namespace arangodb::basics; using namespace arangodb::rest; diff --git a/arangod/RestHandler/RestShutdownHandler.cpp b/arangod/RestHandler/RestShutdownHandler.cpp index 2a5de0cd4a..204d12ac00 100644 --- a/arangod/RestHandler/RestShutdownHandler.cpp +++ b/arangod/RestHandler/RestShutdownHandler.cpp @@ -28,6 +28,7 @@ #include #include +using namespace arangodb; using namespace arangodb::rest; RestShutdownHandler::RestShutdownHandler(arangodb::rest::HttpRequest* request, diff --git a/arangod/RestHandler/RestVocbaseBaseHandler.h b/arangod/RestHandler/RestVocbaseBaseHandler.h index c1b6d0d42a..06cdb2a0d7 100644 --- a/arangod/RestHandler/RestVocbaseBaseHandler.h +++ b/arangod/RestHandler/RestVocbaseBaseHandler.h @@ -43,7 +43,7 @@ class VocbaseContext; /// @brief abstract base request handler //////////////////////////////////////////////////////////////////////////////// -class RestVocbaseBaseHandler : public admin::RestBaseHandler { +class RestVocbaseBaseHandler : public RestBaseHandler { private: RestVocbaseBaseHandler(RestVocbaseBaseHandler const&) = delete; RestVocbaseBaseHandler& operator=(RestVocbaseBaseHandler const&) = delete;