{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/63932881","id":63932881,"diff_hunk":"@@ -0,0 +1,59 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * the License.  You may obtain a copy of the License at\n+ *\n+ *    http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.apache.spark;\n+\n+import java.io.IOException;\n+\n+import org.junit.After;\n+import org.junit.Before;\n+\n+import org.apache.spark.api.java.JavaSparkContext;\n+import org.apache.spark.sql.SparkSession;\n+\n+public class SharedSparkSession {\n+\n+  public transient SparkSession spark;\n+  public transient JavaSparkContext jsc;\n+\n+  @Before\n+  public void setUp() throws IOException {\n+    spark = SparkSession.builder()\n+      .master(\"local\")\n+      .appName(\"shared-spark-session\")\n+      .getOrCreate();\n+    jsc = new JavaSparkContext(spark.sparkContext());\n+\n+    customSetUp();\n+    customSetUpWithException();\n+  }\n+\n+  public void customSetUp() {}","path":"mllib/src/test/java/org/apache/spark/SharedSparkSession.java","position":45,"original_position":45,"commit_id":"f3fa1f5b84873eead74157dacd53a2765a957245","original_commit_id":"f3fa1f5b84873eead74157dacd53a2765a957245","user":{"login":"andrewor14","id":2133137,"avatar_url":"https://avatars.githubusercontent.com/u/2133137?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewor14","html_url":"https://github.com/andrewor14","followers_url":"https://api.github.com/users/andrewor14/followers","following_url":"https://api.github.com/users/andrewor14/following{/other_user}","gists_url":"https://api.github.com/users/andrewor14/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewor14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewor14/subscriptions","organizations_url":"https://api.github.com/users/andrewor14/orgs","repos_url":"https://api.github.com/users/andrewor14/repos","events_url":"https://api.github.com/users/andrewor14/events{/privacy}","received_events_url":"https://api.github.com/users/andrewor14/received_events","type":"User","site_admin":false},"body":"I would call this `doSetup` and `doTearDown`. Also many of these can be protected so please mark them as such.","created_at":"2016-05-19T18:42:39Z","updated_at":"2016-05-19T18:42:39Z","html_url":"https://github.com/apache/spark/pull/13101#discussion_r63932881","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/13101","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/63932881"},"html":{"href":"https://github.com/apache/spark/pull/13101#discussion_r63932881"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/13101"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/13101","id":70020481,"html_url":"https://github.com/apache/spark/pull/13101","diff_url":"https://github.com/apache/spark/pull/13101.diff","patch_url":"https://github.com/apache/spark/pull/13101.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/13101","number":13101,"state":"open","locked":false,"title":"[SPARK-15296][MLlib] Refactor All Java Tests that use SparkSession","user":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\nRefactor All Java Tests that use SparkSession, to extend SharedSparkSesion\r\n\r\n## How was this patch tested?\r\nExisting Tests","created_at":"2016-05-13T16:08:46Z","updated_at":"2016-05-19T18:42:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f77661fe78cbb15cad708330b65042ae8d82a138","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/13101/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/13101/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/13101/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/f3fa1f5b84873eead74157dacd53a2765a957245","head":{"label":"techaddict:SPARK-15296","ref":"SPARK-15296","sha":"f3fa1f5b84873eead74157dacd53a2765a957245","user":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"repo":{"id":18507796,"name":"spark","full_name":"techaddict/spark","owner":{"login":"techaddict","id":1378755,"avatar_url":"https://avatars.githubusercontent.com/u/1378755?v=3","gravatar_id":"","url":"https://api.github.com/users/techaddict","html_url":"https://github.com/techaddict","followers_url":"https://api.github.com/users/techaddict/followers","following_url":"https://api.github.com/users/techaddict/following{/other_user}","gists_url":"https://api.github.com/users/techaddict/gists{/gist_id}","starred_url":"https://api.github.com/users/techaddict/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techaddict/subscriptions","organizations_url":"https://api.github.com/users/techaddict/orgs","repos_url":"https://api.github.com/users/techaddict/repos","events_url":"https://api.github.com/users/techaddict/events{/privacy}","received_events_url":"https://api.github.com/users/techaddict/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/techaddict/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/techaddict/spark","forks_url":"https://api.github.com/repos/techaddict/spark/forks","keys_url":"https://api.github.com/repos/techaddict/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/techaddict/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/techaddict/spark/teams","hooks_url":"https://api.github.com/repos/techaddict/spark/hooks","issue_events_url":"https://api.github.com/repos/techaddict/spark/issues/events{/number}","events_url":"https://api.github.com/repos/techaddict/spark/events","assignees_url":"https://api.github.com/repos/techaddict/spark/assignees{/user}","branches_url":"https://api.github.com/repos/techaddict/spark/branches{/branch}","tags_url":"https://api.github.com/repos/techaddict/spark/tags","blobs_url":"https://api.github.com/repos/techaddict/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/techaddict/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/techaddict/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/techaddict/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/techaddict/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/techaddict/spark/languages","stargazers_url":"https://api.github.com/repos/techaddict/spark/stargazers","contributors_url":"https://api.github.com/repos/techaddict/spark/contributors","subscribers_url":"https://api.github.com/repos/techaddict/spark/subscribers","subscription_url":"https://api.github.com/repos/techaddict/spark/subscription","commits_url":"https://api.github.com/repos/techaddict/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/techaddict/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/techaddict/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/techaddict/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/techaddict/spark/contents/{+path}","compare_url":"https://api.github.com/repos/techaddict/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/techaddict/spark/merges","archive_url":"https://api.github.com/repos/techaddict/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/techaddict/spark/downloads","issues_url":"https://api.github.com/repos/techaddict/spark/issues{/number}","pulls_url":"https://api.github.com/repos/techaddict/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/techaddict/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/techaddict/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/techaddict/spark/labels{/name}","releases_url":"https://api.github.com/repos/techaddict/spark/releases{/id}","deployments_url":"https://api.github.com/repos/techaddict/spark/deployments","created_at":"2014-04-07T06:05:50Z","updated_at":"2016-03-31T13:35:48Z","pushed_at":"2016-05-19T12:06:45Z","git_url":"git://github.com/techaddict/spark.git","ssh_url":"git@github.com:techaddict/spark.git","clone_url":"https://github.com/techaddict/spark.git","svn_url":"https://github.com/techaddict/spark","homepage":null,"size":166731,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"2a5db9c140b9d60a5ec91018be19bec7b80850ee","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":17165658,"name":"spark","full_name":"apache/spark","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/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2016-05-19T16:26:50Z","pushed_at":"2016-05-19T18:41:37Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":494179,"stargazers_count":8582,"watchers_count":8582,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7966,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":432,"forks":7966,"open_issues":432,"watchers":8582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/13101"},"html":{"href":"https://github.com/apache/spark/pull/13101"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/13101"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/13101/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/13101/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/13101/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/f3fa1f5b84873eead74157dacd53a2765a957245"}}}}