From b374624f211006b97584587ee89ef92c9b99706a Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Fri, 3 May 2024 12:05:16 +0200 Subject: [PATCH] [#1907] Hibernate Validator integration test --- .../build.gradle | 119 ++++++++ .../spotless.license.java | 5 + .../it/quarkus/qe/database/Author.java | 70 +++++ .../reactive/it/quarkus/qe/database/Book.java | 66 +++++ .../it/quarkus/qe/database/ISBNConverter.java | 44 +++ .../quarkus/qe/database/BaseReactiveIT.java | 279 ++++++++++++++++++ .../DatabaseHibernateReactiveTest.java | 65 ++++ .../src/test/resources/log4j2.properties | 20 ++ settings.gradle | 1 + 9 files changed, 669 insertions(+) create mode 100644 integration-tests/hibernate-validator-postgres-it/build.gradle create mode 100644 integration-tests/hibernate-validator-postgres-it/spotless.license.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Author.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Book.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/ISBNConverter.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/BaseReactiveIT.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/DatabaseHibernateReactiveTest.java create mode 100644 integration-tests/hibernate-validator-postgres-it/src/test/resources/log4j2.properties diff --git a/integration-tests/hibernate-validator-postgres-it/build.gradle b/integration-tests/hibernate-validator-postgres-it/build.gradle new file mode 100644 index 0000000000..9149fd08e8 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/build.gradle @@ -0,0 +1,119 @@ +buildscript { + repositories { + // Example: ./gradlew build -PenableMavenLocalRepo + if ( project.hasProperty( 'enableMavenLocalRepo' ) ) { + // Useful for local development, it should be disabled otherwise + mavenLocal() + } + mavenCentral() + } +} + +plugins { + id "org.hibernate.orm" version "${hibernateOrmGradlePluginVersion}" +} + +description = 'Quarkus QE integration tests' + +ext { + log4jVersion = '2.20.0' + assertjVersion = '3.24.2' +} + +dependencies { + implementation project(':hibernate-reactive-core') + implementation "org.hibernate.validator:hibernate-validator:8.0.1.Final" + runtimeOnly 'org.glassfish.expressly:expressly:5.0.0' + + // JPA metamodel generation for criteria queries (optional) + annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernateOrmVersion}" + + // Testing on one database should be enough + runtimeOnly "io.vertx:vertx-pg-client:${vertxSqlClientVersion}" + + // Allow authentication to PostgreSQL using SCRAM: + runtimeOnly 'com.ongres.scram:client:2.1' + + // logging + runtimeOnly "org.apache.logging.log4j:log4j-core:${log4jVersion}" + + // Testcontainers + testImplementation "org.testcontainers:postgresql:${testcontainersVersion}" + + // Testing + testImplementation "org.assertj:assertj-core:${assertjVersion}" + testImplementation "io.vertx:vertx-junit5:${vertxSqlClientVersion}" +} + +// Optional: enable the bytecode enhancements +//hibernate { enhancement } + +// Print a summary of the results of the tests (number of failures, successes and skipped) +// This is the same as the one in hibernate-reactive-core +def loggingSummary(db, result, desc) { + if ( !desc.parent ) { // will match the outermost suite + def output = "${db} results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)" + def repeatLength = output.length() + 1 + logger.lifecycle '\n' + ('-' * repeatLength) + '\n' + output + '\n' + ('-' * repeatLength) + } +} + +// Example: +// gradle test -Pdb=MySQL +test { + def selectedDb = project.hasProperty( 'db' ) + ? project.properties['db'] + : 'PostgreSQL' + doFirst { + systemProperty 'db', selectedDb + } + afterSuite { desc, result -> + loggingSummary( selectedDb, result, desc ) + } +} + +// Configuration for the tests +tasks.withType( Test ).configureEach { + defaultCharacterEncoding = "UTF-8" + useJUnitPlatform() + testLogging { + displayGranularity 1 + showStandardStreams = project.hasProperty('showStandardOutput') + showStackTraces = true + exceptionFormat = 'full' + events 'PASSED', 'FAILED', 'SKIPPED' + } + systemProperty 'docker', project.hasProperty( 'docker' ) ? 'true' : 'false' + systemProperty 'org.hibernate.reactive.common.InternalStateAssertions.ENFORCE', 'true' + + if ( project.hasProperty( 'includeTests' ) ) { + // Example: ./gradlew testAll -PincludeTests=DefaultPortTest + filter { + includeTestsMatching project.properties['includeTests'] ?: '*' as String + } + } +} + + +// Rule to recognize calls to testDb +// and run the tests on the selected db +// Example: +// gradle testDbMySQL testDbDB2 +tasks.addRule( "Pattern testDb" ) { String taskName -> + if ( taskName.startsWith( "testDb" ) ) { + tasks.register( taskName, Test ) { + def dbName = taskName.substring( "testDb".length() ) + description = "Run tests for ${dbName}" + + // We only want to test this on Postgres + onlyIf { dbName.toLowerCase().startsWith( 'p' ) } + doFirst() { + systemProperty 'db', dbName + } + afterSuite { desc, result -> + loggingSummary( dbName, result, desc ) + } + + } + } +} \ No newline at end of file diff --git a/integration-tests/hibernate-validator-postgres-it/spotless.license.java b/integration-tests/hibernate-validator-postgres-it/spotless.license.java new file mode 100644 index 0000000000..5e5aa9fd00 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/spotless.license.java @@ -0,0 +1,5 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ diff --git a/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Author.java b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Author.java new file mode 100644 index 0000000000..f0efa7260c --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Author.java @@ -0,0 +1,70 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.reactive.it.quarkus.qe.database; + +import static jakarta.persistence.CascadeType.PERSIST; + +import java.util.ArrayList; +import java.util.List; + + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +@Entity +@Table(name = "authors") +public class Author { + + @Id + @GeneratedValue + private Integer id; + + @NotNull + @Size(max = 10) + private String name; + + @JoinColumn(name = "author") + @OneToMany(cascade = PERSIST) + private List books = new ArrayList<>(); + + public Author(String name) { + this.name = name; + } + + public Author() { + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public @NotNull @Size(max = 1) String getName() { + return name; + } + + public void setName(@NotNull @Size(max = 1) String name) { + this.name = name; + } + + public List getBooks() { + return books; + } + + public void setBooks(List books) { + this.books = books; + } +} diff --git a/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Book.java b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Book.java new file mode 100644 index 0000000000..41459700c2 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/Book.java @@ -0,0 +1,66 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.reactive.it.quarkus.qe.database; + +import jakarta.persistence.Column; +import jakarta.persistence.Convert; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; + + +@Entity +@Table(name = "books") +@NamedQuery(name = "find_by_title_prefix", query = "from Book where title like :prefix") +public class Book { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "id", unique = true, nullable = false) + private Integer id; + + @NotNull + @Size(max = 10) + private String title; + + @NotNull + private Integer author; + + @Convert(converter = ISBNConverter.class) + private long isbn; + + public Book() { + } + + public Book(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public void setAuthor(Integer author) { + this.author = author; + } + + public long getIsbn() { + return isbn; + } + + public void setIsbn(long isbn) { + this.isbn = isbn; + } +} diff --git a/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/ISBNConverter.java b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/ISBNConverter.java new file mode 100644 index 0000000000..be177e0788 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/main/java/org/hibernate/reactive/it/quarkus/qe/database/ISBNConverter.java @@ -0,0 +1,44 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.reactive.it.quarkus.qe.database; + +import jakarta.persistence.AttributeConverter; +import jakarta.persistence.Converter; + +@Converter +public class ISBNConverter implements AttributeConverter { + + private static final int ISBN_MAX_LENGTH = 13; + + @Override + /** + * Canonical ISBN format: 978-3-16-148410-0, can be prefixed with zeroes if there is less than 13 digits + */ + public String convertToDatabaseColumn(Long number) { + String s = number.toString(); + StringBuilder result = new StringBuilder( s ); + if ( s.length() > ISBN_MAX_LENGTH ) { + throw new IllegalStateException( "ISBN " + s + " has a wrong length: " + number ); + } + int paddingLength = ISBN_MAX_LENGTH - s.length(); + result.insert( 0, "0".repeat( paddingLength ) ); + result.insert( 3, '-' ); + result.insert( 5, '-' ); + result.insert( 8, '-' ); + result.insert( 15, '-' ); + return result.toString(); + } + + @Override + public Long convertToEntityAttribute(String s) { + if ( s == null ) { + return 0L; + } + else { + return Long.parseLong( s.replaceAll( "-", "" ) ); + } + } +} diff --git a/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/BaseReactiveIT.java b/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/BaseReactiveIT.java new file mode 100644 index 0000000000..f7a2c96ed6 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/BaseReactiveIT.java @@ -0,0 +1,279 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.reactive.it.quarkus.qe.database; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +import org.hibernate.SessionFactory; +import org.hibernate.boot.registry.StandardServiceRegistry; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; +import org.hibernate.reactive.mutiny.Mutiny; +import org.hibernate.reactive.provider.ReactiveServiceRegistryBuilder; +import org.hibernate.reactive.provider.Settings; +import org.hibernate.reactive.stage.Stage; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.RegisterExtension; + +import io.smallrye.mutiny.Uni; +import io.vertx.core.Promise; +import io.vertx.core.VertxOptions; +import io.vertx.junit5.RunTestOnContext; +import io.vertx.junit5.VertxExtension; +import io.vertx.junit5.VertxTestContext; +import jakarta.persistence.criteria.CriteriaQuery; +import org.testcontainers.containers.PostgreSQLContainer; +import org.testcontainers.utility.DockerImageName; + +import static org.hibernate.reactive.util.impl.CompletionStages.loop; +import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture; + +/** + * Similar to BaseReactiveTest in the hibernate-reactive-core. + * Hopefully, one day we will reorganize the code better. + */ +@ExtendWith(VertxExtension.class) +@TestInstance(TestInstance.Lifecycle.PER_METHOD) +public abstract class BaseReactiveIT { + + // These properties are in DatabaseConfiguration in core + public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" ); + + public static final DockerImageName IMAGE_NAME = DockerImageName + .parse( "docker.io/postgres:16.2" ) + .asCompatibleSubstituteFor( "postgres" ); + + public static final String USERNAME = "hreact"; + public static final String PASSWORD = "hreact"; + public static final String DB_NAME = "hreact"; + + public static final PostgreSQLContainer postgresql = new PostgreSQLContainer<>( IMAGE_NAME ) + .withUsername( USERNAME ) + .withPassword( PASSWORD ) + .withDatabaseName( DB_NAME ) + .withReuse( true ); + + + private static SessionFactory ormSessionFactory; + + /** + * Configure Vertx JUnit5 test context + */ + @RegisterExtension + static RunTestOnContext testOnContext = new RunTestOnContext( vertxOptions() ); + + private static VertxOptions vertxOptions() { + return new VertxOptions() + .setBlockedThreadCheckInterval( 5 ) + .setBlockedThreadCheckIntervalUnit( TimeUnit.MINUTES ); + } + + /** + * Configure properties defined in {@link Settings}. + */ + protected void setProperties(Configuration configuration) { + setDefaultProperties( configuration ); + } + + /** + * Configure default properties common to most tests. + */ + public static void setDefaultProperties(Configuration configuration) { + configuration.setProperty( Settings.HBM2DDL_AUTO, "create" ); + configuration.setProperty( Settings.URL, dbConnectionUrl( USE_DOCKER ) ); + configuration.setProperty( Settings.USER, USERNAME ); + configuration.setProperty( Settings.PASS, PASSWORD ); + + //Use JAVA_TOOL_OPTIONS='-Dhibernate.show_sql=true' + configuration.setProperty( Settings.SHOW_SQL, System.getProperty( Settings.SHOW_SQL, "true" ) ); + configuration.setProperty( Settings.FORMAT_SQL, System.getProperty( Settings.FORMAT_SQL, "false" ) ); + configuration.setProperty( Settings.HIGHLIGHT_SQL, System.getProperty( Settings.HIGHLIGHT_SQL, "true" ) ); + } + + private static String dbConnectionUrl(boolean enableDocker) { + if ( enableDocker ) { + // Calling start() will start the container (if not already started) + // It is required to call start() before obtaining the JDBC URL because it will contain a randomized port + postgresql.start(); + return postgresql.getJdbcUrl(); + } + + // When we don't use testcontainers we expect a database on the default url + return "postgres://localhost:5432/" + DB_NAME; + } + + /** + * These entities will be added to the configuration of the factory and + * the rows in the mapping tables deleted after each test. + *

+ * For more complicated configuration see {@link #constructConfiguration()} + * or {@link #cleanDb()}. + */ + protected Collection> annotatedEntities() { + return List.of(); + } + + /** + * XML mapping documents to be added to the configuration. + */ + protected Collection mappings() { + return List.of(); + } + + public static void test(VertxTestContext context, CompletionStage work) { + work.whenComplete( (res, err) -> { + if ( err != null ) { + context.failNow( err ); + } + else { + context.completeNow(); + } + } ); + } + + public static void test(VertxTestContext context, Uni uni) { + uni.subscribe().with( res -> context.completeNow(), context::failNow ); + } + + protected Configuration constructConfiguration() { + Configuration configuration = new Configuration(); + addEntities( configuration ); + setProperties( configuration ); + return configuration; + } + + protected void addEntities(Configuration configuration) { + for ( Class entity : annotatedEntities() ) { + configuration.addAnnotatedClass( entity ); + } + for ( String mapping : mappings() ) { + configuration.addResource( mapping ); + } + } + + public CompletionStage deleteEntities(Class... entities) { + return getSessionFactory() + .withTransaction( s -> loop( entities, entityClass -> s + .createQuery( queryForDelete( entityClass ) ) + .getResultList() + // This approach will also remove embedded collections and associated entities when possible + // (a `delete from` query will only remove the elements from one table) + .thenCompose( list -> s.remove( list.toArray( new Object[0] ) ) ) + ) ); + } + + private CriteriaQuery queryForDelete(Class entityClass) { + final CriteriaQuery query = getSessionFactory().getCriteriaBuilder().createQuery( entityClass ); + query.from( entityClass ); + return query; + } + + @BeforeEach + public void before(VertxTestContext context) { + test( context, setupSessionFactory( this::constructConfiguration ) ); + } + + + /** + * Set up one session factory shared by the tests in the class. + */ + protected CompletionStage setupSessionFactory(Configuration configuration) { + return setupSessionFactory( () -> configuration ); + } + + /** + * Set up the session factory but create the configuration only if necessary. + * + * @param confSupplier supplies the configuration for the factory + * + * @return a {@link CompletionStage} void that succeeds when the factory is ready. + */ + protected CompletionStage setupSessionFactory(Supplier confSupplier) { + CompletableFuture future = new CompletableFuture<>(); + testOnContext.vertx() + .executeBlocking( + // schema generation is a blocking operation and so it causes an + // exception when run on the Vert.x event loop. So call it using + // Vertx.executeBlocking() + promise -> startFactoryManager( promise, confSupplier ), + event -> { + if ( event.succeeded() ) { + future.complete( null ); + } + else { + future.completeExceptionally( event.cause() ); + } + } + ); + return future; + } + + private void startFactoryManager(Promise p, Supplier confSupplier) { + try { + ormSessionFactory = createHibernateSessionFactory( confSupplier.get() ); + p.complete(); + } + catch (Throwable e) { + p.fail( e ); + } + } + + private SessionFactory createHibernateSessionFactory(Configuration configuration) { + StandardServiceRegistryBuilder builder = new ReactiveServiceRegistryBuilder() + .applySettings( configuration.getProperties() ); + addServices( builder ); + StandardServiceRegistry registry = builder.build(); + configureServices( registry ); + return configuration.buildSessionFactory( registry ); + } + + protected void addServices(StandardServiceRegistryBuilder builder) { + } + + protected void configureServices(StandardServiceRegistry registry) { + } + + @AfterEach + public void after(VertxTestContext context) { + test( context, cleanDb() ); + } + + /** + * Called after each test, remove all the entities defined in {@link #annotatedEntities()} + */ + protected CompletionStage cleanDb() { + final Collection> classes = annotatedEntities(); + return classes.isEmpty() + ? voidFuture() + : deleteEntities( classes.toArray( new Class[0] ) ); + } + + @AfterAll + public static void closeFactory() { + if ( ormSessionFactory != null && ormSessionFactory.isOpen() ) { + ormSessionFactory.close(); + } + } + + protected static Stage.SessionFactory getSessionFactory() { + return ormSessionFactory.unwrap( Stage.SessionFactory.class ); + } + + + protected static Mutiny.SessionFactory getMutinySessionFactory() { + return ormSessionFactory.unwrap( Mutiny.SessionFactory.class ); + } +} diff --git a/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/DatabaseHibernateReactiveTest.java b/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/DatabaseHibernateReactiveTest.java new file mode 100644 index 0000000000..61a4c6b5b6 --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/test/java/org/hibernate/reactive/it/quarkus/qe/database/DatabaseHibernateReactiveTest.java @@ -0,0 +1,65 @@ +/* Hibernate, Relational Persistence for Idiomatic Java + * + * SPDX-License-Identifier: Apache-2.0 + * Copyright: Red Hat Inc. and Hibernate Authors + */ +package org.hibernate.reactive.it.quarkus.qe.database; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.TimeUnit; + + +import org.hibernate.HibernateException; + +import org.junit.jupiter.api.Test; + +import io.smallrye.mutiny.Uni; +import io.vertx.junit5.Timeout; +import io.vertx.junit5.VertxTestContext; +import jakarta.validation.ConstraintViolationException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture; + +@Timeout(value = 10, timeUnit = TimeUnit.MINUTES) +public class DatabaseHibernateReactiveTest extends BaseReactiveIT { + + @Override + protected Collection> annotatedEntities() { + return List.of( Book.class, Author.class ); + } + + @Override + protected CompletionStage cleanDb() { + return voidFuture(); + } + + /** + * Assert that the expected exception type is thrown. + * + * @return a {@link Uni} with the expected exception thrown by the uni we were testing. + */ + public static Uni assertThrown(Class expectedException, Uni uni) { + return uni.onItemOrFailure().transform( (s, e) -> { + assertThat( e ).isInstanceOf( expectedException ); + return (U) e; + } ); + } + + @Test + public void nameIsTooLong(VertxTestContext context) { + test( context, assertThrown( + HibernateException.class, + getMutinySessionFactory().withTransaction( s -> { + Author author = new Author(); + author.setName( "A very long long long long name ... " ); + return s.persist( author ); + } ) + ).invoke( he -> { + assertThat( he.getCause() ).isInstanceOf( ConstraintViolationException.class ); + } ) + ); + } +} diff --git a/integration-tests/hibernate-validator-postgres-it/src/test/resources/log4j2.properties b/integration-tests/hibernate-validator-postgres-it/src/test/resources/log4j2.properties new file mode 100644 index 0000000000..dd663a67eb --- /dev/null +++ b/integration-tests/hibernate-validator-postgres-it/src/test/resources/log4j2.properties @@ -0,0 +1,20 @@ +rootLogger.level = info +rootLogger.appenderRefs = console +rootLogger.appenderRef.console.ref = console + +# Print the selected dialect information +logger.hibernate-dialect.name = org.hibernate.orm.dialect +logger.hibernate-dialect.level = debug + +# SQL logging disabled by default to speed test suite execution +logger.hibernate.name = org.hibernate.SQL +logger.hibernate.level = info + +# Setting level to TRACE will show parameters values +logger.sql-parameters-values.name = org.hibernate.type +logger.sql-parameters-values.level = INFO + +appender.console.name = console +appender.console.type = Console +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %highlight{[%p]} %m%n diff --git a/settings.gradle b/settings.gradle index a0a653dea6..df3e10039d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -89,6 +89,7 @@ include 'release' include 'bytecode-enhancements-it' include 'verticle-postgres-it' include 'techempower-postgres-it' +include 'hibernate-validator-postgres-it' // Examples for ( project in rootProject.children ) {