Github user hanm commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/254#discussion_r116879091
--- Diff: src/java/test/org/apache/zookeeper/SaslAuthTest.java ---
@@ -16,54 +16,58 @@
* limitations under the License.
*/
-package org.apache.zookeeper.test;
+package org.apache.zookeeper;
+
+import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
+import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.TestableZooKeeper;
-import org.apache.zookeeper.WatchedEvent;
-import org.apache.zookeeper.ZooKeeper;
+import org.apache.zookeeper.ClientCnxn.SendThread;
import org.apache.zookeeper.Watcher.Event.KeeperState;
import org.apache.zookeeper.ZooDefs.Ids;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Id;
+import org.apache.zookeeper.test.ClientBase;
+import org.junit.AfterClass;
import org.junit.Assert;
+import org.junit.BeforeClass;
import org.junit.Test;
public class SaslAuthTest extends ClientBase {
- static {
-
System.setProperty("zookeeper.authProvider.1","org.apache.zookeeper.server.auth.SASLAuthenticationProvider");
-
+ @BeforeClass
+ public static void init() {
+ System.setProperty("zookeeper.authProvider.1",
+
"org.apache.zookeeper.server.auth.SASLAuthenticationProvider");
try {
File tmpDir = createTmpDir();
File saslConfFile = new File(tmpDir, "jaas.conf");
FileWriter fwriter = new FileWriter(saslConfFile);
- fwriter.write("" +
- "Server {\n" +
- "
org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
- " user_super=\"test\";\n" +
- "};\n" +
- "Client {\n" +
- "
org.apache.zookeeper.server.auth.DigestLoginModule required\n" +
- " username=\"super\"\n" +
- " password=\"test\";\n" +
- "};" + "\n");
+ fwriter.write("" + "Server {\n"
--- End diff --
Nit: not sure if change is by accident or not, but this made readability
worse.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---