You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by rs...@apache.org on 2017/06/12 15:49:59 UTC

kafka git commit: KAFKA-5433; Close SimpleAclAuthorizer in test to close ZK client

Repository: kafka
Updated Branches:
  refs/heads/trunk a623d8fe3 -> 46db2c5b9


KAFKA-5433; Close SimpleAclAuthorizer in test to close ZK client

Author: Rajini Sivaram <ra...@googlemail.com>

Reviewers: Ismael Juma <is...@juma.me.uk>

Closes #3304 from rajinisivaram/KAFKA-5433


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/46db2c5b
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/46db2c5b
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/46db2c5b

Branch: refs/heads/trunk
Commit: 46db2c5b99de05591274241c70378d845ee4c847
Parents: a623d8f
Author: Rajini Sivaram <ra...@googlemail.com>
Authored: Mon Jun 12 16:49:41 2017 +0100
Committer: Rajini Sivaram <ra...@googlemail.com>
Committed: Mon Jun 12 16:49:41 2017 +0100

----------------------------------------------------------------------
 .../api/SaslSslAdminClientIntegrationTest.scala | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/46db2c5b/core/src/test/scala/integration/kafka/api/SaslSslAdminClientIntegrationTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/integration/kafka/api/SaslSslAdminClientIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/SaslSslAdminClientIntegrationTest.scala
index 815d3a4..d0e0806 100644
--- a/core/src/test/scala/integration/kafka/api/SaslSslAdminClientIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/SaslSslAdminClientIntegrationTest.scala
@@ -38,15 +38,19 @@ class SaslSslAdminClientIntegrationTest extends AdminClientIntegrationTest with
 
   override def configureSecurityBeforeServersStart() {
     val authorizer = CoreUtils.createObject[Authorizer](classOf[SimpleAclAuthorizer].getName())
-    authorizer.configure(this.configs.head.originals())
-    authorizer.addAcls(Set(new AuthAcl(AuthAcl.WildCardPrincipal, Allow,
-                            AuthAcl.WildCardHost, All)), new AuthResource(Topic, "*"))
-    authorizer.addAcls(Set(clusterAcl(Allow, Create),
-                           clusterAcl(Allow, Delete),
-                           clusterAcl(Allow, ClusterAction),
-                           clusterAcl(Allow, AlterConfigs),
-                           clusterAcl(Allow, Alter)),
-                       AuthResource.ClusterResource)
+    try {
+      authorizer.configure(this.configs.head.originals())
+      authorizer.addAcls(Set(new AuthAcl(AuthAcl.WildCardPrincipal, Allow,
+                              AuthAcl.WildCardHost, All)), new AuthResource(Topic, "*"))
+      authorizer.addAcls(Set(clusterAcl(Allow, Create),
+                             clusterAcl(Allow, Delete),
+                             clusterAcl(Allow, ClusterAction),
+                             clusterAcl(Allow, AlterConfigs),
+                             clusterAcl(Allow, Alter)),
+                         AuthResource.ClusterResource)
+    } finally {
+      authorizer.close()
+    }
   }
 
   @Before