Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: fix style
  • Loading branch information
wardseptember committed Apr 25, 2025
commit 5bd43c510c1422e5df61afd7d3d946f64fa66876
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -227,7 +228,7 @@ public void checkServerConfig(ConfigManager applicationConfig) {
assertEquals(serviceConfig.getRegistries().get("polaris").get("token"),
"xxxx");
assertEquals(serviceConfig.getRegistries().get("polaris2").get("token"),
"xxx");
"xxxx");
ProviderConfig providerConfig = serviceConfig.getProviderConfigs().get(0);
assertEquals(providerConfig.getRefClazz(), "com.tencent.trpc.container.demo.GreeterServiceImp");
assertEquals(serviceConfig.getWorkerPool(), "woker_pool_provider_test2");
Expand Down Expand Up @@ -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();
Expand All @@ -271,13 +273,15 @@ public void testServerIpParse() {

@Test
public void testParseMap() {
ConfigManager.stopTest();
String path = YamlParser.class.getClassLoader().getResource("trpc_java.yaml").getPath();
Map<String, Object> map = new YamlApplicationConfigParser().parseMap(path);
Assert.assertNotEquals(map.size(), 0);
}

@Test
public void testParseMap_confPath() {
ConfigManager.stopTest();
TRpcSystemProperties.setProperties(TRpcSystemProperties.CONFIG_PATH, "");
Map<String, Object> map1 = new YamlApplicationConfigParser().parseMap("");
Assert.assertNotNull(map1);
Expand Down Expand Up @@ -314,7 +318,7 @@ public void testParseImpls() {

@Test
public void testEx() {

ConfigManager.stopTest();
try {
new YamlApplicationConfigParser().parseMap("abc");
TRpcSystemProperties.setProperties(TRpcSystemProperties.CONFIG_PATH, "abc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ server:
registrys:
polaris2:
namespace: java-sdk-test-service2
token: xxx
token: xxxx
instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549
name: trpc.TestApp.TestServer.Greeter3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ plugins:
register_self: true
service:
- namespace: java-sdk-test-service1 #环境类型,分正式production和非正式development两种类型
token: xxxxx #服务注册所需要的 token
token: xxxx #服务注册所需要的 token
instance_id: feda4ceffed0b7b08cf5ec665dcd320e50434549 #服务注册所需要的 id
name: trpc.TestApp.TestServer.Greeter
selector:
Expand Down