commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <>
Subject Re: [math] Checking preconditions on package private functions
Date Fri, 30 Nov 2012 07:42:10 GMT
That's fine.  I think raw use of reflection might make the tests pretty
complicated, but the idea is reasonable.

Jmockit allows mocking of static methods (I have used it to mock
System.nanoTime(), for instance).  By using a partial mock class, you can
gain access to private methods as well.

On Thu, Nov 29, 2012 at 10:59 PM, S├ębastien Brisard <> wrote:

> Does anyone oppose the usage of reflection in unit testing to access
> private methods?
> I personnally think it is a good compromise between encapsulation and
> comprehensive testing.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message