Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 49328 invoked from network); 25 May 2010 15:07:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 May 2010 15:07:57 -0000 Received: (qmail 11118 invoked by uid 500); 25 May 2010 15:07:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 11101 invoked by uid 500); 25 May 2010 15:07:56 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 11087 invoked by uid 99); 25 May 2010 15:07:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 15:07:56 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of miguelitovert@gmail.com designates 209.85.212.44 as permitted sender) Received: from [209.85.212.44] (HELO mail-vw0-f44.google.com) (209.85.212.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 May 2010 15:07:47 +0000 Received: by vws14 with SMTP id 14so1297984vws.31 for ; Tue, 25 May 2010 08:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:x-mailer:mime-version :subject:date:cc; bh=hGJ3p34YsuQ0EzK7/kKX58PlUQEZQLqeKkf3F5t9W0I=; b=ROrL6AXFuK7pJxqA7L43R07Z6zhER2LGl16y/IrERPOsiWgpdlmddwDIgvomKKyrU7 WmzwEgWb5HttWOYWO/3vdLDYZYvoragDNDg282ktbzdKxAennAFwRpNv7+TNb6jyltFC 9aZXldDum5sCaDQ7fsIUPBo5uXYSs4pvcPjBs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; b=l8SrGULdzk1DFePmyyRvUVZtvZpUr2LMVy+Gfub5ks+ZFYeTrCjDdCoS0XJ1ImHlu1 sKCtAC1hJqP71wDu3aN2UEQ3h58qdX89xg7PHm5d5FYz5PpkweDTNdGq6GT+GCKKtZxv i2Ud0DADmBYl0mp73Ik+CM3M/4HXS/OgdpI/k= Received: by 10.220.60.13 with SMTP id n13mr5083621vch.258.1274800046110; Tue, 25 May 2010 08:07:26 -0700 (PDT) Received: from [10.27.64.73] (mobile-166-137-143-115.mycingular.net [166.137.143.115]) by mx.google.com with ESMTPS id s9sm24378156vcr.15.2010.05.25.08.07.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 May 2010 08:07:25 -0700 (PDT) Message-Id: <264E5E36-B57D-4D39-A876-5091E59D2373@gmail.com> From: Miguel Verde To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=Apple-Mail-5-140087926 Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Nunit Testing & Cassandra Date: Tue, 25 May 2010 10:07:10 -0500 Cc: "user@cassandra.apache.org" X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-5-140087926 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit My guess is that it is using object equality to compare. One thing to test would be to create two KeySlices whose contents had the same values, add them to separate lists, and then compare the lists. I think you'll find that they are not 'equivalent'. On May 25, 2010, at 10:00 AM, Sandeep wrote: > SDSWebService.Service1Test.GetListOfRowKeysFromCF: > > Expected: equivalent to < System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key3,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key4,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key2,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])> > > > > > But was: < System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key3,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key4,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])>, key2,columns: System.Collections.Generic.List`1 > [Apache.Cassandra.ColumnOrSuperColumn])> > > > > > Is.EquivalentTo( ICollection ) ----- tests that two collections are > equivalent. > > > > Two collections are equivalent if they contain the same items, in > any order. > > > > Assert.That(listOfKeys, Is.EquivalentTo > (TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1"))); > > > > From: Miguel Verde [mailto:miguelitovert@gmail.com] > Sent: Tuesday, May 25, 2010 9:51 AM > To: user@cassandra.apache.org > Subject: Re: Nunit Testing & Cassandra > > > > It would be helpful to know in what way the test fails, or more > information about listOfKeys or the return value of > GetListOfRowKeysFromCF at assert time, or for that matter what > GetListOfRowKeysFromCF is, or the insertion code. > > > > Also, does Is.EquivalentTo compare object equality on the items > inside the collection? If so, that would be a problem. > > On Tue, May 25, 2010 at 8:40 AM, Sandeep wrote: > > Assert.AreEqual(listOfKeys, Is.EquivalentTo > (TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1"))); > > > > TestService.GetListOfRowKeysFromCF() returns a > List. I am constructing the same list in the > same order in which I have inserted in some other method. > > > > But the test always fails. Can any one please tell me > where am I going wrong. Timestamp value is a global variable and is > used through out the class. > > > > Thanks in advance. > > > --Apple-Mail-5-140087926 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
My guess is that it is using object equality to compare.  One thing to test would be to create two KeySlices whose contents had the same values, add them to separate lists, and then compare the lists. I think you'll find that they are not 'equivalent'.


On May 25, 2010, at 10:00 AM, Sandeep <Sandeep@indatus.com> wrote:

SDSWebService.Service1Test.GetListOfRowKeysFromCF:

  Expected: equivalent to < <KeySlice(key: key1,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key3,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key4,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key2,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])> >

 

  But was:  < <KeySlice(key: key1,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key3,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key4,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>, <KeySlice(key: key2,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])> >

 

Is.EquivalentTo( ICollection ) ----- tests that two collections are equivalent.

 

Two collections are equivalent if they contain the same items, in any order.

 

Assert.That(listOfKeys,  Is.EquivalentTo(TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1")));

 

From: Miguel Verde [mailto:miguelitovert@gmail.com]
Sent: Tuesday, May 25, 2010 9:51 AM
To: user@cassandra.apache.org
Subject: Re: Nunit Testing & Cassandra

 

It would be helpful to know in what way the test fails, or more information about listOfKeys or the return value of GetListOfRowKeysFromCF at assert time, or for that matter what GetListOfRowKeysFromCF is, or the insertion code.

 

Also, does Is.EquivalentTo compare object equality on the items inside the collection? If so, that would be a problem.

On Tue, May 25, 2010 at 8:40 AM, Sandeep <Sandeep@indatus.com> wrote:

            Assert.AreEqual(listOfKeys,  Is.EquivalentTo(TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1")));

 

            TestService.GetListOfRowKeysFromCF() returns a List<Keyslices>. I am constructing the same list<Keyslices> in the same order in which I have inserted in some other method.

 

            But the test always fails. Can any one please tell me where am I going wrong. Timestamp value is a global variable and is used through out the class.

 

      Thanks in advance.

 

--Apple-Mail-5-140087926--