118
pom.xml
118
pom.xml
@@ -37,7 +37,7 @@
|
||||
<hibernate-70-snapshots>7.0.0-SNAPSHOT</hibernate-70-snapshots>
|
||||
<hsqldb>2.7.4</hsqldb>
|
||||
<h2>2.3.232</h2>
|
||||
<jakarta-persistence-api>3.1.0</jakarta-persistence-api>
|
||||
<jakarta-persistence-api>3.2.0</jakarta-persistence-api>
|
||||
<jsqlparser>5.2</jsqlparser>
|
||||
<mysql-connector-java>9.2.0</mysql-connector-java>
|
||||
<postgresql>42.7.5</postgresql>
|
||||
@@ -111,6 +111,44 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>all-dbs</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mysql-test</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/MySql*IntegrationTests.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>postgres-test</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/Postgres*IntegrationTests.java
|
||||
</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>eclipselink-next</id>
|
||||
<properties>
|
||||
@@ -151,6 +189,84 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-instrument</artifactId>
|
||||
<version>${spring}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<!-- override the default-test execution and exclude everything -->
|
||||
<id>default-test</id>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>**/*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>unit-test</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*UnitTests.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>integration-test</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/*IntegrationTests.java</include>
|
||||
<include>**/*Tests.java</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/*UnitTests.java</exclude>
|
||||
<exclude>**/EclipseLink*</exclude>
|
||||
<exclude>**/MySql*</exclude>
|
||||
<exclude>**/Postgres*</exclude>
|
||||
</excludes>
|
||||
<argLine>
|
||||
-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar
|
||||
</argLine>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>eclipselink-test</id>
|
||||
<goals>
|
||||
<goal>test</goal>
|
||||
</goals>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>**/EclipseLink*Tests.java</include>
|
||||
</includes>
|
||||
<argLine>
|
||||
-javaagent:${settings.localRepository}/org/eclipse/persistence/org.eclipse.persistence.jpa/${eclipselink}/org.eclipse.persistence.jpa-${eclipselink}.jar
|
||||
-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring}/spring-instrument-${spring}.jar
|
||||
</argLine>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -43,13 +43,13 @@ public class TestMetaModel implements Metamodel {
|
||||
private final Set<Class<?>> managedTypes;
|
||||
private final Lazy<EntityManagerFactory> entityManagerFactory = Lazy.of(this::init);
|
||||
private final Lazy<Metamodel> metamodel = Lazy.of(() -> entityManagerFactory.get().getMetamodel());
|
||||
private Lazy<EntityManager> enityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager());
|
||||
private final Lazy<EntityManager> entityManager = Lazy.of(() -> entityManagerFactory.get().createEntityManager());
|
||||
|
||||
TestMetaModel(Set<Class<?>> managedTypes) {
|
||||
private TestMetaModel(Set<Class<?>> managedTypes) {
|
||||
this("dynamic-tests", managedTypes);
|
||||
}
|
||||
|
||||
TestMetaModel(String persistenceUnit, Set<Class<?>> managedTypes) {
|
||||
private TestMetaModel(String persistenceUnit, Set<Class<?>> managedTypes) {
|
||||
this.persistenceUnit = persistenceUnit;
|
||||
this.managedTypes = managedTypes;
|
||||
}
|
||||
@@ -66,6 +66,11 @@ public class TestMetaModel implements Metamodel {
|
||||
return metamodel.get().entity(cls);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityType<?> entity(String s) {
|
||||
return metamodel.get().entity(s);
|
||||
}
|
||||
|
||||
public <X> ManagedType<X> managedType(Class<X> cls) {
|
||||
return metamodel.get().managedType(cls);
|
||||
}
|
||||
@@ -87,7 +92,7 @@ public class TestMetaModel implements Metamodel {
|
||||
}
|
||||
|
||||
public EntityManager entityManager() {
|
||||
return enityManager.get();
|
||||
return entityManager.get();
|
||||
}
|
||||
|
||||
EntityManagerFactory init() {
|
||||
|
||||
Reference in New Issue
Block a user