Return-Path: Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: (qmail 63790 invoked from network); 17 Feb 2011 01:23:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2011 01:23:59 -0000 Received: (qmail 54446 invoked by uid 500); 17 Feb 2011 01:23:59 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 54419 invoked by uid 500); 17 Feb 2011 01:23:59 -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 54411 invoked by uid 99); 17 Feb 2011 01:23:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Feb 2011 01:23:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Thu, 17 Feb 2011 01:23:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AB5772388A40; Thu, 17 Feb 2011 01:23:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1071469 - /cassandra/trunk/test/system/test_cql.py Date: Thu, 17 Feb 2011 01:23:36 -0000 To: commits@cassandra.apache.org From: eevans@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110217012336.AB5772388A40@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: eevans Date: Thu Feb 17 01:23:36 2011 New Revision: 1071469 URL: http://svn.apache.org/viewvc?rev=1071469&view=rev Log: system tests for CREATE INDEX Patch by eevans for CASSANDRA-1709 Modified: cassandra/trunk/test/system/test_cql.py Modified: cassandra/trunk/test/system/test_cql.py URL: http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_cql.py?rev=1071469&r1=1071468&r2=1071469&view=diff ============================================================================== --- cassandra/trunk/test/system/test_cql.py (original) +++ cassandra/trunk/test/system/test_cql.py Thu Feb 17 01:23:36 2011 @@ -308,6 +308,29 @@ class TestCql(ThriftTester): for coldef in cfam.column_metadata: assert coldef.name in ("a", "b"), "Unknown column name" assert coldef.validation_class.endswith("marshal.IntegerType") + + def test_create_indexs(self): + "creating column indexes" + conn = init() + conn.execute("USE Keyspace1") + conn.execute("CREATE COLUMNFAMILY CreateIndex1") + conn.execute("CREATE INDEX namedIndex ON CreateIndex1 (\"items\")") + conn.execute("CREATE INDEX ON CreateIndex1 (\"stuff\")") + + # TODO: temporary (until this can be done with CQL). + ksdef = thrift_client.describe_keyspace("Keyspace1") + cfam = [i for i in ksdef.cf_defs if i.name == "CreateIndex1"][0] + items = [i for i in cfam.column_metadata if i.name == "items"][0] + stuff = [i for i in cfam.column_metadata if i.name == "stuff"][0] + assert items.index_name == "namedIndex", "missing index (or name)" + assert items.index_type == 0, "missing index" + assert not stuff.index_name, \ + "index_name should be unset, not %s" % stuff.index_name + assert stuff.index_type == 0, "missing index" + + assert_raises(CQLException, + conn.execute, + "CREATE INDEX ON CreateIndex1 (\"stuff\")") def test_time_uuid(self): "store and retrieve time-based (type 1) uuids"