Skip to content

Commit

Permalink
Merge pull request #155 from ppodgorsek/issue-154
Browse files Browse the repository at this point in the history
Issue #154 - Upgrade to Spring 6
  • Loading branch information
ppodgorsek authored Jun 25, 2023
2 parents 3afb5c7 + 4fea6e6 commit 6fbcbe6
Show file tree
Hide file tree
Showing 23 changed files with 143 additions and 157 deletions.
137 changes: 64 additions & 73 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -79,40 +78,41 @@
<config.path.prefix>.</config.path.prefix>
<config.path.output>target</config.path.output>

<dbunit.version>2.6.0</dbunit.version>
<doxia-module-markdown.version>1.8</doxia-module-markdown.version>
<hibernate.version>5.4.2.Final</hibernate.version>
<hikaricp.version>3.3.1</hikaricp.version>
<hsqldb.version>2.4.1</hsqldb.version>
<javax.annotation.version>1.3.2</javax.annotation.version>
<junit-jupiter.version>5.4.1</junit-jupiter.version>
<mockito.version>3.0.0</mockito.version>
<slf4j.version>1.7.26</slf4j.version>
<spring.version>5.1.6.RELEASE</spring.version>
<dbunit.version>2.7.3</dbunit.version>
<doxia-module-markdown.version>2.0.0-M6</doxia-module-markdown.version>
<hibernate.version>6.2.5.Final</hibernate.version>
<hikaricp.version>5.0.1</hikaricp.version>
<hsqldb.version>2.7.2</hsqldb.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
<junit-jupiter.version>5.9.3</junit-jupiter.version>
<mockito.version>5.4.0</mockito.version>
<poi.version>5.2.3</poi.version>
<slf4j.version>2.0.7</slf4j.version>
<spring.version>6.0.10</spring.version>

<!-- Maven plugins -->
<ant-contrib.version>1.0b3</ant-contrib.version>
<cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
<maven-clean-plugin.version>3.3.1</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
<maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
<maven-pmd-plugin.version>3.11.0</maven-pmd-plugin.version>
<maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-scm-provider-gitexe.version>1.11.1</maven-scm-provider-gitexe.version>
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>
<maven-source-plugin.version>3.0.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
<maven-surefire-report-plugin.version>2.22.1</maven-surefire-report-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
<maven-jxr-plugin.version>3.3.0</maven-jxr-plugin.version>
<maven-pmd-plugin.version>3.21.0</maven-pmd-plugin.version>
<maven-project-info-reports-plugin.version>3.4.5</maven-project-info-reports-plugin.version>
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-scm-provider-gitexe.version>2.0.1</maven-scm-provider-gitexe.version>
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<maven-surefire-report-plugin.version>3.1.2</maven-surefire-report-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<site-maven-plugin.version>0.12</site-maven-plugin.version>
</properties>

