You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2015/12/04 22:38:08 UTC

cassandra git commit: Fix failing unit tests post-10796

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 cf567703d -> 587fd9f77


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.0
Commit: 587fd9f77a7dd75f6264cdbd4e82f526dfa28745
Parents: cf56770
Author: Tyler Hobbs <ty...@gmail.com>
Authored: Fri Dec 4 15:37:39 2015 -0600
Committer: Tyler Hobbs <ty...@gmail.com>
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);