Skip to content

Commit fe5ff9a

Browse files
committed
重构自动化测试模块
1 parent e60821e commit fe5ff9a

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

discovery-plugin-test-starter/src/main/java/com/nepxion/discovery/plugin/test/aop/TestInterceptor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import com.nepxion.discovery.plugin.test.annotation.DTest;
2222
import com.nepxion.discovery.plugin.test.annotation.DTestConfig;
2323
import com.nepxion.discovery.plugin.test.constant.TestConstant;
24-
import com.nepxion.discovery.plugin.test.gray.TestOperation;
24+
import com.nepxion.discovery.plugin.test.operation.TestOperation;
2525
import com.nepxion.matrix.proxy.aop.AbstractInterceptor;
2626

2727
public class TestInterceptor extends AbstractInterceptor {
@@ -30,8 +30,8 @@ public class TestInterceptor extends AbstractInterceptor {
3030
@Autowired
3131
private TestOperation testOperation;
3232

33-
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_GRAY_AWAIT_TIME + ":3000}")
34-
private Integer awaitTime;
33+
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_CONFIG_OPERATION_AWAIT_TIME + ":3000}")
34+
private Integer configOperationAwaitTime;
3535

3636
@Override
3737
public Object invoke(MethodInvocation invocation) throws Throwable {
@@ -63,7 +63,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
6363

6464
testOperation.update(group, serviceId, executePath);
6565

66-
Thread.sleep(awaitTime);
66+
Thread.sleep(configOperationAwaitTime);
6767

6868
try {
6969
object = invocation.proceed();
@@ -74,7 +74,7 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
7474
testOperation.clear(group, serviceId);
7575
}
7676

77-
Thread.sleep(awaitTime);
77+
Thread.sleep(configOperationAwaitTime);
7878
}
7979
}
8080

discovery-plugin-test-starter/src/main/java/com/nepxion/discovery/plugin/test/configuration/TestAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.nepxion.discovery.plugin.test.aop.TestAutoScanProxy;
2020
import com.nepxion.discovery.plugin.test.aop.TestInterceptor;
2121
import com.nepxion.discovery.plugin.test.constant.TestConstant;
22-
import com.nepxion.discovery.plugin.test.gray.TestOperation;
22+
import com.nepxion.discovery.plugin.test.operation.TestOperation;
2323

2424
@Configuration
2525
public class TestAutoConfiguration {

discovery-plugin-test-starter/src/main/java/com/nepxion/discovery/plugin/test/constant/TestConstant.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
public class TestConstant {
1313
public static final String SPRING_APPLICATION_TEST_SCAN_PACKAGES = "spring.application.test.scan.packages";
14-
public static final String SPRING_APPLICATION_TEST_GRAY_CONFIGCENTER_ENABLED = "spring.application.test.gray.configcenter.enabled";
15-
public static final String SPRING_APPLICATION_TEST_GRAY_CONFIG_PRINT_ENABLED = "spring.application.test.gray.config.print.enabled";
16-
public static final String SPRING_APPLICATION_TEST_GRAY_AWAIT_TIME = "spring.application.test.gray.await.time";
14+
public static final String SPRING_APPLICATION_TEST_CONFIGCENTER_ENABLED = "spring.application.test.configcenter.enabled";
15+
public static final String SPRING_APPLICATION_TEST_CONFIG_PRINT_ENABLED = "spring.application.test.config.print.enabled";
16+
public static final String SPRING_APPLICATION_TEST_CONFIG_OPERATION_AWAIT_TIME = "spring.application.test.config.operation.await.time";
1717
public static final String SPRING_APPLICATION_TEST_CONSOLE_URL = "spring.application.test.console.url";
1818

1919
public static final String REMOTE_UPDATE_URL = "console/remote-config/update";

discovery-plugin-test-starter/src/main/java/com/nepxion/discovery/plugin/test/gray/TestOperation.java renamed to discovery-plugin-test-starter/src/main/java/com/nepxion/discovery/plugin/test/operation/TestOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.nepxion.discovery.plugin.test.gray;
1+
package com.nepxion.discovery.plugin.test.operation;
22

33
/**
44
* <p>Title: Nepxion Discovery</p>
@@ -29,10 +29,10 @@ public class TestOperation {
2929
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_CONSOLE_URL + "}")
3030
private String consoleUrl;
3131

32-
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_GRAY_CONFIGCENTER_ENABLED + ":true}")
32+
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_CONFIGCENTER_ENABLED + ":true}")
3333
private Boolean configCenterEnabled;
3434

35-
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_GRAY_CONFIG_PRINT_ENABLED + ":true}")
35+
@Value("${" + TestConstant.SPRING_APPLICATION_TEST_CONFIG_PRINT_ENABLED + ":true}")
3636
private Boolean configPrintEnabled;
3737

3838
@Autowired

0 commit comments

Comments
 (0)