You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Christopher Tubbs (JIRA)" <ji...@apache.org> on 2017/10/27 15:45:00 UTC

[jira] [Commented] (ACCUMULO-4729) MiniAccumuloCluster should have a Singleton

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

Christopher Tubbs commented on ACCUMULO-4729:
---------------------------------------------

There are two ways I've seen MiniAccumuloCluster shared with multiple tests:

1. A JUnit test having a {{@BeforeClass}} section to start the cluster, and an {{@AfterClass}} section to stop it, with multiple {{@Test}} methods to each run a test.
2. Using {{accumulo-maven-plugin}} to launch (Mini)Accumulo at the {{pre-integration-test}} phase of the Maven build lifecycle, and run many tests during the {{integration-test}} phase, with the {{maven-failsafe-plugin}}, and then shut down at {{post-integration-test}} just before integration tests are validated in the {{verify}} phase.

If MiniAccumuloCluster were made to have a singleton, I'm not sure it would be clear who would be responsible for managing its lifecycle (shutting it down, starting it, etc.). And, this would be especially weird if we still allowed {{new MiniAccumuloCluster}}s to be launched separately from this singleton. That could be confusing.

For your use case, is it possible for you to simple assign {{new MiniAccumuloCluster}} to a variable, which you share with all your tests? That seems like the best solution to me.

> MiniAccumuloCluster should have a Singleton
> -------------------------------------------
>
>                 Key: ACCUMULO-4729
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-4729
>             Project: Accumulo
>          Issue Type: Bug
>          Components: mini
>    Affects Versions: 1.8.1
>            Reporter: Jorge Machado
>            Priority: Minor
>
> As developer I would like to have something like MiniAccumuloCluster.getInstance() 
> That I can share with multiple tests



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)