Skip to content

Commit d4ce946

Browse files
authored
Merge pull request #1761 from SunJiFengPlus/develop-translate
translate to english /sermant-integration-tests/agentcore-test
2 parents 0d7a205 + b7644cc commit d4ce946

File tree

67 files changed

+322
-320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+322
-320
lines changed

sermant-integration-tests/agentcore-test/agentcore-integration-test/src/test/java/io/sermant/agentcore/test/request/RequestTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
import java.util.Map;
2525

2626
/**
27-
* 请求测试类,采用http请求调用方式测试
27+
* HTTP request test class using HTTP calls for test
2828
*
2929
* @author tangle
3030
* @since 2023-09-07
3131
*/
3232
public class RequestTest {
3333
/**
34-
* 动态配置测试方法
34+
* Dynamic configuration test
3535
*/
3636
@Test
3737
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "DYNAMIC_CONFIG")
@@ -40,7 +40,7 @@ public void testDynamicConfig() throws IOException {
4040
}
4141

4242
/**
43-
* 动态卸载插件测试方法
43+
* Dynamic plugin uninstallation test
4444
*/
4545
@Test
4646
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "UNINSTALL_PLUGIN")
@@ -49,7 +49,7 @@ public void testUninstallPlugin() throws IOException {
4949
}
5050

5151
/**
52-
* 动态卸载Agent测试方法
52+
* Dynamic agent uninstallation test
5353
*/
5454
@Test
5555
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "UNINSTALL_AGENT")
@@ -58,7 +58,7 @@ public void testUninstallAgent() throws IOException {
5858
}
5959

6060
/**
61-
* 动态重装Agent测试方法
61+
* Dynamic agent re-installation test
6262
*/
6363
@Test
6464
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "REINSTALL_AGENT")
@@ -67,7 +67,7 @@ public void testReInstallPlugin() throws IOException {
6767
}
6868

6969
/**
70-
* 动态安装插件测试方法
70+
* Dynamic plugin installation test
7171
*/
7272
@Test
7373
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "INSTALL_PLUGIN")
@@ -76,7 +76,7 @@ public void testInstallPlugin() throws IOException {
7676
}
7777

7878
/**
79-
* agentmain启动测试方法
79+
* Agentmain startup test
8080
*/
8181
@Test
8282
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "AGENTMAIN_STARTUP")
@@ -85,7 +85,7 @@ public void testAgentmainStartup() throws IOException {
8585
}
8686

8787
/**
88-
* premain启动测试方法
88+
* Premain startup test
8989
*/
9090
@Test
9191
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "PREMAIN_STARTUP")
@@ -94,7 +94,7 @@ public void testPremainStartup() throws IOException {
9494
}
9595

9696
/**
97-
* 启动后backend的appType和service字段设置测试方法
97+
* Validates appType and service field in backend post-initialization
9898
*/
9999
@Test
100100
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "PREMAIN_STARTUP|AGENTMAIN_STARTUP")
@@ -109,7 +109,7 @@ public void testBackend() throws IOException {
109109
}
110110

111111
/**
112-
* 配置加载测试方法
112+
* Configuration loading test
113113
*/
114114
@Test
115115
@EnabledIfSystemProperty(named = "agentcore.test.type", matches = "CONFIG_LOAD")

sermant-integration-tests/agentcore-test/agentcore-integration-test/src/test/java/io/sermant/agentcore/test/request/RequestUtils.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import java.util.Map;
3434

