Skip to content
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

Open
wants to merge 116 commits into
base: master
Choose a base branch
from
Open

增加项目单测 #470

wants to merge 116 commits into from

Conversation

vzer200
Copy link

@vzer200 vzer200 commented Aug 27, 2024

No description provided.

test/pom.xml Outdated
<groupId>org.dromara.dynamictp</groupId>
<artifactId>dynamic-tp-spring</artifactId>
<version>1.1.8-beta</version>
<scope>compile</scope>
Copy link
Collaborator

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 {
Copy link
Collaborator

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;
Copy link
Collaborator

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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

断言有点不想关,应该断言的是执行了initialize后,线程池某些字段、状态是否跟预期相同,CorePoolSize、MaximumPoolSize 在initialize里并不会改变,所以这两断言没意义

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants