Skip to content

Commit c5dc9d0

Browse files
committed
Create module hibernate52-test to test against hibernate 5.2
1 parent bec70d6 commit c5dc9d0

File tree

4 files changed

+112
-1
lines changed

4 files changed

+112
-1
lines changed

hibernate5/pom.xml

+12
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ Hibernate (http://hibernate.org) version 5.x data types.
9696

9797
<build>
9898
<plugins>
99+
<plugin>
100+
<groupId>org.apache.maven.plugins</groupId>
101+
<artifactId>maven-jar-plugin</artifactId>
102+
<version>3.0.2</version>
103+
<executions>
104+
<execution>
105+
<goals>
106+
<goal>test-jar</goal>
107+
</goals>
108+
</execution>
109+
</executions>
110+
</plugin>
99111
<plugin>
100112
<!-- Inherited from oss-base. Generate PackageVersion.java.-->
101113
<groupId>com.google.code.maven-replacer-plugin</groupId>

hibernate5/src/test/java/com/fasterxml/jackson/datatype/hibernate5/BaseTest.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22

33
import java.util.Arrays;
44

5+
import org.apache.log4j.Logger;
6+
57
import com.fasterxml.jackson.databind.ObjectMapper;
68

79
public abstract class BaseTest extends junit.framework.TestCase
810
{
9-
protected BaseTest() { }
11+
protected BaseTest() {
12+
try {
13+
Logger.getLogger(this.getClass()).info("Testing using hibernate " + Class.forName("org.hibernate.Version").getMethod("getVersionString").invoke(null));
14+
} catch (Exception e) {
15+
// Should not happen
16+
throw new RuntimeException(e);
17+
}
18+
}
1019

1120
protected ObjectMapper mapperWithModule(boolean forceLazyLoading)
1221
{

hibernate5_2-test/pom.xml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<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/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>com.fasterxml.jackson.datatype</groupId>
5+
<artifactId>jackson-datatype-hibernate-parent</artifactId>
6+
<version>2.8.6-SNAPSHOT</version>
7+
</parent>
8+
<artifactId>jackson-datatype-hibernate5_2-test</artifactId>
9+
<dependencies>
10+
<dependency>
11+
<groupId>com.fasterxml.jackson.datatype</groupId>
12+
<artifactId>jackson-datatype-hibernate5</artifactId>
13+
<version>2.8.6-SNAPSHOT</version>
14+
<scope>test</scope>
15+
</dependency>
16+
<dependency>
17+
<groupId>com.fasterxml.jackson.datatype</groupId>
18+
<artifactId>jackson-datatype-hibernate5</artifactId>
19+
<version>2.8.6-SNAPSHOT</version>
20+
<type>test-jar</type>
21+
<scope>test</scope>
22+
</dependency>
23+
<dependency>
24+
<groupId>org.hibernate</groupId>
25+
<artifactId>hibernate-core</artifactId>
26+
<version>5.2.0.Final</version>
27+
<scope>provided</scope>
28+
</dependency>
29+
30+
<!-- and for testing, JUnit is needed -->
31+
<dependency>
32+
<groupId>junit</groupId>
33+
<artifactId>junit</artifactId>
34+
<version>4.8.2</version>
35+
<scope>test</scope>
36+
</dependency>
37+
<!-- and for some contributed tests Mockito -->
38+
<dependency>
39+
<groupId>org.mockito</groupId>
40+
<artifactId>mockito-core</artifactId>
41+
<version>1.10.19</version>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>com.fasterxml.jackson.core</groupId>
46+
<artifactId>jackson-annotations</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.slf4j</groupId>
51+
<artifactId>slf4j-log4j12</artifactId>
52+
<version>1.6.1</version>
53+
<scope>test</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>log4j</groupId>
57+
<artifactId>log4j</artifactId>
58+
<version>1.2.16</version>
59+
<scope>test</scope>
60+
</dependency>
61+
<dependency>
62+
<groupId>com.h2database</groupId>
63+
<artifactId>h2</artifactId>
64+
<version>1.3.155</version>
65+
<scope>test</scope>
66+
</dependency>
67+
</dependencies>
68+
<profiles>
69+
<profile>
70+
<id>hibernate5_2-test</id>
71+
<activation>
72+
<jdk>1.8</jdk>
73+
</activation>
74+
<build>
75+
<plugins>
76+
<plugin>
77+
<groupId>org.apache.maven.plugins</groupId>
78+
<artifactId>maven-surefire-plugin</artifactId>
79+
<configuration>
80+
<dependenciesToScan>
81+
<dependency>com.fasterxml.jackson.datatype:jackson-datatype-hibernate5</dependency>
82+
</dependenciesToScan>
83+
</configuration>
84+
</plugin>
85+
</plugins>
86+
</build>
87+
</profile>
88+
</profiles>
89+
</project>

pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<module>hibernate3</module>
1818
<module>hibernate4</module>
1919
<module>hibernate5</module>
20+
<module>hibernate5_2-test</module>
2021
</modules>
2122

2223
<url>https://github.com/FasterXML/jackson-datatype-hibernate</url>

0 commit comments

Comments
 (0)