Repository: cassandra Updated Branches: refs/heads/cassandra-3.1 e09287372 -> 71e83f35f
Fix failing unit tests post-10796 Patch by Tyler Hobbs as a follow-up to CASSANDRA-10796 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/587fd9f7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/587fd9f7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/587fd9f7 Branch: refs/heads/cassandra-3.1 Commit: 587fd9f77a7dd75f6264cdbd4e82f526dfa28745 Parents: cf56770 Author: Tyler Hobbs <[email protected]> Authored: Fri Dec 4 15:37:39 2015 -0600 Committer: Tyler Hobbs <[email protected]> Committed: Fri Dec 4 15:37:39 2015 -0600 ---------------------------------------------------------------------- test/unit/org/apache/cassandra/cql3/CQLTester.java | 4 ++-- test/unit/org/apache/cassandra/cql3/ViewTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/587fd9f7/test/unit/org/apache/cassandra/cql3/CQLTester.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java b/test/unit/org/apache/cassandra/cql3/CQLTester.java index fd9bb28..71bc238 100644 --- a/test/unit/org/apache/cassandra/cql3/CQLTester.java +++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java @@ -732,9 +732,9 @@ public abstract class CQLTester .getCodecRegistry() .codecFor(type); ByteBuffer expectedByteValue = codec.serialize(expected[j], ProtocolVersion.fromInt(protocolVersion)); - int expectedBytes = expectedByteValue.remaining(); + int expectedBytes = expectedByteValue == null ? -1 : expectedByteValue.remaining(); ByteBuffer actualValue = actual.getBytesUnsafe(meta.getName(j)); - int actualBytes = actualValue.remaining(); + int actualBytes = actualValue == null ? -1 : actualValue.remaining(); if (!Objects.equal(expectedByteValue, actualValue)) Assert.fail(String.format("Invalid value for row %d column %d (%s of type %s), " + "expected <%s> (%d bytes) but got <%s> (%d bytes) " + http://git-wip-us.apache.org/repos/asf/cassandra/blob/587fd9f7/test/unit/org/apache/cassandra/cql3/ViewTest.java ---------------------------------------------------------------------- diff --git a/test/unit/org/apache/cassandra/cql3/ViewTest.java b/test/unit/org/apache/cassandra/cql3/ViewTest.java index 101eb3d..8ae21df 100644 --- a/test/unit/org/apache/cassandra/cql3/ViewTest.java +++ b/test/unit/org/apache/cassandra/cql3/ViewTest.java @@ -935,7 +935,7 @@ public class ViewTest extends CQLTester createView("mv1", "CREATE MATERIALIZED VIEW %s AS SELECT * FROM %%s WHERE a IS NOT NULL AND b IS NOT NULL AND d IS NOT NULL PRIMARY KEY (a, d, b)"); updateView("INSERT INTO %s (a, b, c, d) VALUES (?, ?, ?, ?)", 0, 0, 0, 0); - ResultSet mvRows = executeNet(protocolVersion, "SELECT a, d, b, cFROM mv1"); + ResultSet mvRows = executeNet(protocolVersion, "SELECT a, d, b, c FROM mv1"); assertRowsNet(protocolVersion, mvRows, row(0, 0, 0, 0)); updateView("DELETE c FROM %s WHERE a = ? AND b = ?", 0, 0);
