All,

I recently added a JIRA enhancement and included a patch. I want to add
a unit test (for my changes to the LinkTool) to the existing tests, but
I'm having trouble doing so.

First, the test system itself is cumbersome (to me). It tries to start
servlet container instances and stuff like that, and anytime something
goes wrong, that server stays running and I can't run a test without
manually stopping it (which was a hunt to figure out how to do it properly).

Second (and more importantly, since I hacked the test script to ignore
all the stuff that wasn't working for me), what is the best way to
represent the standard servlet container objects when doing unit testing?

I started by looking at the existing ViewToolTests (which already has a
testLinkTool method) and I couldn't make head or tail of what's going
on. It looks like the test is attempting to use the on-the-fly-deployed
webapp for a real roundtrip, and then the output is tested against
expected output. Is there no good way to test the component directly?

I was expecting to actually instantiate a LinkTool, configure it
(probably using mock objects) and then poke and prod it to make sure
that it behaves the way I expected it. That does not appear to be
possible using the existing libraries and infrastructure.

Does anyone have any good ideas for how to do this?

-chris


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to