Author: [email protected]
Date: Mon Apr 16 11:02:24 2012
New Revision: 2222
Log:
[AMDATUCASSANDRA-184] Fixed failing unit test
Modified:
trunk/amdatu-cassandra/cassandra-listener/src/test/java/org/amdatu/cassandra/test/unit/listener/ListenerTest.java
Modified:
trunk/amdatu-cassandra/cassandra-listener/src/test/java/org/amdatu/cassandra/test/unit/listener/ListenerTest.java
==============================================================================
---
trunk/amdatu-cassandra/cassandra-listener/src/test/java/org/amdatu/cassandra/test/unit/listener/ListenerTest.java
(original)
+++
trunk/amdatu-cassandra/cassandra-listener/src/test/java/org/amdatu/cassandra/test/unit/listener/ListenerTest.java
Mon Apr 16 11:02:24 2012
@@ -31,6 +31,7 @@
import org.amdatu.cassandra.test.unit.listener.mock.CPMFactoryMock;
import java.nio.ByteBuffer;
+import java.util.ArrayList;
import org.apache.cassandra.thrift.CfDef;
import org.apache.cassandra.thrift.ColumnDef;
@@ -195,14 +196,10 @@
cfDef.setComparator_type(CompareType.BYTESTYPE.getValue());
Assert.assertFalse(DAEMON.updateColumnFamily(TEST_KS, cfDef));
- // Update with change standard -> super, should throw an exception
+ // Update with change standard -> super, should not throw an exception
anymore, the column
+ // type is ignored
cfDef.setColumn_type(ColumnType.SUPER.getValue());
- try {
- DAEMON.updateColumnFamily(TEST_KS, cfDef);
- Assert.fail("Incompatible update of ColumnFamily '" + TEST_CF + "'
does not throw an exception");
- }
- catch (Exception e) {
- }
+ DAEMON.updateColumnFamily(TEST_KS, cfDef);
// Add a ColumnDefinition, should succeed
cfDef.setColumn_type(ColumnType.STANDARD.getValue());
@@ -216,10 +213,11 @@
// Invoke update without an effective change, should return false
Assert.assertFalse(DAEMON.updateColumnFamily(TEST_KS, cfDef));
- // Update the ColumnDefinition without the ColDef, the ColDef should
be removed
+ // Update the ColumnDefinition with an empty array of ColDefs, the
ColDef should be removed
cfDef = new CfDef(TEST_KS, TEST_CF);
cfDef.setColumn_type(ColumnType.STANDARD.getValue());
cfDef.setComparator_type(CompareType.BYTESTYPE.getValue());
+ cfDef.setColumn_metadata(new ArrayList<ColumnDef>());
DAEMON.updateColumnFamily(TEST_KS, cfDef);
CfDef def = DAEMON.getColumnFamily(TEST_KS, TEST_CF);
Assert.assertTrue(def.getColumn_metadata().size() == 0);
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits