Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7E384102C6 for ; Fri, 21 Jun 2013 08:14:32 +0000 (UTC) Received: (qmail 77352 invoked by uid 500); 21 Jun 2013 08:14:29 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 77242 invoked by uid 500); 21 Jun 2013 08:14:28 -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 77110 invoked by uid 99); 21 Jun 2013 08:14:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jun 2013 08:14:26 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a82.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jun 2013 08:14:20 +0000 Received: from homiemail-a82.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTP id CB2D7282061 for ; Fri, 21 Jun 2013 01:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=7dB3t4g2mhVY4i+2zjOz0MMI2G U=; b=0YD+fD1bKaVmjCbB3T5iVLic6Uoy/9cfwYdSidpp3g2GZ0eENndE10cfZJ uAungxgxKKxD/fapzNJW1zK1XJYFVTYW+J3YKd4VJ31moAwjpmIJRMtZtOHbpOt8 hZtEBF8hoog2AYVPburfg8YYflTmYIWz+9qBcmCieCgFRNpfk= Received: from [172.16.1.7] (unknown [203.86.207.101]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTPSA id 19BF528205F for ; Fri, 21 Jun 2013 01:13:57 -0700 (PDT) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_B7D59D67-40FD-41CA-9961-4BD7F40DAD20" Message-Id: <60273C96-AD3D-41E3-81AC-13786CF84BDE@thelastpickle.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: Unit Testing Cassandra Date: Fri, 21 Jun 2013 20:13:57 +1200 References: <72199978CE4FB345A2A454C6FEAAB4250D357729@BOSTONEX.tor.rapid7.com> To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_B7D59D67-40FD-41CA-9961-4BD7F40DAD20 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 > > 2) Second (in which I am more interested in) is for performance = (stress/load) testing.=20 Sometimes you can get cassandra-stress (shipped in the bin distro) to = approximate the expected work load. It's then pretty easy to benchmark = and tests you configuration changes. Cheers =20 ----------------- Aaron Morton Freelance Cassandra Consultant New Zealand @aaronmorton http://www.thelastpickle.com On 20/06/2013, at 2:25 PM, Shahab Yunus wrote: > Thanks Edward, Ben and Dean for the pointers. Yes, I am using Java and = these sounds promising for unit testing, at least. >=20 > Regards, > Shahab >=20 >=20 > On Wed, Jun 19, 2013 at 9:58 AM, Edward Capriolo = wrote: > You really do not need much in java you can use the embedded server. = Hector wrap a simple class around thiscalled EmbeddedServerHelper >=20 >=20 > On Wednesday, June 19, 2013, Ben Boule wrote: > > Hi Shabab, > > > > Cassandra-Unit has been helpful for us for running unit tests = without requiring a real cassandra instance to be running. We only use = this to test our "DAO" code which interacts with the Cassandra client. = It basically starts up an embedded instance of cassandra and fools your = client/driver into using it. It uses a non-standard port and you just = need to make sure you can set the port as a parameter into your client = code. > > > > https://github.com/jsevellec/cassandra-unit > > > > One important thing is to either clear out the keyspace in between = tests or carefully separate your data so different tests don't collide = with each other in the embedded database. > > > > Setup/tear down time is pretty reasonable. > > > > Ben > > ________________________________ > > From: Shahab Yunus [shahab.yunus@gmail.com] > > Sent: Wednesday, June 19, 2013 8:46 AM > > To: user@cassandra.apache.org > > Subject: Re: Unit Testing Cassandra > > > > Thanks Stephen for you reply and explanation. My bad that I mixed = those up and wasn't clear enough. Yes, I have different 2 = requests/questions. > > 1) One is for the unit testing. > > 2) Second (in which I am more interested in) is for performance = (stress/load) testing. Let us keep integration aside for now. > > I do see some stuff out there but wanted to know recommendations = from the community given their experience. > > Regards, > > Shahab > > > > On Wed, Jun 19, 2013 at 3:15 AM, Stephen Connolly = wrote: > >> > >> Unit testing means testing in isolation the smallest part. > >> Unit tests should not take more than a few milliseconds to set up = and verify their assertions. > >> As such, if your code is not factored well for testing, you would = typically use mocking (either by hand, or with mocking libraries) to = mock out the bits not under test. > >> Extensive use of mocks is usually a smell of code that is not well = designed *for testing* > >> If you intend to test components integrated together... That is = integration testing. > >> If you intend to test performance of the whole or significant parts = of the whole... That is performance testing. > >> When searching for the above, you will not get much luck if you are = looking for them in the context of "unit testing" as those things are = *outside the scope of unit testing" > >> > >> On Wednesday, 19 June 2013, Shahab Yunus wrote: > >>> > >>> Hello, > >>> > >>> Can anyone suggest a good/popular Unit Test = tools/frameworks/utilities out > >>> there for unit testing Cassandra stores? I am looking for testing = from performance/load and monitoring perspective. I am using 1.2. > >>> > >>> Thanks a lot. > >>> > >>> Regards, > >>> Shahab > >> > >> > >> -- > >> Sent from my phone > > > > This electronic message contains information which may be = confidential or privileged. The information is intended for the use of = the individual or entity named above. If you are not the intended = recipient, be aware that any disclosure, copying, distribution or use of = the contents of this information is prohibited. If you have received = this electronic transmission in error, please notify us by e-mail at = (postmaster@rapid7.com) immediately. >=20 --Apple-Mail=_B7D59D67-40FD-41CA-9961-4BD7F40DAD20 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1
> 2) = Second (in which I am more interested in) is for performance = (stress/load) = testing. 
Sometimes = you can get cassandra-stress (shipped in the bin distro) to approximate = the expected work load. It's then pretty easy to benchmark and tests you = configuration = changes.

