cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r991590 - /cassandra/trunk/test/system/test_avro_server.py
Date Wed, 01 Sep 2010 16:20:15 GMT
Author: gdusbabek
Date: Wed Sep  1 16:20:15 2010
New Revision: 991590

URL: http://svn.apache.org/viewvc?rev=991590&view=rev
Log:
avro system tests for system_*_keyspace operations

Modified:
    cassandra/trunk/test/system/test_avro_server.py

Modified: cassandra/trunk/test/system/test_avro_server.py
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_avro_server.py?rev=991590&r1=991589&r2=991590&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_avro_server.py (original)
+++ cassandra/trunk/test/system/test_avro_server.py Wed Sep  1 16:20:15 2010
@@ -410,6 +410,42 @@ class TestRpcOperations(AvroTester):
             assert(e['count'] == 10), \
                 "expected 10 results for %s, got %d" % (e['key'], e['count'])
 
+    def test_system_keyspace_operations(self):
+        "adding, renaming, and removing keyspaces"
+        
+        # create
+        keyspace = dict()
+        keyspace['name'] = 'CreateKeyspace'
+        keyspace['strategy_class'] = 'org.apache.cassandra.locator.SimpleStrategy'
+        keyspace['replication_factor'] = 1
+        keyspace['strategy_options'] = {}
+        cfdef = dict();
+        cfdef['keyspace'] = 'CreateKeyspace'
+        cfdef['name'] = 'CreateKsCf'
+        keyspace['cf_defs'] = [cfdef]
+        
+        s = self.client.request('system_add_keyspace', {'ks_def' : keyspace})
+        assert isinstance(s, unicode), 'returned type is %s, (not \'unicode\')' % type(s)
+        
+        # rename
+        self.client.request('set_keyspace', {'keyspace' : 'CreateKeyspace'})
+        s = self.client.request(
+                'system_rename_keyspace', {'old_name' : 'CreateKeyspace', 'new_name' : 'RenameKeyspace'})
+        assert isinstance(s, unicode), 'returned type is %s, (not \'unicode\')' % type(s)
+        renameks = self.client.request('describe_keyspace',
+                {'keyspace': 'RenameKeyspace'})
+        assert renameks['name'] == 'RenameKeyspace'
+        assert renameks['cf_defs'][0]['name'] == 'CreateKsCf'
+        
+        # drop
+        s = self.client.request('system_drop_keyspace', {'keyspace' : 'RenameKeyspace'})
+        assert isinstance(s, unicode), 'returned type is %s, (not \'unicode\')' % type(s)
+        assert_raises(AvroRemoteException,
+                      self.client.request,
+                      'describe_keyspace',
+                      {'keyspace' : 'RenameKeyspace'})
+        
+        
     def __get(self, key, cf, super_name, col_name, consistency_level='ONE'):
         """
         Given arguments for the key, column family, super column name,



Mime
View raw message