Skip to content

Commit 99f4363

Browse files
committed
Switch to junit 5 platform for hibernate-enhance-maven-plugin module
1 parent 0b0d933 commit 99f4363

File tree

5 files changed

+37
-32
lines changed

5 files changed

+37
-32
lines changed

tooling/hibernate-enhance-maven-plugin/hibernate-enhance-maven-plugin.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ processResources.doLast {
106106
}
107107

108108
processResources.dependsOn processPluginXml
109-
// Use the "old" junit platform for this module as the JUnit platform will do nested class loading
110-
// which is interfering with the enhancement test, as classes are loaded before enhancement
111-
test.useJUnit()
109+
// We need this filter here, otherwise Gradle or the JUnit Jupiter platform will load classes at a point
110+
// when they are not yet enhanced, leading to test failures
111+
test.include '**/*Test.class'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.hibernate.orm.tooling.maven;
2+
3+
import javax.persistence.MappedSuperclass;
4+
5+
@MappedSuperclass
6+
public class ChildEntity extends ParentEntity {
7+
8+
String childValue;
9+
10+
}

tooling/hibernate-enhance-maven-plugin/src/test/java/org/hibernate/orm/tooling/maven/MavenEnhancePluginTest.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
import org.junit.Test;
1414
import org.sonatype.plexus.build.incremental.DefaultBuildContext;
1515

16-
import javax.persistence.Entity;
17-
import javax.persistence.Id;
18-
import javax.persistence.MappedSuperclass;
1916
import java.io.File;
2017
import java.lang.reflect.Field;
2118
import java.net.URL;
@@ -79,30 +76,4 @@ private boolean declaresManaged(Class<?> clazz) {
7976
return false;
8077
}
8178

82-
// --- //
83-
84-
@MappedSuperclass
85-
public static class ParentEntity {
86-
87-
String parentValue;
88-
89-
}
90-
91-
@MappedSuperclass
92-
public static class ChildEntity extends ParentEntity {
93-
94-
String childValue;
95-
96-
}
97-
98-
@Entity
99-
public static class TestEntity extends ChildEntity {
100-
101-
@Id
102-
long id;
103-
104-
String testValue;
105-
106-
}
107-
10879
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package org.hibernate.orm.tooling.maven;
2+
3+
import javax.persistence.MappedSuperclass;
4+
5+
@MappedSuperclass
6+
public class ParentEntity {
7+
8+
String parentValue;
9+
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.hibernate.orm.tooling.maven;
2+
3+
import javax.persistence.Entity;
4+
import javax.persistence.Id;
5+
6+
@Entity
7+
public class TestEntity extends ChildEntity {
8+
9+
@Id
10+
long id;
11+
12+
String testValue;
13+
14+
}

0 commit comments

Comments
 (0)