Skip to content

Commit

Permalink
Style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kannanjgithub committed Oct 23, 2024
1 parent 7b47451 commit b4653be
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
5 changes: 2 additions & 3 deletions xds/src/test/java/io/grpc/xds/DataPlaneRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import io.grpc.stub.StreamObserver;
import io.grpc.testing.protobuf.SimpleRequest;
import io.grpc.testing.protobuf.SimpleResponse;
import io.grpc.testing.protobuf.SimpleResponse.Builder;
import io.grpc.testing.protobuf.SimpleServiceGrpc;
import java.net.InetSocketAddress;
import java.util.HashSet;
Expand Down Expand Up @@ -100,8 +99,8 @@ protected void starting(Description description) {
controlPlane.setCdsConfig(ControlPlaneRule.buildCluster());
InetSocketAddress edsInetSocketAddress = (InetSocketAddress) server.getListenSockets().get(0);
controlPlane.setEdsConfig(
ControlPlaneRule.buildClusterLoadAssignment(edsInetSocketAddress.getHostName(), ENDPOINT_HOST_NAME,
edsInetSocketAddress.getPort()));
ControlPlaneRule.buildClusterLoadAssignment(edsInetSocketAddress.getHostName(),
ENDPOINT_HOST_NAME, edsInetSocketAddress.getPort()));
}

@Override
Expand Down
8 changes: 6 additions & 2 deletions xds/src/test/java/io/grpc/xds/GrpcXdsClientImplDataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import io.envoyproxy.envoy.config.core.v3.TransportSocket;
import io.envoyproxy.envoy.config.core.v3.TypedExtensionConfig;
import io.envoyproxy.envoy.config.endpoint.v3.Endpoint;
import io.envoyproxy.envoy.config.listener.v3.Filter;
import io.envoyproxy.envoy.config.listener.v3.FilterChain;
import io.envoyproxy.envoy.config.listener.v3.FilterChainMatch;
import io.envoyproxy.envoy.config.listener.v3.Listener;
Expand Down Expand Up @@ -85,6 +86,7 @@
import io.envoyproxy.envoy.extensions.filters.http.fault.v3.HTTPFault;
import io.envoyproxy.envoy.extensions.filters.http.rbac.v3.RBACPerRoute;
import io.envoyproxy.envoy.extensions.filters.http.router.v3.Router;
import io.envoyproxy.envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager;
import io.envoyproxy.envoy.extensions.filters.network.http_connection_manager.v3.HttpFilter;
import io.envoyproxy.envoy.extensions.filters.network.http_connection_manager.v3.Rds;
import io.envoyproxy.envoy.extensions.load_balancing_policies.client_side_weighted_round_robin.v3.ClientSideWeightedRoundRobin;
Expand Down Expand Up @@ -1008,7 +1010,8 @@ public void parseLocalityLbEndpoints_treatUnknownHealthAsHealthy() {
assertThat(struct.getErrorDetail()).isNull();
assertThat(struct.getStruct()).isEqualTo(
LocalityLbEndpoints.create(
Collections.singletonList(LbEndpoint.create("172.14.14.5", 8888, 20, true, "")), 100, 1));
Collections.singletonList(LbEndpoint.create("172.14.14.5", 8888, 20, true, "")), 100,
1));
}

@Test
Expand All @@ -1032,7 +1035,8 @@ public void parseLocalityLbEndpoints_withUnHealthyEndpoints() {
assertThat(struct.getErrorDetail()).isNull();
assertThat(struct.getStruct()).isEqualTo(
LocalityLbEndpoints.create(
Collections.singletonList(LbEndpoint.create("172.14.14.5", 8888, 20, false, "")), 100, 1));
Collections.singletonList(LbEndpoint.create("172.14.14.5", 8888, 20, false, "")), 100,
1));
}

@Test
Expand Down
12 changes: 8 additions & 4 deletions xds/src/test/java/io/grpc/xds/GrpcXdsClientImplTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ public XdsTransport create(ServerInfo serverInfo) {
}
};