Cheers
 
http://www.thelastpickle.com

On 20/06/2013, at 2:25 PM, Shahab Yunus <shahab.yunus@gmail.com> = wrote:

Thanks Edward, Ben and Dean for the = pointers. Yes, I am using Java and these sounds promising for unit = testing, at least.

Regards,
Shahab


On Wed, Jun 19, 2013 at 9:58 AM, = Edward Capriolo <edlinuxguru@gmail.com> = wrote:
You really do not need much in java you can use the embedded server. = Hector wrap a simple class around thiscalled =  EmbeddedServerHelper


On Wednesday, June 19, 2013, Ben Boule <Ben_Boule@rapid7.com> wrote:
> Hi Shabab,
>
> Cassandra-Unit has been helpful for us = for running unit tests without requiring a real cassandra instance to be = running.   We only use this to test our "DAO" code which = interacts with the Cassandra client.  It basically starts up an = embedded instance of cassandra and fools your client/driver into using = it.  It uses a non-standard port and you just need to make sure you = can set the port as a parameter into your client code.
>
> https://github.com/jsevellec/cassandra-unit
><= br>> One important thing is to either clear out the keyspace in = between tests or carefully separate your data so different tests don't = collide with each other in the embedded database.
>
> Setup/tear down time is pretty reasonable.
>
> = Ben
> ________________________________
> From: Shahab Yunus = [shahab.yunus@gmail.com]
> Sent: Wednesday, June 19, 2013 8:46 AM
> To: user@cassandra.apache.org
> Subject: Re: = Unit Testing Cassandra
>
> Thanks Stephen for you reply and = explanation. My bad that I mixed those up and wasn't clear enough. Yes, = I have different 2 requests/questions.
> 1) One is for the unit testing.
> 2) Second (in which I am = more interested in) is for performance (stress/load) testing. Let us = keep integration aside for now.
> I do see some stuff out there = but wanted to know recommendations from the community given their = experience.
> Regards,
> Shahab
>
> On Wed, Jun 19, 2013 at = 3:15 AM, Stephen Connolly <stephen.alan.connolly@gmail.com> = wrote:
>>
>> Unit testing means testing in isolation the smallest part.
>> Unit tests should not take more than a few milliseconds to set = up and verify their assertions.
>> As such, if your code is not = factored well for testing, you would typically use mocking (either by = hand, or with mocking libraries) to mock out the bits not under = test.
>> Extensive use of mocks is usually a smell of code that is not = well designed *for testing*
>> If you intend to test components = integrated together... That is integration testing.
>> If you = intend to test performance of the whole or significant parts of the = whole... That is performance testing.
>> When searching for the above, you will not get much luck if you = are looking for them in the context of "unit testing" as those things = are *outside the scope of unit testing"
>>
>> On = Wednesday, 19 June 2013, Shahab Yunus wrote:
>>>
>>> Hello,
>>>
>>> Can = anyone suggest a good/popular Unit Test tools/frameworks/utilities = out
>>> there for unit testing Cassandra stores? I am = looking for testing from performance/load and monitoring perspective. I = am using 1.2.
>>>
>>> Thanks a = lot.
>>>
>>> Regards,
>>> = Shahab
>>
>>
>> --
>> Sent from my = phone
>
> This electronic message contains information which = may be confidential or privileged. The information is intended for the = use of the individual or entity named above. If you are not the intended = recipient, be aware that any disclosure, copying, distribution or use of = the contents of this information is prohibited. If you have received = this electronic transmission in error, please notify us by e-mail at (postmaster@rapid7.com) immediately.


= --Apple-Mail=_B7D59D67-40FD-41CA-9961-4BD7F40DAD20--