{"action":"created","comment":{"url":"https://api.github.com/repos/apache/tajo/pulls/comments/26897619","id":26897619,"diff_hunk":"@@ -317,6 +333,60 @@ public ResultSet executeQuery() throws Exception {\n     return executeFile(getMethodName() + \".sql\");\n   }\n \n+  private volatile Description current;\n+\n+  @Rule\n+  public TestRule watcher = new TestWatcher() {\n+    @Override\n+    protected void starting(Description description) {\n+      QueryTestCaseBase.this.current = description;\n+    }\n+  };\n+\n+  @Target({ElementType.METHOD})\n+  @Retention(RetentionPolicy.RUNTIME)\n+  protected static @interface SimpleTest {\n+    String[] queries();\n+    String[] cleanupTables() default {};\n+  }\n+\n+  protected void runSimpleTests() throws Exception {\n+    String methodName = getMethodName();\n+    Method method = current.getTestClass().getMethod(methodName);\n+    SimpleTest annotation = method.getAnnotation(SimpleTest.class);\n+    if (annotation == null) {\n+      throw new IllegalStateException(\"Cannot find test annotation\");\n+    }\n+    String[] queries = annotation.queries();\n+    try {\n+      for (int i = 0; i < queries.length; i++) {\n+        ResultSet result = client.executeQueryAndGetResult(queries[i]);\n+        Path resultPath = StorageUtil.concatPath(\n+            currentResultPath, methodName + \".\" + String.valueOf(i + 1) + \".result\");\n+        if (currentResultFS.exists(resultPath)) {\n+          assertEquals(\"Result Verification\",\n+              FileUtil.readTextFromStream(currentResultFS.open(resultPath)), resultSetToString(result).trim());\n+        } else if (!isNull(result)) {\n+          FileUtil.writeTextToStream(resultSetToString(result).trim(), currentResultFS.create(resultPath));","path":"tajo-core/src/test/java/org/apache/tajo/QueryTestCaseBase.java","position":93,"original_position":93,"commit_id":"9fe6e6aa63c3b1351dfec3648a566e8b89c9286b","original_commit_id":"9fe6e6aa63c3b1351dfec3648a566e8b89c9286b","user":{"login":"navis","id":809395,"avatar_url":"https://avatars.githubusercontent.com/u/809395?v=3","gravatar_id":"","url":"https://api.github.com/users/navis","html_url":"https://github.com/navis","followers_url":"https://api.github.com/users/navis/followers","following_url":"https://api.github.com/users/navis/following{/other_user}","gists_url":"https://api.github.com/users/navis/gists{/gist_id}","starred_url":"https://api.github.com/users/navis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navis/subscriptions","organizations_url":"https://api.github.com/users/navis/orgs","repos_url":"https://api.github.com/users/navis/repos","events_url":"https://api.github.com/users/navis/events{/privacy}","received_events_url":"https://api.github.com/users/navis/received_events","type":"User","site_admin":false},"body":"In the first patch, it was just else { FileUtils.write..} ,which is for creating gold file for new test. In hive there are option (-Dtest.overwrite=true) but I couldn't find something like that in Tajo. So just I've made one if there is no result file expected.\r\n\r\nAdding \"isNull\" to the clause in next patch was because I though some DDL queries can be used in here, which has no output result. For example,\r\n\r\nSimpleTest(queres= {\"create table x ...\", \"select * from x..\"}, cleanup=\"x\")","created_at":"2015-03-21T22:49:20Z","updated_at":"2015-03-21T22:49:20Z","html_url":"https://github.com/apache/tajo/pull/441#discussion_r26897619","pull_request_url":"https://api.github.com/repos/apache/tajo/pulls/441","_links":{"self":{"href":"https://api.github.com/repos/apache/tajo/pulls/comments/26897619"},"html":{"href":"https://github.com/apache/tajo/pull/441#discussion_r26897619"},"pull_request":{"href":"https://api.github.com/repos/apache/tajo/pulls/441"}}},"pull_request":{"url":"https://api.github.com/repos/apache/tajo/pulls/441","id":31587283,"html_url":"https://github.com/apache/tajo/pull/441","diff_url":"https://github.com/apache/tajo/pull/441.diff","patch_url":"https://github.com/apache/tajo/pull/441.patch","issue_url":"https://api.github.com/repos/apache/tajo/issues/441","number":441,"state":"open","locked":false,"title":"TAJO-1426 Support \"explain physical\" to get physical plan","user":{"login":"navis","id":809395,"avatar_url":"https://avatars.githubusercontent.com/u/809395?v=3","gravatar_id":"","url":"https://api.github.com/users/navis","html_url":"https://github.com/navis","followers_url":"https://api.github.com/users/navis/followers","following_url":"https://api.github.com/users/navis/following{/other_user}","gists_url":"https://api.github.com/users/navis/gists{/gist_id}","starred_url":"https://api.github.com/users/navis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navis/subscriptions","organizations_url":"https://api.github.com/users/navis/orgs","repos_url":"https://api.github.com/users/navis/repos","events_url":"https://api.github.com/users/navis/events{/privacy}","received_events_url":"https://api.github.com/users/navis/received_events","type":"User","site_admin":false},"body":"Quite useful","created_at":"2015-03-20T04:15:44Z","updated_at":"2015-03-21T22:49:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac185e3d9b13987ce364dd29d1ab899119ff3fbc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/tajo/pulls/441/commits","review_comments_url":"https://api.github.com/repos/apache/tajo/pulls/441/comments","review_comment_url":"https://api.github.com/repos/apache/tajo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/tajo/issues/441/comments","statuses_url":"https://api.github.com/repos/apache/tajo/statuses/9fe6e6aa63c3b1351dfec3648a566e8b89c9286b","head":{"label":"navis:TAJO-1426","ref":"TAJO-1426","sha":"9fe6e6aa63c3b1351dfec3648a566e8b89c9286b","user":{"login":"navis","id":809395,"avatar_url":"https://avatars.githubusercontent.com/u/809395?v=3","gravatar_id":"","url":"https://api.github.com/users/navis","html_url":"https://github.com/navis","followers_url":"https://api.github.com/users/navis/followers","following_url":"https://api.github.com/users/navis/following{/other_user}","gists_url":"https://api.github.com/users/navis/gists{/gist_id}","starred_url":"https://api.github.com/users/navis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navis/subscriptions","organizations_url":"https://api.github.com/users/navis/orgs","repos_url":"https://api.github.com/users/navis/repos","events_url":"https://api.github.com/users/navis/events{/privacy}","received_events_url":"https://api.github.com/users/navis/received_events","type":"User","site_admin":false},"repo":{"id":31691493,"name":"tajo","full_name":"navis/tajo","owner":{"login":"navis","id":809395,"avatar_url":"https://avatars.githubusercontent.com/u/809395?v=3","gravatar_id":"","url":"https://api.github.com/users/navis","html_url":"https://github.com/navis","followers_url":"https://api.github.com/users/navis/followers","following_url":"https://api.github.com/users/navis/following{/other_user}","gists_url":"https://api.github.com/users/navis/gists{/gist_id}","starred_url":"https://api.github.com/users/navis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/navis/subscriptions","organizations_url":"https://api.github.com/users/navis/orgs","repos_url":"https://api.github.com/users/navis/repos","events_url":"https://api.github.com/users/navis/events{/privacy}","received_events_url":"https://api.github.com/users/navis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/navis/tajo","description":"Mirror of Apache Tajo","fork":true,"url":"https://api.github.com/repos/navis/tajo","forks_url":"https://api.github.com/repos/navis/tajo/forks","keys_url":"https://api.github.com/repos/navis/tajo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/navis/tajo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/navis/tajo/teams","hooks_url":"https://api.github.com/repos/navis/tajo/hooks","issue_events_url":"https://api.github.com/repos/navis/tajo/issues/events{/number}","events_url":"https://api.github.com/repos/navis/tajo/events","assignees_url":"https://api.github.com/repos/navis/tajo/assignees{/user}","branches_url":"https://api.github.com/repos/navis/tajo/branches{/branch}","tags_url":"https://api.github.com/repos/navis/tajo/tags","blobs_url":"https://api.github.com/repos/navis/tajo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/navis/tajo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/navis/tajo/git/refs{/sha}","trees_url":"https://api.github.com/repos/navis/tajo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/navis/tajo/statuses/{sha}","languages_url":"https://api.github.com/repos/navis/tajo/languages","stargazers_url":"https://api.github.com/repos/navis/tajo/stargazers","contributors_url":"https://api.github.com/repos/navis/tajo/contributors","subscribers_url":"https://api.github.com/repos/navis/tajo/subscribers","subscription_url":"https://api.github.com/repos/navis/tajo/subscription","commits_url":"https://api.github.com/repos/navis/tajo/commits{/sha}","git_commits_url":"https://api.github.com/repos/navis/tajo/git/commits{/sha}","comments_url":"https://api.github.com/repos/navis/tajo/comments{/number}","issue_comment_url":"https://api.github.com/repos/navis/tajo/issues/comments{/number}","contents_url":"https://api.github.com/repos/navis/tajo/contents/{+path}","compare_url":"https://api.github.com/repos/navis/tajo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/navis/tajo/merges","archive_url":"https://api.github.com/repos/navis/tajo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/navis/tajo/downloads","issues_url":"https://api.github.com/repos/navis/tajo/issues{/number}","pulls_url":"https://api.github.com/repos/navis/tajo/pulls{/number}","milestones_url":"https://api.github.com/repos/navis/tajo/milestones{/number}","notifications_url":"https://api.github.com/repos/navis/tajo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/navis/tajo/labels{/name}","releases_url":"https://api.github.com/repos/navis/tajo/releases{/id}","created_at":"2015-03-05T02:27:06Z","updated_at":"2015-03-05T02:27:12Z","pushed_at":"2015-03-21T01:13:58Z","git_url":"git://github.com/navis/tajo.git","ssh_url":"git@github.com:navis/tajo.git","clone_url":"https://github.com/navis/tajo.git","svn_url":"https://github.com/navis/tajo","homepage":null,"size":15543,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"154f5b9e1c619ce4327aa055fb3ef02d6030fc0d","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17971138,"name":"tajo","full_name":"apache/tajo","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/tajo","description":"Mirror of Apache Tajo","fork":false,"url":"https://api.github.com/repos/apache/tajo","forks_url":"https://api.github.com/repos/apache/tajo/forks","keys_url":"https://api.github.com/repos/apache/tajo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/tajo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/tajo/teams","hooks_url":"https://api.github.com/repos/apache/tajo/hooks","issue_events_url":"https://api.github.com/repos/apache/tajo/issues/events{/number}","events_url":"https://api.github.com/repos/apache/tajo/events","assignees_url":"https://api.github.com/repos/apache/tajo/assignees{/user}","branches_url":"https://api.github.com/repos/apache/tajo/branches{/branch}","tags_url":"https://api.github.com/repos/apache/tajo/tags","blobs_url":"https://api.github.com/repos/apache/tajo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/tajo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/tajo/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/tajo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/tajo/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/tajo/languages","stargazers_url":"https://api.github.com/repos/apache/tajo/stargazers","contributors_url":"https://api.github.com/repos/apache/tajo/contributors","subscribers_url":"https://api.github.com/repos/apache/tajo/subscribers","subscription_url":"https://api.github.com/repos/apache/tajo/subscription","commits_url":"https://api.github.com/repos/apache/tajo/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/tajo/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/tajo/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/tajo/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/tajo/contents/{+path}","compare_url":"https://api.github.com/repos/apache/tajo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/tajo/merges","archive_url":"https://api.github.com/repos/apache/tajo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/tajo/downloads","issues_url":"https://api.github.com/repos/apache/tajo/issues{/number}","pulls_url":"https://api.github.com/repos/apache/tajo/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/tajo/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/tajo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/tajo/labels{/name}","releases_url":"https://api.github.com/repos/apache/tajo/releases{/id}","created_at":"2014-03-21T07:00:07Z","updated_at":"2015-03-21T09:32:33Z","pushed_at":"2015-03-21T09:38:41Z","git_url":"git://github.com/apache/tajo.git","ssh_url":"git@github.com:apache/tajo.git","clone_url":"https://github.com/apache/tajo.git","svn_url":"https://github.com/apache/tajo","homepage":null,"size":34821,"stargazers_count":37,"watchers_count":37,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":49,"mirror_url":"git://git.apache.org/tajo.git","open_issues_count":33,"forks":49,"open_issues":33,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/tajo/pulls/441"},"html":{"href":"https://github.com/apache/tajo/pull/441"},"issue":{"href":"https://api.github.com/repos/apache/tajo/issues/441"},"comments":{"href":"https://api.github.com/repos/apache/tajo/issues/441/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/tajo/pulls/441/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/tajo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/tajo/pulls/441/commits"},"statuses":{"href":"https://api.github.com/repos/apache/tajo/statuses/9fe6e6aa63c3b1351dfec3648a566e8b89c9286b"}}}}