Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 91e83c72d -> 890f31914
  refs/heads/cassandra-3.11 8a5e88f63 -> 30c35dd8a


Fix unit test failures in ViewComplexTest

patch by Dinesh Joshi; reviewed by jasobrown for CASSANDRA-14219


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/890f3191
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/890f3191
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/890f3191

Branch: refs/heads/cassandra-3.0
Commit: 890f319142ddd3cf2692ff45ff28e71001365e96
Parents: 91e83c7
Author: Dinesh Joshi <dinesh.jo...@yahoo.com>
Authored: Fri Feb 9 11:14:12 2018 -0800
Committer: Jason Brown <jasedbr...@gmail.com>
Committed: Tue Feb 13 15:00:57 2018 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../unit/org/apache/cassandra/cql3/ViewComplexTest.java | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/890f3191/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 197ba58..90bd53f 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.16
+ * Fix unit test failures in ViewComplexTest (CASSANDRA-14219)
  * Add MinGW uname check to start scripts (CASSANDRA-12940)
  * Protect against overflow of local expiration time (CASSANDRA-14092)
  * Use the correct digest file and reload sstable metadata in nodetool verify 
(CASSANDRA-14217)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/890f3191/test/unit/org/apache/cassandra/cql3/ViewComplexTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/ViewComplexTest.java 
b/test/unit/org/apache/cassandra/cql3/ViewComplexTest.java
index 464cc39..bb0e269 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewComplexTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewComplexTest.java
@@ -319,7 +319,7 @@ public class ViewComplexTest extends CQLTester
     private void testUpdateColumnNotInView(boolean flush) throws Throwable
     {
         // CASSANDRA-13127: if base column not selected in view are alive, 
then pk of view row should be alive
-        createTable("create table %s (p int, c int, v1 int, v2 int, primary 
key(p, c))");
+        String baseTable = createTable("create table %s (p int, c int, v1 int, 
v2 int, primary key(p, c))");
 
         execute("USE " + keyspace());
         executeNet(protocolVersion, "USE " + keyspace());
@@ -399,7 +399,7 @@ public class ViewComplexTest extends CQLTester
         assertRowsIgnoringOrder(execute("SELECT * from %s WHERE c = ? AND p = 
?", 0, 0), row(0, 0, null, 1));
         assertRowsIgnoringOrder(execute("SELECT * from mv WHERE c = ? AND p = 
?", 0, 0), row(0, 0));
 
-        assertInvalidMessage("Cannot drop column v2 on base table with 
materialized views", "ALTER TABLE %s DROP v2");
+        assertInvalidMessage(String.format("Cannot drop column v2 on base 
table %s with materialized views.", baseTable), "ALTER TABLE %s DROP v2");
         // // drop unselected base column, unselected metadata should be 
removed, thus view row is dead
         // updateView("ALTER TABLE %s DROP v2");
         // assertRowsIgnoringOrder(execute("SELECT * from %s WHERE c = ? AND p 
= ?", 0, 0));
@@ -424,7 +424,7 @@ public class ViewComplexTest extends CQLTester
     {
         execute("USE " + keyspace());
         executeNet(protocolVersion, "USE " + keyspace());
-        String baseTableName = createTable("CREATE TABLE %s (k int, c int, a 
int, b int, l list<int>, s set<int>, m map<int,int>, PRIMARY KEY (k, c))");
+        String baseTable = createTable("CREATE TABLE %s (k int, c int, a int, 
b int, l list<int>, s set<int>, m map<int,int>, PRIMARY KEY (k, c))");
         createView("mv",
                    "CREATE MATERIALIZED VIEW %s AS SELECT a, b FROM %%s WHERE 
k IS NOT NULL AND c IS NOT NULL PRIMARY KEY (c, k)");
         Keyspace ks = Keyspace.open(keyspace());
@@ -460,7 +460,7 @@ public class ViewComplexTest extends CQLTester
         assertRowsIgnoringOrder(execute("SELECT k,c,a,b from %s"), row(1, 1, 
null, null));
         assertRowsIgnoringOrder(execute("SELECT * from mv"), row(1, 1, null, 
null));
 
-        assertInvalidMessage("Cannot drop column m on base table " + 
baseTableName + " with materialized views", "ALTER TABLE %s DROP m");
+        assertInvalidMessage(String.format("Cannot drop column m on base table 
%s with materialized views.", baseTable), "ALTER TABLE %s DROP m");
         // executeNet(protocolVersion, "ALTER TABLE %s DROP m");
         // ks.getColumnFamilyStore("mv").forceMajorCompaction();
         // assertRowsIgnoringOrder(execute("SELECT k,c,a,b from %s WHERE k = 1 
AND c = 1"));
@@ -880,7 +880,7 @@ public class ViewComplexTest extends CQLTester
     public void testUpdateWithColumnTimestampBiggerThanPk(boolean flush) 
throws Throwable
     {
         // CASSANDRA-11500 able to shadow old view row with column ts greater 
tahn pk's ts and re-insert the view row
-        createTable("CREATE TABLE %s (k int PRIMARY KEY, a int, b int);");
+        String baseTable = createTable("CREATE TABLE %s (k int PRIMARY KEY, a 
int, b int);");
 
         execute("USE " + keyspace());
         executeNet(protocolVersion, "USE " + keyspace());
@@ -929,7 +929,7 @@ public class ViewComplexTest extends CQLTester
         assertRowsIgnoringOrder(execute("SELECT k,a,b from mv"), row(1, 1, 2));
         assertRowsIgnoringOrder(execute("SELECT k,a,b from %s"), row(1, 1, 2));
 
-        assertInvalidMessage("Cannot drop column a on base table with 
materialized views", "ALTER TABLE %s DROP a");
+        assertInvalidMessage(String.format("Cannot drop column a on base table 
%s with materialized views.", baseTable), "ALTER TABLE %s DROP a");
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to