Search in sources :

Example 1 with ThreadPoolTaskScheduler

use of cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler in project today-framework by TAKETODAY.

the class SchedulerBeanDefinitionParserTests method threadNamePrefix.

@Test
public void threadNamePrefix() {
    ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) this.context.getBean("customScheduler");
    assertThat(scheduler.getThreadNamePrefix()).isEqualTo("customScheduler-");
}
Also used : ThreadPoolTaskScheduler(cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.jupiter.api.Test)

Example 2 with ThreadPoolTaskScheduler

use of cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler in project today-framework by TAKETODAY.

the class SchedulerBeanDefinitionParserTests method defaultScheduler.

@Test
public void defaultScheduler() {
    ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) this.context.getBean("defaultScheduler");
    Integer size = (Integer) new DirectFieldAccessor(scheduler).getPropertyValue("poolSize");
    assertThat(size).isEqualTo(1);
}
Also used : DirectFieldAccessor(cn.taketoday.beans.DirectFieldAccessor) ThreadPoolTaskScheduler(cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.jupiter.api.Test)

Example 3 with ThreadPoolTaskScheduler

use of cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler in project today-framework by TAKETODAY.

the class SchedulerBeanDefinitionParserTests method customScheduler.

@Test
public void customScheduler() {
    ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) this.context.getBean("customScheduler");
    Integer size = (Integer) new DirectFieldAccessor(scheduler).getPropertyValue("poolSize");
    assertThat(size).isEqualTo(42);
}
Also used : DirectFieldAccessor(cn.taketoday.beans.DirectFieldAccessor) ThreadPoolTaskScheduler(cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.jupiter.api.Test)

Example 4 with ThreadPoolTaskScheduler

use of cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler in project today-infrastructure by TAKETODAY.

the class SchedulerBeanDefinitionParserTests method customScheduler.

@Test
public void customScheduler() {
    ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) this.context.getBean("customScheduler");
    Integer size = (Integer) new DirectFieldAccessor(scheduler).getPropertyValue("poolSize");
    assertThat(size).isEqualTo(42);
}
Also used : DirectFieldAccessor(cn.taketoday.beans.DirectFieldAccessor) ThreadPoolTaskScheduler(cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.jupiter.api.Test)

Example 5 with ThreadPoolTaskScheduler

use of cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler in project today-infrastructure by TAKETODAY.

the class SchedulerBeanDefinitionParserTests method threadNamePrefix.

@Test
public void threadNamePrefix() {
    ThreadPoolTaskScheduler scheduler = (ThreadPoolTaskScheduler) this.context.getBean("customScheduler");
    assertThat(scheduler.getThreadNamePrefix()).isEqualTo("customScheduler-");
}
Also used : ThreadPoolTaskScheduler(cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler) Test(org.junit.jupiter.api.Test)

Aggregations

ThreadPoolTaskScheduler (cn.taketoday.scheduling.concurrent.ThreadPoolTaskScheduler)6 Test (org.junit.jupiter.api.Test)6 DirectFieldAccessor (cn.taketoday.beans.DirectFieldAccessor)4