diff --git a/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/PluginConfigParserHelperTest.java b/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/PluginConfigParserHelperTest.java index e19a91f05c..f63f95b055 100644 --- a/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/PluginConfigParserHelperTest.java +++ b/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/PluginConfigParserHelperTest.java @@ -86,7 +86,7 @@ private void checkRegistry(PluginConfig config) { List> services = (List>) config.getProperties() .get(ConfigConstants.SERVICE); Assert.assertEquals(services.get(0).get("namespace"), "java-sdk-test-service1"); - Assert.assertEquals(services.get(0).get("token"), "5e43887a00c4465085fb89eaa0e414b4"); + Assert.assertEquals(services.get(0).get("token"), "xxxx"); Assert.assertEquals(services.get(0).get("instance_id"), "feda4ceffed0b7b08cf5ec665dcd320e50434549"); Assert.assertEquals(services.get(0).get("name"), "trpc.TestApp.TestServer.Greeter"); diff --git a/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/YamlApplicationConfigParserTest.java b/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/YamlApplicationConfigParserTest.java index b8a9ae7d3f..8e56a9a0f4 100644 --- a/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/YamlApplicationConfigParserTest.java +++ b/trpc-container/trpc-container-default/src/test/java/com/tencent/trpc/container/config/yaml/YamlApplicationConfigParserTest.java @@ -47,6 +47,7 @@ public void after() { @Test public void parse() { + ConfigManager.stopTest(); ConfigManager applicationConfig = new YamlApplicationConfigParser().parseFromClassPath("trpc_java_parse_test.yaml"); assert applicationConfig != null; @@ -225,9 +226,9 @@ public void checkServerConfig(ConfigManager applicationConfig) { assertEquals(serviceConfig.getFilters().get(1), "filter2"); assertEquals(serviceConfig.getWorkerPool(), "woker_pool_provider_test2"); assertEquals(serviceConfig.getRegistries().get("polaris").get("token"), - "5e43887a00c4465085fb89eaa0e414b4"); + "xxxx"); assertEquals(serviceConfig.getRegistries().get("polaris2").get("token"), - "5e43887a00c4465085fb89eaa0e414b3"); + "xxxx"); ProviderConfig providerConfig = serviceConfig.getProviderConfigs().get(0); assertEquals(providerConfig.getRefClazz(), "com.tencent.trpc.container.demo.GreeterServiceImp"); assertEquals(serviceConfig.getWorkerPool(), "woker_pool_provider_test2"); @@ -259,6 +260,7 @@ public void checkServerConfig(ConfigManager applicationConfig) { @Test public void testServerIpParse() { + ConfigManager.stopTest(); ConfigManager applicationConfig = new YamlApplicationConfigParser() .parseFromClassPath("trpc_java_ip_parse_test.yaml"); applicationConfig.setDefault(); @@ -271,6 +273,7 @@ public void testServerIpParse() { @Test public void testParseMap() { + ConfigManager.stopTest(); String path = YamlParser.class.getClassLoader().getResource("trpc_java.yaml").getPath(); Map map = new YamlApplicationConfigParser().parseMap(path); Assert.assertNotEquals(map.size(), 0); @@ -278,6 +281,7 @@ public void testParseMap() { @Test public void testParseMap_confPath() { + ConfigManager.stopTest(); TRpcSystemProperties.setProperties(TRpcSystemProperties.CONFIG_PATH, ""); Map map1 = new YamlApplicationConfigParser().parseMap(""); Assert.assertNotNull(map1); @@ -314,7 +318,7 @@ public void testParseImpls() { @Test public void testEx() { - + ConfigManager.stopTest(); try { new YamlApplicationConfigParser().parseMap("abc"); TRpcSystemProperties.setProperties(TRpcSystemProperties.CONFIG_PATH, "abc"); diff --git a/trpc-container/trpc-container-default/src/test/resources/listener_default.yaml b/trpc-container/trpc-container-default/src/test/resources/listener_default.yaml index 3403f4305e..dd6c3f766b 100644 --- a/trpc-container/trpc-container-default/src/test/resources/listener_default.yaml +++ b/trpc-container/trpc-container-default/src/test/resources/listener_default.yaml @@ -67,7 +67,7 @@ server: registrys: polaris2: namespace: java-sdk-test-service2 - token: 5e43887a00c4465085fb89eaa0e414b3 + token: xxxx instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 name: trpc.TestApp.TestServer.Greeter3 @@ -173,7 +173,7 @@ plugins: register_self: true service: - namespace: java-sdk-test-service2 - token: 5e43887a00c4465085fb89eaa0e414b4 + token: xxxx instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 name: trpc.TestApp.TestServer.Greeter selector: diff --git a/trpc-container/trpc-container-default/src/test/resources/trpc_java_config.yaml b/trpc-container/trpc-container-default/src/test/resources/trpc_java_config.yaml index e30f0db325..63a756e8dc 100644 --- a/trpc-container/trpc-container-default/src/test/resources/trpc_java_config.yaml +++ b/trpc-container/trpc-container-default/src/test/resources/trpc_java_config.yaml @@ -41,7 +41,7 @@ plugins: register_self: false service: - namespace: java-sdk-test-service1 - token: 5e43887a00c4465085fb89eaa0e414b4 + token: xxxx instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 name: trpc.TestApp.TestServer.Greeter diff --git a/trpc-container/trpc-container-default/src/test/resources/trpc_java_parse_test.yaml b/trpc-container/trpc-container-default/src/test/resources/trpc_java_parse_test.yaml index 983f8703c4..adf675140c 100644 --- a/trpc-container/trpc-container-default/src/test/resources/trpc_java_parse_test.yaml +++ b/trpc-container/trpc-container-default/src/test/resources/trpc_java_parse_test.yaml @@ -67,7 +67,7 @@ server: registrys: polaris2: namespace: java-sdk-test-service2 - token: 5e43887a00c4465085fb89eaa0e414b3 + token: xxxx instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 name: trpc.TestApp.TestServer.Greeter3 @@ -173,7 +173,7 @@ plugins: register_self: true service: - namespace: java-sdk-test-service2 - token: 5e43887a00c4465085fb89eaa0e414b4 + token: xxxx instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 name: trpc.TestApp.TestServer.Greeter selector: diff --git a/trpc-core/src/test/java/com/tencent/trpc/core/utils/IPUtilsTest.java b/trpc-core/src/test/java/com/tencent/trpc/core/utils/IPUtilsTest.java index 830e314689..b3b4a75f09 100644 --- a/trpc-core/src/test/java/com/tencent/trpc/core/utils/IPUtilsTest.java +++ b/trpc-core/src/test/java/com/tencent/trpc/core/utils/IPUtilsTest.java @@ -14,13 +14,11 @@ import org.junit.Assert; import org.junit.Test; -import java.lang.reflect.InvocationTargetException; - public class IPUtilsTest { @Test public void testTransfer() { - String host = "9.12.53.243"; + String host = "19.12.53.243"; int ipInt = IPUtils.ip2int(host); byte[] ipBytes = IPUtils.ip2bytes(host); String newIp = IPUtils.bytes2ip(ipBytes); diff --git a/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/application-bind-test1.yml b/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/application-bind-test1.yml index d430701e45..4a2be8bbc3 100644 --- a/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/application-bind-test1.yml +++ b/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/application-bind-test1.yml @@ -34,4 +34,4 @@ trpc: - instance_id: 0938d8c7303d976bafa761ff588fb41e2192740d #服务注册所需要的 id name: trpc.ep.ods_collector.test namespace: Development #环境类型,分正式production和非正式development两种类型 - token: d70b7d820f6144a2bb42e55cc6567f21 #服务注册所需要的 token \ No newline at end of file + token: xxxx #服务注册所需要的 token \ No newline at end of file diff --git a/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/trpc_java_default-test.yml b/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/trpc_java_default-test.yml index 557f5272b3..c17d5a353b 100644 --- a/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/trpc_java_default-test.yml +++ b/trpc-spring-boot-starters/trpc-spring-boot-starter/src/test/resources/trpc_java_default-test.yml @@ -151,7 +151,7 @@ plugins: register_self: true service: - namespace: java-sdk-test-service1 #环境类型,分正式production和非正式development两种类型 - token: 5e43887a00c4465085fb89eaa0e414b4 #服务注册所需要的 token + token: xxxx #服务注册所需要的 token instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 #服务注册所需要的 id name: trpc.TestApp.TestServer.Greeter selector: