alex-ninja commented on a change in pull request #1117:
URL: https://github.com/apache/cassandra/pull/1117#discussion_r675978709



##########
File path: 
test/unit/org/apache/cassandra/cql3/validation/entities/VirtualTableTest.java
##########
@@ -317,6 +365,32 @@ public void testModifications() throws Throwable
                              "INSERT INTO test_virtual_ks.vt2 (key, value) 
VALUES ('pk2', 22) IF NOT EXISTS");
     }
 
+    @Test
+    public void testTruncationOnTruncatableTable() throws Throwable
+    {
+        // check for existing records
+        assertRows(execute("SELECT * FROM test_virtual_ks.vt4"),
+                row("pk1", 1),
+                row("pk2", 2));
+
+        // truncate
+        execute("TRUNCATE test_virtual_ks.vt4");
+
+        // check that truncation is applied
+        assertEmpty(execute("SELECT * FROM test_virtual_ks.vt4"));
+    }
+
+    @Test
+    public void testInvalidDMLOperations() throws Throwable
+    {
+        assertInvalidMessage("Modification is not supported by table 
test_virtual_ks.vt1",

Review comment:
       This use case was not covered, so I added such a test.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to