zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanm <...@git.apache.org>
Subject [GitHub] zookeeper pull request #254: ZOOKEEPER-2775: ZK Client not able to connect w...
Date Tue, 16 May 2017 23:08:32 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message