Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

demonstrate bug in json-lib

  • Loading branch information...
commit fd58f699c342ffe65e2bdefa425a516979f307ee 1 parent dcad252
@rnewson authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 src/test/java/com/github/rnewson/couchdb/lucene/JsonTest.java
View
19 src/test/java/com/github/rnewson/couchdb/lucene/JsonTest.java
@@ -0,0 +1,19 @@
+package com.github.rnewson.couchdb.lucene;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+import net.sf.json.JSONObject;
+
+import org.junit.Test;
+
+public class JsonTest {
+
+ @Test
+ public void testEscapedChars() throws Exception {
+ final String str = "{\"seq\":1503,\"id\":\"11dca825e8b19e40bd675345e05afa24\",\"changes\":[{\"rev\":\"2-bb1fba3e33ed2e8b78412fe27c8c6474\"}],\"doc\":{\"_id\":\"11dca825e8b19e40bd675345e05afa24\",\"_rev\":\"2-bb1fba3e33ed2e8b78412fe27c8c6474\",\"query_params\":{\"{\\\"action\\\":\\\"answer\\\",\\\"session-id\\\":41,\\\"answer\\\":5}\":\"\"},\"stack_trace\":\" File \\\"/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/core/handlers/base.py\\\", line 95, in get_response\\n response = middleware_method(request, callback, callback_args, callback_kwargs)\\n File \\\"/var/src/bhoma/bhoma/middleware.py\\\", line 37, in process_view\\n return login_required(view_func)(request, *view_args, **view_kwargs)\\n File \\\"/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/contrib/auth/decorators.py\\\", line 25, in _wrapped_view\\n return view_func(request, *args, **kwargs)\\n File \\\"/var/src/bhoma/bhoma/apps/xforms/views.py\\\", line 74, in player_proxy\\n response, errors = post_data(data, settings.XFORMS_PLAYER_URL, content_type=\\\"text/json\\\")\\n File \\\"/var/src/bhoma/bhoma/utils/post.py\\\", line 34, in post_data\\n\",\"doc_type\":\"ExceptionRecord\",\"url\":\"http://10.10.10.10/xforms/player_proxy\",\"clinic_id\":\"5010110\",\"date\":\"2010-09-08T14:39:11Z\",\"message\":\"[Errno 24] Too many open files: '/tmp/tmp8xIQb7'\",\"type\":\"<type 'exceptions.IOError'>\"}}";
+ assertThat(JSONObject.fromObject(str), is(notNullValue()));
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.