Assert.assertFalse(iter2.hasNext());
}
@Test
public void testMutationMerge() throws Exception {
MutationBatch m1 = keyspace.prepareMutationBatch();
MutationBatch m2 = keyspace.prepareMutationBatch();
MutationBatch m3 = keyspace.prepareMutationBatch();
MutationBatch m4 = keyspace.prepareMutationBatch();
MutationBatch m5 = keyspace.prepareMutationBatch();
m1.withRow(CF_STANDARD1, "1").putColumn("1", "X", null);
m2.withRow(CF_STANDARD1, "2").putColumn("2", "X", null).putColumn("3", "X", null);
m3.withRow(CF_STANDARD1, "3").putColumn("4", "X", null).putColumn("5", "X", null).putColumn("6", "X", null);
m4.withRow(CF_STANDARD1, "1").putColumn("7", "X", null).putColumn("8", "X", null).putColumn("9", "X", null).putColumn("10", "X", null);
MutationBatch merged = keyspace.prepareMutationBatch();
Assert.assertEquals(merged.getRowCount(), 0);
merged.mergeShallow(m1);
Assert.assertEquals(merged.getRowCount(), 1);
merged.mergeShallow(m2);
Assert.assertEquals(merged.getRowCount(), 2);
merged.mergeShallow(m3);
Assert.assertEquals(merged.getRowCount(), 3);
merged.mergeShallow(m4);
Assert.assertEquals(merged.getRowCount(), 3);
merged.mergeShallow(m5);
Assert.assertEquals(merged.getRowCount(), 3);
merged.execute();
Rows<String, String> result = keyspace.prepareQuery(CF_STANDARD1).getRowSlice("1", "2", "3").execute().getResult();
Assert.assertTrue(5 == result.getRow("1").getColumns().size());
Assert.assertTrue(2 == result.getRow("2").getColumns().size());