actual responsibility.)
That last one kinda scares me.
I also noted that some elements annotated as @VisibleForTesting are not
referenced by any test.
Dale
From: Alexander Murmann
Date: Thursday, November 4, 2021 at 5:02 PM
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
For constructors, I suggest that we don't need to use either annotation. A
package-private constructor that accepts parameters for all dependencies is
not breaking encapsulation or exposing internals and is very appropriate
for constructor based injection. It adheres to best practices as set out
fo
@VisibileForTesting is bad. It does NOT tell you if the method SHOULD HAVE
BEEN private, or package-private, or protected, so there is no way to
reconstruct the originally-intended code if the annotation is ever removed. It
also prevents the exposed methods from being named in a way that clear
I'm ok with not using these annotations, but we still need to write *unit
tests* in addition to end-to-end *system tests*.
I started this thread primarily to standardize on how we use one or both
annotations. We shouldn't be using both arbitrarily without some sort of
guidelines.
If we want to ac
Houghton
From: Mark Hanson
Date: Friday, November 5, 2021 at 10:11 AM
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
I generally see @VisibleForTesting used to change permissions of a private
method, which is inaccessible to an external object, into a public method to
allow a
r
and by tests. In order for tests to call it, we have to make it visible, so we
mark it as @VisibleForTesting.
Dale
From: Alexander Murmann
Date: Thursday, November 4, 2021 at 5:02 PM
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
Another +1
constructor is called only by the old constructor and by
tests. In order for tests to call it, we have to make it visible, so we mark it
as @VisibleForTesting.
Dale
From: Alexander Murmann
Date: Thursday, November 4, 2021 at 5:02 PM
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
Subject: Re: @TestOnly or @VisibleForTesting
The main time I use the @VisibleForTesting annotation is when I'm unit testing
a method that includes static calls that can't be mocked or verified. A random
example from the codebase is LatestLastAccessTimeMessage.process() which has
e: @TestOnly or @VisibleForTesting
Another +1 to Eric's point. What are others seeing as valid use cases for those
annotations?
From: Patrick Johnson
Sent: Thursday, November 4, 2021 15:55
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
I agree wit
Another +1 to Eric's point. What are others seeing as valid use cases for those
annotations?
From: Patrick Johnson
Sent: Thursday, November 4, 2021 15:55
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
I agree with Eric. Maybe rather
better identification), but I do find it useful to add
@VisibleForTesting methods while making unit tests.
From: Patrick Johnson
Date: Thursday, November 4, 2021 at 3:56 PM
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
I agree with Eric. Maybe rather than standardizing on one
that can be tested on its own.
>
> The same could probably be said for @TestOnly unless there are actually
> static analysis tools that need it for some reason.
>
> From: Kirk Lund
> Date: Thursday, November 4, 2021 at 15:13
> To: dev@geode.apache.org
> Subject: Re:
are actually
static analysis tools that need it for some reason.
From: Kirk Lund
Date: Thursday, November 4, 2021 at 15:13
To: dev@geode.apache.org
Subject: Re: @TestOnly or @VisibleForTesting
As everyone thinks about how we want to use these annotations, please k
class that has a
wider visibility that can be tested on its own.
The same could probably be said for @TestOnly unless there are actually static
analysis tools that need it for some reason.
From: Kirk Lund
Date: Thursday, November 4, 2021 at 15:13
To: dev@geode.apache.org
Subject: Re: @TestOnly
As everyone thinks about how we want to use these annotations, please keep
this in mind that both *@VisibleForTesting* and *@TestOnly* can be used on
Types (Class/Interface/Enum), Constructors, Methods and Fields. (not just
Methods)
On Thu, Nov 4, 2021 at 3:09 PM Kirk Lund wrote:
> Hey all,
>
>
15 matches
Mail list logo