{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/44958374","id":44958374,"diff_hunk":"@@ -23,47 +23,52 @@ import org.apache.kafka.common.security.kerberos.LoginManager\n import org.junit.{After, Before}\n \n trait SaslTestHarness extends ZooKeeperTestHarness {\n-\n+  protected val zkSaslEnabled: Boolean\n   private val workDir = new File(System.getProperty(\"test.dir\", \"target\"))\n   private val kdcConf = MiniKdc.createConf()\n   private val kdc = new MiniKdc(kdcConf, workDir)\n-\n+  \n   @Before\n   override def setUp() {\n     // Important if tests leak consumers, producers or brokers\n     LoginManager.closeAll()\n-    val keytabFile = createKeytabAndSetConfiguration(\"kafka_jaas.conf\")\n+    val keytabFile = createKeytabAndSetConfiguration()\n     kdc.start()\n     kdc.createPrincipal(keytabFile, \"client\", \"kafka/localhost\")\n     super.setUp\n   }\n \n-  protected def createKeytabAndSetConfiguration(jaasResourceName: String): File = {\n-    val (keytabFile, jaasFile) = createKeytabAndJaasFiles(jaasResourceName)\n+  protected def createKeytabAndSetConfiguration(): File = {\n+    val (keytabFile, jaasFile) = createKeytabAndJaasFiles()\n     // This will cause a reload of the Configuration singleton when `getConfiguration` is called\n     Configuration.setConfiguration(null)\n     System.setProperty(JaasUtils.JAVA_LOGIN_CONFIG_PARAM, jaasFile.getAbsolutePath)\n     keytabFile\n   }\n \n-  private def createKeytabAndJaasFiles(jaasResourceName: String): (File, File) = {\n+  private def createKeytabAndJaasFiles(): (File, File) = {\n     val keytabFile = TestUtils.tempFile()\n-    val jaasFile = TestUtils.tempFile()\n+    //val jaasFile = TestUtils.tempFile()\n+    val jaasFileName = if (zkSaslEnabled)\n+        JaasTestUtils.genSingleFile(keytabFile.getAbsolutePath)\n+      else\n+        JaasTestUtils.genKafkaFile(keytabFile.getAbsolutePath)\n+    val jaasFile = new File(jaasFileName)\n \n-    val writer = new BufferedWriter(new FileWriter(jaasFile))\n-    val inputStream = Thread.currentThread().getContextClassLoader.getResourceAsStream(jaasResourceName)\n-    if (inputStream == null)\n-      throw new IllegalStateException(s\"Could not find `$jaasResourceName`, make sure it is in the classpath\")\n-    val source = io.Source.fromInputStream(inputStream, \"UTF-8\")\n+    //val writer = new BufferedWriter(new FileWriter(jaasFile))","path":"core/src/test/scala/integration/kafka/api/SaslTestHarness.scala","position":57,"original_position":57,"commit_id":"a6de49fae69d68e74e3764e416afbfd56e18388e","original_commit_id":"a6de49fae69d68e74e3764e416afbfd56e18388e","user":{"login":"fpj","id":572920,"avatar_url":"https://avatars.githubusercontent.com/u/572920?v=3","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"body":"Need to remove this commented code.","created_at":"2015-11-16T18:03:36Z","updated_at":"2015-11-16T18:03:36Z","html_url":"https://github.com/apache/kafka/pull/410#discussion_r44958374","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/410","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/44958374"},"html":{"href":"https://github.com/apache/kafka/pull/410#discussion_r44958374"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/410","id":49576748,"html_url":"https://github.com/apache/kafka/pull/410","diff_url":"https://github.com/apache/kafka/pull/410.diff","patch_url":"https://github.com/apache/kafka/pull/410.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/410","number":410,"state":"open","locked":false,"title":"KAFKA-2732: Add class for ZK Auth.","user":{"login":"fpj","id":572920,"avatar_url":"https://avatars.githubusercontent.com/u/572920?v=3","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-03T16:23:22Z","updated_at":"2015-11-16T18:03:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf0bc0b4b9ec170d09c8d524db37992fb24fdd68","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/410/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/410/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/410/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/a6de49fae69d68e74e3764e416afbfd56e18388e","head":{"label":"fpj:KAFKA-2732","ref":"KAFKA-2732","sha":"a6de49fae69d68e74e3764e416afbfd56e18388e","user":{"login":"fpj","id":572920,"avatar_url":"https://avatars.githubusercontent.com/u/572920?v=3","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"repo":{"id":39900213,"name":"kafka","full_name":"fpj/kafka","owner":{"login":"fpj","id":572920,"avatar_url":"https://avatars.githubusercontent.com/u/572920?v=3","gravatar_id":"","url":"https://api.github.com/users/fpj","html_url":"https://github.com/fpj","followers_url":"https://api.github.com/users/fpj/followers","following_url":"https://api.github.com/users/fpj/following{/other_user}","gists_url":"https://api.github.com/users/fpj/gists{/gist_id}","starred_url":"https://api.github.com/users/fpj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpj/subscriptions","organizations_url":"https://api.github.com/users/fpj/orgs","repos_url":"https://api.github.com/users/fpj/repos","events_url":"https://api.github.com/users/fpj/events{/privacy}","received_events_url":"https://api.github.com/users/fpj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fpj/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/fpj/kafka","forks_url":"https://api.github.com/repos/fpj/kafka/forks","keys_url":"https://api.github.com/repos/fpj/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fpj/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fpj/kafka/teams","hooks_url":"https://api.github.com/repos/fpj/kafka/hooks","issue_events_url":"https://api.github.com/repos/fpj/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/fpj/kafka/events","assignees_url":"https://api.github.com/repos/fpj/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/fpj/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/fpj/kafka/tags","blobs_url":"https://api.github.com/repos/fpj/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fpj/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fpj/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/fpj/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fpj/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/fpj/kafka/languages","stargazers_url":"https://api.github.com/repos/fpj/kafka/stargazers","contributors_url":"https://api.github.com/repos/fpj/kafka/contributors","subscribers_url":"https://api.github.com/repos/fpj/kafka/subscribers","subscription_url":"https://api.github.com/repos/fpj/kafka/subscription","commits_url":"https://api.github.com/repos/fpj/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/fpj/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/fpj/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/fpj/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/fpj/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/fpj/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fpj/kafka/merges","archive_url":"https://api.github.com/repos/fpj/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fpj/kafka/downloads","issues_url":"https://api.github.com/repos/fpj/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/fpj/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/fpj/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/fpj/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fpj/kafka/labels{/name}","releases_url":"https://api.github.com/repos/fpj/kafka/releases{/id}","created_at":"2015-07-29T15:11:21Z","updated_at":"2015-07-29T15:11:24Z","pushed_at":"2015-11-16T16:26:37Z","git_url":"git://github.com/fpj/kafka.git","ssh_url":"git@github.com:fpj/kafka.git","clone_url":"https://github.com/fpj/kafka.git","svn_url":"https://github.com/fpj/kafka","homepage":null,"size":24580,"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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"356544caba6448c6ba3bcdb38bea787e1fbc277b","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":2211243,"name":"kafka","full_name":"apache/kafka","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/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","created_at":"2011-08-15T18:06:16Z","updated_at":"2015-11-16T09:56:00Z","pushed_at":"2015-11-16T17:06:48Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":43404,"stargazers_count":2212,"watchers_count":2212,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1303,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":101,"forks":1303,"open_issues":101,"watchers":2212,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/410"},"html":{"href":"https://github.com/apache/kafka/pull/410"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/410"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/a6de49fae69d68e74e3764e416afbfd56e18388e"}}}}