commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: [math] Using reflection to test private methods
Date Sat, 01 Dec 2012 23:29:09 GMT
Google has a nice @ExposedForTesting annotation that they use for this.

There are numerous instances in guava where otherwise private methods are
exposed to the test suite for testing.  It makes a lot of sense, and there
are no questions to anybody looking at the code about what is happening.
 If you really want to do so, you can even implement a code walker that
guarantees that all methods are annotated with the access level and level
of stability.

On Sat, Dec 1, 2012 at 2:25 PM, Gilles Sadowski <
gilles@harfang.homelinux.org> wrote:

> After some time, it becomes a soiurce or questioning ("Why is this code
> package private?"). [And no, I don't think that it is enough reason to
> state that reason (for "Junit" testing) is the doc
>

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