curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CURATOR-114) TestingServer should expose restart() method.
Date Wed, 18 Jun 2014 04:17:03 GMT

    [ https://issues.apache.org/jira/browse/CURATOR-114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14034786#comment-14034786
] 

ASF GitHub Bot commented on CURATOR-114:
----------------------------------------

Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/11#discussion_r13898859
  
    --- Diff: curator-test/src/main/java/org/apache/curator/test/TestingServer.java ---
    @@ -37,47 +37,104 @@
     
         /**
          * Create the server using a random port
    -     *
    -     * @throws Exception errors
    +     * 
    +     * @throws Exception
    +     *             errors
          */
         public TestingServer() throws Exception
         {
    +        this(true);
    +    }
    +
    +    /**
    +     * Create the server using a random port
    +     * 
    +     * @param start
    +     *            True if the server should be started, false otherwise
    +     * @throws Exception
    +     *             errors
    +     */
    +    public TestingServer(boolean start) throws Exception
    --- End diff --
    
    Good point, yes it should be passed into the other constructor, will fix this up now.
    
    The start flag is not currently used in any of the unit tests, but I think that it's useful
to be able to create a server without starting it. There are cases where you want to start
with a server that is not started.


> TestingServer should expose restart() method.
> ---------------------------------------------
>
>                 Key: CURATOR-114
>                 URL: https://issues.apache.org/jira/browse/CURATOR-114
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 2.5.0
>            Reporter: Cameron McKenzie
>            Priority: Trivial
>
> Currently restarting the TestingServer involves:
> server.stop()
> server = new TestingServer(server.getPort(), server.getTempDirectory());
> The underlying Zookeeper testing server that is contained within TestingServer supports
a restart() method. It would be cleaner to expose this on the TestingServer interface, so
a restart would simply involve:
> server.restart()



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message