Upgrade dependencies to major versions for Spring Batch 5

* Upgrade to Jakarta EE 9
* Upgrade to Spring Framework 6
* Upgrade to Spring Integration 6
* Upgrade to Spring Data 3
* Upgrade to Spring AMQP 3
* Upgrade to Spring for Apache Kafka 3

LDIF support is still in progress waiting for the next
major version of Spring LDAP.

Closes #4027
Closes #3656
This commit is contained in:
Mahmoud Ben Hassine
2021-09-23 08:29:13 +02:00
parent 2a9904bae1
commit 5dc17b190e
197 changed files with 1295 additions and 1172 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -18,9 +18,9 @@ package org.springframework.batch.item.database;
import java.util.Iterator;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Query;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 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.
@@ -24,8 +24,8 @@ import org.springframework.dao.DataAccessResourceFailureException;
import org.springframework.orm.jpa.EntityManagerFactoryUtils;
import org.springframework.util.Assert;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import java.util.List;
/**
@@ -36,13 +36,14 @@ import java.util.List;
* It is required that {@link #write(List)} is called inside a transaction.<br>
*
* The reader must be configured with an
* {@link javax.persistence.EntityManagerFactory} that is capable of
* {@link jakarta.persistence.EntityManagerFactory} that is capable of
* participating in Spring managed transactions.
*
* The writer is thread-safe after its properties are set (normal singleton
* behaviour), so it can be used to write in multiple concurrent transactions.
*
* @author Thomas Risberg
* @author Mahmoud Ben Hassine
*
*/
public class JpaItemWriter<T> implements ItemWriter<T>, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 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.
@@ -21,10 +21,10 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.EntityTransaction;
import jakarta.persistence.Query;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.database.orm.JpaQueryProvider;
@@ -65,7 +65,7 @@ import org.springframework.util.ClassUtils;
*
* <p>
* The reader must be configured with an
* {@link javax.persistence.EntityManagerFactory}. All entity access is
* {@link jakarta.persistence.EntityManagerFactory}. All entity access is
* performed within a new transaction, independent of any existing Spring
* managed transactions.
* </p>
@@ -81,6 +81,7 @@ import org.springframework.util.ClassUtils;
* @author Thomas Risberg
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
* @since 2.0
*/
public class JpaPagingItemReader<T> extends AbstractPagingItemReader<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -17,7 +17,7 @@ package org.springframework.batch.item.database.builder;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamSupport;
@@ -145,7 +145,7 @@ public class JpaCursorItemReaderBuilder<T> {
* {@link #queryString}.
*
* @param entityManagerFactory {@link EntityManagerFactory} used to create
* {@link javax.persistence.EntityManager}
* {@link jakarta.persistence.EntityManager}
* @return this instance for method chaining
*/
public JpaCursorItemReaderBuilder<T> entityManagerFactory(EntityManagerFactory entityManagerFactory) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 the original author or authors.
* Copyright 2018-2021 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.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database.builder;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.database.JpaItemWriter;
import org.springframework.util.Assert;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2021 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.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.database.builder;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.database.JpaPagingItemReader;
import org.springframework.batch.item.database.orm.JpaQueryProvider;
@@ -184,7 +184,7 @@ public class JpaPagingItemReaderBuilder<T> {
* {@link #queryString}.
*
* @param entityManagerFactory {@link EntityManagerFactory} used to create
* {@link javax.persistence.EntityManager}
* {@link jakarta.persistence.EntityManager}
* @return this instance for method chaining
*/
public JpaPagingItemReaderBuilder<T> entityManagerFactory(EntityManagerFactory entityManagerFactory) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import org.springframework.beans.factory.InitializingBean;
@@ -29,6 +29,7 @@ import org.springframework.beans.factory.InitializingBean;
*
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
* @since 2.1
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database.orm;
import javax.persistence.Query;
import jakarta.persistence.Query;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.Query;
import jakarta.persistence.Query;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -29,6 +29,7 @@ import org.springframework.util.StringUtils;
* </p>
*
* @author Anatoly Polinsky
* @author Mahmoud Ben Hassine
*
* @param <E> entity returned by executing the query
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.database.orm;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import org.springframework.batch.item.ItemReader;
@@ -27,6 +27,7 @@ import org.springframework.batch.item.ItemReader;
*
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
* @since 2.1
*
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 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.
@@ -25,7 +25,7 @@ import org.springframework.jms.core.JmsTemplate;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import javax.jms.Message;
import jakarta.jms.Message;
/**
* An {@link ItemReader} for JMS using a {@link JmsTemplate}. The template
@@ -37,6 +37,7 @@ import javax.jms.Message;
* singleton behavior).
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsItemReader<T> implements ItemReader<T>, InitializingBean {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.jms;
import javax.jms.JMSException;
import javax.jms.Message;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.retry.interceptor.MethodArgumentsKeyGenerator;
@@ -26,6 +26,7 @@ import org.springframework.retry.interceptor.MethodArgumentsKeyGenerator;
* A {@link MethodArgumentsKeyGenerator} for JMS
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsMethodArgumentsKeyGenerator implements MethodArgumentsKeyGenerator {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.jms;
import javax.jms.JMSException;
import javax.jms.Message;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
import org.springframework.retry.interceptor.NewMethodArgumentsIdentifier;
@@ -27,6 +27,7 @@ import org.springframework.retry.interceptor.NewMethodArgumentsIdentifier;
* the arguments and checks its delivery status.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class JmsNewMethodArgumentsIdentifier<T> implements NewMethodArgumentsIdentifier {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2021 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.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.jms.builder;
import javax.jms.Message;
import jakarta.jms.Message;
import org.springframework.batch.item.jms.JmsItemReader;
import org.springframework.jms.core.JmsOperations;
@@ -26,6 +26,7 @@ import org.springframework.util.Assert;
* Creates a fully qualified JmsItemReader.
*
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
*
* @since 4.0
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010 the original author or authors.
* Copyright 2006-2021 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.
@@ -25,7 +25,7 @@ import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMailMessage;
import org.springframework.util.Assert;
import javax.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMessage;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -54,6 +54,7 @@ import java.util.Map.Entry;
* </p>
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
* @since 2.1
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2018-2019 the original author or authors.
* Copyright 2018-2021 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.
@@ -16,7 +16,7 @@
package org.springframework.batch.item.validator;
import javax.validation.Validator;
import jakarta.validation.Validator;
import org.springframework.util.Assert;
import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 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.
@@ -17,8 +17,8 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import javax.batch.api.chunk.ItemReader;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemWriter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -37,6 +37,7 @@ import org.springframework.util.SerializationUtils;
* {@link ItemReader#checkpointInfo()} or {@link ItemWriter#checkpointInfo()} calls.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public abstract class CheckpointSupport extends ItemStreamSupport{

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 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.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.jsr.item;
import javax.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemProcessor;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2019 the original author or authors.
* Copyright 2013-2021 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.
@@ -17,7 +17,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import javax.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemReader;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
@@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils;
* to the corresponding method on the delegate.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ItemReaderAdapter<T> extends CheckpointSupport implements org.springframework.batch.item.ItemReader<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 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.
@@ -18,7 +18,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import java.util.List;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.ItemWriter;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@@ -28,6 +28,7 @@ import org.springframework.util.ClassUtils;
* to the corresponding method on the delegate.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class ItemWriterAdapter<T> extends CheckpointSupport implements org.springframework.batch.item.ItemWriter<T> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2021 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.
@@ -15,8 +15,8 @@
*/
package org.springframework.batch.jsr.repeat;
import javax.batch.api.chunk.CheckpointAlgorithm;
import javax.batch.operations.BatchRuntimeException;
import jakarta.batch.api.chunk.CheckpointAlgorithm;
import jakarta.batch.operations.BatchRuntimeException;
import org.springframework.batch.repeat.CompletionPolicy;
import org.springframework.batch.repeat.RepeatContext;
@@ -28,6 +28,7 @@ import org.springframework.util.Assert;
* of the framework.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @see CheckpointAlgorithm
* @see CompletionPolicy
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -26,9 +26,9 @@ import org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy
import org.springframework.jms.listener.DefaultMessageListenerContainer;
import org.springframework.transaction.interceptor.TransactionInterceptor;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import jakarta.jms.JMSException;
import jakarta.jms.MessageConsumer;
import jakarta.jms.Session;
/**
* Message listener container adapted for intercepting the message reception
@@ -49,6 +49,7 @@ import javax.jms.Session;
* the JMS session from synchronizing with the database transaction.
*
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
*/
public class BatchMessageListenerContainer extends DefaultMessageListenerContainer {
@@ -121,7 +122,7 @@ public class BatchMessageListenerContainer extends DefaultMessageListenerContain
/**
* Override base class method to wrap call in advice if provided.
* @see org.springframework.jms.listener.AbstractPollingMessageListenerContainer#receiveAndExecute(Object,
* javax.jms.Session, javax.jms.MessageConsumer)
* jakarta.jms.Session, jakarta.jms.MessageConsumer)
*/
@Override
protected boolean receiveAndExecute(final Object invoker, final Session session, final MessageConsumer consumer)

View File

@@ -24,10 +24,10 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageListener;
import jakarta.jms.TextMessage;
import org.junit.After;
import org.junit.AfterClass;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -18,12 +18,12 @@ package org.springframework.batch.container.jms;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
import javax.jms.Session;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.MessageConsumer;
import jakarta.jms.MessageListener;
import jakarta.jms.Session;
import org.aopalliance.aop.Advice;
import org.junit.Test;

View File

@@ -17,7 +17,7 @@ package org.springframework.batch.item.database;
import java.util.Arrays;
import java.util.List;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.junit.After;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2019 the original author or authors.
* Copyright 2006-2021 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.
@@ -26,8 +26,8 @@ import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import org.junit.Before;
import org.junit.Test;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 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.
@@ -21,8 +21,8 @@ import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import jakarta.persistence.EntityManagerFactory;
import jakarta.persistence.Query;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,6 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"JpaPagingItemReaderCommonTests-context.xml"})

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2009-2014 the original author or authors.
* Copyright 2009-2021 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.
@@ -28,7 +28,7 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.Executors;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2012 the original author or authors.
* Copyright 2008-2021 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.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.junit.runner.RunWith;
import org.springframework.batch.item.AbstractItemStreamItemReaderTests;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2012 the original author or authors.
* Copyright 2008-2021 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.
@@ -17,7 +17,7 @@ package org.springframework.batch.item.database;
import java.util.Collections;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.sample.Foo;
@@ -28,6 +28,7 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
* Tests for {@link org.springframework.batch.item.database.JpaPagingItemReader}.
*
* @author Thomas Risberg
* @author Mahmoud Ben Hassine
*/
public class JpaPagingItemReaderIntegrationTests extends AbstractGenericDataSourceItemReaderIntegrationTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -15,7 +15,7 @@
*/
package org.springframework.batch.item.database;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.junit.runner.RunWith;

View File

@@ -17,7 +17,7 @@ package org.springframework.batch.item.database;
import java.util.Collections;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.junit.runner.RunWith;
@@ -40,6 +40,7 @@ import org.springframework.transaction.PlatformTransactionManager;
/**
* @author Anatoly Polinsky
* @author Dave Syer
* @author Mahmoud Ben Hassine
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = JpaPagingItemReaderNativeQueryIntegrationTests.JpaConfiguration.class)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2014 the original author or authors.
* Copyright 2008-2021 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.
@@ -17,7 +17,7 @@ package org.springframework.batch.item.database;
import java.util.Collections;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import org.junit.runner.RunWith;
import org.springframework.batch.item.sample.Foo;

View File

@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.junit.After;

View File

@@ -17,8 +17,8 @@ package org.springframework.batch.item.database.builder;
import java.util.Arrays;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityManagerFactory;
import org.junit.After;
import org.junit.Before;

View File

@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManagerFactory;
import jakarta.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.junit.After;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -15,9 +15,9 @@
*/
package org.springframework.batch.item.database.orm;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import jakarta.persistence.TypedQuery;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2008 the original author or authors.
* Copyright 2006-2021 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.
@@ -16,8 +16,8 @@
package org.springframework.batch.item.database.support;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import jakarta.persistence.EntityManager;
import jakarta.persistence.Query;
import org.junit.Test;
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.when;
* @author Anatoly Polinsky
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
*/
public class JpaNativeQueryProviderTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -25,7 +25,7 @@ import static org.junit.Assert.fail;
import java.util.Date;
import javax.jms.Message;
import jakarta.jms.Message;
import org.junit.Test;
import org.springframework.jms.core.JmsOperations;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import javax.jms.Message;
import jakarta.jms.Message;
import org.junit.Test;
@@ -27,6 +27,7 @@ import org.junit.Test;
/**
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
*
*/
public class JmsMethodArgumentsKeyGeneratorTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2021 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.
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import javax.jms.Message;
import jakarta.jms.Message;
import org.junit.Test;
@@ -27,6 +27,7 @@ import org.junit.Test;
/**
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
*
*/
public class JmsNewMethodArgumentsIdentifierTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017-2019 the original author or authors.
* Copyright 2017-2021 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.
@@ -18,7 +18,7 @@ package org.springframework.batch.item.jms.builder;
import java.util.Date;
import javax.jms.Message;
import jakarta.jms.Message;
import org.junit.Before;
import org.junit.Test;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010 the original author or authors.
* Copyright 2006-2021 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.
@@ -17,7 +17,7 @@ package org.springframework.batch.item.mail;
import static org.junit.Assert.*;
import javax.mail.MessagingException;
import jakarta.mail.MessagingException;
import org.junit.Test;
import org.springframework.mail.MailException;
@@ -27,6 +27,7 @@ import org.springframework.mail.SimpleMailMessage;
/**
* @author Dave Syer
* @author Mahmoud Ben Hassine
*
* @since 2.1
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010 the original author or authors.
* Copyright 2006-2021 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.
@@ -25,7 +25,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;
import javax.mail.MessagingException;
import jakarta.mail.MessagingException;
import org.junit.Before;
import org.junit.Test;
@@ -40,6 +40,7 @@ import org.springframework.util.ReflectionUtils;
/**
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
*
* @since 2.1
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2017 the original author or authors.
* Copyright 2017-2021 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.
@@ -20,7 +20,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;
import javax.mail.MessagingException;
import jakarta.mail.MessagingException;
import org.junit.Before;
import org.junit.Test;
@@ -41,6 +41,7 @@ import static org.mockito.Mockito.when;
/**
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
*/
public class SimpleMailMessageItemWriterBuilderTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010 the original author or authors.
* Copyright 2006-2021 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.
@@ -25,9 +25,9 @@ import java.util.Collections;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import jakarta.mail.MessagingException;
import jakarta.mail.Session;
import jakarta.mail.internet.MimeMessage;
import org.junit.Before;
import org.junit.Test;
@@ -42,6 +42,7 @@ import org.springframework.util.ReflectionUtils;
/**
* @author Dave Syer
* @author Will Schipp
* @author Mahmoud Ben Hassine
*
* @since 2.1
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2012 the original author or authors.
* Copyright 2008-2021 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.
@@ -15,9 +15,9 @@
*/
package org.springframework.batch.item.sample;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
/**
* Simple domain object for testing purposes.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019 the original author or authors.
* Copyright 2019-2021 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.
@@ -16,9 +16,9 @@
package org.springframework.batch.item.sample;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
@Entity
@Table(name = "person")

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -15,12 +15,12 @@
*/
package org.springframework.batch.item.sample.books;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import jakarta.persistence.Basic;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import java.util.List;
import java.util.Objects;
@@ -28,6 +28,7 @@ import java.util.Objects;
* Basic domain object with a lazy one-to-many association.
*
* @author Antoine Kapps
* @author Mahmoud Ben Hassine
*/
@Entity
@Table(name = "T_AUTHORS")

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 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.
@@ -15,15 +15,16 @@
*/
package org.springframework.batch.item.sample.books;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.util.Objects;
/**
* Simple domain object implied in an association with {@link Author}.
*
* @author Antoine Kapps
* @author Mahmoud Ben Hassine
*/
@Entity
@Table(name = "T_BOOKS")

View File

@@ -16,7 +16,7 @@
package org.springframework.batch.item.validator;
import javax.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotEmpty;
import org.junit.Assert;
import org.junit.Test;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2020 the original author or authors.
* Copyright 2008-2021 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.
@@ -19,7 +19,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import javax.xml.stream.XMLEventFactory;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamException;

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.item.xml.builder;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import javax.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import javax.xml.stream.XMLInputFactory;
import org.junit.Rule;

View File

@@ -22,7 +22,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import javax.xml.stream.XMLEventFactory;
import javax.xml.stream.XMLStreamException;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 the original author or authors.
* Copyright 2010-2021 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.
@@ -17,14 +17,15 @@ package org.springframework.batch.item.xml.domain;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
/**
* @author Rob Harrop
* @author Mahmoud Ben Hassine
*/
@XmlRootElement(name="trade", namespace="urn:org.springframework.batch.io.oxm.domain")
@XmlType

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 the original author or authors.
* Copyright 2010-2021 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.
@@ -17,11 +17,12 @@ package org.springframework.batch.item.xml.domain;
import java.math.BigDecimal;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
/**
* @author Rob Harrop
* @author Mahmoud Ben Hassine
*/
@XmlRootElement(name="trade")
@XmlType

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.jsr.item;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import javax.batch.api.chunk.ItemProcessor;
import jakarta.batch.api.chunk.ItemProcessor;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import javax.batch.api.chunk.ItemReader;
import jakarta.batch.api.chunk.ItemReader;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,7 +18,7 @@ package org.springframework.batch.jsr.item;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.batch.api.chunk.ItemWriter;
import jakarta.batch.api.chunk.ItemWriter;
import org.junit.Before;
import org.junit.Rule;

View File

@@ -18,10 +18,10 @@ package org.springframework.batch.repeat.jms;
import java.util.ArrayList;
import java.util.List;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import jakarta.jms.JMSException;
import jakarta.jms.Message;
import jakarta.jms.Session;
import jakarta.jms.TextMessage;
import org.junit.After;
import org.junit.Before;

View File

@@ -22,9 +22,9 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Session;
import jakarta.jms.ConnectionFactory;
import jakarta.jms.JMSException;
import jakarta.jms.Session;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@@ -0,0 +1,12 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:activemq" xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
<core xmlns="urn:activemq:core">
<persistence-enabled>false</persistence-enabled>
<security-enabled>false</security-enabled>
<jmx-management-enabled>false</jmx-management-enabled>
<journal-datasync>false</journal-datasync>
<acceptors>
<acceptor name="in-vm">vm://0</acceptor>
</acceptors>
</core>
</configuration>

View File

@@ -22,8 +22,8 @@
<property name="sessionCacheSize" value="5"/>
</bean>
<bean id="targetConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory" depends-on="brokerService">
<property name="brokerURL" value="vm://localhost?jms.prefetchPolicy.all=0"/>
<bean id="targetConnectionFactory" class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" depends-on="brokerService">
<constructor-arg name="brokerURL" value="vm://0"/>
</bean>
<bean id="txAwareConnectionFactory"
@@ -87,22 +87,9 @@
</property>
</bean>
<bean id="brokerService" class="org.apache.activemq.broker.BrokerService" init-method="start"
destroy-method="stop">
<property name="brokerName" value="broker" />
<property name="useJmx" value="false"/>
<property name="transportConnectorURIs">
<list>
<value>vm://localhost?jms.prefetchPolicy.all=0</value>
</list>
</property>
<property name="persistenceAdapter">
<bean class="org.apache.activemq.store.memory.MemoryPersistenceAdapter"/>
<!-- bean class="org.apache.activemq.store.jdbc.JDBCPersistenceAdapter">
<property name="dataSource" ref="dataSource"/>
<property name="createTablesOnStartup" value="true" />
</bean-->
</property>
<bean id="brokerService" class="org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ"
init-method="start" destroy-method="stop">
<property name="configResourcePath" value="broker.xml"/>
</bean>
</beans>