couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [12/48] couch commit: updated refs/heads/master to 7776921
Date Sat, 04 Apr 2015 23:29:07 GMT
Replace s/ejson:/jiffy:/g

COUCHDB-2547


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

Branch: refs/heads/master
Commit: b5d8e09e725e4480e0ccd073eec7a7161d4adcc6
Parents: f568893
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Tue Jan 27 10:51:29 2015 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Feb 10 10:41:04 2015 -0800

----------------------------------------------------------------------
 src/test_util.erl                  |  2 +-
 test/couchdb_attachments_tests.erl | 20 ++++++++++----------
 test/couchdb_vhosts_tests.erl      | 28 ++++++++++++++--------------
 test/couchdb_views_tests.erl       |  4 ++--
 4 files changed, 27 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b5d8e09e/src/test_util.erl
----------------------------------------------------------------------
diff --git a/src/test_util.erl b/src/test_util.erl
index d4eb882..0fbf1de 100644
--- a/src/test_util.erl
+++ b/src/test_util.erl
@@ -39,7 +39,7 @@ init_code_path() ->
     Paths = [
         "etap",
         "couchdb",
-        "ejson",
+        "jiffy",
         "oauth",
         "ibrowse",
         "mochiweb",

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b5d8e09e/test/couchdb_attachments_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_attachments_tests.erl b/test/couchdb_attachments_tests.erl
index 9a43939..083efc7 100644
--- a/test/couchdb_attachments_tests.erl
+++ b/test/couchdb_attachments_tests.erl
@@ -365,7 +365,7 @@ should_get_doc_with_att_data(compressed, {Data, {_, DocUrl, _}}) ->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         AttJson = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_TXT_NAME]),
         AttData = couch_util:get_nested_json_value(
@@ -381,7 +381,7 @@ should_get_doc_with_att_data({text, _}, {Data, {_, DocUrl, _}}) ->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         AttJson = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_TXT_NAME]),
         AttData = couch_util:get_nested_json_value(
@@ -397,7 +397,7 @@ should_get_doc_with_att_data({binary, _}, {Data, {_, DocUrl, _}}) ->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         AttJson = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_BIN_NAME]),
         AttData = couch_util:get_nested_json_value(
@@ -414,7 +414,7 @@ should_get_doc_with_att_data_stub(compressed, {Data, {_, DocUrl, _}})
->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         {AttJson} = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_TXT_NAME]),
         ?assertEqual(<<"gzip">>,
@@ -430,7 +430,7 @@ should_get_doc_with_att_data_stub({text, _}, {Data, {_, DocUrl, _}}) ->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         {AttJson} = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_TXT_NAME]),
         ?assertEqual(<<"gzip">>,
@@ -447,7 +447,7 @@ should_get_doc_with_att_data_stub({binary, _}, {Data, {_, DocUrl, _}})
->
         {ok, Code, _, Body} = test_request:get(
             Url, [{"Accept", "application/json"}]),
         ?assertEqual(200, Code),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         {AttJson} = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_BIN_NAME]),
         ?assertEqual(undefined,
@@ -504,7 +504,7 @@ should_create_compressible_att_with_ctype_params({Host, DbName}) ->
         {ok, Code1, _, Body} = test_request:get(
             DocUrl ++ "?att_encoding_info=true"),
         ?assertEqual(200, Code1),
-        Json = ejson:decode(Body),
+        Json = jiffy:decode(Body),
         {AttJson} = couch_util:get_nested_json_value(
             Json, [<<"_attachments">>, ?ATT_TXT_NAME]),
         ?assertEqual(<<"gzip">>,
@@ -565,7 +565,7 @@ request(Method, Url, Headers, Body) ->
     [Header, Body1] = re:split(R, "\r\n\r\n", [{return, binary}]),
     {ok, {http_response, _, Code, _}, _} =
         erlang:decode_packet(http, Header, []),
-    Json = ejson:decode(Body1),
+    Json = jiffy:decode(Body1),
     {ok, Code, Json}.
 
 create_standalone_text_att(Host, DbName) ->
@@ -596,7 +596,7 @@ create_inline_text_att(Host, DbName) ->
         }]}}
     ]},
     {ok, Code, _Headers, _Body} = test_request:put(
-        Url, [{"Content-Type", "application/json"}], ejson:encode(Doc)),
+        Url, [{"Content-Type", "application/json"}], jiffy:encode(Doc)),
     ?assertEqual(201, Code),
     string:join([Url, ?b2l(?ATT_TXT_NAME)], "/").
 
