Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9131017F28 for ; Tue, 21 Apr 2015 15:30:40 +0000 (UTC) Received: (qmail 37042 invoked by uid 500); 21 Apr 2015 15:30:40 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 37002 invoked by uid 500); 21 Apr 2015 15:30:40 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 36985 invoked by uid 99); 21 Apr 2015 15:30:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 15:30:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D3DB6DFF85; Tue, 21 Apr 2015 15:30:39 +0000 (UTC) From: joshelser To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request: ACCUMULO-3000: Added config option and impl... Content-Type: text/plain Message-Id: <20150421153039.D3DB6DFF85@git1-us-west.apache.org> Date: Tue, 21 Apr 2015 15:30:39 +0000 (UTC) Github user joshelser commented on a diff in the pull request: https://github.com/apache/accumulo/pull/29#discussion_r28789572 --- Diff: minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterExistingZooKeepersTest.java --- @@ -0,0 +1,100 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.accumulo.minicluster; + +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.IOException; + +import org.apache.accumulo.core.client.Connector; +import org.apache.commons.io.FileUtils; +import org.apache.curator.test.TestingServer; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MiniAccumuloClusterExistingZooKeepersTest { + + private static final Logger log = LoggerFactory.getLogger(MiniAccumuloClusterExistingZooKeepersTest.class); + private File baseDir = new File(System.getProperty("user.dir") + "/target/mini-tests/" + this.getClass().getName()); + private TestingServer zooKeeper; + private MiniAccumuloCluster accumulo; + + @Rule + public TestName testName = new TestName(); + + @Before + public void setupTestCluster() throws Exception { + assertTrue(baseDir.mkdirs() || baseDir.isDirectory()); + File testDir = new File(baseDir, testName.getMethodName()); + FileUtils.deleteQuietly(testDir); + assertTrue(testDir.mkdir()); + + zooKeeper = new TestingServer(); + + MiniAccumuloConfig config = new MiniAccumuloConfig(testDir, "superSecret"); + config.setExistingZooKeepers(zooKeeper.getConnectString()); + accumulo = new MiniAccumuloCluster(config); + } + + @After + public void teardownTestCluster() { + if (accumulo != null) { + try { + accumulo.stop(); + } catch (IOException | InterruptedException e) { + log.warn("Failure during tear down", e); + } + } + + if (zooKeeper != null) { + try { + zooKeeper.close(); + } catch (IOException e) { + log.warn("Failure stopping test ZooKeeper server"); + } + } + } + + @Test + public void multipleStartsDoesntThrowAnException() throws Exception { --- End diff -- I don't think this test really needs to be here. --- 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. ---