Google Groups Home
Help | Sign in
Testing Queries
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Andrew Bialecki  
View profile
 More options May 5, 5:01 pm
From: Andrew Bialecki <andrew.biale...@gmail.com>
Date: Mon, 5 May 2008 14:01:40 -0700 (PDT)
Local: Mon, May 5 2008 5:01 pm
Subject: Testing Queries
What do you guys use to create dummy queries?  My use case is that I
want to make sure the data that the query a method is returning is
correct.  I know I can use QueryNew() and add cells and so on, I was
wondering if there was an easier way or at least one that looks
prettier.  I've heard of "querysim" as a custom tag, but I haven't
really experimented with it.  Any thoughts?

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Esher  
View profile
 More options May 5, 6:02 pm
From: "Marc Esher" <marc.es...@gmail.com>
Date: Mon, 5 May 2008 18:02:22 -0400
Local: Mon, May 5 2008 6:02 pm
Subject: Re: [mxunit:389] Testing Queries
I use querysim all the time for this!

On Mon, May 5, 2008 at 5:01 PM, Andrew Bialecki


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Bialecki  
View profile
 More options May 5, 11:06 pm
From: Andrew Bialecki <andrew.biale...@gmail.com>
Date: Mon, 5 May 2008 20:06:11 -0700 (PDT)
Local: Mon, May 5 2008 11:06 pm
Subject: Re: Testing Queries
Cool, then I guess I'll start with that see how it goes.  One other
thing, assertEquals() expects simple objects, yes?  I tried giving it
two queries which looked exactly the same, but it didn't like that.
Looked like it was using the "toString" method to compare them and
that wasn't working because the queries were "the same" if the same is
the same contents.  They weren't actually the same if the same means
referencing the same object.

On May 5, 6:02 pm, "Marc Esher" <marc.es...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Rankin  
View profile
 More options May 6, 12:20 am
From: Mike Rankin <AnodyneP...@gmail.com>
Date: Mon, 5 May 2008 21:20:06 -0700 (PDT)
Local: Tues, May 6 2008 12:20 am
Subject: Re: Testing Queries
I tend to have a lot of my business logic in the database, so for me,
it's important to exercise that code as well as the cf code.  I'm
currently working on some techniques that allow me to test through the
database.  While most people tend to think of testing the database as
something other than unit testing, mxunit makes it possible for me to
do both in one step.  Unfortunately, it's more process than code, so
it doesn't lend itself to easy examination.  When I get some more of
the kinks worked out, I'll drop some documentation about it on the
website.

On May 5, 11:06 pm, Andrew Bialecki <andrew.biale...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Esher  
View profile
 More options May 6, 7:12 am
From: "Marc Esher" <marc.es...@gmail.com>
Date: Tue, 6 May 2008 07:12:59 -0400
Local: Tues, May 6 2008 7:12 am
Subject: Re: [mxunit:391] Re: Testing Queries
Andrew, assertEquals was working as it should. in mxunit, "equals"
means content. if you want to test if two objects are the same, try
assertSame().

best,

marc

On Mon, May 5, 2008 at 11:06 PM, Andrew Bialecki


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Bialecki  
View profile
 More options May 6, 8:13 am
From: Andrew Bialecki <andrew.biale...@gmail.com>
Date: Tue, 6 May 2008 05:13:06 -0700 (PDT)
Local: Tues, May 6 2008 8:13 am
Subject: Re: Testing Queries
Thanks Marc,

Just to clarify, "equals" means content and "same" means two variables
reference the same object.  I'm finding that when I compare two
queries, one from the DB and one I created with QueryNew() and
QuerySetCell(), even though they look the same if I print them out --
that is use cfdump/debug() -- they don't match when I do
assertEquals(queryFromDB, queryCreatedByMe).  It would seem to me that
"assertEquals" is what I want because I want to compare content, not
whether they reference the same object (because I know they don't).
However, this assert fails, and I believe the reason is because it is
using "toString()" to do the comparison.

If I'm supposed to be using "assertSame", then please let me know (and
sorry for misunderstanding which to use).  It sounds like I should be
using "assertEquals" though, so I'm kind of stumped.

- Andrew

On May 6, 7:12 am, "Marc Esher" <marc.es...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Esher  
View profile
 More options May 6, 8:25 am
From: "Marc Esher" <marc.es...@gmail.com>
Date: Tue, 6 May 2008 08:25:06 -0400
Local: Tues, May 6 2008 8:25 am
Subject: Re: [mxunit:396] Re: Testing Queries
Nope, you're doing it right. sounds like a bug to me or, if your
queries truly are off by a char or something, then mxunit isn't being
very helpful. maybe you'd like to go here:
http://code.google.com/p/mxunit/issues/detail?id=59

and put in your 2 cents!

best,

marc

On Tue, May 6, 2008 at 8:13 AM, Andrew Bialecki


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google