3535
/**
36-
* http请求工具类
36+
* HTTP request util class
3737
*
3838
* @author tangle
3939
* @since 2023-09-26
@@ -45,9 +45,9 @@ private RequestUtils() {
4545
}
4646

4747
/**
48-
* 对测试请求结果进行断言判断
48+
* Asserts test request results
4949
*
50-
* @param url 测试请求接口的url
50+
* @param url Test api url
5151
*/
5252
public static void testRequest(String url) throws IOException {
5353
Map<String, Object> resultMap = convertHttpEntityToMap(getResponse(url));
@@ -57,9 +57,9 @@ public static void testRequest(String url) throws IOException {
5757
}
5858

5959
/**
60-
* 对于backend的reponse解析
60+
* Parses backend service response
6161
*
62-
* @param url 测试请求接口的url
62+
* @param url Test api url
6363
*/
6464
public static Map<String, Object> analyzingRequestBackend(String url) throws IOException {
6565
String resultStr = getResponse(url);
@@ -68,10 +68,10 @@ public static Map<String, Object> analyzingRequestBackend(String url) throws IOE
6868
}
6969

7070
/**
71-
* 获取请求结果
71+
* Get HTTP response
7272
*
73-
* @param url 测试请求接口的url
74-
* @return 请求结果Map
73+
* @param url Test api url
74+
* @return Response content
7575
*/
7676
public static String getResponse(String url) throws IOException {
7777
String response = doGet(url);
@@ -80,10 +80,10 @@ public static String getResponse(String url) throws IOException {
8080
}
8181

8282
/**
83-
* http的get请求
83+
* Send HTTP GET request
8484
*
85-
* @param url http请求url
86-
* @return 响应体body
85+
* @param url Target URL
86+
* @return Response body
8787
*/
8888
private static String doGet(String url) {
8989
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
@@ -106,10 +106,10 @@ private static String doGet(String url) {
106106
}
107107

108108
/**
109-
* JSON数据转换为Map
109+
* Converts JSON data to Map
110110
*
111-
* @param response JSON数据
112-
* @return map数据
111+
* @param response JSON string
112+
* @return Converted Map
113113
*/
114114
private static Map<String, Object> convertHttpEntityToMap(String response) throws IOException {
115115
Map<String, Object> result = new HashMap<>();

sermant-integration-tests/agentcore-test/agentcore-test-application/src/main/java/com/example/sermant/agentcore/test/application/AgentCoreTestApplication.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.net.InetSocketAddress;
2626

2727
/**
28-
* 测试应用启动类
28+
* Test application launcher class
2929
*
3030
* @author tangle
3131
* @since 2023-09-08
@@ -34,7 +34,7 @@ public class AgentCoreTestApplication {
3434
private static final int SERVER_PORT = 8915;
3535

3636
/**
37-
* 启动main方法
37+
* Start main method
3838
*
3939
* @param args
4040
* @throws IOException
@@ -50,12 +50,12 @@ public static void main(String[] args) throws IOException, IllegalAccessExceptio
5050
}
5151
HttpServer server = HttpServer.create(new InetSocketAddress(actualPort), 0);
5252

53-
// 添加URL路由
53+
// Add URL Route
5454
for (Field field : RouterPath.class.getDeclaredFields()) {
5555
server.createContext(String.valueOf(field.get(null)), new ControllerHandler());
5656
}
5757

58-
// 启动服务器
58+
// Start the server
5959
server.start();
6060
}
6161
}

sermant-integration-tests/agentcore-test/agentcore-test-application/src/main/java/com/example/sermant/agentcore/test/application/common/TestAnnotationA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25-
* 示例注解,用于作为注解拦截的示例
25+
* Test annotation for interceptors (demo purpose)
2626
*
2727
* @author luanwenfei
2828
* @since 2023-09-08

sermant-integration-tests/agentcore-test/agentcore-test-application/src/main/java/com/example/sermant/agentcore/test/application/common/TestAnnotationB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25-
* 实例注解,用于作为注解拦截的示例
25+
* Test annotation for interceptors (demo purpose)
2626
*
2727
* @author luanwenfei
2828
* @since 2023-09-08

sermant-integration-tests/agentcore-test/agentcore-test-application/src/main/java/com/example/sermant/agentcore/test/application/controller/TestController.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,25 @@
3535
import java.util.Map;
3636

3737
/**
38-
* http接口方法
38+
* HTTP API endpoints
3939
*
4040
* @author tangle
4141
* @since 2023-09-08
4242
*/
4343
public class TestController {
4444
/**
45-
* 作为服务运行成功的请求判断接口
45+
* Service health check endpoint
4646
*
47-
* @return “OK”
47+
* @return "OK"
4848
*/
4949
public String ping() {
5050
return "OK";
5151
}
5252

5353
/**
54-
* 测试动态配置
54+
* Tests dynamic configuration
5555
*
56-
* @return 测试结果
56+
* @return test results
5757
*/
5858
public Map<String, Object> testDynamicConfig() {
5959
Map<String, Object> resultMap = new HashMap<>();
@@ -70,9 +70,9 @@ public Map<String, Object> testDynamicConfig() {
7070
}
7171

7272
/**
73-
* 测试动态安装插件
73+
* Tests dynamic plugin installation
7474
*
75-
* @return 测试结果
75+
* @return test results
7676
*/
7777
public Map<String, Object> testInstallPlugin() {
7878
Map<String, Object> resultMap = new HashMap<>();
@@ -84,9 +84,9 @@ public Map<String, Object> testInstallPlugin() {
8484
}
8585

8686
/**
87-
* Test dynamic installation plugins
87+
* Tests dynamic plugin update
8888
*
89-
* @return test result
89+
* @return test results
9090
*/
9191
public Map<String, Object> testUpdatePlugin() {
9292
Map<String, Object> resultMap = new HashMap<>();
@@ -97,9 +97,9 @@ public Map<String, Object> testUpdatePlugin() {
9797
}
9898

9999
/**
100-
* 测试动态卸载插件
100+
* Tests dynamic plugin uninstallation
101101
*
102-
* @return 测试结果
102+
* @return test results
103103
*/
104104
public Map<String, Object> testUninstallPlugin() {
105105
Map<String, Object> resultMap = new HashMap<>();
@@ -113,9 +113,9 @@ public Map<String, Object> testUninstallPlugin() {
113113
}
114114

115115
/**
116-
* 测试动态卸载agent
116+
* Tests agent uninstallation
117117
*
118-
* @return 测试结果
118+
* @return test results
119119
*/
120120
public Map<String, Object> testUninstallAgent() {
121121
Map<String, Object> resultMap = new HashMap<>();
@@ -127,9 +127,9 @@ public Map<String, Object> testUninstallAgent() {
127127
}
128128

129129
/**
130-
* 测试动态重装agent
130+
* Tests agent re-installation
131131
*
132-
* @return 测试结果
132+
* @return test results
133133
*/
134134
public Map<String, Object> testReInstallAgent() {
135135
Map<String, Object> resultMap = new HashMap<>();
@@ -141,9 +141,9 @@ public Map<String, Object> testReInstallAgent() {
141141
}
142142

143143
/**
144-
* 测试premain启动
144+
* Tests premain startup
145145
*
146-
* @return 测试结果
146+
* @return test results
147147
*/
148148
public Map<String, Object> testPremainStartup() {
149149
Map<String, Object> resultMap = new HashMap<>();
@@ -157,9 +157,9 @@ public Map<String, Object> testPremainStartup() {
157157
}
158158

159159
/**
160-
* 测试agentmain启动
160+
* Tests agentmain startup
161161
*
162-
* @return 测试结果
162+
* @return test results
163163
*/
164164
public Map<String, Object> testAgentmainStartup() {
165165
Map<String, Object> resultMap = new HashMap<>();
@@ -175,9 +175,9 @@ public Map<String, Object> testAgentmainStartup() {
175175
}
176176

177177
/**
178-
* 测试配置加载功能
178+
* Tests configuration loading
179179
*
180-
* @return 测试结果
180+
* @return test results
181181
*/
182182
public Map<String, Object> testCoreAndPluginConfigLoad() {
183183
Map<String, Object> resultMap = new HashMap<>();
@@ -191,9 +191,9 @@ public Map<String, Object> testCoreAndPluginConfigLoad() {
191191
}
192192

193193
/**
194-
* 测试类匹配
194+
* Tests class matching
195195
*
196-
* @return 测试结果
196+
* @return test results
197197
*/
198198
public Map<String, Object> testClassMatch() {
199199
Map<String, Object> resultMap = new HashMap<>();
@@ -206,9 +206,9 @@ public Map<String, Object> testClassMatch() {
206206
}
207207

208208
/**
209-
* 测试方法匹配
209+
* Tests method matching
210210
*
211-
* @return 测试结果
211+
* @return test results
212212
*/
213213
public Map<String, Object> testMethodMatch() {
214214
Map<String, Object> resultMap = new HashMap<>();
@@ -221,9 +221,9 @@ public Map<String, Object> testMethodMatch() {
221221
}
222222

223223
/**
224-
* 测试方法增强
224+
* Tests method enhancement
225225
*
226-
* @return 测试结果
226+
* @return test results
227227
*/
228228
public Map<String, Object> testEnhancement() {
229229
Map<String, Object> resultMap = new HashMap<>();
@@ -236,9 +236,9 @@ public Map<String, Object> testEnhancement() {
236236
}
237237

238238
/**
239-
* 测试类的重转换能力
239+
* Tests class retransformation
240240
*
241-
* @return 测试结果
241+
* @return test results
242242
*/
243243
public Map<String, Object> testReTransform() {
244244
Map<String, Object> resultMap = new HashMap<>();

0 commit comments

Comments
 (0)