Updated Branches: refs/heads/master 7e04aefe3 -> 3959f6bbb
ACCUMULO-1745 Add test to ensure the merging a cloned table works. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3959f6bb Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3959f6bb Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3959f6bb Branch: refs/heads/master Commit: 3959f6bbbb4e7836101ee70a850fa7aa58b8303a Parents: 7e04aef Author: Josh Elser <els...@apache.org> Authored: Wed Oct 23 15:37:05 2013 -0700 Committer: Josh Elser <els...@apache.org> Committed: Wed Oct 23 15:43:47 2013 -0700 ---------------------------------------------------------------------- .../apache/accumulo/test/TableOperationsIT.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/3959f6bb/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java index edc2987..3e33fd5 100644 --- a/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java +++ b/test/src/test/java/org/apache/accumulo/test/TableOperationsIT.java @@ -22,12 +22,14 @@ import static org.junit.Assert.fail; import java.io.File; import java.io.IOException; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeSet; import java.util.concurrent.atomic.AtomicInteger; import org.apache.accumulo.core.client.AccumuloException; @@ -38,6 +40,7 @@ import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.TableExistsException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.accumulo.core.client.admin.DiskUsage; +import org.apache.accumulo.core.client.admin.TableOperations; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.constraints.DefaultKeySizeConstraint; import org.apache.accumulo.core.data.Mutation; @@ -53,6 +56,8 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import com.google.common.collect.Sets; + public class TableOperationsIT { static TemporaryFolder tempFolder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target")); @@ -166,6 +171,20 @@ public class TableOperationsIT { assertEquals(DefaultKeySizeConstraint.class.getName(), props.get(Property.TABLE_CONSTRAINT_PREFIX.toString() + "1")); connector.tableOperations().delete(tableName); } + + @Test(timeout = 30 * 1000) + public void createMergeClonedTable() throws Exception { + String originalTable = makeTableName(); + TableOperations tops = connector.tableOperations(); + + tops.create(originalTable); + tops.addSplits(originalTable, Sets.newTreeSet(Arrays.asList(new Text("a"), new Text("b"), new Text("c"), new Text("d")))); + + String clonedTable = makeTableName(); + + tops.clone(originalTable, clonedTable, true, null, null); + tops.merge(clonedTable, null, new Text("b")); + } private Map<String,String> propsToMap(Iterable<Map.Entry<String,String>> props) { Map<String,String> map = new HashMap<String,String>();