On Aug 20, 2013, at 7:42 AM, Nick Williams <nicho...@nicholaswilliams.net> 
wrote:
> 
> Well, yea. I had figured that part out. :-) I just didn't articulate my 
> question well enough.
> 
> The first step is obviously loading the class through the WACL through the 
> unit test (so this has to be a class not already loaded). I assume I'll 
> figure this part out reading through the existing WACL tests. But the key is 
> *how* to use weaving in the context of the Tomcat unit tests. The way I see 
> it I essentially have two options (though I may be overlooking something):
> 
> 1) Manually manipulate the bytes. This takes great expertise and is ripe for 
> failure. Not a big fan of the idea.
> 2) Introduce an additional test-time dependency on something like ASM. This 
> is probably the safest route, but it introduces an additional test-time 
> dependency. I don't know how amenable y'all are to that.

You only need to test that the weaver is called correctly, not that it actually 
weaves anything. You could have a stub weaver that just captures that it was 
called and verify that is what you expect. EasyMock might help here.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to