zookeeper-dev mailing list archives

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

    https://github.com/apache/zookeeper/pull/549#discussion_r198339563
  
    --- 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 --
    
    Instead of the try-catch paradigm, can we use `@Test(expected = ConfigException.class)`?


---

Mime
View raw message