zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkalmar <...@git.apache.org>
Subject [GitHub] zookeeper pull request #549: ZOOKEEPER-2873 abort startup on invalid ports
Date Wed, 27 Jun 2018 08:25:39 GMT
Github user nkalmar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/549#discussion_r198405834
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java ---
    @@ -103,6 +103,23 @@ public void testCustomSSLAuth()
             }
         }
     
    +    /**
    +     * Test case for https://issues.apache.org/jira/browse/ZOOKEEPER-2873
    +     */
    +    @Test
    +    public void testSamePortConfiguredForClientAndElection() throws IOException, ConfigException
{
    +        QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig();
    +        try {
    +            Properties zkProp = getDefaultZKProperties();
    +            zkProp.setProperty("server.1", "localhost:2888:2888");
    +            quorumPeerConfig.parseProperties(zkProp);
    +            fail("ConfigException is expected");
    +        } catch (ConfigException ce) {
    --- End diff --
    
    That will only verify the exception was thrown. I am also checking what is the error message.
We can use expected, but I think this is more "To the point"


---

Mime
View raw message