You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/10/07 18:46:36 UTC

[2/4] git commit: updated refs/heads/master to 0192566

remove E4X tests


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

Branch: refs/heads/master
Commit: 6e7e18cc067b293027a2ee64dcd6e84e6fa1c917
Parents: b144050
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Sep 30 18:32:38 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Sep 30 18:32:38 2013 +0200

----------------------------------------------------------------------
 share/Makefile.am                         |  1 -
 share/www/script/couch_tests.js           |  1 -
 share/www/script/test/list_views.js       | 26 +---------------
 share/www/script/test/show_documents.js   | 42 --------------------------
 share/www/script/test/update_documents.js | 31 ++-----------------
 share/www/script/test/view_xml.js         | 39 ------------------------
 6 files changed, 4 insertions(+), 136 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/Makefile.am
----------------------------------------------------------------------
diff --git a/share/Makefile.am b/share/Makefile.am
index 135293d..800b88b 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -218,7 +218,6 @@ nobase_dist_localdata_DATA = \
     www/script/test/view_update_seq.js \
     www/script/test/view_pagination.js \
     www/script/test/view_sandboxing.js \
-    www/script/test/view_xml.js \
     www/spec/couch_js_class_methods_spec.js \
     www/spec/couch_js_instance_methods_1_spec.js \
     www/spec/couch_js_instance_methods_2_spec.js \

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/www/script/couch_tests.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 99d63e7..62443f7 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -110,6 +110,5 @@ loadTest("view_offsets.js");
 loadTest("view_pagination.js");
 loadTest("view_sandboxing.js");
 loadTest("view_update_seq.js");
-loadTest("view_xml.js");
 // keep sorted
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/www/script/test/list_views.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
index 3a6e045..ece81ea 100644
--- a/share/www/script/test/list_views.js
+++ b/share/www/script/test/list_views.js
@@ -90,20 +90,6 @@ couchTests.list_views = function(debug) {
           // tail
           return '</ul>';
         });
