Best practice issues...

View: New views
3 Messages — Rating Filter:   Alert me  

Best practice issues...

by nielsene-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've been having difficulties getting stable testing infrastructure working with
the rest of my application.

Specifically, I'm running into foreign key problems.  Yes, I've head the docs
and FAQs.

In one version of my configuration, I'm using hand coded SQL with most, but not
all of the "on-delete"s set to cascade.  I have dbunit's setup configured to
use CLEAN_INSERT.  Under this version, everything seems to work.

I'd like to use hibernates hbm2ddl.auto feature, at least during the early
development, rapid DDL churn phase of the project.  When I enable hmb2ddl.auto,
and proceed, I get foreign key exceptions during the setup of a test case, as
part of CLEAN_INSERT.  I haven't tested, but plan to later this week, what
happens under the original configuration is I set all the on-delete's to
RESTRICT.  I suspect the errors will occur here as well.

I could switch to doing the database cleanup in the teardown, but the dbunit
documentation tends to push the CLEAN_INSERT setup and the do-nothing teardown
and I tend to agree with the reasons given.

Are there other options or approaches I should look at?

Thank you.
Eric Nielsen

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user

Re: Best practice issues...

by Jeff Jensen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We had to add cleanup during the teardown.  Different
tests manipulated different tables and the tables in the
setup data varied per test; therefore the clean wouldn't
hit all needed tables.  This had nothing to do with
Hibernate, of course...


On Wed, 18 Jun 2008 15:55:59 -0400
  Eric D Nielsen <nielsene@...> wrote:

> I've been having difficulties getting stable testing
>infrastructure working with
> the rest of my application.
>
> Specifically, I'm running into foreign key problems.
> Yes, I've head the docs
> and FAQs.
>
> In one version of my configuration, I'm using hand coded
>SQL with most, but not
> all of the "on-delete"s set to cascade.  I have dbunit's
>setup configured to
> use CLEAN_INSERT.  Under this version, everything seems
>to work.
>
> I'd like to use hibernates hbm2ddl.auto feature, at
>least during the early
> development, rapid DDL churn phase of the project.  When
>I enable hmb2ddl.auto,
> and proceed, I get foreign key exceptions during the
>setup of a test case, as
> part of CLEAN_INSERT.  I haven't tested, but plan to
>later this week, what
> happens under the original configuration is I set all
>the on-delete's to
> RESTRICT.  I suspect the errors will occur here as well.
>
> I could switch to doing the database cleanup in the
>teardown, but the dbunit
> documentation tends to push the CLEAN_INSERT setup and
>the do-nothing teardown
> and I tend to agree with the reasons given.
>
> Are there other options or approaches I should look at?
>
> Thank you.
> Eric Nielsen
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@...
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user

Re: Best practice issues...

by mario h.c.t. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, I've had this problem too.

You need to create an ordered dataset.

Here you have the code to this.

http://mitus.pastebin.com/mbebdf72

cheers.
mario h.c.t.

On Wed, Jun 18, 2008 at 5:13 PM, Jeff Jensen <jjensen@...> wrote:
We had to add cleanup during the teardown.  Different
tests manipulated different tables and the tables in the
setup data varied per test; therefore the clean wouldn't
hit all needed tables.  This had nothing to do with
Hibernate, of course...


On Wed, 18 Jun 2008 15:55:59 -0400
 Eric D Nielsen <nielsene@...> wrote:
> I've been having difficulties getting stable testing
>infrastructure working with
> the rest of my application.
>
> Specifically, I'm running into foreign key problems.
> Yes, I've head the docs
> and FAQs.
>
> In one version of my configuration, I'm using hand coded
>SQL with most, but not
> all of the "on-delete"s set to cascade.  I have dbunit's
>setup configured to
> use CLEAN_INSERT.  Under this version, everything seems
>to work.
>
> I'd like to use hibernates hbm2ddl.auto feature, at
>least during the early
> development, rapid DDL churn phase of the project.  When
>I enable hmb2ddl.auto,
> and proceed, I get foreign key exceptions during the
>setup of a test case, as
> part of CLEAN_INSERT.  I haven't tested, but plan to
>later this week, what
> happens under the original configuration is I set all
>the on-delete's to
> RESTRICT.  I suspect the errors will occur here as well.
>
> I could switch to doing the database cleanup in the
>teardown, but the dbunit
> documentation tends to push the CLEAN_INSERT setup and
>the do-nothing teardown
> and I tend to agree with the reasons given.
>
> Are there other options or approaches I should look at?
>
> Thank you.
> Eric Nielsen
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> dbunit-user mailing list
> dbunit-user@...
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dbunit-user mailing list
dbunit-user@...
https://lists.sourceforge.net/lists/listinfo/dbunit-user
LightInTheBox - Buy quality products at wholesale price