Various fixes to SASI tests Patch by Sam Tunnicliffe; reviewed by Sylvain Lebresne for CASSANDRA-12130
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/cb0d1ca4 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/cb0d1ca4 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/cb0d1ca4 Branch: refs/heads/trunk Commit: cb0d1ca4514be44ddf65221b0d7cf75b026be2e8 Parents: 7107646 Author: Sam Tunnicliffe <s...@beobal.com> Authored: Mon Jul 4 14:45:32 2016 +0100 Committer: Sam Tunnicliffe <s...@beobal.com> Committed: Tue Jul 5 10:12:41 2016 +0100 ---------------------------------------------------------------------- .../org/apache/cassandra/index/sasi/SASIIndexTest.java | 4 ++-- .../io/sstable/format/SSTableFlushObserverTest.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb0d1ca4/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java index a27db74..46d1a3c 100644 --- a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java +++ b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java @@ -103,7 +103,7 @@ public class SASIIndexTest SchemaLoader.fullTextSearchSASICFMD(KS_NAME, FTS_CF_NAME)))); } - @After + @Before public void cleanUp() { Keyspace.open(KS_NAME).getColumnFamilyStore(CF_NAME).truncateBlocking(); @@ -1093,8 +1093,8 @@ public class SASIIndexTest Mutation rm = new Mutation(KS_NAME, decoratedKey(AsciiType.instance.decompose("key1"))); update(rm, new ArrayList<Cell>() {{ - add(buildCell(firstName, AsciiType.instance.decompose("pavel"), System.currentTimeMillis())); add(buildCell(age, LongType.instance.decompose(26L), System.currentTimeMillis())); + add(buildCell(firstName, AsciiType.instance.decompose("pavel"), System.currentTimeMillis())); }}); rm.apply(); http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb0d1ca4/test/unit/org/apache/cassandra/io/sstable/format/SSTableFlushObserverTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/io/sstable/format/SSTableFlushObserverTest.java b/test/unit/org/apache/cassandra/io/sstable/format/SSTableFlushObserverTest.java index 27c76dd..dafad37 100644 --- a/test/unit/org/apache/cassandra/io/sstable/format/SSTableFlushObserverTest.java +++ b/test/unit/org/apache/cassandra/io/sstable/format/SSTableFlushObserverTest.java @@ -100,22 +100,22 @@ public class SSTableFlushObserverTest final long now = System.currentTimeMillis(); ByteBuffer key = UTF8Type.instance.fromString("key1"); - expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("jack")), - BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(27)), + expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(27)), + BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("jack")), BufferCell.live(getColumn(cfm, "height"), now, LongType.instance.decompose(183L)))); writer.append(new RowIterator(cfm, key.duplicate(), Collections.singletonList(buildRow(expected.get(key))))); key = UTF8Type.instance.fromString("key2"); - expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("jim")), - BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(30)), + expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(30)), + BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("jim")), BufferCell.live(getColumn(cfm, "height"), now, LongType.instance.decompose(180L)))); writer.append(new RowIterator(cfm, key, Collections.singletonList(buildRow(expected.get(key))))); key = UTF8Type.instance.fromString("key3"); - expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("ken")), - BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(30)), + expected.putAll(key, Arrays.asList(BufferCell.live(getColumn(cfm, "age"), now, Int32Type.instance.decompose(30)), + BufferCell.live(getColumn(cfm, "first_name"), now,UTF8Type.instance.fromString("ken")), BufferCell.live(getColumn(cfm, "height"), now, LongType.instance.decompose(178L)))); writer.append(new RowIterator(cfm, key, Collections.singletonList(buildRow(expected.get(key)))));