xdsServerInfo = ServerInfo.create(SERVER_URI, CHANNEL_CREDENTIALS, ignoreResourceDeletion(), true);
xdsServerInfo = ServerInfo.create(SERVER_URI, CHANNEL_CREDENTIALS, ignoreResourceDeletion(),
true);
BootstrapInfo bootstrapInfo =
Bootstrapper.BootstrapInfo.builder()
.servers(Collections.singletonList(xdsServerInfo))
Expand Down Expand Up @@ -595,7 +596,8 @@ private void validateGoldenClusterLoadAssignment(EdsUpdate edsUpdate) {
.containsExactly(
Locality.create("region1", "zone1", "subzone1"),
LocalityLbEndpoints.create(
ImmutableList.of(LbEndpoint.create("192.168.0.1", 8080, 2, true, "endpoint-host-name")), 1, 0),
ImmutableList.of(LbEndpoint.create("192.168.0.1", 8080, 2, true,
"endpoint-host-name")), 1, 0),
Locality.create("region3", "zone3", "subzone3"),
LocalityLbEndpoints.create(ImmutableList.<LbEndpoint>of(), 2, 1));
}
Expand Down Expand Up @@ -3201,7 +3203,8 @@ public void edsResourceDeletedByCds() {
mf.buildClusterLoadAssignment(resource,
ImmutableList.of(
mf.buildLocalityLbEndpoints("region2", "zone2", "subzone2",
mf.buildLbEndpoint("192.168.0.2", 9090, "healthy", 3, "endpoint-host-name"), 1, 0)),
mf.buildLbEndpoint("192.168.0.2", 9090, "healthy", 3,
"endpoint-host-name"), 1, 0)),
ImmutableList.of(mf.buildDropOverload("lb", 100)))));
call.sendResponse(EDS, clusterLoadAssignments, VERSION_1, "0000");
verify(edsWatcher).onChanged(edsUpdateCaptor.capture());
Expand Down Expand Up @@ -3278,7 +3281,8 @@ public void multipleEdsWatchers() {
mf.buildClusterLoadAssignment(edsResourceTwo,
ImmutableList.of(
mf.buildLocalityLbEndpoints("region2", "zone2", "subzone2",
mf.buildLbEndpoint("172.44.2.2", 8000, "healthy", 3, "endpoint-host-name"), 2, 0)),
mf.buildLbEndpoint("172.44.2.2", 8000, "healthy", 3, "endpoint-host-name"),
2, 0)),
ImmutableList.<Message>of()));
call.sendResponse(EDS, clusterLoadAssignmentTwo, VERSION_2, "0001");

Expand Down
9 changes: 6 additions & 3 deletions xds/src/test/java/io/grpc/xds/XdsNameResolverTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,8 @@ public void resolved_routeActionHasAutoHostRewrite_emitsCallOptionForTheSame()
throws XdsInitializationException {
System.setProperty("GRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE", "true");
try {
FakeXdsClient xdsClient = (FakeXdsClient) xdsClientPoolFactory.getOrCreate(AUTHORITY).getObject();
FakeXdsClient xdsClient =
(FakeXdsClient) xdsClientPoolFactory.getOrCreate(AUTHORITY).getObject();
xdsClient.setTrustedXdsServer(true);
resolver = new XdsNameResolver(targetUri, null, AUTHORITY, null, serviceConfigParser,
syncContext, scheduler, xdsClientPoolFactory, mockRandom,
Expand Down Expand Up @@ -942,7 +943,8 @@ public void resolved_routeActionHasAutoHostRewrite_emitsCallOptionForTheSame()
@Test
public void resolved_routeActionHasAutoHostRewrite_flagDisabledTest()
throws XdsInitializationException {
FakeXdsClient xdsClient = (FakeXdsClient) xdsClientPoolFactory.getOrCreate(AUTHORITY).getObject();
FakeXdsClient xdsClient =
(FakeXdsClient) xdsClientPoolFactory.getOrCreate(AUTHORITY).getObject();
xdsClient.setTrustedXdsServer(true);
resolver = new XdsNameResolver(targetUri, null, AUTHORITY, null, serviceConfigParser,
syncContext, scheduler, xdsClientPoolFactory, mockRandom,
Expand Down Expand Up @@ -2294,7 +2296,8 @@ void deliverError(final Status error) {
@Nullable
@Override
public ServerInfo getServerInfo(String resource) {
return ServerInfo.create(SERVER_URI, InsecureChannelCredentials.create(), false, isTrustedXdsServer);
return ServerInfo.create(SERVER_URI, InsecureChannelCredentials.create(), false,
isTrustedXdsServer);
}
}

Expand Down

0 comments on commit b4653be

Please sign in to comment.