You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/07/23 20:24:52 UTC
git commit: ACCUMULO-1537 applying Michael Berman's patches to make
switching between the different MacTest classes easier, adding missing files
Updated Branches:
refs/heads/master 4661491d0 -> 2709efa14
ACCUMULO-1537 applying Michael Berman's patches to make switching between the different MacTest classes easier, adding missing files
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2709efa1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2709efa1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2709efa1
Branch: refs/heads/master
Commit: 2709efa14baa1f7e1b32719acd61e496be9afe13
Parents: 4661491
Author: Eric Newton <ec...@apache.org>
Authored: Tue Jul 23 14:25:02 2013 -0400
Committer: Eric Newton <ec...@apache.org>
Committed: Tue Jul 23 14:25:02 2013 -0400
----------------------------------------------------------------------
.../accumulo/test/functional/AbstractMacIT.java | 64 ++++++++++++++++++++
.../test/functional/ConfigurableMacIT.java | 54 +++++++++++++++++
2 files changed, 118 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2709efa1/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
new file mode 100644
index 0000000..0ca65f7
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/AbstractMacIT.java
@@ -0,0 +1,64 @@
+/*
+ * 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.test.functional;
+
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.accumulo.core.cli.BatchWriterOpts;
+import org.apache.accumulo.core.cli.ScannerOpts;
+import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.log4j.Logger;
+import org.junit.rules.TemporaryFolder;
+
+public abstract class AbstractMacIT {
+ public static final Logger log = Logger.getLogger(AbstractMacIT.class);
+
+ public static final String ROOT_PASSWORD = "secret";
+ public static final ScannerOpts SOPTS = new ScannerOpts();
+ public static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
+
+ public abstract MiniAccumuloCluster getCluster();
+
+ protected static void cleanUp(MiniAccumuloCluster cluster, TemporaryFolder folder) {
+ if (cluster != null)
+ try {
+ cluster.stop();
+ } catch (Exception e) {}
+ folder.delete();
+ }
+
+ static AtomicInteger tableCount = new AtomicInteger();
+ static public String makeTableName() {
+ return "table" + tableCount.getAndIncrement();
+ }
+
+ public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
+ return getCluster().getConnector("root", ROOT_PASSWORD);
+ }
+
+ public String rootPath() {
+ return getCluster().getConfig().getDir().getAbsolutePath();
+ }
+
+ public Process exec(Class<? extends Object> clazz, String... args) throws IOException {
+ return getCluster().exec(clazz, args);
+ }
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/2709efa1/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
new file mode 100644
index 0000000..8c02a35
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ConfigurableMacIT.java
@@ -0,0 +1,54 @@
+/*
+ * 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.test.functional;
+
+import org.apache.accumulo.minicluster.MiniAccumuloCluster;
+import org.apache.accumulo.minicluster.MiniAccumuloConfig;
+import org.apache.log4j.Logger;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.rules.TemporaryFolder;
+
+public class ConfigurableMacIT extends AbstractMacIT {
+ public static final Logger log = Logger.getLogger(ConfigurableMacIT.class);
+
+ public TemporaryFolder folder = new TemporaryFolder();
+ public MiniAccumuloCluster cluster;
+
+ @Before
+ public void setUp() throws Exception {
+ folder.create();
+ MiniAccumuloConfig cfg = new MiniAccumuloConfig(folder.newFolder(this.getClass().getSimpleName()), ROOT_PASSWORD);
+ configure(cfg);
+ cluster = new MiniAccumuloCluster(cfg);
+ cluster.start();
+ }
+
+ public void configure(MiniAccumuloConfig cfg) {
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ cleanUp(cluster, folder);
+ }
+
+ @Override
+ public MiniAccumuloCluster getCluster() {
+ return cluster;
+ }
+
+}