-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
增加项目单测 #470
base: master
Are you sure you want to change the base?
增加项目单测 #470
Conversation
test/pom.xml
Outdated
<groupId>org.dromara.dynamictp</groupId> | ||
<artifactId>dynamic-tp-spring</artifactId> | ||
<version>1.1.8-beta</version> | ||
<scope>compile</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要指定版本
properties.put("spring.dynamic.tp.executors[0].executorType", "common"); | ||
properties.put("spring.dynamic.tp.globalExecutorProps.executorType","eager"); | ||
void testBindDtpPropertiesWithMap() throws Exception { | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来的case就行啊,反射这部分干了啥没看懂
private DtpLifecycleSpringAdapter dtpLifecycleSpringAdapter; | ||
|
||
@Autowired | ||
private LifeCycleManagement lifeCycleManagement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个test case 不明确,主要断言的应该是lifeCycleManagement状态是否跟随dtpLifecycleSpringAdapter联动
DtpLifecycleSupport.initialize(executorWrapper); | ||
|
||
Assertions.assertEquals(initialCorePoolSize, dtpExecutor.getCorePoolSize()); | ||
Assertions.assertEquals(initialMaxPoolSize, dtpExecutor.getMaximumPoolSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
断言有点不想关,应该断言的是执行了initialize后,线程池某些字段、状态是否跟预期相同,CorePoolSize、MaximumPoolSize 在initialize里并不会改变,所以这两断言没意义
# Conflicts: # core/src/main/java/org/dromara/dynamictp/core/DtpRegistry.java
# Conflicts: # core/src/main/java/org/dromara/dynamictp/core/DtpRegistry.java # core/src/main/java/org/dromara/dynamictp/core/support/DtpBannerPrinter.java
No description provided.