Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ResultSet.close() not able to stubbed
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
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Russell Bateman  
View profile  
 More options Sep 18 2012, 11:43 am
From: Russell Bateman <r...@windofkeltia.com>
Date: Tue, 18 Sep 2012 09:43:56 -0600
Local: Tues, Sep 18 2012 11:43 am
Subject: Re: [mockito] ResultSet.close() not able to stubbed
Looks like you're attempting to mock the underlying driver or ORM code.
I once tried to mock the Hibernate calls I was using. This was a lost cause.

Typically, one doesn't mock classes one doesn't own. Instead, mock your
DAO layer itself for testing your business layer on top. There are
different techniques for "unit" testing the DAO/ORM/driver layer.

Others may have better advice and I'm on the look-out myself for a
simple way to test my DAO code, but I haven't found it, so I try to keep
my DAO code as thin as possible.

On 9/18/2012 8:47 AM, Tarun wrote:


 
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.
Brice Dutheil  
View profile  
 More options Sep 19 2012, 9:24 am
From: Brice Dutheil <brice.duth...@gmail.com>
Date: Wed, 19 Sep 2012 15:23:36 +0200
Local: Wed, Sep 19 2012 9:23 am
Subject: Re: [mockito] ResultSet.close() not able to stubbed

I agree with Russell, you seriously should consider integration tests,
instead of unit testing in your DAOs.

If that's just one method of your test, then your test is poorly
understandable by newcommers, and it will be poorly maintainable, let alone
any easy evolutions. Simplifying the test design will take a great weight
off your shoulders.

Aside from that, I don't see why mockito reports this error, I don't have
enough code sample to identify the issue.

Also I don't really understand why you are "stubbing" this

    stub(systemUnderTest.getNACustomers()).toReturn(set);
    final Set<NACustomerDTO> result = systemUnderTest.getNACustomers();

-- Brice

On Tue, Sep 18, 2012 at 5:43 PM, Russell Bateman <r...@windofkeltia.com>wrote:


 
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.
Brice Dutheil  
View profile  
 More options Sep 19 2012, 9:26 am
From: Brice Dutheil <brice.duth...@gmail.com>
Date: Wed, 19 Sep 2012 15:25:42 +0200
Local: Wed, Sep 19 2012 9:25 am
Subject: Re: [mockito] ResultSet.close() not able to stubbed

(hit send too early)

Anyway, to help diagnostic the issue we might need more code, like the
object your are testing, and more code from the test

Hope that helps,

Cheers,
-- Brice

On Wed, Sep 19, 2012 at 3:23 PM, Brice Dutheil <brice.duth...@gmail.com>wrote:


 
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 »