Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
MODULE: Fix some GatewaySenderFactoryImpl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogpz committed Feb 4, 2022
1 parent 1959233 commit 74f9274
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.geode.cache.wan.GatewaySender.OrderPolicy;
import org.apache.geode.cache.wan.GatewaySenderFactory;
import org.apache.geode.cache.wan.GatewayTransportFilter;
import org.apache.geode.distributed.internal.InternalDistributedSystem;
import org.apache.geode.internal.cache.GemFireCacheImpl;
import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.internal.cache.wan.GatewaySenderAttributes;
Expand Down Expand Up @@ -256,7 +257,13 @@ public GatewaySenderFactory setEnforceThreadsConnectSameReceiver(

static void validate(final @NotNull InternalCache cache,
final @NotNull GatewaySenderAttributesImpl attributes) {
final int myDSId = cache.getDistributionManager().getDistributedSystemId();
int myDSId;
if (cache instanceof CacheCreation) {
myDSId = InternalDistributedSystem.getAnyInstance().getDistributionManager()
.getDistributedSystemId();
} else {
myDSId = cache.getDistributionManager().getDistributedSystemId();
}
final int remoteDSId = attributes.getRemoteDSId();

if (remoteDSId == myDSId) {
Expand Down Expand Up @@ -371,5 +378,4 @@ public void configureGatewaySender(GatewaySender senderCreation) {
attrs.setEnforceThreadsConnectSameReceiver(
senderCreation.getEnforceThreadsConnectSameReceiver());
}

}

0 comments on commit 74f9274

Please sign in to comment.