-
-        provides("xml", function() {
-          send('<feed xmlns="http://www.w3.org/2005/Atom">'
-            +'<title>Test XML Feed</title>');
-
-          while (row = getRow()) {
-            var entry = new XML('<entry/>');
-            entry.id = row.id;
-            entry.title = row.key;
-            entry.content = row.value;
-            send(entry);
-          }
-          return "</feed>";
-        });
       }),
       qsParams: stringFun(function(head, req) {
         return toJSON(req.query) + "\n";
@@ -413,21 +399,11 @@ couchTests.list_views = function(debug) {
   T(xhr.responseText.match(/HTML/));
   T(xhr.responseText.match(/Value/));
 
-  // now with xml
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/lists/_list/acceptSwitch/basicView", {
-    headers: {
-      "Accept": 'application/xml'
-    }
-  });
-  T(xhr.getResponseHeader("Content-Type") == "application/xml");
-  T(xhr.responseText.match(/XML/));
-  T(xhr.responseText.match(/entry/));
-
   // Test we can run lists and views from separate docs.
   T(db.save(viewOnlyDesignDoc).ok);
   var url = "/test_suite_db/_design/lists/_list/simpleForm/views/basicView" +
                 "?startkey=-3";
-  xhr = CouchDB.request("GET", url); 
+  xhr = CouchDB.request("GET", url);
   T(xhr.status == 200, "multiple design docs.");
   T(!(/Key: -4/.test(xhr.responseText)));
   T(/FirstKey: -3/.test(xhr.responseText));

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/www/script/test/show_documents.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js
index 3c4b43a..d4c8ac4 100644
--- a/share/www/script/test/show_documents.js
+++ b/share/www/script/test/show_documents.js
@@ -70,14 +70,6 @@ couchTests.show_documents = function(debug) {
       "fail" : stringFun(function(doc, req) {
         return doc._id;
       }),
-      "xml-type" : stringFun(function(doc, req) {
-         return {
-           "headers" : {
-             "Content-Type" : "application/xml"
-           },
-           "body" : new XML('<xml><node foo="bar"/></xml>').toXMLString()
-         }
-       }),
       "no-set-etag" : stringFun(function(doc, req) {
         return {
           headers : {
@@ -159,16 +151,6 @@ couchTests.show_documents = function(debug) {
           return "Ha ha, you said \"" + doc.word + "\".";
         });
 
-        provides("xml", function() {
-          var xml = new XML('<xml><node/></xml>');
-          // Becase Safari can't stand to see that dastardly
-          // E4X outside of a string. Outside of tests you
-          // can just use E4X literals.
-          eval('xml.node.@foo = doc.word');
-          log('xml: '+xml.toSource());
-          return xml.toXMLString();
-        });
-        
         provides("foo", function() {
           return "foofoo";
         });
@@ -253,11 +235,6 @@ couchTests.show_documents = function(debug) {
   T(equals(resp.path[5], docid));
   T(equals(resp.info.db_name, "test_suite_db"));
 
-  // returning a content-type
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/xml-type/"+docid);
-  T("application/xml" == xhr.getResponseHeader("Content-Type"));
-  T("Accept" == xhr.getResponseHeader("Vary"));
-
   // accept header switching
   // different mime has different etag
   xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/accept-switch/"+docid, {
@@ -349,16 +326,6 @@ couchTests.show_documents = function(debug) {
   T(/text\/html/.test(ct))
   T(xhr.responseText == "Ha ha, you said \"plankton\".");
 
-  // now with xml
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
-    headers: {
-      "Accept": 'application/xml'
-    }
-  });
-  T(xhr.getResponseHeader("Content-Type") == "application/xml");
-  T(xhr.responseText.match(/node/));
-  T(xhr.responseText.match(/plankton/));
-
   // registering types works
   xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
     headers: {
@@ -378,15 +345,6 @@ couchTests.show_documents = function(debug) {
   T(rs.error == "not_acceptable")
 
 
-  // should fallback on the first one
-  xhr = CouchDB.request("GET", "/test_suite_db/_design/template/_show/provides/"+docid, {
-   headers: {
-     "Accept": 'application/x-foo, application/xml'
-   }
-  });
-  var ct = xhr.getResponseHeader("Content-Type");
-  T(/application\/xml/.test(ct));  
-
   // test inclusion of conflict state
   var doc1 = {_id:"foo", a:1};
   var doc2 = {_id:"foo", a:2};

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/www/script/test/update_documents.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js
index 8684217..bdb7a99 100644
--- a/share/www/script/test/update_documents.js
+++ b/share/www/script/test/update_documents.js
@@ -33,8 +33,8 @@ couchTests.update_documents = function(debug) {
             // and returns an HTML response to the client.
             "<p>New World</p>"];
           };
-          // 
-          return [null, "<p>Empty World</p>"];          
+          //
+          return [null, "<p>Empty World</p>"];
         };
         // we can update the document inline
         doc.world = "hello";
@@ -66,20 +66,6 @@ couchTests.update_documents = function(debug) {
       "error" : stringFun(function(doc, req) {
         superFail.badCrash;
       }),
-      "xml" : stringFun(function(doc, req) {
-        var xml = new XML('<xml></xml>');
-        xml.title = doc.title;
-        var posted_xml = new XML(req.body);
-        doc.via_xml = posted_xml.foo.toString();
-        var resp =  {
-          "headers" : {
-            "Content-Type" : "application/xml"
-          },
-          "body" : xml.toXMLString()
-        };
-         
-         return [doc, resp];
-       }),
        "get-uuid" : stringFun(function(doc, req) {
          return [null, req.uuid];
        }),
@@ -156,7 +142,7 @@ couchTests.update_documents = function(debug) {
   xhr = CouchDB.request("GET", "/test_suite_db/nonExistingDoc");
   T(xhr.status == 200);
 
-  // in place update 
+  // in place update
   xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/in-place/"+docid+'?field=title&value=test');
   T(xhr.status == 201);
   T(xhr.responseText == "set title to test");
@@ -195,17 +181,6 @@ couchTests.update_documents = function(debug) {
   
   T(doc.counter == 2);
 
-  // parse xml
-  xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/xml/"+docid, {
-    headers : {"X-Couch-Full-Commit":"true"},
-    "body" : '<xml><foo>bar</foo></xml>'
-  });
-  T(xhr.status == 201);
-  T(xhr.responseText == "<xml>\n  <title>test</title>\n</xml>");
-  
-  doc = db.open(docid);
-  T(doc.via_xml == "bar");
-  
   // Server provides UUID when POSTing without an ID in the URL
   xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/get-uuid/");
   T(xhr.status == 200);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/6e7e18cc/share/www/script/test/view_xml.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/view_xml.js b/share/www/script/test/view_xml.js
deleted file mode 100644
index 3403b47..0000000
--- a/share/www/script/test/view_xml.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-couchTests.view_xml = function(debug) {
-  var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"});
-  db.deleteDb();
-  db.createDb();
-  if (debug) debugger;
-
-  db.save({content: "<doc><title id='xml'>Testing XML</title></doc>"});
-  db.save({content: "<doc><title id='e4x'>Testing E4X</title></doc>"});
-
-  var results = db.query(
-    "function(doc) {\n" +
-    "  var xml = new XML(doc.content);\n" +
-    "  emit(xml.title.text().toXMLString(), null);\n" +
-    "}");
-  T(results.total_rows == 2);
-  T(results.rows[0].key == "Testing E4X");
-  T(results.rows[1].key == "Testing XML");
-
-  var results = db.query(
-    "function(doc) {\n" +
-    "  var xml = new XML(doc.content);\n" +
-    "  emit(xml.title.@id.toXMLString(), null);\n" +
-    "}");
-  T(results.total_rows == 2);
-  T(results.rows[0].key == "e4x");
-  T(results.rows[1].key == "xml");
-};