public void testResolveMultipleDeleted()
{
// deletes and columns with interleaved timestamp, with out of order return sequence
ColumnFamily cf1 = ColumnFamily.create("Keyspace1", "Standard1");
cf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
// these columns created after the previous deletion
ColumnFamily cf2 = ColumnFamily.create("Keyspace1", "Standard1");
cf2.addColumn(column("one", "A", 1));
cf2.addColumn(column("two", "A", 1));
//this column created after the next delete
ColumnFamily cf3 = ColumnFamily.create("Keyspace1", "Standard1");
cf3.addColumn(column("two", "B", 3));
ColumnFamily cf4 = ColumnFamily.create("Keyspace1", "Standard1");
cf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2, cf3, cf4));
// will have deleted marker and one column
assertColumns(resolved, "two");
assertColumn(resolved, "two", "B", 3);
assertTrue(resolved.isMarkedForDelete());
assertEquals(2, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
ColumnFamily scf1 = ColumnFamily.create("Keyspace1", "Super1");
scf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
// these columns created after the previous deletion
ColumnFamily scf2 = ColumnFamily.create("Keyspace1", "Super1");
scf2.addColumn(superColumn(scf2, "super1", column("one", "A", 1), column("two", "A", 1)));
//these columns created after the next delete
ColumnFamily scf3 = ColumnFamily.create("Keyspace1", "Super1");
scf3.addColumn(superColumn(scf3, "super1", column("two", "B", 3)));
scf3.addColumn(superColumn(scf3, "super2", column("three", "A", 3), column("four", "A", 3)));
ColumnFamily scf4 = ColumnFamily.create("Keyspace1", "Super1");
scf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily superResolved = RowDataResolver.resolveSuperset(Arrays.asList(scf1, scf2, scf3, scf4));
// will have deleted marker and two super cols
assertColumns(superResolved, "super1", "super2");