Switch to junit 5 platform for hibernate-enhance-maven-plugin module

This commit is contained in:
Christian Beikov 2021-09-01 19:49:54 +02:00
parent 0b0d9339a6
commit 99f4363a98
5 changed files with 37 additions and 32 deletions

View File

@ -106,6 +106,6 @@ processResources.doLast {
}
processResources.dependsOn processPluginXml
// Use the "old" junit platform for this module as the JUnit platform will do nested class loading
// which is interfering with the enhancement test, as classes are loaded before enhancement
test.useJUnit()
// We need this filter here, otherwise Gradle or the JUnit Jupiter platform will load classes at a point
// when they are not yet enhanced, leading to test failures
test.include '**/*Test.class'

View File

@ -0,0 +1,10 @@
package org.hibernate.orm.tooling.maven;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public class ChildEntity extends ParentEntity {
String childValue;
}

View File

@ -13,9 +13,6 @@ import org.junit.Assert;
import org.junit.Test;
import org.sonatype.plexus.build.incremental.DefaultBuildContext;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.io.File;
import java.lang.reflect.Field;
import java.net.URL;
@ -79,30 +76,4 @@ public class MavenEnhancePluginTest {
return false;
}
// --- //
@MappedSuperclass
public static class ParentEntity {
String parentValue;
}
@MappedSuperclass
public static class ChildEntity extends ParentEntity {
String childValue;
}
@Entity
public static class TestEntity extends ChildEntity {
@Id
long id;
String testValue;
}
}

View File

@ -0,0 +1,10 @@
package org.hibernate.orm.tooling.maven;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public class ParentEntity {
String parentValue;
}

View File

@ -0,0 +1,14 @@
package org.hibernate.orm.tooling.maven;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class TestEntity extends ChildEntity {
@Id
long id;
String testValue;
}