couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject git commit: refactor replicator_db_security to be more resilient
Date Fri, 08 Feb 2013 20:04:23 GMT
Updated Branches:
  refs/heads/1.3.x 357395267 -> f3c9818fb


refactor replicator_db_security to be more resilient


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f3c9818f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f3c9818f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f3c9818f

Branch: refs/heads/1.3.x
Commit: f3c9818fb6b37071cc7455b11ff716e1344afb98
Parents: 3573952
Author: Jan Lehnardt <jan@apache.org>
Authored: Fri Feb 8 20:35:56 2013 +0100
Committer: Jan Lehnardt <jan@apache.org>
Committed: Fri Feb 8 21:04:18 2013 +0100

----------------------------------------------------------------------
 share/www/script/test/replicator_db_security.js |   20 ++++++++++-------
 1 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f3c9818f/share/www/script/test/replicator_db_security.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/replicator_db_security.js b/share/www/script/test/replicator_db_security.js
index 67390cf..7a2bfd1 100644
--- a/share/www/script/test/replicator_db_security.js
+++ b/share/www/script/test/replicator_db_security.js
@@ -11,14 +11,19 @@
 // the License.
 
 couchTests.replicator_db_security = function(debug) {
+
+  var reset_dbs = function(dbs) {
+    dbs.forEach(function(db) {
+      db.deleteDb();
+      try { db.createDb() } catch (e) {};
+    });
+  };
+
   var dbs = ["couch_test_rep_db", "couch_test_users_db",
     "test_suite_db_a", "test_suite_db_b", "test_suite_db_c"]
     .map(function(db_name) {
-      var db = new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
-      db.deleteDb();
-      db.createDb();
-      return db;
-  });
+      return new CouchDB(db_name, {"X-Couch-Full-Commit":"false"});
+    });
 
   var repDb = dbs[0];
   var usersDb = dbs[1];
@@ -94,6 +99,8 @@ couchTests.replicator_db_security = function(debug) {
 
   var testFun = function()
   {
+    reset_dbs(dbs);
+
     // _replicator db
     // in admin party mode, anonymous should be able to create a replication
     var repDoc = {
@@ -372,9 +379,6 @@ couchTests.replicator_db_security = function(debug) {
       });
   };
 
-  usersDb.deleteDb();
-  repDb.deleteDb();
-
   run_on_modified_server([
     {
       section: "couch_httpd_auth",


Mime
View raw message