You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by jc...@apache.org on 2008/10/11 19:58:49 UTC

svn commit: r703698 - in /incubator/couchdb/trunk: share/www/script/couch_tests.js test/test.js

Author: jchris
Date: Sat Oct 11 10:58:48 2008
New Revision: 703698

URL: http://svn.apache.org/viewvc?rev=703698&view=rev
Log:
simplified CouchDB.port handling in tests

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js
    incubator/couchdb/trunk/test/test.js

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=703698&r1=703697&r2=703698&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Sat Oct 11 10:58:48 2008
@@ -12,8 +12,7 @@
 
 // Used by replication test
 CouchDB.host = (typeof window == 'undefined' || !window) ? 
-                  "127.0.0.1" : window.location.host;
-CouchDB.port = 5984;
+                  "127.0.0.1:5984" : window.location.host;
 
 var tests = {
 
@@ -1868,8 +1867,9 @@
     // test that /_config returns all the settings
     var xhr = CouchDB.request("GET", "/_config");
     var config = JSON.parse(xhr.responseText);
+    var port = CouchDB.host.split(':').pop()
     T(config.couchdb.database_dir);
-    T(config.httpd.port == CouchDB.port);
+    T(config.httpd.port == port);
     T(config.daemons.httpd);
     T(config.httpd_global_handlers._config);
     T(config.log.level);

Modified: incubator/couchdb/trunk/test/test.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/test/test.js?rev=703698&r1=703697&r2=703698&view=diff
==============================================================================
--- incubator/couchdb/trunk/test/test.js (original)
+++ incubator/couchdb/trunk/test/test.js Sat Oct 11 10:58:48 2008
@@ -118,11 +118,10 @@
 
 // Monkeypatches to CouchDB client for use of curl.
 
-CouchDB.host = (typeof window == 'undefined' || !window) ? "127.0.0.1" : window;
-CouchDB.port = 5984;
+CouchDB.host = (typeof window == 'undefined' || !window) ? "127.0.0.1:5984" : window;
 
 CouchDB.request = function(method, uri, options) {
-  var full_uri = "http://" + CouchDB.host + ":" + CouchDB.port + uri;
+  var full_uri = "http://" + CouchDB.host + uri;
   options = options || {};
   var response = HTTP[method](full_uri, options.body, options.headers);
   return response;
@@ -239,7 +238,6 @@
 
 p("Running CouchDB Test Suite\n");
 p("Host: "+CouchDB.host);
-p("Port: "+CouchDB.port);
 
 try {
   p("Version: "+CouchDB.getVersion()+"\n");