This is an automated email from the ASF dual-hosted git repository.

zrlw pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.3 by this push:
     new 7285b85cf0 Fix typos of test cases(#15569)
7285b85cf0 is described below

commit 7285b85cf07f67fb84126be1e308b9119bd8b5af
Author: co63oc <[email protected]>
AuthorDate: Sun Jul 20 17:24:22 2025 +0800

    Fix typos of test cases(#15569)
---
 .../loadbalance/ConsistentHashLoadBalanceTest.java | 24 +++----
 .../router/condition/ConditionStateRouterTest.java | 76 +++++++++++-----------
 2 files changed, 50 insertions(+), 50 deletions(-)

diff --git 
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalanceTest.java
 
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalanceTest.java
index 9e7c3cd2c2..b4c756dfb6 100644
--- 
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalanceTest.java
+++ 
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalanceTest.java
@@ -44,10 +44,10 @@ class ConsistentHashLoadBalanceTest extends 
LoadBalanceBaseTest {
         Map<Invoker, AtomicLong> genericInvokeCounter = 
getGenericInvokeCounter(runs, ConsistentHashLoadBalance.NAME);
         Map<Invoker, AtomicLong> invokeCounter = getInvokeCounter(runs, 
ConsistentHashLoadBalance.NAME);
 
-        Invoker genericHitted = findHitted(genericInvokeCounter);
-        Invoker hitted = findHitted(invokeCounter);
+        Invoker genericHit = findHit(genericInvokeCounter);
+        Invoker hit = findHit(invokeCounter);
 
-        Assertions.assertEquals(hitted, genericHitted, "hitted should equals 
to genericHitted");
+        Assertions.assertEquals(hit, genericHit, "hit should equals to 
genericHit");
     }
 
     @Test
@@ -78,7 +78,7 @@ class ConsistentHashLoadBalanceTest extends 
LoadBalanceBaseTest {
         }
     }
 
-    private Invoker findHitted(Map<Invoker, AtomicLong> invokerCounter) {
+    private Invoker findHit(Map<Invoker, AtomicLong> invokerCounter) {
         Invoker invoker = null;
 
         for (Map.Entry<Invoker, AtomicLong> entry : invokerCounter.entrySet()) 
{
@@ -96,26 +96,26 @@ class ConsistentHashLoadBalanceTest extends 
LoadBalanceBaseTest {
     @Test
     void testConsistentHashLoadBalance() {
         int runs = 10000;
-        long unHitedInvokerCount = 0;
-        Map<Invoker, Long> hitedInvokers = new HashMap<>();
+        long unHitInvokerCount = 0;
+        Map<Invoker, Long> hitInvokers = new HashMap<>();
         Map<Invoker, AtomicLong> counter = getInvokeCounter(runs, 
ConsistentHashLoadBalance.NAME);
         for (Invoker minvoker : counter.keySet()) {
             Long count = counter.get(minvoker).get();
 
             if (count == 0) {
-                unHitedInvokerCount++;
+                unHitInvokerCount++;
             } else {
-                hitedInvokers.put(minvoker, count);
+                hitInvokers.put(minvoker, count);
             }
         }
 
         Assertions.assertEquals(
-                counter.size() - 1, unHitedInvokerCount, "the number of 
unHitedInvoker should be counter.size() - 1");
-        Assertions.assertEquals(1, hitedInvokers.size(), "the number of 
hitedInvoker should be 1");
+                counter.size() - 1, unHitInvokerCount, "the number of 
unHitInvoker should be counter.size() - 1");
+        Assertions.assertEquals(1, hitInvokers.size(), "the number of 
hitInvoker should be 1");
         Assertions.assertEquals(
                 runs,
-                hitedInvokers.values().iterator().next().intValue(),
-                "the number of hited count should be the number of runs");
+                hitInvokers.values().iterator().next().intValue(),
+                "the number of hit count should be the number of runs");
     }
 
     // https://github.com/apache/dubbo/issues/5429
diff --git 
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionStateRouterTest.java
 
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionStateRouterTest.java
index 080f7584c9..09ea3673a8 100644
--- 
a/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionStateRouterTest.java
+++ 
b/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionStateRouterTest.java
@@ -495,48 +495,48 @@ class ConditionStateRouterTest {
         RpcInvocation invocation = new RpcInvocation();
         String p = "a";
         invocation.setArguments(new Object[] {null});
-        List<Invoker<String>> fileredInvokers = router.route(
+        List<Invoker<String>> filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         invocation.setArguments(new Object[] {p});
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(0, fileredInvokers.size());
+        Assertions.assertEquals(0, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("arguments = b " + " => " + " host = 
1.2.3.4")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("arguments[10].inner = a " + " => " + " 
host = 1.2.3.4")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         int integer = 1;
         invocation.setArguments(new Object[] {integer});
@@ -545,13 +545,13 @@ class ConditionStateRouterTest {
                         String.class,
                         getRouteUrl("arguments[0].inner = 1 " + " => " + " 
host = 1.2.3.4")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(0, fileredInvokers.size());
+        Assertions.assertEquals(0, filteredInvokers.size());
     }
 
     @Test
@@ -574,48 +574,48 @@ class ConditionStateRouterTest {
         BitList<Invoker<String>> invokers = new BitList<>(originInvokers);
 
         RpcInvocation invocation = new RpcInvocation();
-        List<Invoker<String>> fileredInvokers = router.route(
+        List<Invoker<String>> filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         invocation.setAttachment("foo", "a");
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(0, fileredInvokers.size());
+        Assertions.assertEquals(0, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("attachments = a " + " => " + " host = 
1.2.3.4")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("attachments[foo] = a " + " => " + " 
region = hangzhou")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(1, fileredInvokers.size());
+        Assertions.assertEquals(1, filteredInvokers.size());
     }
 
     @Test
@@ -638,31 +638,31 @@ class ConditionStateRouterTest {
         BitList<Invoker<String>> invokers = new BitList<>(originInvokers);
 
         RpcInvocation invocation = new RpcInvocation();
-        List<Invoker<String>> fileredInvokers = router.route(
+        List<Invoker<String>> filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         invocation.setAttachment("user_id", "80");
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(1, fileredInvokers.size());
+        Assertions.assertEquals(1, filteredInvokers.size());
 
         invocation.setAttachment("user_id", "101");
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
@@ -670,13 +670,13 @@ class ConditionStateRouterTest {
                         getRouteUrl("attachments[user_id] = ~100 " + " => " + 
" region = hangzhou")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
         invocation.setAttachment("user_id", "1");
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(1, fileredInvokers.size());
+        Assertions.assertEquals(1, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
@@ -684,26 +684,26 @@ class ConditionStateRouterTest {
                         getRouteUrl("attachments[user_id] = ~100 " + " => " + 
" region = hangzhou")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
         invocation.setAttachment("user_id", "101");
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("attachments[user_id] = ~100 " + " => " + 
" region = hangzhou")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(
+        filteredInvokers = router.route(
                 invokers.clone(),
                 URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService"),
                 invocation,
                 false,
                 new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        Assertions.assertEquals(3, filteredInvokers.size());
     }
 
     @Test
@@ -727,16 +727,16 @@ class ConditionStateRouterTest {
 
         URL consumer = URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService?when_key=a");
 
-        List<Invoker<String>> fileredInvokers = router.route(invokers.clone(), 
consumer, null, false, new Holder<>());
-        Assertions.assertEquals(0, fileredInvokers.size());
+        List<Invoker<String>> filteredInvokers = 
router.route(invokers.clone(), consumer, null, false, new Holder<>());
+        Assertions.assertEquals(0, filteredInvokers.size());
 
         router = new ConditionStateRouterFactory()
                 .getRouter(
                         String.class,
                         getRouteUrl("not_exist_when_key=a " + " => " + " 
then_key = a")
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router.route(invokers, consumer, null, false, new 
Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        filteredInvokers = router.route(invokers, consumer, null, false, new 
Holder<>());
+        Assertions.assertEquals(3, filteredInvokers.size());
     }
 
     @Test
@@ -763,9 +763,9 @@ class ConditionStateRouterTest {
                         String.class,
                         getRouteUrl("application=consumer_app&arguments[0]=a" 
+ " => " + " host = " + LOCAL_HOST)
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        List<Invoker<String>> fileredInvokers =
+        List<Invoker<String>> filteredInvokers =
                 router.route(invokers.clone(), consumer1, invocation, false, 
new Holder<>());
-        Assertions.assertEquals(2, fileredInvokers.size());
+        Assertions.assertEquals(2, filteredInvokers.size());
 
         // one of the conditions does not match
         URL consume2 = URL.valueOf("consumer://" + LOCAL_HOST + 
"/com.foo.BarService?application=another_consumer_app");
@@ -774,7 +774,7 @@ class ConditionStateRouterTest {
                         String.class,
                         getRouteUrl("application=consumer_app&arguments[0]=a" 
+ " => " + " host = " + LOCAL_HOST)
                                 .addParameter(FORCE_KEY, 
String.valueOf(true)));
-        fileredInvokers = router2.route(invokers.clone(), consume2, 
invocation, false, new Holder<>());
-        Assertions.assertEquals(3, fileredInvokers.size());
+        filteredInvokers = router2.route(invokers.clone(), consume2, 
invocation, false, new Holder<>());
+        Assertions.assertEquals(3, filteredInvokers.size());
     }
 }

Reply via email to