mirror of https://gitee.com/bigwinds/arangodb
javascript side of jsonified agency
This commit is contained in:
parent
d886a85f31
commit
e81e3e51e0
|
@ -388,7 +388,7 @@ void Store::dumpToBuilder (Builder& builder) const {
|
|||
auto in_time_t = std::chrono::system_clock::to_time_t(i.first);
|
||||
std::string ts = ctime(&in_time_t);
|
||||
ts.resize(ts.size()-1);
|
||||
builder.add(ts, VPackValue((size_t)i.second.get()));
|
||||
builder.add(ts, VPackValue(i.second->uri()));
|
||||
}
|
||||
}
|
||||
{
|
||||
|
|
|
@ -621,7 +621,7 @@ bool AgencyComm::tryInitializeStructure() {
|
|||
addEmptyVPackObject("Problems", builder);
|
||||
builder.add("UserVersion", VPackValue("1"));
|
||||
addEmptyVPackObject("ServerStates", builder);
|
||||
builder.add("HeartbeatIntervalMs", VPackValue("500"));
|
||||
builder.add("HeartbeatIntervalMs", VPackValue("10000"));
|
||||
addEmptyVPackObject("Commands", builder);
|
||||
}
|
||||
builder.add(VPackValue("Current"));
|
||||
|
|
|
@ -718,7 +718,6 @@ void ClusterInfo::loadPlannedCollections() {
|
|||
(*it2).second.emplace(std::make_pair(collection, collectionData));
|
||||
(*it2).second.emplace(
|
||||
std::make_pair(collectionData->name(), collectionData));
|
||||
std::cout << database << "/" << collection << std::endl;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -998,6 +997,7 @@ int ClusterInfo::createDatabaseCoordinator(std::string const& name,
|
|||
std::string& errorMsg,
|
||||
double timeout) {
|
||||
|
||||
LOG(INFO) << " +++ " ;
|
||||
AgencyComm ac;
|
||||
AgencyCommResult res;
|
||||
|
||||
|
@ -1023,6 +1023,7 @@ int ClusterInfo::createDatabaseCoordinator(std::string const& name,
|
|||
errorMsg);
|
||||
}
|
||||
}
|
||||
LOG(INFO) << " +++ " ;
|
||||
|
||||
// Now update our own cache of planned databases:
|
||||
loadPlannedDatabases();
|
||||
|
@ -1030,6 +1031,7 @@ int ClusterInfo::createDatabaseCoordinator(std::string const& name,
|
|||
// Now wait for it to appear and be complete:
|
||||
res.clear();
|
||||
res = ac.getValues2("Current/Version", false);
|
||||
LOG(INFO) << " +++ " ;
|
||||
if (!res.successful()) {
|
||||
return setErrormsg(TRI_ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION,
|
||||
errorMsg);
|
||||
|
@ -1039,11 +1041,10 @@ int ClusterInfo::createDatabaseCoordinator(std::string const& name,
|
|||
int count = 0; // this counts, when we have to reload the DBServers
|
||||
|
||||
std::string where = "Current/Databases/" + name;
|
||||
std::cout << "#####################" << where << std::endl;
|
||||
while (TRI_microtime() <= endTime) {
|
||||
res.clear();
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
LOG(INFO) << where;
|
||||
res = ac.getValues(where, true);
|
||||
if (res.successful() && res.parse(where + "/", false)) {
|
||||
if (res._values.size() == DBServers.size()) {
|
||||
|
@ -1149,7 +1150,6 @@ int ClusterInfo::dropDatabaseCoordinator(std::string const& name,
|
|||
|
||||
// Now wait for it to appear and be complete:
|
||||
res.clear();
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
res = ac.getValues("Current/Version", false);
|
||||
if (!res.successful()) {
|
||||
|
@ -1160,7 +1160,6 @@ int ClusterInfo::dropDatabaseCoordinator(std::string const& name,
|
|||
std::string where = "Current/Databases/" + name;
|
||||
while (TRI_microtime() <= endTime) {
|
||||
res.clear();
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
res = ac.getValues(where, true);
|
||||
if (res.successful() && res.parse(where + "/", false)) {
|
||||
if (res._values.size() == 0) {
|
||||
|
@ -1445,8 +1444,6 @@ int ClusterInfo::setCollectionPropertiesCoordinator(
|
|||
.get(AgencyComm::prefix().substr(1,AgencyComm::prefix().size()-2))
|
||||
.get("Plan").get("Collections").get(collectionID);
|
||||
|
||||
std::cout << collection.toJson() << std::endl;
|
||||
|
||||
VPackObjectIterator cols (collection);
|
||||
|
||||
//if (it == res._values.end()) {
|
||||
|
@ -1513,8 +1510,6 @@ int ClusterInfo::setCollectionStatusCoordinator(
|
|||
return TRI_ERROR_ARANGO_DATABASE_NOT_FOUND;
|
||||
}
|
||||
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
res = ac.getValues("Plan/Collections/" + databaseName + "/" + collectionID,
|
||||
false);
|
||||
|
||||
|
@ -1872,7 +1867,6 @@ int ClusterInfo::dropIndexCoordinator(std::string const& databaseName,
|
|||
|
||||
std::string const key =
|
||||
"Plan/Collections/" + databaseName + "/" + collectionID;
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
AgencyCommResult previous = ac.getValues(key, false);
|
||||
previous.parse("", false);
|
||||
|
@ -1987,7 +1981,6 @@ int ClusterInfo::dropIndexCoordinator(std::string const& databaseName,
|
|||
loadPlannedCollections();
|
||||
|
||||
TRI_ASSERT(numberOfShards > 0);
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
// now wait for the index to disappear
|
||||
AgencyCommResult res = ac.getValues("Current/Version", false);
|
||||
|
@ -2000,7 +1993,6 @@ int ClusterInfo::dropIndexCoordinator(std::string const& databaseName,
|
|||
"Current/Collections/" + databaseName + "/" + collectionID;
|
||||
while (TRI_microtime() <= endTime) {
|
||||
res.clear();
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
res = ac.getValues(where, true);
|
||||
if (res.successful() && res.parse(where + "/", false)) {
|
||||
|
@ -2730,7 +2722,6 @@ void FollowerInfo::add(ServerID const& sid) {
|
|||
double startTime = TRI_microtime();
|
||||
bool success = false;
|
||||
do {
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
AgencyCommResult res = ac.getValues(path, false);
|
||||
if (res.successful()) {
|
||||
|
@ -2797,7 +2788,6 @@ void FollowerInfo::remove(ServerID const& sid) {
|
|||
double startTime = TRI_microtime();
|
||||
bool success = false;
|
||||
do {
|
||||
std::cout << __FILE__ << __func__ << __LINE__ << std::endl;
|
||||
|
||||
AgencyCommResult res = ac.getValues(path, false);
|
||||
if (res.successful()) {
|
||||
|
|
|
@ -174,6 +174,7 @@ void HeartbeatThread::runDBServer() {
|
|||
|
||||
AgencyCommResult result =
|
||||
_agency.getValues("Sync/Commands/" + _myId, false);
|
||||
LOG(INFO) << result._body;
|
||||
|
||||
if (result.successful()) {
|
||||
handleStateChange(result, lastCommandIndex);
|
||||
|
@ -191,7 +192,6 @@ void HeartbeatThread::runDBServer() {
|
|||
bool wasNotified;
|
||||
{
|
||||
CONDITION_LOCKER(locker, _condition);
|
||||
LOG(INFO) << _wasNotified;
|
||||
wasNotified = _wasNotified;
|
||||
if (!wasNotified) {
|
||||
locker.wait(static_cast<uint64_t>(remain * 1000000.0));
|
||||
|
@ -668,8 +668,8 @@ bool HeartbeatThread::handleStateChange(AgencyCommResult& result,
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool HeartbeatThread::sendState() {
|
||||
const AgencyCommResult result = _agency.sendServerState(
|
||||
8.0 * static_cast<double>(_interval) / 1000.0 / 1000.0);
|
||||
const AgencyCommResult result = _agency.sendServerState(0.0);
|
||||
// 8.0 * static_cast<double>(_interval) / 1000.0 / 1000.0);
|
||||
|
||||
if (result.successful()) {
|
||||
_numFails = 0;
|
||||
|
|
|
@ -534,6 +534,7 @@ actions.defineHttp({
|
|||
var oldValue;
|
||||
try {
|
||||
oldValue = ArangoAgency.get("Plan/DBServers/" + primary, false, false);
|
||||
oldValue = oldValue.arango.Plan.DBServers[primary];
|
||||
}
|
||||
catch (e1) {
|
||||
actions.resultError(req, res, actions.HTTP_NOT_FOUND, 0,
|
||||
|
@ -651,6 +652,7 @@ actions.defineHttp({
|
|||
try {
|
||||
oldValue = ArangoAgency.get("Plan/DBServers/" + body.primary, false,
|
||||
false);
|
||||
oldValue = oldValue.arango.Plan.DBservers[body.primary];
|
||||
}
|
||||
catch (e1) {
|
||||
actions.resultError(req, res, actions.HTTP_NOT_FOUND, 0,
|
||||
|
@ -700,6 +702,7 @@ function changeAllShardReponsibilities (oldServer, newServer) {
|
|||
// This is only called when we have the write lock and we "only" have to
|
||||
// make sure that either all or none of the shards are moved.
|
||||
var collections = ArangoAgency.get("Plan/Collections", true, false);
|
||||
collections = collections.arango.Plan.Collections;
|
||||
var done = {};
|
||||
try {
|
||||
Object.keys(collections).forEach(function(collectionKey) {
|
||||
|
@ -831,6 +834,7 @@ actions.defineHttp({
|
|||
try {
|
||||
oldValue = ArangoAgency.get("Plan/DBServers/" + body.primary, false,
|
||||
false);
|
||||
oldValue = oldValue.arango.Plan.DBservers[body.primary];
|
||||
}
|
||||
catch (e1) {
|
||||
actions.resultError(req, res, actions.HTTP_NOT_FOUND, 0,
|
||||
|
|
|
@ -70,6 +70,8 @@ function get_api_database (req, res) {
|
|||
// fetch database information from Agency
|
||||
var values = ArangoAgency.get("Plan/Databases/" + encodeURIComponent(req.database), false);
|
||||
var dbEntry = values["Plan/Databases/" + encodeURIComponent(req.database)];
|
||||
require("internal").print(values);
|
||||
require("internal").print(dbEntry);
|
||||
result = {
|
||||
name: dbEntry.name,
|
||||
id: dbEntry.id,
|
||||
|
|
|
@ -510,7 +510,7 @@ function cleanupCurrentDatabases () {
|
|||
db._useDatabase("_system");
|
||||
|
||||
var all = global.ArangoAgency.get("Current/Databases", true);
|
||||
var currentDatabases = getByPrefix3d(all, "Current/Databases/");
|
||||
var currentDatabases = all.arango.Current.Databases;
|
||||
var localDatabases = getLocalDatabases();
|
||||
var name;
|
||||
|
||||
|
@ -538,7 +538,7 @@ function cleanupCurrentDatabases () {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function handleDatabaseChanges (plan) {
|
||||
var plannedDatabases = plan.arango.Plan.Databases;
|
||||
var plannedDatabases = plan.Databases;
|
||||
|
||||
createLocalDatabases(plannedDatabases);
|
||||
dropLocalDatabases(plannedDatabases);
|
||||
|
@ -918,7 +918,7 @@ function cleanupCurrentCollections (plannedCollections) {
|
|||
db._useDatabase("_system");
|
||||
|
||||
var all = global.ArangoAgency.get("Current/Collections", true);
|
||||
var currentCollections = getByPrefix4d(all, "Current/Collections/");
|
||||
var currentCollections = all.arango.Current.Collections;
|
||||
var shardMap = getShardMap(plannedCollections);
|
||||
var database;
|
||||
|
||||
|
@ -973,7 +973,7 @@ function synchronizeLocalFollowerCollections (plannedCollections) {
|
|||
|
||||
// Get current information about collections from agency:
|
||||
var all = global.ArangoAgency.get("Current/Collections", true);
|
||||
var currentCollections = getByPrefix4d(all, "Current/Collections/");
|
||||
var currentCollections = all.arango.Current.Collections;
|
||||
|
||||
var rep = require("@arangodb/replication");
|
||||
|
||||
|
@ -1024,8 +1024,7 @@ function synchronizeLocalFollowerCollections (plannedCollections) {
|
|||
require("internal").wait(0.5);
|
||||
all = global.ArangoAgency.get("Current/Collections",
|
||||
true);
|
||||
currentCollections = getByPrefix4d(all,
|
||||
"Current/Collections/");
|
||||
currentCollections = all.Current.Collections;
|
||||
inCurrent = lookup4d(currentCollections, database,
|
||||
collection, shard);
|
||||
}
|
||||
|
@ -1108,12 +1107,12 @@ function synchronizeLocalFollowerCollections (plannedCollections) {
|
|||
|
||||
function handleCollectionChanges (plan, takeOverResponsibility) {
|
||||
// var plannedCollections = getByPrefix3d(plan, "Plan/Collections/");
|
||||
var plannedCollections = plan.arango.Plan.Collections;
|
||||
var plannedCollections = plan.Collections;
|
||||
|
||||
var ok = true;
|
||||
|
||||
try {
|
||||
createLocalCollections(plannedCollections, plan.arango.Plan.Version, takeOverResponsibility);
|
||||
createLocalCollections(plannedCollections, plan.Version, takeOverResponsibility);
|
||||
dropLocalCollections(plannedCollections);
|
||||
cleanupCurrentCollections(plannedCollections);
|
||||
synchronizeLocalFollowerCollections(plannedCollections);
|
||||
|
@ -1221,12 +1220,12 @@ function handleChanges (plan, current) {
|
|||
// Need to check role change for automatic failover:
|
||||
var myId = ArangoServerState.id();
|
||||
if (role === "PRIMARY") {
|
||||
if (! plan.arango.Plan.DBServers[myId]) {
|
||||
if (! plan.DBServers[myId]) {
|
||||
// Ooops! We do not seem to be a primary any more!
|
||||
changed = ArangoServerState.redetermineRole();
|
||||
}
|
||||
} else { // role === "SECONDARY"
|
||||
if (plan.arango.Plan.DBServers[myId]) {
|
||||
if (plan.DBServers[myId]) {
|
||||
changed = ArangoServerState.redetermineRole();
|
||||
if (!changed) {
|
||||
// mop: oops...changing role has failed. retry next time.
|
||||
|
@ -1433,8 +1432,8 @@ var handlePlanChange = function () {
|
|||
}
|
||||
|
||||
try {
|
||||
var plan = global.ArangoAgency.get("Plan", true);
|
||||
var current = global.ArangoAgency.get("Current", true);
|
||||
var plan = global.ArangoAgency.get("Plan", true).arango.Plan;
|
||||
var current = global.ArangoAgency.get("Current", true).arango.Current;
|
||||
handleChanges(plan, current);
|
||||
console.info("plan change handling successful");
|
||||
} catch (err) {
|
||||
|
|
|
@ -72,10 +72,15 @@ exports.Communication = function() {
|
|||
var _agency = exports._createAgency();
|
||||
var stubs = {
|
||||
get: function(route, recursive) {
|
||||
return _agency.get(route, recursive);
|
||||
var ret = _agency.get(route, recursive);
|
||||
require("internal").print(route);
|
||||
require("internal").print(ret);
|
||||
return ret;
|
||||
},
|
||||
getValue: function(route, name) {
|
||||
var res = _agency.get(route + "/" + name);
|
||||
require("internal").print(route + "/" + name);
|
||||
require("internal").print(res);
|
||||
return _.values(res)[0];
|
||||
},
|
||||
set: function(route, name, value) {
|
||||
|
|
|
@ -359,10 +359,8 @@ exports.reload = function () {
|
|||
|
||||
while (! done) {
|
||||
try {
|
||||
UserVersion = ArangoAgency.get("Sync/UserVersion")["Sync/UserVersion"];
|
||||
UserVersion = ArangoAgency.get("Sync/UserVersion");
|
||||
UserVersion = UserVersion.arango.Sync.UserVersion;
|
||||
require("internal").print(UserVersion);
|
||||
// This is now a string!
|
||||
}
|
||||
catch (err) {
|
||||
break;
|
||||
|
|
|
@ -321,13 +321,13 @@ function AgencySuite () {
|
|||
testSet : function () {
|
||||
// insert
|
||||
agency.set("UnitTestsAgency/foo", "test1");
|
||||
var values = agency.get("UnitTestsAgency/foo");
|
||||
var values = agency.get("UnitTestsAgency/foo").arango.UnitTestsAgency.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/foo"));
|
||||
assertEqual(values["UnitTestsAgency/foo"], "test1");
|
||||
|
||||
// overwrite
|
||||
agency.set("UnitTestsAgency/foo", "test2", 2);
|
||||
values = agency.get("UnitTestsAgency/foo");
|
||||
values = agency.get("UnitTestsAgency/foo").arango.UnitTestsAgency.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/foo"));
|
||||
assertEqual(values["UnitTestsAgency/foo"], "test2");
|
||||
|
||||
|
@ -335,20 +335,20 @@ function AgencySuite () {
|
|||
|
||||
// re-insert
|
||||
agency.set("UnitTestsAgency/foo", "test3");
|
||||
values = agency.get("UnitTestsAgency/foo");
|
||||
values = agency.get("UnitTestsAgency/foo").arango.UnitTestsAgency.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/foo"));
|
||||
assertEqual(values["UnitTestsAgency/foo"], "test3");
|
||||
|
||||
// update with ttl
|
||||
agency.set("UnitTestsAgency/foo", "test4", 2);
|
||||
values = agency.get("UnitTestsAgency/foo");
|
||||
values = agency.get("UnitTestsAgency/foo").arango.UnitTestsAgency.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/foo"));
|
||||
assertEqual(values["UnitTestsAgency/foo"], "test4");
|
||||
|
||||
require("internal").wait(3);
|
||||
|
||||
try {
|
||||
values = agency.get("UnitTestsAgency/foo");
|
||||
values = agency.get("UnitTestsAgency/foo").arango.UnitTestsAgency.foo;
|
||||
fail();
|
||||
}
|
||||
catch (e) {
|
||||
|
@ -449,7 +449,7 @@ function AgencySuite () {
|
|||
assertTrue(agency.remove("UnitTestsAgency/1", true));
|
||||
assertTrue(agency.remove("UnitTestsAgency/2", true));
|
||||
|
||||
var values = agency.get("UnitTestsAgency", true);
|
||||
var values = agency.get("UnitTestsAgency", true).arango.UnitTestsAgency;
|
||||
assertEqual({ }, values); // empty
|
||||
},
|
||||
|
||||
|
@ -471,14 +471,14 @@ function AgencySuite () {
|
|||
assertTrue(agency.remove("UnitTestsAgency/1", true));
|
||||
|
||||
try {
|
||||
agency.get("UnitTestsAgency/1", true);
|
||||
agency.get("UnitTestsAgency/1", true).arango.UnitTestsAgency.1;
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
// key not found
|
||||
}
|
||||
|
||||
var values = agency.get("UnitTestsAgency/2", true);
|
||||
var values = agency.get("UnitTestsAgency/2", true).arango.UnitTestsAgency.2;
|
||||
assertEqual({ "UnitTestsAgency/2/1/foo" : "baz" }, values);
|
||||
},
|
||||
|
||||
|
@ -500,7 +500,7 @@ function AgencySuite () {
|
|||
assertTrue(agency.remove("UnitTestsAgency", true));
|
||||
|
||||
try {
|
||||
agency.get("UnitTestsAgency", true);
|
||||
agency.get("UnitTestsAgency", true).arango.UnitTestsAgency;
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -541,14 +541,14 @@ function AgencySuite () {
|
|||
for (i = 0; i < 100; ++i) {
|
||||
if (i >= 10 && i < 90) {
|
||||
try {
|
||||
values = agency.get("UnitTestsAgency/" + i);
|
||||
values = agency.get("UnitTestsAgency/" + i).arango.UnitTestsAgency[i];
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
values = agency.get("UnitTestsAgency/" + i);
|
||||
values = agency.get("UnitTestsAgency/" + i).arango.UnitTestsAgency[i];
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/" + i));
|
||||
assertEqual(values["UnitTestsAgency/" + i], "value" + i);
|
||||
}
|
||||
|
@ -564,7 +564,7 @@ function AgencySuite () {
|
|||
|
||||
agency.set("UnitTestsAgency/someDir/foo", "bar");
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foo"], "bar");
|
||||
},
|
||||
|
@ -583,12 +583,12 @@ function AgencySuite () {
|
|||
agency.set("UnitTestsAgency/someDir/foo/2/1/1", "bar5");
|
||||
agency.set("UnitTestsAgency/someDir/foo/2/1/2", "bar6");
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir");
|
||||
var values = agency.get("UnitTestsAgency/someDir").arango.UnitTestsAgency.someDir;
|
||||
assertEqual({ }, values);
|
||||
values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
assertEqual({ }, values);
|
||||
|
||||
values = agency.get("UnitTestsAgency/someDir", true);
|
||||
values = agency.get("UnitTestsAgency/someDir", true).arango.UnitTestsAgency.someDir;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo/1/1/1"));
|
||||
assertEqual("bar1", values["UnitTestsAgency/someDir/foo/1/1/1"]);
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo/1/1/2"));
|
||||
|
@ -613,7 +613,7 @@ function AgencySuite () {
|
|||
agency.set("UnitTestsAgency/someDir/foo", "bar");
|
||||
agency.set("UnitTestsAgency/someDir/bar", "baz");
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir", true, true);
|
||||
var values = agency.get("UnitTestsAgency/someDir", true, true).arango.UnitTestsAgency.someDir;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo"));
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/bar"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foo"].value, "bar");
|
||||
|
@ -630,7 +630,7 @@ function AgencySuite () {
|
|||
assertTrue(agency.createDirectory("UnitTestsAgency/someDir"));
|
||||
assertTrue(agency.set("UnitTestsAgency/someDir/foo", "bar"));
|
||||
|
||||
var values = agency.get("UnitTestsAgency", false);
|
||||
var values = agency.get("UnitTestsAgency", false).arango.UnitTestsAgency;
|
||||
assertEqual({ }, values);
|
||||
},
|
||||
|
||||
|
@ -643,7 +643,7 @@ function AgencySuite () {
|
|||
assertTrue(agency.set("UnitTestsAgency/someDir/foo", "bar"));
|
||||
assertTrue(agency.set("UnitTestsAgency/someDir/baz", "bart"));
|
||||
|
||||
var values = agency.get("UnitTestsAgency", true);
|
||||
var values = agency.get("UnitTestsAgency", true).arango.UnitTestsAgency;
|
||||
assertEqual({ "UnitTestsAgency/someDir/baz" : "bart", "UnitTestsAgency/someDir/foo" : "bar" }, values);
|
||||
},
|
||||
|
||||
|
@ -656,12 +656,12 @@ function AgencySuite () {
|
|||
|
||||
agency.set("UnitTestsAgency/someDir/foo", "bar");
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foo"], "bar");
|
||||
|
||||
agency.set("UnitTestsAgency/someDir/foo", "baz");
|
||||
values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foo"], "baz");
|
||||
},
|
||||
|
@ -675,14 +675,14 @@ function AgencySuite () {
|
|||
|
||||
agency.set("UnitTestsAgency/someDir/foo", "bar");
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
var values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foo"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foo"], "bar");
|
||||
|
||||
agency.remove("UnitTestsAgency/someDir/foo");
|
||||
|
||||
try {
|
||||
values = agency.get("UnitTestsAgency/someDir/foo");
|
||||
values = agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -698,7 +698,7 @@ function AgencySuite () {
|
|||
assertTrue(agency.createDirectory("UnitTestsAgency/someDir"));
|
||||
|
||||
try {
|
||||
agency.get("UnitTestsAgency/someDir/foo");
|
||||
agency.get("UnitTestsAgency/someDir/foo").arango.UnitTestsAgency.someDir.foo;
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -712,7 +712,7 @@ function AgencySuite () {
|
|||
|
||||
testGetNonExisting2 : function () {
|
||||
try {
|
||||
agency.get("UnitTestsAgency/someOtherDir");
|
||||
agency.get("UnitTestsAgency/someOtherDir").arango.UnitTestsAgency.someOtherDir;
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -730,7 +730,7 @@ function AgencySuite () {
|
|||
var value = "bar=BAT;foo=%47abc;degf=2343%20hihi aha\nabc";
|
||||
agency.set("UnitTestsAgency/someDir/foobar", value);
|
||||
|
||||
var values = agency.get("UnitTestsAgency/someDir/foobar");
|
||||
var values = agency.get("UnitTestsAgency/someDir/foobar").arango.UnitTestsAgency.someDir.foobar;
|
||||
assertTrue(values.hasOwnProperty("UnitTestsAgency/someDir/foobar"));
|
||||
assertEqual(values["UnitTestsAgency/someDir/foobar"], value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue