> I couldn't find a "user" list for Cactus, so I'm 
> sending my message here. Sorry for any inconvenience.

This *is* the Cactus user-list, so to speak.  By convention, you could add
[Cactus] to your subject line, like I've done with this message, to indicate
which component it is talking about.

> Is there a way to open a JDBC connection to the database once in my
> ServletTestCase so all of my Tests can use it? I'd like to open it before
> running any of my testXXX() tests and close it after the last one runs.
> There's probably a really easy way to do this, but I've been beating my
head
> against the wall for a while to no avail. Any ideas?

I don't know a whole lot about Cactus, but for JUnit in general (and
probably Cactus as well) you could do it in the TestCase constructor, as an
initialization block, or have your setUp method only create a connection if
there isn't one already, but this kinda goes against the design philosophy
of JUnit.  Each test is meant to be completely independent, with no side
effects, so that the order in which tests are executed doesn't interfere
with the test results and the tests themselves are more repeatable.

Reply via email to