Re: Writing Unit Tests: Hard to do with Final Classes/Final Methods.

2008-10-29 Thread Johan Haleby
Could you please post the same question in the PowerMock google group instead and I'll promise to help you out :). That way we don't have to hijack the thread. On Wed, Oct 29, 2008 at 7:14 AM, Barrie Treloar [EMAIL PROTECTED] wrote: On Fri, Oct 24, 2008 at 6:33 PM, Barrie Treloar [EMAIL

Re: Writing Unit Tests: Hard to do with Final Classes/Final Methods.

2008-10-24 Thread Johan Haleby
You could try out PowerMock (www.powermock.org), it allows you to mock final classes/methods easily if you're used to EasyMock. On Fri, Oct 24, 2008 at 7:20 AM, Barrie Treloar [EMAIL PROTECTED] wrote: I wanted to write a unit test that showed AbstractPollingIoProcessor.write() threw an

Re: Writing Unit Tests: Hard to do with Final Classes/Final Methods.

2008-10-24 Thread Emmanuel Lecharny
Barrie Treloar wrote: I wanted to write a unit test that showed AbstractPollingIoProcessor.write() threw an exception that the WriteFuture doesn't get notified. But all the places I would sneak in such a change for testing have been denied. The classes I want to modify are final or the methods

Re: Writing Unit Tests: Hard to do with Final Classes/Final Methods.

2008-10-24 Thread Barrie Treloar
On Fri, Oct 24, 2008 at 4:39 PM, Johan Haleby [EMAIL PROTECTED] wrote: You could try out PowerMock (www.powermock.org), it allows you to mock final classes/methods easily if you're used to EasyMock. Nice! I will write up some tests then.

Re: Writing Unit Tests: Hard to do with Final Classes/Final Methods.

2008-10-24 Thread W.B. Garvelink
Wasn't NioProcessor made non-final as part of fixing DIRMINA-615 ? The attached patch file removes the final keyword. At work I'm currently using a custom build of 2.0.0-M3 with just one change -- to remove the final keyword from NioProcessor. There's quite a lot of code in that class, copy