@@ -612,7 +612,7 @@ create_inline_png_att(Host, DbName) ->
         }]}}
     ]},
     {ok, Code, _Headers, _Body} = test_request:put(
-        Url, [{"Content-Type", "application/json"}], ejson:encode(Doc)),
+        Url, [{"Content-Type", "application/json"}], jiffy:encode(Doc)),
     ?assertEqual(201, Code),
     string:join([Url, ?b2l(?ATT_BIN_NAME)], "/").
 

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b5d8e09e/test/couchdb_vhosts_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_vhosts_tests.erl b/test/couchdb_vhosts_tests.erl
index e2e8cbf..aea00ec 100644
--- a/test/couchdb_vhosts_tests.erl
+++ b/test/couchdb_vhosts_tests.erl
@@ -144,7 +144,7 @@ should_return_database_info({Url, DbName}) ->
         ok = config:set("vhosts", "example.com", "/" ++ DbName, false),
         case test_request:get(Url, [], [{host_header, "example.com"}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"db_name">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -160,7 +160,7 @@ should_return_revs_info({Url, DbName}) ->
         case test_request:get(Url ++ "/doc1?revs_info=true", [],
                               [{host_header, "example.com"}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"_revs_info">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -192,7 +192,7 @@ should_return_virtual_request_path_field_in_request({Url, DbName}) ->
                               false),
         case test_request:get(Url, [], [{host_header, "example1.com"}]) of
             {ok, _, _, Body} ->
-                {Json} = ejson:decode(Body),
+                {Json} = jiffy:decode(Body),
                 ?assertEqual(<<"/">>,
                              proplists:get_value(<<"requested_path">>, Json));
             Else ->
@@ -210,7 +210,7 @@ should_return_real_request_path_field_in_request({Url, DbName}) ->
                               false),
         case test_request:get(Url, [], [{host_header, "example1.com"}]) of
             {ok, _, _, Body} ->
-                {Json} = ejson:decode(Body),
+                {Json} = jiffy:decode(Body),
                 Path = ?l2b("/" ++ DbName ++ "/_design/doc1/_show/test"),
                 ?assertEqual(Path, proplists:get_value(<<"path">>, Json));
             Else ->
@@ -227,7 +227,7 @@ should_match_wildcard_vhost({Url, DbName}) ->
                               "/" ++ DbName ++ "/_design/doc1/_rewrite", false),
         case test_request:get(Url, [], [{host_header, "test.example.com"}]) of
             {ok, _, _, Body} ->
-                {Json} = ejson:decode(Body),
+                {Json} = jiffy:decode(Body),
                 Path = ?l2b("/" ++ DbName ++ "/_design/doc1/_show/test"),
                 ?assertEqual(Path, proplists:get_value(<<"path">>, Json));
             Else ->
@@ -245,7 +245,7 @@ should_return_db_info_for_wildcard_vhost_for_custom_db({Url, DbName})
->
         Host = DbName ++ ".example1.com",
         case test_request:get(Url, [], [{host_header, Host}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"db_name">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -262,7 +262,7 @@ should_replace_rewrite_variables_for_db_and_doc({Url, DbName}) ->
         Host = "doc1." ++ DbName ++ ".example1.com",
         case test_request:get(Url, [], [{host_header, Host}]) of
             {ok, _, _, Body} ->
-                {Json} = ejson:decode(Body),
+                {Json} = jiffy:decode(Body),
                 Path = ?l2b("/" ++ DbName ++ "/_design/doc1/_show/test"),
                 ?assertEqual(Path, proplists:get_value(<<"path">>, Json));
             Else ->
@@ -280,7 +280,7 @@ should_return_db_info_for_vhost_with_resource({Url, DbName}) ->
         ReqUrl = Url ++ "/test",
         case test_request:get(ReqUrl, [], [{host_header, "example.com"}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"db_name">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -298,7 +298,7 @@ should_return_revs_info_for_vhost_with_resource({Url, DbName}) ->
         ReqUrl = Url ++ "/test/doc1?revs_info=true",
         case test_request:get(ReqUrl, [], [{host_header, "example.com"}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"_revs_info">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -315,7 +315,7 @@ should_return_db_info_for_vhost_with_wildcard_resource({Url, DbName})
->
         Host = DbName ++ ".example2.com",
         case test_request:get(ReqUrl, [], [{host_header, Host}]) of
             {ok, _, _, Body} ->
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assert(proplists:is_defined(<<"db_name">>, JsonBody));
             Else ->
                 erlang:error({assertion_failed,
@@ -332,7 +332,7 @@ should_return_path_for_vhost_with_wildcard_host({Url, DbName}) ->
                               false),
         case test_request:get(Url ++ "/test1") of
             {ok, _, _, Body} ->
-                {Json} = ejson:decode(Body),
+                {Json} = jiffy:decode(Body),
                 Path = ?l2b("/" ++ DbName ++ "/_design/doc1/_show/test"),
                 ?assertEqual(Path, proplists:get_value(<<"path">>, Json));
             Else ->
@@ -348,7 +348,7 @@ should_require_auth({Url, _}) ->
         case test_request:get(Url, [], [{host_header, "oauth-example.com"}]) of
             {ok, Code, _, Body} ->
                 ?assertEqual(401, Code),
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assertEqual(<<"unauthorized">>,
                              couch_util:get_value(<<"error">>, JsonBody));
             Else ->
@@ -382,7 +382,7 @@ should_succeed_oauth({Url, _}) ->
         case test_request:get(OAuthUrl, [], [{host_header, Host}]) of
             {ok, Code, _, Body} ->
                 ?assertEqual(200, Code),
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assertEqual(<<"test">>,
                              couch_util:get_value(<<"name">>, JsonBody));
             Else ->
@@ -416,7 +416,7 @@ should_fail_oauth_with_wrong_credentials({Url, _}) ->
         case test_request:get(OAuthUrl, [], [{host_header, Host}]) of
             {ok, Code, _, Body} ->
                 ?assertEqual(401, Code),
-                {JsonBody} = ejson:decode(Body),
+                {JsonBody} = jiffy:decode(Body),
                 ?assertEqual(<<"unauthorized">>,
                              couch_util:get_value(<<"error">>, JsonBody));
             Else ->

http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b5d8e09e/test/couchdb_views_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_views_tests.erl b/test/couchdb_views_tests.erl
index 6282be6..436e625 100644
--- a/test/couchdb_views_tests.erl
+++ b/test/couchdb_views_tests.erl
@@ -479,7 +479,7 @@ query_view(DbName, DDoc, View, Stale) ->
                _ -> "?stale=" ++ atom_to_list(Stale)
            end),
     ?assertEqual(200, Code),
-    {Props} = ejson:decode(Body),
+    {Props} = jiffy:decode(Body),
     couch_util:get_value(<<"rows">>, Props, []).
 
 check_rows_value(Rows, Value) ->
@@ -568,7 +568,7 @@ wait_view_compact_done(DbName, DDocId, N) ->
     {ok, Code, _Headers, Body} = test_request:get(
         db_url(DbName) ++ "/" ++ ?b2l(DDocId) ++ "/_info"),
     ?assertEqual(200, Code),
-    {Info} = ejson:decode(Body),
+    {Info} = jiffy:decode(Body),
     {IndexInfo} = couch_util:get_value(<<"view_index">>, Info),
     CompactRunning = couch_util:get_value(<<"compact_running">>, IndexInfo),
     case CompactRunning of


Mime
View raw message