|
Re: [junitperf] Using JunitPerf in a servlet with JunitEE
On Oct 20, 2004, at 6:19 AM, ozonshak wrote:
> So, I guess my questions are 1) is JUnitPerf compatible with JUnitEE,
> 2) can JUnitPerf be run in a servlet/J2EE environment, 3) what are
> some alternate techniques for running my test where I perhaps can
> evaluate the results of the timed test to see if it actually ran
> correctly?
I don't have experience running JUnitPerf inside of a J2EE container,
so I can't speculate on how JUnitPerf might behave in that environment.
That said, I'm not aware of any design constraints that would preclude
it from working in that environment. JUnitPerf tests are JUnit tests,
so anywhere one can go the other can follow.
I generally run JUnitPerf tests from the outside looking in. For
example, if a servlet/J2EE component generates a web page full of data,
and that web page isn't being displayed in an appropriate amount of
time, then I write a JUnitPerf test that times the web response as
observed by HttpUnit.
You mention that you want to time a database query. Do you have to run
that test within the J2EE container? Querying a database doesn't sound
J2EE-specific to me. If you have to test it within the J2EE container
as it's designed today, then I'd look to refactor that chunk of logic
out into a class that didn't need a container. Perhaps it just needs a
database connection, for example.
Hope that helps.
Mike
|