Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 40386 invoked from network); 1 Sep 2010 16:21:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Sep 2010 16:21:57 -0000 Received: (qmail 99228 invoked by uid 500); 1 Sep 2010 16:21:57 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 99183 invoked by uid 500); 1 Sep 2010 16:21:57 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 99175 invoked by uid 99); 1 Sep 2010 16:21:57 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 16:21:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 16:21:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C60552388A40; Wed, 1 Sep 2010 16:20:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r991590 - /cassandra/trunk/test/system/test_avro_server.py Date: Wed, 01 Sep 2010 16:20:15 -0000 To: commits@cassandra.apache.org From: gdusbabek@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100901162015.C60552388A40@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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,