Take care of some deprecations

This commit is contained in:
Henning Poettker
2023-09-21 22:43:51 +02:00
committed by Mahmoud Ben Hassine
parent cf1f34b4f9
commit f7ec69e891
10 changed files with 15 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2022 the original author or authors.
* Copyright 2006-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.item.ItemStream;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.retry.RetryListener;
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.annotation.Isolation;
@@ -90,7 +90,7 @@ class StepWithFaultTolerantProcessTaskJobParserTests {
Object txq = ReflectionTestUtils.getField(factory, "readerTransactionalQueue");
assertEquals(true, txq, "wrong reader-transactional-queue:");
Object te = ReflectionTestUtils.getField(factory, "taskExecutor");
assertEquals(ConcurrentTaskExecutor.class, te.getClass(), "wrong task-executor:");
assertEquals(SyncTaskExecutor.class, te.getClass(), "wrong task-executor:");
Object listeners = ReflectionTestUtils.getField(factory, "stepExecutionListeners");
assertEquals(2, ((Set<StepExecutionListener>) listeners).size(), "wrong number of listeners:");
Object retryListeners = ReflectionTestUtils.getField(factory, "retryListeners");

View File

@@ -181,7 +181,7 @@ class FlowJobBuilderTests {
FlowBuilder.SplitBuilder<SimpleFlow> splitBuilder = flowBuilder.split(taskExecutor);
splitBuilder.add(new FlowBuilder<Flow>("subflow1").from(step1).end());
splitBuilder.add(new FlowBuilder<Flow>("subflow2").from(step2).end());
Job job = new JobBuilder("job").repository(jobRepository).start(flowBuilder.build()).end().build();
Job job = new JobBuilder("job", jobRepository).start(flowBuilder.build()).end().build();
job.execute(execution);
assertEquals(BatchStatus.COMPLETED, execution.getStatus());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.batch.core.BatchStatus;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.ItemReadListener;
import org.springframework.batch.core.JobParameters;
@@ -42,7 +43,6 @@ import org.springframework.batch.core.annotation.BeforeWrite;
import org.springframework.batch.core.configuration.xml.DummyItemReader;
import org.springframework.batch.core.configuration.xml.DummyItemWriter;
import org.springframework.batch.core.job.SimpleJob;
import org.springframework.batch.core.listener.ChunkListenerSupport;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
import org.springframework.batch.item.ItemReader;
@@ -237,7 +237,7 @@ class StepBuilderTests {
@Test
void testReturnedTypeOfChunkListenerIsAssignableToSimpleStepBuilder() throws Exception {
testReturnedTypeOfSetterIsAssignableToSimpleStepBuilder(builder -> builder.listener(new ChunkListenerSupport() {
testReturnedTypeOfSetterIsAssignableToSimpleStepBuilder(builder -> builder.listener(new ChunkListener() {
}));
}

View File

@@ -62,11 +62,11 @@ import org.springframework.batch.item.WriteFailedException;
import org.springframework.batch.item.WriterNotOpenException;
import org.springframework.batch.item.support.AbstractItemStreamItemReader;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.jdbc.support.JdbcTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.lang.Nullable;
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.StringUtils;
@@ -870,7 +870,7 @@ public class FaultTolerantStepFactoryBeanTests {
};
factory.setItemReader(reader);
factory.setTaskExecutor(new ConcurrentTaskExecutor());
factory.setTaskExecutor(new SyncTaskExecutor());
Step step = factory.getObject();

View File

@@ -44,6 +44,6 @@
<beans:bean id="retryListener" class="org.springframework.batch.core.configuration.xml.TestRetryListener" />
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
</beans:beans>

View File

@@ -47,7 +47,7 @@
<beans:bean id="listener" class="org.springframework.batch.core.configuration.xml.TestListener" />
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
<job-repository id="jobRepository" table-prefix="BATCH_"/>

View File

@@ -53,6 +53,6 @@
<beans:bean id="retryListener" class="org.springframework.batch.core.configuration.xml.TestRetryListener" />
<beans:bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor" />
<beans:bean id="taskExecutor" class="org.springframework.core.task.SyncTaskExecutor" />
</beans:beans>