[Webtest] DBUnit integrated to Canoo?
Eric Pugh
webtest@lists.canoo.com
Wed, 10 Apr 2002 09:41:47 +0100
Ben, Tim,
I think this task is very cool! My one comment is that I currently have my
various Canoo tests set up so that each target is a page, and each testSpec
wraps up the navigation to that page, and then various checks on that
page...
<target name="testWorkOrderList">
<testSpec name="Test Workorder Listing Page">
I want to reset my database before each testSpec, so that the navigation to
that page is always the same, and each page gets tested in isolation. (more
of a unit test for pages). However, I still want to be able to do more
System oriented tests where I test each page and how it affects other
pages...
I was thinking of building in a property that executes the CLEAN_INSERT for
each testSpec if a value is set...
Also, I wish I could configure a single <dbunit> task once, and not have to
put the username etc everywhere in my buildfile...
Maybe some trickery with includes would help?
Eric
-----Original Message-----
From: Ben Cox [mailto:ben@bjtechnics.com]
Sent: Sunday, April 07, 2002 9:26 AM
To: webtest@gate.canoo.com
Subject: Re: [Webtest] DBUnit integrated to Canoo?
David,
Well, my partner and I made a DBUnit task for Ant (a bit less than
thoroughly commented, but it's not really that complicated!), which
sounds like what you'd like. We modelled it after the interface to the
<sql> task in ant. I've included the three Java files (including the
test case), and the XML files required to run the test. Please note a
couple of things:
- the pktabledef.sql contains a MySQL dump of the simple test tables
- the classes need to go into package com.insourcery.ant.dbunit
- the setUp method in DBUnitTaskTester refers to the buildfile.xml
without any path information, so keep that in mind.
Feel free to get in touch if you see any improvements that would
help, or if you just want to talk about the approach!
Enjoy,
Ben Cox && Tim Ruppert
David Eric Pugh wrote:
> Has anyone integrated DBUnit into Canoo/httpUnit?
>
> I am testing a very database intensive app, and I want to after each
> <testSpec> to reset my database to a known state. That way I can
validate
> that all my forign keys and other database related setting work, and that
> they don't change under me!
>
> I think I need to create my own version of testSpec like testSpecDB
that has
> as part of the setup and teardown resetting the database.
>
> Eric
>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
>