geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Galen O'Sullivan" <gosulli...@pivotal.io>
Subject Re: [DISCUSS] Replace @TestingOnly with @VisibleForTesting
Date Mon, 17 Dec 2018 22:45:20 GMT
Sounds good to me.

On Mon, Dec 17, 2018 at 1:04 PM Owen Nichols <onichols@pivotal.io> wrote:

> Sounds good, I would be happy to +1 a PR for this
>
> > On Dec 17, 2018, at 12:22 PM, Kirk Lund <klund@apache.org> wrote:
> >
> > We have a custom annotation in geode-common called @TestingOnly:
> >
> > geode-common/src/main/java/org/apache/geode/annotations/TestingOnly.java
> >
> > This annotation was created while pairing with Michael Feathers and the
> > intention was to annotate non-private constructors or methods that have a
> > widened visibility scope to facilitate testing.
> >
> > Some developers, however, have interpreted it as meaning that the
> > constructor or method cannot be used in the main src code and can only be
> > used from test src code.
> >
> > I'd like to propose deleting @TestingOnly and change to
> > using @VisibleForTesting which is defined in Guava (which is already a
> > Geode dependency). The name of the Guava annotation is less ambiguous and
> > it's already been adopted for use by additional projects including
> AssertJ
> > which we use extensively.
> >
> > The javadocs on VisibleForTesting explains its usage very clearly:
> >
> > /**
> > * Annotates a program element that exists, or is more widely visible
> > than otherwise necessary, only
> > * for use in test code.
> > *
> > * @author Johannes Henkel
> > */
> > @GwtCompatible
> > public @interface VisibleForTesting {
> > }
>
>

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