You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/11/22 03:06:05 UTC
[dubbo] branch 3.1 updated: Remove public modifier in dubbo-common (#10977)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.1 by this push:
new 4af8606b1d Remove public modifier in dubbo-common (#10977)
4af8606b1d is described below
commit 4af8606b1d659d9b386a044ad886ddeba3299567
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Tue Nov 22 11:05:58 2022 +0800
Remove public modifier in dubbo-common (#10977)
---
.../dubbo/common/BaseServiceMetadataTest.java | 6 +-
.../common/CommonScopeModelInitializerTest.java | 6 +-
.../dubbo/common/InterfaceAddressURLTest.java | 14 ++--
.../common/PojoUtilsForNonPublicStaticTest.java | 6 +-
.../common/ProtocolServiceKeyMatcherTest.java | 6 +-
.../dubbo/common/ProtocolServiceKeyTest.java | 6 +-
.../apache/dubbo/common/ServiceKeyMatcherTest.java | 10 +--
.../org/apache/dubbo/common/ServiceKeyTest.java | 6 +-
.../org/apache/dubbo/common/URLBuilderTest.java | 20 ++---
.../org/apache/dubbo/common/URLStrParserTest.java | 8 +-
.../test/java/org/apache/dubbo/common/URLTest.java | 97 +++++++++++-----------
.../common/beans/InstantiationStrategyTest.java | 6 +-
.../dubbo/common/beans/ScopeBeanFactoryTest.java | 6 +-
.../common/beanutil/JavaBeanAccessorTest.java | 8 +-
.../common/beanutil/JavaBeanSerializeUtilTest.java | 42 +++++-----
.../dubbo/common/bytecode/ClassGeneratorTest.java | 10 +--
.../apache/dubbo/common/bytecode/MixinTest.java | 6 +-
.../apache/dubbo/common/bytecode/ProxyTest.java | 8 +-
.../apache/dubbo/common/bytecode/WrapperTest.java | 32 +++----
.../common/cache/FileCacheStoreFactoryTest.java | 2 +-
.../dubbo/common/cache/FileCacheStoreTest.java | 2 +-
.../compiler/support/AdaptiveCompilerTest.java | 6 +-
.../common/compiler/support/ClassUtilsTest.java | 30 +++----
.../common/compiler/support/JavaCodeTest.java | 4 +-
.../compiler/support/JavassistCompilerTest.java | 12 +--
.../common/compiler/support/JdkCompilerTest.java | 16 ++--
.../concurrent/CompletableFutureTaskTest.java | 14 ++--
.../common/config/CompositeConfigurationTest.java | 6 +-
.../common/config/ConfigurationCacheTest.java | 6 +-
.../common/config/ConfigurationUtilsTest.java | 16 ++--
.../config/EnvironmentConfigurationTest.java | 6 +-
.../dubbo/common/config/EnvironmentTest.java | 8 +-
.../common/config/InmemoryConfigurationTest.java | 2 +-
.../config/OrderedPropertiesConfigurationTest.java | 6 +-
.../common/config/PrefixedConfigurationTest.java | 6 +-
.../common/config/PropertiesConfigurationTest.java | 6 +-
.../common/config/SystemConfigurationTest.java | 6 +-
.../AbstractDynamicConfigurationFactoryTest.java | 6 +-
.../AbstractDynamicConfigurationTest.java | 28 +++----
.../config/configcenter/ConfigChangeTypeTest.java | 6 +-
.../configcenter/ConfigChangedEventTest.java | 10 +--
.../DynamicConfigurationFactoryTest.java | 6 +-
.../FileSystemDynamicConfigurationFactoryTest.java | 6 +-
.../file/FileSystemDynamicConfigurationTest.java | 12 +--
.../common/constants/CommonConstantsTest.java | 6 +-
.../apache/dubbo/common/convert/ConverterTest.java | 8 +-
.../convert/StringToBooleanConverterTest.java | 8 +-
.../convert/StringToCharArrayConverterTest.java | 8 +-
.../convert/StringToCharacterConverterTest.java | 8 +-
.../convert/StringToDoubleConverterTest.java | 8 +-
.../common/convert/StringToFloatConverterTest.java | 8 +-
.../convert/StringToIntegerConverterTest.java | 8 +-
.../common/convert/StringToLongConverterTest.java | 8 +-
.../convert/StringToOptionalConverterTest.java | 8 +-
.../common/convert/StringToShortConverterTest.java | 8 +-
.../convert/StringToStringConverterTest.java | 8 +-
.../convert/multiple/MultiValueConverterTest.java | 6 +-
.../multiple/StringToArrayConverterTest.java | 12 +--
.../StringToBlockingDequeConverterTest.java | 12 +--
.../StringToBlockingQueueConverterTest.java | 12 +--
.../multiple/StringToCollectionConverterTest.java | 12 +--
.../multiple/StringToDequeConverterTest.java | 12 +--
.../multiple/StringToListConverterTest.java | 12 +--
.../StringToNavigableSetConverterTest.java | 12 +--
.../multiple/StringToQueueConverterTest.java | 12 +--
.../convert/multiple/StringToSetConverterTest.java | 12 +--
.../multiple/StringToSortedSetConverterTest.java | 12 +--
.../StringToTransferQueueConverterTest.java | 12 +--
.../extension/AdaptiveClassCodeGeneratorTest.java | 6 +-
.../common/extension/ExtensionDirectorTest.java | 14 ++--
.../common/extension/ExtensionLoaderTest.java | 96 ++++++++++-----------
.../extension/ExtensionLoader_Adaptive_Test.java | 34 ++++----
...tensionLoader_Adaptive_UseJdkCompiler_Test.java | 4 +-
.../extension/ExtensionLoader_Compatible_Test.java | 6 +-
.../inject/AdaptiveExtensionInjectorTest.java | 6 +-
.../extension/support/ActivateComparatorTest.java | 8 +-
.../common/extension/wrapper/WrapperTest.java | 6 +-
.../dubbo/common/function/PredicatesTest.java | 12 +--
.../apache/dubbo/common/function/StreamsTest.java | 10 +--
.../dubbo/common/function/ThrowableActionTest.java | 6 +-
.../common/function/ThrowableConsumerTest.java | 6 +-
.../common/function/ThrowableFunctionTest.java | 6 +-
.../java/org/apache/dubbo/common/io/BytesTest.java | 30 +++----
.../apache/dubbo/common/io/StreamUtilsTest.java | 16 ++--
.../common/io/UnsafeByteArrayInputStreamTest.java | 16 ++--
.../common/io/UnsafeByteArrayOutputStreamTest.java | 14 ++--
.../dubbo/common/io/UnsafeStringReaderTest.java | 12 +--
.../dubbo/common/io/UnsafeStringWriterTest.java | 18 ++--
.../apache/dubbo/common/json/GsonUtilsTest.java | 8 +-
.../apache/dubbo/common/lang/PrioritizedTest.java | 10 +--
.../common/lang/ShutdownHookCallbacksTest.java | 8 +-
.../dubbo/common/logger/LoggerAdapterTest.java | 4 +-
.../dubbo/common/logger/LoggerFactoryTest.java | 16 ++--
.../org/apache/dubbo/common/logger/LoggerTest.java | 4 +-
.../dubbo/common/logger/slf4j/Slf4jLoggerTest.java | 6 +-
.../support/FailsafeErrorTypeAwareLoggerTest.java | 12 +--
.../common/logger/support/FailsafeLoggerTest.java | 10 +--
.../collector/DefaultMetricsCollectorTest.java | 10 +--
.../dubbo/common/metrics/event/RTEventTest.java | 5 +-
.../common/metrics/event/RequestEventTest.java | 5 +-
.../common/metrics/model/MethodMetricTest.java | 12 ++-
.../model/sample/GaugeMetricSampleTest.java | 5 +-
.../metrics/model/sample/MetricSampleTest.java | 5 +-
.../common/metrics/service/MetricsEntityTest.java | 5 +-
.../apache/dubbo/common/profiler/ProfilerTest.java | 8 +-
.../resource/GlobalResourcesRepositoryTest.java | 6 +-
.../org/apache/dubbo/common/status/StatusTest.java | 10 +--
.../reporter/FrameworkStatusReportServiceTest.java | 6 +-
.../status/support/LoadStatusCheckerTest.java | 6 +-
.../status/support/MemoryStatusCheckerTest.java | 6 +-
.../common/status/support/StatusUtilsTest.java | 10 +--
.../common/store/support/SimpleDataStoreTest.java | 10 +--
.../threadlocal/InternalThreadLocalTest.java | 26 +++---
.../NamedInternalThreadFactoryTest.java | 6 +-
.../MemoryLimitedLinkedBlockingQueueTest.java | 6 +-
.../MemorySafeLinkedBlockingQueueTest.java | 9 +-
.../common/threadpool/ThreadlessExecutorTest.java | 7 +-
.../ThreadPoolExhaustedEventListenerTest.java | 6 +-
.../event/ThreadPoolExhaustedEventTest.java | 6 +-
.../threadpool/manager/ExecutorRepositoryTest.java | 10 +--
.../manager/FrameworkExecutorRepositoryTest.java | 8 +-
.../threadpool/serial/SerializingExecutorTest.java | 4 +-
.../support/AbortPolicyWithReportTest.java | 12 +--
.../support/cached/CachedThreadPoolTest.java | 8 +-
.../support/eager/EagerThreadPoolExecutorTest.java | 10 +--
.../support/eager/EagerThreadPoolTest.java | 8 +-
.../threadpool/support/eager/TaskQueueTest.java | 16 ++--
.../support/fixed/FixedThreadPoolTest.java | 8 +-
.../support/limited/LimitedThreadPoolTest.java | 8 +-
.../dubbo/common/timer/HashedWheelTimerTest.java | 10 +--
.../org/apache/dubbo/common/url/URLParamTest.java | 20 ++---
.../dubbo/common/utils/AnnotationUtilsTest.java | 34 ++++----
.../apache/dubbo/common/utils/ArrayUtilsTest.java | 8 +-
.../org/apache/dubbo/common/utils/AssertTest.java | 18 ++--
.../common/utils/AtomicPositiveIntegerTest.java | 34 ++++----
.../apache/dubbo/common/utils/CIDRUtilsTest.java | 8 +-
.../utils/ClassLoaderResourceLoaderTest.java | 6 +-
.../apache/dubbo/common/utils/ClassUtilsTest.java | 26 +++---
.../dubbo/common/utils/CollectionUtilsTest.java | 37 +++++----
.../common/utils/CompatibleTypeUtilsTest.java | 6 +-
.../apache/dubbo/common/utils/ConfigUtilsTest.java | 54 ++++++------
.../apache/dubbo/common/utils/DefaultPageTest.java | 6 +-
.../dubbo/common/utils/DubboAppenderTest.java | 17 ++--
.../dubbo/common/utils/ExecutorUtilTest.java | 14 ++--
.../apache/dubbo/common/utils/FieldUtilsTest.java | 12 +--
.../org/apache/dubbo/common/utils/HolderTest.java | 6 +-
.../org/apache/dubbo/common/utils/IOUtilsTest.java | 24 +++---
.../org/apache/dubbo/common/utils/JVMUtilTest.java | 4 +-
.../apache/dubbo/common/utils/JsonUtilsTest.java | 8 +-
.../apache/dubbo/common/utils/LFUCacheTest.java | 12 +--
.../apache/dubbo/common/utils/LRU2CacheTest.java | 8 +-
.../apache/dubbo/common/utils/LogHelperTest.java | 14 ++--
.../org/apache/dubbo/common/utils/LogTest.java | 12 +--
.../org/apache/dubbo/common/utils/LogUtilTest.java | 20 ++---
.../apache/dubbo/common/utils/MD5UtilsTest.java | 6 +-
.../apache/dubbo/common/utils/MemberUtilsTest.java | 10 ++-
.../apache/dubbo/common/utils/MethodUtilsTest.java | 16 ++--
.../dubbo/common/utils/NamedThreadFactoryTest.java | 8 +-
...sInterfaceDisplayNameHasMetaCharactersTest.java | 6 +-
.../apache/dubbo/common/utils/NetUtilsTest.java | 2 +-
.../apache/dubbo/common/utils/ParametersTest.java | 4 +-
.../apache/dubbo/common/utils/PojoUtilsTest.java | 76 ++++++++---------
.../dubbo/common/utils/ReflectUtilsTest.java | 76 ++++++++---------
.../dubbo/common/utils/RegexPropertiesTest.java | 6 +-
.../common/utils/SerializeClassCheckerTest.java | 12 +--
.../org/apache/dubbo/common/utils/StackTest.java | 24 +++---
.../StringConstantFieldValuePredicateTest.java | 6 +-
.../apache/dubbo/common/utils/StringUtilsTest.java | 78 ++++++++---------
.../apache/dubbo/common/utils/UrlUtilsTest.java | 66 +++++++--------
.../apache/dubbo/common/version/VersionTest.java | 16 ++--
.../dubbo/config/AbstractInterfaceConfigTest.java | 52 ++++++------
.../context/ConfigConfigurationAdapterTest.java | 6 +-
.../dubbo/config/context/ConfigManagerTest.java | 40 ++++-----
.../dubbo/metadata/definition/MetadataTest.java | 12 +--
.../definition/ServiceDefinitionBuilderTest.java | 6 +-
.../definition/TypeDefinitionBuilderTest.java | 6 +-
.../dubbo/rpc/model/ApplicationModelTest.java | 14 ++--
.../apache/dubbo/rpc/model/FrameworkModelTest.java | 12 +--
.../rpc/model/FrameworkServiceRepositoryTest.java | 6 +-
.../apache/dubbo/rpc/model/ModuleModelTest.java | 10 +--
.../rpc/model/ModuleServiceRepositoryTest.java | 6 +-
.../rpc/model/ReflectionMethodDescriptorTest.java | 2 +-
.../rpc/model/ReflectionServiceDescriptorTest.java | 2 +-
.../ScopeModelAwareExtensionProcessorTest.java | 8 +-
.../org/apache/dubbo/rpc/model/ScopeModelTest.java | 6 +-
.../apache/dubbo/rpc/model/ScopeModelUtilTest.java | 7 +-
.../dubbo/rpc/model/ServiceRepositoryTest.java | 6 +-
.../dubbo/rpc/service/GenericExceptionTest.java | 3 +-
.../ServiceDescriptorInternalCacheTest.java | 2 +-
.../dubbo/rpc/support/ProtocolUtilsTest.java | 6 +-
190 files changed, 1245 insertions(+), 1231 deletions(-)
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/BaseServiceMetadataTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/BaseServiceMetadataTest.java
index 1075aec70d..6a9ed6e8b1 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/BaseServiceMetadataTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/BaseServiceMetadataTest.java
@@ -22,10 +22,10 @@ import static org.apache.dubbo.common.constants.CommonConstants.DEFAULT_VERSION;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
-public class BaseServiceMetadataTest {
+class BaseServiceMetadataTest {
@Test
- public void test() {
+ void test() {
BaseServiceMetadata baseServiceMetadata = new BaseServiceMetadata();
baseServiceMetadata.setGroup("group1");
baseServiceMetadata.setServiceInterfaceName("org.apache.dubbo.common.TestInterface");
@@ -63,4 +63,4 @@ public class BaseServiceMetadataTest {
assertEquals(BaseServiceMetadata.revertDisplayServiceKey(null).getDisplayServiceKey(),"null:null");
assertEquals(BaseServiceMetadata.revertDisplayServiceKey("org.apache.dubbo.common.TestInterface:1.0.0:1").getDisplayServiceKey(),"null:null");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/CommonScopeModelInitializerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/CommonScopeModelInitializerTest.java
index d7794f55b0..93ec99bec7 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/CommonScopeModelInitializerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/CommonScopeModelInitializerTest.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
/**
* {@link CommonScopeModelInitializer}
*/
-public class CommonScopeModelInitializerTest {
+class CommonScopeModelInitializerTest {
private FrameworkModel frameworkModel;
private ApplicationModel applicationModel;
@@ -51,7 +51,7 @@ public class CommonScopeModelInitializerTest {
}
@Test
- public void test() {
+ void test() {
ScopeBeanFactory applicationModelBeanFactory = applicationModel.getBeanFactory();
Assertions.assertNotNull(applicationModelBeanFactory.getBean(ShutdownHookCallbacks.class));
Assertions.assertNotNull(applicationModelBeanFactory.getBean(FrameworkStatusReportService.class));
@@ -60,4 +60,4 @@ public class CommonScopeModelInitializerTest {
ScopeBeanFactory moduleModelBeanFactory = moduleModel.getBeanFactory();
Assertions.assertNotNull(moduleModelBeanFactory.getBean(ConfigurationCache.class));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/InterfaceAddressURLTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/InterfaceAddressURLTest.java
index 843cab8b59..010edb1b3f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/InterfaceAddressURLTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/InterfaceAddressURLTest.java
@@ -27,13 +27,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotSame;
-public class InterfaceAddressURLTest {
+class InterfaceAddressURLTest {
private static final String rawURL = "dubbo://10.20.130.230:20880/context/path?version=1.0.0&group=g1&application=provider&timeout=1000&category=provider&side=provider&sayHello.weight=222";
private static final URL overrideURL = URL.valueOf("override://10.20.130.230:20880/context/path?version=1.0.0&application=morgan&timeout=2000&category=configurators&sayHello.overrideKey=override");
private static final URL consumerURL = URL.valueOf("consumer://10.20.130.230/context/path?version=2.0.0,1.0.0&group=g2&application=morgan&timeout=3000&side=consumer&sayHello.timeout=5000");
@Test
- public void testMergeOverriden() {
+ void testMergeOverriden() {
URL url = URL.valueOf(rawURL);
ServiceAddressURL interfaceAddressURL = new DubboServiceAddressURL(url.getUrlAddress(), url.getUrlParam(), null, null);
assertEquals("1000", interfaceAddressURL.getParameter(TIMEOUT_KEY));
@@ -46,7 +46,7 @@ public class InterfaceAddressURLTest {
}
@Test
- public void testGetParameter() {
+ void testGetParameter() {
URL url = URL.valueOf(rawURL);
ServiceAddressURL interfaceAddressURL = new DubboServiceAddressURL(url.getUrlAddress(), url.getUrlParam(), consumerURL, null);
@@ -64,7 +64,7 @@ public class InterfaceAddressURLTest {
}
@Test
- public void testGetMethodParameter() {
+ void testGetMethodParameter() {
URL url = URL.valueOf(rawURL);
ServiceAddressURL interfaceAddressURL = new DubboServiceAddressURL(url.getUrlAddress(), url.getUrlParam(), consumerURL, (ServiceConfigURL) overrideURL);
@@ -76,7 +76,7 @@ public class InterfaceAddressURLTest {
}
@Test
- public void testURLEquals() {
+ void testURLEquals() {
URL url1 = URL.valueOf(rawURL);
URL url2 = URL.valueOf(rawURL);
assertNotSame(url1, url2);
@@ -95,7 +95,7 @@ public class InterfaceAddressURLTest {
}
@Test
- public void testToString() {
+ void testToString() {
URL url1 = URL.valueOf(rawURL);
System.out.println(url1.toString());
ServiceAddressURL withConsumer = new DubboServiceAddressURL(url1.getUrlAddress(), url1.getUrlParam(), consumerURL, null);
@@ -103,4 +103,4 @@ public class InterfaceAddressURLTest {
ServiceAddressURL withOverride2 = new DubboServiceAddressURL(url1.getUrlAddress(), url1.getUrlParam(), consumerURL, (ServiceConfigURL) overrideURL);
System.out.println(withOverride2.toString());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/PojoUtilsForNonPublicStaticTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/PojoUtilsForNonPublicStaticTest.java
index 8e1e5a569d..3b7a5fa057 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/PojoUtilsForNonPublicStaticTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/PojoUtilsForNonPublicStaticTest.java
@@ -20,10 +20,10 @@ import org.apache.dubbo.common.utils.PojoUtils;
import org.junit.jupiter.api.Test;
-public class PojoUtilsForNonPublicStaticTest {
+class PojoUtilsForNonPublicStaticTest {
@Test
- public void testNonPublicStaticClass() {
+ void testNonPublicStaticClass() {
NonPublicStaticData nonPublicStaticData = new NonPublicStaticData("horizon");
PojoUtils.generalize(nonPublicStaticData);
}
@@ -47,4 +47,4 @@ public class PojoUtilsForNonPublicStaticTest {
this.name = name;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyMatcherTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyMatcherTest.java
index 635045c408..4b20f87d9d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyMatcherTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyMatcherTest.java
@@ -19,10 +19,10 @@ package org.apache.dubbo.common;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ProtocolServiceKeyMatcherTest {
+class ProtocolServiceKeyMatcherTest {
@Test
- public void testProtocol() {
+ void testProtocol() {
Assertions.assertTrue(ProtocolServiceKey.Matcher.isMatch(
new ProtocolServiceKey(null, null, null, "dubbo"),
new ProtocolServiceKey(null, null, null, "dubbo")
@@ -104,4 +104,4 @@ public class ProtocolServiceKeyMatcherTest {
new ProtocolServiceKey(null, null, null, "dubbo")
));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyTest.java
index 09b2711aa2..8d50abbd42 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/ProtocolServiceKeyTest.java
@@ -19,9 +19,9 @@ package org.apache.dubbo.common;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ProtocolServiceKeyTest {
+class ProtocolServiceKeyTest {
@Test
- public void test() {
+ void test() {
ProtocolServiceKey protocolServiceKey = new ProtocolServiceKey("DemoService", "1.0.0", "group1", "protocol1");
Assertions.assertEquals("DemoService", protocolServiceKey.getInterfaceName());
Assertions.assertEquals("1.0.0", protocolServiceKey.getVersion());
@@ -73,4 +73,4 @@ public class ProtocolServiceKeyTest {
Assertions.assertFalse(protocolServiceKey7.isSameWith(new ProtocolServiceKey("DemoService", "1.0.0", "group1", "protocol1")));
Assertions.assertFalse(protocolServiceKey7.isSameWith(new ProtocolServiceKey("DemoService", "1.0.0", "group1", "protocol2")));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyMatcherTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyMatcherTest.java
index 6d85c46b31..180a1e21a0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyMatcherTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyMatcherTest.java
@@ -19,10 +19,10 @@ package org.apache.dubbo.common;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ServiceKeyMatcherTest {
+class ServiceKeyMatcherTest {
@Test
- public void testInterface() {
+ void testInterface() {
Assertions.assertTrue(ServiceKey.Matcher.isMatch(
new ServiceKey(null, null, null),
new ServiceKey(null, null, null)
@@ -48,7 +48,7 @@ public class ServiceKeyMatcherTest {
}
@Test
- public void testVersion() {
+ void testVersion() {
Assertions.assertTrue(ServiceKey.Matcher.isMatch(
new ServiceKey(null, "1.0.0", null),
new ServiceKey(null, "1.0.0", null)
@@ -142,7 +142,7 @@ public class ServiceKeyMatcherTest {
}
@Test
- public void testGroup() {
+ void testGroup() {
Assertions.assertTrue(ServiceKey.Matcher.isMatch(
new ServiceKey(null, null, "group1"),
new ServiceKey(null, null, "group1")
@@ -221,4 +221,4 @@ public class ServiceKeyMatcherTest {
new ServiceKey(null, null, "group1")
));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyTest.java
index 5643166ffa..d0833c6029 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/ServiceKeyTest.java
@@ -19,9 +19,9 @@ package org.apache.dubbo.common;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ServiceKeyTest {
+class ServiceKeyTest {
@Test
- public void test() {
+ void test() {
ServiceKey serviceKey = new ServiceKey("DemoService", "1.0.0", "group1");
Assertions.assertEquals("DemoService", serviceKey.getInterfaceName());
@@ -51,4 +51,4 @@ public class ServiceKeyTest {
ProtocolServiceKey protocolServiceKey = new ProtocolServiceKey("DemoService", "1.0.0", "group1", "protocol1");
Assertions.assertNotEquals(serviceKey, protocolServiceKey);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLBuilderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLBuilderTest.java
index e0839696ae..9967a7bd02 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLBuilderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLBuilderTest.java
@@ -27,15 +27,15 @@ import java.util.Map;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
-public class URLBuilderTest {
+class URLBuilderTest {
@Test
- public void testNoArgConstructor() {
+ void testNoArgConstructor() {
URL url = new URLBuilder().build();
assertThat(url.toString(), equalTo(""));
}
@Test
- public void shouldAddParameter() {
+ void shouldAddParameter() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URLBuilder.from(url1)
.addParameter("newKey1", "newValue1") // string
@@ -48,7 +48,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldSet() {
+ void shouldSet() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
int port = NetUtils.getAvailablePort();
URL url2 = URLBuilder.from(url1)
@@ -75,7 +75,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldClearParameters() {
+ void shouldClearParameters() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URLBuilder.from(url1)
.clearParameters()
@@ -84,7 +84,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldRemoveParameters() {
+ void shouldRemoveParameters() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&key2=v2");
URL url2 = URLBuilder.from(url1)
.removeParameters(Arrays.asList("key2", "application"))
@@ -94,7 +94,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldAddIfAbsent() {
+ void shouldAddIfAbsent() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&key2=v2");
URL url2 = URLBuilder.from(url1)
.addParameterIfAbsent("absentKey", "absentValue")
@@ -105,7 +105,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldAddParameters() {
+ void shouldAddParameters() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&key2=v2");
// string pairs test
@@ -130,7 +130,7 @@ public class URLBuilderTest {
}
@Test
- public void shouldAddParametersIfAbsent() {
+ void shouldAddParametersIfAbsent() {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&key2=v2");
Map<String, String> parameters = new HashMap<String, String>(){
@@ -145,4 +145,4 @@ public class URLBuilderTest {
assertThat(url2.getParameter("version"), equalTo("1.0.0"));
assertThat(url2.getParameter("absentKey"), equalTo("absentValue"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
index fdd3533361..aea2001306 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLStrParserTest.java
@@ -29,7 +29,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
/**
* Created by LinShunkang on 2020/03/12
*/
-public class URLStrParserTest {
+class URLStrParserTest {
private static Set<String> testCases = new HashSet<>(16);
private static Set<String> errorDecodedCases = new HashSet<>(8);
private static Set<String> errorEncodedCases = new HashSet<>(8);
@@ -57,7 +57,7 @@ public class URLStrParserTest {
}
@Test
- public void testEncoded() {
+ void testEncoded() {
testCases.forEach(testCase -> {
assertThat(URLStrParser.parseEncodedStr(URL.encode(testCase)), equalTo(URL.valueOf(testCase)));
});
@@ -69,7 +69,7 @@ public class URLStrParserTest {
}
@Test
- public void testDecoded() {
+ void testDecoded() {
testCases.forEach(testCase -> {
assertThat(URLStrParser.parseDecodedStr(testCase), equalTo(URL.valueOf(testCase)));
});
@@ -80,4 +80,4 @@ public class URLStrParserTest {
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
index 033901bd89..a4400eebef 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/URLTest.java
@@ -18,6 +18,7 @@ package org.apache.dubbo.common;
import org.apache.dubbo.common.url.component.ServiceConfigURL;
import org.apache.dubbo.common.utils.CollectionUtils;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -40,10 +41,10 @@ import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-public class URLTest {
+class URLTest {
@Test
- public void test_ignore_pond() {
+ void test_ignore_pond() {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path#index?version=1.0.0&id=org.apache.dubbo.config.RegistryConfig#0");
assertURLStrDecoder(url);
assertEquals("dubbo", url.getProtocol());
@@ -59,7 +60,7 @@ public class URLTest {
}
@Test
- public void test_valueOf_noProtocolAndHost() throws Exception {
+ void test_valueOf_noProtocolAndHost() throws Exception {
URL url = URL.valueOf("/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url);
assertNull(url.getProtocol());
@@ -97,7 +98,7 @@ public class URLTest {
}
@Test
- public void test_valueOf_noProtocol() throws Exception {
+ void test_valueOf_noProtocol() throws Exception {
URL url = URL.valueOf("10.20.130.230");
assertURLStrDecoder(url);
assertNull(url.getProtocol());
@@ -157,7 +158,7 @@ public class URLTest {
}
@Test
- public void test_valueOf_noHost() throws Exception {
+ void test_valueOf_noHost() throws Exception {
URL url = URL.valueOf("file:///home/user1/router.js");
assertURLStrDecoder(url);
assertEquals("file", url.getProtocol());
@@ -236,7 +237,7 @@ public class URLTest {
}
@Test
- public void test_valueOf_WithProtocolHost() throws Exception {
+ void test_valueOf_WithProtocolHost() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230");
assertURLStrDecoder(url);
assertEquals("dubbo", url.getProtocol());
@@ -312,7 +313,7 @@ public class URLTest {
// TODO Do not want to use spaces? See: DUBBO-502, URL class handles special conventions for special characters.
@Test
- public void test_valueOf_spaceSafe() throws Exception {
+ void test_valueOf_spaceSafe() throws Exception {
URL url = URL.valueOf("http://1.2.3.4:8080/path?key=value1 value2");
assertURLStrDecoder(url);
assertEquals("http://1.2.3.4:8080/path?key=value1 value2", url.toString());
@@ -320,7 +321,7 @@ public class URLTest {
}
@Test
- public void test_noValueKey() throws Exception {
+ void test_noValueKey() throws Exception {
URL url = URL.valueOf("http://1.2.3.4:8080/path?k0=&k1=v1");
assertURLStrDecoder(url);
@@ -331,7 +332,7 @@ public class URLTest {
}
@Test
- public void test_valueOf_Exception_noProtocol() throws Exception {
+ void test_valueOf_Exception_noProtocol() throws Exception {
try {
URL.valueOf("://1.2.3.4:8080/path");
fail();
@@ -356,14 +357,14 @@ public class URLTest {
}
@Test
- public void test_getAddress() throws Exception {
+ void test_getAddress() throws Exception {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url1);
assertEquals("10.20.130.230:20880", url1.getAddress());
}
@Test
- public void test_getAbsolutePath() throws Exception {
+ void test_getAbsolutePath() throws Exception {
URL url = new ServiceConfigURL("p1", "1.2.2.2", 33);
assertURLStrDecoder(url);
assertNull(url.getAbsolutePath());
@@ -374,7 +375,7 @@ public class URLTest {
}
@Test
- public void test_equals() throws Exception {
+ void test_equals() throws Exception {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url1);
@@ -388,7 +389,7 @@ public class URLTest {
}
@Test
- public void test_toString() throws Exception {
+ void test_toString() throws Exception {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url1);
assertThat(url1.toString(), anyOf(
@@ -398,7 +399,7 @@ public class URLTest {
}
@Test
- public void test_toFullString() throws Exception {
+ void test_toFullString() throws Exception {
URL url1 = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url1);
assertThat(url1.toFullString(), anyOf(
@@ -408,7 +409,7 @@ public class URLTest {
}
@Test
- public void test_set_methods() throws Exception {
+ void test_set_methods() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url);
@@ -498,7 +499,7 @@ public class URLTest {
}
@Test
- public void test_removeParameters() throws Exception {
+ void test_removeParameters() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&k1=v1&k2=v2");
assertURLStrDecoder(url);
@@ -551,7 +552,7 @@ public class URLTest {
}
@Test
- public void test_addParameter() throws Exception {
+ void test_addParameter() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?application=morgan");
url = url.addParameter("k1", "v1");
@@ -569,7 +570,7 @@ public class URLTest {
}
@Test
- public void test_addParameter_sameKv() throws Exception {
+ void test_addParameter_sameKv() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?application=morgan&k1=v1");
URL newUrl = url.addParameter("k1", "v1");
@@ -579,7 +580,7 @@ public class URLTest {
@Test
- public void test_addParameters() throws Exception {
+ void test_addParameters() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?application=morgan");
url = url.addParameters(CollectionUtils.toStringMap("k1", "v1", "k2", "v2"));
@@ -659,7 +660,7 @@ public class URLTest {
}
@Test
- public void test_addParameters_SameKv() throws Exception {
+ void test_addParameters_SameKv() throws Exception {
{
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?application=morgan&k1=v1");
URL newUrl = url.addParameters(CollectionUtils.toStringMap("k1", "v1"));
@@ -677,7 +678,7 @@ public class URLTest {
}
@Test
- public void test_addParameterIfAbsent() throws Exception {
+ void test_addParameterIfAbsent() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?application=morgan");
url = url.addParameterIfAbsent("application", "xxx");
@@ -694,7 +695,7 @@ public class URLTest {
}
@Test
- public void test_windowAbsolutePathBeginWithSlashIsValid() throws Exception {
+ void test_windowAbsolutePathBeginWithSlashIsValid() throws Exception {
final String osProperty = System.getProperties().getProperty(OS_NAME_KEY);
if (!osProperty.toLowerCase().contains(OS_WIN_PREFIX)) return;
@@ -714,7 +715,7 @@ public class URLTest {
}
@Test
- public void test_javaNetUrl() throws Exception {
+ void test_javaNetUrl() throws Exception {
java.net.URL url = new java.net.URL("http://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan#anchor1");
assertEquals("http", url.getProtocol());
@@ -730,7 +731,7 @@ public class URLTest {
}
@Test
- public void test_Anyhost() throws Exception {
+ void test_Anyhost() throws Exception {
URL url = URL.valueOf("dubbo://0.0.0.0:20880");
assertURLStrDecoder(url);
assertEquals("0.0.0.0", url.getHost());
@@ -738,7 +739,7 @@ public class URLTest {
}
@Test
- public void test_Localhost() throws Exception {
+ void test_Localhost() throws Exception {
URL url = URL.valueOf("dubbo://127.0.0.1:20880");
assertURLStrDecoder(url);
assertEquals("127.0.0.1", url.getHost());
@@ -759,14 +760,14 @@ public class URLTest {
}
@Test
- public void test_Path() throws Exception {
+ void test_Path() throws Exception {
URL url = new ServiceConfigURL("dubbo", "localhost", 20880, "////path");
assertURLStrDecoder(url);
assertEquals("path", url.getPath());
}
@Test
- public void testAddParameters() throws Exception {
+ void testAddParameters() throws Exception {
URL url = URL.valueOf("dubbo://127.0.0.1:20880");
assertURLStrDecoder(url);
@@ -777,7 +778,7 @@ public class URLTest {
}
@Test
- public void testUserNamePasswordContainsAt() {
+ void testUserNamePasswordContainsAt() {
// Test username or password contains "@"
URL url = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url);
@@ -795,7 +796,7 @@ public class URLTest {
@Test
- public void testIpV6Address() {
+ void testIpV6Address() {
// Test username or password contains "@"
URL url = URL.valueOf("ad@min111:haha@1234@2001:0db8:85a3:08d3:1319:8a2e:0370:7344:20880/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url);
@@ -812,7 +813,7 @@ public class URLTest {
}
@Test
- public void testIpV6AddressWithScopeId() {
+ void testIpV6AddressWithScopeId() {
URL url = URL.valueOf("2001:0db8:85a3:08d3:1319:8a2e:0370:7344%5/context/path?version=1.0.0&application=morgan");
assertURLStrDecoder(url);
assertNull(url.getProtocol());
@@ -826,13 +827,13 @@ public class URLTest {
}
@Test
- public void testDefaultPort() {
+ void testDefaultPort() {
Assertions.assertEquals("10.20.153.10:2181", URL.appendDefaultPort("10.20.153.10:0", 2181));
Assertions.assertEquals("10.20.153.10:2181", URL.appendDefaultPort("10.20.153.10", 2181));
}
@Test
- public void testGetServiceKey() {
+ void testGetServiceKey() {
URL url1 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName");
assertURLStrDecoder(url1);
Assertions.assertEquals("org.apache.dubbo.test.interfaceName", url1.getServiceKey());
@@ -855,7 +856,7 @@ public class URLTest {
}
@Test
- public void testGetColonSeparatedKey() {
+ void testGetColonSeparatedKey() {
URL url1 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group&version=1.0.0");
assertURLStrDecoder(url1);
Assertions.assertEquals("org.apache.dubbo.test.interfaceName:1.0.0:group", url1.getColonSeparatedKey());
@@ -882,7 +883,7 @@ public class URLTest {
}
@Test
- public void testValueOf() {
+ void testValueOf() {
URL url = URL.valueOf("10.20.130.230");
assertURLStrDecoder(url);
@@ -903,7 +904,7 @@ public class URLTest {
* @since 2.7.8
*/
@Test
- public void testGetParameters() {
+ void testGetParameters() {
URL url = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group&version=1.0.0");
Map<String, String> parameters = url.getParameters(i -> "version".equals(i));
String version = parameters.get("version");
@@ -912,14 +913,14 @@ public class URLTest {
}
@Test
- public void testGetParameter() {
+ void testGetParameter() {
URL url = URL.valueOf("http://127.0.0.1:8080/path?i=1&b=false");
assertEquals(Integer.valueOf(1), url.getParameter("i", Integer.class));
assertEquals(Boolean.FALSE, url.getParameter("b", Boolean.class));
}
@Test
- public void testEquals() {
+ void testEquals() {
URL url1 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group&version=1.0.0");
URL url2 = URL.valueOf("10.20.130.230:20880/context/path?interface=org.apache.dubbo.test.interfaceName&group=group&version=1.0.0");
Assertions.assertEquals(url1, url2);
@@ -955,7 +956,7 @@ public class URLTest {
@Test
- public void testEqualsWithPassword() {
+ void testEqualsWithPassword() {
URL url1 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URL.valueOf("ad@min:hello@4321@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url3 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
@@ -967,7 +968,7 @@ public class URLTest {
}
@Test
- public void testEqualsWithPath() {
+ void testEqualsWithPath() {
URL url1 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path1?version=1.0.0&application=morgan");
URL url2 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path2?version=1.0.0&application=morgan");
URL url3 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path1?version=1.0.0&application=morgan");
@@ -979,7 +980,7 @@ public class URLTest {
}
@Test
- public void testEqualsWithPort() {
+ void testEqualsWithPort() {
URL url1 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20881/context/path?version=1.0.0&application=morgan");
URL url3 = URL.valueOf("ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
@@ -991,7 +992,7 @@ public class URLTest {
}
@Test
- public void testEqualsWithProtocol() {
+ void testEqualsWithProtocol() {
URL url1 = URL.valueOf("dubbo://ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URL.valueOf("file://ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url3 = URL.valueOf("dubbo://ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
@@ -1003,7 +1004,7 @@ public class URLTest {
}
@Test
- public void testEqualsWithUser() {
+ void testEqualsWithUser() {
URL url1 = URL.valueOf("ad@min1:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url2 = URL.valueOf("ad@min2:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
URL url3 = URL.valueOf("ad@min1:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan");
@@ -1015,7 +1016,7 @@ public class URLTest {
}
@Test
- public void testHashcode() {
+ void testHashcode() {
URL url1 = URL.valueOf("consumer://30.225.20.150/org.apache.dubbo.rpc.service.GenericService?application=" +
"dubbo-demo-api-consumer&category=consumers&check=false&dubbo=2.0.2&generic=true&interface=" +
"org.apache.dubbo.demo.DemoService&pid=7375&side=consumer&sticky=false×tamp=1599556506417");
@@ -1036,7 +1037,7 @@ public class URLTest {
}
@Test
- public void testParameterContainPound() {
+ void testParameterContainPound() {
URL url = URL.valueOf(
"dubbo://ad@min:hello@1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan£=abcd#efg&protocol=registry");
Assertions.assertEquals("abcd#efg", url.getParameter("pound"));
@@ -1044,13 +1045,13 @@ public class URLTest {
}
@Test
- public void test_valueOfHasNameWithoutValue() throws Exception {
+ void test_valueOfHasNameWithoutValue() throws Exception {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=morgan&noValue");
Assertions.assertEquals("noValue", url.getParameter("noValue"));
}
@Test
- public void testGetAuthority() {
+ void testGetAuthority() {
URL url = URL.valueOf("admin1:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=app1");
assertEquals("admin1:hello1234@10.20.130.230:20880", url.getAuthority());
@@ -1068,7 +1069,7 @@ public class URLTest {
}
@Test
- public void testGetUserInformation() {
+ void testGetUserInformation() {
URL url = URL.valueOf("admin1:hello1234@10.20.130.230:20880/context/path?version=1.0.0&application=app1");
assertEquals("admin1:hello1234", url.getUserInformation());
@@ -1084,7 +1085,7 @@ public class URLTest {
@Test
- public void testIPV6() {
+ void testIPV6() {
URL url = URL.valueOf("dubbo://[2408:4004:194:8896:3e8a:82ae:814a:398]:20881?name=apache");
assertEquals("[2408:4004:194:8896:3e8a:82ae:814a:398]", url.getHost());
assertEquals(20881, url.getPort());
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/beans/InstantiationStrategyTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/beans/InstantiationStrategyTest.java
index c54fe383c4..69ba384612 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/beans/InstantiationStrategyTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/beans/InstantiationStrategyTest.java
@@ -31,7 +31,7 @@ import org.apache.dubbo.rpc.model.ScopeModelAccessor;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class InstantiationStrategyTest {
+class InstantiationStrategyTest {
private ScopeModelAccessor scopeModelAccessor = new ScopeModelAccessor() {
@Override
@@ -41,7 +41,7 @@ public class InstantiationStrategyTest {
};
@Test
- public void testCreateBeanWithScopeModelArgument() throws ReflectiveOperationException {
+ void testCreateBeanWithScopeModelArgument() throws ReflectiveOperationException {
InstantiationStrategy instantiationStrategy = new InstantiationStrategy(scopeModelAccessor);
FooBeanWithFrameworkModel beanWithFrameworkModel = instantiationStrategy.instantiate(FooBeanWithFrameworkModel.class);
@@ -67,4 +67,4 @@ public class InstantiationStrategyTest {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/beans/ScopeBeanFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/beans/ScopeBeanFactoryTest.java
index 8a5fa08fed..a15bd80bcf 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/beans/ScopeBeanFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/beans/ScopeBeanFactoryTest.java
@@ -25,10 +25,10 @@ import org.apache.dubbo.rpc.model.FrameworkModel;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ScopeBeanFactoryTest {
+class ScopeBeanFactoryTest {
@Test
- public void testInjection() {
+ void testInjection() {
ApplicationModel applicationModel = ApplicationModel.defaultModel();
ScopeBeanFactory beanFactory = applicationModel.getBeanFactory();
@@ -54,4 +54,4 @@ public class ScopeBeanFactoryTest {
Assertions.assertTrue(beanWithApplicationModel.isDestroyed());
Assertions.assertTrue(beanWithFrameworkModel.isDestroyed());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanAccessorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanAccessorTest.java
index 55bbc598ec..eb1118479f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanAccessorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanAccessorTest.java
@@ -19,19 +19,19 @@ package org.apache.dubbo.common.beanutil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class JavaBeanAccessorTest {
+class JavaBeanAccessorTest {
@Test
- public void testIsAccessByMethod(){
+ void testIsAccessByMethod(){
Assertions.assertTrue(JavaBeanAccessor.isAccessByMethod(JavaBeanAccessor.METHOD));
Assertions.assertTrue(JavaBeanAccessor.isAccessByMethod(JavaBeanAccessor.ALL));
Assertions.assertFalse(JavaBeanAccessor.isAccessByMethod(JavaBeanAccessor.FIELD));
}
@Test
- public void testIsAccessByField(){
+ void testIsAccessByField(){
Assertions.assertTrue(JavaBeanAccessor.isAccessByField(JavaBeanAccessor.FIELD));
Assertions.assertTrue(JavaBeanAccessor.isAccessByField(JavaBeanAccessor.ALL));
Assertions.assertFalse(JavaBeanAccessor.isAccessByField(JavaBeanAccessor.METHOD));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtilTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtilTest.java
index 053bdd4dc5..9231a32c10 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtilTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtilTest.java
@@ -35,10 +35,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-public class JavaBeanSerializeUtilTest {
+class JavaBeanSerializeUtilTest {
@Test
- public void testSerialize_Primitive() {
+ void testSerialize_Primitive() {
JavaBeanDescriptor descriptor;
descriptor = JavaBeanSerializeUtil.serialize(Integer.MAX_VALUE);
Assertions.assertTrue(descriptor.isPrimitiveType());
@@ -51,14 +51,14 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testSerialize_Primitive_NUll() {
+ void testSerialize_Primitive_NUll() {
JavaBeanDescriptor descriptor;
descriptor = JavaBeanSerializeUtil.serialize(null);
Assertions.assertNull(descriptor);
}
@Test
- public void testDeserialize_Primitive() {
+ void testDeserialize_Primitive() {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_PRIMITIVE);
descriptor.setPrimitiveProperty(Long.MAX_VALUE);
Assertions.assertEquals(Long.MAX_VALUE, JavaBeanSerializeUtil.deserialize(descriptor));
@@ -73,7 +73,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testDeserialize_Primitive0() {
+ void testDeserialize_Primitive0() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
JavaBeanDescriptor.TYPE_BEAN + 1);
@@ -81,14 +81,14 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testDeserialize_Null() {
+ void testDeserialize_Null() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(null, JavaBeanDescriptor.TYPE_BEAN);
});
}
@Test
- public void testDeserialize_containsProperty() {
+ void testDeserialize_containsProperty() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
JavaBeanDescriptor.TYPE_PRIMITIVE);
@@ -97,7 +97,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testSetEnumNameProperty() {
+ void testSetEnumNameProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
JavaBeanDescriptor.TYPE_PRIMITIVE);
@@ -115,7 +115,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testGetEnumNameProperty() {
+ void testGetEnumNameProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
JavaBeanDescriptor.TYPE_PRIMITIVE);
@@ -124,7 +124,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testSetClassNameProperty() {
+ void testSetClassNameProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
@@ -143,7 +143,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testGetClassNameProperty() {
+ void testGetClassNameProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(),
JavaBeanDescriptor.TYPE_PRIMITIVE);
@@ -152,7 +152,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testSetPrimitiveProperty() {
+ void testSetPrimitiveProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(),
JavaBeanDescriptor.TYPE_BEAN);
@@ -161,7 +161,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testGetPrimitiveProperty() {
+ void testGetPrimitiveProperty() {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(JavaBeanDescriptor.class.getName(),
JavaBeanDescriptor.TYPE_BEAN);
@@ -170,7 +170,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testDeserialize_get_and_set() {
+ void testDeserialize_get_and_set() {
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(long.class.getName(), JavaBeanDescriptor.TYPE_BEAN);
descriptor.setType(JavaBeanDescriptor.TYPE_PRIMITIVE);
Assertions.assertEquals(descriptor.getType(), JavaBeanDescriptor.TYPE_PRIMITIVE);
@@ -179,7 +179,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testSerialize_Array() {
+ void testSerialize_Array() {
int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9};
JavaBeanDescriptor descriptor = JavaBeanSerializeUtil.serialize(array, JavaBeanAccessor.METHOD);
Assertions.assertTrue(descriptor.isArrayType());
@@ -226,7 +226,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testConstructorArg() {
+ void testConstructorArg() {
Assertions.assertFalse((boolean) JavaBeanSerializeUtil.getConstructorArg(boolean.class));
Assertions.assertFalse((boolean) JavaBeanSerializeUtil.getConstructorArg(Boolean.class));
Assertions.assertEquals((byte) 0, JavaBeanSerializeUtil.getConstructorArg(byte.class));
@@ -247,7 +247,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testDeserialize_Array() {
+ void testDeserialize_Array() {
final int len = 10;
JavaBeanDescriptor descriptor = new JavaBeanDescriptor(int.class.getName(), JavaBeanDescriptor.TYPE_ARRAY);
for (int i = 0; i < len; i++) {
@@ -299,7 +299,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void test_Circular_Reference() {
+ void test_Circular_Reference() {
PojoUtilsTest.Parent parent = new PojoUtilsTest.Parent();
parent.setAge(Integer.MAX_VALUE);
parent.setEmail("a@b");
@@ -325,7 +325,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testBeanSerialize() {
+ void testBeanSerialize() {
Bean bean = new Bean();
bean.setDate(new Date());
bean.setStatus(PersonStatus.ENABLED);
@@ -375,7 +375,7 @@ public class JavaBeanSerializeUtilTest {
}
@Test
- public void testDeserializeBean() {
+ void testDeserializeBean() {
Bean bean = new Bean();
bean.setDate(new Date());
bean.setStatus(PersonStatus.ENABLED);
@@ -544,4 +544,4 @@ public class JavaBeanSerializeUtilTest {
bigPerson.setInfoProfile(pi);
return bigPerson;
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
index 94837548f2..9cef0a3468 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ClassGeneratorTest.java
@@ -48,10 +48,10 @@ class BaseClass {
interface BaseInterface {
}
-public class ClassGeneratorTest {
+class ClassGeneratorTest {
@Test
- public void test() throws Exception {
+ void test() throws Exception {
ClassGenerator cg = ClassGenerator.newInstance();
// add className, interface, superClass
@@ -147,7 +147,7 @@ public class ClassGeneratorTest {
@SuppressWarnings("unchecked")
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
Bean b = new Bean();
Field fname = Bean.class.getDeclaredField("name");
fname.setAccessible(true);
@@ -173,7 +173,7 @@ public class ClassGeneratorTest {
}
@Test
- public void testMain0() throws Exception {
+ void testMain0() throws Exception {
Bean b = new Bean();
Field fname = Bean.class.getDeclaredField("name");
fname.setAccessible(true);
@@ -213,4 +213,4 @@ class Bean {
}
public static volatile String abc = "df";
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/MixinTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/MixinTest.java
index b6a825e235..64cc7fc28f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/MixinTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/MixinTest.java
@@ -20,10 +20,10 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class MixinTest {
+class MixinTest {
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
Mixin mixin = Mixin.mixin(new Class[]{I1.class, I2.class, I3.class}, new Class[]{C1.class, C2.class});
Object o = mixin.newInstance(new Object[]{new C1(), new C2()});
assertTrue(o instanceof I1);
@@ -69,4 +69,4 @@ public class MixinTest {
System.out.println("setMixinInstance:" + mi);
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ProxyTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ProxyTest.java
index f607f69f38..6a6e1df794 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ProxyTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/ProxyTest.java
@@ -27,10 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
@DisabledForJreRange(min = JRE.JAVA_16)
-public class ProxyTest {
+class ProxyTest {
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
Proxy proxy = Proxy.getProxy(ITest.class, ITest.class);
ITest instance = (ITest) proxy.newInstance((proxy1, method, args) -> {
if ("getName".equals(method.getName())) {
@@ -48,7 +48,7 @@ public class ProxyTest {
}
@Test
- public void testCglibProxy() throws Exception {
+ void testCglibProxy() throws Exception {
ITest test = (ITest) Proxy.getProxy(ITest.class).newInstance((proxy, method, args) -> {
System.out.println(method.getName());
return null;
@@ -74,4 +74,4 @@ public class ProxyTest {
return "Bye!";
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/WrapperTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/WrapperTest.java
index 39fa87172a..8268494421 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/WrapperTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/bytecode/WrapperTest.java
@@ -26,9 +26,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;
-public class WrapperTest {
+class WrapperTest {
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
Wrapper w = Wrapper.getWrapper(I1.class);
String[] ns = w.getDeclaredMethodNames();
assertEquals(ns.length, 5);
@@ -52,7 +52,7 @@ public class WrapperTest {
// bug: DUBBO-132
@Test
- public void test_unwantedArgument() throws Exception {
+ void test_unwantedArgument() throws Exception {
Wrapper w = Wrapper.getWrapper(I1.class);
Object obj = new Impl1();
try {
@@ -65,12 +65,12 @@ public class WrapperTest {
//bug: DUBBO-425
@Test
- public void test_makeEmptyClass() throws Exception {
+ void test_makeEmptyClass() throws Exception {
Wrapper.getWrapper(EmptyServiceImpl.class);
}
@Test
- public void testHasMethod() throws Exception {
+ void testHasMethod() throws Exception {
Wrapper w = Wrapper.getWrapper(I1.class);
Assertions.assertTrue(w.hasMethod("setName"));
Assertions.assertTrue(w.hasMethod("hello"));
@@ -81,7 +81,7 @@ public class WrapperTest {
}
@Test
- public void testWrapperObject() throws Exception {
+ void testWrapperObject() throws Exception {
Wrapper w = Wrapper.getWrapper(Object.class);
Assertions.assertEquals(4, w.getMethodNames().length);
Assertions.assertEquals(4, w.getDeclaredMethodNames().length);
@@ -91,7 +91,7 @@ public class WrapperTest {
}
@Test
- public void testGetPropertyValue() throws Exception {
+ void testGetPropertyValue() throws Exception {
Assertions.assertThrows(NoSuchPropertyException.class, () -> {
Wrapper w = Wrapper.getWrapper(Object.class);
w.getPropertyValue(null, null);
@@ -99,7 +99,7 @@ public class WrapperTest {
}
@Test
- public void testSetPropertyValue() throws Exception {
+ void testSetPropertyValue() throws Exception {
Assertions.assertThrows(NoSuchPropertyException.class, () -> {
Wrapper w = Wrapper.getWrapper(Object.class);
w.setPropertyValue(null, null, null);
@@ -107,14 +107,14 @@ public class WrapperTest {
}
@Test
- public void testWrapPrimitive() throws Exception {
+ void testWrapPrimitive() throws Exception {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
Wrapper.getWrapper(Byte.TYPE);
});
}
@Test
- public void testInvokeWrapperObject() throws Exception {
+ void testInvokeWrapperObject() throws Exception {
Wrapper w = Wrapper.getWrapper(Object.class);
Object instance = new Object();
Assertions.assertEquals(instance.getClass(), w.invokeMethod(instance, "getClass", null, null));
@@ -126,7 +126,7 @@ public class WrapperTest {
}
@Test
- public void testNoSuchMethod() throws Exception {
+ void testNoSuchMethod() throws Exception {
Assertions.assertThrows(NoSuchMethodException.class, () -> {
Wrapper w = Wrapper.getWrapper(Object.class);
w.invokeMethod(new Object(), "__XX__", null, null);
@@ -134,7 +134,7 @@ public class WrapperTest {
}
@Test
- public void testOverloadMethod() throws Exception {
+ void testOverloadMethod() throws Exception {
Wrapper w = Wrapper.getWrapper(I2.class);
assertEquals(2, w.getMethodNames().length);
@@ -154,7 +154,7 @@ public class WrapperTest {
}
@Test
- public void test_getDeclaredMethodNames_ContainExtendsParentMethods() throws Exception {
+ void test_getDeclaredMethodNames_ContainExtendsParentMethods() throws Exception {
assertArrayEquals(new String[]{"hello",}, Wrapper.getWrapper(Parent1.class).getMethodNames());
assertArrayEquals(new String[]{"hello",}, ClassUtils.getMethodNames(Parent1.class));
@@ -163,13 +163,13 @@ public class WrapperTest {
}
@Test
- public void test_getMethodNames_ContainExtendsParentMethods() throws Exception {
+ void test_getMethodNames_ContainExtendsParentMethods() throws Exception {
assertArrayEquals(new String[]{"hello", "world"}, Wrapper.getWrapper(Son.class).getMethodNames());
assertArrayEquals(new String[]{"hello", "world"}, ClassUtils.getMethodNames(Son.class));
}
@Test
- public void testWrapImplClass(){
+ void testWrapImplClass(){
Wrapper w = Wrapper.getWrapper(Impl0.class);
String[] propertyNames = w.getPropertyNames();
@@ -293,4 +293,4 @@ public class WrapperTest {
public static class EmptyServiceImpl implements EmptyService {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreFactoryTest.java
index 927501ffce..8a3cb3255a 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreFactoryTest.java
@@ -71,4 +71,4 @@ class FileCacheStoreFactoryTest {
String directoryPath = path.substring(0, index);
return directoryPath;
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreTest.java
index 1c2a878e72..bdfcc3b022 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/cache/FileCacheStoreTest.java
@@ -75,4 +75,4 @@ class FileCacheStoreTest {
return directoryPath;
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/AdaptiveCompilerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/AdaptiveCompilerTest.java
index 7e2110ca1e..785ee82b16 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/AdaptiveCompilerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/AdaptiveCompilerTest.java
@@ -21,10 +21,10 @@ import org.apache.dubbo.rpc.model.FrameworkModel;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class AdaptiveCompilerTest extends JavaCodeTest {
+class AdaptiveCompilerTest extends JavaCodeTest {
@Test
- public void testAvailableCompiler() throws Exception {
+ void testAvailableCompiler() throws Exception {
AdaptiveCompiler.setDefaultCompiler("jdk");
AdaptiveCompiler compiler = new AdaptiveCompiler();
compiler.setFrameworkModel(FrameworkModel.defaultModel());
@@ -33,4 +33,4 @@ public class AdaptiveCompilerTest extends JavaCodeTest {
Assertions.assertEquals("Hello world!", helloService.sayHello());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/ClassUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/ClassUtilsTest.java
index 88ddf8fe4d..e2d990caf9 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/ClassUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/ClassUtilsTest.java
@@ -25,41 +25,41 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class ClassUtilsTest {
+class ClassUtilsTest {
@Test
- public void testNewInstance() {
+ void testNewInstance() {
HelloServiceImpl0 instance = (HelloServiceImpl0) ClassUtils.newInstance(HelloServiceImpl0.class.getName());
Assertions.assertEquals("Hello world!", instance.sayHello());
}
@Test
- public void testNewInstance0() {
+ void testNewInstance0() {
Assertions.assertThrows(IllegalStateException.class, () -> ClassUtils.newInstance(PrivateHelloServiceImpl.class.getName()));
}
@Test
- public void testNewInstance1() {
+ void testNewInstance1() {
Assertions.assertThrows(IllegalStateException.class, () -> ClassUtils.newInstance("org.apache.dubbo.common.compiler.support.internal.HelloServiceInternalImpl"));
}
@Test
- public void testNewInstance2() {
+ void testNewInstance2() {
Assertions.assertThrows(IllegalStateException.class, () -> ClassUtils.newInstance("org.apache.dubbo.common.compiler.support.internal.NotExistsImpl"));
}
@Test
- public void testForName() {
+ void testForName() {
ClassUtils.forName(new String[]{"org.apache.dubbo.common.compiler.support"}, "HelloServiceImpl0");
}
@Test
- public void testForName1() {
+ void testForName1() {
Assertions.assertThrows(IllegalStateException.class, () -> ClassUtils.forName(new String[]{"org.apache.dubbo.common.compiler.support"}, "HelloServiceImplXX"));
}
@Test
- public void testForName2() {
+ void testForName2() {
ClassUtils.forName("boolean");
ClassUtils.forName("byte");
ClassUtils.forName("char");
@@ -79,7 +79,7 @@ public class ClassUtilsTest {
}
@Test
- public void testGetBoxedClass() {
+ void testGetBoxedClass() {
Assertions.assertEquals(Boolean.class, ClassUtils.getBoxedClass(boolean.class));
Assertions.assertEquals(Character.class, ClassUtils.getBoxedClass(char.class));
Assertions.assertEquals(Byte.class, ClassUtils.getBoxedClass(byte.class));
@@ -92,7 +92,7 @@ public class ClassUtilsTest {
}
@Test
- public void testBoxedAndUnboxed() {
+ void testBoxedAndUnboxed() {
Assertions.assertEquals(Boolean.valueOf(true), ClassUtils.boxed(true));
Assertions.assertEquals(Character.valueOf('0'), ClassUtils.boxed('0'));
Assertions.assertEquals(Byte.valueOf((byte) 0), ClassUtils.boxed((byte) 0));
@@ -113,7 +113,7 @@ public class ClassUtilsTest {
}
@Test
- public void testGetSize() {
+ void testGetSize() {
Assertions.assertEquals(0, ClassUtils.getSize(null));
List<Integer> list = new ArrayList<>();
list.add(1);
@@ -127,17 +127,17 @@ public class ClassUtilsTest {
}
@Test
- public void testToUri() {
+ void testToUri() {
Assertions.assertThrows(RuntimeException.class, () -> ClassUtils.toURI("#xx_abc#hello"));
}
@Test
- public void testGetSizeMethod() {
+ void testGetSizeMethod() {
Assertions.assertEquals("getLength()", ClassUtils.getSizeMethod(GenericClass3.class));
}
@Test
- public void testGetSimpleClassName() {
+ void testGetSimpleClassName() {
Assertions.assertNull(ClassUtils.getSimpleClassName(null));
Assertions.assertEquals("Map", ClassUtils.getSimpleClassName(Map.class.getName()));
Assertions.assertEquals("Map", ClassUtils.getSimpleClassName(Map.class.getSimpleName()));
@@ -174,4 +174,4 @@ public class ClassUtilsTest {
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavaCodeTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavaCodeTest.java
index a812a2b8c4..16686cde7f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavaCodeTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavaCodeTest.java
@@ -18,7 +18,7 @@ package org.apache.dubbo.common.compiler.support;
import java.util.concurrent.atomic.AtomicInteger;
-public class JavaCodeTest {
+class JavaCodeTest {
public final static AtomicInteger SUBFIX = new AtomicInteger(8);
@@ -107,4 +107,4 @@ public class JavaCodeTest {
code.append('}');
return code.toString();
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavassistCompilerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavassistCompilerTest.java
index 66b2e00944..37c60165a7 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavassistCompilerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JavassistCompilerTest.java
@@ -23,9 +23,9 @@ import org.junit.jupiter.api.condition.JRE;
import java.lang.reflect.Method;
-public class JavassistCompilerTest extends JavaCodeTest {
+class JavassistCompilerTest extends JavaCodeTest {
@Test
- public void testCompileJavaClass() throws Exception {
+ void testCompileJavaClass() throws Exception {
JavassistCompiler compiler = new JavassistCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCode(), JavassistCompiler.class.getClassLoader());
@@ -55,7 +55,7 @@ public class JavassistCompilerTest extends JavaCodeTest {
}
@Test
- public void testCompileJavaClass1() throws Exception {
+ void testCompileJavaClass1() throws Exception {
Assertions.assertThrows(IllegalStateException.class, () -> {
JavassistCompiler compiler = new JavassistCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithSyntax0(), JavassistCompiler.class.getClassLoader());
@@ -66,7 +66,7 @@ public class JavassistCompilerTest extends JavaCodeTest {
}
@Test
- public void testCompileJavaClassWithImport() throws Exception {
+ void testCompileJavaClassWithImport() throws Exception {
JavassistCompiler compiler = new JavassistCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithImports(), JavassistCompiler.class.getClassLoader());
Object instance = clazz.newInstance();
@@ -75,11 +75,11 @@ public class JavassistCompilerTest extends JavaCodeTest {
}
@Test
- public void testCompileJavaClassWithExtends() throws Exception {
+ void testCompileJavaClassWithExtends() throws Exception {
JavassistCompiler compiler = new JavassistCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithWithExtends(), JavassistCompiler.class.getClassLoader());
Object instance = clazz.newInstance();
Method sayHello = instance.getClass().getMethod("sayHello");
Assertions.assertEquals("Hello world3!", sayHello.invoke(instance));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JdkCompilerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JdkCompilerTest.java
index baa63b2f71..99633b1210 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JdkCompilerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/compiler/support/JdkCompilerTest.java
@@ -21,10 +21,10 @@ import org.junit.jupiter.api.Test;
import java.lang.reflect.Method;
-public class JdkCompilerTest extends JavaCodeTest {
+class JdkCompilerTest extends JavaCodeTest {
@Test
- public void test_compileJavaClass() throws Exception {
+ void test_compileJavaClass() throws Exception {
JdkCompiler compiler = new JdkCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCode(), JdkCompiler.class.getClassLoader());
Object instance = clazz.newInstance();
@@ -33,7 +33,7 @@ public class JdkCompilerTest extends JavaCodeTest {
}
@Test
- public void test_compileJavaClass0() throws Exception {
+ void test_compileJavaClass0() throws Exception {
Assertions.assertThrows(IllegalStateException.class, () -> {
JdkCompiler compiler = new JdkCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithoutPackage(), JdkCompiler.class.getClassLoader());
@@ -44,7 +44,7 @@ public class JdkCompilerTest extends JavaCodeTest {
}
@Test
- public void test_compileJavaClass1() throws Exception {
+ void test_compileJavaClass1() throws Exception {
Assertions.assertThrows(IllegalStateException.class, () -> {
JdkCompiler compiler = new JdkCompiler();
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithSyntax(), JdkCompiler.class.getClassLoader());
@@ -55,7 +55,7 @@ public class JdkCompilerTest extends JavaCodeTest {
}
@Test
- public void test_compileJavaClass_java8() throws Exception {
+ void test_compileJavaClass_java8() throws Exception {
JdkCompiler compiler = new JdkCompiler("1.8");
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCode(), JdkCompiler.class.getClassLoader());
Object instance = clazz.newInstance();
@@ -64,7 +64,7 @@ public class JdkCompilerTest extends JavaCodeTest {
}
@Test
- public void test_compileJavaClass0_java8() throws Exception {
+ void test_compileJavaClass0_java8() throws Exception {
Assertions.assertThrows(IllegalStateException.class, () -> {
JdkCompiler compiler = new JdkCompiler("1.8");
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithoutPackage(), JdkCompiler.class.getClassLoader());
@@ -75,7 +75,7 @@ public class JdkCompilerTest extends JavaCodeTest {
}
@Test
- public void test_compileJavaClass1_java8() throws Exception {
+ void test_compileJavaClass1_java8() throws Exception {
Assertions.assertThrows(IllegalStateException.class, () -> {
JdkCompiler compiler = new JdkCompiler("1.8");
Class<?> clazz = compiler.compile(JavaCodeTest.class, getSimpleCodeWithSyntax(), JdkCompiler.class.getClassLoader());
@@ -84,4 +84,4 @@ public class JdkCompilerTest extends JavaCodeTest {
Assertions.assertEquals("Hello world!", sayHello.invoke(instance));
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java
index 58317dd521..f9f0d60fff 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/concurrent/CompletableFutureTaskTest.java
@@ -37,12 +37,12 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-public class CompletableFutureTaskTest {
+class CompletableFutureTaskTest {
private static final ExecutorService executor = new ThreadPoolExecutor(0, 10, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new NamedThreadFactory("DubboMonitorCreator", true));
@Test
- public void testCreate() throws InterruptedException {
+ void testCreate() throws InterruptedException {
final CountDownLatch countDownLatch = new CountDownLatch(1);
CompletableFuture<Boolean> completableFuture = CompletableFuture.supplyAsync(() -> {
@@ -53,7 +53,7 @@ public class CompletableFutureTaskTest {
}
@Test
- public void testRunnableResponse() throws ExecutionException, InterruptedException {
+ void testRunnableResponse() throws ExecutionException, InterruptedException {
CompletableFuture<Boolean> completableFuture = CompletableFuture.supplyAsync(() -> {
try {
Thread.sleep(500);
@@ -68,7 +68,7 @@ public class CompletableFutureTaskTest {
}
@Test
- public void testListener() throws InterruptedException {
+ void testListener() throws InterruptedException {
CompletableFuture<String> completableFuture = CompletableFuture.supplyAsync(() -> {
try {
Thread.sleep(500);
@@ -84,8 +84,8 @@ public class CompletableFutureTaskTest {
}
-@Test
- public void testCustomExecutor() {
+ @Test
+ void testCustomExecutor() {
Executor mockedExecutor = mock(Executor.class);
CompletableFuture<Integer> completableFuture = CompletableFuture.supplyAsync(() -> {
return 0;
@@ -93,4 +93,4 @@ public class CompletableFutureTaskTest {
completableFuture.thenRunAsync(mock(Runnable.class), mockedExecutor).whenComplete((s, e) ->
verify(mockedExecutor, times(1)).execute(any(Runnable.class)));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/CompositeConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/CompositeConfigurationTest.java
index 1022f973cb..09d4ca7fa7 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/CompositeConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/CompositeConfigurationTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
/**
* {@link CompositeConfiguration}
*/
-public class CompositeConfigurationTest {
+class CompositeConfigurationTest {
@Test
- public void test() {
+ void test() {
InmemoryConfiguration inmemoryConfiguration1 = new InmemoryConfiguration();
InmemoryConfiguration inmemoryConfiguration2 = new InmemoryConfiguration();
InmemoryConfiguration inmemoryConfiguration3 = new InmemoryConfiguration();
@@ -39,4 +39,4 @@ public class CompositeConfigurationTest {
Assertions.assertEquals(configuration.getInternalProperty("k"), "v3");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationCacheTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationCacheTest.java
index e4a5aca4c3..acf6a3b229 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationCacheTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationCacheTest.java
@@ -22,14 +22,14 @@ import org.junit.jupiter.api.Test;
/**
* {@link ConfigurationCache}
*/
-public class ConfigurationCacheTest {
+class ConfigurationCacheTest {
@Test
- public void test() {
+ void test() {
ConfigurationCache configurationCache = new ConfigurationCache();
String value = configurationCache.computeIfAbsent("k1", k -> "v1");
Assertions.assertEquals(value, "v1");
value = configurationCache.computeIfAbsent("k1", k -> "v2");
Assertions.assertEquals(value, "v1");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationUtilsTest.java
index e7d58b619e..da4e01a3f6 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/ConfigurationUtilsTest.java
@@ -31,9 +31,9 @@ import static org.apache.dubbo.common.constants.CommonConstants.SHUTDOWN_WAIT_KE
/**
*
*/
-public class ConfigurationUtilsTest {
+class ConfigurationUtilsTest {
@Test
- public void testCachedProperties() {
+ void testCachedProperties() {
FrameworkModel frameworkModel = new FrameworkModel();
ApplicationModel applicationModel = new ApplicationModel(frameworkModel);
@@ -72,21 +72,21 @@ public class ConfigurationUtilsTest {
}
@Test
- public void testGetServerShutdownTimeout () {
+ void testGetServerShutdownTimeout () {
System.setProperty(SHUTDOWN_WAIT_KEY, " 10000");
Assertions.assertEquals(10000, ConfigurationUtils.getServerShutdownTimeout(ApplicationModel.defaultModel()));
System.clearProperty(SHUTDOWN_WAIT_KEY);
}
@Test
- public void testGetProperty () {
+ void testGetProperty () {
System.setProperty(SHUTDOWN_WAIT_KEY, " 10000");
Assertions.assertEquals("10000", ConfigurationUtils.getProperty(ApplicationModel.defaultModel(), SHUTDOWN_WAIT_KEY));
System.clearProperty(SHUTDOWN_WAIT_KEY);
}
@Test
- public void testParseSingleProperties() throws Exception {
+ void testParseSingleProperties() throws Exception {
String p1 = "aaa=bbb";
Map<String, String> result = ConfigurationUtils.parseProperties(p1);
Assertions.assertEquals(1, result.size());
@@ -94,7 +94,7 @@ public class ConfigurationUtilsTest {
}
@Test
- public void testParseMultipleProperties() throws Exception {
+ void testParseMultipleProperties() throws Exception {
String p1 = "aaa=bbb\nccc=ddd";
Map<String, String> result = ConfigurationUtils.parseProperties(p1);
Assertions.assertEquals(2, result.size());
@@ -103,10 +103,10 @@ public class ConfigurationUtilsTest {
}
@Test
- public void testEscapedNewLine() throws Exception {
+ void testEscapedNewLine() throws Exception {
String p1 = "dubbo.registry.address=zookeeper://127.0.0.1:2181\\\\ndubbo.protocol.port=20880";
Map<String, String> result = ConfigurationUtils.parseProperties(p1);
Assertions.assertEquals(1, result.size());
Assertions.assertEquals("zookeeper://127.0.0.1:2181\\ndubbo.protocol.port=20880", result.get("dubbo.registry.address"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentConfigurationTest.java
index 88c4c47824..b2433a1590 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentConfigurationTest.java
@@ -29,7 +29,7 @@ import java.util.Map;
/**
* The type Environment configuration test.
*/
-public class EnvironmentConfigurationTest {
+class EnvironmentConfigurationTest {
private static final String MOCK_KEY = "DUBBO_KEY";
private static final String MOCK_VALUE = "mockValue";
@@ -43,7 +43,7 @@ public class EnvironmentConfigurationTest {
}
@Test
- public void testGetInternalProperty() {
+ void testGetInternalProperty() {
Map<String, String> map = new HashMap<>();
map.put(MOCK_KEY, MOCK_VALUE);
try {
@@ -101,4 +101,4 @@ public class EnvironmentConfigurationTest {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentTest.java
index cf2235ec5a..01c00fa43e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/EnvironmentTest.java
@@ -35,10 +35,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* {@link Environment}
*/
-public class EnvironmentTest {
+class EnvironmentTest {
@Test
- public void testResolvePlaceholders() {
+ void testResolvePlaceholders() {
Environment environment = ApplicationModel.defaultModel().getModelEnvironment();
Map<String, String> externalMap = new LinkedHashMap<>();
@@ -62,7 +62,7 @@ public class EnvironmentTest {
}
@Test
- public void test() {
+ void test() {
FrameworkModel frameworkModel = new FrameworkModel();
ApplicationModel applicationModel = new ApplicationModel(frameworkModel);
Environment environment = applicationModel.getModelEnvironment();
@@ -112,4 +112,4 @@ public class EnvironmentTest {
frameworkModel.destroy();
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/InmemoryConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/InmemoryConfigurationTest.java
index 3ac7b90300..50c55c00fe 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/InmemoryConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/InmemoryConfigurationTest.java
@@ -159,4 +159,4 @@ class InmemoryConfigurationTest {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/OrderedPropertiesConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/OrderedPropertiesConfigurationTest.java
index 64578bfeb2..45525c7191 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/OrderedPropertiesConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/OrderedPropertiesConfigurationTest.java
@@ -25,12 +25,12 @@ import org.junit.jupiter.api.Test;
/**
* {@link OrderedPropertiesConfiguration}
*/
-public class OrderedPropertiesConfigurationTest {
+class OrderedPropertiesConfigurationTest {
@Test
- public void testOrderPropertiesProviders() {
+ void testOrderPropertiesProviders() {
OrderedPropertiesConfiguration configuration = new OrderedPropertiesConfiguration(ApplicationModel.defaultModel().getDefaultModule());
Assertions.assertEquals("999", configuration.getInternalProperty("testKey"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/PrefixedConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/PrefixedConfigurationTest.java
index b12a5e2ce9..8f7d89fb0a 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/PrefixedConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/PrefixedConfigurationTest.java
@@ -22,10 +22,10 @@ import org.junit.jupiter.api.Test;
import java.util.LinkedHashMap;
import java.util.Map;
-public class PrefixedConfigurationTest {
+class PrefixedConfigurationTest {
@Test
- public void testPrefixedConfiguration() {
+ void testPrefixedConfiguration() {
Map<String,String> props = new LinkedHashMap<>();
props.put("dubbo.protocol.name", "dubbo");
props.put("dubbo.protocol.port", "1234");
@@ -48,4 +48,4 @@ public class PrefixedConfigurationTest {
Assertions.assertEquals("2345", prefixedConfiguration.getProperty("port"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/PropertiesConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/PropertiesConfigurationTest.java
index d301f5871b..9394a6cacf 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/PropertiesConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/PropertiesConfigurationTest.java
@@ -26,10 +26,10 @@ import java.util.Map;
/**
* {@link PropertiesConfiguration}
*/
-public class PropertiesConfigurationTest {
+class PropertiesConfigurationTest {
@Test
- public void test() {
+ void test() {
PropertiesConfiguration propertiesConfiguration = new PropertiesConfiguration(ApplicationModel.defaultModel());
Map<String, String> properties = propertiesConfiguration.getProperties();
@@ -45,4 +45,4 @@ public class PropertiesConfigurationTest {
propertiesConfiguration.remove("k1");
Assertions.assertNull(propertiesConfiguration.getProperty("k1"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/SystemConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/SystemConfigurationTest.java
index 3fea755472..d25f46101c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/SystemConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/SystemConfigurationTest.java
@@ -51,7 +51,7 @@ class SystemConfigurationTest {
* Test get sys property.
*/
@Test
- public void testGetSysProperty() {
+ void testGetSysProperty() {
Assertions.assertNull(sysConfig.getInternalProperty(MOCK_KEY));
Assertions.assertFalse(sysConfig.containsKey(MOCK_KEY));
Assertions.assertNull(sysConfig.getString(MOCK_KEY));
@@ -67,7 +67,7 @@ class SystemConfigurationTest {
* Test convert.
*/
@Test
- public void testConvert() {
+ void testConvert() {
Assertions.assertEquals(
MOCK_STRING_VALUE, sysConfig.convert(String.class, NOT_EXIST_KEY, MOCK_STRING_VALUE));
System.setProperty(MOCK_KEY, String.valueOf(MOCK_BOOL_VALUE));
@@ -114,4 +114,4 @@ class SystemConfigurationTest {
MockTwo
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationFactoryTest.java
index 7a9536b017..4633dd3ec8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationFactoryTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
* @see AbstractDynamicConfigurationFactory
* @since 2.7.5
*/
-public class AbstractDynamicConfigurationFactoryTest {
+class AbstractDynamicConfigurationFactoryTest {
private AbstractDynamicConfigurationFactory factory;
@@ -45,8 +45,8 @@ public class AbstractDynamicConfigurationFactoryTest {
}
@Test
- public void testGetDynamicConfiguration() {
+ void testGetDynamicConfiguration() {
URL url = URL.valueOf("nop://127.0.0.1");
assertEquals(factory.getDynamicConfiguration(url), factory.getDynamicConfiguration(url));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationTest.java
index c758aaac90..08afb8d05f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/AbstractDynamicConfigurationTest.java
@@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
*
* @since 2.7.5
*/
-public class AbstractDynamicConfigurationTest {
+class AbstractDynamicConfigurationTest {
private AbstractDynamicConfiguration configuration;
@@ -69,7 +69,7 @@ public class AbstractDynamicConfigurationTest {
}
@Test
- public void testConstants() {
+ void testConstants() {
assertEquals("dubbo.config-center.", PARAM_NAME_PREFIX);
assertEquals("dubbo.config-center.workers", DEFAULT_THREAD_POOL_PREFIX);
assertEquals("dubbo.config-center.thread-pool.prefix", THREAD_POOL_PREFIX_PARAM_NAME);
@@ -84,7 +84,7 @@ public class AbstractDynamicConfigurationTest {
}
@Test
- public void testConstructor() {
+ void testConstructor() {
URL url = URL.valueOf("default://")
.addParameter(THREAD_POOL_PREFIX_PARAM_NAME, "test")
.addParameter(THREAD_POOL_SIZE_PARAM_NAME, 10)
@@ -121,7 +121,7 @@ public class AbstractDynamicConfigurationTest {
}
@Test
- public void testPublishConfig() {
+ void testPublishConfig() {
assertFalse(configuration.publishConfig(null, null));
assertFalse(configuration.publishConfig(null, null, null));
}
@@ -132,36 +132,36 @@ public class AbstractDynamicConfigurationTest {
// }
@Test
- public void testGetConfig() {
+ void testGetConfig() {
assertNull(configuration.getConfig(null, null));
assertNull(configuration.getConfig(null, null, 200));
}
@Test
- public void testGetInternalProperty() {
+ void testGetInternalProperty() {
assertNull(configuration.getInternalProperty(null));
}
@Test
- public void testGetProperties() {
+ void testGetProperties() {
assertNull(configuration.getProperties(null, null));
assertNull(configuration.getProperties(null, null, 100L));
}
@Test
- public void testAddListener() {
+ void testAddListener() {
configuration.addListener(null, null);
configuration.addListener(null, null, null);
}
@Test
- public void testRemoveListener() {
+ void testRemoveListener() {
configuration.removeListener(null, null);
configuration.removeListener(null, null, null);
}
@Test
- public void testClose() throws Exception {
+ void testClose() throws Exception {
configuration.close();
}
@@ -172,7 +172,7 @@ public class AbstractDynamicConfigurationTest {
* @since 2.7.8
*/
@Test
- public void testGetGroupAndGetDefaultGroup() {
+ void testGetGroupAndGetDefaultGroup() {
assertEquals(configuration.getGroup(), configuration.getDefaultGroup());
assertEquals(DEFAULT_GROUP, configuration.getDefaultGroup());
}
@@ -184,7 +184,7 @@ public class AbstractDynamicConfigurationTest {
* @since 2.7.8
*/
@Test
- public void testGetTimeoutAndGetDefaultTimeout() {
+ void testGetTimeoutAndGetDefaultTimeout() {
assertEquals(configuration.getTimeout(), configuration.getDefaultTimeout());
assertEquals(-1L, configuration.getDefaultTimeout());
}
@@ -196,10 +196,10 @@ public class AbstractDynamicConfigurationTest {
* @since 2.7.8
*/
@Test
- public void testRemoveConfigAndDoRemoveConfig() throws Exception {
+ void testRemoveConfigAndDoRemoveConfig() throws Exception {
String key = null;
String group = null;
assertEquals(configuration.removeConfig(key, group), configuration.doRemoveConfig(key, group));
assertFalse(configuration.removeConfig(key, group));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangeTypeTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangeTypeTest.java
index e56e4fbe59..8b3224b13e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangeTypeTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangeTypeTest.java
@@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals;
* @see ConfigChangeType
* @since 2.7.5
*/
-public class ConfigChangeTypeTest {
+class ConfigChangeTypeTest {
@Test
- public void testMembers() {
+ void testMembers() {
assertArrayEquals(new ConfigChangeType[]{ADDED, MODIFIED, DELETED}, ConfigChangeType.values());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangedEventTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangedEventTest.java
index 7725399ab2..55183f3cd0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangedEventTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/ConfigChangedEventTest.java
@@ -26,7 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
*
* @since 2.7.5
*/
-public class ConfigChangedEventTest {
+class ConfigChangedEventTest {
private static final String KEY = "k";
@@ -35,7 +35,7 @@ public class ConfigChangedEventTest {
private static final String CONTENT = "c";
@Test
- public void testGetter() {
+ void testGetter() {
ConfigChangedEvent event = new ConfigChangedEvent(KEY, GROUP, CONTENT);
@@ -55,7 +55,7 @@ public class ConfigChangedEventTest {
}
@Test
- public void testEqualsAndHashCode() {
+ void testEqualsAndHashCode() {
for (ConfigChangeType type : ConfigChangeType.values()) {
assertEquals(new ConfigChangedEvent(KEY, GROUP, CONTENT, type), new ConfigChangedEvent(KEY, GROUP, CONTENT, type));
assertEquals(new ConfigChangedEvent(KEY, GROUP, CONTENT, type).hashCode(), new ConfigChangedEvent(KEY, GROUP, CONTENT, type).hashCode());
@@ -64,8 +64,8 @@ public class ConfigChangedEventTest {
}
@Test
- public void testToString() {
+ void testToString() {
ConfigChangedEvent event = new ConfigChangedEvent(KEY, GROUP, CONTENT);
assertNotNull(event.toString());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/DynamicConfigurationFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/DynamicConfigurationFactoryTest.java
index c89091c662..f52b79e328 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/DynamicConfigurationFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/DynamicConfigurationFactoryTest.java
@@ -28,12 +28,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.5
*/
-public class DynamicConfigurationFactoryTest {
+class DynamicConfigurationFactoryTest {
@Test
- public void testDefaultExtension() {
+ void testDefaultExtension() {
DynamicConfigurationFactory factory = getExtensionLoader(DynamicConfigurationFactory.class).getDefaultExtension();
assertEquals(NopDynamicConfigurationFactory.class, factory.getClass());
assertEquals(NopDynamicConfigurationFactory.class, getExtensionLoader(DynamicConfigurationFactory.class).getExtension("nop").getClass());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationFactoryTest.java
index 32430a8b96..37c3f22847 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationFactoryTest.java
@@ -28,10 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.5
*/
-public class FileSystemDynamicConfigurationFactoryTest {
+class FileSystemDynamicConfigurationFactoryTest {
@Test
- public void testGetFactory() {
+ void testGetFactory() {
assertEquals(FileSystemDynamicConfigurationFactory.class, ConfigurationUtils.getDynamicConfigurationFactory(ApplicationModel.defaultModel(), "file").getClass());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationTest.java
index cb34f71d7a..ae4ec918be 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/config/configcenter/file/FileSystemDynamicConfigurationTest.java
@@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
// Test often failed on GitHub Actions Platform because of file system on Azure
// Change to Disabled because DisabledIfEnvironmentVariable does not work on GitHub.
@Disabled
-public class FileSystemDynamicConfigurationTest {
+class FileSystemDynamicConfigurationTest {
private final Logger logger = LoggerFactory.getLogger(getClass());
@@ -79,7 +79,7 @@ public class FileSystemDynamicConfigurationTest {
}
@Test
- public void testInit() {
+ void testInit() {
assertEquals(new File(getClassPath(), "config-center"), configuration.getRootDirectory());
assertEquals("UTF-8", configuration.getEncoding());
@@ -95,7 +95,7 @@ public class FileSystemDynamicConfigurationTest {
}
@Test
- public void testPublishAndGetConfig() {
+ void testPublishAndGetConfig() {
assertTrue(configuration.publishConfig(KEY, CONTENT));
assertTrue(configuration.publishConfig(KEY, CONTENT));
assertTrue(configuration.publishConfig(KEY, CONTENT));
@@ -103,7 +103,7 @@ public class FileSystemDynamicConfigurationTest {
}
@Test
- public void testAddAndRemoveListener() throws InterruptedException {
+ void testAddAndRemoveListener() throws InterruptedException {
configuration.publishConfig(KEY, "A");
@@ -160,7 +160,7 @@ public class FileSystemDynamicConfigurationTest {
}
@Test
- public void testRemoveConfig() throws Exception {
+ void testRemoveConfig() throws Exception {
assertTrue(configuration.publishConfig(KEY, DEFAULT_GROUP, "A"));
@@ -183,4 +183,4 @@ public class FileSystemDynamicConfigurationTest {
//
// assertEquals(new TreeSet(asList("A", "B", "C")), configuration.getConfigKeys(DEFAULT_GROUP));
// }
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/constants/CommonConstantsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/constants/CommonConstantsTest.java
index bc85dfb3d5..7ab68f44b5 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/constants/CommonConstantsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/constants/CommonConstantsTest.java
@@ -29,13 +29,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.8
*/
-public class CommonConstantsTest {
+class CommonConstantsTest {
@Test
- public void test() {
+ void test() {
assertEquals(',', COMMA_SEPARATOR_CHAR);
assertEquals("composite", COMPOSITE_METADATA_STORAGE_TYPE);
assertEquals("service-name-mapping.properties-path", SERVICE_NAME_MAPPING_PROPERTIES_FILE_KEY);
assertEquals("META-INF/dubbo/service-name-mapping.properties", DEFAULT_SERVICE_NAME_MAPPING_PROPERTIES_PATH);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/ConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/ConverterTest.java
index ab40833cf3..2deaf7ebb6 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/ConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/ConverterTest.java
@@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertSame;
*
* @since 2.7.8
*/
-public class ConverterTest {
+class ConverterTest {
private ConverterUtil converterUtil;
@@ -46,7 +46,7 @@ public class ConverterTest {
}
@Test
- public void testGetConverter() {
+ void testGetConverter() {
getExtensionLoader(Converter.class)
.getSupportedExtensionInstances()
.forEach(converter -> {
@@ -55,9 +55,9 @@ public class ConverterTest {
}
@Test
- public void testConvertIfPossible() {
+ void testConvertIfPossible() {
assertEquals(Integer.valueOf(2), converterUtil.convertIfPossible("2", Integer.class));
assertEquals(Boolean.FALSE, converterUtil.convertIfPossible("false", Boolean.class));
assertEquals(Double.valueOf(1), converterUtil.convertIfPossible("1", Double.class));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToBooleanConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToBooleanConverterTest.java
index e955fa9a41..64dbe23e86 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToBooleanConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToBooleanConverterTest.java
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToBooleanConverterTest {
+class StringToBooleanConverterTest {
private StringToBooleanConverter converter;
@@ -39,12 +39,12 @@ public class StringToBooleanConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Boolean.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertTrue(converter.convert("true"));
assertTrue(converter.convert("true"));
assertTrue(converter.convert("True"));
@@ -52,4 +52,4 @@ public class StringToBooleanConverterTest {
assertNull(converter.convert(""));
assertNull(converter.convert(null));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharArrayConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharArrayConverterTest.java
index bc3a606ee5..e05a315b57 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharArrayConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharArrayConverterTest.java
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToCharArrayConverterTest {
+class StringToCharArrayConverterTest {
private StringToCharArrayConverter converter;
@@ -39,13 +39,13 @@ public class StringToCharArrayConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, char[].class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertArrayEquals(new char[]{'1', '2', '3'}, converter.convert("123"));
assertNull(converter.convert(null));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharacterConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharacterConverterTest.java
index 87f3367709..c5c321397b 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharacterConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToCharacterConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToCharacterConverterTest {
+class StringToCharacterConverterTest {
private StringToCharacterConverter converter;
@@ -40,16 +40,16 @@ public class StringToCharacterConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Character.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals('t', converter.convert("t"));
assertNull(converter.convert(null));
assertThrows(IllegalArgumentException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToDoubleConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToDoubleConverterTest.java
index 2c74736018..ae92ee6151 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToDoubleConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToDoubleConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToDoubleConverterTest {
+class StringToDoubleConverterTest {
private StringToDoubleConverter converter;
@@ -40,16 +40,16 @@ public class StringToDoubleConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Double.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Double.valueOf("1.0"), converter.convert("1.0"));
assertNull(converter.convert(null));
assertThrows(NumberFormatException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToFloatConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToFloatConverterTest.java
index b4b36f3f17..794e7ca325 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToFloatConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToFloatConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToFloatConverterTest {
+class StringToFloatConverterTest {
private StringToFloatConverter converter;
@@ -40,16 +40,16 @@ public class StringToFloatConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Float.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Float.valueOf("1.0"), converter.convert("1.0"));
assertNull(converter.convert(null));
assertThrows(NumberFormatException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToIntegerConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToIntegerConverterTest.java
index 1ccebfd183..5a648d9fe1 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToIntegerConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToIntegerConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToIntegerConverterTest {
+class StringToIntegerConverterTest {
private StringToIntegerConverter converter;
@@ -40,16 +40,16 @@ public class StringToIntegerConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Integer.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Integer.valueOf("1"), converter.convert("1"));
assertNull(converter.convert(null));
assertThrows(NumberFormatException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToLongConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToLongConverterTest.java
index c7cd926262..cda878d1c5 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToLongConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToLongConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToLongConverterTest {
+class StringToLongConverterTest {
private StringToLongConverter converter;
@@ -40,16 +40,16 @@ public class StringToLongConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Long.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Long.valueOf("1"), converter.convert("1"));
assertNull(converter.convert(null));
assertThrows(NumberFormatException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToOptionalConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToOptionalConverterTest.java
index 9cb79e20b5..f2edaeac93 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToOptionalConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToOptionalConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToOptionalConverterTest {
+class StringToOptionalConverterTest {
private StringToOptionalConverter converter;
@@ -40,13 +40,13 @@ public class StringToOptionalConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Optional.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Optional.of("1"), converter.convert("1"));
assertEquals(Optional.empty(), converter.convert(null));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToShortConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToShortConverterTest.java
index 9ecdc207b7..b349d1cef2 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToShortConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToShortConverterTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToShortConverterTest {
+class StringToShortConverterTest {
private StringToShortConverter converter;
@@ -40,16 +40,16 @@ public class StringToShortConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Short.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals(Short.valueOf("1"), converter.convert("1"));
assertNull(converter.convert(null));
assertThrows(NumberFormatException.class, () -> {
converter.convert("ttt");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToStringConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToStringConverterTest.java
index 517585df77..aeada364ed 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToStringConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/StringToStringConverterTest.java
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToStringConverterTest {
+class StringToStringConverterTest {
private StringToStringConverter converter;
@@ -39,13 +39,13 @@ public class StringToStringConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, String.class));
}
@Test
- public void testConvert() {
+ void testConvert() {
assertEquals("1", converter.convert("1"));
assertNull(converter.convert(null));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/MultiValueConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/MultiValueConverterTest.java
index ea64628bd2..ac904bbc8f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/MultiValueConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/MultiValueConverterTest.java
@@ -35,10 +35,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.8
*/
-public class MultiValueConverterTest {
+class MultiValueConverterTest {
@Test
- public void testFind() {
+ void testFind() {
MultiValueConverter converter = MultiValueConverter.find(String.class, String[].class);
assertEquals(StringToArrayConverter.class, converter.getClass());
@@ -69,4 +69,4 @@ public class MultiValueConverterTest {
converter = MultiValueConverter.find(String.class, TransferQueue.class);
assertEquals(StringToTransferQueueConverter.class, converter.getClass());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToArrayConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToArrayConverterTest.java
index 79bfac3088..0565c290d0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToArrayConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToArrayConverterTest.java
@@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToArrayConverterTest {
+class StringToArrayConverterTest {
private StringToArrayConverter converter;
@@ -42,7 +42,7 @@ public class StringToArrayConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, char[].class));
assertTrue(converter.accept(null, char[].class));
assertFalse(converter.accept(null, String.class));
@@ -51,7 +51,7 @@ public class StringToArrayConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
assertTrue(deepEquals(new Integer[]{123}, converter.convert("123", Integer[].class, Integer.class)));
assertTrue(deepEquals(new Integer[]{1, 2, 3}, converter.convert("1,2,3", Integer[].class, null)));
assertNull(converter.convert("", Integer[].class, null));
@@ -59,12 +59,12 @@ public class StringToArrayConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingDequeConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingDequeConverterTest.java
index f0975ad6bf..e114f8b6b9 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingDequeConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingDequeConverterTest.java
@@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @see BlockingDeque
* @since 2.7.6
*/
-public class StringToBlockingDequeConverterTest {
+class StringToBlockingDequeConverterTest {
private MultiValueConverter converter;
@@ -61,7 +61,7 @@ public class StringToBlockingDequeConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -89,7 +89,7 @@ public class StringToBlockingDequeConverterTest {
}
@Test
- public void testConvert() throws NoSuchFieldException {
+ void testConvert() throws NoSuchFieldException {
BlockingQueue<Integer> values = new LinkedBlockingDeque(asList(1, 2, 3));
@@ -109,12 +109,12 @@ public class StringToBlockingDequeConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 5, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingQueueConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingQueueConverterTest.java
index f1d8cb8b67..2c830782ea 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingQueueConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToBlockingQueueConverterTest.java
@@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* @see BlockingDeque
* @since 2.7.6
*/
-public class StringToBlockingQueueConverterTest {
+class StringToBlockingQueueConverterTest {
private MultiValueConverter converter;
@@ -60,7 +60,7 @@ public class StringToBlockingQueueConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -88,7 +88,7 @@ public class StringToBlockingQueueConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
BlockingQueue values = new ArrayBlockingQueue(3);
values.offer(1);
@@ -112,12 +112,12 @@ public class StringToBlockingQueueConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 3, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToCollectionConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToCollectionConverterTest.java
index 564ece3384..37a3aa145c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToCollectionConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToCollectionConverterTest.java
@@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToCollectionConverterTest {
+class StringToCollectionConverterTest {
private MultiValueConverter converter;
@@ -57,7 +57,7 @@ public class StringToCollectionConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertTrue(converter.accept(String.class, Collection.class));
@@ -85,7 +85,7 @@ public class StringToCollectionConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
List values = asList(1L, 2L, 3L);
@@ -105,12 +105,12 @@ public class StringToCollectionConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 1, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToDequeConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToDequeConverterTest.java
index 3d4b785f41..f921cae0f5 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToDequeConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToDequeConverterTest.java
@@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToDequeConverterTest {
+class StringToDequeConverterTest {
private MultiValueConverter converter;
@@ -60,7 +60,7 @@ public class StringToDequeConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -88,7 +88,7 @@ public class StringToDequeConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
Deque values = new ArrayDeque(asList(1, 2, 3));
@@ -107,12 +107,12 @@ public class StringToDequeConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 3, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToListConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToListConverterTest.java
index 4258199e3d..5002449317 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToListConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToListConverterTest.java
@@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToListConverterTest {
+class StringToListConverterTest {
private MultiValueConverter converter;
@@ -59,7 +59,7 @@ public class StringToListConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -87,7 +87,7 @@ public class StringToListConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
List values = asList(1, 2, 3);
@@ -106,12 +106,12 @@ public class StringToListConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 2, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToNavigableSetConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToNavigableSetConverterTest.java
index e7e1660d81..bcea5dc4b3 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToNavigableSetConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToNavigableSetConverterTest.java
@@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToNavigableSetConverterTest {
+class StringToNavigableSetConverterTest {
private MultiValueConverter converter;
@@ -59,7 +59,7 @@ public class StringToNavigableSetConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -87,7 +87,7 @@ public class StringToNavigableSetConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
Set values = new TreeSet(asList(1, 2, 3));
@@ -106,12 +106,12 @@ public class StringToNavigableSetConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 4, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToQueueConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToQueueConverterTest.java
index 864b472662..014b069bfe 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToQueueConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToQueueConverterTest.java
@@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToQueueConverterTest {
+class StringToQueueConverterTest {
private StringToQueueConverter converter;
@@ -60,7 +60,7 @@ public class StringToQueueConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -88,7 +88,7 @@ public class StringToQueueConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
Queue values = new ArrayDeque(asList(1.0, 2.0, 3.0));
@@ -108,12 +108,12 @@ public class StringToQueueConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 2, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSetConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSetConverterTest.java
index 4cc85e15af..4c1c251ddc 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSetConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSetConverterTest.java
@@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToSetConverterTest {
+class StringToSetConverterTest {
private StringToSetConverter converter;
@@ -60,7 +60,7 @@ public class StringToSetConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -88,7 +88,7 @@ public class StringToSetConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
Set values = new HashSet(asList(1.0, 2.0, 3.0));
Set result = (Set<Double>) converter.convert("1.0,2.0,3.0", Queue.class, Double.class);
@@ -107,12 +107,12 @@ public class StringToSetConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 2, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSortedSetConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSortedSetConverterTest.java
index 2ed12526ce..769309ab6e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSortedSetConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToSortedSetConverterTest.java
@@ -49,7 +49,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToSortedSetConverterTest {
+class StringToSortedSetConverterTest {
private MultiValueConverter converter;
@@ -59,7 +59,7 @@ public class StringToSortedSetConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -87,7 +87,7 @@ public class StringToSortedSetConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
Set values = new TreeSet(asList(1, 2, 3));
@@ -106,12 +106,12 @@ public class StringToSortedSetConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 3, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToTransferQueueConverterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToTransferQueueConverterTest.java
index e4cc101b91..3e46ef1c8c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToTransferQueueConverterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/convert/multiple/StringToTransferQueueConverterTest.java
@@ -50,7 +50,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class StringToTransferQueueConverterTest {
+class StringToTransferQueueConverterTest {
private MultiValueConverter converter;
@@ -60,7 +60,7 @@ public class StringToTransferQueueConverterTest {
}
@Test
- public void testAccept() {
+ void testAccept() {
assertFalse(converter.accept(String.class, Collection.class));
@@ -88,7 +88,7 @@ public class StringToTransferQueueConverterTest {
}
@Test
- public void testConvert() {
+ void testConvert() {
TransferQueue values = new LinkedTransferQueue(asList(1, 2, 3));
@@ -109,12 +109,12 @@ public class StringToTransferQueueConverterTest {
}
@Test
- public void testGetSourceType() {
+ void testGetSourceType() {
assertEquals(String.class, converter.getSourceType());
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Integer.MAX_VALUE - 4, converter.getPriority());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGeneratorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGeneratorTest.java
index ee83e821ff..830e612c61 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGeneratorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGeneratorTest.java
@@ -34,10 +34,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.5
*/
-public class AdaptiveClassCodeGeneratorTest {
+class AdaptiveClassCodeGeneratorTest {
@Test
- public void testGenerate() throws IOException {
+ void testGenerate() throws IOException {
AdaptiveClassCodeGenerator generator = new AdaptiveClassCodeGenerator(HasAdaptiveExt.class, "adaptive");
String value = generator.generate();
URL url = getClass().getResource("/org/apache/dubbo/common/extension/adaptive/HasAdaptiveExt$Adaptive");
@@ -48,4 +48,4 @@ public class AdaptiveClassCodeGeneratorTest {
assertTrue(content.contains(value));
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionDirectorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionDirectorTest.java
index 7db538524c..95f9b59d48 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionDirectorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionDirectorTest.java
@@ -31,14 +31,14 @@ import org.junit.jupiter.api.Test;
import java.util.Collection;
-public class ExtensionDirectorTest {
+class ExtensionDirectorTest {
String testFwSrvName = "testFwSrv";
String testAppSrvName = "testAppSrv";
String testMdSrvName = "testMdSrv";
@Test
- public void testInheritanceAndScope() {
+ void testInheritanceAndScope() {
// Expecting:
// 1. SPI extension only be created in ExtensionDirector which matched scope
@@ -78,12 +78,12 @@ public class ExtensionDirectorTest {
}
@Test
- public void testPostProcessor() {
+ void testPostProcessor() {
}
@Test
- public void testModelAware() {
+ void testModelAware() {
// Expecting:
// 1. Module scope SPI can be injected ModuleModel, ApplicationModel, FrameworkModel
// 2. Application scope SPI can be injected ApplicationModel, FrameworkModel, but not ModuleModel
@@ -139,7 +139,7 @@ public class ExtensionDirectorTest {
}
@Test
- public void testModelDataIsolation() {
+ void testModelDataIsolation() {
//Model Tree
//├─frameworkModel1
//│ ├─applicationModel11
@@ -227,7 +227,7 @@ public class ExtensionDirectorTest {
}
@Test
- public void testInjection() {
+ void testInjection() {
// Expect:
// 1. Framework scope extension can be injected to extensions of Framework/Application/Module scope
@@ -272,4 +272,4 @@ public class ExtensionDirectorTest {
Assertions.assertTrue(appService.isDestroyed());
Assertions.assertTrue(frameworkService.isDestroyed());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
index 1894b9ae41..ff62b95ea7 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoaderTest.java
@@ -97,14 +97,14 @@ import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-public class ExtensionLoaderTest {
+class ExtensionLoaderTest {
private <T> ExtensionLoader<T> getExtensionLoader(Class<T> type) {
return ApplicationModel.defaultModel().getExtensionDirector().getExtensionLoader(type);
}
@Test
- public void test_getExtensionLoader_Null() {
+ void test_getExtensionLoader_Null() {
try {
getExtensionLoader(null);
fail();
@@ -115,7 +115,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtensionLoader_NotInterface() {
+ void test_getExtensionLoader_NotInterface() {
try {
getExtensionLoader(ExtensionLoaderTest.class);
fail();
@@ -126,7 +126,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtensionLoader_NotSpiAnnotation() {
+ void test_getExtensionLoader_NotSpiAnnotation() {
try {
getExtensionLoader(NoSpiExt.class);
fail();
@@ -139,7 +139,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getDefaultExtension() {
+ void test_getDefaultExtension() {
SimpleExt ext = getExtensionLoader(SimpleExt.class).getDefaultExtension();
assertThat(ext, instanceOf(SimpleExtImpl1.class));
@@ -148,7 +148,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getDefaultExtension_NULL() {
+ void test_getDefaultExtension_NULL() {
Ext2 ext = getExtensionLoader(Ext2.class).getDefaultExtension();
assertNull(ext);
@@ -157,13 +157,13 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtension() {
+ void test_getExtension() {
assertTrue(getExtensionLoader(SimpleExt.class).getExtension("impl1") instanceof SimpleExtImpl1);
assertTrue(getExtensionLoader(SimpleExt.class).getExtension("impl2") instanceof SimpleExtImpl2);
}
@Test
- public void test_getExtension_WithWrapper() {
+ void test_getExtension_WithWrapper() {
WrappedExt impl1 = getExtensionLoader(WrappedExt.class).getExtension("impl1");
assertThat(impl1, anyOf(instanceOf(Ext6Wrapper1.class), instanceOf(Ext6Wrapper2.class)));
assertThat(impl1, instanceOf(WrappedExtWrapper.class));
@@ -194,7 +194,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtension_withWrapperAnnotation() {
+ void test_getExtension_withWrapperAnnotation() {
WrappedExt impl3 = getExtensionLoader(WrappedExt.class).getExtension("impl3");
assertThat(impl3, instanceOf(Ext6Wrapper3.class));
WrappedExt originImpl3 = impl3;
@@ -221,7 +221,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getActivateExtension_WithWrapper() {
+ void test_getActivateExtension_WithWrapper() {
URL url = URL.valueOf("test://localhost/test");
List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
.getActivateExtension(url, new String[]{}, "order");
@@ -229,7 +229,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtension_ExceptionNoExtension() {
+ void test_getExtension_ExceptionNoExtension() {
try {
getExtensionLoader(SimpleExt.class).getExtension("XXX");
fail();
@@ -239,7 +239,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtension_ExceptionNoExtension_WrapperNotAffactName() {
+ void test_getExtension_ExceptionNoExtension_WrapperNotAffactName() {
try {
getExtensionLoader(WrappedExt.class).getExtension("XXX");
fail();
@@ -249,7 +249,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getExtension_ExceptionNullArg() {
+ void test_getExtension_ExceptionNullArg() {
try {
getExtensionLoader(SimpleExt.class).getExtension(null);
fail();
@@ -259,7 +259,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_hasExtension() {
+ void test_hasExtension() {
assertTrue(getExtensionLoader(SimpleExt.class).hasExtension("impl1"));
assertFalse(getExtensionLoader(SimpleExt.class).hasExtension("impl1,impl2"));
assertFalse(getExtensionLoader(SimpleExt.class).hasExtension("xxx"));
@@ -273,7 +273,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_hasExtension_wrapperIsNotExt() {
+ void test_hasExtension_wrapperIsNotExt() {
assertTrue(getExtensionLoader(WrappedExt.class).hasExtension("impl1"));
assertFalse(getExtensionLoader(WrappedExt.class).hasExtension("impl1,impl2"));
assertFalse(getExtensionLoader(WrappedExt.class).hasExtension("xxx"));
@@ -289,7 +289,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getSupportedExtensions() {
+ void test_getSupportedExtensions() {
Set<String> exts = getExtensionLoader(SimpleExt.class).getSupportedExtensions();
Set<String> expected = new HashSet<String>();
@@ -301,7 +301,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getSupportedExtensions_wrapperIsNotExt() {
+ void test_getSupportedExtensions_wrapperIsNotExt() {
Set<String> exts = getExtensionLoader(WrappedExt.class).getSupportedExtensions();
Set<String> expected = new HashSet<String>();
@@ -314,7 +314,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_AddExtension() {
+ void test_AddExtension() {
try {
getExtensionLoader(AddExt1.class).getExtension("Manual1");
fail();
@@ -330,7 +330,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_AddExtension_NoExtend() {
+ void test_AddExtension_NoExtend() {
getExtensionLoader(Ext9Empty.class).addExtension("ext9", Ext9EmptyImpl.class);
Ext9Empty ext = getExtensionLoader(Ext9Empty.class).getExtension("ext9");
@@ -339,7 +339,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_AddExtension_ExceptionWhenExistedExtension() {
+ void test_AddExtension_ExceptionWhenExistedExtension() {
SimpleExt ext = getExtensionLoader(SimpleExt.class).getExtension("impl1");
try {
@@ -351,7 +351,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_AddExtension_Adaptive() {
+ void test_AddExtension_Adaptive() {
ExtensionLoader<AddExt2> loader = getExtensionLoader(AddExt2.class);
loader.addExtension(null, AddExt2_ManualAdaptive.class);
@@ -360,7 +360,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_AddExtension_Adaptive_ExceptionWhenExistedAdaptive() {
+ void test_AddExtension_Adaptive_ExceptionWhenExistedAdaptive() {
ExtensionLoader<AddExt1> loader = getExtensionLoader(AddExt1.class);
loader.getAdaptiveExtension();
@@ -374,7 +374,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_addExtension_with_error_class() {
+ void test_addExtension_with_error_class() {
try {
getExtensionLoader(SimpleExt.class).addExtension("impl1", ExtensionLoaderTest.class);
} catch (IllegalStateException expected) {
@@ -385,7 +385,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_addExtension_with_interface() {
+ void test_addExtension_with_interface() {
try {
getExtensionLoader(SimpleExt.class).addExtension("impl1", SimpleExt.class);
} catch (IllegalStateException expected) {
@@ -396,7 +396,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_addExtension_without_adaptive_annotation() {
+ void test_addExtension_without_adaptive_annotation() {
try {
getExtensionLoader(NoAdaptiveExt.class).addExtension(null, NoAdaptiveExtImpl.class);
} catch (IllegalStateException expected) {
@@ -407,7 +407,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getLoadedExtension_name_with_null() {
+ void test_getLoadedExtension_name_with_null() {
try {
getExtensionLoader(SimpleExt.class).getLoadedExtension(null);
} catch (IllegalArgumentException expected) {
@@ -416,13 +416,13 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getLoadedExtension_null() {
+ void test_getLoadedExtension_null() {
SimpleExt impl1 = getExtensionLoader(SimpleExt.class).getLoadedExtension("XXX");
assertNull(impl1);
}
@Test
- public void test_getLoadedExtension() {
+ void test_getLoadedExtension() {
SimpleExt simpleExt = getExtensionLoader(SimpleExt.class).getExtension("impl1");
assertThat(simpleExt, instanceOf(SimpleExtImpl1.class));
@@ -431,7 +431,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getLoadedExtensions() {
+ void test_getLoadedExtensions() {
SimpleExt simpleExt1 = getExtensionLoader(SimpleExt.class).getExtension("impl1");
assertThat(simpleExt1, instanceOf(SimpleExtImpl1.class));
@@ -443,7 +443,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_getLoadedExtensionInstances() {
+ void test_getLoadedExtensionInstances() {
SimpleExt simpleExt1 = getExtensionLoader(SimpleExt.class).getExtension("impl1");
assertThat(simpleExt1, instanceOf(SimpleExtImpl1.class));
@@ -455,7 +455,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension_with_error_class() {
+ void test_replaceExtension_with_error_class() {
try {
getExtensionLoader(SimpleExt.class).replaceExtension("impl1", ExtensionLoaderTest.class);
} catch (IllegalStateException expected) {
@@ -466,7 +466,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension_with_interface() {
+ void test_replaceExtension_with_interface() {
try {
getExtensionLoader(SimpleExt.class).replaceExtension("impl1", SimpleExt.class);
} catch (IllegalStateException expected) {
@@ -477,7 +477,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension() {
+ void test_replaceExtension() {
try {
getExtensionLoader(AddExt1.class).getExtension("Manual2");
fail();
@@ -501,7 +501,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension_Adaptive() {
+ void test_replaceExtension_Adaptive() {
ExtensionLoader<AddExt3> loader = getExtensionLoader(AddExt3.class);
AddExt3 adaptive = loader.getAdaptiveExtension();
@@ -514,7 +514,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension_ExceptionWhenNotExistedExtension() {
+ void test_replaceExtension_ExceptionWhenNotExistedExtension() {
AddExt1 ext = getExtensionLoader(AddExt1.class).getExtension("impl1");
try {
@@ -526,7 +526,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_replaceExtension_Adaptive_ExceptionWhenNotExistedExtension() {
+ void test_replaceExtension_Adaptive_ExceptionWhenNotExistedExtension() {
ExtensionLoader<AddExt4> loader = getExtensionLoader(AddExt4.class);
try {
@@ -538,7 +538,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void test_InitError() {
+ void test_InitError() {
ExtensionLoader<InitErrorExt> loader = getExtensionLoader(InitErrorExt.class);
loader.getExtension("ok");
@@ -553,7 +553,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testLoadActivateExtension() {
+ void testLoadActivateExtension() {
// test default
URL url = URL.valueOf("test://localhost/test");
List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
@@ -596,7 +596,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testLoadDefaultActivateExtension() {
+ void testLoadDefaultActivateExtension() {
// test default
URL url = URL.valueOf("test://localhost/test?ext=order1,default");
List<ActivateExt1> list = getExtensionLoader(ActivateExt1.class)
@@ -621,7 +621,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testInjectExtension() {
+ void testInjectExtension() {
// register bean for test ScopeBeanExtensionInjector
DemoImpl demoBean = new DemoImpl();
ApplicationModel.defaultModel().getBeanFactory().registerBean(demoBean);
@@ -647,7 +647,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testGetOrDefaultExtension() {
+ void testGetOrDefaultExtension() {
ExtensionLoader<InjectExt> loader = getExtensionLoader(InjectExt.class);
InjectExt injectExt = loader.getOrDefaultExtension("non-exists");
assertEquals(InjectExtImpl.class, injectExt.getClass());
@@ -655,7 +655,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testGetSupported() {
+ void testGetSupported() {
ExtensionLoader<InjectExt> loader = getExtensionLoader(InjectExt.class);
assertEquals(1, loader.getSupportedExtensions().size());
assertEquals(Collections.singleton("injection"), loader.getSupportedExtensions());
@@ -665,7 +665,7 @@ public class ExtensionLoaderTest {
* @since 2.7.7
*/
@Test
- public void testOverridden() {
+ void testOverridden() {
ExtensionLoader<Converter> loader = getExtensionLoader(Converter.class);
Converter converter = loader.getExtension("string-to-boolean");
@@ -691,7 +691,7 @@ public class ExtensionLoaderTest {
* @since 2.7.7
*/
@Test
- public void testGetLoadingStrategies() {
+ void testGetLoadingStrategies() {
List<LoadingStrategy> strategies = getLoadingStrategies();
assertEquals(4, strategies.size());
@@ -717,7 +717,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testDuplicatedImplWithoutOverriddenStrategy() {
+ void testDuplicatedImplWithoutOverriddenStrategy() {
List<LoadingStrategy> loadingStrategies = ExtensionLoader.getLoadingStrategies();
ExtensionLoader.setLoadingStrategies(new DubboExternalLoadingStrategyTest(false),
new DubboInternalLoadingStrategyTest(false));
@@ -735,7 +735,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testDuplicatedImplWithOverriddenStrategy() {
+ void testDuplicatedImplWithOverriddenStrategy() {
List<LoadingStrategy> loadingStrategies = ExtensionLoader.getLoadingStrategies();
ExtensionLoader.setLoadingStrategies(new DubboExternalLoadingStrategyTest(true),
new DubboInternalLoadingStrategyTest(true));
@@ -747,7 +747,7 @@ public class ExtensionLoaderTest {
}
@Test
- public void testLoadByDubboInternalSPI() {
+ void testLoadByDubboInternalSPI() {
ExtensionLoader<SPI1> extensionLoader = getExtensionLoader(SPI1.class);
SPI1 spi1 = extensionLoader.getExtension("1",true);
assertNotNull(spi1);
@@ -832,4 +832,4 @@ public class ExtensionLoaderTest {
return MAX_PRIORITY;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_Test.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_Test.java
index 047d0e288c..52755a8bf4 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_Test.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_Test.java
@@ -44,17 +44,17 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-public class ExtensionLoader_Adaptive_Test {
+class ExtensionLoader_Adaptive_Test {
@Test
- public void test_useAdaptiveClass() throws Exception {
+ void test_useAdaptiveClass() throws Exception {
ExtensionLoader<HasAdaptiveExt> loader = ExtensionLoader.getExtensionLoader(HasAdaptiveExt.class);
HasAdaptiveExt ext = loader.getAdaptiveExtension();
assertTrue(ext instanceof HasAdaptiveExt_ManualAdaptive);
}
@Test
- public void test_getAdaptiveExtension_defaultAdaptiveKey() throws Exception {
+ void test_getAdaptiveExtension_defaultAdaptiveKey() throws Exception {
{
SimpleExt ext = ExtensionLoader.getExtensionLoader(SimpleExt.class).getAdaptiveExtension();
@@ -78,7 +78,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_customizeAdaptiveKey() throws Exception {
+ void test_getAdaptiveExtension_customizeAdaptiveKey() throws Exception {
SimpleExt ext = ExtensionLoader.getExtensionLoader(SimpleExt.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
@@ -94,7 +94,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_protocolKey() throws Exception {
+ void test_getAdaptiveExtension_protocolKey() throws Exception {
UseProtocolKeyExt ext = ExtensionLoader.getExtensionLoader(UseProtocolKeyExt.class).getAdaptiveExtension();
{
@@ -130,7 +130,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_UrlNpe() throws Exception {
+ void test_getAdaptiveExtension_UrlNpe() throws Exception {
SimpleExt ext = ExtensionLoader.getExtensionLoader(SimpleExt.class).getAdaptiveExtension();
try {
@@ -142,7 +142,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_ExceptionWhenNoAdaptiveMethodOnInterface() throws Exception {
+ void test_getAdaptiveExtension_ExceptionWhenNoAdaptiveMethodOnInterface() throws Exception {
try {
ExtensionLoader.getExtensionLoader(NoAdaptiveMethodExt.class).getAdaptiveExtension();
fail();
@@ -163,7 +163,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_ExceptionWhenNotAdaptiveMethod() throws Exception {
+ void test_getAdaptiveExtension_ExceptionWhenNotAdaptiveMethod() throws Exception {
SimpleExt ext = ExtensionLoader.getExtensionLoader(SimpleExt.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
@@ -181,7 +181,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_ExceptionWhenNoUrlAttribute() throws Exception {
+ void test_getAdaptiveExtension_ExceptionWhenNoUrlAttribute() throws Exception {
try {
ExtensionLoader.getExtensionLoader(NoUrlParamExt.class).getAdaptiveExtension();
fail();
@@ -192,7 +192,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_urlHolder_getAdaptiveExtension() throws Exception {
+ void test_urlHolder_getAdaptiveExtension() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
@@ -207,7 +207,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_urlHolder_getAdaptiveExtension_noExtension() throws Exception {
+ void test_urlHolder_getAdaptiveExtension_noExtension() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
URL url = new ServiceConfigURL("p1", "1.2.3.4", 1010, "path1");
@@ -233,7 +233,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_urlHolder_getAdaptiveExtension_UrlNpe() throws Exception {
+ void test_urlHolder_getAdaptiveExtension_UrlNpe() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
try {
@@ -252,7 +252,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_urlHolder_getAdaptiveExtension_ExceptionWhenNotAdativeMethod() throws Exception {
+ void test_urlHolder_getAdaptiveExtension_ExceptionWhenNotAdativeMethod() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
Map<String, String> map = new HashMap<String, String>();
@@ -270,7 +270,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_urlHolder_getAdaptiveExtension_ExceptionWhenNameNotProvided() throws Exception {
+ void test_urlHolder_getAdaptiveExtension_ExceptionWhenNameNotProvided() throws Exception {
Ext2 ext = ExtensionLoader.getExtensionLoader(Ext2.class).getAdaptiveExtension();
URL url = new ServiceConfigURL("p1", "1.2.3.4", 1010, "path1");
@@ -296,7 +296,7 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_inject() throws Exception {
+ void test_getAdaptiveExtension_inject() throws Exception {
LogUtil.start();
Ext6 ext = ExtensionLoader.getExtensionLoader(Ext6.class).getAdaptiveExtension();
@@ -314,10 +314,10 @@ public class ExtensionLoader_Adaptive_Test {
}
@Test
- public void test_getAdaptiveExtension_InjectNotExtFail() throws Exception {
+ void test_getAdaptiveExtension_InjectNotExtFail() throws Exception {
Ext6 ext = ExtensionLoader.getExtensionLoader(Ext6.class).getExtension("impl2");
Ext6Impl2 impl = (Ext6Impl2) ext;
assertNull(impl.getList());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_UseJdkCompiler_Test.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_UseJdkCompiler_Test.java
index f311555793..0848c01a43 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_UseJdkCompiler_Test.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Adaptive_UseJdkCompiler_Test.java
@@ -21,7 +21,7 @@ import org.apache.dubbo.common.compiler.support.AdaptiveCompiler;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
-public class ExtensionLoader_Adaptive_UseJdkCompiler_Test extends ExtensionLoader_Adaptive_Test {
+class ExtensionLoader_Adaptive_UseJdkCompiler_Test extends ExtensionLoader_Adaptive_Test {
@BeforeAll
public static void setUp() throws Exception {
AdaptiveCompiler.setDefaultCompiler("jdk");
@@ -31,4 +31,4 @@ public class ExtensionLoader_Adaptive_UseJdkCompiler_Test extends ExtensionLoade
public static void tearDown() throws Exception {
AdaptiveCompiler.setDefaultCompiler("javassist");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Compatible_Test.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Compatible_Test.java
index 97904ae1c9..967215037f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Compatible_Test.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/ExtensionLoader_Compatible_Test.java
@@ -24,11 +24,11 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ExtensionLoader_Compatible_Test {
+class ExtensionLoader_Compatible_Test {
@Test
- public void test_getExtension() throws Exception {
+ void test_getExtension() throws Exception {
assertTrue(ExtensionLoader.getExtensionLoader(CompatibleExt.class).getExtension("impl1") instanceof CompatibleExtImpl1);
assertTrue(ExtensionLoader.getExtensionLoader(CompatibleExt.class).getExtension("impl2") instanceof CompatibleExtImpl2);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/inject/AdaptiveExtensionInjectorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/inject/AdaptiveExtensionInjectorTest.java
index d533f20258..566ffa4787 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/inject/AdaptiveExtensionInjectorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/inject/AdaptiveExtensionInjectorTest.java
@@ -31,10 +31,10 @@ import org.junit.jupiter.api.Test;
* {@link ScopeBeanExtensionInjector}
* {@link SpiExtensionInjector}
*/
-public class AdaptiveExtensionInjectorTest {
+class AdaptiveExtensionInjectorTest {
@Test
- public void test() {
+ void test() {
FrameworkModel frameworkModel = new FrameworkModel();
ExtensionLoader<ExtensionInjector> extensionLoader = frameworkModel.getExtensionLoader(ExtensionInjector.class);
@@ -56,4 +56,4 @@ public class AdaptiveExtensionInjectorTest {
frameworkModel.destroy();
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/support/ActivateComparatorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/support/ActivateComparatorTest.java
index 29d8b1c611..2b0bbad296 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/support/ActivateComparatorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/support/ActivateComparatorTest.java
@@ -26,7 +26,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-public class ActivateComparatorTest {
+class ActivateComparatorTest {
private ActivateComparator activateComparator;
@@ -36,7 +36,7 @@ public class ActivateComparatorTest {
}
@Test
- public void testActivateComparator(){
+ void testActivateComparator(){
Filter1 f1 = new Filter1();
Filter2 f2 = new Filter2();
Filter3 f3 = new Filter3();
@@ -59,7 +59,7 @@ public class ActivateComparatorTest {
}
@Test
- public void testFilterOrder() {
+ void testFilterOrder() {
Order0Filter1 order0Filter1 = new Order0Filter1();
Order0Filter2 order0Filter2 = new Order0Filter2();
@@ -83,4 +83,4 @@ public class ActivateComparatorTest {
Assertions.assertEquals(order0Filter2.getClass(), filters.get(1));
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/wrapper/WrapperTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/wrapper/WrapperTest.java
index a6f1a56e8f..f17543d1c4 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/extension/wrapper/WrapperTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/extension/wrapper/WrapperTest.java
@@ -29,13 +29,13 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.5
*/
-public class WrapperTest {
+class WrapperTest {
@Test
- public void testWrapper() {
+ void testWrapper() {
Demo demoWrapper = ExtensionLoader.getExtensionLoader(Demo.class).getExtension("demo");
assertTrue(demoWrapper instanceof DemoWrapper);
Demo demoWrapper2 = ExtensionLoader.getExtensionLoader(Demo.class).getExtension("demo2");
assertTrue(demoWrapper2 instanceof DemoWrapper2);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/function/PredicatesTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/function/PredicatesTest.java
index d042e645b7..b1dc5de727 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/function/PredicatesTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/function/PredicatesTest.java
@@ -30,20 +30,20 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.5
*/
-public class PredicatesTest {
+class PredicatesTest {
@Test
- public void testAlwaysTrue() {
+ void testAlwaysTrue() {
assertTrue(alwaysTrue().test(null));
}
@Test
- public void testAlwaysFalse() {
+ void testAlwaysFalse() {
assertFalse(alwaysFalse().test(null));
}
@Test
- public void testAnd() {
+ void testAnd() {
assertTrue(and(alwaysTrue(), alwaysTrue(), alwaysTrue()).test(null));
assertFalse(and(alwaysFalse(), alwaysFalse(), alwaysFalse()).test(null));
assertFalse(and(alwaysTrue(), alwaysFalse(), alwaysFalse()).test(null));
@@ -51,10 +51,10 @@ public class PredicatesTest {
}
@Test
- public void testOr() {
+ void testOr() {
assertTrue(or(alwaysTrue(), alwaysTrue(), alwaysTrue()).test(null));
assertTrue(or(alwaysTrue(), alwaysTrue(), alwaysFalse()).test(null));
assertTrue(or(alwaysTrue(), alwaysFalse(), alwaysFalse()).test(null));
assertFalse(or(alwaysFalse(), alwaysFalse(), alwaysFalse()).test(null));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/function/StreamsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/function/StreamsTest.java
index d55a009155..d8fde23d22 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/function/StreamsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/function/StreamsTest.java
@@ -35,23 +35,23 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.5
*/
-public class StreamsTest {
+class StreamsTest {
@Test
- public void testFilterStream() {
+ void testFilterStream() {
Stream<Integer> stream = filterStream(asList(1, 2, 3, 4, 5), i -> i % 2 == 0);
assertEquals(asList(2, 4), stream.collect(toList()));
}
@Test
- public void testFilterList() {
+ void testFilterList() {
List<Integer> list = filterList(asList(1, 2, 3, 4, 5), i -> i % 2 == 0);
assertEquals(asList(2, 4), list);
}
@Test
- public void testFilterSet() {
+ void testFilterSet() {
Set<Integer> set = filterSet(asList(1, 2, 3, 4, 5), i -> i % 2 == 0);
assertEquals(new LinkedHashSet<>(asList(2, 4)), set);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableActionTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableActionTest.java
index c5abf14754..5a608eb3ea 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableActionTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableActionTest.java
@@ -26,12 +26,12 @@ import static org.apache.dubbo.common.function.ThrowableAction.execute;
*
* @since 2.7.5
*/
-public class ThrowableActionTest {
+class ThrowableActionTest {
@Test
- public void testExecute() {
+ void testExecute() {
Assertions.assertThrows(RuntimeException.class, () -> execute(() -> {
throw new Exception("Test");
}), "Test");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableConsumerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableConsumerTest.java
index 0891a5200a..57e515eef0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableConsumerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableConsumerTest.java
@@ -26,12 +26,12 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*
* @since 2.7.5
*/
-public class ThrowableConsumerTest {
+class ThrowableConsumerTest {
@Test
- public void testExecute() {
+ void testExecute() {
assertThrows(RuntimeException.class, () -> execute("Hello,World", m -> {
throw new Exception(m);
}), "Hello,World");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableFunctionTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableFunctionTest.java
index 8ddaf271c6..08b9d72a31 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableFunctionTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/function/ThrowableFunctionTest.java
@@ -26,12 +26,12 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*
* @since 2.7.5
*/
-public class ThrowableFunctionTest {
+class ThrowableFunctionTest {
@Test
- public void testExecute() {
+ void testExecute() {
assertThrows(RuntimeException.class, () -> execute("Hello,World", m -> {
throw new Exception(m);
}), "Hello,World");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/BytesTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/BytesTest.java
index f065164d98..b57e1cb1c3 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/BytesTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/BytesTest.java
@@ -25,14 +25,14 @@ import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-public class BytesTest {
+class BytesTest {
private final byte[] b1 = "adpfioha;eoh;aldfadl;kfadslkfdajfio123431241235123davas;odvwe;lmzcoqpwoewqogineopwqihwqetup\n\tejqf;lajsfd䏿–‡å—符0da0gsaofdsf==adfasdfs".getBytes();
private final String C64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; //default base64.
private byte[] bytes1 = {3, 12, 14, 41, 12, 2, 3, 12, 4, 67, 23};
private byte[] bytes2 = {3, 12, 14, 41, 12, 2, 3, 12, 4, 67};
@Test
- public void testMain() throws Exception {
+ void testMain() throws Exception {
short s = (short) 0xabcd;
assertThat(s, is(Bytes.bytes2short(Bytes.short2bytes(s))));
@@ -66,27 +66,27 @@ public class BytesTest {
}
@Test
- public void testWrongBase64Code() {
+ void testWrongBase64Code() {
Assertions.assertThrows(IllegalArgumentException.class, () -> Bytes.bytes2base64("dubbo".getBytes(), 0, 1, new char[]{'a'}));
}
@Test
- public void testWrongOffSet() {
+ void testWrongOffSet() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> Bytes.bytes2base64("dubbo".getBytes(), -1, 1));
}
@Test
- public void testLargeLength() {
+ void testLargeLength() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> Bytes.bytes2base64("dubbo".getBytes(), 0, 100000));
}
@Test
- public void testSmallLength() {
+ void testSmallLength() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> Bytes.bytes2base64("dubbo".getBytes(), 0, -1));
}
@Test
- public void testBase64S2b2sFailCaseLog() throws Exception {
+ void testBase64S2b2sFailCaseLog() throws Exception {
String s1 = Bytes.bytes2base64(bytes1);
byte[] out1 = Bytes.base642bytes(s1);
assertThat(bytes1, is(out1));
@@ -97,7 +97,7 @@ public class BytesTest {
}
@Test
- public void testBase642bCharArrCall() {
+ void testBase642bCharArrCall() {
byte[] stringCall = Bytes.base642bytes("ZHViYm8=", C64);
byte[] charArrCall = Bytes.base642bytes("ZHViYm8=", C64.toCharArray());
@@ -105,25 +105,25 @@ public class BytesTest {
}
@Test
- public void testHex() {
+ void testHex() {
String str = Bytes.bytes2hex(b1);
assertThat(b1, is(Bytes.hex2bytes(str)));
}
@Test
- public void testMD5ForString() {
+ void testMD5ForString() {
byte[] md5 = Bytes.getMD5("dubbo");
assertThat(md5, is(Bytes.base642bytes("qk4bjCzJ3u2W/gEu8uB1Kg==")));
}
@Test
- public void testMD5ForFile() throws IOException {
+ void testMD5ForFile() throws IOException {
byte[] md5 = Bytes.getMD5(new File(getClass().getClassLoader().getResource("md5.testfile.txt").getFile()));
assertThat(md5, is(Bytes.base642bytes("iNZ+5qHafVNPLJxHwLKJ3w==")));
}
@Test
- public void testZip() throws IOException {
+ void testZip() throws IOException {
String s = "hello world";
byte[] zip = Bytes.zip(s.getBytes());
byte[] unzip = Bytes.unzip(zip);
@@ -131,12 +131,12 @@ public class BytesTest {
}
@Test
- public void testBytes2HexWithWrongOffset() {
+ void testBytes2HexWithWrongOffset() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> Bytes.bytes2hex("hello".getBytes(), -1, 1));
}
@Test
- public void testBytes2HexWithWrongLength() {
+ void testBytes2HexWithWrongLength() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> Bytes.bytes2hex("hello".getBytes(), 0, 6));
}
@@ -161,4 +161,4 @@ public class BytesTest {
bb[7] = (byte) (x >> 0);
return bb;
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/StreamUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/StreamUtilsTest.java
index 79ac29e493..21c63cc488 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/StreamUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/StreamUtilsTest.java
@@ -28,10 +28,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
-public class StreamUtilsTest {
+class StreamUtilsTest {
@Test
- public void testMarkSupportedInputStream() throws Exception {
+ void testMarkSupportedInputStream() throws Exception {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
assertEquals(10, is.available());
@@ -85,7 +85,7 @@ public class StreamUtilsTest {
}
@Test
- public void testLimitedInputStream() throws Exception {
+ void testLimitedInputStream() throws Exception {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
assertThat(10, is(is.available()));
@@ -119,7 +119,7 @@ public class StreamUtilsTest {
}
@Test
- public void testMarkInputSupport() {
+ void testMarkInputSupport() {
Assertions.assertThrows(IOException.class, () -> {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
try {
@@ -140,7 +140,7 @@ public class StreamUtilsTest {
}
@Test
- public void testSkipForOriginMarkSupportInput() throws IOException {
+ void testSkipForOriginMarkSupportInput() throws IOException {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
InputStream newIs = StreamUtils.markSupportedInputStream(is, 1);
@@ -149,7 +149,7 @@ public class StreamUtilsTest {
}
@Test
- public void testReadEmptyByteArray() {
+ void testReadEmptyByteArray() {
Assertions.assertThrows(NullPointerException.class, () -> {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
try {
@@ -164,7 +164,7 @@ public class StreamUtilsTest {
}
@Test
- public void testReadWithWrongOffset() {
+ void testReadWithWrongOffset() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
InputStream is = StreamUtilsTest.class.getResourceAsStream("/StreamUtilsTest.txt");
try {
@@ -177,4 +177,4 @@ public class StreamUtilsTest {
}
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStreamTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStreamTest.java
index 9603b4c3d3..a60a6af585 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStreamTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayInputStreamTest.java
@@ -24,9 +24,9 @@ import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-public class UnsafeByteArrayInputStreamTest {
+class UnsafeByteArrayInputStreamTest {
@Test
- public void testMark() {
+ void testMark() {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes(), 1);
assertThat(stream.markSupported(), is(true));
@@ -38,7 +38,7 @@ public class UnsafeByteArrayInputStreamTest {
}
@Test
- public void testRead() throws IOException {
+ void testRead() throws IOException {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes());
assertThat(stream.read(), is((int) 'a'));
assertThat(stream.available(), is(2));
@@ -60,7 +60,7 @@ public class UnsafeByteArrayInputStreamTest {
}
@Test
- public void testWrongLength() {
+ void testWrongLength() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes());
stream.read(new byte[1], 0, 100);
@@ -68,7 +68,7 @@ public class UnsafeByteArrayInputStreamTest {
}
@Test
- public void testWrongOffset() {
+ void testWrongOffset() {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes());
stream.read(new byte[1], -1, 1);
@@ -76,7 +76,7 @@ public class UnsafeByteArrayInputStreamTest {
}
@Test
- public void testReadEmptyByteArray() {
+ void testReadEmptyByteArray() {
Assertions.assertThrows(NullPointerException.class, () -> {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes());
stream.read(null, 0, 1);
@@ -84,11 +84,11 @@ public class UnsafeByteArrayInputStreamTest {
}
@Test
- public void testSkipZero() {
+ void testSkipZero() {
UnsafeByteArrayInputStream stream = new UnsafeByteArrayInputStream("abc".getBytes());
long skip = stream.skip(-1);
assertThat(skip, is(0L));
assertThat(stream.position(), is(0));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayOutputStreamTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayOutputStreamTest.java
index dde47f1338..ad733e017f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayOutputStreamTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeByteArrayOutputStreamTest.java
@@ -31,14 +31,14 @@ import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
-public class UnsafeByteArrayOutputStreamTest {
+class UnsafeByteArrayOutputStreamTest {
@Test
- public void testWrongSize() {
+ void testWrongSize() {
Assertions.assertThrows(IllegalArgumentException.class, () -> new UnsafeByteArrayOutputStream(-1));
}
@Test
- public void testWrite() {
+ void testWrite() {
UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream(1);
outputStream.write((int) 'a');
outputStream.write("bc".getBytes(), 0, 2);
@@ -48,7 +48,7 @@ public class UnsafeByteArrayOutputStreamTest {
}
@Test
- public void testToByteBuffer() {
+ void testToByteBuffer() {
UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream(1);
outputStream.write((int) 'a');
@@ -57,7 +57,7 @@ public class UnsafeByteArrayOutputStreamTest {
}
@Test
- public void testExtendLengthForBuffer() throws IOException {
+ void testExtendLengthForBuffer() throws IOException {
UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream(1);
for (int i = 0; i < 10; i++) {
outputStream.write(i);
@@ -70,10 +70,10 @@ public class UnsafeByteArrayOutputStreamTest {
}
@Test
- public void testToStringWithCharset() throws IOException {
+ void testToStringWithCharset() throws IOException {
UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream();
outputStream.write("Hòa Bình".getBytes());
assertThat(outputStream.toString("UTF-8"), is("Hòa Bình"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringReaderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringReaderTest.java
index ae7a2984e2..2911c64bfa 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringReaderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringReaderTest.java
@@ -24,9 +24,9 @@ import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-public class UnsafeStringReaderTest {
+class UnsafeStringReaderTest {
@Test
- public void testRead() throws IOException {
+ void testRead() throws IOException {
UnsafeStringReader reader = new UnsafeStringReader("abc");
assertThat(reader.markSupported(), is(true));
assertThat(reader.read(), is((int) 'a'));
@@ -47,7 +47,7 @@ public class UnsafeStringReaderTest {
}
@Test
- public void testSkip() throws IOException {
+ void testSkip() throws IOException {
UnsafeStringReader reader = new UnsafeStringReader("abc");
assertThat(reader.ready(), is(true));
reader.skip(1);
@@ -55,7 +55,7 @@ public class UnsafeStringReaderTest {
}
@Test
- public void testSkipTooLong() throws IOException {
+ void testSkipTooLong() throws IOException {
UnsafeStringReader reader = new UnsafeStringReader("abc");
reader.skip(10);
@@ -65,11 +65,11 @@ public class UnsafeStringReaderTest {
}
@Test
- public void testWrongLength() throws IOException {
+ void testWrongLength() throws IOException {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
UnsafeStringReader reader = new UnsafeStringReader("abc");
char[] chars = new char[1];
reader.read(chars, 0, 2);
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringWriterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringWriterTest.java
index 3f4c0c81c2..bb054b3e50 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringWriterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/io/UnsafeStringWriterTest.java
@@ -24,9 +24,9 @@ import java.io.IOException;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-public class UnsafeStringWriterTest {
+class UnsafeStringWriterTest {
@Test
- public void testWrite() {
+ void testWrite() {
UnsafeStringWriter writer = new UnsafeStringWriter();
writer.write("a");
writer.write("abc", 1, 1);
@@ -38,12 +38,12 @@ public class UnsafeStringWriterTest {
}
@Test
- public void testNegativeSize() {
+ void testNegativeSize() {
Assertions.assertThrows(IllegalArgumentException.class, () -> new UnsafeStringWriter(-1));
}
@Test
- public void testAppend() {
+ void testAppend() {
UnsafeStringWriter writer = new UnsafeStringWriter();
writer.append('a');
writer.append("abc", 1, 2);
@@ -55,7 +55,7 @@ public class UnsafeStringWriterTest {
}
@Test
- public void testAppendNull() {
+ void testAppendNull() {
UnsafeStringWriter writer = new UnsafeStringWriter();
writer.append(null);
writer.append(null, 0, 4);
@@ -66,7 +66,7 @@ public class UnsafeStringWriterTest {
}
@Test
- public void testWriteNull() throws IOException {
+ void testWriteNull() throws IOException {
UnsafeStringWriter writer = new UnsafeStringWriter(3);
char[] chars = new char[2];
chars[0] = 'a';
@@ -80,7 +80,7 @@ public class UnsafeStringWriterTest {
}
@Test
- public void testWriteCharWithWrongLength() throws IOException {
+ void testWriteCharWithWrongLength() throws IOException {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
UnsafeStringWriter writer = new UnsafeStringWriter();
char[] chars = new char[0];
@@ -89,11 +89,11 @@ public class UnsafeStringWriterTest {
}
@Test
- public void testWriteCharWithWrongCombineLength() throws IOException {
+ void testWriteCharWithWrongCombineLength() throws IOException {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
UnsafeStringWriter writer = new UnsafeStringWriter();
char[] chars = new char[1];
writer.write(chars, 1, 1);
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/json/GsonUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/json/GsonUtilsTest.java
index e6a3e1d6cd..468374d6ba 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/json/GsonUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/json/GsonUtilsTest.java
@@ -23,9 +23,9 @@ import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
-public class GsonUtilsTest {
+class GsonUtilsTest {
@Test
- public void test1() {
+ void test1() {
Object user = GsonUtils.fromJson("{'name':'Tom','age':24}", User.class);
Assertions.assertInstanceOf(User.class, user);
Assertions.assertEquals("Tom", ((User) user).getName());
@@ -40,7 +40,7 @@ public class GsonUtilsTest {
}
@Test
- public void test2() {
+ void test2() {
ClassLoader originClassLoader = Thread.currentThread().getContextClassLoader();
AtomicReference<List<String>> removedPackages = new AtomicReference<>(Collections.emptyList());
ClassLoader newClassLoader = new ClassLoader(originClassLoader) {
@@ -90,4 +90,4 @@ public class GsonUtilsTest {
this.age = age;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/lang/PrioritizedTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/lang/PrioritizedTest.java
index 87d28dc579..c65de4d736 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/lang/PrioritizedTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/lang/PrioritizedTest.java
@@ -31,22 +31,22 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
* @since 2.7.5
*/
-public class PrioritizedTest {
+class PrioritizedTest {
@Test
- public void testConstants() {
+ void testConstants() {
assertEquals(Integer.MAX_VALUE, Prioritized.MIN_PRIORITY);
assertEquals(Integer.MIN_VALUE, Prioritized.MAX_PRIORITY);
}
@Test
- public void testGetPriority() {
+ void testGetPriority() {
assertEquals(Prioritized.NORMAL_PRIORITY, new Prioritized() {
}.getPriority());
}
@Test
- public void testComparator() {
+ void testComparator() {
List<Object> list = new LinkedList<>();
@@ -123,4 +123,4 @@ public class PrioritizedTest {
return Objects.hash(value);
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/lang/ShutdownHookCallbacksTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/lang/ShutdownHookCallbacksTest.java
index 19906258f6..035f118172 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/lang/ShutdownHookCallbacksTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/lang/ShutdownHookCallbacksTest.java
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.5
*/
-public class ShutdownHookCallbacksTest {
+class ShutdownHookCallbacksTest {
private ShutdownHookCallbacks callbacks;
@@ -40,12 +40,12 @@ public class ShutdownHookCallbacksTest {
}
@Test
- public void testSingleton() {
+ void testSingleton() {
assertNotNull(callbacks);
}
@Test
- public void testCallback() {
+ void testCallback() {
callbacks.callback();
DefaultShutdownHookCallback callback = (DefaultShutdownHookCallback) callbacks.getCallbacks().iterator().next();
assertTrue(callback.isExecuted());
@@ -56,4 +56,4 @@ public class ShutdownHookCallbacksTest {
callbacks.destroy();
assertTrue(callbacks.getCallbacks().isEmpty());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerAdapterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerAdapterTest.java
index 0a9686ff64..7d5b82f840 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerAdapterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerAdapterTest.java
@@ -36,7 +36,7 @@ import java.util.stream.Stream;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
-public class LoggerAdapterTest {
+class LoggerAdapterTest {
static Stream<Arguments> data() {
return Stream.of(
Arguments.of(JclLoggerAdapter.class, JclLogger.class),
@@ -68,4 +68,4 @@ public class LoggerAdapterTest {
assertThat(loggerAdapter.getLevel(), is(targetLevel));
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerFactoryTest.java
index 70a7ce8693..4b5dc7d9e4 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerFactoryTest.java
@@ -26,9 +26,9 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-public class LoggerFactoryTest {
+class LoggerFactoryTest {
@Test
- public void testLoggerLevel() {
+ void testLoggerLevel() {
LoggerFactory.setLevel(Level.INFO);
Level level = LoggerFactory.getLevel();
@@ -36,7 +36,7 @@ public class LoggerFactoryTest {
}
@Test
- public void testGetLogFile() {
+ void testGetLogFile() {
LoggerFactory.setLoggerAdapter(FrameworkModel.defaultModel(), "slf4j");
File file = LoggerFactory.getFile();
@@ -44,7 +44,7 @@ public class LoggerFactoryTest {
}
@Test
- public void testAllLogLevel() {
+ void testAllLogLevel() {
for (Level targetLevel : Level.values()) {
LoggerFactory.setLevel(targetLevel);
Level level = LoggerFactory.getLevel();
@@ -54,7 +54,7 @@ public class LoggerFactoryTest {
}
@Test
- public void testGetLogger() {
+ void testGetLogger() {
Logger logger1 = LoggerFactory.getLogger(this.getClass());
Logger logger2 = LoggerFactory.getLogger(this.getClass());
@@ -62,7 +62,7 @@ public class LoggerFactoryTest {
}
@Test
- public void shouldReturnSameLogger() {
+ void shouldReturnSameLogger() {
Logger logger1 = LoggerFactory.getLogger(this.getClass().getName());
Logger logger2 = LoggerFactory.getLogger(this.getClass().getName());
@@ -70,10 +70,10 @@ public class LoggerFactoryTest {
}
@Test
- public void shouldReturnSameErrorTypeAwareLogger() {
+ void shouldReturnSameErrorTypeAwareLogger() {
ErrorTypeAwareLogger logger1 = LoggerFactory.getErrorTypeAwareLogger(this.getClass().getName());
ErrorTypeAwareLogger logger2 = LoggerFactory.getErrorTypeAwareLogger(this.getClass().getName());
assertThat(logger1, is(logger2));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerTest.java
index 6e6cd3c676..98941fe686 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/LoggerTest.java
@@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-public class LoggerTest {
+class LoggerTest {
static Stream<Arguments> data() {
return Stream.of(
@@ -82,4 +82,4 @@ public class LoggerTest {
assertThat(logger.isInfoEnabled(), not(nullValue()));
assertThat(logger.isDebugEnabled(), not(nullValue()));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
index 17d01d9f27..931e34313e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/slf4j/Slf4jLoggerTest.java
@@ -17,21 +17,19 @@
package org.apache.dubbo.common.logger.slf4j;
import org.junit.jupiter.api.Test;
-import org.slf4j.Marker;
import org.slf4j.spi.LocationAwareLogger;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.isNotNull;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.internal.verification.VerificationModeFactory.times;
-public class Slf4jLoggerTest {
+class Slf4jLoggerTest {
@Test
- public void testLocationAwareLogger() {
+ void testLocationAwareLogger() {
LocationAwareLogger locationAwareLogger = mock(LocationAwareLogger.class);
Slf4jLogger logger = new Slf4jLogger(locationAwareLogger);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeErrorTypeAwareLoggerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeErrorTypeAwareLoggerTest.java
index ce101f9c30..78c20457dc 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeErrorTypeAwareLoggerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeErrorTypeAwareLoggerTest.java
@@ -34,9 +34,9 @@ import static org.mockito.Mockito.verify;
/**
* Tests for FailsafeErrorTypeAwareLogger to test whether it 'ignores' exceptions thrown by logger or not.
*/
-public class FailsafeErrorTypeAwareLoggerTest {
+class FailsafeErrorTypeAwareLoggerTest {
@Test
- public void testFailsafeErrorTypeAwareForLoggingMethod() {
+ void testFailsafeErrorTypeAwareForLoggingMethod() {
Logger failLogger = mock(Logger.class);
FailsafeErrorTypeAwareLogger failsafeLogger = new FailsafeErrorTypeAwareLogger(failLogger);
@@ -60,7 +60,7 @@ public class FailsafeErrorTypeAwareLoggerTest {
}
@Test
- public void testSuccessLogger() {
+ void testSuccessLogger() {
Logger successLogger = mock(Logger.class);
FailsafeErrorTypeAwareLogger failsafeLogger = new FailsafeErrorTypeAwareLogger(successLogger);
@@ -75,7 +75,7 @@ public class FailsafeErrorTypeAwareLoggerTest {
}
@Test
- public void testGetLogger() {
+ void testGetLogger() {
Assertions.assertThrows(RuntimeException.class, () -> {
Logger failLogger = mock(Logger.class);
FailsafeErrorTypeAwareLogger failsafeLogger = new FailsafeErrorTypeAwareLogger(failLogger);
@@ -86,7 +86,7 @@ public class FailsafeErrorTypeAwareLoggerTest {
}
@Test
- public void testInstructionShownOrNot() {
+ void testInstructionShownOrNot() {
LoggerFactory.setLoggerAdapter(FrameworkModel.defaultModel(), "jdk");
ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(FailsafeErrorTypeAwareLoggerTest.class);
@@ -97,4 +97,4 @@ public class FailsafeErrorTypeAwareLoggerTest {
logger.error(REGISTRY_ADDRESS_INVALID, "Registry center", "May be it's offline.",
"error message", new Exception("error"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeLoggerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeLoggerTest.java
index 841c68eb7a..52abadc0c7 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeLoggerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/logger/support/FailsafeLoggerTest.java
@@ -27,9 +27,9 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-public class FailsafeLoggerTest {
+class FailsafeLoggerTest {
@Test
- public void testFailSafeForLoggingMethod() {
+ void testFailSafeForLoggingMethod() {
Logger failLogger = mock(Logger.class);
FailsafeLogger failsafeLogger = new FailsafeLogger(failLogger);
@@ -65,7 +65,7 @@ public class FailsafeLoggerTest {
}
@Test
- public void testSuccessLogger() {
+ void testSuccessLogger() {
Logger successLogger = mock(Logger.class);
FailsafeLogger failsafeLogger = new FailsafeLogger(successLogger);
failsafeLogger.error("error");
@@ -94,7 +94,7 @@ public class FailsafeLoggerTest {
}
@Test
- public void testGetLogger() {
+ void testGetLogger() {
Assertions.assertThrows(RuntimeException.class, () -> {
Logger failLogger = mock(Logger.class);
FailsafeLogger failsafeLogger = new FailsafeLogger(failLogger);
@@ -103,4 +103,4 @@ public class FailsafeLoggerTest {
failsafeLogger.getLogger().error("should get error");
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
index 1a5334a8cb..d1c5b20d69 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/collector/DefaultMetricsCollectorTest.java
@@ -42,7 +42,7 @@ import static org.apache.dubbo.common.constants.MetricsConstants.TAG_INTERFACE_K
import static org.apache.dubbo.common.constants.MetricsConstants.TAG_METHOD_KEY;
import static org.apache.dubbo.common.constants.MetricsConstants.TAG_VERSION_KEY;
-public class DefaultMetricsCollectorTest {
+class DefaultMetricsCollectorTest {
private ApplicationModel applicationModel;
private String interfaceName;
@@ -70,7 +70,7 @@ public class DefaultMetricsCollectorTest {
}
@Test
- public void testRequestsMetrics() {
+ void testRequestsMetrics() {
DefaultMetricsCollector collector = new DefaultMetricsCollector(applicationModel);
collector.setCollectEnabled(true);
collector.increaseTotalRequests(interfaceName, methodName, group, version);
@@ -103,7 +103,7 @@ public class DefaultMetricsCollectorTest {
}
@Test
- public void testRTMetrics() {
+ void testRTMetrics() {
DefaultMetricsCollector collector = new DefaultMetricsCollector(applicationModel);
collector.setCollectEnabled(true);
collector.addRT(interfaceName, methodName, group, version, 10L);
@@ -132,7 +132,7 @@ public class DefaultMetricsCollectorTest {
}
@Test
- public void testListener() {
+ void testListener() {
DefaultMetricsCollector collector = new DefaultMetricsCollector(applicationModel);
collector.setCollectEnabled(true);
@@ -162,4 +162,4 @@ public class DefaultMetricsCollectorTest {
return curEvent;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RTEventTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RTEventTest.java
index fea3e0ecec..948110971d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RTEventTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RTEventTest.java
@@ -18,13 +18,14 @@
package org.apache.dubbo.common.metrics.event;
import org.apache.dubbo.common.metrics.model.MethodMetric;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class RTEventTest {
+class RTEventTest {
@Test
- public void testNewEvent() {
+ void testNewEvent() {
MethodMetric metric = new MethodMetric();
Long rt = 5L;
RTEvent event = new RTEvent(metric, rt);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RequestEventTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RequestEventTest.java
index 3da2f3ac5c..b808fa75ec 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RequestEventTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/event/RequestEventTest.java
@@ -18,13 +18,14 @@
package org.apache.dubbo.common.metrics.event;
import org.apache.dubbo.common.metrics.model.MethodMetric;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class RequestEventTest {
+class RequestEventTest {
@Test
- public void testNewEvent() {
+ void testNewEvent() {
MethodMetric metric = new MethodMetric();
RequestEvent.Type type = RequestEvent.Type.TOTAL;
RequestEvent event = new RequestEvent(metric, type);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/MethodMetricTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/MethodMetricTest.java
index f4dbcf2ded..b722970950 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/MethodMetricTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/MethodMetricTest.java
@@ -23,11 +23,17 @@ import org.junit.jupiter.api.Test;
import java.util.Map;
-import static org.apache.dubbo.common.constants.MetricsConstants.*;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_APPLICATION_NAME;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_GROUP_KEY;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_HOSTNAME;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_INTERFACE_KEY;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_IP;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_METHOD_KEY;
+import static org.apache.dubbo.common.constants.MetricsConstants.TAG_VERSION_KEY;
import static org.apache.dubbo.common.utils.NetUtils.getLocalHost;
import static org.apache.dubbo.common.utils.NetUtils.getLocalHostName;
-public class MethodMetricTest {
+class MethodMetricTest {
private static final String applicationName = null;
private static String interfaceName;
@@ -44,7 +50,7 @@ public class MethodMetricTest {
}
@Test
- public void test() {
+ void test() {
MethodMetric metric = new MethodMetric(applicationName, interfaceName, methodName, group, version);
Assertions.assertEquals(metric.getInterfaceName(), interfaceName);
Assertions.assertEquals(metric.getMethodName(), methodName);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/GaugeMetricSampleTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/GaugeMetricSampleTest.java
index d45ee03c11..a47e071cf5 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/GaugeMetricSampleTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/GaugeMetricSampleTest.java
@@ -18,6 +18,7 @@
package org.apache.dubbo.common.metrics.model.sample;
import org.apache.dubbo.common.metrics.model.MetricsCategory;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -26,7 +27,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
-public class GaugeMetricSampleTest {
+class GaugeMetricSampleTest {
private static String name;
private static String description;
@@ -46,7 +47,7 @@ public class GaugeMetricSampleTest {
}
@Test
- public void test() {
+ void test() {
GaugeMetricSample sample = new GaugeMetricSample(name, description, tags, category, baseUnit, supplier);
Assertions.assertEquals(sample.getName(), name);
Assertions.assertEquals(sample.getDescription(), description);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/MetricSampleTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/MetricSampleTest.java
index 78b575304a..b85afec10d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/MetricSampleTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/model/sample/MetricSampleTest.java
@@ -18,6 +18,7 @@
package org.apache.dubbo.common.metrics.model.sample;
import org.apache.dubbo.common.metrics.model.MetricsCategory;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -25,7 +26,7 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
-public class MetricSampleTest {
+class MetricSampleTest {
private static String name;
private static String description;
@@ -45,7 +46,7 @@ public class MetricSampleTest {
}
@Test
- public void test() {
+ void test() {
MetricSample sample = new MetricSample(name, description, tags, type, category, baseUnit);
Assertions.assertEquals(sample.getName(), name);
Assertions.assertEquals(sample.getDescription(), description);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/service/MetricsEntityTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/service/MetricsEntityTest.java
index c2688cefce..b6e2016291 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/service/MetricsEntityTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/metrics/service/MetricsEntityTest.java
@@ -18,6 +18,7 @@
package org.apache.dubbo.common.metrics.service;
import org.apache.dubbo.common.metrics.model.MetricsCategory;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -25,7 +26,7 @@ import org.junit.jupiter.api.Test;
import java.util.HashMap;
import java.util.Map;
-public class MetricsEntityTest {
+class MetricsEntityTest {
private static String name;
private static Map<String, String> tags;
@@ -41,7 +42,7 @@ public class MetricsEntityTest {
}
@Test
- public void test() {
+ void test() {
MetricsEntity entity = new MetricsEntity(name, tags, category, value);
Assertions.assertEquals(entity.getName(), name);
Assertions.assertEquals(entity.getTags(), tags);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/profiler/ProfilerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/profiler/ProfilerTest.java
index d235264482..42c52f8519 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/profiler/ProfilerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/profiler/ProfilerTest.java
@@ -19,10 +19,10 @@ package org.apache.dubbo.common.profiler;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class ProfilerTest {
+class ProfilerTest {
@Test
- public void testProfiler() {
+ void testProfiler() {
ProfilerEntry one = Profiler.start("1");
ProfilerEntry two = Profiler.enter(one, "1-2");
@@ -79,7 +79,7 @@ public class ProfilerTest {
}
@Test
- public void testBizProfiler() {
+ void testBizProfiler() {
Assertions.assertNull(Profiler.getBizProfiler());
ProfilerEntry one = Profiler.start("1");
@@ -94,4 +94,4 @@ public class ProfilerTest {
Profiler.removeBizProfiler();
Assertions.assertNull(Profiler.getBizProfiler());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/resource/GlobalResourcesRepositoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/resource/GlobalResourcesRepositoryTest.java
index 28ce084a55..c19a21b65f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/resource/GlobalResourcesRepositoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/resource/GlobalResourcesRepositoryTest.java
@@ -24,10 +24,10 @@ import java.util.concurrent.ExecutorService;
/**
* {@link GlobalResourcesRepository}
*/
-public class GlobalResourcesRepositoryTest {
+class GlobalResourcesRepositoryTest {
@Test
- public void test() throws NoSuchFieldException {
+ void test() throws NoSuchFieldException {
GlobalResourcesRepository repository = GlobalResourcesRepository.getInstance();
ExecutorService globalExecutorService = GlobalResourcesRepository.getGlobalExecutorService();
@@ -74,4 +74,4 @@ public class GlobalResourcesRepositoryTest {
return destroyed;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/status/StatusTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/status/StatusTest.java
index 02a4c4ee2f..188b9692b0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/status/StatusTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/status/StatusTest.java
@@ -25,9 +25,9 @@ import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyOrNullString;
-public class StatusTest {
+class StatusTest {
@Test
- public void testConstructor1() throws Exception {
+ void testConstructor1() throws Exception {
Status status = new Status(OK, "message", "description");
assertThat(status.getLevel(), is(OK));
assertThat(status.getMessage(), equalTo("message"));
@@ -35,7 +35,7 @@ public class StatusTest {
}
@Test
- public void testConstructor2() throws Exception {
+ void testConstructor2() throws Exception {
Status status = new Status(OK, "message");
assertThat(status.getLevel(), is(OK));
assertThat(status.getMessage(), equalTo("message"));
@@ -43,10 +43,10 @@ public class StatusTest {
}
@Test
- public void testConstructor3() throws Exception {
+ void testConstructor3() throws Exception {
Status status = new Status(OK);
assertThat(status.getLevel(), is(OK));
assertThat(status.getMessage(), isEmptyOrNullString());
assertThat(status.getDescription(), isEmptyOrNullString());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/status/reporter/FrameworkStatusReportServiceTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/status/reporter/FrameworkStatusReportServiceTest.java
index 14c8465132..1892be1f84 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/status/reporter/FrameworkStatusReportServiceTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/status/reporter/FrameworkStatusReportServiceTest.java
@@ -36,10 +36,10 @@ import static org.apache.dubbo.common.status.reporter.FrameworkStatusReportServi
/**
* {@link FrameworkStatusReportService}
*/
-public class FrameworkStatusReportServiceTest {
+class FrameworkStatusReportServiceTest {
@Test
- public void test() {
+ void test() {
FrameworkModel frameworkModel = new FrameworkModel();
ApplicationModel applicationModel = new ApplicationModel(frameworkModel);
ApplicationConfig app = new ApplicationConfig("APP");
@@ -103,4 +103,4 @@ public class FrameworkStatusReportServiceTest {
frameworkModel.destroy();
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/LoadStatusCheckerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/LoadStatusCheckerTest.java
index 3361ee3b44..ebf87859b6 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/LoadStatusCheckerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/LoadStatusCheckerTest.java
@@ -26,15 +26,15 @@ import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.notNullValue;
-public class LoadStatusCheckerTest {
+class LoadStatusCheckerTest {
private static Logger logger = LoggerFactory.getLogger(LoadStatusCheckerTest.class);
@Test
- public void test() throws Exception {
+ void test() throws Exception {
LoadStatusChecker statusChecker = new LoadStatusChecker();
Status status = statusChecker.check();
assertThat(status, notNullValue());
logger.info("load status level: " + status.getLevel());
logger.info("load status message: " + status.getMessage());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/MemoryStatusCheckerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/MemoryStatusCheckerTest.java
index e04b8d70ac..ca624a9cd8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/MemoryStatusCheckerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/MemoryStatusCheckerTest.java
@@ -29,15 +29,15 @@ import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-public class MemoryStatusCheckerTest {
+class MemoryStatusCheckerTest {
private static final Logger logger = LoggerFactory.getLogger(MemoryStatusCheckerTest.class);
@Test
- public void test() throws Exception {
+ void test() throws Exception {
MemoryStatusChecker statusChecker = new MemoryStatusChecker();
Status status = statusChecker.check();
assertThat(status.getLevel(), anyOf(is(OK), is(WARN)));
logger.info("memory status level: " + status.getLevel());
logger.info("memory status message: " + status.getMessage());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/StatusUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/StatusUtilsTest.java
index 9d6d059d38..d5c3b39e18 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/StatusUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/status/support/StatusUtilsTest.java
@@ -30,9 +30,9 @@ import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.isEmptyOrNullString;
import static org.hamcrest.Matchers.not;
-public class StatusUtilsTest {
+class StatusUtilsTest {
@Test
- public void testGetSummaryStatus1() throws Exception {
+ void testGetSummaryStatus1() throws Exception {
Status status1 = new Status(Status.Level.ERROR);
Status status2 = new Status(Status.Level.WARN);
Status status3 = new Status(Status.Level.OK);
@@ -48,7 +48,7 @@ public class StatusUtilsTest {
}
@Test
- public void testGetSummaryStatus2() throws Exception {
+ void testGetSummaryStatus2() throws Exception {
Status status1 = new Status(Status.Level.WARN);
Status status2 = new Status(Status.Level.OK);
Map<String, Status> statuses = new HashMap<String, Status>();
@@ -61,7 +61,7 @@ public class StatusUtilsTest {
}
@Test
- public void testGetSummaryStatus3() throws Exception {
+ void testGetSummaryStatus3() throws Exception {
Status status1 = new Status(Status.Level.OK);
Map<String, Status> statuses = new HashMap<String, Status>();
statuses.put("status1", status1);
@@ -69,4 +69,4 @@ public class StatusUtilsTest {
assertThat(status.getLevel(), is(Status.Level.OK));
assertThat(status.getMessage(), isEmptyOrNullString());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/store/support/SimpleDataStoreTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/store/support/SimpleDataStoreTest.java
index fc99859d47..7b9e7ca225 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/store/support/SimpleDataStoreTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/store/support/SimpleDataStoreTest.java
@@ -25,11 +25,11 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class SimpleDataStoreTest {
+class SimpleDataStoreTest {
private SimpleDataStore dataStore = new SimpleDataStore();
@Test
- public void testPutGet() throws Exception {
+ void testPutGet() throws Exception {
assertNull(dataStore.get("xxx", "yyy"));
dataStore.put("name", "key", "1");
@@ -39,7 +39,7 @@ public class SimpleDataStoreTest {
}
@Test
- public void testRemove() throws Exception {
+ void testRemove() throws Exception {
dataStore.remove("xxx", "yyy");
dataStore.put("name", "key", "1");
@@ -48,7 +48,7 @@ public class SimpleDataStoreTest {
}
@Test
- public void testGetComponent() throws Exception {
+ void testGetComponent() throws Exception {
Map<String, Object> map = dataStore.get("component");
assertTrue(map != null && map.isEmpty());
dataStore.put("component", "key", "value");
@@ -57,4 +57,4 @@ public class SimpleDataStoreTest {
dataStore.remove("component", "key");
assertNotEquals(map, dataStore.get("component"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalTest.java
index 002354afea..5f9d57237b 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/InternalThreadLocalTest.java
@@ -34,7 +34,7 @@ import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class InternalThreadLocalTest {
+class InternalThreadLocalTest {
private static final int THREADS = 10;
@@ -48,7 +48,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testInternalThreadLocal() throws InterruptedException {
+ void testInternalThreadLocal() throws InterruptedException {
final AtomicInteger index = new AtomicInteger(0);
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>() {
@@ -70,7 +70,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testRemoveAll() throws InterruptedException {
+ void testRemoveAll() throws InterruptedException {
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>();
internalThreadLocal.set(1);
Assertions.assertEquals(1, (int)internalThreadLocal.get(), "set failed");
@@ -85,7 +85,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testSize() throws InterruptedException {
+ void testSize() throws InterruptedException {
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>();
internalThreadLocal.set(1);
Assertions.assertEquals(1, InternalThreadLocal.size(), "size method is wrong!");
@@ -97,7 +97,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testSetAndGet() {
+ void testSetAndGet() {
final Integer testVal = 10;
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>();
internalThreadLocal.set(testVal);
@@ -105,7 +105,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testRemove() {
+ void testRemove() {
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>();
internalThreadLocal.set(1);
Assertions.assertEquals(1, (int)internalThreadLocal.get(), "get method false!");
@@ -115,7 +115,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testOnRemove() {
+ void testOnRemove() {
final Integer[] valueToRemove = {null};
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>() {
@Override
@@ -132,7 +132,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testMultiThreadSetAndGet() throws InterruptedException {
+ void testMultiThreadSetAndGet() throws InterruptedException {
final Integer testVal1 = 10;
final Integer testVal2 = 20;
final InternalThreadLocal<Integer> internalThreadLocal = new InternalThreadLocal<Integer>();
@@ -167,7 +167,7 @@ public class InternalThreadLocalTest {
* This test is based on a Machine with 4 core and 16g memory.
*/
@Test
- public void testPerformanceTradition() {
+ void testPerformanceTradition() {
final ThreadLocal<String>[] caches1 = new ThreadLocal[PERFORMANCE_THREAD_COUNT];
final Thread mainThread = Thread.currentThread();
for (int i = 0; i < PERFORMANCE_THREAD_COUNT; i++) {
@@ -202,7 +202,7 @@ public class InternalThreadLocalTest {
* This test is based on a Machine with 4 core and 16g memory.
*/
@Test
- public void testPerformance() {
+ void testPerformance() {
final InternalThreadLocal<String>[] caches = new InternalThreadLocal[PERFORMANCE_THREAD_COUNT];
final Thread mainThread = Thread.currentThread();
for (int i = 0; i < PERFORMANCE_THREAD_COUNT; i++) {
@@ -231,7 +231,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testConstructionWithIndex() throws Exception {
+ void testConstructionWithIndex() throws Exception {
int ARRAY_LIST_CAPACITY_MAX_SIZE = Integer.MAX_VALUE - 8;
Field nextIndexField =
InternalThreadLocalMap.class.getDeclaredField("NEXT_INDEX");
@@ -260,7 +260,7 @@ public class InternalThreadLocalTest {
}
@Test
- public void testInternalThreadLocalMapExpand() throws Exception {
+ void testInternalThreadLocalMapExpand() throws Exception {
final AtomicReference<Throwable> throwable = new AtomicReference<Throwable>();
Runnable runnable = new Runnable() {
@Override
@@ -279,4 +279,4 @@ public class InternalThreadLocalTest {
// Assert the expanded size is not overflowed to negative value
assertThat(throwable.get(), is(not(instanceOf(NegativeArraySizeException.class))));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/NamedInternalThreadFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/NamedInternalThreadFactoryTest.java
index 06b072356f..92cd977a3b 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/NamedInternalThreadFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadlocal/NamedInternalThreadFactoryTest.java
@@ -20,10 +20,10 @@ package org.apache.dubbo.common.threadlocal;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class NamedInternalThreadFactoryTest {
+class NamedInternalThreadFactoryTest {
@Test
- public void newThread() throws Exception {
+ void newThread() throws Exception {
NamedInternalThreadFactory namedInternalThreadFactory = new NamedInternalThreadFactory();
Thread t = namedInternalThreadFactory.newThread(new Runnable() {
@Override
@@ -33,4 +33,4 @@ public class NamedInternalThreadFactoryTest {
});
Assertions.assertEquals(t.getClass(), InternalThread.class, "thread is not InternalThread");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemoryLimitedLinkedBlockingQueueTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemoryLimitedLinkedBlockingQueueTest.java
index 7744c02ba4..1196e5993d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemoryLimitedLinkedBlockingQueueTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemoryLimitedLinkedBlockingQueueTest.java
@@ -25,9 +25,9 @@ import java.lang.instrument.Instrumentation;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-public class MemoryLimitedLinkedBlockingQueueTest {
+class MemoryLimitedLinkedBlockingQueueTest {
@Test
- public void test() throws Exception {
+ void test() throws Exception {
ByteBuddyAgent.install();
final Instrumentation instrumentation = ByteBuddyAgent.getInstrumentation();
MemoryLimitedLinkedBlockingQueue<Runnable> queue = new MemoryLimitedLinkedBlockingQueue<>(1, instrumentation);
@@ -38,4 +38,4 @@ public class MemoryLimitedLinkedBlockingQueueTest {
queue.setMemoryLimit(Integer.MAX_VALUE);
assertThat(queue.offer(() -> System.out.println("add success")), is(true));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemorySafeLinkedBlockingQueueTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemorySafeLinkedBlockingQueueTest.java
index cb8b31b021..c8203e090c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemorySafeLinkedBlockingQueueTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/MemorySafeLinkedBlockingQueueTest.java
@@ -17,9 +17,10 @@
package org.apache.dubbo.common.threadpool;
-import net.bytebuddy.agent.ByteBuddyAgent;
import org.apache.dubbo.common.concurrent.AbortPolicy;
import org.apache.dubbo.common.concurrent.RejectException;
+
+import net.bytebuddy.agent.ByteBuddyAgent;
import org.junit.jupiter.api.Test;
import java.lang.instrument.Instrumentation;
@@ -28,9 +29,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertThrows;
-public class MemorySafeLinkedBlockingQueueTest {
+class MemorySafeLinkedBlockingQueueTest {
@Test
- public void test() throws Exception {
+ void test() throws Exception {
ByteBuddyAgent.install();
final Instrumentation instrumentation = ByteBuddyAgent.getInstrumentation();
final long objectSize = instrumentation.getObjectSize((Runnable) () -> {
@@ -48,7 +49,7 @@ public class MemorySafeLinkedBlockingQueueTest {
}
@Test
- public void testCustomReject() throws Exception {
+ void testCustomReject() throws Exception {
MemorySafeLinkedBlockingQueue<Runnable> queue = new MemorySafeLinkedBlockingQueue<>(Integer.MAX_VALUE);
queue.setRejector(new AbortPolicy<>());
assertThrows(RejectException.class, () -> queue.offer(() -> {
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/ThreadlessExecutorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/ThreadlessExecutorTest.java
index 730d7cc927..fd806b9416 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/ThreadlessExecutorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/ThreadlessExecutorTest.java
@@ -17,16 +17,13 @@
package org.apache.dubbo.common.threadpool;
import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.extension.ExtensionLoader;
-import org.apache.dubbo.common.threadpool.manager.ExecutorRepository;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-public class ThreadlessExecutorTest {
+class ThreadlessExecutorTest {
private static ThreadlessExecutor executor;
static {
@@ -35,7 +32,7 @@ public class ThreadlessExecutorTest {
}
@Test
- public void test() throws InterruptedException {
+ void test() throws InterruptedException {
for (int i = 0; i < 10; i++) {
executor.execute(()->{throw new RuntimeException("test");});
}
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventListenerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventListenerTest.java
index dc2b32dde7..d064730f6b 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventListenerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventListenerTest.java
@@ -24,7 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* {@link ThreadPoolExhaustedEvent} Test
*/
-public class ThreadPoolExhaustedEventListenerTest {
+class ThreadPoolExhaustedEventListenerTest {
private MyListener listener;
@@ -35,7 +35,7 @@ public class ThreadPoolExhaustedEventListenerTest {
}
@Test
- public void testOnEvent() {
+ void testOnEvent() {
String msg = "Thread pool is EXHAUSTED! Thread Name: DubboServerHandler-127.0.0.1:12345, Pool Size: 1 (active: 0, core: 1, max: 1, largest: 1), Task: 6 (completed: 6), Executor status:(isShutdown:false, isTerminated:false, isTerminating:false), in dubbo://127.0.0.1:12345!, dubbo version: 2.7.3, current host: 127.0.0.1";
ThreadPoolExhaustedEvent exhaustedEvent = new ThreadPoolExhaustedEvent(msg);
listener.onEvent(exhaustedEvent);
@@ -55,4 +55,4 @@ public class ThreadPoolExhaustedEventListenerTest {
return threadPoolExhaustedEvent;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventTest.java
index 492c4b890e..8570b24af8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/event/ThreadPoolExhaustedEventTest.java
@@ -23,13 +23,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* {@link ThreadPoolExhaustedEvent} Test
*/
-public class ThreadPoolExhaustedEventTest {
+class ThreadPoolExhaustedEventTest {
@Test
- public void test() {
+ void test() {
String msg = "Thread pool is EXHAUSTED! Thread Name: DubboServerHandler-127.0.0.1:12345, Pool Size: 1 (active: 0, core: 1, max: 1, largest: 1), Task: 6 (completed: 6), Executor status:(isShutdown:false, isTerminated:false, isTerminating:false), in dubbo://127.0.0.1:12345!, dubbo version: 2.7.3, current host: 127.0.0.1";
ThreadPoolExhaustedEvent event = new ThreadPoolExhaustedEvent(msg);
assertEquals(msg, event.getMsg());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/ExecutorRepositoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/ExecutorRepositoryTest.java
index 657d21eaeb..2fbf5dd221 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/ExecutorRepositoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/ExecutorRepositoryTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicBoolean;
-public class ExecutorRepositoryTest {
+class ExecutorRepositoryTest {
private ApplicationModel applicationModel;
private ExecutorRepository executorRepository;
@@ -45,7 +45,7 @@ public class ExecutorRepositoryTest {
}
@Test
- public void testGetExecutor() {
+ void testGetExecutor() {
testGet(URL.valueOf("dubbo://127.0.0.1:23456/TestService"));
testGet(URL.valueOf("dubbo://127.0.0.1:23456/TestService?side=consumer"));
@@ -67,7 +67,7 @@ public class ExecutorRepositoryTest {
}
@Test
- public void testUpdateExecutor() {
+ void testUpdateExecutor() {
URL url = URL.valueOf("dubbo://127.0.0.1:23456/TestService?threads=5");
ThreadPoolExecutor executorService = (ThreadPoolExecutor) executorRepository.createExecutorIfAbsent(url);
@@ -91,7 +91,7 @@ public class ExecutorRepositoryTest {
}
@Test
- public void testSharedExecutor() throws Exception {
+ void testSharedExecutor() throws Exception {
ExecutorService sharedExecutor = executorRepository.getSharedExecutor();
MockTask task1 = new MockTask(2000);
MockTask task2 = new MockTask(100);
@@ -141,4 +141,4 @@ public class ExecutorRepositoryTest {
return running.get();
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/FrameworkExecutorRepositoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/FrameworkExecutorRepositoryTest.java
index a62abaa2b7..f240d146be 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/FrameworkExecutorRepositoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/manager/FrameworkExecutorRepositoryTest.java
@@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicBoolean;
-public class FrameworkExecutorRepositoryTest {
+class FrameworkExecutorRepositoryTest {
private FrameworkModel frameworkModel;
private FrameworkExecutorRepository frameworkExecutorRepository;
@@ -42,14 +42,14 @@ public class FrameworkExecutorRepositoryTest {
}
@Test
- public void testGetExecutor() {
+ void testGetExecutor() {
Assertions.assertNotNull(frameworkExecutorRepository.getSharedExecutor());
frameworkExecutorRepository.nextScheduledExecutor();
}
@Test
- public void testSharedExecutor() throws Exception {
+ void testSharedExecutor() throws Exception {
ExecutorService sharedExecutor = frameworkExecutorRepository.getSharedExecutor();
FrameworkExecutorRepositoryTest.MockTask task1 = new FrameworkExecutorRepositoryTest.MockTask(2000);
FrameworkExecutorRepositoryTest.MockTask task2 = new FrameworkExecutorRepositoryTest.MockTask(100);
@@ -99,4 +99,4 @@ public class FrameworkExecutorRepositoryTest {
return running.get();
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutorTest.java
index 6d123789a7..7095378fdd 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/serial/SerializingExecutorTest.java
@@ -29,7 +29,7 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
-public class SerializingExecutorTest {
+class SerializingExecutorTest {
protected static SerializingExecutor serializingExecutor;
@@ -40,7 +40,7 @@ public class SerializingExecutorTest {
}
@Test
- public void test1() throws InterruptedException {
+ void test1() throws InterruptedException {
int n = 2;
int eachCount = 1000;
int total = n * eachCount;
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReportTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReportTest.java
index 909c8417a6..ebeef9f22f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReportTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReportTest.java
@@ -31,9 +31,9 @@ import static org.apache.dubbo.common.constants.CommonConstants.OS_NAME_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.OS_WIN_PREFIX;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class AbortPolicyWithReportTest {
+class AbortPolicyWithReportTest {
@Test
- public void jStackDumpTest() throws InterruptedException {
+ void jStackDumpTest() throws InterruptedException {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?dump.directory=/tmp&version=1.0.0&application=morgan&noValue=");
AbortPolicyWithReport abortPolicyWithReport = new AbortPolicyWithReport("Test", url);
@@ -48,7 +48,7 @@ public class AbortPolicyWithReportTest {
}
@Test
- public void jStackDumpTest_dumpDirectoryNotExists_cannotBeCreatedTakeUserHome() throws InterruptedException {
+ void jStackDumpTest_dumpDirectoryNotExists_cannotBeCreatedTakeUserHome() throws InterruptedException {
final String dumpDirectory = dumpDirectoryCannotBeCreated();
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?dump.directory="
@@ -81,7 +81,7 @@ public class AbortPolicyWithReportTest {
}
@Test
- public void jStackDumpTest_dumpDirectoryNotExists_canBeCreated() throws InterruptedException {
+ void jStackDumpTest_dumpDirectoryNotExists_canBeCreated() throws InterruptedException {
final String dumpDirectory = UUID.randomUUID().toString();
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?dump.directory="
@@ -104,7 +104,7 @@ public class AbortPolicyWithReportTest {
}
@Test
- public void test_dispatchThreadPoolExhaustedEvent() {
+ void test_dispatchThreadPoolExhaustedEvent() {
URL url = URL.valueOf("dubbo://admin:hello1234@10.20.130.230:20880/context/path?dump.directory=/tmp&version=1.0.0&application=morgan&noValue=");
AbortPolicyWithReport abortPolicyWithReport = new AbortPolicyWithReport("Test", url);
String msg = "Thread pool is EXHAUSTED! Thread Name: DubboServerHandler-127.0.0.1:12345, Pool Size: 1 (active: 0, core: 1, max: 1, largest: 1), Task: 6 (completed: 6), Executor status:(isShutdown:false, isTerminated:false, isTerminating:false), in dubbo://127.0.0.1:12345!, dubbo version: 2.7.3, current host: 127.0.0.1";
@@ -128,4 +128,4 @@ public class AbortPolicyWithReportTest {
return threadPoolExhaustedEvent;
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/cached/CachedThreadPoolTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/cached/CachedThreadPoolTest.java
index f345970fb0..91267b1768 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/cached/CachedThreadPoolTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/cached/CachedThreadPoolTest.java
@@ -42,9 +42,9 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
-public class CachedThreadPoolTest {
+class CachedThreadPoolTest {
@Test
- public void getExecutor1() throws Exception {
+ void getExecutor1() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" +
THREAD_NAME_KEY + "=demo&" +
CORE_THREADS_KEY + "=1&" +
@@ -72,10 +72,10 @@ public class CachedThreadPoolTest {
}
@Test
- public void getExecutor2() throws Exception {
+ void getExecutor2() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" + QUEUES_KEY + "=1");
ThreadPool threadPool = new CachedThreadPool();
ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url);
assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(LinkedBlockingQueue.class));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
index 89e8e4a2ec..a172982a2e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolExecutorTest.java
@@ -30,7 +30,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
-public class EagerThreadPoolExecutorTest {
+class EagerThreadPoolExecutorTest {
private static final URL URL = new ServiceConfigURL("dubbo", "localhost", 8080);
@@ -56,7 +56,7 @@ public class EagerThreadPoolExecutorTest {
* the thread pool create thread (but thread nums always less than max) instead of put task into queue.
*/
@Test
- public void testEagerThreadPool() throws Exception {
+ void testEagerThreadPool() throws Exception {
String name = "eager-tf";
int queues = 5;
int cores = 5;
@@ -93,7 +93,7 @@ public class EagerThreadPoolExecutorTest {
}
@Test
- public void testSPI() {
+ void testSPI() {
ExecutorService executorService = (ExecutorService) ExtensionLoader.getExtensionLoader(ThreadPool.class)
.getExtension("eager")
.getExecutor(URL);
@@ -102,7 +102,7 @@ public class EagerThreadPoolExecutorTest {
}
@Test
- public void testEagerThreadPool_rejectExecution() throws Exception {
+ void testEagerThreadPool_rejectExecution() throws Exception {
String name = "eager-tf";
int cores = 1;
int threads = 3;
@@ -135,4 +135,4 @@ public class EagerThreadPoolExecutorTest {
Thread.sleep(10000);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolTest.java
index cb8e9e2661..7c5f9e450f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/EagerThreadPoolTest.java
@@ -41,9 +41,9 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
-public class EagerThreadPoolTest {
+class EagerThreadPoolTest {
@Test
- public void getExecutor1() throws Exception {
+ void getExecutor1() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" +
THREAD_NAME_KEY + "=demo&" +
CORE_THREADS_KEY + "=1&" +
@@ -74,11 +74,11 @@ public class EagerThreadPoolTest {
}
@Test
- public void getExecutor2() throws Exception {
+ void getExecutor2() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" + QUEUES_KEY + "=2");
ThreadPool threadPool = new EagerThreadPool();
ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url);
assertThat(executor.getQueue().remainingCapacity(), is(2));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueueTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueueTest.java
index 534fe6a016..42c4bf6c23 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueueTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/eager/TaskQueueTest.java
@@ -28,10 +28,10 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
-public class TaskQueueTest {
+class TaskQueueTest {
@Test
- public void testOffer1() throws Exception {
+ void testOffer1() throws Exception {
Assertions.assertThrows(RejectedExecutionException.class, () -> {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
queue.offer(mock(Runnable.class));
@@ -39,7 +39,7 @@ public class TaskQueueTest {
}
@Test
- public void testOffer2() throws Exception {
+ void testOffer2() throws Exception {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
EagerThreadPoolExecutor executor = mock(EagerThreadPoolExecutor.class);
Mockito.when(executor.getPoolSize()).thenReturn(2);
@@ -49,7 +49,7 @@ public class TaskQueueTest {
}
@Test
- public void testOffer3() throws Exception {
+ void testOffer3() throws Exception {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
EagerThreadPoolExecutor executor = mock(EagerThreadPoolExecutor.class);
Mockito.when(executor.getPoolSize()).thenReturn(2);
@@ -60,7 +60,7 @@ public class TaskQueueTest {
}
@Test
- public void testOffer4() throws Exception {
+ void testOffer4() throws Exception {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
EagerThreadPoolExecutor executor = mock(EagerThreadPoolExecutor.class);
Mockito.when(executor.getPoolSize()).thenReturn(4);
@@ -71,7 +71,7 @@ public class TaskQueueTest {
}
@Test
- public void testRetryOffer1() throws Exception {
+ void testRetryOffer1() throws Exception {
Assertions.assertThrows(RejectedExecutionException.class, () -> {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
EagerThreadPoolExecutor executor = mock(EagerThreadPoolExecutor.class);
@@ -83,7 +83,7 @@ public class TaskQueueTest {
@Test
- public void testRetryOffer2() throws Exception {
+ void testRetryOffer2() throws Exception {
TaskQueue<Runnable> queue = new TaskQueue<Runnable>(1);
EagerThreadPoolExecutor executor = mock(EagerThreadPoolExecutor.class);
Mockito.when(executor.isShutdown()).thenReturn(false);
@@ -91,4 +91,4 @@ public class TaskQueueTest {
assertThat(queue.retryOffer(mock(Runnable.class), 1000, TimeUnit.MILLISECONDS), is(true));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/fixed/FixedThreadPoolTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/fixed/FixedThreadPoolTest.java
index ff8ac9225f..5a10dd934c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/fixed/FixedThreadPoolTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/fixed/FixedThreadPoolTest.java
@@ -42,9 +42,9 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
-public class FixedThreadPoolTest {
+class FixedThreadPoolTest {
@Test
- public void getExecutor1() throws Exception {
+ void getExecutor1() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" +
THREAD_NAME_KEY + "=demo&" +
CORE_THREADS_KEY + "=1&" +
@@ -75,10 +75,10 @@ public class FixedThreadPoolTest {
}
@Test
- public void getExecutor2() throws Exception {
+ void getExecutor2() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" + QUEUES_KEY + "=1");
ThreadPool threadPool = new FixedThreadPool();
ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url);
assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(LinkedBlockingQueue.class));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/limited/LimitedThreadPoolTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/limited/LimitedThreadPoolTest.java
index 4878d3546c..0f44e65082 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/limited/LimitedThreadPoolTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/threadpool/support/limited/LimitedThreadPoolTest.java
@@ -41,9 +41,9 @@ import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.startsWith;
-public class LimitedThreadPoolTest {
+class LimitedThreadPoolTest {
@Test
- public void getExecutor1() throws Exception {
+ void getExecutor1() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" +
THREAD_NAME_KEY + "=demo&" +
CORE_THREADS_KEY + "=1&" +
@@ -73,10 +73,10 @@ public class LimitedThreadPoolTest {
}
@Test
- public void getExecutor2() throws Exception {
+ void getExecutor2() throws Exception {
URL url = URL.valueOf("dubbo://10.20.130.230:20880/context/path?" + QUEUES_KEY + "=1");
ThreadPool threadPool = new LimitedThreadPool();
ThreadPoolExecutor executor = (ThreadPoolExecutor) threadPool.getExecutor(url);
assertThat(executor.getQueue(), Matchers.<BlockingQueue<Runnable>>instanceOf(LinkedBlockingQueue.class));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/timer/HashedWheelTimerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/timer/HashedWheelTimerTest.java
index 6729b944a8..34d5d625f0 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/timer/HashedWheelTimerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/timer/HashedWheelTimerTest.java
@@ -28,7 +28,7 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-public class HashedWheelTimerTest {
+class HashedWheelTimerTest {
private CountDownLatch tryStopTaskCountDownLatch = new CountDownLatch(1);
private CountDownLatch errorTaskCountDownLatch = new CountDownLatch(1);
@@ -68,7 +68,7 @@ public class HashedWheelTimerTest {
}
@Test
- public void constructorTest() {
+ void constructorTest() {
// use weak reference to let gc work every time
// which can check finalize method and reduce memory usage in time
WeakReference<Timer> timer = new WeakReference<>(new HashedWheelTimer());
@@ -133,7 +133,7 @@ public class HashedWheelTimerTest {
}
@Test
- public void createTaskTest() throws InterruptedException {
+ void createTaskTest() throws InterruptedException {
HashedWheelTimer timer = new HashedWheelTimer(
new NamedThreadFactory("dubbo-future-timeout", true),
10,
@@ -178,7 +178,7 @@ public class HashedWheelTimerTest {
}
@Test
- public void stopTaskTest() throws InterruptedException {
+ void stopTaskTest() throws InterruptedException {
Timer timer = new HashedWheelTimer(new NamedThreadFactory("dubbo-future-timeout", true));
timer.newTimeout(new TryStopTask(timer), 10, TimeUnit.MILLISECONDS);
tryStopTaskCountDownLatch.await();
@@ -195,4 +195,4 @@ public class HashedWheelTimerTest {
() -> timer.newTimeout(new EmptyTask(), 5, TimeUnit.SECONDS));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/url/URLParamTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/url/URLParamTest.java
index c7ea41c836..d230dd7bcf 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/url/URLParamTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/url/URLParamTest.java
@@ -28,9 +28,9 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-public class URLParamTest {
+class URLParamTest {
@Test
- public void testParseWithRawParam() {
+ void testParseWithRawParam() {
URLParam urlParam1 = URLParam.parse("aaa=aaa&bbb&version=1.0&default.ccc=123");
Assertions.assertEquals("aaa", urlParam1.getParameter("aaa"));
Assertions.assertEquals("bbb", urlParam1.getParameter("bbb"));
@@ -55,7 +55,7 @@ public class URLParamTest {
}
@Test
- public void testParseWithMap() {
+ void testParseWithMap() {
Map<String, String> map = new HashMap<>();
map.put("aaa", "aaa");
map.put("bbb", "bbb");
@@ -82,7 +82,7 @@ public class URLParamTest {
}
@Test
- public void testGetParameter() {
+ void testGetParameter() {
URLParam urlParam1 = URLParam.parse("aaa=aaa&bbb&version=1.0&default.ccc=123");
Assertions.assertNull(urlParam1.getParameter("abcde"));
@@ -98,7 +98,7 @@ public class URLParamTest {
}
@Test
- public void testHasParameter() {
+ void testHasParameter() {
URLParam urlParam1 = URLParam.parse("aaa=aaa&side=provider");
Assertions.assertTrue(urlParam1.hasParameter("aaa"));
Assertions.assertFalse(urlParam1.hasParameter("bbb"));
@@ -107,7 +107,7 @@ public class URLParamTest {
}
@Test
- public void testRemoveParameters() {
+ void testRemoveParameters() {
URLParam urlParam1 = URLParam.parse("aaa=aaa&side=provider&version=1.0");
Assertions.assertTrue(urlParam1.hasParameter("aaa"));
Assertions.assertTrue(urlParam1.hasParameter("side"));
@@ -138,7 +138,7 @@ public class URLParamTest {
}
@Test
- public void testAddParameters() {
+ void testAddParameters() {
URLParam urlParam1 = URLParam.parse("aaa=aaa&side=provider");
Assertions.assertTrue(urlParam1.hasParameter("aaa"));
Assertions.assertTrue(urlParam1.hasParameter("side"));
@@ -186,7 +186,7 @@ public class URLParamTest {
}
@Test
- public void testURLParamMap() {
+ void testURLParamMap() {
URLParam urlParam1 = URLParam.parse("");
Assertions.assertTrue(urlParam1.getParameters().isEmpty());
Assertions.assertEquals(0, urlParam1.getParameters().size());
@@ -260,7 +260,7 @@ public class URLParamTest {
}
@Test
- public void testMethodParameters() {
+ void testMethodParameters() {
URLParam urlParam1 = URLParam.parse("aaa.method1=aaa&bbb.method2=bbb");
Assertions.assertEquals("aaa",urlParam1.getAnyMethodParameter("method1"));
Assertions.assertEquals("bbb",urlParam1.getAnyMethodParameter("method2"));
@@ -270,4 +270,4 @@ public class URLParamTest {
Assertions.assertEquals("aaa",urlParam2.getAnyMethodParameter("method1"));
Assertions.assertNull(urlParam2.getAnyMethodParameter("method2"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AnnotationUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AnnotationUtilsTest.java
index 7dbdf3e085..84c1f6906d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AnnotationUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AnnotationUtilsTest.java
@@ -66,10 +66,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class AnnotationUtilsTest {
+class AnnotationUtilsTest {
@Test
- public void testIsType() throws NoSuchMethodException {
+ void testIsType() throws NoSuchMethodException {
// null checking
assertFalse(isType(null));
// Method checking
@@ -79,7 +79,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testIsSameType() {
+ void testIsSameType() {
assertTrue(isSameType(A.class.getAnnotation(Service.class), Service.class));
assertFalse(isSameType(A.class.getAnnotation(Service.class), Deprecated.class));
assertFalse(isSameType(A.class.getAnnotation(Service.class), null));
@@ -88,13 +88,13 @@ public class AnnotationUtilsTest {
}
@Test
- public void testExcludedType() {
+ void testExcludedType() {
assertFalse(excludedType(Service.class).test(A.class.getAnnotation(Service.class)));
assertTrue(excludedType(Service.class).test(A.class.getAnnotation(Deprecated.class)));
}
@Test
- public void testGetAttribute() {
+ void testGetAttribute() {
Annotation annotation = A.class.getAnnotation(Service.class);
assertEquals("java.lang.CharSequence", getAttribute(annotation, "interfaceName"));
assertEquals(CharSequence.class, getAttribute(annotation, "interfaceClass"));
@@ -106,7 +106,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetAttributesMap() {
+ void testGetAttributesMap() {
Annotation annotation = A.class.getAnnotation(Service.class);
Map<String, Object> attributes = getAttributes(annotation, false);
assertEquals("java.lang.CharSequence", attributes.get("interfaceName"));
@@ -126,14 +126,14 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetValue() {
+ void testGetValue() {
Adaptive adaptive = A.class.getAnnotation(Adaptive.class);
String[] value = getValue(adaptive);
assertEquals(asList("a", "b", "c"), asList(value));
}
@Test
- public void testGetDeclaredAnnotations() {
+ void testGetDeclaredAnnotations() {
List<Annotation> annotations = getDeclaredAnnotations(A.class);
assertADeclaredAnnotations(annotations, 0);
@@ -145,7 +145,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetAllDeclaredAnnotations() {
+ void testGetAllDeclaredAnnotations() {
List<Annotation> annotations = getAllDeclaredAnnotations(A.class);
assertADeclaredAnnotations(annotations, 0);
@@ -168,7 +168,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetMetaAnnotations() {
+ void testGetMetaAnnotations() {
List<Annotation> metaAnnotations = getMetaAnnotations(Service.class, a -> isSameType(a, Inherited.class));
assertEquals(1, metaAnnotations.size());
assertEquals(Inherited.class, metaAnnotations.get(0).annotationType());
@@ -184,7 +184,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetAllMetaAnnotations() {
+ void testGetAllMetaAnnotations() {
List<Annotation> metaAnnotations = getAllMetaAnnotations(Service5.class);
int offset = 0;
@@ -212,7 +212,7 @@ public class AnnotationUtilsTest {
@Test
- public void testIsAnnotationPresent() {
+ void testIsAnnotationPresent() {
assertTrue(isAnnotationPresent(A.class, true, Service.class));
assertTrue(isAnnotationPresent(A.class, true, Service.class, com.alibaba.dubbo.config.annotation.Service.class));
assertTrue(isAnnotationPresent(A.class, Service.class));
@@ -222,7 +222,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testIsAnyAnnotationPresent() {
+ void testIsAnyAnnotationPresent() {
assertTrue(isAnyAnnotationPresent(A.class, Service.class, com.alibaba.dubbo.config.annotation.Service.class, Deprecated.class));
assertTrue(isAnyAnnotationPresent(A.class, Service.class, com.alibaba.dubbo.config.annotation.Service.class));
assertTrue(isAnyAnnotationPresent(A.class, Service.class, Deprecated.class));
@@ -233,7 +233,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testGetAnnotation() {
+ void testGetAnnotation() {
assertNotNull(getAnnotation(A.class, "org.apache.dubbo.config.annotation.Service"));
assertNotNull(getAnnotation(A.class, "com.alibaba.dubbo.config.annotation.Service"));
assertNotNull(getAnnotation(A.class, "org.apache.dubbo.common.extension.Adaptive"));
@@ -243,7 +243,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testFindAnnotation() {
+ void testFindAnnotation() {
Service service = findAnnotation(A.class, Service.class);
assertEquals("java.lang.CharSequence", service.interfaceName());
assertEquals(CharSequence.class, service.interfaceClass());
@@ -253,7 +253,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testFindMetaAnnotations() {
+ void testFindMetaAnnotations() {
List<DubboService> services = findMetaAnnotations(B.class, DubboService.class);
assertEquals(1, services.size());
@@ -270,7 +270,7 @@ public class AnnotationUtilsTest {
}
@Test
- public void testFindMetaAnnotation() {
+ void testFindMetaAnnotation() {
DubboService service = findMetaAnnotation(B.class, DubboService.class);
assertEquals(Cloneable.class, service.interfaceClass());
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ArrayUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ArrayUtilsTest.java
index 4f7edf245e..fd0ae90b66 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ArrayUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ArrayUtilsTest.java
@@ -22,20 +22,20 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class ArrayUtilsTest {
+class ArrayUtilsTest {
@Test
- public void isEmpty() throws Exception {
+ void isEmpty() throws Exception {
assertTrue(ArrayUtils.isEmpty(null));
assertTrue(ArrayUtils.isEmpty(new Object[0]));
assertFalse(ArrayUtils.isEmpty(new Object[]{"abc"}));
}
@Test
- public void isNotEmpty() throws Exception {
+ void isNotEmpty() throws Exception {
assertFalse(ArrayUtils.isNotEmpty(null));
assertFalse(ArrayUtils.isNotEmpty(new Object[0]));
assertTrue(ArrayUtils.isNotEmpty(new Object[]{"abc"}));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AssertTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AssertTest.java
index bea9488522..c8c9385b05 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AssertTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AssertTest.java
@@ -23,39 +23,39 @@ import org.junit.jupiter.api.Test;
import static org.apache.dubbo.common.utils.Assert.notEmptyString;
import static org.apache.dubbo.common.utils.Assert.notNull;
-public class AssertTest {
+class AssertTest {
@Test
- public void testNotNull1() {
+ void testNotNull1() {
Assertions.assertThrows(IllegalArgumentException.class, () -> notNull(null, "null object"));
}
@Test
- public void testNotNull2() {
+ void testNotNull2() {
Assertions.assertThrows(IllegalStateException.class, () -> notNull(null, new IllegalStateException("null object")));
}
@Test
- public void testNotNullWhenInputNotNull1() {
+ void testNotNullWhenInputNotNull1() {
notNull(new Object(), "null object");
}
@Test
- public void testNotNullWhenInputNotNull2() {
+ void testNotNullWhenInputNotNull2() {
notNull(new Object(), new IllegalStateException("null object"));
}
@Test
- public void testNotNullString() {
+ void testNotNullString() {
Assertions.assertThrows(IllegalArgumentException.class, () -> notEmptyString(null, "Message can't be null"));
}
@Test
- public void testNotEmptyString() {
+ void testNotEmptyString() {
Assertions.assertThrows(IllegalArgumentException.class, () -> notEmptyString("", "Message can't be null or empty"));
}
@Test
- public void testNotNullNotEmptyString() {
+ void testNotNullNotEmptyString() {
notEmptyString("abcd", "Message can'be null or empty");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AtomicPositiveIntegerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AtomicPositiveIntegerTest.java
index 90d0430fcf..1c2880ff03 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AtomicPositiveIntegerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/AtomicPositiveIntegerTest.java
@@ -27,7 +27,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
-public class AtomicPositiveIntegerTest {
+class AtomicPositiveIntegerTest {
private AtomicPositiveInteger i1 = new AtomicPositiveInteger();
private AtomicPositiveInteger i2 = new AtomicPositiveInteger(127);
@@ -35,14 +35,14 @@ public class AtomicPositiveIntegerTest {
private AtomicPositiveInteger i3 = new AtomicPositiveInteger(Integer.MAX_VALUE);
@Test
- public void testGet() throws Exception {
+ void testGet() throws Exception {
assertEquals(0, i1.get());
assertEquals(127, i2.get());
assertEquals(Integer.MAX_VALUE, i3.get());
}
@Test
- public void testSet() throws Exception {
+ void testSet() throws Exception {
i1.set(100);
assertEquals(100, i1.get());
@@ -56,7 +56,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testGetAndIncrement() throws Exception {
+ void testGetAndIncrement() throws Exception {
int get = i1.getAndIncrement();
assertEquals(0, get);
assertEquals(1, i1.get());
@@ -71,7 +71,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testGetAndDecrement() throws Exception {
+ void testGetAndDecrement() throws Exception {
int get = i1.getAndDecrement();
assertEquals(0, get);
assertEquals(Integer.MAX_VALUE, i1.get());
@@ -86,7 +86,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testIncrementAndGet() throws Exception {
+ void testIncrementAndGet() throws Exception {
int get = i1.incrementAndGet();
assertEquals(1, get);
assertEquals(1, i1.get());
@@ -101,7 +101,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testDecrementAndGet() throws Exception {
+ void testDecrementAndGet() throws Exception {
int get = i1.decrementAndGet();
assertEquals(Integer.MAX_VALUE, get);
assertEquals(Integer.MAX_VALUE, i1.get());
@@ -116,7 +116,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testGetAndSet() throws Exception {
+ void testGetAndSet() throws Exception {
int get = i1.getAndSet(100);
assertEquals(0, get);
assertEquals(100, i1.get());
@@ -130,7 +130,7 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testGetAndAnd() throws Exception {
+ void testGetAndAnd() throws Exception {
int get = i1.getAndAdd(3);
assertEquals(0, get);
assertEquals(3, i1.get());
@@ -146,7 +146,7 @@ public class AtomicPositiveIntegerTest {
@Test
- public void testAddAndGet() throws Exception {
+ void testAddAndGet() throws Exception {
int get = i1.addAndGet(3);
assertEquals(3, get);
assertEquals(3, i1.get());
@@ -161,33 +161,33 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testCompareAndSet1() {
+ void testCompareAndSet1() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
i1.compareAndSet(i1.get(), -1);
});
}
@Test
- public void testCompareAndSet2() {
+ void testCompareAndSet2() {
assertThat(i1.compareAndSet(i1.get(), 2), is(true));
assertThat(i1.get(), is(2));
}
@Test
- public void testWeakCompareAndSet1() {
+ void testWeakCompareAndSet1() {
Assertions.assertThrows(IllegalArgumentException.class, () -> {
i1.weakCompareAndSet(i1.get(), -1);
});
}
@Test
- public void testWeakCompareAndSet2() {
+ void testWeakCompareAndSet2() {
assertThat(i1.weakCompareAndSet(i1.get(), 2), is(true));
assertThat(i1.get(), is(2));
}
@Test
- public void testValues() throws Exception {
+ void testValues() throws Exception {
Integer i = i1.get();
assertThat(i1.byteValue(), equalTo(i.byteValue()));
assertThat(i1.shortValue(), equalTo(i.shortValue()));
@@ -199,8 +199,8 @@ public class AtomicPositiveIntegerTest {
}
@Test
- public void testEquals() {
+ void testEquals() {
assertEquals(new AtomicPositiveInteger(), new AtomicPositiveInteger());
assertEquals(new AtomicPositiveInteger(1), new AtomicPositiveInteger(1));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CIDRUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CIDRUtilsTest.java
index 89e023f72b..2264cb795a 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CIDRUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CIDRUtilsTest.java
@@ -21,10 +21,10 @@ import org.junit.jupiter.api.Test;
import java.net.UnknownHostException;
-public class CIDRUtilsTest {
+class CIDRUtilsTest {
@Test
- public void testIpv4() throws UnknownHostException {
+ void testIpv4() throws UnknownHostException {
CIDRUtils cidrUtils = new CIDRUtils("192.168.1.0/26");
Assertions.assertTrue(cidrUtils.isInRange("192.168.1.63"));
Assertions.assertFalse(cidrUtils.isInRange("192.168.1.65"));
@@ -35,7 +35,7 @@ public class CIDRUtilsTest {
}
@Test
- public void testIpv6() throws UnknownHostException {
+ void testIpv6() throws UnknownHostException {
CIDRUtils cidrUtils = new CIDRUtils("234e:0:4567::3d/64");
Assertions.assertTrue(cidrUtils.isInRange("234e:0:4567::3e"));
Assertions.assertTrue(cidrUtils.isInRange("234e:0:4567::ffff:3e"));
@@ -50,4 +50,4 @@ public class CIDRUtilsTest {
Assertions.assertFalse(cidrUtils.isInRange("3EFE:FFFE:0:C107::dd"));
Assertions.assertFalse(cidrUtils.isInRange("1FFE:FFFE:0:CC00::dd"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassLoaderResourceLoaderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassLoaderResourceLoaderTest.java
index efcfdbf783..09dcfd8e67 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassLoaderResourceLoaderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassLoaderResourceLoaderTest.java
@@ -31,10 +31,10 @@ import java.util.Set;
/**
* {@link ClassLoaderResourceLoader}
*/
-public class ClassLoaderResourceLoaderTest {
+class ClassLoaderResourceLoaderTest {
@Test
- public void test() throws InterruptedException {
+ void test() throws InterruptedException {
DubboInternalLoadingStrategy dubboInternalLoadingStrategy = new DubboInternalLoadingStrategy();
String directory = dubboInternalLoadingStrategy.directory();
String type = FooAppProvider.class.getName();
@@ -56,4 +56,4 @@ public class ClassLoaderResourceLoaderTest {
ClassLoaderResourceLoader.destroy();
Assertions.assertNull(ClassLoaderResourceLoader.getClassLoaderResourcesCache());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassUtilsTest.java
index a28e924d51..6fa46643cc 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ClassUtilsTest.java
@@ -27,9 +27,9 @@ import static org.hamcrest.Matchers.sameInstance;
import static org.hamcrest.Matchers.startsWith;
import static org.mockito.Mockito.verify;
-public class ClassUtilsTest {
+class ClassUtilsTest {
@Test
- public void testForNameWithThreadContextClassLoader() throws Exception {
+ void testForNameWithThreadContextClassLoader() throws Exception {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
ClassLoader classLoader = Mockito.mock(ClassLoader.class);
@@ -42,18 +42,18 @@ public class ClassUtilsTest {
}
@Test
- public void tetForNameWithCallerClassLoader() throws Exception {
+ void tetForNameWithCallerClassLoader() throws Exception {
Class c = ClassUtils.forNameWithCallerClassLoader(ClassUtils.class.getName(), ClassUtilsTest.class);
assertThat(c == ClassUtils.class, is(true));
}
@Test
- public void testGetCallerClassLoader() throws Exception {
+ void testGetCallerClassLoader() throws Exception {
assertThat(ClassUtils.getCallerClassLoader(ClassUtilsTest.class), sameInstance(ClassUtilsTest.class.getClassLoader()));
}
@Test
- public void testGetClassLoader1() throws Exception {
+ void testGetClassLoader1() throws Exception {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
assertThat(ClassUtils.getClassLoader(ClassUtilsTest.class), sameInstance(oldClassLoader));
@@ -65,31 +65,31 @@ public class ClassUtilsTest {
}
@Test
- public void testGetClassLoader2() throws Exception {
+ void testGetClassLoader2() throws Exception {
assertThat(ClassUtils.getClassLoader(), sameInstance(ClassUtils.class.getClassLoader()));
}
@Test
- public void testForName1() throws Exception {
+ void testForName1() throws Exception {
assertThat(ClassUtils.forName(ClassUtilsTest.class.getName()) == ClassUtilsTest.class, is(true));
}
@Test
- public void testForName2() throws Exception {
+ void testForName2() throws Exception {
assertThat(ClassUtils.forName("byte") == byte.class, is(true));
assertThat(ClassUtils.forName("java.lang.String[]") == String[].class, is(true));
assertThat(ClassUtils.forName("[Ljava.lang.String;") == String[].class, is(true));
}
@Test
- public void testForName3() throws Exception {
+ void testForName3() throws Exception {
ClassLoader classLoader = Mockito.mock(ClassLoader.class);
ClassUtils.forName("a.b.c.D", classLoader);
verify(classLoader).loadClass("a.b.c.D");
}
@Test
- public void testResolvePrimitiveClassName() throws Exception {
+ void testResolvePrimitiveClassName() throws Exception {
assertThat(ClassUtils.resolvePrimitiveClassName("boolean") == boolean.class, is(true));
assertThat(ClassUtils.resolvePrimitiveClassName("byte") == byte.class, is(true));
assertThat(ClassUtils.resolvePrimitiveClassName("char") == char.class, is(true));
@@ -109,13 +109,13 @@ public class ClassUtilsTest {
}
@Test
- public void testToShortString() throws Exception {
+ void testToShortString() throws Exception {
assertThat(ClassUtils.toShortString(null), equalTo("null"));
assertThat(ClassUtils.toShortString(new ClassUtilsTest()), startsWith("ClassUtilsTest@"));
}
@Test
- public void testConvertPrimitive() throws Exception {
+ void testConvertPrimitive() throws Exception {
assertThat(ClassUtils.convertPrimitive(char.class, ""), equalTo(null));
assertThat(ClassUtils.convertPrimitive(char.class, null), equalTo(null));
@@ -151,4 +151,4 @@ public class ClassUtilsTest {
assertThat(ClassUtils.convertPrimitive(double.class, "10.1"), equalTo(Double.valueOf(10.1)));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CollectionUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CollectionUtilsTest.java
index d40ab82ab4..3516e75178 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CollectionUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CollectionUtilsTest.java
@@ -17,6 +17,7 @@
package org.apache.dubbo.common.utils;
import org.apache.dubbo.config.ProtocolConfig;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -47,9 +48,9 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class CollectionUtilsTest {
+class CollectionUtilsTest {
@Test
- public void testSort() throws Exception {
+ void testSort() throws Exception {
List<Integer> list = new ArrayList<Integer>();
list.add(100);
list.add(10);
@@ -64,14 +65,14 @@ public class CollectionUtilsTest {
}
@Test
- public void testSortNull() throws Exception {
+ void testSortNull() throws Exception {
assertNull(CollectionUtils.sort(null));
assertTrue(CollectionUtils.sort(new ArrayList<Integer>()).isEmpty());
}
@Test
- public void testSortSimpleName() throws Exception {
+ void testSortSimpleName() throws Exception {
List<String> list = new ArrayList<String>();
list.add("aaa.z");
list.add("b");
@@ -86,14 +87,14 @@ public class CollectionUtilsTest {
}
@Test
- public void testSortSimpleNameNull() throws Exception {
+ void testSortSimpleNameNull() throws Exception {
assertNull(CollectionUtils.sortSimpleName(null));
assertTrue(CollectionUtils.sortSimpleName(new ArrayList<String>()).isEmpty());
}
@Test
- public void testFlip() {
+ void testFlip() {
assertEquals(CollectionUtils.flip(null), null);
Map<String, String> input1 = new HashMap<>();
input1.put("k1", null);
@@ -109,7 +110,7 @@ public class CollectionUtilsTest {
}
@Test
- public void testSplitAll() throws Exception {
+ void testSplitAll() throws Exception {
assertNull(CollectionUtils.splitAll(null, null));
assertNull(CollectionUtils.splitAll(null, "-"));
@@ -131,7 +132,7 @@ public class CollectionUtilsTest {
}
@Test
- public void testJoinAll() throws Exception {
+ void testJoinAll() throws Exception {
assertNull(CollectionUtils.joinAll(null, null));
assertNull(CollectionUtils.joinAll(null, "-"));
@@ -158,7 +159,7 @@ public class CollectionUtilsTest {
}
@Test
- public void testJoinList() throws Exception {
+ void testJoinList() throws Exception {
List<String> list = emptyList();
assertEquals("", CollectionUtils.join(list, "/"));
@@ -170,7 +171,7 @@ public class CollectionUtilsTest {
}
@Test
- public void testMapEquals() throws Exception {
+ void testMapEquals() throws Exception {
assertTrue(CollectionUtils.mapEquals(null, null));
assertFalse(CollectionUtils.mapEquals(null, new HashMap<String, String>()));
assertFalse(CollectionUtils.mapEquals(new HashMap<String, String>(), null));
@@ -180,17 +181,17 @@ public class CollectionUtilsTest {
}
@Test
- public void testStringMap1() throws Exception {
+ void testStringMap1() throws Exception {
assertThat(toStringMap("key", "value"), equalTo(Collections.singletonMap("key", "value")));
}
@Test
- public void testStringMap2() throws Exception {
+ void testStringMap2() throws Exception {
Assertions.assertThrows(IllegalArgumentException.class, () -> toStringMap("key", "value", "odd"));
}
@Test
- public void testToMap1() throws Exception {
+ void testToMap1() throws Exception {
assertTrue(CollectionUtils.toMap().isEmpty());
Map<String, Integer> expected = new HashMap<String, Integer>();
@@ -202,7 +203,7 @@ public class CollectionUtilsTest {
}
@Test
- public void testObjectToMap() throws Exception {
+ void testObjectToMap() throws Exception {
ProtocolConfig protocolConfig=new ProtocolConfig();
protocolConfig.setSerialization("fastjson2");
@@ -210,24 +211,24 @@ public class CollectionUtilsTest {
}
@Test
- public void testToMap2() throws Exception {
+ void testToMap2() throws Exception {
Assertions.assertThrows(IllegalArgumentException.class, () -> toMap("a", "b", "c"));
}
@Test
- public void testIsEmpty() throws Exception {
+ void testIsEmpty() throws Exception {
assertThat(isEmpty(null), is(true));
assertThat(isEmpty(new HashSet()), is(true));
assertThat(isEmpty(emptyList()), is(true));
}
@Test
- public void testIsNotEmpty() throws Exception {
+ void testIsNotEmpty() throws Exception {
assertThat(isNotEmpty(singleton("a")), is(true));
}
@Test
- public void testOfSet() {
+ void testOfSet() {
Set<String> set = ofSet();
assertEquals(emptySet(), set);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CompatibleTypeUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CompatibleTypeUtilsTest.java
index ee9adc2c0e..1599d25a4f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CompatibleTypeUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/CompatibleTypeUtilsTest.java
@@ -34,11 +34,11 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class CompatibleTypeUtilsTest {
+class CompatibleTypeUtilsTest {
@SuppressWarnings("unchecked")
@Test
- public void testCompatibleTypeConvert() throws Exception {
+ void testCompatibleTypeConvert() throws Exception {
Object result;
{
@@ -219,4 +219,4 @@ public class CompatibleTypeUtilsTest {
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ConfigUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ConfigUtilsTest.java
index 787b8372ec..b63aa5322e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ConfigUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ConfigUtilsTest.java
@@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class ConfigUtilsTest {
+class ConfigUtilsTest {
private Properties properties;
@BeforeEach
@@ -55,12 +55,12 @@ public class ConfigUtilsTest {
}
@Test
- public void testIsNotEmpty() throws Exception {
+ void testIsNotEmpty() throws Exception {
assertThat(ConfigUtils.isNotEmpty("abc"), is(true));
}
@Test
- public void testIsEmpty() throws Exception {
+ void testIsEmpty() throws Exception {
assertThat(ConfigUtils.isEmpty(null), is(true));
assertThat(ConfigUtils.isEmpty(""), is(true));
assertThat(ConfigUtils.isEmpty("false"), is(true));
@@ -73,7 +73,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testIsDefault() throws Exception {
+ void testIsDefault() throws Exception {
assertThat(ConfigUtils.isDefault("true"), is(true));
assertThat(ConfigUtils.isDefault("TRUE"), is(true));
assertThat(ConfigUtils.isDefault("default"), is(true));
@@ -81,27 +81,27 @@ public class ConfigUtilsTest {
}
@Test
- public void testMergeValues() {
+ void testMergeValues() {
List<String> merged = ConfigUtils.mergeValues(ApplicationModel.defaultModel().getExtensionDirector(), ThreadPool.class, "aaa,bbb,default.custom",
asList("fixed", "default.limited", "cached"));
assertEquals(asList("fixed", "cached", "aaa", "bbb", "default.custom"), merged);
}
@Test
- public void testMergeValuesAddDefault() {
+ void testMergeValuesAddDefault() {
List<String> merged = ConfigUtils.mergeValues(ApplicationModel.defaultModel().getExtensionDirector(), ThreadPool.class, "aaa,bbb,default,zzz",
asList("fixed", "default.limited", "cached"));
assertEquals(asList("aaa", "bbb", "fixed", "cached", "zzz"), merged);
}
@Test
- public void testMergeValuesDeleteDefault() {
+ void testMergeValuesDeleteDefault() {
List<String> merged = ConfigUtils.mergeValues(ApplicationModel.defaultModel().getExtensionDirector(), ThreadPool.class, "-default", asList("fixed", "default.limited", "cached"));
assertEquals(Collections.emptyList(), merged);
}
@Test
- public void testMergeValuesDeleteDefault_2() {
+ void testMergeValuesDeleteDefault_2() {
List<String> merged = ConfigUtils.mergeValues(ApplicationModel.defaultModel().getExtensionDirector(), ThreadPool.class, "-default,aaa", asList("fixed", "default.limited", "cached"));
assertEquals(asList("aaa"), merged);
}
@@ -110,13 +110,13 @@ public class ConfigUtilsTest {
* The user configures -default, which will delete all the default parameters
*/
@Test
- public void testMergeValuesDelete() {
+ void testMergeValuesDelete() {
List<String> merged = ConfigUtils.mergeValues(ApplicationModel.defaultModel().getExtensionDirector(), ThreadPool.class, "-fixed,aaa", asList("fixed", "default.limited", "cached"));
assertEquals(asList("cached", "aaa"), merged);
}
@Test
- public void testReplaceProperty() throws Exception {
+ void testReplaceProperty() throws Exception {
String s = ConfigUtils.replaceProperty("1${a.b.c}2${a.b.c}3", Collections.singletonMap("a.b.c", "ABC"));
assertEquals( "1ABC2ABC3", s);
s = ConfigUtils.replaceProperty("1${a.b.c}2${a.b.c}3", Collections.<String, String>emptyMap());
@@ -124,7 +124,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testReplaceProperty2() {
+ void testReplaceProperty2() {
InmemoryConfiguration configuration1 = new InmemoryConfiguration();
configuration1.getProperties().put("zookeeper.address", "127.0.0.1");
@@ -146,7 +146,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testGetProperties1() throws Exception {
+ void testGetProperties1() throws Exception {
try {
System.setProperty(CommonConstants.DUBBO_PROPERTIES_KEY, "properties.load");
Properties p = ConfigUtils.getProperties(Collections.emptySet());
@@ -159,14 +159,14 @@ public class ConfigUtilsTest {
}
@Test
- public void testGetProperties2() throws Exception {
+ void testGetProperties2() throws Exception {
System.clearProperty(CommonConstants.DUBBO_PROPERTIES_KEY);
Properties p = ConfigUtils.getProperties(Collections.emptySet());
assertThat((String) p.get("dubbo"), equalTo("properties"));
}
@Test
- public void testLoadPropertiesNoFile() throws Exception {
+ void testLoadPropertiesNoFile() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "notExisted", true);
Properties expected = new Properties();
assertEquals(expected, p);
@@ -176,17 +176,17 @@ public class ConfigUtilsTest {
}
@Test
- public void testGetProperty() throws Exception {
+ void testGetProperty() throws Exception {
assertThat(properties.getProperty("dubbo"), equalTo("properties"));
}
@Test
- public void testGetPropertyDefaultValue() throws Exception {
+ void testGetPropertyDefaultValue() throws Exception {
assertThat(properties.getProperty("not-exist", "default"), equalTo("default"));
}
@Test
- public void testGetSystemProperty() throws Exception {
+ void testGetSystemProperty() throws Exception {
try {
System.setProperty("dubbo", "system-only");
assertThat(ConfigUtils.getSystemProperty("dubbo"), equalTo("system-only"));
@@ -196,13 +196,13 @@ public class ConfigUtilsTest {
}
@Test
- public void testLoadProperties() throws Exception {
+ void testLoadProperties() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "dubbo.properties");
assertThat((String)p.get("dubbo"), equalTo("properties"));
}
@Test
- public void testLoadPropertiesOneFile() throws Exception {
+ void testLoadPropertiesOneFile() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "properties.load", false);
Properties expected = new Properties();
@@ -214,7 +214,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testLoadPropertiesOneFileAllowMulti() throws Exception {
+ void testLoadPropertiesOneFileAllowMulti() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "properties.load", true);
Properties expected = new Properties();
@@ -226,7 +226,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testLoadPropertiesOneFileNotRootPath() throws Exception {
+ void testLoadPropertiesOneFileNotRootPath() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "META-INF/dubbo/internal/org.apache.dubbo.common.threadpool.ThreadPool", false);
Properties expected = new Properties();
@@ -241,7 +241,7 @@ public class ConfigUtilsTest {
@Disabled("Not know why disabled, the original link explaining this was reachable.")
@Test
- public void testLoadPropertiesMultiFileNotRootPathException() throws Exception {
+ void testLoadPropertiesMultiFileNotRootPathException() throws Exception {
try {
ConfigUtils.loadProperties(Collections.emptySet(), "META-INF/services/org.apache.dubbo.common.status.StatusChecker", false);
Assertions.fail();
@@ -251,7 +251,7 @@ public class ConfigUtilsTest {
}
@Test
- public void testLoadPropertiesMultiFileNotRootPath() throws Exception {
+ void testLoadPropertiesMultiFileNotRootPath() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "META-INF/dubbo/internal/org.apache.dubbo.common.status.StatusChecker", true);
@@ -264,12 +264,12 @@ public class ConfigUtilsTest {
}
@Test
- public void testGetPid() throws Exception {
+ void testGetPid() throws Exception {
assertThat(ConfigUtils.getPid(), greaterThan(0));
}
@Test
- public void testPropertiesWithStructedValue() throws Exception {
+ void testPropertiesWithStructedValue() throws Exception {
Properties p = ConfigUtils.loadProperties(Collections.emptySet(), "parameters.properties", false);
Properties expected = new Properties();
@@ -279,10 +279,10 @@ public class ConfigUtilsTest {
}
@Test
- public void testLoadMigrationRule() {
+ void testLoadMigrationRule() {
Set<ClassLoader> classLoaderSet = new HashSet<>();
classLoaderSet.add(ClassUtils.getClassLoader());
String rule = ConfigUtils.loadMigrationRule(classLoaderSet, "dubbo-migration.yaml");
Assertions.assertNotNull(rule);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DefaultPageTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DefaultPageTest.java
index 41c0e03ff3..72b30db554 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DefaultPageTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DefaultPageTest.java
@@ -28,10 +28,10 @@ import static java.util.Arrays.asList;
*
* @since 2.7.5
*/
-public class DefaultPageTest {
+class DefaultPageTest {
@Test
- public void test() {
+ void test() {
List<Integer> data = asList(1, 2, 3, 4, 5);
DefaultPage<Integer> page = new DefaultPage<>(0, 1, data.subList(0, 1), data.size());
Assertions.assertEquals(page.getOffset(), 0);
@@ -41,4 +41,4 @@ public class DefaultPageTest {
Assertions.assertEquals(page.getTotalPages(), 5);
Assertions.assertTrue(page.hasNext());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DubboAppenderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DubboAppenderTest.java
index 24cb10539a..4528f9ad7e 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DubboAppenderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/DubboAppenderTest.java
@@ -23,16 +23,17 @@ import org.apache.log4j.spi.LoggingEvent;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.equalTo;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
-public class DubboAppenderTest {
+class DubboAppenderTest {
private LoggingEvent event;
@BeforeEach
@@ -51,7 +52,7 @@ public class DubboAppenderTest {
}
@Test
- public void testAvailable() {
+ void testAvailable() {
assumeFalse(DubboAppender.available);
DubboAppender.doStart();
assertThat(DubboAppender.available, is(true));
@@ -60,7 +61,7 @@ public class DubboAppenderTest {
}
@Test
- public void testAppend() {
+ void testAppend() {
DubboAppender appender = new DubboAppender();
appender.append(event);
assumeTrue(0 == DubboAppender.logList.size());
@@ -71,7 +72,7 @@ public class DubboAppenderTest {
}
@Test
- public void testClear() {
+ void testClear() {
DubboAppender.doStart();
DubboAppender appender = new DubboAppender();
appender.append(event);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ExecutorUtilTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ExecutorUtilTest.java
index 3d0f46540d..c6d3846b17 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ExecutorUtilTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ExecutorUtilTest.java
@@ -35,9 +35,9 @@ import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-public class ExecutorUtilTest {
+class ExecutorUtilTest {
@Test
- public void testIsTerminated() throws Exception {
+ void testIsTerminated() throws Exception {
ExecutorService executor = Mockito.mock(ExecutorService.class);
when(executor.isTerminated()).thenReturn(true);
assertThat(ExecutorUtil.isTerminated(executor), is(true));
@@ -46,7 +46,7 @@ public class ExecutorUtilTest {
}
@Test
- public void testGracefulShutdown1() throws Exception {
+ void testGracefulShutdown1() throws Exception {
ExecutorService executor = Mockito.mock(ExecutorService.class);
when(executor.isTerminated()).thenReturn(false, true);
when(executor.awaitTermination(20, TimeUnit.MILLISECONDS)).thenReturn(false);
@@ -56,7 +56,7 @@ public class ExecutorUtilTest {
}
@Test
- public void testGracefulShutdown2() throws Exception {
+ void testGracefulShutdown2() throws Exception {
ExecutorService executor = Mockito.mock(ExecutorService.class);
when(executor.isTerminated()).thenReturn(false, false, false);
when(executor.awaitTermination(20, TimeUnit.MILLISECONDS)).thenReturn(false);
@@ -68,7 +68,7 @@ public class ExecutorUtilTest {
}
@Test
- public void testShutdownNow() throws Exception {
+ void testShutdownNow() throws Exception {
ExecutorService executor = Mockito.mock(ExecutorService.class);
when(executor.isTerminated()).thenReturn(false, true);
ExecutorUtil.shutdownNow(executor, 20);
@@ -77,9 +77,9 @@ public class ExecutorUtilTest {
}
@Test
- public void testSetThreadName() throws Exception {
+ void testSetThreadName() throws Exception {
URL url = new ServiceConfigURL("dubbo", "localhost", 1234).addParameter(THREAD_NAME_KEY, "custom-thread");
url = ExecutorUtil.setThreadName(url, "default-name");
assertThat(url.getParameter(THREAD_NAME_KEY), equalTo("custom-thread-localhost:1234"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/FieldUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/FieldUtilsTest.java
index e85995a3ac..8266e70521 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/FieldUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/FieldUtilsTest.java
@@ -30,10 +30,10 @@ import static org.junit.jupiter.api.Assertions.assertNull;
*
* @since 2.7.6
*/
-public class FieldUtilsTest {
+class FieldUtilsTest {
@Test
- public void testGetDeclaredField() {
+ void testGetDeclaredField() {
assertEquals("a", getDeclaredField(A.class, "a").getName());
assertEquals("b", getDeclaredField(B.class, "b").getName());
assertEquals("c", getDeclaredField(C.class, "c").getName());
@@ -42,7 +42,7 @@ public class FieldUtilsTest {
}
@Test
- public void testFindField() {
+ void testFindField() {
assertEquals("a", findField(A.class, "a").getName());
assertEquals("a", findField(new A(), "a").getName());
assertEquals("a", findField(B.class, "a").getName());
@@ -53,7 +53,7 @@ public class FieldUtilsTest {
}
@Test
- public void testGetFieldValue() {
+ void testGetFieldValue() {
assertEquals("a", getFieldValue(new A(), "a"));
assertEquals("a", getFieldValue(new B(), "a"));
assertEquals("b", getFieldValue(new B(), "b"));
@@ -63,7 +63,7 @@ public class FieldUtilsTest {
}
@Test
- public void setSetFieldValue() {
+ void setSetFieldValue() {
A a = new A();
assertEquals("a", setFieldValue(a, "a", "x"));
assertEquals("x", getFieldValue(a, "a"));
@@ -85,4 +85,4 @@ class B extends A {
class C extends B {
private String c = "c";
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/HolderTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/HolderTest.java
index 0735ad3c83..d6fc36bcb6 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/HolderTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/HolderTest.java
@@ -22,12 +22,12 @@ import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-public class HolderTest {
+class HolderTest {
@Test
- public void testSetAndGet() throws Exception {
+ void testSetAndGet() throws Exception {
Holder<String> holder = new Holder<String>();
String message = "hello";
holder.set(message);
assertThat(holder.get(), is(message));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/IOUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/IOUtilsTest.java
index 687348cad2..c23d3b2427 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/IOUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/IOUtilsTest.java
@@ -38,7 +38,7 @@ import java.nio.file.Path;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
-public class IOUtilsTest {
+class IOUtilsTest {
private static String TEXT = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
private InputStream is;
@@ -63,32 +63,32 @@ public class IOUtilsTest {
}
@Test
- public void testWrite1() throws Exception {
+ void testWrite1() throws Exception {
assertThat((int) IOUtils.write(is, os, 16), equalTo(TEXT.length()));
}
@Test
- public void testWrite2() throws Exception {
+ void testWrite2() throws Exception {
assertThat((int) IOUtils.write(reader, writer, 16), equalTo(TEXT.length()));
}
@Test
- public void testWrite3() throws Exception {
+ void testWrite3() throws Exception {
assertThat((int) IOUtils.write(writer, TEXT), equalTo(TEXT.length()));
}
@Test
- public void testWrite4() throws Exception {
+ void testWrite4() throws Exception {
assertThat((int) IOUtils.write(is, os), equalTo(TEXT.length()));
}
@Test
- public void testWrite5() throws Exception {
+ void testWrite5() throws Exception {
assertThat((int) IOUtils.write(reader, writer), equalTo(TEXT.length()));
}
@Test
- public void testLines(@TempDir Path tmpDir) throws Exception {
+ void testLines(@TempDir Path tmpDir) throws Exception {
File file = tmpDir.getFileName().toAbsolutePath().toFile();
IOUtils.writeLines(file, new String[]{TEXT});
String[] lines = IOUtils.readLines(file);
@@ -98,26 +98,26 @@ public class IOUtilsTest {
}
@Test
- public void testReadLines() throws Exception {
+ void testReadLines() throws Exception {
String[] lines = IOUtils.readLines(is);
assertThat(lines.length, equalTo(1));
assertThat(lines[0], equalTo(TEXT));
}
@Test
- public void testWriteLines() throws Exception {
+ void testWriteLines() throws Exception {
IOUtils.writeLines(os, new String[]{TEXT});
ByteArrayOutputStream bos = (ByteArrayOutputStream) os;
assertThat(new String(bos.toByteArray()), equalTo(TEXT + System.lineSeparator()));
}
@Test
- public void testRead() throws Exception {
+ void testRead() throws Exception {
assertThat(IOUtils.read(reader), equalTo(TEXT));
}
@Test
- public void testAppendLines(@TempDir Path tmpDir) throws Exception {
+ void testAppendLines(@TempDir Path tmpDir) throws Exception {
File file = tmpDir.getFileName().toAbsolutePath().toFile();
IOUtils.appendLines(file, new String[]{"a", "b", "c"});
String[] lines = IOUtils.readLines(file);
@@ -127,4 +127,4 @@ public class IOUtilsTest {
assertThat(lines[2], equalTo("c"));
tmpDir.getFileName().toAbsolutePath().toFile().delete();
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JVMUtilTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JVMUtilTest.java
index d980c26335..5276dabf70 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JVMUtilTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JVMUtilTest.java
@@ -17,5 +17,5 @@
package org.apache.dubbo.common.utils;
-public class JVMUtilTest {
-}
+class JVMUtilTest {
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
index a04683c8d8..3757082ac8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
@@ -29,9 +29,9 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
-public class JsonUtilsTest {
+class JsonUtilsTest {
@Test
- public void testGetJson1() {
+ void testGetJson1() {
Assertions.assertNotNull(JsonUtils.getJson());
Assertions.assertEquals(JsonUtils.getJson(), JsonUtils.getJson());
@@ -61,7 +61,7 @@ public class JsonUtilsTest {
}
@Test
- public void testGetJson2() {
+ void testGetJson2() {
ClassLoader originClassLoader = Thread.currentThread().getContextClassLoader();
AtomicReference<List<String>> removedPackages = new AtomicReference<>(Collections.emptyList());
ClassLoader newClassLoader = new ClassLoader(originClassLoader) {
@@ -135,4 +135,4 @@ public class JsonUtilsTest {
Thread.currentThread().setContextClassLoader(originClassLoader);
JsonUtils.setJson(null);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LFUCacheTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LFUCacheTest.java
index d7a725089e..abee14aecb 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LFUCacheTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LFUCacheTest.java
@@ -24,10 +24,10 @@ import java.io.IOException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
-public class LFUCacheTest {
+class LFUCacheTest {
@Test
- public void testCacheEviction() throws Exception {
+ void testCacheEviction() throws Exception {
LFUCache<String, Integer> cache = new LFUCache<>(8, 0.8f);
cache.put("one", 1);
cache.put("two", 2);
@@ -48,7 +48,7 @@ public class LFUCacheTest {
}
@Test
- public void testCacheRemove() throws Exception {
+ void testCacheRemove() throws Exception {
LFUCache<String, Integer> cache = new LFUCache<>(8, 0.8f);
cache.put("one", 1);
cache.put("two", 2);
@@ -68,16 +68,16 @@ public class LFUCacheTest {
}
@Test
- public void testDefaultCapacity() throws Exception {
+ void testDefaultCapacity() throws Exception {
LFUCache<String, Integer> cache = new LFUCache<>();
assertThat(cache.getCapacity(), equalTo(1000));
}
@Test
- public void testErrorConstructArguments() throws IOException {
+ void testErrorConstructArguments() throws IOException {
Assertions.assertThrows(IllegalArgumentException.class, () -> new LFUCache<>(0, 0.8f));
Assertions.assertThrows(IllegalArgumentException.class, () -> new LFUCache<>(-1, 0.8f));
Assertions.assertThrows(IllegalArgumentException.class, () -> new LFUCache<>(100, 0.0f));
Assertions.assertThrows(IllegalArgumentException.class, () -> new LFUCache<>(100, -0.1f));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LRU2CacheTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LRU2CacheTest.java
index a616a33633..8dab9afeac 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LRU2CacheTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LRU2CacheTest.java
@@ -24,9 +24,9 @@ import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class LRU2CacheTest {
+class LRU2CacheTest {
@Test
- public void testCache() throws Exception {
+ void testCache() throws Exception {
LRU2Cache<String, Integer> cache = new LRU2Cache<String, Integer>(3);
cache.put("one", 1);
cache.put("two", 2);
@@ -62,10 +62,10 @@ public class LRU2CacheTest {
}
@Test
- public void testCapacity() throws Exception {
+ void testCapacity() throws Exception {
LRU2Cache<String, Integer> cache = new LRU2Cache<String, Integer>();
assertThat(cache.getMaxCapacity(), equalTo(1000));
cache.setMaxCapacity(10);
assertThat(cache.getMaxCapacity(), equalTo(10));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogHelperTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogHelperTest.java
index 5134b95a83..fd8a041b8f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogHelperTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogHelperTest.java
@@ -25,10 +25,10 @@ import org.mockito.Mockito;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-public class LogHelperTest {
+class LogHelperTest {
@Test
- public void testTrace() throws Exception {
+ void testTrace() throws Exception {
Logger logger = Mockito.mock(Logger.class);
when(logger.isTraceEnabled()).thenReturn(true);
LogHelper.trace(logger, "trace");
@@ -41,7 +41,7 @@ public class LogHelperTest {
}
@Test
- public void testDebug() throws Exception {
+ void testDebug() throws Exception {
Logger logger = Mockito.mock(Logger.class);
when(logger.isDebugEnabled()).thenReturn(true);
LogHelper.debug(logger, "debug");
@@ -54,7 +54,7 @@ public class LogHelperTest {
}
@Test
- public void testInfo() throws Exception {
+ void testInfo() throws Exception {
Logger logger = Mockito.mock(Logger.class);
when(logger.isInfoEnabled()).thenReturn(true);
LogHelper.info(logger, "info");
@@ -67,7 +67,7 @@ public class LogHelperTest {
}
@Test
- public void testWarn() throws Exception {
+ void testWarn() throws Exception {
Logger logger = Mockito.mock(Logger.class);
when(logger.isWarnEnabled()).thenReturn(true);
LogHelper.warn(logger, "warn");
@@ -80,7 +80,7 @@ public class LogHelperTest {
}
@Test
- public void testError() throws Exception {
+ void testError() throws Exception {
Logger logger = Mockito.mock(Logger.class);
when(logger.isErrorEnabled()).thenReturn(true);
LogHelper.error(logger, "error");
@@ -91,4 +91,4 @@ public class LogHelperTest {
LogHelper.error(logger, "error", t);
verify(logger).error("error", t);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogTest.java
index 39b60ab849..a357ae6fa8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogTest.java
@@ -25,9 +25,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
-public class LogTest {
+class LogTest {
@Test
- public void testLogName() throws Exception {
+ void testLogName() throws Exception {
Log log1 = new Log();
Log log2 = new Log();
Log log3 = new Log();
@@ -41,7 +41,7 @@ public class LogTest {
}
@Test
- public void testLogLevel() throws Exception {
+ void testLogLevel() throws Exception {
Log log1 = new Log();
Log log2 = new Log();
Log log3 = new Log();
@@ -55,7 +55,7 @@ public class LogTest {
}
@Test
- public void testLogMessage() throws Exception {
+ void testLogMessage() throws Exception {
Log log1 = new Log();
Log log2 = new Log();
Log log3 = new Log();
@@ -69,7 +69,7 @@ public class LogTest {
}
@Test
- public void testLogThread() throws Exception {
+ void testLogThread() throws Exception {
Log log1 = new Log();
Log log2 = new Log();
Log log3 = new Log();
@@ -82,4 +82,4 @@ public class LogTest {
Assertions.assertNotEquals(log1, log3);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogUtilTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogUtilTest.java
index 4793d7bc92..9af6e22fff 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogUtilTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/LogUtilTest.java
@@ -27,14 +27,14 @@ import static org.hamcrest.Matchers.is;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class LogUtilTest {
+class LogUtilTest {
@AfterEach
public void tearDown() throws Exception {
DubboAppender.logList.clear();
}
@Test
- public void testStartStop() throws Exception {
+ void testStartStop() throws Exception {
LogUtil.start();
assertThat(DubboAppender.available, is(true));
LogUtil.stop();
@@ -42,7 +42,7 @@ public class LogUtilTest {
}
@Test
- public void testCheckNoError() throws Exception {
+ void testCheckNoError() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogLevel()).thenReturn(Level.ERROR);
@@ -52,7 +52,7 @@ public class LogUtilTest {
}
@Test
- public void testFindName() throws Exception {
+ void testFindName() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogName()).thenReturn("a");
@@ -60,7 +60,7 @@ public class LogUtilTest {
}
@Test
- public void testFindLevel() throws Exception {
+ void testFindLevel() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogLevel()).thenReturn(Level.ERROR);
@@ -69,7 +69,7 @@ public class LogUtilTest {
}
@Test
- public void testFindLevelWithThreadName() throws Exception {
+ void testFindLevelWithThreadName() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogLevel()).thenReturn(Level.ERROR);
@@ -82,7 +82,7 @@ public class LogUtilTest {
}
@Test
- public void testFindThread() throws Exception {
+ void testFindThread() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogThread()).thenReturn("thread-1");
@@ -90,7 +90,7 @@ public class LogUtilTest {
}
@Test
- public void testFindMessage1() throws Exception {
+ void testFindMessage1() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogMessage()).thenReturn("message");
@@ -98,7 +98,7 @@ public class LogUtilTest {
}
@Test
- public void testFindMessage2() throws Exception {
+ void testFindMessage2() throws Exception {
Log log = mock(Log.class);
DubboAppender.logList.add(log);
when(log.getLogMessage()).thenReturn("message");
@@ -110,4 +110,4 @@ public class LogUtilTest {
assertThat(LogUtil.findMessage(Level.ERROR, "message"), equalTo(1));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MD5UtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MD5UtilsTest.java
index 4a5ca05709..d5a0a46d0d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MD5UtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MD5UtilsTest.java
@@ -27,10 +27,10 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
-public class MD5UtilsTest {
+class MD5UtilsTest {
@Test
- public void test() {
+ void test() {
MD5Utils sharedMd5Utils = new MD5Utils();
final String[] input = {"provider-appgroup-one/org.apache.dubbo.config.spring.api.HelloService:dubboorg.apache.dubbo.config.spring.api.HelloService{REGISTRY_CLUSTER=registry-one, anyhost=true, application=provider-app, background=false, compiler=javassist, deprecated=false, dubbo=2.0.2, dynamic=true, file.cache=false, generic=false, group=group-one, interface=org.apache.dubbo.config.spring.api.HelloService, logger=slf4j, metadata-type=remote, methods=sayHello, organization=test, [...]
"provider-appgroup-two/org.apache.dubbo.config.spring.api.DemoService:dubboorg.apache.dubbo.config.spring.api.DemoService{REGISTRY_CLUSTER=registry-two, anyhost=true, application=provider-app, background=false, compiler=javassist, deprecated=false, dubbo=2.0.2, dynamic=true, file.cache=false, generic=false, group=group-two, interface=org.apache.dubbo.config.spring.api.DemoService, logger=slf4j, metadata-type=remote, methods=sayName,getBox, organization=test, owner=com.test, r [...]
@@ -92,4 +92,4 @@ public class MD5UtilsTest {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MemberUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MemberUtilsTest.java
index a5a78cc765..c1f322fc80 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MemberUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MemberUtilsTest.java
@@ -29,17 +29,21 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.6
*/
-public class MemberUtilsTest {
+class MemberUtilsTest {
@Test
- public void testIsStatic() throws NoSuchMethodException {
+ void test() throws NoSuchMethodException {
- assertFalse(isStatic(getClass().getMethod("testIsStatic")));
+ assertFalse(isStatic(getClass().getMethod("noStatic")));
assertTrue(isStatic(getClass().getMethod("staticMethod")));
assertTrue(isPrivate(getClass().getDeclaredMethod("privateMethod")));
assertTrue(isPublic(getClass().getMethod("publicMethod")));
}
+ public void noStatic() throws NoSuchMethodException {
+
+ }
+
public static void staticMethod() {
}
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MethodUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MethodUtilsTest.java
index c174b6899b..b986c3d662 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MethodUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/MethodUtilsTest.java
@@ -32,10 +32,10 @@ import static org.apache.dubbo.common.utils.MethodUtils.getMethods;
import static org.apache.dubbo.common.utils.MethodUtils.invokeMethod;
import static org.apache.dubbo.common.utils.MethodUtils.overrides;
-public class MethodUtilsTest {
+class MethodUtilsTest {
@Test
- public void testGetMethod() {
+ void testGetMethod() {
Method getMethod = null;
for (Method method : MethodTestClazz.class.getMethods()) {
if (MethodUtils.isGetter(method)) {
@@ -47,7 +47,7 @@ public class MethodUtilsTest {
}
@Test
- public void testSetMethod() {
+ void testSetMethod() {
Method setMethod = null;
for (Method method : MethodTestClazz.class.getMethods()) {
if (MethodUtils.isSetter(method)) {
@@ -59,13 +59,13 @@ public class MethodUtilsTest {
}
@Test
- public void testIsDeprecated() throws Exception {
+ void testIsDeprecated() throws Exception {
Assertions.assertTrue(MethodUtils.isDeprecated(MethodTestClazz.class.getMethod("deprecatedMethod")));
Assertions.assertFalse(MethodUtils.isDeprecated(MethodTestClazz.class.getMethod("getValue")));
}
@Test
- public void testIsMetaMethod() {
+ void testIsMetaMethod() {
boolean containMetaMethod = false;
for (Method method : MethodTestClazz.class.getMethods()) {
if (MethodUtils.isMetaMethod(method)) {
@@ -76,7 +76,7 @@ public class MethodUtilsTest {
}
@Test
- public void testGetMethods() throws NoSuchMethodException {
+ void testGetMethods() throws NoSuchMethodException {
Assertions.assertTrue(getDeclaredMethods(MethodTestClazz.class, excludedDeclaredClass(String.class)).size() > 0);
Assertions.assertTrue(getMethods(MethodTestClazz.class).size() > 0);
Assertions.assertTrue(getAllDeclaredMethods(MethodTestClazz.class).size() > 0);
@@ -97,7 +97,7 @@ public class MethodUtilsTest {
}
@Test
- public void testExtractFieldName() throws Exception {
+ void testExtractFieldName() throws Exception {
Method m1 = MethodFieldTestClazz.class.getMethod("is");
Method m2 = MethodFieldTestClazz.class.getMethod("get");
Method m3 = MethodFieldTestClazz.class.getMethod("getClass");
@@ -170,4 +170,4 @@ public class MethodUtilsTest {
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NamedThreadFactoryTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NamedThreadFactoryTest.java
index c28b701a77..a2dc5a84c9 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NamedThreadFactoryTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NamedThreadFactoryTest.java
@@ -27,9 +27,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class NamedThreadFactoryTest {
+class NamedThreadFactoryTest {
@Test
- public void testNewThread() throws Exception {
+ void testNewThread() throws Exception {
NamedThreadFactory factory = new NamedThreadFactory();
Thread t = factory.newThread(Mockito.mock(Runnable.class));
assertThat(t.getName(), allOf(containsString("pool-"), containsString("-thread-")));
@@ -39,10 +39,10 @@ public class NamedThreadFactoryTest {
}
@Test
- public void testPrefixAndDaemon() throws Exception {
+ void testPrefixAndDaemon() throws Exception {
NamedThreadFactory factory = new NamedThreadFactory("prefix", true);
Thread t = factory.newThread(Mockito.mock(Runnable.class));
assertThat(t.getName(), allOf(containsString("prefix-"), containsString("-thread-")));
assertTrue(t.isDaemon());
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsInterfaceDisplayNameHasMetaCharactersTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsInterfaceDisplayNameHasMetaCharactersTest.java
index 19200270ec..4e835745ae 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsInterfaceDisplayNameHasMetaCharactersTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsInterfaceDisplayNameHasMetaCharactersTest.java
@@ -28,13 +28,13 @@ import java.util.NoSuchElementException;
import static org.apache.dubbo.common.constants.CommonConstants.DUBBO_NETWORK_IGNORED_INTERFACE;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class NetUtilsInterfaceDisplayNameHasMetaCharactersTest {
+class NetUtilsInterfaceDisplayNameHasMetaCharactersTest {
private static final String IGNORED_DISPLAY_NAME_HAS_METACHARACTERS = "Mock(R) ^$*+[?].|-[0-9] Adapter";
private static final String SELECTED_DISPLAY_NAME = "Selected Adapter";
private static final String SELECTED_HOST_ADDR = "192.168.0.1";
@Test
- public void testIgnoreGivenInterfaceNameWithMetaCharacters() throws Exception {
+ void testIgnoreGivenInterfaceNameWithMetaCharacters() throws Exception {
String originIgnoredInterfaces = this.getIgnoredInterfaces();
// mock static methods of final class NetworkInterface
try (MockedStatic<NetworkInterface> mockedStaticNetif = Mockito.mockStatic(NetworkInterface.class)) {
@@ -110,4 +110,4 @@ public class NetUtilsInterfaceDisplayNameHasMetaCharactersTest {
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsTest.java
index 79f01df758..accdb9afc8 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/NetUtilsTest.java
@@ -398,4 +398,4 @@ class NetUtilsTest {
System.setProperty(DUBBO_NETWORK_IGNORED_INTERFACE, "");
}
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
index 52a1f03c64..21cc63950b 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ParametersTest.java
@@ -21,7 +21,7 @@ import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
-public class ParametersTest {
+class ParametersTest {
final String ServiceName = "org.apache.dubbo.rpc.service.GenericService";
final String ServiceVersion = "1.0.15";
final String LoadBalance = "lcr";
@@ -44,4 +44,4 @@ public class ParametersTest {
assertEquals(map.get("version"), ServiceVersion);
assertEquals(map.get("lb"), LoadBalance);
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/PojoUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/PojoUtilsTest.java
index 6a0f1ef69e..e4b8b15c9c 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/PojoUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/PojoUtilsTest.java
@@ -114,7 +114,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_primitive() throws Exception {
+ void test_primitive() throws Exception {
assertObject(Boolean.TRUE);
assertObject(Boolean.FALSE);
@@ -134,19 +134,19 @@ public class PojoUtilsTest {
}
@Test
- public void test_pojo() throws Exception {
+ void test_pojo() throws Exception {
assertObject(new Person());
assertObject(new BasicTestData(false, '\0', (byte) 0, (short) 0, 0, 0L, 0F, 0D));
assertObject(new SerializablePerson(Character.MIN_VALUE, false));
}
@Test
- public void test_has_no_nullary_constructor_pojo() {
+ void test_has_no_nullary_constructor_pojo() {
assertObject(new User(1, "fibbery"));
}
@Test
- public void test_Map_List_pojo() throws Exception {
+ void test_Map_List_pojo() throws Exception {
Map<String, List<Object>> map = new HashMap<String, List<Object>>();
List<Object> list = new ArrayList<Object>();
@@ -161,7 +161,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_PrimitiveArray() throws Exception {
+ void test_PrimitiveArray() throws Exception {
assertObject(new boolean[]{true, false});
assertObject(new Boolean[]{true, false, true});
@@ -210,7 +210,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_PojoArray() throws Exception {
+ void test_PojoArray() throws Exception {
Person[] array = new Person[2];
array[0] = new Person();
{
@@ -222,7 +222,7 @@ public class PojoUtilsTest {
}
@Test
- public void testArrayToCollection() throws Exception {
+ void testArrayToCollection() throws Exception {
Person[] array = new Person[2];
Person person1 = new Person();
person1.setName("person1");
@@ -237,7 +237,7 @@ public class PojoUtilsTest {
}
@Test
- public void testCollectionToArray() throws Exception {
+ void testCollectionToArray() throws Exception {
Person person1 = new Person();
person1.setName("person1");
Person person2 = new Person();
@@ -252,7 +252,7 @@ public class PojoUtilsTest {
}
@Test
- public void testMapToEnum() throws Exception {
+ void testMapToEnum() throws Exception {
Map map = new HashMap();
map.put("name", "MONDAY");
Object o = PojoUtils.realize(map, Day.class);
@@ -260,7 +260,7 @@ public class PojoUtilsTest {
}
@Test
- public void testGeneralizeEnumArray() throws Exception {
+ void testGeneralizeEnumArray() throws Exception {
Object days = new Enum[]{Day.FRIDAY, Day.SATURDAY};
Object o = PojoUtils.generalize(days);
assertTrue(o instanceof String[]);
@@ -269,7 +269,7 @@ public class PojoUtilsTest {
}
@Test
- public void testGeneralizePersons() throws Exception {
+ void testGeneralizePersons() throws Exception {
Object persons = new Person[]{new Person(), new Person()};
Object o = PojoUtils.generalize(persons);
assertTrue(o instanceof Object[]);
@@ -277,7 +277,7 @@ public class PojoUtilsTest {
}
@Test
- public void testMapToInterface() throws Exception {
+ void testMapToInterface() throws Exception {
Map map = new HashMap();
map.put("content", "greeting");
map.put("from", "dubbo");
@@ -290,7 +290,7 @@ public class PojoUtilsTest {
}
@Test
- public void testJsonObjectToMap() throws Exception {
+ void testJsonObjectToMap() throws Exception {
Method method = PojoUtilsTest.class.getMethod("setMap", Map.class);
assertNotNull(method);
JSONObject jsonObject = new JSONObject();
@@ -304,7 +304,7 @@ public class PojoUtilsTest {
}
@Test
- public void testListJsonObjectToListMap() throws Exception {
+ void testListJsonObjectToListMap() throws Exception {
Method method = PojoUtilsTest.class.getMethod("setListMap", List.class);
assertNotNull(method);
JSONObject jsonObject = new JSONObject();
@@ -327,7 +327,7 @@ public class PojoUtilsTest {
}
@Test
- public void testException() throws Exception {
+ void testException() throws Exception {
Map map = new HashMap();
map.put("message", "dubbo exception");
Object o = PojoUtils.realize(map, RuntimeException.class);
@@ -335,7 +335,7 @@ public class PojoUtilsTest {
}
@Test
- public void testIsPojo() throws Exception {
+ void testIsPojo() throws Exception {
assertFalse(PojoUtils.isPojo(boolean.class));
assertFalse(PojoUtils.isPojo(Map.class));
assertFalse(PojoUtils.isPojo(List.class));
@@ -362,7 +362,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_simpleCollection() throws Exception {
+ void test_simpleCollection() throws Exception {
Type gtype = getType("returnListPersonMethod");
List<Person> list = new ArrayList<Person>();
list.add(new Person());
@@ -375,7 +375,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_total() throws Exception {
+ void test_total() throws Exception {
Object generalize = PojoUtils.generalize(bigPerson);
Type gtype = getType("returnBigPersonMethod");
Object realize = PojoUtils.realize(generalize, BigPerson.class, gtype);
@@ -383,7 +383,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_total_Array() throws Exception {
+ void test_total_Array() throws Exception {
Object[] persons = new Object[]{bigPerson, bigPerson, bigPerson};
Object generalize = PojoUtils.generalize(persons);
@@ -392,7 +392,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_Loop_pojo() throws Exception {
+ void test_Loop_pojo() throws Exception {
Parent p = new Parent();
p.setAge(10);
p.setName("jerry");
@@ -414,7 +414,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_Loop_Map() throws Exception {
+ void test_Loop_Map() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("k", "v");
@@ -432,7 +432,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_LoopPojoInMap() throws Exception {
+ void test_LoopPojoInMap() throws Exception {
Parent p = new Parent();
p.setAge(10);
p.setName("jerry");
@@ -460,7 +460,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_LoopPojoInList() throws Exception {
+ void test_LoopPojoInList() throws Exception {
Parent p = new Parent();
p.setAge(10);
p.setName("jerry");
@@ -491,7 +491,7 @@ public class PojoUtilsTest {
}
@Test
- public void test_PojoInList() throws Exception {
+ void test_PojoInList() throws Exception {
Parent p = new Parent();
p.setAge(10);
p.setName("jerry");
@@ -525,7 +525,7 @@ public class PojoUtilsTest {
// java.lang.IllegalArgumentException: argument type mismatch
@Test
- public void test_realize_LongPararmter_IllegalArgumentException() throws Exception {
+ void test_realize_LongPararmter_IllegalArgumentException() throws Exception {
Method method = PojoUtilsTest.class.getMethod("setLong", long.class);
assertNotNull(method);
@@ -536,7 +536,7 @@ public class PojoUtilsTest {
// java.lang.IllegalArgumentException: argument type mismatch
@Test
- public void test_realize_IntPararmter_IllegalArgumentException() throws Exception {
+ void test_realize_IntPararmter_IllegalArgumentException() throws Exception {
Method method = PojoUtilsTest.class.getMethod("setInt", int.class);
assertNotNull(method);
@@ -546,7 +546,7 @@ public class PojoUtilsTest {
}
@Test
- public void testStackOverflow() throws Exception {
+ void testStackOverflow() throws Exception {
Parent parent = Parent.getNewParent();
parent.setAge(Integer.MAX_VALUE);
String name = UUID.randomUUID().toString();
@@ -563,7 +563,7 @@ public class PojoUtilsTest {
}
@Test
- public void testGenerializeAndRealizeClass() throws Exception {
+ void testGenerializeAndRealizeClass() throws Exception {
Object generalize = PojoUtils.generalize(Integer.class);
assertEquals(Integer.class.getName(), generalize);
Object real = PojoUtils.realize(generalize, Integer.class.getClass());
@@ -576,7 +576,7 @@ public class PojoUtilsTest {
}
@Test
- public void testPublicField() throws Exception {
+ void testPublicField() throws Exception {
Parent parent = new Parent();
parent.gender = "female";
parent.email = "email@host.com";
@@ -596,7 +596,7 @@ public class PojoUtilsTest {
}
@Test
- public void testMapField() throws Exception {
+ void testMapField() throws Exception {
TestData data = new TestData();
Child child = newChild("first", 1);
data.addChild(child);
@@ -629,7 +629,7 @@ public class PojoUtilsTest {
}
@Test
- public void testRealize() throws Exception {
+ void testRealize() throws Exception {
Map<String, String> map = new LinkedHashMap<String, String>();
map.put("key", "value");
Object obj = PojoUtils.generalize(map);
@@ -642,7 +642,7 @@ public class PojoUtilsTest {
}
@Test
- public void testRealizeLinkedList() throws Exception {
+ void testRealizeLinkedList() throws Exception {
LinkedList<Person> input = new LinkedList<Person>();
Person person = new Person();
person.setAge(37);
@@ -655,7 +655,7 @@ public class PojoUtilsTest {
}
@Test
- public void testPojoList() throws Exception {
+ void testPojoList() throws Exception {
ListResult<Parent> result = new ListResult<Parent>();
List<Parent> list = new ArrayList<Parent>();
Parent parent = new Parent();
@@ -677,7 +677,7 @@ public class PojoUtilsTest {
}
@Test
- public void testListPojoListPojo() throws Exception {
+ void testListPojoListPojo() throws Exception {
InnerPojo<Parent> parentList = new InnerPojo<Parent>();
Parent parent = new Parent();
parent.setName("zhangsan");
@@ -704,7 +704,7 @@ public class PojoUtilsTest {
}
@Test
- public void testDateTimeTimestamp() throws Exception {
+ void testDateTimeTimestamp() throws Exception {
String dateStr = "2018-09-12";
String timeStr = "10:12:33";
String dateTimeStr = "2018-09-12 10:12:33";
@@ -732,7 +732,7 @@ public class PojoUtilsTest {
}
@Test
- public void testIntToBoolean() throws Exception {
+ void testIntToBoolean() throws Exception {
Map<String, Object> map = new HashMap<>();
map.put("name", "myname");
map.put("male", 1);
@@ -746,7 +746,7 @@ public class PojoUtilsTest {
}
@Test
- public void testRealizeCollectionWithNullElement() {
+ void testRealizeCollectionWithNullElement() {
LinkedList<String> listStr = new LinkedList<>();
listStr.add("arrayValue");
listStr.add(null);
@@ -764,7 +764,7 @@ public class PojoUtilsTest {
}
@Test
- public void testJava8Time() {
+ void testJava8Time() {
Object localDateTimeGen = PojoUtils.generalize(LocalDateTime.now());
Object localDateTime = PojoUtils.realize(localDateTimeGen, LocalDateTime.class);
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ReflectUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ReflectUtilsTest.java
index e6a31e63cc..2b2022e852 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ReflectUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ReflectUtilsTest.java
@@ -44,16 +44,16 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
-public class ReflectUtilsTest {
+class ReflectUtilsTest {
@Test
- public void testIsPrimitives() throws Exception {
+ void testIsPrimitives() throws Exception {
assertTrue(ReflectUtils.isPrimitives(boolean[].class));
assertTrue(ReflectUtils.isPrimitives(byte.class));
assertFalse(ReflectUtils.isPrimitive(Map[].class));
}
@Test
- public void testIsPrimitive() throws Exception {
+ void testIsPrimitive() throws Exception {
assertTrue(ReflectUtils.isPrimitive(boolean.class));
assertTrue(ReflectUtils.isPrimitive(String.class));
assertTrue(ReflectUtils.isPrimitive(Boolean.class));
@@ -64,7 +64,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetBoxedClass() throws Exception {
+ void testGetBoxedClass() throws Exception {
assertThat(ReflectUtils.getBoxedClass(int.class), sameInstance(Integer.class));
assertThat(ReflectUtils.getBoxedClass(boolean.class), sameInstance(Boolean.class));
assertThat(ReflectUtils.getBoxedClass(long.class), sameInstance(Long.class));
@@ -77,7 +77,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testIsCompatible() throws Exception {
+ void testIsCompatible() throws Exception {
assertTrue(ReflectUtils.isCompatible(short.class, (short) 1));
assertTrue(ReflectUtils.isCompatible(int.class, 1));
assertTrue(ReflectUtils.isCompatible(double.class, 1.2));
@@ -86,21 +86,21 @@ public class ReflectUtilsTest {
}
@Test
- public void testIsCompatibleWithArray() throws Exception {
+ void testIsCompatibleWithArray() throws Exception {
assertFalse(ReflectUtils.isCompatible(new Class[]{short.class, int.class}, new Object[]{(short) 1}));
assertFalse(ReflectUtils.isCompatible(new Class[]{double.class}, new Object[]{"hello"}));
assertTrue(ReflectUtils.isCompatible(new Class[]{double.class}, new Object[]{1.2}));
}
@Test
- public void testGetCodeBase() throws Exception {
+ void testGetCodeBase() throws Exception {
assertNull(ReflectUtils.getCodeBase(null));
assertNull(ReflectUtils.getCodeBase(String.class));
assertNotNull(ReflectUtils.getCodeBase(ReflectUtils.class));
}
@Test
- public void testGetName() throws Exception {
+ void testGetName() throws Exception {
// getName
assertEquals("boolean", ReflectUtils.getName(boolean.class));
assertEquals("int[][][]", ReflectUtils.getName(int[][][].class));
@@ -131,12 +131,12 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetGenericClass() throws Exception {
+ void testGetGenericClass() throws Exception {
assertThat(ReflectUtils.getGenericClass(Foo1.class), sameInstance(String.class));
}
@Test
- public void testGetGenericClassWithIndex() throws Exception {
+ void testGetGenericClassWithIndex() throws Exception {
assertThat(ReflectUtils.getGenericClass(Foo1.class, 0), sameInstance(String.class));
assertThat(ReflectUtils.getGenericClass(Foo1.class, 1), sameInstance(Integer.class));
assertThat(ReflectUtils.getGenericClass(Foo2.class, 0), sameInstance(List.class));
@@ -146,25 +146,25 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetMethodName() throws Exception {
+ void testGetMethodName() throws Exception {
assertThat(ReflectUtils.getName(Foo2.class.getDeclaredMethod("hello", int[].class)),
equalTo("java.util.List hello(int[])"));
}
@Test
- public void testGetSignature() throws Exception {
+ void testGetSignature() throws Exception {
Method m = Foo2.class.getDeclaredMethod("hello", int[].class);
assertThat(ReflectUtils.getSignature("greeting", m.getParameterTypes()), equalTo("greeting([I)"));
}
@Test
- public void testGetConstructorName() throws Exception {
+ void testGetConstructorName() throws Exception {
Constructor c = Foo2.class.getConstructors()[0];
assertThat(ReflectUtils.getName(c), equalTo("(java.util.List,int[])"));
}
@Test
- public void testName2Class() throws Exception {
+ void testName2Class() throws Exception {
assertEquals(boolean.class, ReflectUtils.name2class("boolean"));
assertEquals(boolean[].class, ReflectUtils.name2class("boolean[]"));
assertEquals(int[][].class, ReflectUtils.name2class(ReflectUtils.getName(int[][].class)));
@@ -172,29 +172,29 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetDescMethod() throws Exception {
+ void testGetDescMethod() throws Exception {
assertThat(ReflectUtils.getDesc(Foo2.class.getDeclaredMethod("hello", int[].class)),
equalTo("hello([I)Ljava/util/List;"));
}
@Test
- public void testGetDescConstructor() throws Exception {
+ void testGetDescConstructor() throws Exception {
assertThat(ReflectUtils.getDesc(Foo2.class.getConstructors()[0]), equalTo("(Ljava/util/List;[I)V"));
}
@Test
- public void testGetDescWithoutMethodName() throws Exception {
+ void testGetDescWithoutMethodName() throws Exception {
assertThat(ReflectUtils.getDescWithoutMethodName(Foo2.class.getDeclaredMethod("hello", int[].class)),
equalTo("([I)Ljava/util/List;"));
}
@Test
- public void testFindMethodByMethodName1() throws Exception {
+ void testFindMethodByMethodName1() throws Exception {
assertNotNull(ReflectUtils.findMethodByMethodName(Foo.class, "hello"));
}
@Test
- public void testFindMethodByMethodName2() {
+ void testFindMethodByMethodName2() {
Assertions.assertThrows(IllegalStateException.class, () -> {
ReflectUtils.findMethodByMethodName(Foo2.class, "hello");
});
@@ -202,18 +202,18 @@ public class ReflectUtilsTest {
}
@Test
- public void testFindConstructor() throws Exception {
+ void testFindConstructor() throws Exception {
Constructor constructor = ReflectUtils.findConstructor(Foo3.class, Foo2.class);
assertNotNull(constructor);
}
@Test
- public void testIsInstance() throws Exception {
+ void testIsInstance() throws Exception {
assertTrue(ReflectUtils.isInstance(new Foo1(), Foo.class.getName()));
}
@Test
- public void testIsBeanPropertyReadMethod() throws Exception {
+ void testIsBeanPropertyReadMethod() throws Exception {
Method method = EmptyClass.class.getMethod("getProperty");
assertTrue(ReflectUtils.isBeanPropertyReadMethod(method));
method = EmptyClass.class.getMethod("getProperties");
@@ -225,7 +225,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetPropertyNameFromBeanReadMethod() throws Exception {
+ void testGetPropertyNameFromBeanReadMethod() throws Exception {
Method method = EmptyClass.class.getMethod("getProperty");
assertEquals(ReflectUtils.getPropertyNameFromBeanReadMethod(method), "property");
method = EmptyClass.class.getMethod("isSet");
@@ -233,7 +233,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testIsBeanPropertyWriteMethod() throws Exception {
+ void testIsBeanPropertyWriteMethod() throws Exception {
Method method = EmptyClass.class.getMethod("setProperty", EmptyProperty.class);
assertTrue(ReflectUtils.isBeanPropertyWriteMethod(method));
method = EmptyClass.class.getMethod("setSet", boolean.class);
@@ -241,13 +241,13 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetPropertyNameFromBeanWriteMethod() throws Exception {
+ void testGetPropertyNameFromBeanWriteMethod() throws Exception {
Method method = EmptyClass.class.getMethod("setProperty", EmptyProperty.class);
assertEquals(ReflectUtils.getPropertyNameFromBeanWriteMethod(method), "property");
}
@Test
- public void testIsPublicInstanceField() throws Exception {
+ void testIsPublicInstanceField() throws Exception {
Field field = EmptyClass.class.getDeclaredField("set");
assertTrue(ReflectUtils.isPublicInstanceField(field));
field = EmptyClass.class.getDeclaredField("property");
@@ -255,7 +255,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetBeanPropertyFields() throws Exception {
+ void testGetBeanPropertyFields() throws Exception {
Map<String, Field> map = ReflectUtils.getBeanPropertyFields(EmptyClass.class);
assertThat(map.size(), is(2));
assertThat(map, hasKey("set"));
@@ -268,7 +268,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetBeanPropertyReadMethods() throws Exception {
+ void testGetBeanPropertyReadMethods() throws Exception {
Map<String, Method> map = ReflectUtils.getBeanPropertyReadMethods(EmptyClass.class);
assertThat(map.size(), is(2));
assertThat(map, hasKey("set"));
@@ -281,7 +281,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testDesc2Class() throws Exception {
+ void testDesc2Class() throws Exception {
assertEquals(void.class, ReflectUtils.desc2class("V"));
assertEquals(boolean.class, ReflectUtils.desc2class("Z"));
assertEquals(boolean[].class, ReflectUtils.desc2class("[Z"));
@@ -319,7 +319,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testFindMethodByMethodSignature() throws Exception {
+ void testFindMethodByMethodSignature() throws Exception {
Method m = ReflectUtils.findMethodByMethodSignature(TestedClass.class, "method1", null);
assertEquals("method1", m.getName());
@@ -329,7 +329,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testFindMethodByMethodSignature_override() throws Exception {
+ void testFindMethodByMethodSignature_override() throws Exception {
{
Method m = ReflectUtils.findMethodByMethodSignature(TestedClass.class,
"overrideMethod", new String[]{"int"});
@@ -351,7 +351,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testFindMethodByMethodSignatureOverrideMoreThan1() throws Exception {
+ void testFindMethodByMethodSignatureOverrideMoreThan1() throws Exception {
try {
ReflectUtils.findMethodByMethodSignature(TestedClass.class, "overrideMethod", null);
fail();
@@ -361,7 +361,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testFindMethodByMethodSignatureNotFound() throws Exception {
+ void testFindMethodByMethodSignatureNotFound() throws Exception {
try {
ReflectUtils.findMethodByMethodSignature(TestedClass.class, "notExsited", null);
fail();
@@ -372,7 +372,7 @@ public class ReflectUtilsTest {
}
@Test
- public void testGetEmptyObject() throws Exception {
+ void testGetEmptyObject() throws Exception {
assertTrue(ReflectUtils.getEmptyObject(Collection.class) instanceof Collection);
assertTrue(ReflectUtils.getEmptyObject(List.class) instanceof List);
assertTrue(ReflectUtils.getEmptyObject(Set.class) instanceof Set);
@@ -393,19 +393,19 @@ public class ReflectUtilsTest {
}
@Test
- public void testForName1() throws Exception {
+ void testForName1() throws Exception {
assertThat(ReflectUtils.forName(ReflectUtils.class.getName()), sameInstance(ReflectUtils.class));
}
@Test
- public void testForName2() {
+ void testForName2() {
Assertions.assertThrows(IllegalStateException.class, () -> {
ReflectUtils.forName("a.c.d.e.F");
});
}
@Test
- public void testGetReturnTypes () throws Exception{
+ void testGetReturnTypes () throws Exception{
Class clazz = TypeClass.class;
Type[] types = ReflectUtils.getReturnTypes(clazz.getMethod("getFuture"));
@@ -544,4 +544,4 @@ public class ReflectUtilsTest {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/RegexPropertiesTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/RegexPropertiesTest.java
index 395b032b22..8afcb0dff1 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/RegexPropertiesTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/RegexPropertiesTest.java
@@ -19,9 +19,9 @@ package org.apache.dubbo.common.utils;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class RegexPropertiesTest {
+class RegexPropertiesTest {
@Test
- public void testGetProperty(){
+ void testGetProperty(){
RegexProperties regexProperties = new RegexProperties();
regexProperties.setProperty("org.apache.dubbo.provider.*", "http://localhost:20880");
regexProperties.setProperty("org.apache.dubbo.provider.config.*", "http://localhost:30880");
@@ -35,4 +35,4 @@ public class RegexPropertiesTest {
Assertions.assertEquals("http://localhost:50880", regexProperties.getProperty("org.apache.dubbo.consumer.service.demo"));
Assertions.assertEquals("http://localhost:60880", regexProperties.getProperty("org.apache.dubbo.service"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/SerializeClassCheckerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/SerializeClassCheckerTest.java
index b637923d28..0ffd6546c3 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/SerializeClassCheckerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/SerializeClassCheckerTest.java
@@ -19,9 +19,9 @@ package org.apache.dubbo.common.utils;
import org.apache.dubbo.common.constants.CommonConstants;
import javassist.compiler.Javac;
+import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import java.net.Socket;
@@ -29,7 +29,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
-public class SerializeClassCheckerTest {
+class SerializeClassCheckerTest {
@BeforeEach
public void setUp() {
@@ -42,7 +42,7 @@ public class SerializeClassCheckerTest {
}
@Test
- public void testCommon() {
+ void testCommon() {
SerializeClassChecker serializeClassChecker = SerializeClassChecker.getInstance();
for (int i = 0; i < 10; i++) {
@@ -63,7 +63,7 @@ public class SerializeClassCheckerTest {
}
@Test
- public void testAddAllow() {
+ void testAddAllow() {
System.setProperty(CommonConstants.CLASS_DESERIALIZE_ALLOWED_LIST, Socket.class.getName() + "," + Javac.class.getName());
SerializeClassChecker serializeClassChecker = SerializeClassChecker.getInstance();
@@ -76,7 +76,7 @@ public class SerializeClassCheckerTest {
}
@Test
- public void testAddBlock() {
+ void testAddBlock() {
System.setProperty(CommonConstants.CLASS_DESERIALIZE_BLOCKED_LIST, LinkedList.class.getName() + "," + Integer.class.getName());
SerializeClassChecker serializeClassChecker = SerializeClassChecker.getInstance();
@@ -93,7 +93,7 @@ public class SerializeClassCheckerTest {
}
@Test
- public void testBlockAll() {
+ void testBlockAll() {
System.setProperty(CommonConstants.CLASS_DESERIALIZE_BLOCK_ALL, "true");
System.setProperty(CommonConstants.CLASS_DESERIALIZE_ALLOWED_LIST, LinkedList.class.getName());
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StackTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StackTest.java
index a51bc783e0..80d4109952 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StackTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StackTest.java
@@ -26,9 +26,9 @@ import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
-public class StackTest {
+class StackTest {
@Test
- public void testOps() throws Exception {
+ void testOps() throws Exception {
Stack<String> stack = new Stack<String>();
stack.push("one");
assertThat(stack.get(0), equalTo("one"));
@@ -49,7 +49,7 @@ public class StackTest {
}
@Test
- public void testClear() throws Exception {
+ void testClear() throws Exception {
Stack<String> stack = new Stack<String>();
stack.push("one");
stack.push("two");
@@ -59,7 +59,7 @@ public class StackTest {
}
@Test
- public void testIllegalPop() throws Exception {
+ void testIllegalPop() throws Exception {
Assertions.assertThrows(EmptyStackException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.pop();
@@ -67,7 +67,7 @@ public class StackTest {
}
@Test
- public void testIllegalPeek() throws Exception {
+ void testIllegalPeek() throws Exception {
Assertions.assertThrows(EmptyStackException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.peek();
@@ -75,7 +75,7 @@ public class StackTest {
}
@Test
- public void testIllegalGet() throws Exception {
+ void testIllegalGet() throws Exception {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.get(1);
@@ -83,7 +83,7 @@ public class StackTest {
}
@Test
- public void testIllegalGetNegative() throws Exception {
+ void testIllegalGetNegative() throws Exception {
Stack<String> stack = new Stack<String>();
stack.push("one");
stack.get(-1);
@@ -94,7 +94,7 @@ public class StackTest {
}
@Test
- public void testIllegalSet() throws Exception {
+ void testIllegalSet() throws Exception {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.set(1, "illegal");
@@ -102,7 +102,7 @@ public class StackTest {
}
@Test
- public void testIllegalSetNegative() throws Exception {
+ void testIllegalSetNegative() throws Exception {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.set(-1, "illegal");
@@ -110,7 +110,7 @@ public class StackTest {
}
@Test
- public void testIllegalRemove() throws Exception {
+ void testIllegalRemove() throws Exception {
Assertions.assertThrows(IndexOutOfBoundsException.class, () -> {
Stack<String> stack = new Stack<String>();
stack.remove(1);
@@ -118,7 +118,7 @@ public class StackTest {
}
@Test
- public void testIllegalRemoveNegative() throws Exception {
+ void testIllegalRemoveNegative() throws Exception {
Stack<String> stack = new Stack<String>();
stack.push("one");
@@ -126,4 +126,4 @@ public class StackTest {
stack.remove(-2);
});
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringConstantFieldValuePredicateTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringConstantFieldValuePredicateTest.java
index 061854296f..c788d8f7e3 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringConstantFieldValuePredicateTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringConstantFieldValuePredicateTest.java
@@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*
* @since 2.7.8
*/
-public class StringConstantFieldValuePredicateTest {
+class StringConstantFieldValuePredicateTest {
public static final String S1 = "1";
@@ -38,10 +38,10 @@ public class StringConstantFieldValuePredicateTest {
public static final Object O2 = 3;
@Test
- public void test() {
+ void test() {
Predicate<String> predicate = of(getClass());
assertTrue(predicate.test("1"));
assertTrue(predicate.test("2"));
assertFalse(predicate.test("3"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringUtilsTest.java
index 043ac40eb7..5d46c2ad18 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/StringUtilsTest.java
@@ -48,15 +48,15 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class StringUtilsTest {
+class StringUtilsTest {
@Test
- public void testLength() throws Exception {
+ void testLength() throws Exception {
assertThat(StringUtils.length(null), equalTo(0));
assertThat(StringUtils.length("abc"), equalTo(3));
}
@Test
- public void testRepeat() throws Exception {
+ void testRepeat() throws Exception {
assertThat(StringUtils.repeat(null, 2), nullValue());
assertThat(StringUtils.repeat("", 0), equalTo(""));
assertThat(StringUtils.repeat("", 2), equalTo(""));
@@ -74,7 +74,7 @@ public class StringUtilsTest {
}
@Test
- public void testStripEnd() throws Exception {
+ void testStripEnd() throws Exception {
assertThat(StringUtils.stripEnd(null, "*"), nullValue());
assertThat(StringUtils.stripEnd("", null), equalTo(""));
assertThat(StringUtils.stripEnd("abc", ""), equalTo("abc"));
@@ -87,7 +87,7 @@ public class StringUtilsTest {
}
@Test
- public void testReplace() throws Exception {
+ void testReplace() throws Exception {
assertThat(StringUtils.replace(null, "*", "*"), nullValue());
assertThat(StringUtils.replace("", "*", "*"), equalTo(""));
assertThat(StringUtils.replace("any", null, "*"), equalTo("any"));
@@ -110,21 +110,21 @@ public class StringUtilsTest {
}
@Test
- public void testIsBlank() throws Exception {
+ void testIsBlank() throws Exception {
assertTrue(StringUtils.isBlank(null));
assertTrue(StringUtils.isBlank(""));
assertFalse(StringUtils.isBlank("abc"));
}
@Test
- public void testIsEmpty() throws Exception {
+ void testIsEmpty() throws Exception {
assertTrue(StringUtils.isEmpty(null));
assertTrue(StringUtils.isEmpty(""));
assertFalse(StringUtils.isEmpty("abc"));
}
@Test
- public void testIsNoneEmpty() throws Exception {
+ void testIsNoneEmpty() throws Exception {
assertFalse(StringUtils.isNoneEmpty(null));
assertFalse(StringUtils.isNoneEmpty(""));
assertTrue(StringUtils.isNoneEmpty(" "));
@@ -136,7 +136,7 @@ public class StringUtilsTest {
}
@Test
- public void testIsAnyEmpty() throws Exception {
+ void testIsAnyEmpty() throws Exception {
assertTrue(StringUtils.isAnyEmpty(null));
assertTrue(StringUtils.isAnyEmpty(""));
assertFalse(StringUtils.isAnyEmpty(" "));
@@ -148,14 +148,14 @@ public class StringUtilsTest {
}
@Test
- public void testIsNotEmpty() throws Exception {
+ void testIsNotEmpty() throws Exception {
assertFalse(StringUtils.isNotEmpty(null));
assertFalse(StringUtils.isNotEmpty(""));
assertTrue(StringUtils.isNotEmpty("abc"));
}
@Test
- public void testIsEquals() throws Exception {
+ void testIsEquals() throws Exception {
assertTrue(StringUtils.isEquals(null, null));
assertFalse(StringUtils.isEquals(null, ""));
assertTrue(StringUtils.isEquals("abc", "abc"));
@@ -163,20 +163,20 @@ public class StringUtilsTest {
}
@Test
- public void testIsInteger() throws Exception {
+ void testIsInteger() throws Exception {
assertFalse(StringUtils.isNumber(null));
assertFalse(StringUtils.isNumber(""));
assertTrue(StringUtils.isNumber("123"));
}
@Test
- public void testParseInteger() throws Exception {
+ void testParseInteger() throws Exception {
assertThat(StringUtils.parseInteger(null), equalTo(0));
assertThat(StringUtils.parseInteger("123"), equalTo(123));
}
@Test
- public void testIsJavaIdentifier() throws Exception {
+ void testIsJavaIdentifier() throws Exception {
assertThat(StringUtils.isJavaIdentifier(""), is(false));
assertThat(StringUtils.isJavaIdentifier("1"), is(false));
assertThat(StringUtils.isJavaIdentifier("abc123"), is(true));
@@ -184,26 +184,26 @@ public class StringUtilsTest {
}
@Test
- public void testExceptionToString() throws Exception {
+ void testExceptionToString() throws Exception {
assertThat(StringUtils.toString(new RuntimeException("abc")), containsString("java.lang.RuntimeException: abc"));
}
@Test
- public void testExceptionToStringWithMessage() throws Exception {
+ void testExceptionToStringWithMessage() throws Exception {
String s = StringUtils.toString("greeting", new RuntimeException("abc"));
assertThat(s, containsString("greeting"));
assertThat(s, containsString("java.lang.RuntimeException: abc"));
}
@Test
- public void testParseQueryString() throws Exception {
+ void testParseQueryString() throws Exception {
assertThat(StringUtils.getQueryStringValue("key1=value1&key2=value2", "key1"), equalTo("value1"));
assertThat(StringUtils.getQueryStringValue("key1=value1&key2=value2", "key2"), equalTo("value2"));
assertThat(StringUtils.getQueryStringValue("", "key1"), isEmptyOrNullString());
}
@Test
- public void testGetServiceKey() throws Exception {
+ void testGetServiceKey() throws Exception {
Map<String, String> map = new HashMap<String, String>();
map.put(GROUP_KEY, "dubbo");
map.put(INTERFACE_KEY, "a.b.c.Foo");
@@ -212,7 +212,7 @@ public class StringUtilsTest {
}
@Test
- public void testToQueryString() throws Exception {
+ void testToQueryString() throws Exception {
Map<String, String> map = new HashMap<String, String>();
map.put("key1", "value1");
map.put("key2", "value2");
@@ -222,7 +222,7 @@ public class StringUtilsTest {
}
@Test
- public void testJoin() throws Exception {
+ void testJoin() throws Exception {
String[] s = {"1", "2", "3"};
assertEquals(StringUtils.join(s), "123");
assertEquals(StringUtils.join(s, ','), "1,2,3");
@@ -230,7 +230,7 @@ public class StringUtilsTest {
}
@Test
- public void testSplit() throws Exception {
+ void testSplit() throws Exception {
String str = "d,1,2,4";
assertEquals(4, StringUtils.split(str, ',').length);
@@ -247,7 +247,7 @@ public class StringUtilsTest {
}
@Test
- public void testSplitToList() throws Exception {
+ void testSplitToList() throws Exception {
String str = "d,1,2,4";
assertEquals(4, splitToList(str, ',').size());
@@ -266,7 +266,7 @@ public class StringUtilsTest {
* @since 2.7.8
*/
@Test
- public void testSplitToSet() {
+ void testSplitToSet() {
String value = "1# 2#3 #4#3";
Set<String> values = splitToSet(value, '#', false);
assertEquals(ofSet("1", " 2", "3 ", "4", "3"), values);
@@ -277,14 +277,14 @@ public class StringUtilsTest {
@Test
- public void testTranslate() throws Exception {
+ void testTranslate() throws Exception {
String s = "16314";
assertEquals(StringUtils.translate(s, "123456", "abcdef"), "afcad");
assertEquals(StringUtils.translate(s, "123456", "abcd"), "acad");
}
@Test
- public void testIsContains() throws Exception {
+ void testIsContains() throws Exception {
assertThat(StringUtils.isContains("a,b, c", "b"), is(true));
assertThat(StringUtils.isContains("", "b"), is(false));
assertThat(StringUtils.isContains(new String[]{"a", "b", "c"}, "b"), is(true));
@@ -302,7 +302,7 @@ public class StringUtilsTest {
}
@Test
- public void testIsNumeric() throws Exception {
+ void testIsNumeric() throws Exception {
assertThat(StringUtils.isNumeric("123", false), is(true));
assertThat(StringUtils.isNumeric("1a3", false), is(false));
assertThat(StringUtils.isNumeric(null, false), is(false));
@@ -322,7 +322,7 @@ public class StringUtilsTest {
}
@Test
- public void testJoinCollectionString() throws Exception {
+ void testJoinCollectionString() throws Exception {
List<String> list = new ArrayList<String>();
assertEquals("", StringUtils.join(list, ","));
@@ -336,7 +336,7 @@ public class StringUtilsTest {
}
@Test
- public void testCamelToSplitName() throws Exception {
+ void testCamelToSplitName() throws Exception {
assertEquals("ab-cd-ef", StringUtils.camelToSplitName("abCdEf", "-"));
assertEquals("ab-cd-ef", StringUtils.camelToSplitName("AbCdEf", "-"));
assertEquals("abcdef", StringUtils.camelToSplitName("abcdef", "-"));
@@ -352,7 +352,7 @@ public class StringUtilsTest {
}
@Test
- public void testSnakeCaseToSplitName() throws Exception {
+ void testSnakeCaseToSplitName() throws Exception {
assertEquals("ab-cd-ef", StringUtils.snakeToSplitName("ab_Cd_Ef", "-"));
assertEquals("ab-cd-ef", StringUtils.snakeToSplitName("Ab_Cd_Ef", "-"));
assertEquals("ab-cd-ef", StringUtils.snakeToSplitName("ab_cd_ef", "-"));
@@ -363,7 +363,7 @@ public class StringUtilsTest {
}
@Test
- public void testConvertToSplitName() {
+ void testConvertToSplitName() {
assertEquals("ab-cd-ef", StringUtils.convertToSplitName("ab_Cd_Ef", "-"));
assertEquals("ab-cd-ef", StringUtils.convertToSplitName("Ab_Cd_Ef", "-"));
assertEquals("ab-cd-ef", StringUtils.convertToSplitName("ab_cd_ef", "-"));
@@ -380,7 +380,7 @@ public class StringUtilsTest {
}
@Test
- public void testToArgumentString() throws Exception {
+ void testToArgumentString() throws Exception {
String s = StringUtils.toArgumentString(new Object[]{"a", 0, Collections.singletonMap("enabled", true)});
assertThat(s, containsString("a,"));
assertThat(s, containsString("0,"));
@@ -388,20 +388,20 @@ public class StringUtilsTest {
}
@Test
- public void testTrim() {
+ void testTrim() {
assertEquals("left blank", StringUtils.trim(" left blank"));
assertEquals("right blank", StringUtils.trim("right blank "));
assertEquals("bi-side blank", StringUtils.trim(" bi-side blank "));
}
@Test
- public void testToURLKey() {
+ void testToURLKey() {
assertEquals("dubbo.tag1", StringUtils.toURLKey("dubbo_tag1"));
assertEquals("dubbo.tag1.tag11", StringUtils.toURLKey("dubbo-tag1_tag11"));
}
@Test
- public void testToOSStyleKey() {
+ void testToOSStyleKey() {
assertEquals("DUBBO_TAG1", StringUtils.toOSStyleKey("dubbo_tag1"));
assertEquals("DUBBO_TAG1", StringUtils.toOSStyleKey("dubbo.tag1"));
assertEquals("DUBBO_TAG1_TAG11", StringUtils.toOSStyleKey("dubbo.tag1.tag11"));
@@ -409,7 +409,7 @@ public class StringUtilsTest {
}
@Test
- public void testParseParameters() {
+ void testParseParameters() {
String legalStr = "[{key1:value1},{key2:value2}]";
Map<String, String> legalMap = StringUtils.parseParameters(legalStr);
assertEquals(2, legalMap.size());
@@ -448,7 +448,7 @@ public class StringUtilsTest {
}
@Test
- public void testEncodeParameters() {
+ void testEncodeParameters() {
Map<String, String> nullValueMap = new LinkedHashMap<>();
nullValueMap.put("client", null);
String str = StringUtils.encodeParameters(nullValueMap);
@@ -475,7 +475,7 @@ public class StringUtilsTest {
* @since 2.7.8
*/
@Test
- public void testToCommaDelimitedString() {
+ void testToCommaDelimitedString() {
String value = toCommaDelimitedString(null);
assertNull(value);
@@ -496,10 +496,10 @@ public class StringUtilsTest {
}
@Test
- public void testStartsWithIgnoreCase() {
+ void testStartsWithIgnoreCase() {
assertTrue(startsWithIgnoreCase("dubbo.application.name", "dubbo.application."));
assertTrue(startsWithIgnoreCase("dubbo.Application.name", "dubbo.application."));
assertTrue(startsWithIgnoreCase("Dubbo.application.name", "dubbo.application."));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
index 948bce438e..b82be418f6 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
@@ -37,12 +37,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
-public class UrlUtilsTest {
+class UrlUtilsTest {
String localAddress = "127.0.0.1";
@Test
- public void testAddressNull() {
+ void testAddressNull() {
String exceptionMessage = "Address is not allowed to be empty, please re-enter.";
try {
UrlUtils.parseURL(null, null);
@@ -52,7 +52,7 @@ public class UrlUtilsTest {
}
@Test
- public void testParseUrl() {
+ void testParseUrl() {
String address = "remote://root:alibaba@127.0.0.1:9090/dubbo.test.api";
URL url = UrlUtils.parseURL(address, null);
assertEquals(localAddress + ":9090", url.getAddress());
@@ -64,13 +64,13 @@ public class UrlUtilsTest {
}
@Test
- public void testParseURLWithSpecial() {
+ void testParseURLWithSpecial() {
String address = "127.0.0.1:2181?backup=127.0.0.1:2182,127.0.0.1:2183";
assertEquals("dubbo://" + address, UrlUtils.parseURL(address, null).toString());
}
@Test
- public void testDefaultUrl() {
+ void testDefaultUrl() {
String address = "127.0.0.1";
URL url = UrlUtils.parseURL(address, null);
assertEquals(localAddress + ":9090", url.getAddress());
@@ -82,7 +82,7 @@ public class UrlUtilsTest {
}
@Test
- public void testParseFromParameter() {
+ void testParseFromParameter() {
String address = "127.0.0.1";
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("username", "root");
@@ -104,7 +104,7 @@ public class UrlUtilsTest {
}
@Test
- public void testParseUrl2() {
+ void testParseUrl2() {
String address = "192.168.0.1";
String backupAddress1 = "192.168.0.2";
String backupAddress2 = "192.168.0.3";
@@ -124,7 +124,7 @@ public class UrlUtilsTest {
}
@Test
- public void testParseUrls() {
+ void testParseUrls() {
String addresses = "192.168.0.1|192.168.0.2|192.168.0.3";
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("username", "root");
@@ -137,7 +137,7 @@ public class UrlUtilsTest {
}
@Test
- public void testParseUrlsAddressNull() {
+ void testParseUrlsAddressNull() {
String exceptionMessage = "Address is not allowed to be empty, please re-enter.";
try {
UrlUtils.parseURLs(null, null);
@@ -147,7 +147,7 @@ public class UrlUtilsTest {
}
@Test
- public void testConvertRegister() {
+ void testConvertRegister() {
String key = "perf/dubbo.test.api.HelloService:1.0.0";
Map<String, Map<String, String>> register = new HashMap<String, Map<String, String>>();
register.put(key, null);
@@ -156,7 +156,7 @@ public class UrlUtilsTest {
}
@Test
- public void testConvertRegister2() {
+ void testConvertRegister2() {
String key = "dubbo.test.api.HelloService";
Map<String, Map<String, String>> register = new HashMap<String, Map<String, String>>();
Map<String, String> service = new HashMap<String, String>();
@@ -169,7 +169,7 @@ public class UrlUtilsTest {
}
@Test
- public void testSubscribe() {
+ void testSubscribe() {
String key = "perf/dubbo.test.api.HelloService:1.0.0";
Map<String, String> subscribe = new HashMap<String, String>();
subscribe.put(key, null);
@@ -178,7 +178,7 @@ public class UrlUtilsTest {
}
@Test
- public void testSubscribe2() {
+ void testSubscribe2() {
String key = "dubbo.test.api.HelloService";
Map<String, String> subscribe = new HashMap<String, String>();
subscribe.put(key, "version=1.0.0&group=test&dubbo.version=2.0.0");
@@ -187,7 +187,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertRegister() {
+ void testRevertRegister() {
String key = "perf/dubbo.test.api.HelloService:1.0.0";
Map<String, Map<String, String>> register = new HashMap<String, Map<String, String>>();
Map<String, String> service = new HashMap<String, String>();
@@ -201,7 +201,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertRegister2() {
+ void testRevertRegister2() {
String key = "dubbo.test.api.HelloService";
Map<String, Map<String, String>> register = new HashMap<String, Map<String, String>>();
Map<String, String> service = new HashMap<String, String>();
@@ -215,7 +215,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertSubscribe() {
+ void testRevertSubscribe() {
String key = "perf/dubbo.test.api.HelloService:1.0.0";
Map<String, String> subscribe = new HashMap<String, String>();
subscribe.put(key, null);
@@ -226,7 +226,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertSubscribe2() {
+ void testRevertSubscribe2() {
String key = "dubbo.test.api.HelloService";
Map<String, String> subscribe = new HashMap<String, String>();
subscribe.put(key, null);
@@ -235,7 +235,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertNotify() {
+ void testRevertNotify() {
String key = "dubbo.test.api.HelloService";
Map<String, Map<String, String>> notify = new HashMap<String, Map<String, String>>();
Map<String, String> service = new HashMap<String, String>();
@@ -249,7 +249,7 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertNotify2() {
+ void testRevertNotify2() {
String key = "perf/dubbo.test.api.HelloService:1.0.0";
Map<String, Map<String, String>> notify = new HashMap<String, Map<String, String>>();
Map<String, String> service = new HashMap<String, String>();
@@ -264,7 +264,7 @@ public class UrlUtilsTest {
// backward compatibility for version 2.0.0
@Test
- public void testRevertForbid() {
+ void testRevertForbid() {
String service = "dubbo.test.api.HelloService";
List<String> forbid = new ArrayList<String>();
forbid.add(service);
@@ -277,13 +277,13 @@ public class UrlUtilsTest {
}
@Test
- public void testRevertForbid2() {
+ void testRevertForbid2() {
List<String> newForbid = UrlUtils.revertForbid(null, null);
assertNull(newForbid);
}
@Test
- public void testRevertForbid3() {
+ void testRevertForbid3() {
String service1 = "dubbo.test.api.HelloService:1.0.0";
String service2 = "dubbo.test.api.HelloService:2.0.0";
List<String> forbid = new ArrayList<String>();
@@ -294,42 +294,42 @@ public class UrlUtilsTest {
}
@Test
- public void testIsMatch() {
+ void testIsMatch() {
URL consumerUrl = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?version=1.0.0&group=test");
URL providerUrl = URL.valueOf("http://127.0.0.1:8080/com.xxx.XxxService?version=1.0.0&group=test");
assertTrue(UrlUtils.isMatch(consumerUrl, providerUrl));
}
@Test
- public void testIsMatch2() {
+ void testIsMatch2() {
URL consumerUrl = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?version=2.0.0&group=test");
URL providerUrl = URL.valueOf("http://127.0.0.1:8080/com.xxx.XxxService?version=1.0.0&group=test");
assertFalse(UrlUtils.isMatch(consumerUrl, providerUrl));
}
@Test
- public void testIsMatch3() {
+ void testIsMatch3() {
URL consumerUrl = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?version=1.0.0&group=aa");
URL providerUrl = URL.valueOf("http://127.0.0.1:8080/com.xxx.XxxService?version=1.0.0&group=test");
assertFalse(UrlUtils.isMatch(consumerUrl, providerUrl));
}
@Test
- public void testIsMatch4() {
+ void testIsMatch4() {
URL consumerUrl = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?version=1.0.0&group=*");
URL providerUrl = URL.valueOf("http://127.0.0.1:8080/com.xxx.XxxService?version=1.0.0&group=test");
assertTrue(UrlUtils.isMatch(consumerUrl, providerUrl));
}
@Test
- public void testIsMatch5() {
+ void testIsMatch5() {
URL consumerUrl = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?version=*&group=test");
URL providerUrl = URL.valueOf("http://127.0.0.1:8080/com.xxx.XxxService?version=1.0.0&group=test");
assertTrue(UrlUtils.isMatch(consumerUrl, providerUrl));
}
@Test
- public void testIsItemMatch() throws Exception {
+ void testIsItemMatch() throws Exception {
assertTrue(UrlUtils.isItemMatch(null, null));
assertTrue(!UrlUtils.isItemMatch("1", null));
assertTrue(!UrlUtils.isItemMatch(null, "1"));
@@ -341,7 +341,7 @@ public class UrlUtilsTest {
}
@Test
- public void testIsServiceKeyMatch() throws Exception {
+ void testIsServiceKeyMatch() throws Exception {
URL url = URL.valueOf("test://127.0.0.1");
URL pattern = url.addParameter(GROUP_KEY, "test")
.addParameter(INTERFACE_KEY, "test")
@@ -357,13 +357,13 @@ public class UrlUtilsTest {
}
@Test
- public void testGetEmptyUrl() throws Exception {
+ void testGetEmptyUrl() throws Exception {
URL url = UrlUtils.getEmptyUrl("dubbo/a.b.c.Foo:1.0.0", "test");
assertThat(url.toFullString(), equalTo("empty://0.0.0.0/a.b.c.Foo?category=test&group=dubbo&version=1.0.0"));
}
@Test
- public void testIsMatchGlobPattern() throws Exception {
+ void testIsMatchGlobPattern() throws Exception {
assertTrue(UrlUtils.isMatchGlobPattern("*", "value"));
assertTrue(UrlUtils.isMatchGlobPattern("", null));
assertFalse(UrlUtils.isMatchGlobPattern("", "value"));
@@ -375,7 +375,7 @@ public class UrlUtilsTest {
}
@Test
- public void testIsMatchUrlWithDefaultPrefix() {
+ void testIsMatchUrlWithDefaultPrefix() {
URL url = URL.valueOf("dubbo://127.0.0.1:20880/com.xxx.XxxService?default.version=1.0.0&default.group=test");
assertEquals("1.0.0", url.getVersion());
assertEquals("1.0.0", url.getParameter("default.version"));
@@ -386,4 +386,4 @@ public class UrlUtilsTest {
URL consumerUrl1 = URL.valueOf("consumer://127.0.0.1/com.xxx.XxxService?default.version=1.0.0&default.group=test");
assertTrue(UrlUtils.isMatch(consumerUrl, url));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java
index 7311cc694e..39093a8d55 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java
@@ -22,15 +22,15 @@ import org.apache.dubbo.common.Version;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-public class VersionTest {
+class VersionTest {
@Test
- public void testGetProtocolVersion() {
+ void testGetProtocolVersion() {
Assertions.assertEquals(Version.getProtocolVersion(), Version.DEFAULT_DUBBO_PROTOCOL_VERSION);
}
@Test
- public void testSupportResponseAttachment() {
+ void testSupportResponseAttachment() {
Assertions.assertTrue(Version.isSupportResponseAttachment("2.0.2"));
Assertions.assertTrue(Version.isSupportResponseAttachment("2.0.3"));
Assertions.assertTrue(Version.isSupportResponseAttachment("2.0.99"));
@@ -47,7 +47,7 @@ public class VersionTest {
}
@Test
- public void testGetIntVersion() {
+ void testGetIntVersion() {
Assertions.assertEquals(2060100, Version.getIntVersion("2.6.1"));
Assertions.assertEquals(2060101, Version.getIntVersion("2.6.1.1"));
Assertions.assertEquals(2070001, Version.getIntVersion("2.7.0.1"));
@@ -60,7 +60,7 @@ public class VersionTest {
}
@Test
- public void testCompare() {
+ void testCompare() {
Assertions.assertEquals(0, Version.compare("3.0.0", "3.0.0"));
Assertions.assertEquals(0, Version.compare("3.0.0-SNAPSHOT", "3.0.0"));
Assertions.assertEquals(1, Version.compare("3.0.0.1", "3.0.0"));
@@ -71,7 +71,7 @@ public class VersionTest {
}
@Test
- public void testIsFramework270OrHigher() {
+ void testIsFramework270OrHigher() {
Assertions.assertTrue(Version.isRelease270OrHigher("2.7.0"));
Assertions.assertTrue(Version.isRelease270OrHigher("2.7.0.1"));
Assertions.assertTrue(Version.isRelease270OrHigher("2.7.0.2"));
@@ -81,7 +81,7 @@ public class VersionTest {
}
@Test
- public void testIsFramework263OrHigher() {
+ void testIsFramework263OrHigher() {
Assertions.assertTrue(Version.isRelease263OrHigher("2.7.0"));
Assertions.assertTrue(Version.isRelease263OrHigher("2.7.0.1"));
Assertions.assertTrue(Version.isRelease263OrHigher("2.6.4"));
@@ -91,4 +91,4 @@ public class VersionTest {
Assertions.assertTrue(Version.isRelease263OrHigher("2.6.3"));
Assertions.assertTrue(Version.isRelease263OrHigher("2.6.3.0"));
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/config/AbstractInterfaceConfigTest.java b/dubbo-common/src/test/java/org/apache/dubbo/config/AbstractInterfaceConfigTest.java
index 5771e99349..a09ea89e21 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/config/AbstractInterfaceConfigTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/config/AbstractInterfaceConfigTest.java
@@ -29,7 +29,7 @@ import java.io.File;
import java.nio.file.Path;
import java.util.Collections;
-public class AbstractInterfaceConfigTest {
+class AbstractInterfaceConfigTest {
@BeforeAll
public static void setUp(@TempDir Path folder) {
@@ -44,7 +44,7 @@ public class AbstractInterfaceConfigTest {
@Test
- public void checkStub1() {
+ void checkStub1() {
Assertions.assertThrows(IllegalStateException.class, () -> {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setLocal(GreetingLocal1.class.getName());
@@ -53,7 +53,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void checkStub2() {
+ void checkStub2() {
Assertions.assertThrows(IllegalStateException.class, () -> {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setLocal(GreetingLocal2.class.getName());
@@ -62,14 +62,14 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void checkStub3() {
+ void checkStub3() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setLocal(GreetingLocal3.class.getName());
interfaceConfig.checkStubAndLocal(Greeting.class);
}
@Test
- public void checkStub4() {
+ void checkStub4() {
Assertions.assertThrows(IllegalStateException.class, () -> {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setStub(GreetingLocal1.class.getName());
@@ -78,7 +78,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void checkStub5() {
+ void checkStub5() {
Assertions.assertThrows(IllegalStateException.class, () -> {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setStub(GreetingLocal2.class.getName());
@@ -87,14 +87,14 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void checkStub6() {
+ void checkStub6() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setStub(GreetingLocal3.class.getName());
interfaceConfig.checkStubAndLocal(Greeting.class);
}
@Test
- public void testLocal() {
+ void testLocal() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setLocal((Boolean) null);
Assertions.assertNull(interfaceConfig.getLocal());
@@ -105,7 +105,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testStub() {
+ void testStub() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setStub((Boolean) null);
Assertions.assertNull(interfaceConfig.getStub());
@@ -116,49 +116,49 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testCluster() {
+ void testCluster() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setCluster("mockcluster");
Assertions.assertEquals("mockcluster", interfaceConfig.getCluster());
}
@Test
- public void testProxy() {
+ void testProxy() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setProxy("mockproxyfactory");
Assertions.assertEquals("mockproxyfactory", interfaceConfig.getProxy());
}
@Test
- public void testConnections() {
+ void testConnections() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setConnections(1);
Assertions.assertEquals(1, interfaceConfig.getConnections().intValue());
}
@Test
- public void testFilter() {
+ void testFilter() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setFilter("mockfilter");
Assertions.assertEquals("mockfilter", interfaceConfig.getFilter());
}
@Test
- public void testListener() {
+ void testListener() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setListener("mockinvokerlistener");
Assertions.assertEquals("mockinvokerlistener", interfaceConfig.getListener());
}
@Test
- public void testLayer() {
+ void testLayer() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setLayer("layer");
Assertions.assertEquals("layer", interfaceConfig.getLayer());
}
@Test
- public void testApplication() {
+ void testApplication() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
ApplicationConfig applicationConfig = new ApplicationConfig("AbstractInterfaceConfigTest");
interfaceConfig.setApplication(applicationConfig);
@@ -166,7 +166,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testModule() {
+ void testModule() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
ModuleConfig moduleConfig = new ModuleConfig();
interfaceConfig.setModule(moduleConfig);
@@ -174,7 +174,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testRegistry() {
+ void testRegistry() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
RegistryConfig registryConfig = new RegistryConfig();
interfaceConfig.setRegistry(registryConfig);
@@ -182,7 +182,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testRegistries() {
+ void testRegistries() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
RegistryConfig registryConfig = new RegistryConfig();
interfaceConfig.setRegistries(Collections.singletonList(registryConfig));
@@ -191,7 +191,7 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testMonitor() {
+ void testMonitor() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setMonitor("monitor-addr");
Assertions.assertEquals("monitor-addr", interfaceConfig.getMonitor().getAddress());
@@ -202,35 +202,35 @@ public class AbstractInterfaceConfigTest {
}
@Test
- public void testOwner() {
+ void testOwner() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setOwner("owner");
Assertions.assertEquals("owner", interfaceConfig.getOwner());
}
@Test
- public void testCallbacks() {
+ void testCallbacks() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setCallbacks(2);
Assertions.assertEquals(2, interfaceConfig.getCallbacks().intValue());
}
@Test
- public void testOnconnect() {
+ void testOnconnect() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setOnconnect("onConnect");
Assertions.assertEquals("onConnect", interfaceConfig.getOnconnect());
}
@Test
- public void testOndisconnect() {
+ void testOndisconnect() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setOndisconnect("onDisconnect");
Assertions.assertEquals("onDisconnect", interfaceConfig.getOndisconnect());
}
@Test
- public void testScope() {
+ void testScope() {
InterfaceConfig interfaceConfig = new InterfaceConfig();
interfaceConfig.setScope("scope");
Assertions.assertEquals("scope", interfaceConfig.getScope());
@@ -239,4 +239,4 @@ public class AbstractInterfaceConfigTest {
public static class InterfaceConfig extends AbstractInterfaceConfig {
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigConfigurationAdapterTest.java b/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigConfigurationAdapterTest.java
index 3a4a7ddbe5..826560831f 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigConfigurationAdapterTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigConfigurationAdapterTest.java
@@ -24,10 +24,10 @@ import org.junit.jupiter.api.Test;
/**
* {@link ConfigConfigurationAdapter}
*/
-public class ConfigConfigurationAdapterTest {
+class ConfigConfigurationAdapterTest {
@Test
- public void test() {
+ void test() {
RegistryConfig registryConfig = new RegistryConfig();
registryConfig.setAddress("127.0.0.1");
registryConfig.setPort(2181);
@@ -38,4 +38,4 @@ public class ConfigConfigurationAdapterTest {
Assertions.assertEquals(configConfigurationAdapter.getInternalProperty(prefix + "." + "address"), "127.0.0.1");
Assertions.assertEquals(configConfigurationAdapter.getInternalProperty(prefix + "." + "port"), "2181");
}
-}
+}
\ No newline at end of file
diff --git a/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigManagerTest.java b/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigManagerTest.java
index 3a59d30ce0..aaa7fc604d 100644
--- a/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigManagerTest.java
+++ b/dubbo-common/src/test/java/org/apache/dubbo/config/context/ConfigManagerTest.java
@@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.fail;
*
* @since 2.7.5
*/
-public class ConfigManagerTest {
+class ConfigManagerTest {
private ConfigManager configManager;
private ModuleConfigManager moduleConfigManager;
@@ -67,12 +67,12 @@ public class ConfigManagerTest {
}
@Test
- public void testDestroy() {
+ void testDestroy() {
assertTrue(configManager.configsCache.isEmpty());
}
@Test
- public void testDefaultValues() {
+ void testDefaultValues() {
// assert single
assertFalse(configManager.getApplication().isPresent());
assertFalse(configManager.getMonitor().isPresent());
@@ -106,7 +106,7 @@ public class ConfigManagerTest {
// Test ApplicationConfig correlative methods
@Test
- public void testApplicationConfig() {
+ void testApplicationConfig() {
ApplicationConfig config = new ApplicationConfig("ConfigManagerTest");
configManager.setApplication(config);
assertTrue(configManager.getApplication().isPresent());
@@ -116,7 +116,7 @@ public class ConfigManagerTest {
// Test MonitorConfig correlative methods
@Test
- public void testMonitorConfig() {
+ void testMonitorConfig() {
MonitorConfig monitorConfig = new MonitorConfig();
monitorConfig.setGroup("test");
configManager.setMonitor(monitorConfig);
@@ -127,7 +127,7 @@ public class ConfigManagerTest {
// Test ModuleConfig correlative methods
@Test
- public void testModuleConfig() {
+ void testModuleConfig() {
ModuleConfig config = new ModuleConfig();
moduleConfigManager.setModule(config);
assertTrue(moduleConfigManager.getModule().isPresent());
@@ -136,7 +136,7 @@ public class ConfigManagerTest {
// Test MetricsConfig correlative methods
@Test
- public void testMetricsConfig() {
+ void testMetricsConfig() {
MetricsConfig config = new MetricsConfig();
config.setProtocol(PROTOCOL_PROMETHEUS);
configManager.setMetrics(config);
@@ -147,7 +147,7 @@ public class ConfigManagerTest {
// Test ProviderConfig correlative methods
@Test
- public void testProviderConfig() {
+ void testProviderConfig() {
ProviderConfig config = new ProviderConfig();
moduleConfigManager.addProviders(asList(config, null));
Collection<ProviderConfig> configs = moduleConfigManager.getProviders();
@@ -166,7 +166,7 @@ public class ConfigManagerTest {
// Test ConsumerConfig correlative methods
@Test
- public void testConsumerConfig() {
+ void testConsumerConfig() {
ConsumerConfig config = new ConsumerConfig();
moduleConfigManager.addConsumers(asList(config, null));
Collection<ConsumerConfig> configs = moduleConfigManager.getConsumers();
@@ -185,7 +185,7 @@ public class ConfigManagerTest {
// Test ProtocolConfig correlative methods
@Test
- public void testProtocolConfig() {
+ void testProtocolConfig() {
ProtocolConfig config = new ProtocolConfig();
configManager.addProtocols(asList(config, null));
Collection<ProtocolConfig> configs = configManager.getProtocols();
@@ -205,7 +205,7 @@ public class ConfigManagerTest {
// Test RegistryConfig correlative methods
@Test
- public void testRegistryConfig() {
+ void testRegistryConfig() {
RegistryConfig config = new RegistryConfig();
configManager.addRegistries(asList(config, null));
Collection<RegistryConfig> configs = configManager.getRegistries();
@@ -217,7 +217,7 @@ public class ConfigManagerTest {
// Test ConfigCenterConfig correlative methods
@Test
- public void testConfigCenterConfig() {
+ void testConfigCenterConfig() {
String address = "zookeeper://127.0.0.1:2181";
ConfigCenterConfig config = new ConfigCenterConfig();
config.setAddress(address);
@@ -238,7 +238,7 @@ public class ConfigManagerTest {
}
@Test
- public void testAddConfig() {
+ void testAddConfig() {
configManager.addConfig(new ApplicationConfig("ConfigManagerTest"));
configManager.addConfig(new ProtocolConfig());
moduleConfigManager.addConfig(new ProviderConfig());
@@ -249,13 +249,13 @@ public class ConfigManagerTest {
}
... 567 lines suppressed ...