Expand Down Expand Up @@ -154,6 +154,16 @@
<artifactId>HikariCP</artifactId>
<version>${hikaricp.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
Expand All @@ -166,12 +176,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
Expand Down Expand Up @@ -254,8 +259,7 @@
</goals>
<configuration>
<target>
<copy file="../README.md"
tofile="src/site/markdown/index.md" overwrite="true" />
<copy file="../README.md" tofile="src/site/markdown/index.md" overwrite="true" />
</target>
</configuration>
</execution>
Expand All @@ -267,17 +271,11 @@
</goals>
<configuration>
<target>
<replace
file="${project.build.directory}/site/index.html"
token="&lt;title&gt;&lt;/title&gt;"
<replace file="${project.build.directory}/site/index.html" token="&lt;title&gt;&lt;/title&gt;"
value="&lt;title&gt;Spring-Test DBUnit&lt;/title&gt;" />
<replace
file="${project.build.directory}/site/faq.html"
token="&lt;title&gt;&lt;/title&gt;"
<replace file="${project.build.directory}/site/faq.html" token="&lt;title&gt;&lt;/title&gt;"
value="&lt;title&gt;Frequently Asked Questions&lt;/title&gt;" />
<replace
file="${project.build.directory}/site/sample.html"
token="&lt;title&gt;&lt;/title&gt;"
<replace file="${project.build.directory}/site/sample.html" token="&lt;title&gt;&lt;/title&gt;"
value="&lt;title&gt;Quick Start Example&lt;/title&gt;" />
</target>
</configuration>
Expand Down Expand Up @@ -418,24 +416,17 @@
<goal>run</goal>
</goals>
<configuration>
<!-- Place any Ant tasks here. You can add anything you can add between
<target> and </target> in a build.xml. -->
<!-- Place any Ant tasks here. You can add anything you can add between <target> and </target> in a build.xml. -->
<target>
<taskdef
resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath" />

<copy file="${config.path.prefix}/LICENSE"
tofile="${config.path.output}/META-INF/LICENSE"
<copy file="${config.path.prefix}/LICENSE" tofile="${config.path.output}/META-INF/LICENSE"
failonerror="true" />
<copy file="${config.path.prefix}/LICENSE"
tofile="${config.path.output}/classes/META-INF/LICENSE"
<copy file="${config.path.prefix}/LICENSE" tofile="${config.path.output}/classes/META-INF/LICENSE"
failonerror="true" />
<copy file="${config.path.prefix}/LICENSE"
tofile="${config.path.output}/test-classes/META-INF/LICENSE"
<copy file="${config.path.prefix}/LICENSE" tofile="${config.path.output}/test-classes/META-INF/LICENSE"
failonerror="true" />
<copy file="${config.path.prefix}/LICENSE"
tofile="${config.path.output}/apidocs/META-INF/LICENSE"
<copy file="${config.path.prefix}/LICENSE" tofile="${config.path.output}/apidocs/META-INF/LICENSE"
failonerror="true" />
</target>
</configuration>
Expand All @@ -457,30 +448,30 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<author>true</author>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<id>attach-javadocs</id>
<goals>
<goal>jar-no-fork</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<author>true</author>
<encoding>UTF-8</encoding>
</configuration>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
Expand Down
18 changes: 5 additions & 13 deletions spring-test-dbunit-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -125,17 +124,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
Expand All @@ -161,6 +149,10 @@
</dependency>

<!-- Expected Dependencies -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import java.util.Arrays;

import javax.sql.DataSource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.dbunit.database.IDatabaseConnection;
Expand All @@ -40,6 +38,8 @@
import com.github.springtestdbunit.operation.DatabaseOperationLookup;
import com.github.springtestdbunit.operation.DefaultDatabaseOperationLookup;

import javax.sql.DataSource;

/**
* <code>TestExecutionListener</code> which provides support for {@link DatabaseSetup &#064;DatabaseSetup},
* {@link DatabaseTearDown &#064;DatabaseTearDown} and {@link ExpectedDatabase &#064;ExpectedDatabase} annotations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.sql.DataSource;

import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.IDataSet;

Expand All @@ -34,6 +32,8 @@
import com.github.springtestdbunit.operation.DatabaseOperationLookup;
import com.github.springtestdbunit.operation.DefaultDatabaseOperationLookup;

import javax.sql.DataSource;

/**
* Annotation that can be used to configure {@link DbUnitTestExecutionListener}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@

package com.github.springtestdbunit.bean;

import javax.sql.DataSource;

import org.dbunit.database.DatabaseDataSourceConnection;
import org.dbunit.database.IDatabaseConnection;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.util.Assert;

import javax.sql.DataSource;

/**
* A {@link FactoryBean} that can be used to create a {@link #setTransactionAware transaction} aware
* {@link DatabaseDataSourceConnection} using the specified {@link #setDataSource dataSource}. Additional configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;
import javax.sql.DataSource;

import org.dbunit.dataset.datatype.IDataTypeFactory;
Expand All @@ -40,6 +39,8 @@
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;

import jakarta.annotation.Resource;

/**
* Hibernate configuration for the Core module.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
import java.util.SortedSet;
import java.util.TreeSet;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

import org.springframework.beans.factory.InitializingBean;

import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Root;

/**
* Bean that can be used to assert the {@link SampleEntity#getValue() values} from {@link SampleEntity entities}
* contained in the database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

package com.github.springtestdbunit.entity;

import javax.annotation.Resource;

import org.junit.jupiter.api.Test;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import com.github.springtestdbunit.config.CoreTestConfiguration;

import jakarta.annotation.Resource;

/**
* Test the initial state of the database to ensure that import.sql has run.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
import java.util.SortedSet;
import java.util.TreeSet;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

import org.springframework.beans.factory.InitializingBean;

import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.TypedQuery;
import jakarta.persistence.criteria.CriteriaBuilder;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Root;

/**
* Bean that can be used to assert the {@link com.github.springtestdbunit.entity.OtherSampleEntity#getValue() values}
* from {@link com.github.springtestdbunit.entity.OtherSampleEntity entities} contained in the database.
Expand Down
Loading

0 comments on commit 6fbcbe6

Please sign in to comment.