-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODE-7634: create an ArchUnitTest that asserts that geode-core only … #4549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Package rename, is good. NASA won't like the lack of emergency classes, but we'll worry about that next year...
duplication of LocatorAddress
is my only nitpik
@@ -363,15 +358,15 @@ public void testLocatorAndTwoServersJoinUsingDiffeHellman() throws Exception { | |||
// manager queues new views for processing through the DM listener, | |||
// which is a mock object in this test | |||
System.out.println("waiting for views to stabilize"); | |||
JoinLeave jl1 = ((GMSMembership) m1).getServices().getJoinLeave(); | |||
JoinLeave jl2 = ((GMSMembership) m2).getServices().getJoinLeave(); | |||
final Membership mgr1 = m1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this, test at the API boundary!
* This test class can be removed if and when we create an isolated Java module that does | ||
* not export internal membership classes. | ||
*/ | ||
public class CoreOnlyUsesMembershipAPIArchUnitTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how this is segmented, very much. only concern is that a new package ( or renamed package) will require manual entry into this list- aka how do we go about having an automated way to catch any new violations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure that one out. Any attempts met with OOME when run from gradle. That concern will go away when we start using Jigsaw and enforce API use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured as much, just something to keep an eye on...
|
||
import org.apache.commons.validator.routines.InetAddressValidator; | ||
|
||
public class LocatorAddress { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a clone of HostAddress
, curious why we want to have both classes...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like avoidable duplication
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do something about that. I don't much like it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to move LocatorAddress to the geode-tcp-server module and subclass it in membership for HostAddress.
@@ -114,32 +112,6 @@ void startupMessageFailed(InternalDistributedMember mbr, | |||
|
|||
Set<InternalDistributedMember> getMembersNotShuttingDown(); | |||
|
|||
// TODO - this method is only used by tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see test hooks reducing.
@@ -638,49 +612,6 @@ public DistributedMember getCoordinator() { | |||
return membership.getMembersNotShuttingDown(); | |||
} | |||
|
|||
// TODO - this method is only used by tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…uses the membership API creating a new test to enforce use of membership APIs. There are a few exceptions in test code, plus others that aren't in the "integration test" source set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apologies if I caused those conflicts with my latest merge
f939b33
to
f2d7ab8
Compare
apache#4549) * GEODE-7634: create an ArchUnitTest that asserts that geode-core only uses the membership API creating a new test to enforce use of membership APIs. There are a few exceptions in test code, plus others that aren't in the "integration test" source set. * removing test dependencies and fixing crashDistributedSystem method * moved membership API classes to membership.api package and fixed OOME * move address verification class to tcp-server module and subclass in membership * rebasing on Ernie's GeodeGlossary stuff
apache#4549) * GEODE-7634: create an ArchUnitTest that asserts that geode-core only uses the membership API creating a new test to enforce use of membership APIs. There are a few exceptions in test code, plus others that aren't in the "integration test" source set. * removing test dependencies and fixing crashDistributedSystem method * moved membership API classes to membership.api package and fixed OOME * move address verification class to tcp-server module and subclass in membership * rebasing on Ernie's GeodeGlossary stuff
…uses the membership API
creating a new test to enforce use of membership APIs.
This PR also deletes old deprecated loadEmergencyClasses methods and associated
state from a number of classes. That functionality was never integrated fully into membership
anyway.
Membership API classes and interfaces are now in membership.api instead of being buried in membership.gms.api. This simplifies ArchUnitTest rules.
HostAddress is duplicated and the copy is named LocatorAddress. This new class is
specifically for client cache connection pool use. The HostAddress class is retained and is now used
only by membership.
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop
)?Is your initial contribution a single, squashed commit?
Does
gradlew build
run cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.