{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare/pulls/comments/36873865","id":36873865,"diff_hunk":"@@ -0,0 +1,58 @@\n+package org.commcare.cases;\n+\n+import org.commcare.test.utils.TestInstanceInitializer;\n+import org.commcare.util.mocks.MockUserDataSandbox;\n+import org.javarosa.core.model.condition.EvaluationContext;\n+import org.javarosa.core.model.instance.ExternalDataInstance;\n+import org.javarosa.model.xform.DataModelSerializer;\n+import org.javarosa.xpath.XPathParseTool;\n+import org.javarosa.xpath.expr.XPathExpression;\n+import org.javarosa.xpath.expr.XPathFuncExpr;\n+import org.javarosa.xpath.parser.XPathSyntaxException;\n+\n+import java.io.ByteArrayOutputStream;\n+import java.io.IOException;\n+\n+public class CaseTestUtils {\n+    public static final String CASE_INSTANCE = \"jr://instance/casedb\";\n+    public static final String LEDGER_INSTANCE = \"jr://instance/ledgerdb\";\n+\n+    public static byte[] loadCaseInstanceIntoSandbox(MockUserDataSandbox sandbox) {","path":"tests/test/org/commcare/cases/CaseTestUtils.java","position":null,"original_position":20,"commit_id":"7e75f3d368d1cc6edb6a3ee968763a477a6f758c","original_commit_id":"de0d839d6da9b94b4b3f3bcc7c6a0ceab240db98","user":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"body":"Oops, named that back when I was super confused about what it was actually doing :)","created_at":"2015-08-12T15:30:25Z","updated_at":"2015-08-12T15:30:25Z","html_url":"https://github.com/dimagi/commcare/pull/127#discussion_r36873865","pull_request_url":"https://api.github.com/repos/dimagi/commcare/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/comments/36873865"},"html":{"href":"https://github.com/dimagi/commcare/pull/127#discussion_r36873865"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare/pulls/127","id":42245769,"html_url":"https://github.com/dimagi/commcare/pull/127","diff_url":"https://github.com/dimagi/commcare/pull/127.diff","patch_url":"https://github.com/dimagi/commcare/pull/127.patch","issue_url":"https://api.github.com/repos/dimagi/commcare/issues/127","number":127,"state":"open","locked":false,"title":"Make case & ledger queries fail silently when no data has been loaded","user":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"body":"XPath case and ledger queries should fail silently when no case or ledger data has been loaded but the base path is of the form:\r\n - ```instance('casedb')/casedb/case[@case_id = 'anything']```\r\n - ```instance('ledger')/ledgerdb/ledger[@entity-id='anything']```\r\n\r\nShould address issues brought up in http://manage.dimagi.com/default.asp?177247","created_at":"2015-08-12T14:28:07Z","updated_at":"2015-08-12T15:30:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12d9e4feebdcd288dd8dd8450df36c32864f2098","assignee":{"login":"ctsims","id":155066,"avatar_url":"https://avatars.githubusercontent.com/u/155066?v=3","gravatar_id":"","url":"https://api.github.com/users/ctsims","html_url":"https://github.com/ctsims","followers_url":"https://api.github.com/users/ctsims/followers","following_url":"https://api.github.com/users/ctsims/following{/other_user}","gists_url":"https://api.github.com/users/ctsims/gists{/gist_id}","starred_url":"https://api.github.com/users/ctsims/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctsims/subscriptions","organizations_url":"https://api.github.com/users/ctsims/orgs","repos_url":"https://api.github.com/users/ctsims/repos","events_url":"https://api.github.com/users/ctsims/events{/privacy}","received_events_url":"https://api.github.com/users/ctsims/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dimagi/commcare/milestones/1","html_url":"https://github.com/dimagi/commcare/milestones/commcare_2.23","labels_url":"https://api.github.com/repos/dimagi/commcare/milestones/1/labels","id":1205336,"number":1,"title":"commcare_2.23","description":null,"creator":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":13,"state":"open","created_at":"2015-07-13T15:35:22Z","updated_at":"2015-08-12T15:19:17Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/dimagi/commcare/pulls/127/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare/pulls/127/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcare/issues/127/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare/statuses/7e75f3d368d1cc6edb6a3ee968763a477a6f758c","head":{"label":"dimagi:bugs/make-ledger-queries-fail-silently","ref":"bugs/make-ledger-queries-fail-silently","sha":"7e75f3d368d1cc6edb6a3ee968763a477a6f758c","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":20939782,"name":"commcare","full_name":"dimagi/commcare","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare","description":"","fork":false,"url":"https://api.github.com/repos/dimagi/commcare","forks_url":"https://api.github.com/repos/dimagi/commcare/forks","keys_url":"https://api.github.com/repos/dimagi/commcare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare/events","assignees_url":"https://api.github.com/repos/dimagi/commcare/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare/merges","archive_url":"https://api.github.com/repos/dimagi/commcare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare/releases{/id}","created_at":"2014-06-17T21:13:25Z","updated_at":"2015-05-01T15:55:40Z","pushed_at":"2015-08-12T15:26:43Z","git_url":"git://github.com/dimagi/commcare.git","ssh_url":"git@github.com:dimagi/commcare.git","clone_url":"https://github.com/dimagi/commcare.git","svn_url":"https://github.com/dimagi/commcare","homepage":null,"size":7399,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":2,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"a99277b51f281a863f994071c0171187f393c749","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":20939782,"name":"commcare","full_name":"dimagi/commcare","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare","description":"","fork":false,"url":"https://api.github.com/repos/dimagi/commcare","forks_url":"https://api.github.com/repos/dimagi/commcare/forks","keys_url":"https://api.github.com/repos/dimagi/commcare/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare/events","assignees_url":"https://api.github.com/repos/dimagi/commcare/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcare/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare/merges","archive_url":"https://api.github.com/repos/dimagi/commcare/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare/releases{/id}","created_at":"2014-06-17T21:13:25Z","updated_at":"2015-05-01T15:55:40Z","pushed_at":"2015-08-12T15:26:43Z","git_url":"git://github.com/dimagi/commcare.git","ssh_url":"git@github.com:dimagi/commcare.git","clone_url":"https://github.com/dimagi/commcare.git","svn_url":"https://github.com/dimagi/commcare","homepage":null,"size":7399,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":8,"forks":3,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/127"},"html":{"href":"https://github.com/dimagi/commcare/pull/127"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare/issues/127"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare/statuses/7e75f3d368d1cc6edb6a3ee968763a477a6f758c"}}}}