From 38a2aa111aef03b0177b7699517ee2ef78f77709 Mon Sep 17 00:00:00 2001 From: Hu Zongtang Date: Sun, 28 Jun 2020 09:49:53 +0800 Subject: [PATCH] [#3185]Fix chinese unit method name in config test module. (#3186) --- .../config/server/utils/GroupKeyTest.java | 24 +++++++++---------- .../server/utils/SimpleReadWriteLockTest.java | 10 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java b/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java index 2b8e3b65d..bea4272ef 100644 --- a/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java +++ b/config/src/test/java/com/alibaba/nacos/config/server/utils/GroupKeyTest.java @@ -30,7 +30,7 @@ public class GroupKeyTest { @Rule public final ExpectedException thrown = ExpectedException.none(); @Test - public void test_parseGroupKey_非法的() { + public void testParseInvalidGroupKey() { String key = "11111+222+333333+444"; try { GroupKey2.parseKey(key); @@ -70,7 +70,7 @@ public class GroupKeyTest { } @Test - public void getKey_ThreeParams() { + public void testGetKeyByThreeParams() { // Act final String actual = GroupKey.getKey(",", ",", "3"); @@ -80,7 +80,7 @@ public class GroupKeyTest { } @Test - public void getKey_TwoParams() { + public void testGetKeyByTwoParams() { // Act final String actual = GroupKey.getKey("3", "\'"); @@ -90,7 +90,7 @@ public class GroupKeyTest { } @Test - public void getKeyTenant_Plus_ThreeParams() { + public void testGetKeyTenantByPlusThreeParams() { // Act final String actual = GroupKey.getKeyTenant("3", "1", ","); @@ -100,7 +100,7 @@ public class GroupKeyTest { } @Test - public void getKeyTenant_Percent_ThreeParams() { + public void testGetKeyTenantByPercentThreeParams() { // Act final String actual = GroupKey.getKeyTenant("\u0000\u0000", "%+", null); @@ -110,7 +110,7 @@ public class GroupKeyTest { } @Test - public void parseKey_SingleCharacter() { + public void testParseKeyBySingleCharacter() { // Act final String[] actual = GroupKey.parseKey("/"); @@ -120,7 +120,7 @@ public class GroupKeyTest { } @Test - public void parseKey_Plus_IllegalArgumentException() { + public void testParseKeyForPlusIllegalArgumentException() { // Act thrown.expect(IllegalArgumentException.class); @@ -130,7 +130,7 @@ public class GroupKeyTest { } @Test - public void parseKey_Percent_IllegalArgumentException() { + public void testParseKeyForPercentIllegalArgumentException() { // Act thrown.expect(IllegalArgumentException.class); @@ -140,7 +140,7 @@ public class GroupKeyTest { } @Test - public void parseKey_Invalid_StringIndexOutOfBoundsException() { + public void testParseKeyForInvalidStringIndexOutOfBoundsException() { // Act thrown.expect(StringIndexOutOfBoundsException.class); @@ -150,7 +150,7 @@ public class GroupKeyTest { } @Test - public void urlEncode_Plus() { + public void testUrlEncodePlus() { // Arrange final StringBuilder sb = new StringBuilder("????"); @@ -164,7 +164,7 @@ public class GroupKeyTest { } @Test - public void urlEncode_Percent() { + public void testUrlEncodeByPercent() { // Arrange final StringBuilder sb = new StringBuilder("??????"); @@ -178,7 +178,7 @@ public class GroupKeyTest { } @Test - public void urlEncode_NullStringBuilder() { + public void testUrlEncodeForNullStringBuilder() { // Act thrown.expect(NullPointerException.class); diff --git a/config/src/test/java/com/alibaba/nacos/config/server/utils/SimpleReadWriteLockTest.java b/config/src/test/java/com/alibaba/nacos/config/server/utils/SimpleReadWriteLockTest.java index 32db67855..342f95dbe 100644 --- a/config/src/test/java/com/alibaba/nacos/config/server/utils/SimpleReadWriteLockTest.java +++ b/config/src/test/java/com/alibaba/nacos/config/server/utils/SimpleReadWriteLockTest.java @@ -28,7 +28,7 @@ import static org.junit.Assert.assertTrue; public class SimpleReadWriteLockTest { @Test - public void test_双重读锁_全部释放_加写锁() { + public void testDoubleReadLockByAllReleaseAndWriteLock() { SimpleReadWriteLock lock = new SimpleReadWriteLock(); assertTrue(lock.tryReadLock()); assertTrue(lock.tryReadLock()); @@ -40,14 +40,14 @@ public class SimpleReadWriteLockTest { } @Test - public void test_加写锁() { + public void testAddWriteLock() { SimpleReadWriteLock lock = new SimpleReadWriteLock(); assertTrue(lock.tryWriteLock()); lock.releaseWriteLock(); } @Test - public void test_双重写锁() { + public void testDoubleWriteLock() { SimpleReadWriteLock lock = new SimpleReadWriteLock(); assertTrue(lock.tryWriteLock()); @@ -55,7 +55,7 @@ public class SimpleReadWriteLockTest { } @Test - public void test_先读锁后写锁() { + public void testFirstReadLockThenWriteLock() { SimpleReadWriteLock lock = new SimpleReadWriteLock(); assertTrue(lock.tryReadLock()); @@ -63,7 +63,7 @@ public class SimpleReadWriteLockTest { } @Test - public void test_双重读锁_释放一个_加写锁失败() { + public void testDoubleReadLockAndOneReleaseOneFailed() { SimpleReadWriteLock lock = new SimpleReadWriteLock(); assertTrue(lock.tryReadLock()); assertTrue(lock.tryReadLock());