Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 52230 invoked from network); 26 Jul 2005 14:48:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jul 2005 14:48:52 -0000 Received: (qmail 62122 invoked by uid 500); 26 Jul 2005 14:48:51 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 62105 invoked by uid 500); 26 Jul 2005 14:48:51 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 62092 invoked by uid 99); 26 Jul 2005 14:48:50 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2005 07:48:50 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_50_60,HTML_MESSAGE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [12.129.199.61] (HELO mail22-haw-R.bigfish.com) (12.129.199.61) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2005 07:48:43 -0700 Received: from mail22-haw.bigfish.com (localhost.localdomain [127.0.0.1]) by mail22-haw-R.bigfish.com (Postfix) with ESMTP id E78C4310776; Tue, 26 Jul 2005 14:48:47 +0000 (UTC) X-BigFish: V Received: by mail22-haw.bigfish.com (MessageSwitch) id 1122389327826960_19831; Tue, 26 Jul 2005 14:48:47 +0000 (UCT) Received: from mail8.fw-bc.sony.com (mail8.fw-bc.sony.com [160.33.98.75]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by mail22-haw.bigfish.com (Postfix) with ESMTP id 99C5931064B; Tue, 26 Jul 2005 14:48:47 +0000 (UTC) Received: from mail1.sgo.in.sel.sony.com (mail1.sgo.in.sel.sony.com [43.130.1.111]) by mail8.fw-bc.sony.com (8.12.11/8.12.11) with ESMTP id j6QEmGPq003379; Tue, 26 Jul 2005 14:48:16 GMT Received: from USSDIXIM01.am.sony.com (ussdixim01.am.sony.com [43.130.140.33]) by mail1.sgo.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id j6QEmjA9028912; Tue, 26 Jul 2005 14:48:45 GMT content-class: urn:content-classes:message Subject: RE: Mock for DaoManager MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C591F1.2EC86CC0" Date: Tue, 26 Jul 2005 10:49:10 -0400 Message-ID: <41314DDCD3F8D2119F6400A0C9F285F10A28F913@US-PB-XMSG-1> X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Mock for DaoManager Thread-Index: AcWR7PMnccPLK6GuRVOfNYURLfUzpAAA92tw From: "Akins, Greg" To: , X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C591F1.2EC86CC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable That's an option also. Though given the data I'm working with; it might be easier to create Mock objects, or do anything else other than cleaning up the data;') -----Original Message----- From: Larry Meadors [mailto:larry.meadors@gmail.com]=20 Sent: Tuesday, July 26, 2005 10:19 AM To: user-java@ibatis.apache.org Subject: Re: Mock for DaoManager Can you trim down the data? I was working on a db with ~800G of data, but it only *needed* a few dozen rows in each table to be usable. I was not trying to stress test, only unit test. Larry On 7/26/05, Akins, Greg wrote:=20 Thanks. =20 I've used DbUnit before.. =20 However, the test data we have is in some cases over 20 million rows. =20 1. I had planned on two sets of tests, 1 would use the actual dao implementations, to test the mappings. 2 would use mocks to speed up the rest of the testing. So I think I can mix both your suggestions to get the results I want. Thanks for the help. -----Original Message----- From: Larry Meadors [mailto:larry.meadors@gmail.com]=20 Sent: Tuesday, July 26, 2005 9:20 AM To: user-java@ibatis.apache.org Subject: Re: Mock for DaoManager Hmm, ok. Two options to consider: 1) Use dbunit to populate a database, and use your normal DAOs. 2) Create an alternate dao.xml that has your mocked up dao classes that return hard-coded values. I would seriously suggest #1..and yes, I know, it is not what you wanted ("without requiring a call to the database"), however, with a smallish database I think you'll find the performance acceptable, and you will get the added benefit of testing your mapped statements, too.=20 Using dbunit, you can specify the exact contents of the database, so you have known quantities to test against. It is a pretty darn slick tool. Larry On 7/26/05, Akins, Greg wrote:=20 Well, I think I might be on the wrong path... =20 But what I was trying to do is replace the call the StandardDaoManager with calls to a MockDaoManager that would return an instance of a mock dao object =20 The MockDao object would just keep all the "data" in memory and the implementation of each method would return data that I could use for testing, without requiring a call to the database. =20 -----Original Message----- From: Larry Meadors [mailto:larry.meadors@gmail.com]=20 Sent: Tuesday, July 26, 2005 8:30 AM To: user-java@ibatis.apache.org Subject: Re: Mock for DaoManager I am not sure what you are trying to do here..do you want the DAOs defined in the dao.xml, or do you want to return different ones? It would be a fairly straightforward exercise to build one that mimicked the StandardDaoManager class, and exposed the dao maps so you could replace them. What is it that you are trying to accomplish? There may be an easier way... Larry On 7/26/05, Akins, Greg wrote:=20 Has anyone written a mock object that implements DaoManager for testing? I started by writing a specific MockDao that returns a specific Dao implementation; but wanted something that would use the dao.xml. Just=20 wondering if it's been done already. -greg ------_=_NextPart_001_01C591F1.2EC86CC0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
That's=20 an option also.  Though given the data I'm working with; it might = be easier=20 to create Mock objects, or do anything else other than cleaning up the=20 data;')
-----Original Message-----
From: = Larry Meadors=20 [mailto:larry.meadors@gmail.com]
Sent: Tuesday, July 26, = 2005 10:19=20 AM
To: user-java@ibatis.apache.org
Subject: Re: = Mock for=20 DaoManager

Can you trim down the data? I was = working on a=20 db with ~800G of data, but it only *needed* a few dozen rows in each = table to=20 be usable. I was not trying to stress test, only unit=20 test.

Larry


On 7/26/05, Akins,=20 Greg <Greg.Akins@am.sony.com>=20 wrote:
Thanks.
 
I've used = DbUnit=20 before..
 
However, the = test data we=20 have is in some cases over 20 million rows.
 
  1. I had = planned on two sets=20 of tests, 1 would use the actual dao implementations, to test the=20 mappings.  2 would use mocks to speed up the rest of the=20 testing.
So I think I = can mix both=20 your suggestions to get the results I want.  Thanks for the=20 help.
-----Original Message-----
From: Larry Meadors = [mailto:larry.meadors@gmail.com]
Sent: Tuesday, July 26, 2005 9:20 AM
To: = user-java@ibatis.apache.org
Subject: = Re: Mock=20 for DaoManager

Hmm, ok.

Two = options to=20 consider:
1) Use dbunit to populate a database, and use your = normal=20 DAOs.
2) Create an alternate dao.xml that has your mocked up = dao=20 classes that return hard-coded values.

