Author: ivol37 at gmail.com
Date: Fri Jan 21 15:39:20 2011
New Revision: 682

Log:
[AMDATU-274] Fixed the nullpointer

Modified:
   
trunk/amdatu-cassandra/cassandra-listener/src/main/java/org/amdatu/cassandra/listener/service/ColumnFamilyHandler.java
   
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java

Modified: 
trunk/amdatu-cassandra/cassandra-listener/src/main/java/org/amdatu/cassandra/listener/service/ColumnFamilyHandler.java
==============================================================================
--- 
trunk/amdatu-cassandra/cassandra-listener/src/main/java/org/amdatu/cassandra/listener/service/ColumnFamilyHandler.java
      (original)
+++ 
trunk/amdatu-cassandra/cassandra-listener/src/main/java/org/amdatu/cassandra/listener/service/ColumnFamilyHandler.java
      Fri Jan 21 15:39:20 2011
@@ -90,8 +90,8 @@
     TException, NotFoundException {
         final String cfName = colDef.getName();
         String columnType = colDef.getColumnType().value;
-        String comparatorType = colDef.getCompareWith().value;
-        String subComparatorType = colDef.getCompareSubcolumnsWith().value;
+        String comparatorType = colDef.getCompareWith() != null ? 
colDef.getCompareWith().value : null;
+        String subComparatorType = colDef.getCompareSubcolumnsWith() != null ? 
colDef.getCompareSubcolumnsWith().value : null;
 
         if (!daemonService.addColumnFamily(ksName, cfName, columnType, 
comparatorType, subComparatorType)) {
             // Since Cassandra does not (yet) support updating columnType, 
comparatorType or subComparatorType

Modified: 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
==============================================================================
--- 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
 (original)
+++ 
trunk/integration-tests/src/test/java/org/amdatu/test/integration/tests/CassandraDaemonIntegrationTest.java
 Fri Jan 21 15:39:20 2011
@@ -139,7 +139,7 @@
         m_daemonService.addKeyspace(KEYSPACE.toUpperCase());
 
         // Sleep a second, this increases the probability that write requests 
have been handled
-        Thread.sleep(1000);
+        Thread.sleep(5000);
 
         // Get all keyspaces and check that all three have been created
         List<String> allKeyspaces = m_daemonService.getKeyspaces();
@@ -166,7 +166,7 @@
         testColumnFamilyProvider();
 
         // Sleep a second, this increases the probability that write requests 
have been handled
-        Thread.sleep(1000);
+        Thread.sleep(5000);
 
         List<String> allColumnFamilies = 
m_daemonService.getColumnFamilies(KEYSPACE);
         Assert.assertTrue(allColumnFamilies.contains(COLUMNFAMILY));
@@ -220,8 +220,8 @@
         // -5- Add another keyspace
         m_daemonService.addKeyspace(KEYSPACE3);
 
-        // Give the cassandra listener 3 seconds time to pick up the added 
keyspace and a CF for it
-        Thread.sleep(3000);
+        // Give the cassandra listener 6 seconds time to pick up the added 
keyspace and a CF for it
+        Thread.sleep(6000);
 
         // -6- Verify that our ColumnFamily is available in this new keyspace
         Assert.assertTrue("Keyspace '" + KEYSPACE3 + "' added, but 
keyspace-global ColumnFamily '" + COLUMNFAMILY2 + "' does not come " +

Reply via email to