Skip to content

Commit e1334ea

Browse files
authored
Change Round Robin and WeightedRoundRobin into petiole policies (#10528)
* Change Round Robin and WeightedRoundRobin into petiole policies
1 parent 69986b5 commit e1334ea

File tree

15 files changed

+983
-629
lines changed

15 files changed

+983
-629
lines changed

core/src/test/java/io/grpc/internal/ManagedChannelImplTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
/** Unit tests for {@link ManagedChannelImpl}. */
162162
@RunWith(JUnit4.class)
163163
// TODO(creamsoup) remove backward compatible check when fully migrated
164-
@SuppressWarnings("deprecation")
164+
@SuppressWarnings({"deprecation", "DataFlowIssue"})
165165
public class ManagedChannelImplTest {
166166
private static final int DEFAULT_PORT = 447;
167167

core/src/testFixtures/java/io/grpc/internal/TestUtils.java

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.grpc.CallOptions;
2525
import io.grpc.ChannelLogger;
2626
import io.grpc.ClientStreamTracer;
27+
import io.grpc.EquivalentAddressGroup;
2728
import io.grpc.InternalLogId;
2829
import io.grpc.LoadBalancer.PickResult;
2930
import io.grpc.LoadBalancer.PickSubchannelArgs;
@@ -143,6 +144,10 @@ public Runnable answer(InvocationOnMock invocation) throws Throwable {
143144
return captor;
144145
}
145146

147+
public static EquivalentAddressGroup stripAttrs(EquivalentAddressGroup eag) {
148+
return new EquivalentAddressGroup(eag.getAddresses());
149+
}
150+
146151
private TestUtils() {
147152
}
148153

examples/android/strictmode/app/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dependencies {
5353
implementation 'androidx.appcompat:appcompat:1.0.0'
5454

5555
// You need to build grpc-java to obtain these libraries below.
56+
implementation 'io.grpc:grpc-core:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
5657
implementation 'io.grpc:grpc-okhttp:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
5758
implementation 'io.grpc:grpc-protobuf-lite:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION
5859
implementation 'io.grpc:grpc-stub:1.59.0-SNAPSHOT' // CURRENT_GRPC_VERSION

examples/android/strictmode/app/proguard-rules.pro

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
-dontwarn javax.naming.**
1616
-dontwarn okio.**
1717
-dontwarn sun.misc.Unsafe
18+

util/build.gradle

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id "java-library"
3+
id "java-test-fixtures"
34
id "maven-publish"
45

56
id "me.champeau.jmh"
@@ -19,11 +20,18 @@ dependencies {
1920

2021
implementation libraries.animalsniffer.annotations,
2122
libraries.guava
22-
testImplementation testFixtures(project(':grpc-api')),
23+
testImplementation libraries.guava.testlib,
24+
testFixtures(project(':grpc-api')),
2325
testFixtures(project(':grpc-core')),
2426
project(':grpc-testing')
25-
testImplementation libraries.guava.testlib
2627

28+
testFixturesApi project(':grpc-core')
29+
testFixturesImplementation libraries.guava,
30+
libraries.junit,
31+
libraries.mockito.core,
32+
testFixtures(project(':grpc-api')),
33+
testFixtures(project(':grpc-core')),
34+
project(':grpc-testing')
2735
jmh project(':grpc-testing')
2836

2937
signature libraries.signature.java

0 commit comments

Comments
 (0)