I would seriously = suggest=20 #1..and yes, I know, it is not what you wanted ("without requiring a call to the=20 database"), however, with a smallish database I = think you'll=20 find the performance acceptable, and you will get the added = benefit of=20 testing your mapped statements, too.

Using dbunit, you can = specify=20 the exact contents of the database, so you have known quantities = to test=20 against. It is a pretty darn slick tool.

Larry


On 7/26/05, Akins,=20 Greg <Greg.Akins@am.sony.com> wrote:=20
Well, I = think I might=20 be on the wrong path...
 
But what = I was trying=20 to do is replace the call the StandardDaoManager with calls to a = MockDaoManager that would return an instance of a mock dao=20 object
 
The = MockDao object=20 would just keep all the "data" in memory and the implementation = of each=20 method would return data that I could use for testing, without = requiring=20 a call to the database.
 
-----Original Message-----
From: Larry = Meadors=20 [mailto:larry.meadors@gmail.com]
Sent: = Tuesday,=20 July 26, 2005 8:30 AM
To: user-java@ibatis.apache.org
Subject: Re:=20 Mock for DaoManager

I am not sure what you = are=20 trying to do here..do you want the DAOs defined in the = dao.xml, or do=20 you want to return different ones?

It would be a fairly = straightforward exercise to build one that mimicked the=20 StandardDaoManager class, and exposed the dao maps so you = could=20 replace them.

What is it that you are trying to = accomplish?=20 There may be an easier way...

Larry

On 7/26/05, Akins, Greg <Greg.Akins@am.sony.com> wrote:=20
Has=20 anyone written a mock object that implements DaoManager for=20 testing?

I started by writing a specific MockDao that = returns=20 a specific Dao
implementation; but wanted something that = would=20 use the dao.xml.  Just
wondering if it's been = done=20 = already.

-greg


<= /DIV>

=
------_=_NextPart_001_01C591F1.2EC86CC0--