Re: Deleting All Objects in a Database
Re: Deleting All Objects in a Database
- Subject: Re: Deleting All Objects in a Database
- From: Chuck Hill <email@hidden>
- Date: Wed, 28 Oct 2009 13:43:46 -0700
On Oct 27, 2009, at 7:35 PM, Johnny Miller wrote:
Can you use Migrations to tear down and recreate the database while
unit testing? If so can you please explain how?
Reverse migrations are not supported now, so that might not be the
most productive avenue to pursue. I try to structure my unit tests so
that they leave the data in the state it started in so that I can run
them repeatedly without having to re-establish the database state.
For initial database state, I create an empty DB shell and the run the
app / unit tests which create the schema can make use of DBUnit to
load a base set of data.
Chuck
On Oct 27, 2009, at 3:31 PM, David LeBer wrote:
On 2009-10-27, at 9:14 PM, Chuck Hill wrote:
On Oct 27, 2009, at 5:57 PM, David LeBer wrote:
On 2009-10-27, at 8:29 PM, Chuck Hill wrote:
On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:
Hi all,
I am trying to make the life of the person doing our acceptance
testing easier by creating a utility that deletes all the
objects from our database without having to run our drop/create
scripts and restart our app every time she wants to start a
test from a clean environment. Is there an easy way to delete
all the objects in a database in webobjects?
Not that I can think of. In your case, it will probably be
quicker to do what you are doing.
For our integration tests we use a combination of raw sql and
DBUnit to setup and teardown the test db.
While the app is running? The problem doing this while the app is
running is mostly PK conflicts when the sequences restart. You
could invalidateAllObjects, but yanking the DB out from under a
running app _can_ produce odd results.
No, they are integration tests that are run by JUnit. My mistake, I
skimmed the OP's post, I agree he'd be best to stop, recreate/
reload and restart.
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Johnny Miller
Kahalawai Media Corp
w: www.kahalawai.com
e: email@hidden
p: 808.661.7962
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden