The database test scripts I use may not suit your needs, but I'll run you
through the main work flows anyway.
Use Torque to create sql
|
|
\|/
if set for each database type (db2/hyper etc)
use <sql> task to generate
(db connectivity information is set
as properties in build.properties)
|
|
|
\|/
For each database, uses velocity to dynamically
general the login part of the repository descriptor
and run the unit test.
|
|
|
\|/
For each test, uses dbunit to dump data into
database and do table comparisons etc etc using the
same connection that the persistence broker uses (with caching
off).
Anyway, may not suit your need, however if you're looking to unit test your db
code it's pretty stable.
Also, if you're looking for x-platform on the repository descriptor, may I
suggest a velocity template. It's fairly short order to replace the template
variable with a parameter sourced from ant or your build.properties. I have a
simplified version of the Texen task I wrote if you want it.
Cheers
Adam
Quoting Durham David R Jr Contr 805 CSPTS/SCE <[EMAIL PROTECTED]>:
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, September 15, 2004 1:35 AM
> > To: OJB Users List
> > Subject: Re: hsqldb, junit, torque, ojb, et al.
> >
> > Yeah, I've got a similar thing goin on with my db unit tests (torque +
> ojb +
> > velocity + dbunit).
> >
> > Quite often people get confused with the protocol/subprotocol things
> in OJB.
> > Your connection descriptor should look something like this:
> >
> > protocol="jdbc"
> > subprotocol="hsqldb"
> > dbalias="/home/username/databasename"
> > username="sa"
> > password=""
>
>
> I've got:
>
> protocol="jdbc:hsqldb"
> subprotocol="file"
> dbalias="ucm"
> username="sa"
> password=""
>
> I don't want to use a full path because I'm going for maximum
> portability. I've cross posted this message, so I think my step is to
> determine the line(s) of code that actually resolves the db file.
>
>
> > I've seen some time people leave out the dbalias by mistake and add it
> to the
> > subprotocol. In this situation, you'll get some odd behaviour. So
> that's
> > probably the first thing to check.
>
> I'm thinking my protocol, subprotocol, dbalias combination should be
> fine. But maybe not.
>
>
>
> > Second, if you're using hsql in standalone and you're accessing it
> from two
> > seperate jvms, you get all sorts of problems there (or at least I
> did).
>
> Well, yeah, I thought of that. I'm pretty sure that I'm loading from
> the same JVM "instance", let's say.
>
>
> > Anyway, check those two things and if you still have problems I have
> some pretty
> > neat scripts that work well that I can strip the proprietory stuff
> from and send
> > your way.
>
> What types of scripts? I'm pretty well set on what I need to do, but
> I've run into this minor problem. Once I've got it resolved I'll be
> smooth sailing, as it were.
>
>
> - Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
------------------------------------------------------------
This email was sent from Netspace Webmail: http://www.netspace.net.au
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]