summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2013-09-30 18:32:38 +0200
committerJan Lehnardt <jan@apache.org>2013-09-30 18:32:38 +0200
commit6e7e18cc067b293027a2ee64dcd6e84e6fa1c917 (patch)
tree4b29a5566984dc64d60d3171f3655dbcf49d2b7a
parentb14405041b87867878cd1088bfcca41f3b72f3c6 (diff)
downloadcouchdb-remove-e4x-tests.tar.gz
remove E4X testsremove-e4x-tests
-rw-r--r--share/Makefile.am1
-rw-r--r--share/www/script/couch_tests.js1
-rw-r--r--share/www/script/test/list_views.js26
-rw-r--r--share/www/script/test/show_documents.js42
-rw-r--r--share/www/script/test/update_documents.js31
-rw-r--r--share/www/script/test/view_xml.js39
6 files changed, 4 insertions, 136 deletions
diff --git a/share/Makefile.am b/share/Makefile.am
index 135293d58..800b88b0d 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 \
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index 99d63e745..62443f7b0 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
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js
index 3a6e04565..ece81ea00 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));
diff --git a/share/www/script/test/show_documents.js b/share/www/script/test/show_documents.js
index 3c4b43a50..d4c8ac4bb 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};
diff --git a/share/www/script/test/update_documents.js b/share/www/script/test/update_documents.js
index 868421770..bdb7a9981 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);
diff --git a/share/www/script/test/view_xml.js b/share/www/script/test/view_xml.js
deleted file mode 100644
index 3403b47c9..000000000
--- 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");
-};