For similar cases, I have a build/test_classes that I exclude from my
production build with ant.
Manually, it depends on your IDE. I use IDEA, and I can choose what tests
classes I want to test.
For this kind of tests, I use plain JUnit, whitout Cactus.
Regards,
Pedro Nevado

-----Mensaje original-----
De: David Turley [mailto:[EMAIL PROTECTED]
Enviado el: miƩrcoles, 31 de agosto de 2005 20:28
Para: Cactus Users List
Asunto: Database dilemma


Hello everyone,

    I'm testing some struts actions that modify some rows in the
database, but I don't want those modifications to stick, because then I
have to set everything back to the way it was to get my database back to
a known state.  You'd think that if I changed a row, I could just change
it back, but whoever designed this database put triggers all over the
place, so if you change one thing explicitly, you change several other
things implicitly.  So I thought that it would be nice if I could
execute everything within the context of a transaction.  To do this I
would need to change the code that gets the connections to the database
to get only one connection, set it so that autocommit is off, and return
that connection whenever a connection is needed.  So I have a copy of
the class that has all the database access code in it that has those
modifications, but I only want to use this class for testing,
obviously.  Is there a way to use one version of the class for testing
and the other for production?  I could do it with ant, I suppose and
just exclude the one and include the other, but is there an easier way?
One that I can use when I run my tests manually?  Or is there some other
better alternative for what I'm trying to do?

Thanks,
David

P.S.  Sorry if this is a little off topic.  I just don't know who else
to ask, and you are all so helpful :-).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to