From ff60c131882477c9d5cb582297120297607fc065 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Feb 2018 15:34:55 +0100 Subject: [PATCH 001/454] HBX-1521: Update the version to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 23734d3e42..c90225a1c4 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 21e59a7dd0..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "6.0.0-SNAPSHOT"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/pom.xml b/pom.xml index 8ac0164d04..275819bc17 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 240a47d15e..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index f0ccf5c2f6..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 11177befa6..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 0944f7c29b..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 706d9da93e..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a5394bec28..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d04014beb9..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d962dd5d06..41fe62b156 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index b5d0526e35..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From 229dfe335900a910f694ea3a305c02cc3be5fbe3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Feb 2018 09:02:53 +0100 Subject: [PATCH 002/454] HBX-1522: Update Hibernate core dependency to 5.3.0.Beta2 Signed-off-by: Koen Aers --- .../org/hibernate/tool/hbm2x/pojo/EntityPOJOClass.java | 8 ++++---- pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/pojo/EntityPOJOClass.java b/main/src/main/java/org/hibernate/tool/hbm2x/pojo/EntityPOJOClass.java index 9d701e1045..feab4cb949 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/pojo/EntityPOJOClass.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/pojo/EntityPOJOClass.java @@ -257,14 +257,14 @@ else if ( "sequence".equals( strategy ) ) { else if ( TableGenerator.class.getName().equals( strategy ) ) { builder.resetAnnotation( importType("javax.persistence.GeneratedValue") ) .addAttribute( "strategy", staticImport("javax.persistence.GenerationType", "TABLE" ) ) - .addQuotedAttribute( "generator", "generator" ); + .addQuotedAttribute( "generator", clazz.getClassName()+"IdGenerator" ); idResult.append(builder.getResult()); buildAnnTableGenerator( wholeString, properties ); } else { isGenericGenerator = true; builder.resetAnnotation( importType("javax.persistence.GeneratedValue") ); - builder.addQuotedAttribute( "generator", "generator" ); + builder.addQuotedAttribute( "generator", clazz.getClassName()+"IdGenerator" ); idResult.append(builder.getResult()); } } else { @@ -274,7 +274,7 @@ else if ( TableGenerator.class.getName().equals( strategy ) ) { } if ( isGenericGenerator ) { builder.resetAnnotation( importType("org.hibernate.annotations.GenericGenerator") ) - .addQuotedAttribute( "name", "generator" ) + .addQuotedAttribute( "name", clazz.getClassName()+"IdGenerator" ) .addQuotedAttribute( "strategy", strategy); List params = new ArrayList(); @@ -301,7 +301,7 @@ else if ( TableGenerator.class.getName().equals( strategy ) ) { private void buildAnnTableGenerator(StringBuffer wholeString, Properties properties) { AnnotationBuilder builder = AnnotationBuilder.createAnnotation( importType("javax.persistence.TableGenerator") ); - builder.addQuotedAttribute( "name", "generator" ); + builder.addQuotedAttribute( "name", clazz.getClassName()+"IdGenerator" ); builder.addQuotedAttribute( "table", properties.getProperty( "generatorTableName", "hibernate_sequences" ) ); if ( ! isPropertyDefault( PersistentIdentifierGenerator.CATALOG, properties ) ) { builder.addQuotedAttribute( "catalog", properties.getProperty( PersistentIdentifierGenerator.CATALOG, "") ); diff --git a/pom.xml b/pom.xml index 275819bc17..3e163faf9f 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,7 @@ 2.3.23 1.4.194 5.0.0.Final - 5.2.12.Final + 5.3.0.Beta2 1.0.0.Final 2.3.3 7.0 From b4583802178a2c7435eac191a1ff2067b96e09e7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 9 Mar 2018 16:24:01 +0100 Subject: [PATCH 003/454] HBX-1527: Module hibernate-tools-parent needs to be installed and deployed after build Signed-off-by: Koen Aers --- main/pom.xml | 5 ----- pom.xml | 3 --- test/pom.xml | 5 +++++ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index c90225a1c4..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -55,11 +55,6 @@ - - false - false - - commons-collections diff --git a/pom.xml b/pom.xml index 3e163faf9f..6850289c4f 100644 --- a/pom.xml +++ b/pom.xml @@ -24,9 +24,6 @@ - true - true - 1.10.1 3.2.2 1.2 diff --git a/test/pom.xml b/test/pom.xml index 41fe62b156..3671832305 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -17,6 +17,11 @@ Hibernate Tools Integration Tests Parent Project + + true + true + + all From f5f684dc3cbae0b836ba6fb35f65dd0cfb162d96 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 14 Mar 2018 12:28:50 +0100 Subject: [PATCH 004/454] HBX-1533: Update version identifier to 5.3.0.Beta1 Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..be8a61aff4 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..f534a2151e 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.Beta1"; private static final Version instance = new Version(); diff --git a/pom.xml b/pom.xml index 6850289c4f..4fc5007537 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..88e9ff061a 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..761dd2786b 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..2a4cb35e49 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-hsql diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..da5df2a2b9 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..2dcc07c618 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..2ce7da9913 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..b7a5783b48 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 3671832305..98697ecfea 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..b8a1c639e4 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta1 hibernate-tools-tests-utils From dee88922338a48b628d1c5f00c0cd3fdafebbe6a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 14 Mar 2018 15:17:05 +0100 Subject: [PATCH 005/454] HBX-1534: Update the version to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index be8a61aff4..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f534a2151e..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.Beta1"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/pom.xml b/pom.xml index 4fc5007537..6850289c4f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 88e9ff061a..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 761dd2786b..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 2a4cb35e49..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index da5df2a2b9..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2dcc07c618..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 2ce7da9913..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index b7a5783b48..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 98697ecfea..3671832305 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index b8a1c639e4..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta1 + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From b8311f50fc2551bdc494ae6aa6722be3dc6b7590 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 17 Mar 2018 01:43:33 +0100 Subject: [PATCH 006/454] HBX-1027: Reveng of Oracle db finds wrong lengths for unicode CHAR columns Signed-off-by: Koen Aers --- .../reveng/dialect/OracleMetaDataDialect.java | 13 ++- .../cfg/reveng/dialect/TestCase.java | 87 +++++++++++++++++++ .../hibernate/cfg/reveng/dialect/create.sql | 1 + .../org/hibernate/cfg/reveng/dialect/drop.sql | 1 + .../tool/test/db/oracle/TestSuite.java | 1 + 5 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java create mode 100644 test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql create mode 100644 test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java index e0a7736b52..689ec1808a 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java @@ -17,6 +17,7 @@ * * @author David Channon * @author Eric Kershner (added preparedstatements HBX-817) + * @author Jacques Stadler (added HBX-1027) * */ @@ -93,9 +94,15 @@ public OracleMetaDataDialect() { /* ****** COLUMN QUERIES ******* */ private static final String SQL_COLUMN_BASE = "select a.column_name as COLUMN_NAME, a.owner as TABLE_SCHEM, " + "decode(a.nullable,'N',0,1) as NULLABLE, " - + "decode(a.data_type, 'FLOAT',decode(a.data_precision,null, " - + "a.data_length, a.data_precision), 'NUMBER', decode(a.data_precision,null, " - + "a.data_length, a.data_precision), a.data_length) as COLUMN_SIZE, " + + "decode(a.data_type, " + + "'FLOAT', decode(a.data_precision, null, a.data_length, a.data_precision), " + + "'NUMBER', decode(a.data_precision, null, a.data_length, a.data_precision), " + + "'VARCHAR2', a.char_length, " + + "'VARCHAR', a.char_length, " + + "'NVARCHAR2', a.char_length, " + + "'CHAR', a.char_length, " + + "'NCHAR', a.char_length, " + + "a.data_length) as COLUMN_SIZE, " + "decode(a.data_type,'CHAR',1, 'DATE',91, 'FLOAT',6, " + "'LONG',-1, 'NUMBER',2, 'VARCHAR2',12, 'BFILE',-13, " + "'BLOB',2004, 'CLOB',2005, 'MLSLABEL',1111, 'NCHAR',1, 'NCLOB',2005, 'NVARCHAR2',12, " diff --git a/test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java b/test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java new file mode 100644 index 0000000000..dab7e9b9b9 --- /dev/null +++ b/test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java @@ -0,0 +1,87 @@ +package org.hibernate.cfg.reveng.dialect; + +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.cfg.Environment; +import org.hibernate.cfg.reveng.DefaultDatabaseCollector; +import org.hibernate.cfg.reveng.ReverseEngineeringRuntimeInfo; +import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider; +import org.hibernate.engine.jdbc.spi.JdbcServices; +import org.hibernate.service.ServiceRegistry; +import org.hibernate.tools.test.util.JdbcUtil; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertThat; + +public class TestCase { + + private Properties properties = null; + private ServiceRegistry serviceRegistry; + + @Before + public void setUp() { + JdbcUtil.createDatabase(this); + properties = Environment.getProperties(); + StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder(); + serviceRegistry = ssrb.build(); + } + + @After + public void tearDown() { + JdbcUtil.dropDatabase(this); + } + + @Test + public void testColumnTypeSizes() { + MetaDataDialect dialect = configureOracleMetaDataDialect(); + + assertSqlTypeLengths(dialect, "a_varchar2_char", "VARCHAR2", 10, 0); + assertSqlTypeLengths(dialect, "a_varchar2_byte", "VARCHAR2", 10, 0); + assertSqlTypeLengths(dialect, "a_varchar_char", "VARCHAR2", 10, 0); + assertSqlTypeLengths(dialect, "a_varchar_byte", "VARCHAR2", 10, 0); + assertSqlTypeLengths(dialect, "a_nvarchar", "NVARCHAR2", 10, 0); + assertSqlTypeLengths(dialect, "a_char_char", "CHAR", 10, 0); + assertSqlTypeLengths(dialect, "a_char_byte", "CHAR", 10, 0); + assertSqlTypeLengths(dialect, "a_nchar_char", "NCHAR", 10, 0); + assertSqlTypeLengths(dialect, "a_nchar_byte", "NCHAR", 10, 0); + assertSqlTypeLengths(dialect, "a_number_int", "NUMBER", 10, 0); + assertSqlTypeLengths(dialect, "a_number_dec", "NUMBER", 10, 2); + assertSqlTypeLengths(dialect, "a_float", "FLOAT", 10, 0); + } + + private MetaDataDialect configureOracleMetaDataDialect() { + MetaDataDialect dialect = new OracleMetaDataDialect(); + JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class); + ConnectionProvider connectionProvider = serviceRegistry.getService(ConnectionProvider.class); + dialect.configure( + ReverseEngineeringRuntimeInfo.createInstance( + connectionProvider, + jdbcServices.getSqlExceptionHelper().getSqlExceptionConverter(), + new DefaultDatabaseCollector(dialect))); + return dialect; + } + + private void assertSqlTypeLengths(MetaDataDialect dialect, String columnName, String typeName, int columnSize, int decimalDigits) { + columnName = columnName.toUpperCase(); + String catalog = properties.getProperty(AvailableSettings.DEFAULT_CATALOG); + String schema = properties.getProperty(AvailableSettings.DEFAULT_SCHEMA); + Iterator> columns = dialect.getColumns(catalog, schema, "PERSON", columnName); + boolean found = false; + while (columns.hasNext()) { + Map column = columns.next(); + assertThat(column.get("COLUMN_NAME"), equalTo(columnName.toUpperCase())); + assertThat(column.get("TYPE_NAME"), equalTo(typeName)); + assertThat(column.get("COLUMN_SIZE"), equalTo(columnSize)); + assertThat(column.get("DECIMAL_DIGITS"), equalTo(decimalDigits)); + found = true; + } + assertThat("Expected column '" + columnName + "'to exist.", found, equalTo(true)); + } +} diff --git a/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql b/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql new file mode 100644 index 0000000000..e04b390dc2 --- /dev/null +++ b/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql @@ -0,0 +1 @@ +CREATE TABLE person ( id NUMBER(2) PRIMARY KEY, a_varchar2_char VARCHAR2(10 CHAR), a_varchar2_byte VARCHAR2(10 BYTE), a_varchar_char VARCHAR(10 CHAR), a_varchar_byte VARCHAR(10 BYTE), a_nvarchar NVARCHAR2(10), a_char_char CHAR(10 CHAR), a_char_byte CHAR(10 BYTE), a_nchar_char NCHAR(10), a_nchar_byte NCHAR(10), a_number_int NUMBER(10), a_number_dec NUMBER(10, 2), a_float FLOAT(10)) \ No newline at end of file diff --git a/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql b/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql new file mode 100644 index 0000000000..716ca00b53 --- /dev/null +++ b/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql @@ -0,0 +1 @@ +DROP TABLE PERSON \ No newline at end of file diff --git a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java index 68c945d1ac..c0aec0a645 100644 --- a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java +++ b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java @@ -6,6 +6,7 @@ @RunWith(DbSuite.class) @SuiteClasses({ + org.hibernate.cfg.reveng.dialect.TestCase.class, org.hibernate.tool.jdbc2cfg.CompositeIdOrder.TestCase.class, org.hibernate.tool.jdbc2cfg.Views.TestCase.class, org.hibernate.tool.test.db.CommonTestSuite.class From 273d5e633a45ba7d2eff87597165a44e343b9ed6 Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Tue, 16 Jan 2018 22:05:16 +0100 Subject: [PATCH 007/454] HBX-1516: Initial migration of hibernate-tools-maven-plugin to hibernate-tools project * Copies files from https://github.com/stadler/hibernate-tools-maven-plugin as of version 1.1.0. * Adapted pom.xml to fit this project * Changed README.mds to readme.txt and adapted content * Add this maven-plugin as module to parent --- maven-plugin/lgpl.txt | 504 ++++++++++++++++++ maven-plugin/pom.xml | 166 ++++++ maven-plugin/readme.txt | 109 ++++ .../src/it/hbm2ddl/invoker.properties | 2 + maven-plugin/src/it/hbm2ddl/pom.xml | 53 ++ .../src/main/hibernate/hibernate.cfg.xml | 13 + .../src/main/hibernate/hibernate.reveng.xml | 11 + maven-plugin/src/it/hbm2ddl/test.mv.db | Bin 0 -> 28672 bytes maven-plugin/src/it/hbm2ddl/verify.groovy | 6 + .../src/it/hbm2java/invoker.properties | 2 + maven-plugin/src/it/hbm2java/pom.xml | 53 ++ .../src/main/hibernate/hibernate.cfg.xml | 13 + .../src/main/hibernate/hibernate.reveng.xml | 11 + .../main/resources/templates/pojo/Pojo.ftl | 29 + .../resources/templates/pojo/PojoFields.ftl | 7 + maven-plugin/src/it/hbm2java/test.mv.db | Bin 0 -> 28672 bytes maven-plugin/src/it/hbm2java/verify.groovy | 6 + maven-plugin/src/it/settings.xml | 46 ++ .../com/github/stadler/AbstractHbm2xMojo.java | 81 +++ .../java/com/github/stadler/Hbm2DdlMojo.java | 52 ++ .../java/com/github/stadler/Hbm2JavaMojo.java | 42 ++ maven-plugin/src/site/site.xml | 29 + pom.xml | 1 + 23 files changed, 1236 insertions(+) create mode 100644 maven-plugin/lgpl.txt create mode 100644 maven-plugin/pom.xml create mode 100644 maven-plugin/readme.txt create mode 100644 maven-plugin/src/it/hbm2ddl/invoker.properties create mode 100644 maven-plugin/src/it/hbm2ddl/pom.xml create mode 100644 maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml create mode 100644 maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml create mode 100644 maven-plugin/src/it/hbm2ddl/test.mv.db create mode 100644 maven-plugin/src/it/hbm2ddl/verify.groovy create mode 100644 maven-plugin/src/it/hbm2java/invoker.properties create mode 100644 maven-plugin/src/it/hbm2java/pom.xml create mode 100644 maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml create mode 100644 maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml create mode 100644 maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl create mode 100644 maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl create mode 100644 maven-plugin/src/it/hbm2java/test.mv.db create mode 100644 maven-plugin/src/it/hbm2java/verify.groovy create mode 100644 maven-plugin/src/it/settings.xml create mode 100644 maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java create mode 100644 maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java create mode 100644 maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java create mode 100644 maven-plugin/src/site/site.xml diff --git a/maven-plugin/lgpl.txt b/maven-plugin/lgpl.txt new file mode 100644 index 0000000000..1c03f74b99 --- /dev/null +++ b/maven-plugin/lgpl.txt @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml new file mode 100644 index 0000000000..8e06a24fe0 --- /dev/null +++ b/maven-plugin/pom.xml @@ -0,0 +1,166 @@ + + 4.0.0 + + + org.hibernate + hibernate-tools-parent + 6.0.0-SNAPSHOT + + + hibernate-tools-maven-plugin + + maven-plugin + + Hibernate Tools Maven Plugin + Maven plugin to provide hibernate-tools reverse engineering and code/schema generation abilities. + + https://stadler.github.io/hibernate-tools-maven-plugin/ + + + JIRA + http://hibernate.onjira.com/browse/HBX + + + + scm:git:git://github.com/hibernate/hibernate-tools.git + scm:git:git@github.com:hibernate/hibernate-tools.git + http://github.com/hibernate/hibernate-tools + + + + Hibernate + http://www.hibernate.org + + + + + GNU Lesser General Public License + http://www.gnu.org/licenses/lgpl-2.1.html + + + + + + stadler + Jacques Stadler + jacques.stadler+github@gmail.com + + + + + 3.0 + + + + 3.5 + 3.5.2 + + + 3.5 + 3.0.2 + 2.5.2 + 3.0.0 + 3.7.0 + 3.0.1 + 1.6 + 2.5.3 + 2.8.2 + 2.20.1 + 3.0.0 + 3.0.1 + 2.9 + 3.7 + 0.12 + + + + + + org.hibernate + hibernate-tools + ${project.version} + + + + org.apache.maven + maven-plugin-api + ${maven-plugin-api.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven-plugin-annotations.version} + provided + + + + + + + maven-plugin-plugin + + + default-descriptor + process-classes + + + help-goal + + helpmojo + + + + + + maven-invoker-plugin + + true + ${project.build.directory}/it + src/it/settings.xml + ${project.build.directory}/local-repo + verify + install + + + + integration-test + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + maven-project-info-reports-plugin + + + maven-plugin-plugin + + + + + diff --git a/maven-plugin/readme.txt b/maven-plugin/readme.txt new file mode 100644 index 0000000000..fca41775d7 --- /dev/null +++ b/maven-plugin/readme.txt @@ -0,0 +1,109 @@ +Hibernate Tools Maven Plugin +============================ +Version: 6.0.0, January 2016 + +What is it +---------- +A Maven Plugin to generate JPA Entities from an existing database using hibernate-tools. + +Development status +------------------ +Currently the plugin allows database reverse engineering configurations (JDBCMetaDataConfiguration) +to export JPA Entities (hbm2java) and Schema Files (hbm2ddl). + +History +------- +The hibernate-tools-maven-plugin was originally developed by Jacques Stadler +in the following repository and was based on version 1.1.0: +https://github.com/stadler/hibernate-tools-maven-plugin + +Licensing +--------- +This software is distributed under the terms of the FSF Lesser Gnu Public +License (see lgpl.txt). + +Maven Plugin Site +----------------- +TODO: To be migrated... +https://stadler.github.io/hibernate-tools-maven-plugin/ + +Usage +----- +TODO: To be migrated... +An example project using this plugin can be found here: +https://github.com/stadler/hibernate-tools-maven-plugin-sample + +The plugin declaration may look as follows: +``` + + com.github.stadler + hibernate-tools-maven-plugin + ${hibernate-tools-maven-plugin.version} + + + Display Help + validate + + help + + + + Entity generation + generate-sources + + hbm2java + + + ${project.basedir}/src/main/resources/templates/ + + ${project.build.directory}/generated-sources/ + false + false + + + + Schema generation + generate-resources + + hbm2ddl + + + + + SCRIPT + STDOUT + DATABASE + + + ${project.build.directory}/generated-resources/ + + CREATE + schema.ddl + ; + true + true + + + + + ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + + + ${project.basedir}/src/main/hibernate/hibernate.cfg.xml + true + true + true + true + true + + + + + com.h2database + h2 + ${h2.version} + + + + +``` diff --git a/maven-plugin/src/it/hbm2ddl/invoker.properties b/maven-plugin/src/it/hbm2ddl/invoker.properties new file mode 100644 index 0000000000..13598db400 --- /dev/null +++ b/maven-plugin/src/it/hbm2ddl/invoker.properties @@ -0,0 +1,2 @@ +invoker.java.version = 1.8+ +invoker.goals = generate-resources \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2ddl/pom.xml b/maven-plugin/src/it/hbm2ddl/pom.xml new file mode 100644 index 0000000000..e3962a340f --- /dev/null +++ b/maven-plugin/src/it/hbm2ddl/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.github.stadler + hbm2ddl + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + 1.8 + 1.4.195 + 0.1.1-SNAPSHOT + + + + + + com.github.stadler + hibernate-tools-maven-plugin + ${hibernate-tools-maven-plugin.version} + + + Schema generation + generate-resources + + hbm2ddl + + + BOTH + + + + + ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + + + + + com.h2database + h2 + ${h2.version} + + + + + + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml b/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml new file mode 100644 index 0000000000..fe2b99a46a --- /dev/null +++ b/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml @@ -0,0 +1,13 @@ + + + + + org.hibernate.dialect.H2Dialect + org.h2.Driver + jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE + sa + + 1 + true + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml b/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml new file mode 100644 index 0000000000..7ac52fd2cf --- /dev/null +++ b/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2ddl/test.mv.db b/maven-plugin/src/it/hbm2ddl/test.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..72d79270f88b69518fe17598ef53debfe7371c91 GIT binary patch literal 28672 zcmeI4TWcFf6vuZJtBI93AWCQ-S{NtPPC+O$yV{#*OJr$-L?zisa!8)c>@6{IBxB1V z^r3{d^r_Hq(9hAAmVAOd=B*IOW4}Y`XlG}4t&1bas&UB?W-qg=oio4H#sB}Aqk35> zIC}&4iCA}czw^rkV_a|_AN8M<00AHX1b_e#00KY&2mk>f00e*l5V!yY>O%L6HR%5f za91D%AOHk_01yBIKmZ5;0U!VbfB+Bx0*fUOC;7!BfIYv@vieWyewni6^D=R8q3=H* zmes;OedHf9pWt9HV3~izWRnCiRt&5bhPzMMq=A4C*KwWHlmK*=$7uGzs`OTpWl8$v zg(Tf+v-Mp`dj0D1^(+gps7sPOkbjXbOIN~S6g5|Dc;N{oTq@yG4VR^GsXdE^?M8DS zv;rUY-tIHM#RjdYxG>t@ibkB^(EJF89^udgj*td+a2kiEQY*pXif+BATYaosVy3%I z--VL63r5tfD!MIAxeJ=+7)iI@jXq_!XRz=0dk3_CNZlcuuyJ@TY(46GgXZ87-x*S8 z&oAPu;gP+8)1v$FcE=AE`^tl>0RbQY1b_e#00KY&2mk>f00cfP0u%as+I;#zQ3F@? zoU^Fu>CeqY{RfdERU<_@Mevr!1+N<_&trmDF;pw1|AXnB&e_WJzx}sP`Y39DnFWo|`D_=!?wmPh}^ALS&Ka7LoO*^b< z$3&a$xSa>vsIg0|qc2t-F^CNAlmW5v*HCq{-R*TMqcKIJOQyt%Cmt2- z(Lo*p`y5!yyuF;2@|jhV&)ihM6SXP*8)p8r=2%`L^5XC0p+lF3tf{{OE~+kMJz*PV_e zjn=PUEyvm}^IN7WEuWuHm?|29U2mk>f z00e*l5C8&c0$g>b^taIetSSCIJy*x38Bl9dBcHWJ9U z`G0M!N=O%p=~P(^wo2GdI&~JR|9|{24HsU06y^W<4(R{%7cFc90U!VbfB+Bx0zlw` z5SYk13;nOTiT)3;>bt~q&m^a(K3VAh@qBZl|7Yg^jX5gMr}jB-BhUZ8;o9yl&;RrK z|6}?8?^F5zDcVkmJojXg7iYZBLFFYGZ*sg+--`49=OX)N#zA8m=b!^;M&SqzJZ?@2 zG5R0f@D2iz{!jFG VtpB}~{wErC70;hnInRGy?qAGfE9C$H literal 0 HcmV?d00001 diff --git a/maven-plugin/src/it/hbm2ddl/verify.groovy b/maven-plugin/src/it/hbm2ddl/verify.groovy new file mode 100644 index 0000000000..14485800e0 --- /dev/null +++ b/maven-plugin/src/it/hbm2ddl/verify.groovy @@ -0,0 +1,6 @@ +import java.io.*; + +File schema = new File(basedir, "target/generated-resources/schema.ddl"); +if (!schema.isFile()) { + throw new FileNotFoundException("Could not find generated schema file: " + schema); +} diff --git a/maven-plugin/src/it/hbm2java/invoker.properties b/maven-plugin/src/it/hbm2java/invoker.properties new file mode 100644 index 0000000000..4537ab14c4 --- /dev/null +++ b/maven-plugin/src/it/hbm2java/invoker.properties @@ -0,0 +1,2 @@ +invoker.java.version = 1.8+ +invoker.goals = generate-sources \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/pom.xml b/maven-plugin/src/it/hbm2java/pom.xml new file mode 100644 index 0000000000..cf7c359284 --- /dev/null +++ b/maven-plugin/src/it/hbm2java/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.github.stadler + hbm2java + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + 1.8 + 1.4.195 + 0.1.1-SNAPSHOT + + + + + + com.github.stadler + hibernate-tools-maven-plugin + ${hibernate-tools-maven-plugin.version} + + + Entity generation + generate-sources + + hbm2java + + + ${project.basedir}/src/main/resources/templates/ + + + + + ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + + + + + com.h2database + h2 + ${h2.version} + + + + + + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml b/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml new file mode 100644 index 0000000000..fe2b99a46a --- /dev/null +++ b/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml @@ -0,0 +1,13 @@ + + + + + org.hibernate.dialect.H2Dialect + org.h2.Driver + jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE + sa + + 1 + true + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml b/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml new file mode 100644 index 0000000000..7ac52fd2cf --- /dev/null +++ b/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl b/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl new file mode 100644 index 0000000000..84ff76a5b2 --- /dev/null +++ b/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl @@ -0,0 +1,29 @@ +${pojo.getPackageDeclaration()} +// Generated ${date} by Hibernate Tools ${version} + +<#assign classbody> +<#include "PojoTypeDeclaration.ftl"/> { + +<#if !pojo.isInterface()> +<#include "PojoFields.ftl"/> + +<#include "PojoConstructors.ftl"/> + +<#include "PojoPropertyAccessors.ftl"/> + +<#include "PojoToString.ftl"/> + +<#include "PojoEqualsHashcode.ftl"/> + +<#else> +<#include "PojoInterfacePropertyAccessors.ftl"/> + + +<#include "PojoExtraClassCode.ftl"/> + +} + + +${pojo.generateImports()} +${classbody} + diff --git a/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl b/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl new file mode 100644 index 0000000000..098e5ef030 --- /dev/null +++ b/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl @@ -0,0 +1,7 @@ +<#-- // Fields --> +<#foreach field in pojo.getAllPropertiesIterator()><#if pojo.getMetaAttribAsBool(field, "gen-property", true)><#if pojo.hasMetaAttribute(field, "field-description")> /** + ${pojo.getFieldJavaDoc(field, 0)} + */ + ${pojo.getFieldModifiers(field)} ${pojo.getJavaTypeName(field, jdk5)} ${c2j.keyWordCheck(field.name)}<#if pojo.hasFieldInitializor(field, jdk5)> = ${pojo.getFieldInitialization(field, jdk5)}; + + diff --git a/maven-plugin/src/it/hbm2java/test.mv.db b/maven-plugin/src/it/hbm2java/test.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..72d79270f88b69518fe17598ef53debfe7371c91 GIT binary patch literal 28672 zcmeI4TWcFf6vuZJtBI93AWCQ-S{NtPPC+O$yV{#*OJr$-L?zisa!8)c>@6{IBxB1V z^r3{d^r_Hq(9hAAmVAOd=B*IOW4}Y`XlG}4t&1bas&UB?W-qg=oio4H#sB}Aqk35> zIC}&4iCA}czw^rkV_a|_AN8M<00AHX1b_e#00KY&2mk>f00e*l5V!yY>O%L6HR%5f za91D%AOHk_01yBIKmZ5;0U!VbfB+Bx0*fUOC;7!BfIYv@vieWyewni6^D=R8q3=H* zmes;OedHf9pWt9HV3~izWRnCiRt&5bhPzMMq=A4C*KwWHlmK*=$7uGzs`OTpWl8$v zg(Tf+v-Mp`dj0D1^(+gps7sPOkbjXbOIN~S6g5|Dc;N{oTq@yG4VR^GsXdE^?M8DS zv;rUY-tIHM#RjdYxG>t@ibkB^(EJF89^udgj*td+a2kiEQY*pXif+BATYaosVy3%I z--VL63r5tfD!MIAxeJ=+7)iI@jXq_!XRz=0dk3_CNZlcuuyJ@TY(46GgXZ87-x*S8 z&oAPu;gP+8)1v$FcE=AE`^tl>0RbQY1b_e#00KY&2mk>f00cfP0u%as+I;#zQ3F@? zoU^Fu>CeqY{RfdERU<_@Mevr!1+N<_&trmDF;pw1|AXnB&e_WJzx}sP`Y39DnFWo|`D_=!?wmPh}^ALS&Ka7LoO*^b< z$3&a$xSa>vsIg0|qc2t-F^CNAlmW5v*HCq{-R*TMqcKIJOQyt%Cmt2- z(Lo*p`y5!yyuF;2@|jhV&)ihM6SXP*8)p8r=2%`L^5XC0p+lF3tf{{OE~+kMJz*PV_e zjn=PUEyvm}^IN7WEuWuHm?|29U2mk>f z00e*l5C8&c0$g>b^taIetSSCIJy*x38Bl9dBcHWJ9U z`G0M!N=O%p=~P(^wo2GdI&~JR|9|{24HsU06y^W<4(R{%7cFc90U!VbfB+Bx0zlw` z5SYk13;nOTiT)3;>bt~q&m^a(K3VAh@qBZl|7Yg^jX5gMr}jB-BhUZ8;o9yl&;RrK z|6}?8?^F5zDcVkmJojXg7iYZBLFFYGZ*sg+--`49=OX)N#zA8m=b!^;M&SqzJZ?@2 zG5R0f@D2iz{!jFG VtpB}~{wErC70;hnInRGy?qAGfE9C$H literal 0 HcmV?d00001 diff --git a/maven-plugin/src/it/hbm2java/verify.groovy b/maven-plugin/src/it/hbm2java/verify.groovy new file mode 100644 index 0000000000..b42495d3d5 --- /dev/null +++ b/maven-plugin/src/it/hbm2java/verify.groovy @@ -0,0 +1,6 @@ +import java.io.*; + +File entity = new File(basedir, "target/generated-sources/Person.java"); +if (!entity.isFile()) { + throw new FileNotFoundException("Could not find generated JPA Entity: " + entity); +} diff --git a/maven-plugin/src/it/settings.xml b/maven-plugin/src/it/settings.xml new file mode 100644 index 0000000000..15b3aee62b --- /dev/null +++ b/maven-plugin/src/it/settings.xml @@ -0,0 +1,46 @@ + + + + + it-repo + + true + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + false + + + true + + plexus-snapshots + Plexus Snapshot Repository + https://oss.sonatype.org/content/repositories/plexus-snapshots + + + + + local.central + @localRepositoryUrl@ + + true + + + true + + + + + + \ No newline at end of file diff --git a/maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java new file mode 100644 index 0000000000..8cbc42daee --- /dev/null +++ b/maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java @@ -0,0 +1,81 @@ +package com.github.stadler; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.cfg.Configuration; +import org.hibernate.cfg.JDBCMetaDataConfiguration; +import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; +import org.hibernate.cfg.reveng.OverrideRepository; +import org.hibernate.cfg.reveng.ReverseEngineeringSettings; +import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; + +import java.io.File; + +public abstract class AbstractHbm2xMojo extends AbstractMojo { + + // For reveng strategy + @Parameter + private String packageName; + @Parameter + private File revengFile; + @Parameter(defaultValue = "true") + private boolean detectManyToMany; + @Parameter(defaultValue = "true") + private boolean detectOneToOne; + @Parameter(defaultValue = "true") + private boolean detectOptimisticLock; + @Parameter(defaultValue = "true") + private boolean createCollectionForForeignKey; + @Parameter(defaultValue = "true") + private boolean createManyToOneForForeignKey; + + // For configuration + @Parameter(defaultValue = "${project.basedir}/src/main/hibernate/hibernate.cfg.xml") + private File configFile; + + public void execute() throws MojoExecutionException, MojoFailureException { + getLog().info("Starting " + this.getClass().getSimpleName() + "..."); + ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); + JDBCMetaDataConfiguration cfg = setupJdbcMetaDataConfiguration(strategy); + executeExporter(cfg); + getLog().info("Finished " + this.getClass().getSimpleName() + "!"); + } + + private ReverseEngineeringStrategy setupReverseEngineeringStrategy() { + ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy(); + + if (revengFile != null) { + OverrideRepository override = new OverrideRepository(); + override.addFile(revengFile); + strategy = override.getReverseEngineeringStrategy(strategy); + } + + ReverseEngineeringSettings settings = + new ReverseEngineeringSettings(strategy) + .setDefaultPackageName(packageName) + .setDetectManyToMany(detectManyToMany) + .setDetectOneToOne(detectOneToOne) + .setDetectOptimisticLock(detectOptimisticLock) + .setCreateCollectionForForeignKey(createCollectionForForeignKey) + .setCreateManyToOneForForeignKey(createManyToOneForForeignKey); + + strategy.setSettings(settings); + return strategy; + } + + private JDBCMetaDataConfiguration setupJdbcMetaDataConfiguration(ReverseEngineeringStrategy strategy) { + JDBCMetaDataConfiguration cfg = new JDBCMetaDataConfiguration(); + cfg.setReverseEngineeringStrategy(strategy); + + getLog().info("Configuring using file: " + configFile + "..."); + cfg.configure(configFile); + + getLog().info("Reading from JDBC..."); + cfg.readFromJDBC(); + return cfg; + } + + protected abstract void executeExporter(Configuration cfg); +} diff --git a/maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java b/maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java new file mode 100644 index 0000000000..919cc92960 --- /dev/null +++ b/maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java @@ -0,0 +1,52 @@ +package com.github.stadler; + +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.boot.Metadata; +import org.hibernate.cfg.Configuration; +import org.hibernate.tool.hbm2ddl.SchemaExport; +import org.hibernate.tool.schema.TargetType; +import org.hibernate.tool.util.MetadataHelper; + +import java.io.File; +import java.util.EnumSet; +import java.util.Set; + +import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_RESOURCES; + +/** + * Mojo to generate DDL Scripts from an existing database. + *

+ * See https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4651 + */ +@Mojo(name = "hbm2ddl", defaultPhase = GENERATE_RESOURCES) +public class Hbm2DdlMojo extends AbstractHbm2xMojo { + + @Parameter(defaultValue = "${project.build.directory}/generated-resources/") + private File outputDirectory; + @Parameter(defaultValue = "schema.ddl") + private String outputFileName; + @Parameter(defaultValue = "SCRIPT") + private Set targetTypes; + @Parameter(defaultValue = "CREATE") + private SchemaExport.Action schemaExportAction; + @Parameter(defaultValue = ";") + private String delimiter; + @Parameter(defaultValue = "true") + private boolean format; + @Parameter(defaultValue = "true") + private boolean haltOnError; + + + @Override + protected void executeExporter(Configuration cfg) { + Metadata metadata = MetadataHelper.getMetadata(cfg); + + SchemaExport export = new SchemaExport(); + export.setOutputFile(new File(outputDirectory, outputFileName).toString()); + export.setDelimiter(delimiter); + export.setHaltOnError(haltOnError); + export.setFormat(format); + export.execute(EnumSet.copyOf(this.targetTypes), schemaExportAction, metadata); + } +} diff --git a/maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java b/maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java new file mode 100644 index 0000000000..90ce8cf1fb --- /dev/null +++ b/maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java @@ -0,0 +1,42 @@ +package com.github.stadler; + +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.cfg.Configuration; +import org.hibernate.tool.hbm2x.POJOExporter; + +import java.io.File; + +import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; + +/** + * Mojo to generate Java JPA Entities from an existing database. + *

+ * See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 + */ +@Mojo(name = "hbm2java", defaultPhase = GENERATE_SOURCES) +public class Hbm2JavaMojo extends AbstractHbm2xMojo { + + @Parameter(defaultValue = "${project.build.directory}/generated-sources/") + private File outputDirectory; + @Parameter(defaultValue = "false") + private boolean ejb3; + @Parameter(defaultValue = "false") + private boolean jdk5; + @Parameter + private String templatePath; + + protected void executeExporter(Configuration cfg) { + POJOExporter pojoExporter = new POJOExporter(cfg, outputDirectory); + if (templatePath != null) { + getLog().info("Setting template path to: " + templatePath); + pojoExporter.setTemplatePath(new String[]{templatePath}); + } + pojoExporter.getProperties().setProperty("ejb3", String.valueOf(ejb3)); + pojoExporter.getProperties().setProperty("jdk5", String.valueOf(jdk5)); + getLog().info("Starting POJO export to directory: " + outputDirectory + "..."); + pojoExporter.start(); + } + + +} diff --git a/maven-plugin/src/site/site.xml b/maven-plugin/src/site/site.xml new file mode 100644 index 0000000000..44e762a10c --- /dev/null +++ b/maven-plugin/src/site/site.xml @@ -0,0 +1,29 @@ + + + + + org.apache.maven.skins + maven-fluido-skin + 1.7 + + + + + + apache/maven-skins + right + gray + + + + + +

+ + + + + + diff --git a/pom.xml b/pom.xml index 6850289c4f..27a4f2f6da 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ main + maven-plugin test From 67d75a5014276b12a8862d2ef534de61c51b0091 Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Wed, 17 Jan 2018 22:26:04 +0100 Subject: [PATCH 008/454] HBX-1516: Switch the maven-plugin to hibernate-tools 6.0.0 API And with it switch to hibernate.properties instead of hibernate.cfg.xml file for configuration as it seems no longer to be possible to configure hibernate JDBC Configuration with xml --- maven-plugin/pom.xml | 22 +------ .../src/main/hibernate/hibernate.cfg.xml | 13 ----- .../src/main/hibernate/hibernate.cfg.xml | 13 ----- .../hibernate/mvn}/AbstractHbm2xMojo.java | 53 ++++++++++++----- .../hibernate/mvn}/Hbm2DdlMojo.java | 9 ++- .../hibernate/mvn}/Hbm2JavaMojo.java | 10 ++-- test/maven-plugin/pom.xml | 55 ++++++++++++++++++ .../src/it/hbm2ddl/invoker.properties | 0 .../maven-plugin}/src/it/hbm2ddl/pom.xml | 6 +- .../src/main/hibernate/hibernate.properties | 7 +++ .../src/main/hibernate/hibernate.reveng.xml | 0 .../maven-plugin}/src/it/hbm2ddl/test.mv.db | Bin .../src/it/hbm2ddl/verify.groovy | 0 .../src/it/hbm2java/invoker.properties | 0 .../maven-plugin}/src/it/hbm2java/pom.xml | 6 +- .../src/main/hibernate/hibernate.properties | 7 +++ .../src/main/hibernate/hibernate.reveng.xml | 0 .../main/resources/templates/pojo/Pojo.ftl | 0 .../resources/templates/pojo/PojoFields.ftl | 0 .../maven-plugin}/src/it/hbm2java/test.mv.db | Bin 28672 -> 24576 bytes .../src/it/hbm2java/verify.groovy | 0 .../maven-plugin}/src/it/settings.xml | 0 test/pom.xml | 12 ++-- 23 files changed, 132 insertions(+), 81 deletions(-) delete mode 100644 maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml delete mode 100644 maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml rename maven-plugin/src/main/java/{com/github/stadler => org/hibernate/mvn}/AbstractHbm2xMojo.java (60%) rename maven-plugin/src/main/java/{com/github/stadler => org/hibernate/mvn}/Hbm2DdlMojo.java (87%) rename maven-plugin/src/main/java/{com/github/stadler => org/hibernate/mvn}/Hbm2JavaMojo.java (79%) create mode 100644 test/maven-plugin/pom.xml rename {maven-plugin => test/maven-plugin}/src/it/hbm2ddl/invoker.properties (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2ddl/pom.xml (92%) create mode 100644 test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties rename {maven-plugin => test/maven-plugin}/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2ddl/test.mv.db (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2ddl/verify.groovy (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/invoker.properties (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/pom.xml (92%) create mode 100644 test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl (100%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/test.mv.db (77%) rename {maven-plugin => test/maven-plugin}/src/it/hbm2java/verify.groovy (100%) rename {maven-plugin => test/maven-plugin}/src/it/settings.xml (100%) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 8e06a24fe0..5e67f002ea 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -53,6 +53,9 @@ + false + false + 3.5 3.5.2 @@ -112,25 +115,6 @@ - - maven-invoker-plugin - - true - ${project.build.directory}/it - src/it/settings.xml - ${project.build.directory}/local-repo - verify - install - - - - integration-test - - run - - - - diff --git a/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml b/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml deleted file mode 100644 index fe2b99a46a..0000000000 --- a/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.cfg.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - org.hibernate.dialect.H2Dialect - org.h2.Driver - jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE - sa - - 1 - true - - \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml b/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml deleted file mode 100644 index fe2b99a46a..0000000000 --- a/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.cfg.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - org.hibernate.dialect.H2Dialect - org.h2.Driver - jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE - sa - - 1 - true - - \ No newline at end of file diff --git a/maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java similarity index 60% rename from maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java rename to maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index 8cbc42daee..33d3044dff 100644 --- a/maven-plugin/src/main/java/com/github/stadler/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -1,17 +1,22 @@ -package com.github.stadler; +package org.hibernate.mvn; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; -import org.hibernate.cfg.Configuration; -import org.hibernate.cfg.JDBCMetaDataConfiguration; +import org.apache.tools.ant.BuildException; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.OverrideRepository; import org.hibernate.cfg.reveng.ReverseEngineeringSettings; import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Properties; public abstract class AbstractHbm2xMojo extends AbstractMojo { @@ -32,14 +37,18 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { private boolean createManyToOneForForeignKey; // For configuration - @Parameter(defaultValue = "${project.basedir}/src/main/hibernate/hibernate.cfg.xml") - private File configFile; + @Parameter(defaultValue = "${project.basedir}/src/main/hibernate/hibernate.properties") + private File propertyFile; + + // Not exposed for now + private boolean preferBasicCompositeIds = true; public void execute() throws MojoExecutionException, MojoFailureException { getLog().info("Starting " + this.getClass().getSimpleName() + "..."); ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); - JDBCMetaDataConfiguration cfg = setupJdbcMetaDataConfiguration(strategy); - executeExporter(cfg); + Properties properties = loadPropertiesFile(); + MetadataDescriptor jdbcDescriptor = createJdbcDescriptor(strategy, properties); + executeExporter(jdbcDescriptor); getLog().info("Finished " + this.getClass().getSimpleName() + "!"); } @@ -65,17 +74,29 @@ private ReverseEngineeringStrategy setupReverseEngineeringStrategy() { return strategy; } - private JDBCMetaDataConfiguration setupJdbcMetaDataConfiguration(ReverseEngineeringStrategy strategy) { - JDBCMetaDataConfiguration cfg = new JDBCMetaDataConfiguration(); - cfg.setReverseEngineeringStrategy(strategy); + private Properties loadPropertiesFile() { + if (propertyFile == null) { + return null; + } - getLog().info("Configuring using file: " + configFile + "..."); - cfg.configure(configFile); + Properties properties = new Properties(); + try (FileInputStream is = new FileInputStream(propertyFile);) { + properties.load(is); + return properties; + } catch (FileNotFoundException e) { + throw new BuildException(propertyFile + " not found.", e); + } catch (IOException e) { + throw new BuildException("Problem while loading " + propertyFile, e); + } + } - getLog().info("Reading from JDBC..."); - cfg.readFromJDBC(); - return cfg; + private MetadataDescriptor createJdbcDescriptor(ReverseEngineeringStrategy strategy, Properties properties) { + return MetadataDescriptorFactory + .createJdbcDescriptor( + strategy, + properties, + preferBasicCompositeIds); } - protected abstract void executeExporter(Configuration cfg); + protected abstract void executeExporter(MetadataDescriptor metadataDescriptor); } diff --git a/maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java similarity index 87% rename from maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java rename to maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java index 919cc92960..b2b4fc2886 100644 --- a/maven-plugin/src/main/java/com/github/stadler/Hbm2DdlMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java @@ -1,12 +1,11 @@ -package com.github.stadler; +package org.hibernate.mvn; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.hibernate.boot.Metadata; -import org.hibernate.cfg.Configuration; +import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2ddl.SchemaExport; import org.hibernate.tool.schema.TargetType; -import org.hibernate.tool.util.MetadataHelper; import java.io.File; import java.util.EnumSet; @@ -39,8 +38,8 @@ public class Hbm2DdlMojo extends AbstractHbm2xMojo { @Override - protected void executeExporter(Configuration cfg) { - Metadata metadata = MetadataHelper.getMetadata(cfg); + protected void executeExporter(MetadataDescriptor metadataDescriptor) { + Metadata metadata = metadataDescriptor.createMetadata(); SchemaExport export = new SchemaExport(); export.setOutputFile(new File(outputDirectory, outputFileName).toString()); diff --git a/maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java similarity index 79% rename from maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java rename to maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java index 90ce8cf1fb..d600eee8e7 100644 --- a/maven-plugin/src/main/java/com/github/stadler/Hbm2JavaMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java @@ -1,8 +1,8 @@ -package com.github.stadler; +package org.hibernate.mvn; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; -import org.hibernate.cfg.Configuration; +import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.POJOExporter; import java.io.File; @@ -26,8 +26,10 @@ public class Hbm2JavaMojo extends AbstractHbm2xMojo { @Parameter private String templatePath; - protected void executeExporter(Configuration cfg) { - POJOExporter pojoExporter = new POJOExporter(cfg, outputDirectory); + protected void executeExporter(MetadataDescriptor metadataDescriptor) { + POJOExporter pojoExporter = new POJOExporter(); + pojoExporter.setMetadataDescriptor(metadataDescriptor); + pojoExporter.setOutputDirectory(outputDirectory); if (templatePath != null) { getLog().info("Setting template path to: " + templatePath); pojoExporter.setTemplatePath(new String[]{templatePath}); diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml new file mode 100644 index 0000000000..fe0db15186 --- /dev/null +++ b/test/maven-plugin/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + + + org.hibernate + hibernate-tools-tests-parent + 6.0.0-SNAPSHOT + + + hibernate-tools-tests-maven-plugin + + Hibernate Tools Maven Plugin Tests Project + + + 3.0.1 + + + + + org.hibernate + hibernate-tools-maven-plugin + ${project.version} + + + + + + + maven-invoker-plugin + ${maven-invoker-plugin.version} + + true + ${project.build.directory}/it + src/it/settings.xml + ${project.build.directory}/local-repo + verify + install + + + + integration-test + + run + + + + + + + + diff --git a/maven-plugin/src/it/hbm2ddl/invoker.properties b/test/maven-plugin/src/it/hbm2ddl/invoker.properties similarity index 100% rename from maven-plugin/src/it/hbm2ddl/invoker.properties rename to test/maven-plugin/src/it/hbm2ddl/invoker.properties diff --git a/maven-plugin/src/it/hbm2ddl/pom.xml b/test/maven-plugin/src/it/hbm2ddl/pom.xml similarity index 92% rename from maven-plugin/src/it/hbm2ddl/pom.xml rename to test/maven-plugin/src/it/hbm2ddl/pom.xml index e3962a340f..73aff79576 100644 --- a/maven-plugin/src/it/hbm2ddl/pom.xml +++ b/test/maven-plugin/src/it/hbm2ddl/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.github.stadler + org.hibernate hbm2ddl 0.0.1-SNAPSHOT @@ -14,13 +14,13 @@ 1.8 1.4.195 - 0.1.1-SNAPSHOT + 6.0.0-SNAPSHOT - com.github.stadler + org.hibernate hibernate-tools-maven-plugin ${hibernate-tools-maven-plugin.version} diff --git a/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties new file mode 100644 index 0000000000..71496b3adc --- /dev/null +++ b/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties @@ -0,0 +1,7 @@ +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE +hibernate.connection.username=sa +hibernate.connection.password= +hibernate.connection.pool_size=1 +hibernate.show_sql=true \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml similarity index 100% rename from maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml rename to test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml diff --git a/maven-plugin/src/it/hbm2ddl/test.mv.db b/test/maven-plugin/src/it/hbm2ddl/test.mv.db similarity index 100% rename from maven-plugin/src/it/hbm2ddl/test.mv.db rename to test/maven-plugin/src/it/hbm2ddl/test.mv.db diff --git a/maven-plugin/src/it/hbm2ddl/verify.groovy b/test/maven-plugin/src/it/hbm2ddl/verify.groovy similarity index 100% rename from maven-plugin/src/it/hbm2ddl/verify.groovy rename to test/maven-plugin/src/it/hbm2ddl/verify.groovy diff --git a/maven-plugin/src/it/hbm2java/invoker.properties b/test/maven-plugin/src/it/hbm2java/invoker.properties similarity index 100% rename from maven-plugin/src/it/hbm2java/invoker.properties rename to test/maven-plugin/src/it/hbm2java/invoker.properties diff --git a/maven-plugin/src/it/hbm2java/pom.xml b/test/maven-plugin/src/it/hbm2java/pom.xml similarity index 92% rename from maven-plugin/src/it/hbm2java/pom.xml rename to test/maven-plugin/src/it/hbm2java/pom.xml index cf7c359284..2c861977e3 100644 --- a/maven-plugin/src/it/hbm2java/pom.xml +++ b/test/maven-plugin/src/it/hbm2java/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.github.stadler + org.hibernate hbm2java 0.0.1-SNAPSHOT @@ -14,13 +14,13 @@ 1.8 1.4.195 - 0.1.1-SNAPSHOT + 6.0.0-SNAPSHOT - com.github.stadler + org.hibernate hibernate-tools-maven-plugin ${hibernate-tools-maven-plugin.version} diff --git a/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties new file mode 100644 index 0000000000..71496b3adc --- /dev/null +++ b/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties @@ -0,0 +1,7 @@ +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE +hibernate.connection.username=sa +hibernate.connection.password= +hibernate.connection.pool_size=1 +hibernate.show_sql=true \ No newline at end of file diff --git a/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml similarity index 100% rename from maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml rename to test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml diff --git a/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl b/test/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl similarity index 100% rename from maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl rename to test/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/Pojo.ftl diff --git a/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl b/test/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl similarity index 100% rename from maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl rename to test/maven-plugin/src/it/hbm2java/src/main/resources/templates/pojo/PojoFields.ftl diff --git a/maven-plugin/src/it/hbm2java/test.mv.db b/test/maven-plugin/src/it/hbm2java/test.mv.db similarity index 77% rename from maven-plugin/src/it/hbm2java/test.mv.db rename to test/maven-plugin/src/it/hbm2java/test.mv.db index 72d79270f88b69518fe17598ef53debfe7371c91..aba76d3403bc1e1b54e2526be9b9bc7c2f09288c 100644 GIT binary patch delta 833 zcmbW#&ubGw6bJB`MBR0fCSXHC6`Ru7f-K#c$?oiQQCK5*Y{eY)GP~~D(qt3z>sHv4 zN724NpyEHEAr}t{{t4bi>RIsUvFavGnne78oy(iUgL&`so%l13-{WU1DNdiSuH`t@ z!&=bscY>B9g)eC!iPo2g892_A{@Js?t!1e0)f)bu!}MAZITY?y7fnlV%Ev+5vGi7> z(Q&9S$?$lDl=aSTJ#a!EdV>2z?**;)ZX?lx@>Onq`RK}iWH>!JKbn+!wSb2PT-4s4R;Pm9$r^fFw6oxC|`u5 ziivv%ZXOIzg;%%B;JBp=xkx4>!LpTuLzCf~An$xDj7MfRC6^}iOD@O-eu6CntJ9u;w%-;uE4{pntX%*{|HV%7{>3yM-mI#EKv|hkdjcO%B|0K?8FvnlOlw~kfs?rAtC#Grd8V{%9mI` zkw8p{54{5$ZTSzPEG$U;1&qu=jNREvxqLWIgaQcR#b@c>$Io-W=h~leyN6#d1T^+0 zu^82u=e$>-0jlw{-BT$T7c@E= z(jY=E!@c|xyi|q0>mYZHf8f>b`}hgQJvh96BlmF_fyen!3c%@uw}%hz+kcV-VlG1RLvN{{Nv5#q&Xb zQId&~BGgy1r+_Hutils nodb common - h2 - hsql - mssql - oracle - mysql + maven-plugin + h2 + hsql + mssql + oracle + mysql @@ -45,6 +46,7 @@ utils nodb common + maven-plugin h2 From c6fc5b70170ca579f6c90826e5b780490fde41d3 Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Wed, 17 Jan 2018 22:51:24 +0100 Subject: [PATCH 009/454] HBX-1516: Ensure that the site works as expected and drop obsolete properties --- maven-plugin/pom.xml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 5e67f002ea..4f01f0f754 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -60,18 +60,6 @@ 3.5.2 - 3.5 - 3.0.2 - 2.5.2 - 3.0.0 - 3.7.0 - 3.0.1 - 1.6 - 2.5.3 - 2.8.2 - 2.20.1 - 3.0.0 - 3.0.1 2.9 3.7 0.12 @@ -99,6 +87,22 @@ + + + + maven-project-info-reports-plugin + ${maven-project-info-reports-plugin.version} + + + maven-site-plugin + ${maven-site-plugin.version} + + true + + + + + maven-plugin-plugin From 91ad34e8ef9a7354da788279bcb2f1c2145d3915 Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Thu, 18 Jan 2018 20:25:30 +0100 Subject: [PATCH 010/454] HBX-1516: Remove declared but unused dependency --- test/maven-plugin/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index fe0db15186..b1a32e89bf 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -19,14 +19,6 @@ 3.0.1 - - - org.hibernate - hibernate-tools-maven-plugin - ${project.version} - - - From e0bb24e04607053563164658ecefc5abe95d2fb4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 22 Mar 2018 11:07:19 +0100 Subject: [PATCH 011/454] HBX-1516: Module versions should be 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- maven-plugin/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 4f01f0f754..fd8e5fbdee 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-maven-plugin diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index b1a32e89bf..544b800fb1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 6.0.0-SNAPSHOT + 5.3.0-SNAPSHOT hibernate-tools-tests-maven-plugin From 3af360fd39a2a103755495cfe87b3c400e42af84 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 24 Mar 2018 17:23:55 +0100 Subject: [PATCH 012/454] HBX-1404: Guard against connection leaks - Initial implementation of a connection leak detection class Signed-off-by: Koen Aers --- .../tools/test/util/ConnectionLeakUtil.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java new file mode 100644 index 0000000000..1046f5f2ec --- /dev/null +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java @@ -0,0 +1,65 @@ +package org.hibernate.tools.test.util; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; + +public class ConnectionLeakUtil { + + public static ConnectionLeakUtil forH2() { + ConnectionLeakUtil result = new ConnectionLeakUtil(); + result.idleConnectionCounter = new H2IdleConnectionCounter(); + return result; + } + + private IdleConnectionCounter idleConnectionCounter = null; + + private int connectionCount = 0; + + public void initialize() { + connectionCount = idleConnectionCounter.countConnections(); + } + + public int getLeakedConnectionCount() { + int previousCount = connectionCount; + connectionCount = idleConnectionCounter.countConnections(); + return connectionCount - previousCount; + } + + private static interface IdleConnectionCounter { + int countConnections(); + } + + private static class H2IdleConnectionCounter implements IdleConnectionCounter { + private Connection newConnection() { + try { + return DriverManager.getConnection("jdbc:h2:mem:test", "sa", ""); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + public int countConnections() { + try { + int result = 0; + Connection connection = newConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery( + "SELECT COUNT(*) " + + "FROM information_schema.sessions " + + "WHERE statement IS NULL"); + while (resultSet.next()) { + result = resultSet.getInt(1); + } + statement.close(); + connection.close(); + return result; + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + } + +} From 7248a0101157d26612ea4fe9bd4993bc8dc7a6d3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 27 Mar 2018 18:03:25 +0200 Subject: [PATCH 013/454] HBX-1404: Guard against connection leaks - Improve the connection leak detection class and add tests for it Signed-off-by: Koen Aers --- .../tools/test/util/ConnectionLeakUtil.java | 9 ++++- .../test/util/ConnectionLeakUtilTest.java | 38 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java index 1046f5f2ec..82858df7ef 100644 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java @@ -6,6 +6,8 @@ import java.sql.SQLException; import java.sql.Statement; +import org.junit.Assert; + public class ConnectionLeakUtil { public static ConnectionLeakUtil forH2() { @@ -22,7 +24,12 @@ public void initialize() { connectionCount = idleConnectionCounter.countConnections(); } - public int getLeakedConnectionCount() { + public void assertNoLeaks() { + int leaked = getLeakedConnectionCount(); + Assert.assertTrue(leaked + " connections are leaked.", leaked == 0); + } + + private int getLeakedConnectionCount() { int previousCount = connectionCount; connectionCount = idleConnectionCounter.countConnections(); return connectionCount - previousCount; diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java new file mode 100644 index 0000000000..262ef0430b --- /dev/null +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java @@ -0,0 +1,38 @@ +package org.hibernate.tools.test.util; + +import java.sql.Connection; +import java.sql.DriverManager; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class ConnectionLeakUtilTest { + + private ConnectionLeakUtil connectionLeakUtil = null; + + @Before + public void before() { + connectionLeakUtil = ConnectionLeakUtil.forH2(); + connectionLeakUtil.initialize(); + } + + @Test + public void testLeaks() throws Exception { + try { + DriverManager.getConnection("jdbc:h2:mem:test", "sa", ""); + connectionLeakUtil.assertNoLeaks(); + throw new RuntimeException("should not happen"); + } catch (AssertionError e) { + Assert.assertEquals("1 connections are leaked.", e.getMessage()); + } + } + + @Test + public void testNoLeaks() throws Exception { + Connection connection = DriverManager.getConnection("jdbc:h2:mem:test", "sa", ""); + connection.close(); + connectionLeakUtil.assertNoLeaks(); + } + +} From 214fe4b5c6d131ea5b576c609f853b4af5c6dfb1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 28 Mar 2018 12:45:58 +0200 Subject: [PATCH 014/454] HBX-1538: 'formula' attribute is erroneously generated in addition to the nested element - Add test proving the problem Signed-off-by: Koen Aers --- .../tool/stat/Statistics/TestCase.java | 6 +- .../hbm2x/hbm2hbmxml/FormulaTest/Address.java | 49 +++++++++++ .../hbm2hbmxml/FormulaTest/AddressId.java | 39 +++++++++ .../hbm2hbmxml/FormulaTest/Customer.java | 34 ++++++++ .../hbm2hbmxml/FormulaTest/TestCase.java | 85 +++++++++++++++++++ .../hbm2hbmxml/FormulaTest/Customer.hbm.xml | 85 +++++++++++++++++++ 6 files changed, 293 insertions(+), 5 deletions(-) create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java create mode 100644 test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java index 87734da755..471e6e3592 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java @@ -27,11 +27,6 @@ public void tearDown() { public void testBrowser() throws Exception { MetadataSources mds = new MetadataSources(); mds.addResource("/org/hibernate/tool/stat/Statistics/UserGroup.hbm.xml"); -// StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder(); -// ssrb.applySetting("hibernate.hbm2ddl.auto", "create"); -// ssrb.applySetting("hibernate.hbm2dll.create_namespaces", true); -// ssrb.applySetting("hibernate.show_sql", true); -// Metadata md = mds.buildMetadata(ssrb.build()); Metadata md = mds.buildMetadata(); SessionFactory sf = md.buildSessionFactory(); sf.getStatistics().setStatisticsEnabled(true); @@ -57,6 +52,7 @@ public void testBrowser() throws Exception { s.createQuery( "from java.lang.Object" ).getResultList(); tx.commit(); s.close(); + sf.close(); } } diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java new file mode 100644 index 0000000000..3c157182d5 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java @@ -0,0 +1,49 @@ +package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; + +public class Address { + + private AddressId addressId; + private String street; + private String city; + private String state; + private String zip; + private Customer customer; + + public Customer getCustomer() { + return customer; + } + public void setCustomer(Customer customer) { + this.customer = customer; + } + + public String getCity() { + return city; + } + public void setCity(String city) { + this.city = city; + } + public String getState() { + return state; + } + public void setState(String state) { + this.state = state; + } + public String getStreet() { + return street; + } + public void setStreet(String street) { + this.street = street; + } + public String getZip() { + return zip; + } + public void setZip(String zip) { + this.zip = zip; + } + public AddressId getAddressId() { + return addressId; + } + public void setAddressId(AddressId addressId) { + this.addressId = addressId; + } +} diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java new file mode 100644 index 0000000000..43ca6b1be1 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java @@ -0,0 +1,39 @@ +package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; + +public class AddressId { + private String type; + private String addressId; + + public AddressId(String type, String customerId) { + this.addressId = customerId; + this.type = type; + } + + public AddressId() {} + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public String getAddressId() { + return addressId; + } + public void setAddressId(String customerId) { + this.addressId = customerId; + } + public boolean equals(Object other) { + if ( !(other instanceof AddressId) ) return false; + AddressId add = (AddressId) other; + return type.equals(add.type) && addressId.equals(add.addressId); + } + public int hashCode() { + return addressId.hashCode() + type.hashCode(); + } + + public String toString() { + return type + '#' + addressId; + } + +} diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java new file mode 100644 index 0000000000..0af5a2ee64 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java @@ -0,0 +1,34 @@ +package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; + +public class Customer { + + private String name; + private String customerId; + private Address billingAddress; + private Address shippingAddress; + + public Address getBillingAddress() { + return billingAddress; + } + public void setBillingAddress(Address billingAddress) { + this.billingAddress = billingAddress; + } + public String getCustomerId() { + return customerId; + } + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Address getShippingAddress() { + return shippingAddress; + } + public void setShippingAddress(Address shippingAddress) { + this.shippingAddress = shippingAddress; + } +} diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java new file mode 100644 index 0000000000..fa51742be4 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java @@ -0,0 +1,85 @@ +/* + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; + +import java.io.File; +import java.util.ArrayList; +import java.util.Properties; + +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; +import org.hibernate.tool.hbm2x.Exporter; +import org.hibernate.tool.hbm2x.HibernateMappingExporter; +import org.hibernate.tools.test.util.HibernateUtil; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +/** + * @author koen + */ +public class TestCase { + + private static final String[] HBM_XML_FILES = new String[] { + "Customer.hbm.xml" + }; + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private File outputDir = null; + private File resourcesDir = null; + + private Exporter hbmexporter = null; + + @Before + public void setUp() throws Exception { + outputDir = new File(temporaryFolder.getRoot(), "output"); + outputDir.mkdir(); + resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir.mkdir(); + MetadataDescriptor metadataDescriptor = HibernateUtil + .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); + hbmexporter = new HibernateMappingExporter(); + hbmexporter.setMetadataDescriptor(metadataDescriptor); + hbmexporter.setOutputDirectory(outputDir); + hbmexporter.start(); + } + + @Test + public void testReadable() { + ArrayList files = new ArrayList(4); + files.add(new File( + outputDir, + "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml")); + files.add(new File( + outputDir, + "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/BillingAddress.hbm.xml")); + files.add(new File( + outputDir, + "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/ShippingAddress.hbm.xml")); + Properties properties = new Properties(); + properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); + MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory + .createNativeDescriptor(null, files.toArray(new File[2]), properties); + Assert.assertNotNull(metadataDescriptor.createMetadata()); + } + +} diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml new file mode 100644 index 0000000000..5a878b2209 --- /dev/null +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + 'BILLING' + + + + + 'SHIPPING' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 82e1eae97002e4ed5d2e0ef54e8ffcf55106373e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 28 Mar 2018 13:39:20 +0200 Subject: [PATCH 015/454] HBX-1538: 'formula' attribute is erroneously generated in addition to the nested element - Problem solution Signed-off-by: Koen Aers --- main/src/main/resources/hbm/many-to-one.hbm.ftl | 6 ------ 1 file changed, 6 deletions(-) diff --git a/main/src/main/resources/hbm/many-to-one.hbm.ftl b/main/src/main/resources/hbm/many-to-one.hbm.ftl index 11fd1805b2..3a0cff5978 100644 --- a/main/src/main/resources/hbm/many-to-one.hbm.ftl +++ b/main/src/main/resources/hbm/many-to-one.hbm.ftl @@ -23,12 +23,6 @@ <#if !property.optimisticLocked> optimistic-lock="false" - -<#if property.value.hasFormula()> -<#assign formula = c2h.getFormulaForProperty(property)> -<#if formula?exists> - formula="${formula.text}" - > <#assign metaattributable=property> From 61ffc79ddd11e73e14a4cfe5231b00ca61d9b046 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 28 Mar 2018 15:29:08 +0200 Subject: [PATCH 016/454] HBX-1539: Update version identifier to 5.3.0.Beta2 Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..5432509c0f 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..f116d42126 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.Beta2"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fd8e5fbdee..c24e369300 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 27a4f2f6da..68a8414f14 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..4fc1c734ef 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..6b3a45140a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..0f6344a24a 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 544b800fb1..d82412e8e4 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..2dfa2cc4d0 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..6764583773 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..8b3c5406f0 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..f2765b12ca 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 97ad6b320e..7f548d1789 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..bb412c56bf 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta2 hibernate-tools-tests-utils From e8b147b4f4e2260d1bfb580574f62e9478c8e69b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 28 Mar 2018 19:18:29 +0200 Subject: [PATCH 017/454] HBX-1540: Update the version to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 5432509c0f..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f116d42126..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.Beta2"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c24e369300..fd8e5fbdee 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 68a8414f14..27a4f2f6da 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 4fc1c734ef..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 6b3a45140a..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 0f6344a24a..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index d82412e8e4..544b800fb1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 2dfa2cc4d0..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 6764583773..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 8b3c5406f0..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index f2765b12ca..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 7f548d1789..97ad6b320e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index bb412c56bf..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta2 + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From f920433388ac914f43c2ed261d23b25bd491590c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 2 Apr 2018 11:05:31 +0200 Subject: [PATCH 018/454] HBX-1541: element is generated at wrong location - add a test that shows the problem Signed-off-by: Koen Aers --- .../tool/hbm2x/hbm2hbmxml/JoinTest/Child.java | 47 +++++++++++ .../hbm2x/hbm2hbmxml/JoinTest/Parent.java | 50 +++++++++++ .../hbm2x/hbm2hbmxml/JoinTest/TestCase.java | 82 +++++++++++++++++++ .../hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml | 49 +++++++++++ 4 files changed, 228 insertions(+) create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java create mode 100644 test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java create mode 100644 test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java new file mode 100644 index 0000000000..7fc6739d69 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java @@ -0,0 +1,47 @@ +//$Id$ +package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; + +/** + * @author gavin + */ +public class Child { + private Long id; + private String name; + private Parent parent; + /** + * @return Returns the id. + */ + public Long getId() { + return id; + } + /** + * @param id The id to set. + */ + public void setId(Long id) { + this.id = id; + } + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + /** + * @param name The name to set. + */ + public void setName(String name) { + this.name = name; + } + /** + * @return Returns the parent. + */ + public Parent getParent() { + return parent; + } + /** + * @param parent The parent to set. + */ + public void setParent(Parent parent) { + this.parent = parent; + } +} diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java new file mode 100644 index 0000000000..0a272620d8 --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java @@ -0,0 +1,50 @@ +//$Id$ +package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; + +import java.util.Collection; +import java.util.HashSet; + +/** + * @author gavin + */ +public class Parent { + private Long id; + private String name; + private Collection children = new HashSet(); + /** + * @return Returns the children. + */ + public Collection getChildren() { + return children; + } + /** + * @param children The children to set. + */ + public void setChildren(Collection children) { + this.children = children; + } + /** + * @return Returns the id. + */ + public Long getId() { + return id; + } + /** + * @param id The id to set. + */ + public void setId(Long id) { + this.id = id; + } + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + /** + * @param name The name to set. + */ + public void setName(String name) { + this.name = name; + } +} diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java new file mode 100644 index 0000000000..9171be79de --- /dev/null +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java @@ -0,0 +1,82 @@ +/* + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; + +import java.io.File; +import java.util.ArrayList; +import java.util.Properties; + +import org.hibernate.cfg.AvailableSettings; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; +import org.hibernate.tool.hbm2x.Exporter; +import org.hibernate.tool.hbm2x.HibernateMappingExporter; +import org.hibernate.tools.test.util.HibernateUtil; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +/** + * @author koen + */ +public class TestCase { + + private static final String[] HBM_XML_FILES = new String[] { + "Parent.hbm.xml" + }; + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private File outputDir = null; + private File resourcesDir = null; + + private Exporter hbmexporter = null; + + @Before + public void setUp() throws Exception { + outputDir = new File(temporaryFolder.getRoot(), "output"); + outputDir.mkdir(); + resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir.mkdir(); + MetadataDescriptor metadataDescriptor = HibernateUtil + .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); + hbmexporter = new HibernateMappingExporter(); + hbmexporter.setMetadataDescriptor(metadataDescriptor); + hbmexporter.setOutputDirectory(outputDir); + hbmexporter.start(); + } + + @Test + public void testReadable() { + ArrayList files = new ArrayList(4); + files.add(new File( + outputDir, + "/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml")); + files.add(new File( + outputDir, + "/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.hbm.xml")); + Properties properties = new Properties(); + properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); + MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory + .createNativeDescriptor(null, files.toArray(new File[2]), properties); + Assert.assertNotNull(metadataDescriptor.createMetadata()); + } + +} diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml new file mode 100644 index 0000000000..8f353f0db6 --- /dev/null +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7b5d33a2fdf722f46ceb7cb21ec2f6fe000ba939 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 2 Apr 2018 11:28:39 +0200 Subject: [PATCH 019/454] HBX-1541: element is generated at wrong location - Problem solution implementation Signed-off-by: Koen Aers --- .../resources/hbm/persistentclass.hbm.ftl | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/main/src/main/resources/hbm/persistentclass.hbm.ftl b/main/src/main/resources/hbm/persistentclass.hbm.ftl index 623b74104e..6fa0c0ac9f 100644 --- a/main/src/main/resources/hbm/persistentclass.hbm.ftl +++ b/main/src/main/resources/hbm/persistentclass.hbm.ftl @@ -65,24 +65,6 @@ <#if clazz.table.comment?exists && clazz.table.comment?trim?length!=0> ${clazz.table.comment} -<#foreach join in clazz.joinIterator> - - table="${join.table.name}" - > - <#if join.table.comment?exists && join.table.comment?trim?length!=0> - ${comment} - - - <#foreach column in join.key.columnIterator> - <#include "column.hbm.ftl"> - - - <#foreach property in join.propertyIterator> - <#include "${c2h.getTag(property)}.hbm.ftl"/> - - - <#-- TODO: move this to id.hbm.ftl --> <#if !c2h.isSubclass(clazz)> <#if clazz.hasIdentifierProperty()> @@ -141,4 +123,23 @@ +<#foreach join in clazz.joinIterator> + + table="${join.table.name}" + > + <#if join.table.comment?exists && join.table.comment?trim?length!=0> + ${comment} + + + <#foreach column in join.key.columnIterator> + <#include "column.hbm.ftl"> + + + <#foreach property in join.propertyIterator> + <#include "${c2h.getTag(property)}.hbm.ftl"/> + + + + From 8574db854a62ee68403b649206bfb50c4cb367d8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 8 Apr 2018 00:52:38 +0200 Subject: [PATCH 020/454] HBX-1543: Update version identifier to 5.3.0.Beta3 Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..051bf345e7 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..7f410f0baf 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.Beta3"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fd8e5fbdee..2ae76e633f 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 27a4f2f6da..3106a73385 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..b9691a9c44 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..51a36089cb 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..ad7946de5b 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 544b800fb1..e7b268a786 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..7aa3e612b3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..7c88110576 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..58d8d2fd44 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..c71287eed7 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 97ad6b320e..043963b7db 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..f3db69fbd2 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Beta3 hibernate-tools-tests-utils From 08a25417c5f7e1db5361300d5cd0d1db84eb5342 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 20 Apr 2018 11:12:09 +0200 Subject: [PATCH 021/454] HBX-1566: Update version identifier to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 051bf345e7..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 7f410f0baf..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.Beta3"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2ae76e633f..fd8e5fbdee 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 3106a73385..27a4f2f6da 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index b9691a9c44..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 51a36089cb..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index ad7946de5b..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index e7b268a786..544b800fb1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 7aa3e612b3..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 7c88110576..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 58d8d2fd44..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c71287eed7..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 043963b7db..97ad6b320e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index f3db69fbd2..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Beta3 + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From 8abce9e64a4652d43f5e1df0b890096244f39ee8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 20 Apr 2018 11:39:20 +0200 Subject: [PATCH 022/454] HBX-1567: Update Hibernate core dependency to 5.3.0.CR1 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 27a4f2f6da..fb2d44752c 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.0.Final - 5.3.0.Beta2 + 5.3.0.CR1 1.0.0.Final 2.3.3 7.0 From 420c4ca92248838c27cbe4de00096433b1dcd66c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 21 Apr 2018 11:15:12 +0200 Subject: [PATCH 023/454] HBX-1568: Update the version to 5.3.0.CR1 Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..20ccd5e0b7 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..edbfb03374 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.CR1"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fd8e5fbdee..9392e7c71e 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index fb2d44752c..918de6a15a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..a995aef81a 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..813daa32e1 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..f221633533 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 544b800fb1..553b03368a 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..ddad58992b 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..f50c4ff40a 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..b1dffe252e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..93acd00df2 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 97ad6b320e..1afe150fc1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..fe81f347c2 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR1 hibernate-tools-tests-utils From d49ca28e40650a75ec1a3d4b093b3e5fe1269a89 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 22 Apr 2018 07:47:17 +0200 Subject: [PATCH 024/454] HBX-1569: Update the version to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 20ccd5e0b7..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index edbfb03374..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.CR1"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 9392e7c71e..fd8e5fbdee 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 918de6a15a..fb2d44752c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index a995aef81a..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 813daa32e1..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index f221633533..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 553b03368a..544b800fb1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ddad58992b..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index f50c4ff40a..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index b1dffe252e..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 93acd00df2..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 1afe150fc1..97ad6b320e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index fe81f347c2..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR1 + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From dcac2b6dff374df33553788ae63f2fbe2ffcd0e5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 3 May 2018 15:43:51 +0200 Subject: [PATCH 025/454] HBX-1575: Update Hibernate core dependency to 5.3.0.CR2 Signed-off-by: Koen Aers --- .../hibernate/tool/hbm2x/Cfg2JavaTool.java | 4 +- .../detector/InstrumentationDetector.java | 25 ++--- .../metadata/JdbcMetadataDescriptor.java | 95 ++++--------------- pom.xml | 2 +- 4 files changed, 35 insertions(+), 91 deletions(-) diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java b/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java index 21f0fac6cc..b690db649a 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java @@ -34,6 +34,7 @@ import org.hibernate.type.PrimitiveType; import org.hibernate.type.Type; import org.hibernate.type.TypeResolver; +import org.hibernate.type.spi.TypeConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -337,13 +338,14 @@ public String asArgumentList(List fields) { public String asFinderArgumentList(Map parameterTypes, ImportContext ctx) { StringBuffer buf = new StringBuffer(); Iterator> iter = parameterTypes.entrySet().iterator(); + TypeResolver typeResolver = new TypeConfiguration().getTypeResolver(); while ( iter.hasNext() ) { Entry entry = iter.next(); String typename = null; Type type = null; if(entry.getValue() instanceof String) { try { - type = new TypeResolver().heuristicType((String) entry.getValue()); + type = typeResolver.heuristicType((String) entry.getValue()); } catch(Throwable t) { type = null; typename = (String) entry.getValue(); diff --git a/main/src/main/java/org/hibernate/tool/hbmlint/detector/InstrumentationDetector.java b/main/src/main/java/org/hibernate/tool/hbmlint/detector/InstrumentationDetector.java index bf4a71ddf7..0ff24cb818 100644 --- a/main/src/main/java/org/hibernate/tool/hbmlint/detector/InstrumentationDetector.java +++ b/main/src/main/java/org/hibernate/tool/hbmlint/detector/InstrumentationDetector.java @@ -2,8 +2,9 @@ import org.hibernate.MappingException; import org.hibernate.boot.Metadata; -import org.hibernate.bytecode.internal.javassist.BytecodeProviderImpl; +import org.hibernate.bytecode.spi.BytecodeProvider; import org.hibernate.cfg.Environment; +import org.hibernate.engine.spi.Managed; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; import org.hibernate.tool.hbmlint.Issue; @@ -15,13 +16,15 @@ public String getName() { return "instrument"; } - private boolean javassistEnabled; + private boolean enhanceEnabled; public void initialize(Metadata metadata) { super.initialize(metadata); - if(Environment.getBytecodeProvider() instanceof BytecodeProviderImpl) { - javassistEnabled = true; - } + BytecodeProvider bytecodeProvider = Environment.getBytecodeProvider(); + if(bytecodeProvider instanceof org.hibernate.bytecode.internal.javassist.BytecodeProviderImpl || + bytecodeProvider instanceof org.hibernate.bytecode.internal.bytebuddy.BytecodeProviderImpl) { + enhanceEnabled = true; + } } protected void visit(PersistentClass clazz, IssueCollector collector) { @@ -45,17 +48,17 @@ protected void visit(PersistentClass clazz, IssueCollector collector) { return; } - } else if(javassistEnabled){ + } else if(enhanceEnabled){ Class[] interfaces = mappedClass.getInterfaces(); - boolean javaassist = false; + boolean enhanced = false; for (int i = 0; i < interfaces.length; i++) { - Class intface = interfaces[i]; - if(intface.getName().equals( "org.hibernate.bytecode.internal.javassist.FieldHandled" )) { - javaassist = true; + Class intface = interfaces[i]; + if(intface.getName().equals(Managed.class.getName())) { + enhanced = true; } } - if (javassistEnabled && !javaassist) { + if (enhanceEnabled && !enhanced) { collector.reportIssue( new Issue("LAZY_NOT_INSTRUMENTED", Issue.HIGH_PRIORITY, "'" + clazz.getEntityName() + "' has lazy='false', but its class '" + mappedClass.getName() + "' has not been instrumented with javaassist") ); return; } else { diff --git a/main/src/main/java/org/hibernate/tool/internal/metadata/JdbcMetadataDescriptor.java b/main/src/main/java/org/hibernate/tool/internal/metadata/JdbcMetadataDescriptor.java index a12997f1d2..d996484e78 100644 --- a/main/src/main/java/org/hibernate/tool/internal/metadata/JdbcMetadataDescriptor.java +++ b/main/src/main/java/org/hibernate/tool/internal/metadata/JdbcMetadataDescriptor.java @@ -4,37 +4,26 @@ import org.hibernate.MappingException; import org.hibernate.boot.Metadata; -import org.hibernate.boot.internal.ClassLoaderAccessImpl; +import org.hibernate.boot.internal.BootstrapContextImpl; import org.hibernate.boot.internal.InFlightMetadataCollectorImpl; import org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl; import org.hibernate.boot.internal.MetadataBuildingContextRootImpl; -import org.hibernate.boot.model.TypeContributions; -import org.hibernate.boot.model.TypeContributor; +import org.hibernate.boot.internal.MetadataImpl; import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.boot.registry.classloading.spi.ClassLoaderService; -import org.hibernate.boot.spi.BasicTypeRegistration; -import org.hibernate.boot.spi.ClassLoaderAccess; +import org.hibernate.boot.spi.BootstrapContext; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.cfg.Environment; import org.hibernate.cfg.JDBCBinder; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; -import org.hibernate.dialect.Dialect; -import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.Mapping; import org.hibernate.id.factory.IdentifierGeneratorFactory; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; import org.hibernate.tool.api.metadata.MetadataDescriptor; -import org.hibernate.type.BasicType; -import org.hibernate.type.BasicTypeRegistry; import org.hibernate.type.Type; -import org.hibernate.type.TypeFactory; -import org.hibernate.type.TypeResolver; -import org.hibernate.usertype.CompositeUserType; -import org.hibernate.usertype.UserType; public class JdbcMetadataDescriptor implements MetadataDescriptor { @@ -66,19 +55,24 @@ public Metadata createMetadata() { StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder() .applySettings(getProperties()) .build(); - MetadataBuildingOptions metadataBuildingOptions = + MetadataBuildingOptionsImpl metadataBuildingOptions = new MetadataBuildingOptionsImpl( serviceRegistry ); + BootstrapContextImpl bootstrapContext = new BootstrapContextImpl( + serviceRegistry, + metadataBuildingOptions); + metadataBuildingOptions.setBootstrapContext(bootstrapContext); InFlightMetadataCollectorImpl metadataCollector = - getMetadataCollector(metadataBuildingOptions); - ClassLoaderAccess classLoaderAccess = - getClassLoaderAccess(metadataBuildingOptions); + getMetadataCollector( + bootstrapContext, + metadataBuildingOptions); MetadataBuildingContext metadataBuildingContext = new MetadataBuildingContextRootImpl( + bootstrapContext, metadataBuildingOptions, - classLoaderAccess, metadataCollector); - Metadata metadata = metadataCollector + MetadataImpl metadata = metadataCollector .buildMetadataInstance(metadataBuildingContext); + metadata.getTypeConfiguration().scope(metadataBuildingContext); JDBCBinder binder = new JDBCBinder( serviceRegistry, getProperties(), @@ -93,66 +87,11 @@ public Metadata createMetadata() { } private InFlightMetadataCollectorImpl getMetadataCollector( + BootstrapContext bootstrapContext, MetadataBuildingOptions metadataBuildingOptions) { - BasicTypeRegistry basicTypeRegistry = handleTypes( metadataBuildingOptions ); return new InFlightMetadataCollectorImpl( - metadataBuildingOptions, - new TypeResolver( basicTypeRegistry, new TypeFactory() ) - ); - } - - private BasicTypeRegistry handleTypes(MetadataBuildingOptions options) { - final ClassLoaderService classLoaderService = options.getServiceRegistry().getService( ClassLoaderService.class ); - - // ultimately this needs to change a little bit to account for HHH-7792 - final BasicTypeRegistry basicTypeRegistry = new BasicTypeRegistry(); - - final TypeContributions typeContributions = new TypeContributions() { - public void contributeType(BasicType type) { - basicTypeRegistry.register( type ); - } - - public void contributeType(BasicType type, String... keys) { - basicTypeRegistry.register( type, keys ); - } - - public void contributeType(UserType type, String... keys) { - basicTypeRegistry.register( type, keys ); - } - - public void contributeType(CompositeUserType type, String... keys) { - basicTypeRegistry.register( type, keys ); - } - }; - - // add Dialect contributed types - final Dialect dialect = options.getServiceRegistry().getService( JdbcServices.class ).getDialect(); - dialect.contributeTypes( typeContributions, options.getServiceRegistry() ); - - // add TypeContributor contributed types. - for ( TypeContributor contributor : classLoaderService.loadJavaServices( TypeContributor.class ) ) { - contributor.contribute( typeContributions, options.getServiceRegistry() ); - } - - // add explicit application registered types - for ( BasicTypeRegistration basicTypeRegistration : options.getBasicTypeRegistrations() ) { - basicTypeRegistry.register( - basicTypeRegistration.getBasicType(), - basicTypeRegistration.getRegistrationKeys() - ); - } - - return basicTypeRegistry; - } - - private ClassLoaderAccess getClassLoaderAccess( - MetadataBuildingOptions metadataBuildingOptions) { - ClassLoaderService classLoaderService = - metadataBuildingOptions.getServiceRegistry().getService( - ClassLoaderService.class ); - return new ClassLoaderAccessImpl( - metadataBuildingOptions.getTempClassLoader(), - classLoaderService); + bootstrapContext, + metadataBuildingOptions); } private Mapping buildMapping(final Metadata metadata) { diff --git a/pom.xml b/pom.xml index fb2d44752c..01249c93ea 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.0.Final - 5.3.0.CR1 + 5.3.0.CR2 1.0.0.Final 2.3.3 7.0 From 1f99b931350b62f1c2c5195afa3651dfbe53443d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 3 May 2018 17:44:30 +0200 Subject: [PATCH 026/454] HBX-1576: Update the version to 5.3.0.CR2 Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..7e6a2c5378 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..35c616b972 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.CR2"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fd8e5fbdee..69a6c1931c 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 01249c93ea..095599a4e1 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..9e24a3cb07 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..950a962828 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..2416a66b5e 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 544b800fb1..f0bc28cf7b 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..237b822ebb 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..cd72425bc0 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..3ce7015de3 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..34dc3c17b6 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 97ad6b320e..f1de1dbd4c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..9c06763ca9 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.CR2 hibernate-tools-tests-utils From 2c381043d2ee3d626d099296a1f57fb29643e3ff Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 May 2018 09:38:34 +0200 Subject: [PATCH 027/454] HBX-1577: Update version identifier to 5.3.0-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 7e6a2c5378..1f337e22c2 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 35c616b972..442aca5a39 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.CR2"; + public static final String VERSION = "5.3.0-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 69a6c1931c..fd8e5fbdee 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 095599a4e1..01249c93ea 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 9e24a3cb07..26d931b2d1 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 950a962828..000b58173e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 2416a66b5e..04f1320c59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index f0bc28cf7b..544b800fb1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 237b822ebb..96c9b43616 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index cd72425bc0..caf5e1e0ec 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 3ce7015de3..a2d4cb533e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 34dc3c17b6..46736ead5a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index f1de1dbd4c..97ad6b320e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 9c06763ca9..a3ff42aa0c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.CR2 + 5.3.0-SNAPSHOT hibernate-tools-tests-utils From 28b8a4310dcc78a2410905a997b939bf341e1288 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 16 May 2018 15:47:44 +0200 Subject: [PATCH 028/454] HBX-1611: Update Hibernate core dependency to 5.3.0.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 01249c93ea..7d27f7980e 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.0.Final - 5.3.0.CR2 + 5.3.0.Final 1.0.0.Final 2.3.3 7.0 From 8ef5bcfbe805dd0518e811c3b62b8f559d1c81e8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 16 May 2018 16:12:41 +0200 Subject: [PATCH 029/454] HBX-1544: Update version identifier to 5.3.0.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1f337e22c2..5dd9a2db36 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 442aca5a39..78ef5eaf23 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0-SNAPSHOT"; + public static final String VERSION = "5.3.0.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fd8e5fbdee..fc5fbb3c75 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 7d27f7980e..993fb53912 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 26d931b2d1..b70a6c5dec 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 000b58173e..968313b6ca 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 04f1320c59..e0380a3b6b 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 544b800fb1..455df08e59 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 96c9b43616..f1991ef7d3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caf5e1e0ec..1ae07ca28e 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a2d4cb533e..afe7e688ac 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 46736ead5a..adafa005b4 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 97ad6b320e..e87ed3014c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a3ff42aa0c..cfd7309755 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0-SNAPSHOT + 5.3.0.Final hibernate-tools-tests-utils From ec6e032c0a07a6d39a04dd1cfa278e7683fd12a9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 17 May 2018 07:58:31 +0200 Subject: [PATCH 030/454] HBX-1612: Update version identifier to 5.3.1-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 5dd9a2db36..4d6e1a61dc 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 78ef5eaf23..2ff0bc2c3e 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.0.Final"; + public static final String VERSION = "5.3.1-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fc5fbb3c75..2c277dedca 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 993fb53912..dd295429c1 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Final + 5.3.1-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index b70a6c5dec..2a9fce6abb 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 968313b6ca..c6e1a9536c 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index e0380a3b6b..91eefdb31e 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 455df08e59..78254644c3 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index f1991ef7d3..2e1e5090b1 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 1ae07ca28e..2be8bb1664 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index afe7e688ac..e51c8a31a5 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index adafa005b4..68052dd5f3 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index e87ed3014c..bb3e968937 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index cfd7309755..ed49c8a353 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.0.Final + 5.3.1-SNAPSHOT hibernate-tools-tests-utils From 85ba385d8ef3a3ef29ac8aa7eec5b1b102759291 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 17 May 2018 15:23:39 +0200 Subject: [PATCH 031/454] HBX-1615: Update Hibernate Commons Annotations dependency to version 5.0.3.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dd295429c1..ebdcc8783e 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 3.12.2 2.3.23 1.4.194 - 5.0.0.Final + 5.0.3.Final 5.3.0.Final 1.0.0.Final 2.3.3 From 5095b48166ba09fcd74ac75e288bbb1180aee6d1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 18 May 2018 07:36:49 +0200 Subject: [PATCH 032/454] HBX-1617: Replace the use of 'hibernate-jpa-2.1-api' with 'javax.persistence-api' Signed-off-by: Koen Aers --- main/pom.xml | 4 ++-- pom.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 4d6e1a61dc..24b30a8dfb 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -89,8 +89,8 @@ hibernate-commons-annotations - org.hibernate.javax.persistence - hibernate-jpa-2.1-api + javax.persistence + javax.persistence-api org.slf4j diff --git a/pom.xml b/pom.xml index ebdcc8783e..b05e68e9d0 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 1.4.194 5.0.3.Final 5.3.0.Final - 1.0.0.Final + 2.2 2.3.3 7.0 1.1.6 @@ -138,9 +138,9 @@ ${hibernate-commons-annotations.version} - org.hibernate.javax.persistence - hibernate-jpa-2.1-api - ${hibernate-jpa.version} + javax.persistence + javax.persistence-api + ${javax.persistence-api.version} org.hsqldb From cef5aa2a8ee5503e18cafd024870cd342d3261ef Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 May 2018 08:54:37 +0200 Subject: [PATCH 033/454] HBX-1634: Update Hibernate core dependency to 5.3.1.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b05e68e9d0..6cb7ba3fc9 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.0.Final + 5.3.1.Final 2.2 2.3.3 7.0 From d5c238e07e132aae7b619a1e17a7a4b90d7b2393 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 May 2018 16:31:22 +0200 Subject: [PATCH 034/454] HBX-1613: Update version identifier to 5.3.1.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 24b30a8dfb..cef59c2e89 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 2ff0bc2c3e..80b59e05dc 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.1-SNAPSHOT"; + public static final String VERSION = "5.3.1.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2c277dedca..85f27d8d59 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 6cb7ba3fc9..114f5de5e0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.1-SNAPSHOT + 5.3.1.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 2a9fce6abb..38e0b49f47 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index c6e1a9536c..dd75ba76a5 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 91eefdb31e..0ef3631283 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 78254644c3..02a3284aca 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 2e1e5090b1..0f9b77b97e 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2be8bb1664..3d8e0a89e3 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index e51c8a31a5..8d4e8cf03b 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 68052dd5f3..6c3b4c37f9 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index bb3e968937..eb1b01d955 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ed49c8a353..016a02982d 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1-SNAPSHOT + 5.3.1.Final hibernate-tools-tests-utils From 9e02b1eab358e267ff1e4c6b6ce6fd3cd29a9c31 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 May 2018 17:58:51 +0200 Subject: [PATCH 035/454] HBX-1635: Update version identifier to 5.3.2-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index cef59c2e89..5eaed34597 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 80b59e05dc..d05f2c9c0e 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.1.Final"; + public static final String VERSION = "5.3.2-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 85f27d8d59..a5fb89e525 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 114f5de5e0..b0c7d8a499 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.1.Final + 5.3.2-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 38e0b49f47..382e6cbd5a 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index dd75ba76a5..476d8eaaf3 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 0ef3631283..94b30c1e80 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 02a3284aca..2282a3249c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 0f9b77b97e..78d296000a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 3d8e0a89e3..c08a4706a4 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 8d4e8cf03b..992d213097 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 6c3b4c37f9..dea5a0451b 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index eb1b01d955..dc893f278f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 016a02982d..af988e36e8 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.1.Final + 5.3.2-SNAPSHOT hibernate-tools-tests-utils From b1f57da10b56d3384d4de7e310c334541b9e6535 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 26 Jun 2018 14:40:30 +0200 Subject: [PATCH 036/454] HBX-1093: Missing inverseJoinColumn at ManyToMany relations with composite keys - Add test that proves the issue Signed-off-by: Koen Aers --- .../org/hibernate/tool/hbx1093/TestCase.java | 65 +++++++++++++++++++ .../org/hibernate/tool/hbx1093/create.sql | 3 + .../org/hibernate/tool/hbx1093/drop.sql | 3 + 3 files changed, 71 insertions(+) create mode 100644 test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java create mode 100644 test/h2/src/test/resources/org/hibernate/tool/hbx1093/create.sql create mode 100644 test/h2/src/test/resources/org/hibernate/tool/hbx1093/drop.sql diff --git a/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java b/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java new file mode 100644 index 0000000000..420eec7d59 --- /dev/null +++ b/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java @@ -0,0 +1,65 @@ +/* + * Created on 07-Dec-2004 + * + */ +package org.hibernate.tool.hbx1093; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; + +import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; +import org.hibernate.cfg.reveng.ReverseEngineeringSettings; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; +import org.hibernate.tool.hbm2x.POJOExporter; +import org.hibernate.tools.test.util.JdbcUtil; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +/** + * @author koen + */ +public class TestCase { + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); + + private MetadataDescriptor metadataDescriptor = null; + private File outputDir = null; + + @Before + public void setUp() { + JdbcUtil.createDatabase(this); + outputDir = temporaryFolder.getRoot(); + DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy(); + c.setSettings(new ReverseEngineeringSettings(c).setDetectManyToMany(true)); + metadataDescriptor = MetadataDescriptorFactory + .createJdbcDescriptor(c, null, true); + } + + @After + public void tearDown() { + JdbcUtil.dropDatabase(this); + } + + @Test + public void testGenerateJava() throws IOException { + POJOExporter exporter = new POJOExporter(); + exporter.setMetadataDescriptor(metadataDescriptor); + exporter.setOutputDirectory(outputDir); + exporter.getProperties().setProperty("ejb3", "true"); + exporter.start(); + File etManyToManyComp1 = new File(outputDir, "EtManyToManyComp1.java"); + String str = new String(Files.readAllBytes(etManyToManyComp1.toPath())); + Assert.assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP22_ID\"")); + File etManyToManyComp2 = new File(outputDir, "EtManyToManyComp2.java"); + str = new String(Files.readAllBytes(etManyToManyComp2.toPath())); + Assert.assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP11_ID\"")); + } + +} diff --git a/test/h2/src/test/resources/org/hibernate/tool/hbx1093/create.sql b/test/h2/src/test/resources/org/hibernate/tool/hbx1093/create.sql new file mode 100644 index 0000000000..cdf1ffd9ff --- /dev/null +++ b/test/h2/src/test/resources/org/hibernate/tool/hbx1093/create.sql @@ -0,0 +1,3 @@ +CREATE TABLE ET_MANY_TO_MANY_COMP1 (ET_MANY_TO_MANY_COMP1_ID NUMBER, ET_MANY_TO_MANY_COMP11_ID NUMBER, FIELD VARCHAR2(10), PRIMARY KEY (ET_MANY_TO_MANY_COMP1_ID, ET_MANY_TO_MANY_COMP11_ID)) +CREATE TABLE ET_MANY_TO_MANY_COMP2 ( ET_MANY_TO_MANY_COMP2_ID NUMBER, ET_MANY_TO_MANY_COMP22_ID NUMBER, FIELD VARCHAR2(10), PRIMARY KEY (ET_MANY_TO_MANY_COMP2_ID, ET_MANY_TO_MANY_COMP22_ID)) +CREATE TABLE ET_MANY_TO_MANY_COMP_MAPPING ( FK_ET_MANY_TO_MANY_COMP1_ID NUMBER, FK_ET_MANY_TO_MANY_COMP11_ID NUMBER, FK_ET_MANY_TO_MANY_COMP2_ID NUMBER, FK_ET_MANY_TO_MANY_COMP22_ID NUMBER, FOREIGN KEY (FK_ET_MANY_TO_MANY_COMP1_ID,FK_ET_MANY_TO_MANY_COMP11_ID) REFERENCES ET_MANY_TO_MANY_COMP1(ET_MANY_TO_MANY_COMP1_ID,ET_MANY_TO_MANY_COMP11_ID), FOREIGN KEY (FK_ET_MANY_TO_MANY_COMP2_ID, FK_ET_MANY_TO_MANY_COMP22_ID) REFERENCES ET_MANY_TO_MANY_COMP2(ET_MANY_TO_MANY_COMP2_ID, ET_MANY_TO_MANY_COMP22_ID), PRIMARY KEY (FK_ET_MANY_TO_MANY_COMP1_ID,FK_ET_MANY_TO_MANY_COMP11_ID,FK_ET_MANY_TO_MANY_COMP2_ID,FK_ET_MANY_TO_MANY_COMP22_ID) ) diff --git a/test/h2/src/test/resources/org/hibernate/tool/hbx1093/drop.sql b/test/h2/src/test/resources/org/hibernate/tool/hbx1093/drop.sql new file mode 100644 index 0000000000..ffc413a279 --- /dev/null +++ b/test/h2/src/test/resources/org/hibernate/tool/hbx1093/drop.sql @@ -0,0 +1,3 @@ +DROP TABLE ET_MANY_TO_MANY_COMP_MAPPING +DROP TABLE ET_MANY_TO_MANY_COMP2 +DROP TABLE ET_MANY_TO_MANY_COMP1 \ No newline at end of file From 2aa6d80e56f201849b9efe7acdb1f5007ada927b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 26 Jun 2018 14:48:18 +0200 Subject: [PATCH 037/454] HBX-1093: Missing inverseJoinColumn at ManyToMany relations with composite keys - Problem solution Signed-off-by: Koen Aers --- main/src/main/java/org/hibernate/cfg/JDBCBinder.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java index 625513ded8..aadf797bd9 100644 --- a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java +++ b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java @@ -489,7 +489,14 @@ private Property bindOneToMany(PersistentClass rc, ForeignKey foreignKey, Set columnIterator = fk.getColumns().iterator(); + while (columnIterator.hasNext()) { + Column fkcolumn = (Column) columnIterator.next(); + if(fkcolumn.getSqlTypeCode() != null) { // TODO: user defined foreign ref columns does not have a type set. + guessAndAlignType(fk.getTable(), fkcolumn, mapping, false); // needed to ensure foreign key columns has same type as the "property" column. + } + element.addColumn(fkcolumn); + } collection.setElement( element ); } else { From 3a5f312e4971ba89c15ea4c4f07898d059a6b816 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 10 Jul 2018 16:38:54 +0200 Subject: [PATCH 038/454] HBX-1698: Update Hibernate core dependency to 5.3.2.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b0c7d8a499..4db87146f4 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.1.Final + 5.3.2.Final 2.2 2.3.3 7.0 From 294dab2ec8d72fe4049b7f6ccdeb479d43ddd1e8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 10 Jul 2018 17:23:29 +0200 Subject: [PATCH 039/454] HBX-1636: Update version identifier to 5.3.2.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 5eaed34597..05b7cbb87e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index d05f2c9c0e..8461c518d7 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.2-SNAPSHOT"; + public static final String VERSION = "5.3.2.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index a5fb89e525..fcfc8c2457 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 4db87146f4..8415108c1a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.2-SNAPSHOT + 5.3.2.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 382e6cbd5a..f09f410ff7 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 476d8eaaf3..e3e6f8e6d1 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 94b30c1e80..34acd2ecbf 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 2282a3249c..145760c46f 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 78d296000a..273083a95f 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index c08a4706a4..11a5c6b62f 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 992d213097..6261cc3401 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index dea5a0451b..844d2fb71f 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index dc893f278f..a4cdc8a4a6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index af988e36e8..d291004e23 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2-SNAPSHOT + 5.3.2.Final hibernate-tools-tests-utils From f01b5e3cef1bf44bbf5d012ad8068f5c96047cf4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 10 Jul 2018 17:55:05 +0200 Subject: [PATCH 040/454] HBX-1699: Update version identifier to 5.3.3-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 05b7cbb87e..2211313617 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 8461c518d7..b9ead21b9e 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.2.Final"; + public static final String VERSION = "5.3.3-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fcfc8c2457..61329623e8 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 8415108c1a..e4da4b4562 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.2.Final + 5.3.3-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index f09f410ff7..721c976045 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e3e6f8e6d1..f3892a0334 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 34acd2ecbf..5d0bcc3823 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 145760c46f..50084faed1 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 273083a95f..8bf3b00d6a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 11a5c6b62f..4b4db746d2 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 6261cc3401..7575ee9e8f 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 844d2fb71f..1944a8644f 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index a4cdc8a4a6..326ffd2452 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index d291004e23..1f6cdb85fb 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.2.Final + 5.3.3-SNAPSHOT hibernate-tools-tests-utils From ed8d79ea3a0d757c9f5ef504950e64a3364f88ab Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 23 Jul 2018 11:34:01 +0200 Subject: [PATCH 041/454] HBX-1709: Update Hibernate core dependency to 5.3.3.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4da4b4562..e9ad631330 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.2.Final + 5.3.3.Final 2.2 2.3.3 7.0 From 67aab702c1494a1248c0dfc6986445788e79e589 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 23 Jul 2018 11:54:05 +0200 Subject: [PATCH 042/454] HBX-1710: Update version identifier to 5.3.3.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 2211313617..bbd56ba77d 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index b9ead21b9e..097b68d9f2 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.3-SNAPSHOT"; + public static final String VERSION = "5.3.3.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 61329623e8..637bd392d7 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e9ad631330..46795e9827 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.3-SNAPSHOT + 5.3.3.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 721c976045..4ea3005fc9 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index f3892a0334..6309306126 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 5d0bcc3823..f842e4a33e 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 50084faed1..3767682291 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 8bf3b00d6a..3ab9697bd4 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 4b4db746d2..c4034eeb54 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 7575ee9e8f..803c6abb55 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 1944a8644f..57cd8ca81c 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 326ffd2452..2e13928d60 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 1f6cdb85fb..9a96588f09 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3-SNAPSHOT + 5.3.3.Final hibernate-tools-tests-utils From e40ca0ff2e00c8af19952aba7f8868d7324c0429 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 23 Jul 2018 12:27:15 +0200 Subject: [PATCH 043/454] HBX-1711: Update version identifier to 5.3.4-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index bbd56ba77d..52795b3326 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 097b68d9f2..53669e8e09 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.3.Final"; + public static final String VERSION = "5.3.4-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 637bd392d7..037e39986e 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 46795e9827..1abb7ad922 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.3.Final + 5.3.4-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 4ea3005fc9..cb479f578d 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 6309306126..5ce359660f 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index f842e4a33e..fd7fb59161 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 3767682291..341b0167d7 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 3ab9697bd4..c20b06183f 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index c4034eeb54..2c8b789d38 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 803c6abb55..dff3181f9d 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 57cd8ca81c..f385a5b7c6 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 2e13928d60..ef3927b9d4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 9a96588f09..665dea37c7 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.3.Final + 5.3.4-SNAPSHOT hibernate-tools-tests-utils From 7b426d207603d9640894c598f483599aa4c12558 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 31 Jul 2018 11:08:02 +0200 Subject: [PATCH 044/454] HBX-1714: Make the build run on Java 9 and Java 10 Signed-off-by: Koen Aers --- pom.xml | 28 +++++++++++++++++++++++++++- test/utils/pom.xml | 16 ++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1abb7ad922..28ece7a9b1 100644 --- a/pom.xml +++ b/pom.xml @@ -33,9 +33,11 @@ 1.4.194 5.0.3.Final 5.3.3.Final + 1.2.0 2.2 2.3.3 7.0 + 2.3.0 1.1.6 4.12 6.0.6 @@ -137,11 +139,35 @@ hibernate-commons-annotations ${hibernate-commons-annotations.version} - + + javax.activation + javax.activation-api + ${javax.activation-api.version} + runtime + + javax.persistence javax.persistence-api ${javax.persistence-api.version} + + javax.xml.bind + jaxb-api + ${jaxb.version} + runtime + + + com.sun.xml.bind + jaxb-impl + ${jaxb.version} + runtime + + + com.sun.xml.bind + jaxb-core + ${jaxb.version} + runtime + org.hsqldb hsqldb diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 665dea37c7..ced63e9990 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -34,6 +34,22 @@ org.hibernate hibernate-tools + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-impl + + + com.sun.xml.bind + jaxb-core + + + javax.activation + javax.activation-api + From 01ca93af9cdaeef07828aa5a899d19d7c022c9c7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 3 Aug 2018 17:37:32 +0200 Subject: [PATCH 045/454] HBX-1719: Update jboss parent version to 28 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28ece7a9b1..c10b0b99ab 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 24 + 28 org.hibernate From 610149db31749ec3fcdd81520ff0c9f967833afa Mon Sep 17 00:00:00 2001 From: dgf Date: Wed, 4 Jul 2018 18:01:39 +0100 Subject: [PATCH 046/454] HBX-1720: Re-add RevengStrategy Parameter Signed-off-by: Koen Aers --- .../main/java/org/hibernate/mvn/AbstractHbm2xMojo.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index 33d3044dff..de7bfa592d 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -5,7 +5,6 @@ import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; import org.apache.tools.ant.BuildException; -import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.OverrideRepository; import org.hibernate.cfg.reveng.ReverseEngineeringSettings; import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; @@ -25,6 +24,8 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { private String packageName; @Parameter private File revengFile; + @Parameter(defaultValue = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy") + private String revengStrategy; @Parameter(defaultValue = "true") private boolean detectManyToMany; @Parameter(defaultValue = "true") @@ -53,7 +54,12 @@ public void execute() throws MojoExecutionException, MojoFailureException { } private ReverseEngineeringStrategy setupReverseEngineeringStrategy() { - ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy(); + ReverseEngineeringStrategy strategy; + try { + strategy = ReverseEngineeringStrategy.class.cast(Class.forName(revengStrategy).newInstance()); + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | ClassCastException e) { + throw new BuildException(revengStrategy + " not instanced.", e); + } if (revengFile != null) { OverrideRepository override = new OverrideRepository(); From 5be6a157496ebe18a642aed23ff2507cae33f163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20Gr=C3=A4f?= Date: Sat, 4 Aug 2018 14:42:03 +0100 Subject: [PATCH 047/454] HBX-1720: Re-add RevengStrategy Parameter - document revengStrategy parameter Signed-off-by: Koen Aers --- .../src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index de7bfa592d..1d7578110c 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -24,6 +24,9 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { private String packageName; @Parameter private File revengFile; + /** The class name of the reverse engineering strategy to use. + * Extend the DefaultReverseEngineeringStrategy and override the corresponding methods, e.g. + * to adapt the generate class names or to provide custom type mappings. */ @Parameter(defaultValue = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy") private String revengStrategy; @Parameter(defaultValue = "true") From 578cfba5cabd26d6a97cfe6797057a48d837f601 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 7 Aug 2018 13:38:11 +0200 Subject: [PATCH 048/454] HBX-1721: Update Hibernate core dependency to 5.3.4.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c10b0b99ab..a00fd858cc 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.3.Final + 5.3.4.Final 1.2.0 2.2 2.3.3 From 8c39b3a3974eaef3acf01deb5b0c6bf6d12b1b59 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 7 Aug 2018 16:15:49 +0200 Subject: [PATCH 049/454] HBX-1712: Update version identifier to 5.3.4.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 52795b3326..871a093885 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 53669e8e09..43d4a969f4 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.4-SNAPSHOT"; + public static final String VERSION = "5.3.4.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 037e39986e..54a9c612d7 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index a00fd858cc..95499e7a72 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.4-SNAPSHOT + 5.3.4.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index cb479f578d..acaea4c98d 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 5ce359660f..e7543ec573 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index fd7fb59161..2623a470dd 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 341b0167d7..a93609147c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c20b06183f..4d3a850c19 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2c8b789d38..b7aaafa1ae 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index dff3181f9d..1f48f0b270 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index f385a5b7c6..79d47643da 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index ef3927b9d4..275c2d2e34 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ced63e9990..135436c047 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4-SNAPSHOT + 5.3.4.Final hibernate-tools-tests-utils From 53556e9f567ab1996e80396d0ed55add19dcf079 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 7 Aug 2018 17:34:58 +0200 Subject: [PATCH 050/454] HBX-1722: Update version identifier to 5.3.5-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 871a093885..84373ca390 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 43d4a969f4..401a83537a 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.4.Final"; + public static final String VERSION = "5.3.5-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 54a9c612d7..21e2645286 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 95499e7a72..9f695df710 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.4.Final + 5.3.5-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index acaea4c98d..1ac1e6025f 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e7543ec573..735b96a972 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 2623a470dd..61c1114881 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index a93609147c..e61ec45284 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 4d3a850c19..10afeb80c3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index b7aaafa1ae..37d1317121 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 1f48f0b270..f7a3ca2dc1 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 79d47643da..a95812947b 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 275c2d2e34..2684a4e431 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 135436c047..d33fc3c1c2 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.4.Final + 5.3.5-SNAPSHOT hibernate-tools-tests-utils From fd6f5c351cf9261ad291667dec68d3961e2ea32c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 8 Sep 2018 23:23:06 +0200 Subject: [PATCH 051/454] HBX-1726: Update Hibernate core dependency to 5.3.5.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9f695df710..b370b8c954 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.4.Final + 5.3.5.Final 1.2.0 2.2 2.3.3 From 3ea93c51291c99a3a2cfa73c0ecb9f346c597a80 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Sep 2018 17:50:21 +0200 Subject: [PATCH 052/454] HBX-1727: Update version identifier to 5.3.5.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 84373ca390..3c2694c38e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 401a83537a..fa9224afc2 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.5-SNAPSHOT"; + public static final String VERSION = "5.3.5.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 21e2645286..3d25d6f4d5 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index b370b8c954..9b815ee7ea 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.5-SNAPSHOT + 5.3.5.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 1ac1e6025f..f930dd14f7 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 735b96a972..0e39182840 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 61c1114881..b4a73384a8 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index e61ec45284..fbb92eb134 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 10afeb80c3..db69b66457 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 37d1317121..8073ab2039 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index f7a3ca2dc1..fd385141e9 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index a95812947b..0e7766d448 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 2684a4e431..d750fa60bf 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index d33fc3c1c2..835325f78c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5-SNAPSHOT + 5.3.5.Final hibernate-tools-tests-utils From 41e7e8a01779c865ea94cd3508df0beb423f7f4d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Sep 2018 19:29:04 +0200 Subject: [PATCH 053/454] HBX-1729: Update version identifier to 5.3.6-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 3c2694c38e..aa31bd024b 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index fa9224afc2..87ddc7d818 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.5.Final"; + public static final String VERSION = "5.3.6-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 3d25d6f4d5..9e95fb704d 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 9b815ee7ea..2d35d9fe3e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.5.Final + 5.3.6-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index f930dd14f7..758f795bcf 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 0e39182840..d88f4bab09 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index b4a73384a8..8e34cbc075 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index fbb92eb134..0cc50771ac 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index db69b66457..1ea4b32b3a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 8073ab2039..bc0dbd6120 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index fd385141e9..0c0bcb37a1 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 0e7766d448..6e7e7767de 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d750fa60bf..d0311742f1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 835325f78c..204f1bf255 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.5.Final + 5.3.6-SNAPSHOT hibernate-tools-tests-utils From 37daad9ba34c5a2be1607db24da2f205e5c6da91 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Sep 2018 08:59:23 +0200 Subject: [PATCH 054/454] HBX-1730: Update Hibernate core dependency to 5.3.6.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2d35d9fe3e..8f118e3c78 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.5.Final + 5.3.6.Final 1.2.0 2.2 2.3.3 From 14d7f483580016b276a08a7107495b6f2c89d604 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Sep 2018 16:27:59 +0200 Subject: [PATCH 055/454] HBX-1728: Update version identifier to 5.3.6.Final --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index aa31bd024b..00fbf9431d 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 87ddc7d818..47495cb4e5 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.6-SNAPSHOT"; + public static final String VERSION = "5.3.6.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 9e95fb704d..7ddecb843c 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 8f118e3c78..fb32b6e13b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.6-SNAPSHOT + 5.3.6.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 758f795bcf..5af2ed95c9 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index d88f4bab09..728927a4e0 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 8e34cbc075..e3e9075b3b 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 0cc50771ac..869be0d508 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 1ea4b32b3a..7559858ab2 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index bc0dbd6120..27f7a330fa 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 0c0bcb37a1..8c52c1a362 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 6e7e7767de..d6dd61e2b1 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d0311742f1..0f3189c276 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 204f1bf255..b032bdda22 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6-SNAPSHOT + 5.3.6.Final hibernate-tools-tests-utils From eca7b36dc4547ee0fe66c52995a77e7344b94f64 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 12 Sep 2018 11:44:46 +0200 Subject: [PATCH 056/454] HBX-1732: Update version identifier to 5.3.7-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 00fbf9431d..08505c8a4e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 47495cb4e5..d4bb550f25 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.6.Final"; + public static final String VERSION = "5.3.7-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 7ddecb843c..aa4b3f019d 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index fb32b6e13b..9a4edf9860 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.6.Final + 5.3.7-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 5af2ed95c9..a44df9a6c9 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 728927a4e0..e0361558a7 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index e3e9075b3b..dcae3a2637 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 869be0d508..4170a41cbd 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 7559858ab2..713426654c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 27f7a330fa..4fb4424579 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 8c52c1a362..4329bc9cf2 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d6dd61e2b1..6f3f8481ac 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 0f3189c276..b3dae1c2c1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index b032bdda22..30fe215d64 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.6.Final + 5.3.7-SNAPSHOT hibernate-tools-tests-utils From c82f421ca50ea4c12895ac15979663414762b6aa Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 19 Oct 2018 22:06:06 +0200 Subject: [PATCH 057/454] HBX-1746: Update jboss-parent dependency to version 29 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a4edf9860..92ea96dc47 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 28 + 29 org.hibernate From b70eb572e3605c678ab96448953911f5be081d50 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 22 Oct 2018 12:27:11 +0200 Subject: [PATCH 058/454] HBX-1747: Update Hibernate core dependency to 5.3.7.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 92ea96dc47..5e39cb41aa 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.23 1.4.194 5.0.3.Final - 5.3.6.Final + 5.3.7.Final 1.2.0 2.2 2.3.3 From a9086d82a0170abc3341bad69139159cd3f1c2ea Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 23 Oct 2018 09:58:16 +0200 Subject: [PATCH 059/454] HBX-1733: Update version identifier to 5.3.7.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 08505c8a4e..1101ad19ea 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index d4bb550f25..06f1f85904 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.7-SNAPSHOT"; + public static final String VERSION = "5.3.7.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index aa4b3f019d..180c28fbff 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 5e39cb41aa..47079f6f8b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.7-SNAPSHOT + 5.3.7.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index a44df9a6c9..658e986c57 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e0361558a7..64dd22cc4a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index dcae3a2637..4b4ce9703d 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 4170a41cbd..80ad0eba0e 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 713426654c..02751b5f07 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 4fb4424579..0f48e819cb 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 4329bc9cf2..4841ba366d 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 6f3f8481ac..74ac4a9d1a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index b3dae1c2c1..b454a697b8 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 30fe215d64..5643292f90 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7-SNAPSHOT + 5.3.7.Final hibernate-tools-tests-utils From a3e74b12176f487693c7c47241542100a260fc48 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 23 Oct 2018 10:32:11 +0200 Subject: [PATCH 060/454] HBX-1748: Update version identifier to 5.3.8-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1101ad19ea..1edc87d387 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 06f1f85904..ac10e57ae9 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.7.Final"; + public static final String VERSION = "5.3.8-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 180c28fbff..1c0cc7481b 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 47079f6f8b..dc5c5e06d6 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.7.Final + 5.3.8-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 658e986c57..f58dd4da08 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 64dd22cc4a..1788b1bcd4 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 4b4ce9703d..c49531f0ff 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 80ad0eba0e..2668f9117f 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 02751b5f07..a7fb559af6 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 0f48e819cb..b0561cb00c 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 4841ba366d..1bf0fde1f3 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 74ac4a9d1a..051ef1dc11 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index b454a697b8..7046e7bddf 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 5643292f90..58307c62ac 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.7.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-utils From c9cfa41468b240e89fbb49a27330ec00deaec5b2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 25 Oct 2018 11:05:48 +0200 Subject: [PATCH 061/454] HBX-1749: Use @project.version@ instead of hardcoded version in the tests for hibernate-tools-maven Signed-off-by: Koen Aers --- test/maven-plugin/src/it/hbm2ddl/pom.xml | 3 +-- test/maven-plugin/src/it/hbm2java/pom.xml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test/maven-plugin/src/it/hbm2ddl/pom.xml b/test/maven-plugin/src/it/hbm2ddl/pom.xml index 73aff79576..1bb46c5661 100644 --- a/test/maven-plugin/src/it/hbm2ddl/pom.xml +++ b/test/maven-plugin/src/it/hbm2ddl/pom.xml @@ -14,7 +14,6 @@ 1.8 1.4.195 - 6.0.0-SNAPSHOT @@ -22,7 +21,7 @@ org.hibernate hibernate-tools-maven-plugin - ${hibernate-tools-maven-plugin.version} + @project.version@ Schema generation diff --git a/test/maven-plugin/src/it/hbm2java/pom.xml b/test/maven-plugin/src/it/hbm2java/pom.xml index 2c861977e3..35fd6256d2 100644 --- a/test/maven-plugin/src/it/hbm2java/pom.xml +++ b/test/maven-plugin/src/it/hbm2java/pom.xml @@ -14,7 +14,6 @@ 1.8 1.4.195 - 6.0.0-SNAPSHOT @@ -22,7 +21,7 @@ org.hibernate hibernate-tools-maven-plugin - ${hibernate-tools-maven-plugin.version} + @project.version@ Entity generation From d06eb4a7f96777768515f78a1889a5d5caeb9b7b Mon Sep 17 00:00:00 2001 From: Graham Collinson Date: Thu, 4 Oct 2018 12:16:21 +0100 Subject: [PATCH 062/454] HBX-1193: Exclude unique function based indexes from oracle Change-Id: I505c10e19e22cf35b54f709e22690b945fa47697 Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/OracleMetaDataDialect.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java index 689ec1808a..8d3b7fd782 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java @@ -67,7 +67,8 @@ public OracleMetaDataDialect() { + "from all_ind_columns a left join all_indexes b on " + "(a.table_name = b.table_name " + " AND a.table_owner = b.table_owner " - + " AND a.index_name = b.index_name) "; + + " AND a.index_name = b.index_name) " + + "where b.index_type not like 'FUNCTION-BASED%' "; private static final String SQL_INDEX_ORDER = " order by a.table_name, a.column_position"; @@ -75,13 +76,13 @@ public OracleMetaDataDialect() { + SQL_INDEX_ORDER; private static final String SQL_INDEX_SCHEMA = SQL_INDEX_BASE - + "where a.table_owner like ? " + SQL_INDEX_ORDER; + + "and a.table_owner like ? " + SQL_INDEX_ORDER; private static final String SQL_INDEX_TABLE = SQL_INDEX_BASE - + "where a.table_name like ? " + SQL_INDEX_ORDER; + + "and a.table_name like ? " + SQL_INDEX_ORDER; private static final String SQL_INDEX_SCHEMA_AND_TABLE = SQL_INDEX_BASE - + "where a.table_owner like ? and a.table_name like ? " + SQL_INDEX_ORDER; + + "and a.table_owner like ? and a.table_name like ? " + SQL_INDEX_ORDER; private PreparedStatement prepIndexNone; From 60ac5a1bcc61657190d74aeed2830db3d029fdd0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 9 Nov 2018 13:39:30 +0100 Subject: [PATCH 063/454] HBX-1750: Remove unneeded '${project.version}' specification in hibernate-tools-orm dependency in maven/pom.xml Signed-off-by: Koen Aers --- maven-plugin/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 1c0cc7481b..2bb505de1a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -70,7 +70,6 @@ org.hibernate hibernate-tools - ${project.version} From b068bd1b590e1fbdd27abbbc1a54175df175b048 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 11 Nov 2018 10:05:01 +0100 Subject: [PATCH 064/454] HBX-1751: Update ant dependency version to 1.10.5 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dc5c5e06d6..54d84ab58a 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.1 + 1.10.5 3.2.2 1.2 3.12.2 From c6cbfc5c41f8ca45389c4acb15d3d13c6a718b24 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 21 Nov 2018 10:34:20 +0100 Subject: [PATCH 065/454] HBX-1755: Update jboss-parent dependency to version 30 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54d84ab58a..a1dbbf25fd 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 29 + 30 org.hibernate From 9a551d1f40f2664f46764277a453e8aa11b29f66 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 4 Dec 2018 14:43:15 +0100 Subject: [PATCH 066/454] HBX-1768: Update eclipse-jdt-core dependency to version 3.15.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a1dbbf25fd..62eb55f49c 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.10.5 3.2.2 1.2 - 3.12.2 + 3.15.0 2.3.23 1.4.194 5.0.3.Final From c49ada45b82506935312d64983873b6a58ebe7b1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 5 Dec 2018 14:09:11 +0100 Subject: [PATCH 067/454] HBX-1772: Update freemarker version to 2.3.28 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 62eb55f49c..d7cb9bdec2 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 3.2.2 1.2 3.15.0 - 2.3.23 + 2.3.28 1.4.194 5.0.3.Final 5.3.7.Final From fbe09d6d1f291b741806d9820337aa11ecab01f4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Dec 2018 17:45:32 +0100 Subject: [PATCH 068/454] HBX-1773: Update hibernate commons annotations dependency to version 5.1.0.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d7cb9bdec2..04b8ba07ac 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 3.15.0 2.3.28 1.4.194 - 5.0.3.Final + 5.1.0.Final 5.3.7.Final 1.2.0 2.2 From d6ff27e5c9fa59559d7d4752359630d861b81dfd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 17 Dec 2018 19:38:19 +0100 Subject: [PATCH 069/454] HBX-1774: Update H2 version to 1.4.197 Signed-off-by: Koen Aers --- pom.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 04b8ba07ac..f1cd1255bb 100644 --- a/pom.xml +++ b/pom.xml @@ -25,16 +25,16 @@ - 1.10.5 - 3.2.2 - 1.2 - 3.15.0 - 2.3.28 - 1.4.194 - 5.1.0.Final + 1.10.5 + 3.2.2 + 1.2 + 3.15.0 + 2.3.28 + 1.4.197 + 5.1.0.Final 5.3.7.Final - 1.2.0 - 2.2 + 1.2.0 + 2.2 2.3.3 7.0 2.3.0 From c076b6a19892357bfda1011da0a15b0265b3a431 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 18 Dec 2018 15:00:13 +0100 Subject: [PATCH 070/454] HBX-1775: Update slf4j version to 1.7.25 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1cd1255bb..cddcc0e7e0 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 4.12 6.0.6 12.2.0.1 - 1.7.23 + 1.7.25 6.1.7.jre8-preview From 0f8ba00ba32e0e716a1e0f33a56d06b78d716fad Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 9 Jan 2019 17:34:46 +0100 Subject: [PATCH 071/454] HBX-1781: Update jboss-parent dependency to version 31 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cddcc0e7e0..b49b0c0fdf 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 30 + 31 org.hibernate From b7d3fbe5d43a48f55081755f5341ee1ba7ba27e0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jan 2019 18:51:20 +0100 Subject: [PATCH 072/454] HBX-1785: Use 'jaxb-runtime' instead of 'jaxb-core' and 'jaxb-impl' Signed-off-by: Koen Aers --- pom.xml | 33 ++++++++++++++------------------- test/utils/pom.xml | 8 ++------ 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index b49b0c0fdf..42abe10b06 100644 --- a/pom.xml +++ b/pom.xml @@ -25,19 +25,20 @@ - 1.10.5 - 3.2.2 - 1.2 - 3.15.0 - 2.3.28 + 1.10.5 + 3.2.2 + 1.2 + 3.15.0 + 2.3.28 1.4.197 - 5.1.0.Final + 5.1.0.Final 5.3.7.Final - 1.2.0 - 2.2 + 1.2.0 + 2.2 2.3.3 7.0 - 2.3.0 + 2.3.1 + 2.3.2 1.1.6 4.12 6.0.6 @@ -153,19 +154,13 @@ javax.xml.bind jaxb-api - ${jaxb.version} + ${jaxb-api.version} runtime - com.sun.xml.bind - jaxb-impl - ${jaxb.version} - runtime - - - com.sun.xml.bind - jaxb-core - ${jaxb.version} + org.glassfish.jaxb + jaxb-runtime + ${jaxb-runtime.version} runtime diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 58307c62ac..1b264c79d9 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -39,12 +39,8 @@ jaxb-api - com.sun.xml.bind - jaxb-impl - - - com.sun.xml.bind - jaxb-core + org.glassfish.jaxb + jaxb-runtime javax.activation From 2181235a8fb2e5eaa74061fd14c45f50664af180 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jan 2019 16:34:07 +0100 Subject: [PATCH 073/454] HBX-1784: Remove unneeded dependency on javax.activation Signed-off-by: Koen Aers --- pom.xml | 6 ------ test/utils/pom.xml | 4 ---- 2 files changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index 42abe10b06..c67b496a30 100644 --- a/pom.xml +++ b/pom.xml @@ -140,12 +140,6 @@ hibernate-commons-annotations ${hibernate-commons-annotations.version} - - javax.activation - javax.activation-api - ${javax.activation-api.version} - runtime - javax.persistence javax.persistence-api diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 1b264c79d9..492de00af5 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -42,10 +42,6 @@ org.glassfish.jaxb jaxb-runtime - - javax.activation - javax.activation-api - From c9199ae0261afcb7e9303109c84b107cbc044f6a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 20 Jan 2019 13:44:44 +0100 Subject: [PATCH 074/454] HBX-1793: Update org.eclipse.jdt.core dependency version to 3.16.0 Signed-off-by: Koen Aers --- pom.xml | 68 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index c67b496a30..111cb7f82c 100644 --- a/pom.xml +++ b/pom.xml @@ -28,15 +28,15 @@ 1.10.5 3.2.2 1.2 - 3.15.0 + 3.16.0 2.3.28 1.4.197 5.1.0.Final 5.3.7.Final - 1.2.0 - 2.2 2.3.3 7.0 + 1.2.0 + 2.2 2.3.1 2.3.2 1.1.6 @@ -83,6 +83,17 @@ ${javaee-api.version} test + + javax.persistence + javax.persistence-api + ${javax.persistence-api.version} + + + javax.xml.bind + jaxb-api + ${jaxb-api.version} + runtime + jaxen jaxen @@ -115,48 +126,37 @@ freemarker ${freemarker.version} + + org.glassfish.jaxb + jaxb-runtime + ${jaxb-runtime.version} + runtime + org.hibernate hibernate-core ${hibernate-core.version} - - org.hibernate - hibernate-tools - ${project.version} - - - org.hibernate - hibernate-tools-tests-common - ${project.version} - - - org.hibernate - hibernate-tools-tests-utils - ${project.version} + + org.hibernate + hibernate-tools + ${project.version} + + + org.hibernate + hibernate-tools-tests-common + ${project.version} + + + org.hibernate + hibernate-tools-tests-utils + ${project.version} org.hibernate.common hibernate-commons-annotations ${hibernate-commons-annotations.version} - - javax.persistence - javax.persistence-api - ${javax.persistence-api.version} - - - javax.xml.bind - jaxb-api - ${jaxb-api.version} - runtime - - - org.glassfish.jaxb - jaxb-runtime - ${jaxb-runtime.version} - runtime - org.hsqldb hsqldb From 651945959ad4f143d31c1e686fd232f54b5e41ca Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 31 Jan 2019 14:56:45 +0100 Subject: [PATCH 075/454] HBX-1795: Replace slf4j with jboss logging Signed-off-by: Koen Aers --- main/pom.xml | 12 ++++-------- .../java/org/hibernate/cfg/JDBCBinder.java | 5 ++--- .../hibernate/cfg/binder/PropertyBinder.java | 5 ++--- .../cfg/reveng/BasicColumnProcessor.java | 5 ++--- .../DefaultReverseEngineeringStrategy.java | 5 ++--- .../cfg/reveng/ForeignKeyProcessor.java | 5 ++--- .../hibernate/cfg/reveng/IndexProcessor.java | 5 ++--- .../cfg/reveng/OverrideRepository.java | 5 ++--- .../cfg/reveng/PrimaryKeyProcessor.java | 5 ++--- .../hibernate/cfg/reveng/TableProcessor.java | 5 ++--- .../dialect/AbstractMetaDataDialect.java | 5 ++--- .../hibernate/tool/hbm2x/AbstractExporter.java | 5 ++--- .../org/hibernate/tool/hbm2x/Cfg2JavaTool.java | 5 ++--- .../tool/hbm2x/ConfigurationNavigator.java | 5 ++--- .../hibernate/tool/hbm2x/TemplateHelper.java | 5 ++--- .../hibernate/tool/hbm2x/TemplateProducer.java | 6 +++--- pom.xml | 18 ++++++------------ 17 files changed, 41 insertions(+), 65 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 1edc87d387..188779baf4 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -92,14 +92,10 @@ javax.persistence javax.persistence-api - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - + + org.jboss.logging + jboss-logging + diff --git a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java index aadf797bd9..096c504ee7 100644 --- a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java +++ b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java @@ -58,8 +58,7 @@ import org.hibernate.tool.util.TableNameQualifier; import org.hibernate.type.ForeignKeyDirection; import org.hibernate.type.Type; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; /** @@ -69,7 +68,7 @@ public class JDBCBinder { private Properties properties; - private static final Logger log = LoggerFactory.getLogger(JDBCBinder.class); + private static final Logger log = Logger.getLogger(JDBCBinder.class); private final MetadataBuildingContext mdbc; diff --git a/main/src/main/java/org/hibernate/cfg/binder/PropertyBinder.java b/main/src/main/java/org/hibernate/cfg/binder/PropertyBinder.java index bfdd6cc767..053d7fc020 100644 --- a/main/src/main/java/org/hibernate/cfg/binder/PropertyBinder.java +++ b/main/src/main/java/org/hibernate/cfg/binder/PropertyBinder.java @@ -4,12 +4,11 @@ import org.hibernate.mapping.Property; import org.hibernate.mapping.Table; import org.hibernate.mapping.Value; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class PropertyBinder { - private static final Logger log = LoggerFactory.getLogger(PropertyBinder.class); + private static final Logger log = Logger.getLogger(PropertyBinder.class); public static Property makeProperty( Table table, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java index 407f96dab8..e3a87fd0cd 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java @@ -10,12 +10,11 @@ import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class BasicColumnProcessor { - private static final Logger log = LoggerFactory.getLogger(BasicColumnProcessor.class); + private static final Logger log = Logger.getLogger(BasicColumnProcessor.class); public static void processBasicColumns( MetaDataDialect metaDataDialect, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java index 06dcb43f00..8805261f3e 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java @@ -17,12 +17,11 @@ import org.hibernate.mapping.PrimaryKey; import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class DefaultReverseEngineeringStrategy implements ReverseEngineeringStrategy { - static final private Logger log = LoggerFactory.getLogger(DefaultReverseEngineeringStrategy.class); + static final private Logger log = Logger.getLogger(DefaultReverseEngineeringStrategy.class); private static Set AUTO_OPTIMISTICLOCK_COLUMNS; diff --git a/main/src/main/java/org/hibernate/cfg/reveng/ForeignKeyProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/ForeignKeyProcessor.java index 081051e3f7..897daec7fa 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/ForeignKeyProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/ForeignKeyProcessor.java @@ -14,12 +14,11 @@ import org.hibernate.mapping.ForeignKey; import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class ForeignKeyProcessor { - private static final Logger log = LoggerFactory.getLogger(ForeignKeyProcessor.class); + private static final Logger log = Logger.getLogger(ForeignKeyProcessor.class); public static ForeignKeysInfo processForeignKeys( MetaDataDialect metaDataDialect, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/IndexProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/IndexProcessor.java index 44eb94b6e3..4c3ff2bb30 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/IndexProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/IndexProcessor.java @@ -16,12 +16,11 @@ import org.hibernate.mapping.Table; import org.hibernate.mapping.UniqueKey; import org.hibernate.tool.util.TableNameQualifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class IndexProcessor { - private static final Logger log = LoggerFactory.getLogger(IndexProcessor.class); + private static final Logger log = Logger.getLogger(IndexProcessor.class); public static void processIndices( MetaDataDialect metaDataDialect, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java index 7f6194e9c4..4b50f88f80 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java @@ -25,13 +25,12 @@ import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; import org.hibernate.tool.xml.XMLHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; import org.xml.sax.InputSource; public class OverrideRepository { - final private static Logger log = LoggerFactory.getLogger( OverrideRepository.class ); + final private static Logger log = Logger.getLogger( OverrideRepository.class ); final private Map> typeMappings; // from sqltypes to list of SQLTypeMapping diff --git a/main/src/main/java/org/hibernate/cfg/reveng/PrimaryKeyProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/PrimaryKeyProcessor.java index 2139b3fb1b..f48cd66fe1 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/PrimaryKeyProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/PrimaryKeyProcessor.java @@ -14,12 +14,11 @@ import org.hibernate.mapping.PrimaryKey; import org.hibernate.mapping.Table; import org.hibernate.sql.Alias; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class PrimaryKeyProcessor { - private static final Logger log = LoggerFactory.getLogger(PrimaryKeyProcessor.class); + private static final Logger log = Logger.getLogger(PrimaryKeyProcessor.class); public static void processPrimaryKey( MetaDataDialect metaDataDialect, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/TableProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/TableProcessor.java index d8d5f5d6ba..d247fe3921 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/TableProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/TableProcessor.java @@ -11,12 +11,11 @@ import org.hibernate.cfg.reveng.dialect.MetaDataDialect; import org.hibernate.internal.util.StringHelper; import org.hibernate.mapping.Table; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; public class TableProcessor { - private static final Logger log = LoggerFactory.getLogger(TableProcessor.class); + private static final Logger log = Logger.getLogger(TableProcessor.class); public static Collection processTables( MetaDataDialect metaDataDialect, diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java index 4bf846082b..d0af8d759a 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java @@ -14,8 +14,7 @@ import org.hibernate.cfg.JDBCBinderException; import org.hibernate.cfg.reveng.ReverseEngineeringRuntimeInfo; import org.hibernate.exception.spi.SQLExceptionConverter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; /** * abstract base class for the metadatadialects to hold the @@ -26,7 +25,7 @@ */ public abstract class AbstractMetaDataDialect implements MetaDataDialect { - protected final Logger log = LoggerFactory.getLogger(this.getClass()); + protected final Logger log = Logger.getLogger(this.getClass()); private Connection connection; private DatabaseMetaData metaData; diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/AbstractExporter.java b/main/src/main/java/org/hibernate/tool/hbm2x/AbstractExporter.java index b52b64616f..0a84f87d6e 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/AbstractExporter.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/AbstractExporter.java @@ -12,8 +12,7 @@ import org.hibernate.internal.util.ReflectHelper; import org.hibernate.internal.util.StringHelper; import org.hibernate.tool.api.metadata.MetadataDescriptor; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; /** * Base exporter for the template and direct output generation. @@ -24,7 +23,7 @@ */ public abstract class AbstractExporter implements Exporter { - protected Logger log = LoggerFactory.getLogger(this.getClass()); + protected Logger log = Logger.getLogger(this.getClass()); private File outputdir; private String[] templatePaths = new String[0]; diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java b/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java index b690db649a..0213073601 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/Cfg2JavaTool.java @@ -35,8 +35,7 @@ import org.hibernate.type.Type; import org.hibernate.type.TypeResolver; import org.hibernate.type.spi.TypeConfiguration; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; /** * Helper methods for javacode generation. @@ -47,7 +46,7 @@ */ public class Cfg2JavaTool { - private static final Logger log = LoggerFactory.getLogger( Cfg2JavaTool.class ); + private static final Logger log = Logger.getLogger( Cfg2JavaTool.class ); public Cfg2JavaTool() { diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java b/main/src/main/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java index 5e6ab355c9..82c8f49777 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/ConfigurationNavigator.java @@ -12,15 +12,14 @@ import org.hibernate.mapping.Property; import org.hibernate.tool.hbm2x.pojo.ComponentPOJOClass; import org.hibernate.tool.hbm2x.pojo.POJOClass; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; /** * @author max and david */ public class ConfigurationNavigator { - private static final Logger log = LoggerFactory.getLogger(POJOExporter.class); + private static final Logger log = Logger.getLogger(POJOExporter.class); /** * @param clazz diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/TemplateHelper.java b/main/src/main/java/org/hibernate/tool/hbm2x/TemplateHelper.java index b0d931eafd..ea45e6b728 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/TemplateHelper.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/TemplateHelper.java @@ -17,8 +17,7 @@ import java.util.List; import org.hibernate.tool.Version; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; import freemarker.cache.ClassTemplateLoader; import freemarker.cache.FileTemplateLoader; @@ -45,7 +44,7 @@ */ public class TemplateHelper { - static final Logger log = LoggerFactory.getLogger(TemplateHelper.class); + static final Logger log = Logger.getLogger(TemplateHelper.class); private String templatePrefix; private File outputDirectory; diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/TemplateProducer.java b/main/src/main/java/org/hibernate/tool/hbm2x/TemplateProducer.java index 50799eac08..4a0e1fff0f 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/TemplateProducer.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/TemplateProducer.java @@ -9,13 +9,13 @@ import java.util.Map; import java.util.Map.Entry; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.jboss.logging.Logger; + public class TemplateProducer { - private static final Logger log = LoggerFactory.getLogger(TemplateProducer.class); + private static final Logger log = Logger.getLogger(TemplateProducer.class); private final TemplateHelper th; private ArtifactCollector ac; diff --git a/pom.xml b/pom.xml index 111cb7f82c..68c946f622 100644 --- a/pom.xml +++ b/pom.xml @@ -40,10 +40,10 @@ 2.3.12.3.21.1.6 + 3.3.2.Final4.126.0.612.2.0.1 - 1.7.256.1.7.jre8-preview @@ -163,18 +163,12 @@ ${hsqldb.version}test - - org.slf4j - slf4j-api - ${slf4j.version} - - org.slf4j - slf4j-log4j12 - ${slf4j.version} - runtime - - + org.jboss.logging + jboss-logging + ${jboss-logging.version} + + From 52c7edb69368e87dd47b4b30a372a9bbb5dfafef Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 22 Feb 2019 15:53:07 +0100 Subject: [PATCH 076/454] HBX-1799: Update Hibernate core dependency to 5.3.8.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 68c946f622..7beb9410c0 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.28 1.4.197 5.1.0.Final - 5.3.7.Final + 5.3.8.Final 2.3.3 7.0 1.2.0 From 905e869e43476a66b9bf34c2903fe39ded7ee82d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 23 Feb 2019 08:01:20 +0100 Subject: [PATCH 077/454] HBX-1800: Update version identifier to 4.3.8.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 188779baf4..6cbd1106e3 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index ac10e57ae9..320ba948e1 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.8-SNAPSHOT"; + public static final String VERSION = "5.3.8.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2bb505de1a..684c75c940 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 7beb9410c0..b23eca82d0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index f58dd4da08..e48e6f5bd3 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 1788b1bcd4..d522b57d38 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index c49531f0ff..5191ca1997 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 2668f9117f..ad0c517882 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index a7fb559af6..952dac5ce6 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index b0561cb00c..2db2037b71 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 1bf0fde1f3..cfeafc6939 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 051ef1dc11..920dbd04b9 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 7046e7bddf..5aa5e35b89 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 492de00af5..5de4975e2f 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-utils From e99504aefa4450b08287526bda9273dde56e6461 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 25 Feb 2019 14:38:50 +0100 Subject: [PATCH 078/454] Revert "HBX-1800: Update version identifier to 4.3.8.Final" This reverts commit 905e869e43476a66b9bf34c2903fe39ded7ee82d. --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6cbd1106e3..188779baf4 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 320ba948e1..ac10e57ae9 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.8.Final"; + public static final String VERSION = "5.3.8-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 684c75c940..2bb505de1a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index b23eca82d0..7beb9410c0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.8-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index e48e6f5bd3..f58dd4da08 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index d522b57d38..1788b1bcd4 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 5191ca1997..c49531f0ff 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index ad0c517882..2668f9117f 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 952dac5ce6..a7fb559af6 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2db2037b71..b0561cb00c 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index cfeafc6939..1bf0fde1f3 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 920dbd04b9..051ef1dc11 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 5aa5e35b89..7046e7bddf 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 5de4975e2f..492de00af5 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.8-SNAPSHOT hibernate-tools-tests-utils From 2c79b739b10a2d6c2f615ee4f941818e65271205 Mon Sep 17 00:00:00 2001 From: Guillaume HUSTA Date: Thu, 13 Jul 2017 14:48:05 +0200 Subject: [PATCH 079/454] HBX-1408 - Bad default type mapping for SQL Type NUMERIC or DECIMAL with precision >= 19 and scale = 0 Signed-off-by: Koen Aers --- .../org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java b/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java index b8c78aaf64..f921e1187f 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java @@ -79,7 +79,7 @@ else if (precision < 19) { return returnNullable?Long.class.getName():"long"; } else { - return "big_decimal"; + return "big_integer"; } } From ad2b37e80b0740aa3823c397641ffd52f2d59573 Mon Sep 17 00:00:00 2001 From: Alexander Bryantsev Date: Sat, 9 Feb 2019 15:32:03 +0300 Subject: [PATCH 080/454] HBX-1797: Oracle metadata of columns includes all forms of TIMESTAMP datatype now. Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/OracleMetaDataDialect.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java index 8d3b7fd782..4ffcd541d3 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java @@ -104,11 +104,14 @@ public OracleMetaDataDialect() { + "'CHAR', a.char_length, " + "'NCHAR', a.char_length, " + "a.data_length) as COLUMN_SIZE, " - + "decode(a.data_type,'CHAR',1, 'DATE',91, 'FLOAT',6, " - + "'LONG',-1, 'NUMBER',2, 'VARCHAR2',12, 'BFILE',-13, " - + "'BLOB',2004, 'CLOB',2005, 'MLSLABEL',1111, 'NCHAR',1, 'NCLOB',2005, 'NVARCHAR2',12, " - + "'RAW',-3, 'ROWID',1111, 'UROWID',1111, 'LONG RAW', -4, " - + "'TIMESTAMP', 93, 'TIMESTAMP(6)', 93, 'XMLTYPE',2005, 1111) as DATA_TYPE, " + + "CASE\n" + + " WHEN a.data_type LIKE 'TIMESTAMP%' THEN\n" + + " 93\n" + + " ELSE\n" + + " decode(a.data_type, 'CHAR', 1, 'DATE', 91, 'FLOAT', 6, 'LONG', -1, 'NUMBER', 2, 'VARCHAR2', 12, 'BFILE', -13,\n" + + " 'BLOB', 2004, 'CLOB', 2005, 'MLSLABEL', 1111, 'NCHAR', 1, 'NCLOB', 2005, 'NVARCHAR2', 12, 'RAW', -3,\n" + + " 'ROWID', 1111, 'UROWID', 1111, 'LONG RAW', -4, 'XMLTYPE', 2005, 1111)\n" + + "END AS data_type\n," + "a.table_name as TABLE_NAME, a.data_type as TYPE_NAME, " + "decode(a.data_scale, null, 0 ,a.data_scale) as DECIMAL_DIGITS, b.comments " + "from all_tab_columns a left join all_col_comments b on " From 7cc015026d8416b291b8b99dc0d4b25ae33f6edc Mon Sep 17 00:00:00 2001 From: Alexander Bryantsev Date: Sat, 9 Feb 2019 16:08:02 +0300 Subject: [PATCH 081/454] HBX-1797: Oracle metadata queries were optimized (tested at Oracle 9.2) Signed-off-by: Koen Aers --- .../reveng/dialect/OracleMetaDataDialect.java | 145 +++++++++++------- 1 file changed, 88 insertions(+), 57 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java index 4ffcd541d3..33b8dd8a8a 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/OracleMetaDataDialect.java @@ -31,9 +31,13 @@ public OracleMetaDataDialect() { /* ******* TABLE QUERIES ******* */ private static final String SQL_TABLE_BASE = - "select a.table_name, a.owner, b.comments, 'TABLE' " - + "from all_tables a left join all_tab_comments b " - + "on (a.owner=b.owner and a.table_name=b.table_name) "; + "select a.table_name, a.owner, " + + "(SELECT b.comments\n" + + " FROM all_tab_comments b\n" + + " WHERE a.owner = b.owner\n" + + " AND a.table_name = b.table_name) AS comments, " + + "'TABLE' " + + "from all_tables a "; private static final String SQL_TABLE_VIEW = " union all select view_name, owner, NULL, 'VIEW' from all_views "; @@ -46,9 +50,11 @@ public OracleMetaDataDialect() { private static final String SQL_TABLE_TABLE = SQL_TABLE_BASE + "where a.table_name like ?" + SQL_TABLE_VIEW + "where view_name like ?"; - private static final String SQL_TABLE_SCHEMA_AND_TABLE = SQL_TABLE_BASE - + "where a.owner like ? and a.table_name like ?" + SQL_TABLE_VIEW - + "where owner like ? and view_name like ?"; + private static final String SQL_TABLE_SCHEMA_AND_TABLE = + SQL_TABLE_BASE + + "where a.owner like ? and a.table_name like ?" + + SQL_TABLE_VIEW + + "where owner like ? and view_name like ?"; private PreparedStatement prepTableNone; @@ -61,14 +67,19 @@ public OracleMetaDataDialect() { /* ***************************** */ /* ******* INDEX QUERIES ******* */ /* ***************************** */ - private static final String SQL_INDEX_BASE = "select a.column_name, " - + "decode(b.uniqueness,'UNIQUE','false','true'), " - + "a.index_owner, a.index_name, a.table_name " - + "from all_ind_columns a left join all_indexes b on " - + "(a.table_name = b.table_name " - + " AND a.table_owner = b.table_owner " - + " AND a.index_name = b.index_name) " - + "where b.index_type not like 'FUNCTION-BASED%' "; + private static final String SQL_INDEX_BASE = + "SELECT a.column_name\n" + + " ,decode((SELECT b.uniqueness\n" + + " FROM all_indexes b\n" + + " WHERE a.table_name = b.table_name\n" + + " AND a.table_owner = b.table_owner\n" + + " AND a.index_name = b.index_name\n" + + " AND b.index_type NOT LIKE 'FUNCTION-BASED%'), 'UNIQUE', 'false', 'true') AS uniqueness\n" + + " ,a.index_owner\n" + + " ,a.index_name\n" + + " ,a.table_name\n" + + " FROM all_ind_columns a\n " + + " WHERE 1 = 1\n "; private static final String SQL_INDEX_ORDER = " order by a.table_name, a.column_position"; @@ -93,29 +104,30 @@ public OracleMetaDataDialect() { private PreparedStatement prepIndexSchemaAndTable; /* ****** COLUMN QUERIES ******* */ - private static final String SQL_COLUMN_BASE = "select a.column_name as COLUMN_NAME, a.owner as TABLE_SCHEM, " - + "decode(a.nullable,'N',0,1) as NULLABLE, " - + "decode(a.data_type, " - + "'FLOAT', decode(a.data_precision, null, a.data_length, a.data_precision), " - + "'NUMBER', decode(a.data_precision, null, a.data_length, a.data_precision), " - + "'VARCHAR2', a.char_length, " - + "'VARCHAR', a.char_length, " - + "'NVARCHAR2', a.char_length, " - + "'CHAR', a.char_length, " - + "'NCHAR', a.char_length, " - + "a.data_length) as COLUMN_SIZE, " - + "CASE\n" - + " WHEN a.data_type LIKE 'TIMESTAMP%' THEN\n" - + " 93\n" - + " ELSE\n" - + " decode(a.data_type, 'CHAR', 1, 'DATE', 91, 'FLOAT', 6, 'LONG', -1, 'NUMBER', 2, 'VARCHAR2', 12, 'BFILE', -13,\n" - + " 'BLOB', 2004, 'CLOB', 2005, 'MLSLABEL', 1111, 'NCHAR', 1, 'NCLOB', 2005, 'NVARCHAR2', 12, 'RAW', -3,\n" - + " 'ROWID', 1111, 'UROWID', 1111, 'LONG RAW', -4, 'XMLTYPE', 2005, 1111)\n" - + "END AS data_type\n," - + "a.table_name as TABLE_NAME, a.data_type as TYPE_NAME, " - + "decode(a.data_scale, null, 0 ,a.data_scale) as DECIMAL_DIGITS, b.comments " - + "from all_tab_columns a left join all_col_comments b on " - + "(a.owner=b.owner and a.table_name=b.table_name and a.column_name=b.column_name) "; + private static final String SQL_COLUMN_BASE = + "SELECT a.column_name AS COLUMN_NAME\n" + + " ,a.owner AS TABLE_SCHEM\n" + + " ,decode(a.nullable, 'N', 0, 1) AS NULLABLE\n" + + " ,decode(a.data_type, 'FLOAT', decode(a.data_precision, NULL, a.data_length, a.data_precision), 'NUMBER',\n" + + " decode(a.data_precision, NULL, a.data_length, a.data_precision), 'VARCHAR2', a.char_length, 'VARCHAR',\n" + + " a.char_length, 'NVARCHAR2', a.char_length, 'CHAR', a.char_length, 'NCHAR', a.char_length, a.data_length) AS COLUMN_SIZE\n" + + " ,CASE\n" + + " WHEN a.data_type LIKE 'TIMESTAMP%' THEN\n" + + " 93\n" + + " ELSE\n" + + " decode(a.data_type, 'CHAR', 1, 'DATE', 91, 'FLOAT', 6, 'LONG', -1, 'NUMBER', 2, 'VARCHAR2', 12, 'BFILE', -13,\n" + + " 'BLOB', 2004, 'CLOB', 2005, 'MLSLABEL', 1111, 'NCHAR', 1, 'NCLOB', 2005, 'NVARCHAR2', 12, 'RAW', -3,\n" + + " 'ROWID', 1111, 'UROWID', 1111, 'LONG RAW', -4, 'XMLTYPE', 2005, 1111)\n" + + " END AS DATA_TYPE\n" + + " ,a.table_name AS TABLE_NAME\n" + + " ,a.data_type AS TYPE_NAME\n" + + " ,decode(a.data_scale, NULL, 0, a.data_scale) AS DECIMAL_DIGITS\n" + + " ,(SELECT b.comments\n" + + " FROM all_col_comments b\n" + + " WHERE a.owner = b.owner\n" + + " AND a.table_name = b.table_name\n" + + " AND a.column_name = b.column_name) AS COMMENTS\n" + + " FROM all_tab_columns a\n"; private static final String SQL_COLUMN_ORDER = " order by column_id "; @@ -164,8 +176,9 @@ public OracleMetaDataDialect() { /* ***************************** */ /* ******** PK QUERIES ********* */ /* ***************************** */ - private static final String SQL_PK_BASE = "select c.table_name, c.column_name, c.position, c.constraint_name, " - + "c.owner from all_cons_columns c left join all_constraints k on " + private static final String SQL_PK_BASE = + "select c.table_name, c.column_name, c.position, c.constraint_name, " + + "c.owner from all_cons_columns c join all_constraints k on " + "(k.owner = c.owner AND k.table_name = c.table_name AND k.constraint_name = c.constraint_name) " + "where k.constraint_type = 'P' "; @@ -193,16 +206,37 @@ public OracleMetaDataDialect() { /* ***************************** */ /* ******** FK QUERIES ********* */ /* ***************************** */ - private static final String SQL_FK_BASE = "select p.table_name, p.owner, f.owner, f.table_name, " - + "fc.column_name, pc.column_name, f.constraint_name, fc.position " - + "from all_constraints p left join all_cons_columns pc on " - + "(pc.owner = p.owner and pc.constraint_name = p.constraint_name and pc.table_name = p.table_name) " - + "left join all_constraints f on (p.owner = f.r_owner and p.constraint_name = f.r_constraint_name) " - + "left join all_cons_columns fc on " - + "(fc.owner = f.owner and fc.constraint_name = f.constraint_name and fc.table_name = f.table_name and" - + " fc.position = pc.position) where f.constraint_type = 'R' AND p.constraint_type = 'P' "; - - private static final String SQL_FK_ORDER = " order by f.table_name, f.constraint_name, fc.position "; + private static final String SQL_FK_BASE = + "SELECT p.table_name as p_table_name\n" + + " ,p.owner as p_owner\n" + + " ,f.owner as f_owner\n" + + " ,f.table_name as f_table_name\n" + + " ,(SELECT fc.column_name\n" + + " FROM all_cons_columns fc\n" + + " WHERE fc.owner = f.owner\n" + + " AND fc.constraint_name = f.constraint_name\n" + + " AND fc.table_name = f.table_name\n" + + " AND fc.position = pc.position) AS fc_column_name\n" + + " ,pc.column_name as pc_column_name\n" + + " ,f.constraint_name\n" + + " ,(SELECT fc.position\n" + + " FROM all_cons_columns fc\n" + + " WHERE fc.owner = f.owner\n" + + " AND fc.constraint_name = f.constraint_name\n" + + " AND fc.table_name = f.table_name\n" + + " AND fc.position = pc.position) AS fc_position\n" + + " FROM all_constraints p\n" + + " JOIN all_cons_columns pc\n" + + " ON pc.owner = p.owner\n" + + " AND pc.constraint_name = p.constraint_name\n" + + " AND pc.table_name = p.table_name\n" + + " JOIN all_constraints f\n" + + " ON p.owner = f.r_owner\n" + + " AND p.constraint_name = f.r_constraint_name\n" + + " WHERE f.constraint_type = 'R'\n" + + " AND p.constraint_type = 'P'\n"; + + private static final String SQL_FK_ORDER = " order by f.table_name, f.constraint_name, position "; private static final String SQL_FK_NONE = SQL_FK_BASE + SQL_FK_ORDER; @@ -228,8 +262,7 @@ public Iterator> getTables(final String catalog, final String try { log.debug("getTables(" + catalog + "." + schema + "." + table + ")"); - ResultSet tableRs; - tableRs = getTableResultSet( schema, table ); + ResultSet tableRs = getTableResultSet( schema, table ); return new ResultSetIterator(null, tableRs, getSQLExceptionConverter()) { @@ -244,7 +277,7 @@ protected Map convertRow(ResultSet tableResultSet) element.put("TABLE_SCHEM", tableResultSet.getString(2)); element.put("TABLE_CAT", null); element.put("TABLE_TYPE", tableResultSet.getString(4)); - element.put("REMARKS", tableResultSet.getString(3)); + element.put("REMARKS", tableResultSet.getString(3)); log.info( element.toString() ); return element; } @@ -312,7 +345,7 @@ protected Throwable handleSQLException(SQLException e) { throw getSQLExceptionConverter().convert( e, "Exception while getting index info for " - + TableNameQualifier.qualify(catalog, schema, table), null); + + TableNameQualifier.qualify(catalog, schema, table) + ": " + e.getMessage(), null); } } @@ -412,8 +445,7 @@ public Iterator> getExportedKeys(final String catalog, final log.debug("getExportedKeys(" + catalog + "." + schema + "." + table + ")"); - ResultSet pExportRs; - pExportRs = getExportedKeysResultSet( schema, table ); + ResultSet pExportRs = getExportedKeysResultSet( schema, table ); return new ResultSetIterator(null, pExportRs, getSQLExceptionConverter()) { @@ -576,8 +608,7 @@ private ResultSet getExportedKeysResultSet(final String schema, final String tab prepFkNone = con .prepareStatement(SQL_FK_NONE); prepFkSchema = con.prepareStatement(SQL_FK_SCHEMA); prepFkTable = con.prepareStatement(SQL_FK_TABLE); - prepFkSchemaAndTable = con - .prepareStatement(SQL_FK_SCHEMA_AND_TABLE); + prepFkSchemaAndTable = con.prepareStatement(SQL_FK_SCHEMA_AND_TABLE); log.debug(" foreign key queries prepared!"); } From 8de576e666336b8ff2d6b750ec44811888f44077 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 23 Feb 2019 08:01:20 +0100 Subject: [PATCH 082/454] HBX-1800: Update version identifier to 4.3.8.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 188779baf4..6cbd1106e3 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index ac10e57ae9..320ba948e1 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.8-SNAPSHOT"; + public static final String VERSION = "5.3.8.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2bb505de1a..684c75c940 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 7beb9410c0..b23eca82d0 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index f58dd4da08..e48e6f5bd3 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 1788b1bcd4..d522b57d38 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index c49531f0ff..5191ca1997 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 2668f9117f..ad0c517882 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index a7fb559af6..952dac5ce6 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index b0561cb00c..2db2037b71 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 1bf0fde1f3..cfeafc6939 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 051ef1dc11..920dbd04b9 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 7046e7bddf..5aa5e35b89 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 492de00af5..5de4975e2f 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8-SNAPSHOT + 5.3.8.Final hibernate-tools-tests-utils From 69a11c11164660884b5504fec23e82d8303504b9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 2 Mar 2019 13:05:49 +0100 Subject: [PATCH 083/454] HBX-1802: Update version identifier to 5.3.9-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6cbd1106e3..a64b0df891 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 320ba948e1..49d33c5ba3 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.8.Final"; + public static final String VERSION = "5.3.9-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 684c75c940..6d283fb1e8 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index b23eca82d0..8aeac37028 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.9-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index e48e6f5bd3..09409cfbe3 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index d522b57d38..1c03ed922a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 5191ca1997..9b2414fef0 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index ad0c517882..fa1696e97c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 952dac5ce6..d2b57294ae 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2db2037b71..60bc4240a2 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index cfeafc6939..45e6c37b63 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 920dbd04b9..f75009c7cb 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 5aa5e35b89..eeb9865684 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 5de4975e2f..73dc903279 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.8.Final + 5.3.9-SNAPSHOT hibernate-tools-tests-utils From 661ea466f3579516b16158725d9827ebf1353326 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 3 Mar 2019 01:43:37 +0100 Subject: [PATCH 084/454] HBX-1803: Update Hibernate core dependency to 5.3.9.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8aeac37028..1a01cd39c9 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.28 1.4.197 5.1.0.Final - 5.3.8.Final + 5.3.9.Final 2.3.3 7.0 1.2.0 From ff89fb8190f1d21b80c8ad4b94f2e9887953cca7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 10 Mar 2019 13:20:18 +0100 Subject: [PATCH 085/454] HBX-1804: Update version identifier to 5.3.9.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index a64b0df891..53dca94aa7 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 49d33c5ba3..5f79b5a811 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.9-SNAPSHOT"; + public static final String VERSION = "5.3.9.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 6d283fb1e8..c1263fc288 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 1a01cd39c9..dc3497db4b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.9-SNAPSHOT + 5.3.9.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 09409cfbe3..1e4f49638e 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 1c03ed922a..283afda121 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 9b2414fef0..666f8f2fcf 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index fa1696e97c..f9b7d4b5ce 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index d2b57294ae..25c31de19c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 60bc4240a2..d0998b6ac9 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 45e6c37b63..f730962851 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index f75009c7cb..b3961d5e84 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index eeb9865684..bdf4516b29 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 73dc903279..f001f7891e 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9-SNAPSHOT + 5.3.9.Final hibernate-tools-tests-utils From d4c7c1925ffc4d5a6ac97f1a3c2220e7fa4e567b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 11 Mar 2019 18:27:13 +0100 Subject: [PATCH 086/454] HBX-1805: Update version identifier to 5.3.10-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 53dca94aa7..81b396d633 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 5f79b5a811..3927bb279a 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.9.Final"; + public static final String VERSION = "5.3.10-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c1263fc288..5c9268a314 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index dc3497db4b..bd6c725d51 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.9.Final + 5.3.10-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 1e4f49638e..11ddc63277 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 283afda121..8e84a6109f 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 666f8f2fcf..fe68047ffe 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index f9b7d4b5ce..bddbef9885 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 25c31de19c..7411c965aa 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index d0998b6ac9..a139016d3c 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index f730962851..cfe3a252d4 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index b3961d5e84..9205bd7e21 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index bdf4516b29..4f35084c8e 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index f001f7891e..117c735502 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.9.Final + 5.3.10-SNAPSHOT hibernate-tools-tests-utils From 78c8180afbd3202408637212f421e8c4d9a7b390 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 29 Mar 2019 12:56:31 +0100 Subject: [PATCH 087/454] HBX-1810: Update jboss-parent dependency to version 32 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bd6c725d51..c69ed90dea 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 31 + 32 org.hibernate From a058ee7ccf24eb0945b0cdbee1858e422d3b73d5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 12 Apr 2019 20:46:06 +0200 Subject: [PATCH 088/454] HBX-1811: Update jboss-parent dependency to version 34 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c69ed90dea..c7870f0ed6 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 32 + 34 org.hibernate From 5296b562c87161cc3b0c1b31cf445cabce5b5984 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 26 Apr 2019 14:35:28 +0200 Subject: [PATCH 089/454] HBX-1812: Update Eclipse-jdt-core dependency to version 3.17.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7870f0ed6..fcc47b04af 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.10.5 3.2.2 1.2 - 3.16.0 + 3.17.0 2.3.28 1.4.197 5.1.0.Final From b4d09069969a10bf805f0d055f644dabbea38b91 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 6 May 2019 11:20:31 +0200 Subject: [PATCH 090/454] HBX-1813: Update Hibernate core dependency to 5.3.10.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fcc47b04af..df976a7e70 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.28 1.4.197 5.1.0.Final - 5.3.9.Final + 5.3.10.Final 2.3.3 7.0 1.2.0 From fb59c8f3a809f39a93ca71730c418ab5952042ce Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 6 May 2019 11:41:23 +0200 Subject: [PATCH 091/454] HBX-1814: Update version identifier to 5.3.10.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 81b396d633..6222f4ae3f 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 3927bb279a..d297470d40 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.10-SNAPSHOT"; + public static final String VERSION = "5.3.10.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 5c9268a314..0fb3eb53a5 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index df976a7e70..de6dd594c3 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.10-SNAPSHOT + 5.3.10.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 11ddc63277..24e9b5192b 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 8e84a6109f..7818d4ede8 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index fe68047ffe..ad758116c5 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index bddbef9885..1816f90d2b 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 7411c965aa..f51c6e3d1c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index a139016d3c..be8543f948 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index cfe3a252d4..d8682be7e5 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 9205bd7e21..d9712e4ddd 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 4f35084c8e..dda624a77c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 117c735502..93b9030430 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10-SNAPSHOT + 5.3.10.Final hibernate-tools-tests-utils From ee7b273901aed8c5848a9b544a9c864234e796aa Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 6 May 2019 12:22:23 +0200 Subject: [PATCH 092/454] HBX-1815: Update version identifier to 5.3.11-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6222f4ae3f..9931adabdc 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index d297470d40..b9c9996c22 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.10.Final"; + public static final String VERSION = "5.3.11-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 0fb3eb53a5..7ebdc808cc 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index de6dd594c3..1ef559cecf 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.10.Final + 5.3.11-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 24e9b5192b..5fb3bf6341 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 7818d4ede8..a3a4004e0b 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index ad758116c5..fbc4b4ce2f 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 1816f90d2b..72718e1e3c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index f51c6e3d1c..c3c9fb5bf5 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index be8543f948..8ced9a4465 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index d8682be7e5..9cbabe6b8c 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d9712e4ddd..47baa4f5af 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index dda624a77c..9f4723c7a1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 93b9030430..c7f03e6aa1 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.10.Final + 5.3.11-SNAPSHOT hibernate-tools-tests-utils From c49e93cba1f886b388d6485530be78ef357fee5c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 15 May 2019 20:57:52 +0200 Subject: [PATCH 093/454] HBX-1818: Update jboss-parent dependency to version 35 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1ef559cecf..d5030caae2 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 34 + 35 org.hibernate From 359595e954af42ae6dab2fc4556384a0199c5471 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 27 May 2019 15:41:48 +0200 Subject: [PATCH 094/454] HBX-1819: Update ant dependency version to 1.10.6 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5030caae2..0f5aad491c 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.5 + 1.10.6 3.2.2 1.2 3.17.0 From 73f085b49421255703dce1eea6fd0e912aa8289f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 3 Jun 2019 16:31:16 +0200 Subject: [PATCH 095/454] HBX-1821: Update H2 version to 1.4.199 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f5aad491c..edac4b73cc 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.2 3.17.0 2.3.28 - 1.4.197 + 1.4.199 5.1.0.Final 5.3.10.Final 2.3.3 From c27c7791b77fb3fd056b7facfa96449126c765fe Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Jun 2019 10:30:30 +0200 Subject: [PATCH 096/454] HBX-1827: Update jboss-logging dependency to version 3.4.0.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index edac4b73cc..209a345696 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 2.3.1 2.3.2 1.1.6 - 3.3.2.Final + 3.4.0.Final 4.12 6.0.6 12.2.0.1 From 543c8075bff1e731c55155d26926046991cf11e1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 18 Jun 2019 16:13:42 +0200 Subject: [PATCH 097/454] HBX-1830: Update HSQLDB dependency to version 2.5.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 209a345696..fbef550eb6 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 1.4.199 5.1.0.Final 5.3.10.Final - 2.3.3 + 2.5.0 7.0 1.2.0 2.2 From 460c617235845606bf760533953bf40c36e033a2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 9 Jul 2019 10:33:45 +0200 Subject: [PATCH 098/454] HBX-1831: Remove outdated 'readme.txt' - Delete 'main/readme.txt' Signed-off-by: Koen Aers --- main/readme.txt | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 main/readme.txt diff --git a/main/readme.txt b/main/readme.txt deleted file mode 100644 index 21538b1b69..0000000000 --- a/main/readme.txt +++ /dev/null @@ -1,35 +0,0 @@ -Hibernate Tools -=============== -Version: 4.0.0, February 2012 - -What is it ----------- - -The tools for Hibernate provides various tools to use with Hibernate. -The primary tools can be used for generating source artifacts such as -mapping files, java entities, DAO and other scaffolding code. The -source of this generation can be JDBC database, classes or even just -existing mappings. - -It uses Hibernate core metamodel to generate from and to the source -artifacts. Allowing it to support both top-down, bottom-up and -middle-out development. - -Hibernate Tools is used in JBoss Tools Hibernate plugins to provide -parts of the Eclipse plugins for Hibernate. - -Licensing ---------- - -This software is distributed under the terms of the FSF Lesser Gnu Public -License (see lgpl.txt). This product includes software developed by the Apache -Software Foundation (http://www.apache.org/). - -Hibernate Tools URLs --------------------- - -Home Page: http://tools.hibernate.org | http://jboss.org/tools -Downloads: http://jboss.org/tools/download -Mailing lists: http://www.hibernate.org/community/mailinglists.html -Source Code: https://github.com/hibernate/hibernate-tools/ -Issue Tracking: http://opensource.atlassian.com/projects/hibernate/browse/HBX From 605613ac9bc0ee398a64d07cb7af213980d40286 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 16 Jul 2019 17:13:02 +0200 Subject: [PATCH 099/454] HBX-1832: Update eclipse-jdt-core dependency to version 3.18.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fbef550eb6..29229fb061 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.10.6 3.2.2 1.2 - 3.17.0 + 3.18.0 2.3.28 1.4.199 5.1.0.Final From 53d9ba09dea95fcd7f672765aceaa83f158a2443 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 18 Jul 2019 15:27:53 +0200 Subject: [PATCH 100/454] HBX-1833: Update Jaxen dependency to version 1.2.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 29229fb061..955a9843d3 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2.2 2.3.1 2.3.2 - 1.1.6 + 1.2.0 3.4.0.Final 4.12 6.0.6 From 0daa2e8a2122607be5c49fed58149cbd7105d58c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 6 Sep 2019 12:18:52 +0200 Subject: [PATCH 101/454] HBX-1816: Update Hibernate core dependency to 5.3.11.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 955a9843d3..7d8dc4e5e4 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.28 1.4.199 5.1.0.Final - 5.3.10.Final + 5.3.11.Final 2.5.0 7.0 1.2.0 From bac216aad8ade888b0793ec330ccca96555e4a22 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 7 Sep 2019 09:55:31 +0200 Subject: [PATCH 102/454] HBX-1817: Update version identifier to 5.3.11.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 9931adabdc..a93086d168 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index b9c9996c22..a0bf715ad9 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.11-SNAPSHOT"; + public static final String VERSION = "5.3.11.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 7ebdc808cc..67b50d2788 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 7d8dc4e5e4..ebb34b7a2f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.11-SNAPSHOT + 5.3.11.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 5fb3bf6341..216a8314a3 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index a3a4004e0b..5cfd8206c0 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index fbc4b4ce2f..9d2f97824f 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 72718e1e3c..054c505cc9 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c3c9fb5bf5..42708dcee7 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 8ced9a4465..4363a8ebde 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 9cbabe6b8c..77edaee7f5 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 47baa4f5af..d40ace656c 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 9f4723c7a1..41e22b2fb6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index c7f03e6aa1..e620122650 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11-SNAPSHOT + 5.3.11.Final hibernate-tools-tests-utils From 9a23db3d2b0f4f9c2e916ee103f90ef35ab5a26a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 8 Sep 2019 14:30:08 +0200 Subject: [PATCH 103/454] HBX-1844: Update version identifier to 5.3.12-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index a93086d168..08929a4f29 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index a0bf715ad9..01dc4461dd 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.11.Final"; + public static final String VERSION = "5.3.12-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 67b50d2788..c92d555cff 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index ebb34b7a2f..13cca45496 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.11.Final + 5.3.12-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 216a8314a3..80ad297590 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 5cfd8206c0..87df1a463b 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 9d2f97824f..745b73d4e8 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 054c505cc9..b353785b56 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 42708dcee7..b34333e8d4 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 4363a8ebde..88b232512d 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 77edaee7f5..4056997cd5 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d40ace656c..54e6c5fcaa 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 41e22b2fb6..d63d583435 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index e620122650..95452dd3e4 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.11.Final + 5.3.12-SNAPSHOT hibernate-tools-tests-utils From 616af60b276cf1973c60ce25758384d499965235 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 16 Sep 2019 18:40:26 +0200 Subject: [PATCH 104/454] HBX-1846: Update freemarker version to 2.3.29 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 13cca45496..0592ce77e6 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ 3.2.2 1.2 3.18.0 - 2.3.28 + 2.3.29 1.4.199 5.1.0.Final 5.3.11.Final From ea0117985c6b6308084069c000a8b2a8dd5b04e6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Sep 2019 15:28:53 +0200 Subject: [PATCH 105/454] HBX-1845: Update hibernate core dependency to 5.3.12.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0592ce77e6..027264ab92 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.29 1.4.199 5.1.0.Final - 5.3.11.Final + 5.3.12.Final 2.5.0 7.0 1.2.0 From e6317b564227701e7b1a118316695696d548d3e1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Sep 2019 16:01:09 +0200 Subject: [PATCH 106/454] HBX-1847: Update version identifier to 5.3.12.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 08929a4f29..eef8f80287 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 01dc4461dd..1b4974f6b8 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.12-SNAPSHOT"; + public static final String VERSION = "5.3.12.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c92d555cff..41a8c1092f 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 027264ab92..37ca197ce4 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.12-SNAPSHOT + 5.3.12.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 80ad297590..6992883f61 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 87df1a463b..ffe4c51782 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 745b73d4e8..220141340c 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index b353785b56..eb506176fc 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index b34333e8d4..e7e3bc62c3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 88b232512d..c0d3897df6 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 4056997cd5..f8bc4bb00e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 54e6c5fcaa..1b7d3158a6 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d63d583435..8f1c74d47c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 95452dd3e4..0486da4324 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12-SNAPSHOT + 5.3.12.Final hibernate-tools-tests-utils From a8d84d6f0877f102eee13fc611106224694dbfa3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 19 Sep 2019 10:47:56 +0200 Subject: [PATCH 107/454] HBX-1848: Update version identifier to 5.3.13-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index eef8f80287..613334e264 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 1b4974f6b8..22197471e0 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.12.Final"; + public static final String VERSION = "5.3.13-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 41a8c1092f..cfedaad9e9 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 37ca197ce4..aa1c7c5eed 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.12.Final + 5.3.13-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 6992883f61..ee8c8096c5 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index ffe4c51782..f00ad711bf 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 220141340c..74e81c626b 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index eb506176fc..cd7df6bb3c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index e7e3bc62c3..ce992bbd36 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index c0d3897df6..f895d83079 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index f8bc4bb00e..e1bc928fa6 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 1b7d3158a6..3d69c97814 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 8f1c74d47c..85f3fff30f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 0486da4324..ec2f4a92c9 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.12.Final + 5.3.13-SNAPSHOT hibernate-tools-tests-utils From 38ed454ecf681953e5ec085b2ed1453efca39404 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 20 Sep 2019 12:09:43 +0200 Subject: [PATCH 108/454] HBX-1851: Update jboss-parent dependency to version 36 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa1c7c5eed..af21b034b7 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 35 + 36 org.hibernate From 826de508ca5715ea26610b3124a3e0c77fe26b53 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Oct 2019 10:24:54 +0200 Subject: [PATCH 109/454] HBX-1877: Update hibernate core dependency to 5.3.13.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index af21b034b7..7531ad60b4 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.3.29 1.4.199 5.1.0.Final - 5.3.12.Final + 5.3.13.Final 2.5.0 7.0 1.2.0 From 24f7aa38ee1f640b6efdad7d221a9304155e10ec Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Oct 2019 10:50:11 +0200 Subject: [PATCH 110/454] HBX-1849: Update version identifier to 5.3.13.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 613334e264..3a5d3268de 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 22197471e0..c414be3d22 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.13-SNAPSHOT"; + public static final String VERSION = "5.3.13.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index cfedaad9e9..573762a6c6 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 7531ad60b4..6d192ccc17 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.13-SNAPSHOT + 5.3.13.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index ee8c8096c5..9cc773b10c 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index f00ad711bf..6a7c9ed6e0 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 74e81c626b..8eaad81865 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index cd7df6bb3c..537f1e87db 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ce992bbd36..c6fbf9b09a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index f895d83079..6dbd7c998f 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index e1bc928fa6..684c375877 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 3d69c97814..824e6572b0 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 85f3fff30f..c6ae4efd8c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ec2f4a92c9..ab90df813d 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13-SNAPSHOT + 5.3.13.Final hibernate-tools-tests-utils From 5a6879e7ffb9ad7d58bd1ffbade22768fc17e3c7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Oct 2019 11:21:36 +0200 Subject: [PATCH 111/454] HBX-1878: Update version identifier to 5.3.14-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 3a5d3268de..104b1752cf 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index c414be3d22..8dfa3b6573 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -5,7 +5,7 @@ final public class Version { - public static final String VERSION = "5.3.13.Final"; + public static final String VERSION = "5.3.14-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 573762a6c6..c6f55db5d1 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 6d192ccc17..be79ac635b 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.13.Final + 5.3.14-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 9cc773b10c..b1ddcede7f 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 6a7c9ed6e0..656f72ffba 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 8eaad81865..725e0cb957 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 537f1e87db..bcd30b9450 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c6fbf9b09a..c08883e2a2 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 6dbd7c998f..caa893428b 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 684c375877..e772811f7b 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 824e6572b0..45cbddcac8 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index c6ae4efd8c..d4da3362a1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ab90df813d..f638331013 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.13.Final + 5.3.14-SNAPSHOT hibernate-tools-tests-utils From 0c1e52157559a0903e5a2d10cc554508fca682a8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Oct 2019 15:20:07 +0200 Subject: [PATCH 112/454] HBX-1883: Update ant dependency version to 1.10.7 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index be79ac635b..f270bc1ac8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.6 + 1.10.7 3.2.2 1.2 3.18.0 From 04f7a128fd87985e735312f7eb06bcef5eb09c7f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Oct 2019 17:18:13 +0200 Subject: [PATCH 113/454] HBX-1884: Update commons collections dependency to version 4.4 Signed-off-by: Koen Aers --- main/pom.xml | 4 ++-- .../java/org/hibernate/cfg/reveng/MetaAttributeBinder.java | 4 ++-- .../main/java/org/hibernate/cfg/reveng/OverrideBinder.java | 4 ++-- .../java/org/hibernate/cfg/reveng/OverrideRepository.java | 2 +- .../java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java | 2 +- pom.xml | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 104b1752cf..3f7f56cf9c 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -57,8 +57,8 @@ - commons-collections - commons-collections + org.apache.commons + commons-collections4 commons-logging diff --git a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java index 0f06f65b35..978b1321e1 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java @@ -5,8 +5,8 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.collections.MultiMap; -import org.apache.commons.collections.map.MultiValueMap; +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.map.MultiValueMap; import org.dom4j.Element; import org.hibernate.mapping.MetaAttribute; import org.hibernate.tool.hbm2x.MetaAttributeHelper; diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java index 004e30197d..6aac3e90d4 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java @@ -5,8 +5,8 @@ import java.util.List; import java.util.Properties; -import org.apache.commons.collections.MultiMap; -import org.apache.commons.collections.map.MultiValueMap; +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.map.MultiValueMap; import org.dom4j.Document; import org.dom4j.Element; import org.hibernate.MappingException; diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java index 4b50f88f80..b60099cc74 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java @@ -14,7 +14,7 @@ import java.util.Properties; import java.util.Set; -import org.apache.commons.collections.MultiMap; +import org.apache.commons.collections4.MultiMap; import org.dom4j.Document; import org.hibernate.MappingException; import org.hibernate.internal.util.StringHelper; diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java index 83c6c47252..359c4f57ee 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java @@ -3,7 +3,7 @@ import java.util.Collection; import java.util.Iterator; -import org.apache.commons.collections.MultiMap; +import org.apache.commons.collections4.MultiMap; import org.hibernate.mapping.MetaAttribute; /** diff --git a/pom.xml b/pom.xml index f270bc1ac8..6e53736c2e 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 1.10.7 - 3.2.2 + 4.4 1.2 3.18.0 2.3.29 @@ -68,8 +68,8 @@ test - commons-collections - commons-collections + org.apache.commons + commons-collections4 ${commons-collections.version} From cba4a7b6708650c0325903d56e4bcc9e72411f03 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 16 Oct 2019 14:23:33 +0200 Subject: [PATCH 114/454] HBX-1885: Replace the use of the deprecated classes 'MultiMap' and 'MultiValueMap' by 'MultiValuedMap' and 'HashSetValuedHashMap' Signed-off-by: Koen Aers --- .../cfg/reveng/MetaAttributeBinder.java | 37 +++++++------- .../hibernate/cfg/reveng/OverrideBinder.java | 19 +++++-- .../cfg/reveng/OverrideRepository.java | 49 ++++++++++--------- .../org/hibernate/cfg/reveng/TableFilter.java | 8 +-- .../tool/hbm2x/MetaAttributeHelper.java | 30 +++++------- 5 files changed, 72 insertions(+), 71 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java index 978b1321e1..6c557afa90 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java @@ -5,8 +5,8 @@ import java.util.Iterator; import java.util.List; -import org.apache.commons.collections4.MultiMap; -import org.apache.commons.collections4.map.MultiValueMap; +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.multimap.HashSetValuedHashMap; import org.dom4j.Element; import org.hibernate.mapping.MetaAttribute; import org.hibernate.tool.hbm2x.MetaAttributeHelper; @@ -22,19 +22,19 @@ public class MetaAttributeBinder { * @return a MultiMap with all values from local and extra values * from inherited */ - public static MultiMap mergeMetaMaps(MultiMap specific, MultiMap general) { - MultiValueMap result = new MultiValueMap(); + public static MultiValuedMap mergeMetaMaps( + MultiValuedMap specific, + MultiValuedMap general) { + MultiValuedMap result = new HashSetValuedHashMap(); MetaAttributeHelper.copyMultiMap(result, specific); - if (general != null) { - for (Iterator iter = general.keySet().iterator();iter.hasNext();) { - Object key = iter.next(); - + for (Iterator iter = general.keySet().iterator();iter.hasNext();) { + String key = iter.next(); if (!specific.containsKey(key) ) { // inheriting a meta attribute only if it is inheritable - Collection ml = (Collection)general.get(key); - for (Iterator iterator = ml.iterator(); iterator.hasNext();) { - SimpleMetaAttribute element = (SimpleMetaAttribute) iterator.next(); + Collection ml = general.get(key); + for (Iterator iterator = ml.iterator(); iterator.hasNext();) { + SimpleMetaAttribute element = iterator.next(); if (element.inheritable) { result.put(key, element); } @@ -47,26 +47,25 @@ public static MultiMap mergeMetaMaps(MultiMap specific, MultiMap general) { } - public static MetaAttribute toRealMetaAttribute(String name, List values) { + public static MetaAttribute toRealMetaAttribute(String name, Collection values) { MetaAttribute attribute = new MetaAttribute(name); - for (Iterator iter = values.iterator(); iter.hasNext();) { - SimpleMetaAttribute element = (SimpleMetaAttribute) iter.next(); + for (Iterator iter = values.iterator(); iter.hasNext();) { + SimpleMetaAttribute element = iter.next(); attribute.addValue(element.value); } return attribute; } - /** * Method loadAndMergeMetaMap. * @param classElement * @param inheritedMeta * @return MultiMap */ - public static MultiMap loadAndMergeMetaMap( + public static MultiValuedMap loadAndMergeMetaMap( Element classElement, - MultiMap inheritedMeta) { + MultiValuedMap inheritedMeta) { return MetaAttributeBinder.mergeMetaMaps(loadMetaMap(classElement), inheritedMeta); } @@ -77,8 +76,8 @@ public static MultiMap loadAndMergeMetaMap( * @param element * @return MultiMap */ - protected static MultiMap loadMetaMap(Element element) { - MultiMap result = new MultiValueMap(); + protected static MultiValuedMap loadMetaMap(Element element) { + MultiValuedMap result = new HashSetValuedHashMap(); List metaAttributeList = new ArrayList(); for (Object obj : element.elements("meta")) { metaAttributeList.add((Element)obj); diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java index 6aac3e90d4..d9ce82a6ff 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java @@ -5,8 +5,8 @@ import java.util.List; import java.util.Properties; -import org.apache.commons.collections4.MultiMap; -import org.apache.commons.collections4.map.MultiValueMap; +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.multimap.HashSetValuedHashMap; import org.dom4j.Document; import org.dom4j.Element; import org.hibernate.MappingException; @@ -123,7 +123,10 @@ private static void bindTables(List tables, OverrideRepository repository) { } private static void bindMetaAttributes(Element element, Table table, OverrideRepository repository) { - MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiValueMap()); + MultiValuedMap map = + MetaAttributeBinder.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); if(map!=null && !map.isEmpty()) { repository.addMetaAttributeInfo( table, map); } @@ -320,7 +323,10 @@ private static List bindColumns(List columns, Table table, OverrideRe throw new MappingException("Column " + column.getName() + " already exists in table " + tableIdentifier ); } - MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiValueMap()); + MultiValuedMap map = + MetaAttributeBinder.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); if(map!=null && !map.isEmpty()) { repository.addMetaAttributeInfo( tableIdentifier, column.getName(), map); } @@ -383,7 +389,10 @@ private static void bindTableFilters(List filters, OverrideRepository resposi filter.setExclude(Boolean.valueOf(element.attributeValue("exclude") ) ); filter.setPackage(element.attributeValue("package") ); - MultiMap map = MetaAttributeBinder.loadAndMergeMetaMap( element, new MultiValueMap()); + MultiValuedMap map = + MetaAttributeBinder.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); if(map!=null && !map.isEmpty()) { filter.setMetaAttributes( map ); } else { diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java index b60099cc74..f8ea2d538e 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java @@ -5,16 +5,17 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Map.Entry; import java.util.Properties; import java.util.Set; -import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.MapIterator; +import org.apache.commons.collections4.MultiValuedMap; import org.dom4j.Document; import org.hibernate.MappingException; import org.hibernate.internal.util.StringHelper; @@ -70,9 +71,9 @@ public class OverrideRepository { final private Map foreignKeyToEntityInfo; final private Map foreignKeyToInverseEntityInfo; - final private Map tableMetaAttributes; // TI -> MultiMap of SimpleMetaAttributes + final private Map> tableMetaAttributes; // TI -> MultiMap of SimpleMetaAttributes - final private Map columnMetaAttributes; + final private Map> columnMetaAttributes; //private String defaultCatalog; //private String defaultSchema; @@ -98,8 +99,8 @@ public OverrideRepository() { foreignKeyToInverseName = new HashMap(); foreignKeyInverseExclude = new HashMap(); foreignKeyToOneExclude = new HashMap(); - tableMetaAttributes = new HashMap(); - columnMetaAttributes = new HashMap(); + tableMetaAttributes = new HashMap>(); + columnMetaAttributes = new HashMap>(); foreignKeyToEntityInfo = new HashMap(); foreignKeyToInverseEntityInfo = new HashMap(); } @@ -501,7 +502,7 @@ public AssociationInfo foreignKeyToAssociationInfo(ForeignKey foreignKey) { } protected Map columnToMetaAttributes(TableIdentifier tableIdentifier, String column) { - MultiMap specific = columnMetaAttributes.get( new TableColumnKey(tableIdentifier, column) ); + MultiValuedMap specific = columnMetaAttributes.get( new TableColumnKey(tableIdentifier, column) ); if(specific!=null && !specific.isEmpty()) { return toMetaAttributes(specific); } @@ -511,11 +512,11 @@ protected Map columnToMetaAttributes(TableIdentifier tabl // TODO: optimize protected Map tableToMetaAttributes(TableIdentifier identifier) { - MultiMap specific = tableMetaAttributes.get( identifier ); + MultiValuedMap specific = tableMetaAttributes.get( identifier ); if(specific!=null && !specific.isEmpty()) { return toMetaAttributes(specific); } - Map general = findGeneralAttributes( identifier ); + MultiValuedMap general = findGeneralAttributes( identifier ); if(general!=null && !general.isEmpty()) { return toMetaAttributes(general); } @@ -537,11 +538,11 @@ protected Map tableToMetaAttributes(TableIdentifier identi */ } - private Map findGeneralAttributes(TableIdentifier identifier) { + private MultiValuedMap findGeneralAttributes(TableIdentifier identifier) { Iterator iterator = tableFilters.iterator(); while(iterator.hasNext() ) { TableFilter tf = iterator.next(); - Map value = tf.getMetaAttributes(identifier); + MultiValuedMap value = tf.getMetaAttributes(identifier); if(value!=null) { return value; } @@ -549,20 +550,15 @@ private Map findGeneralAttributes(TableIdentifier identifier) { return null; } - private Map toMetaAttributes(Map value) { + private Map toMetaAttributes(MultiValuedMap mvm) { Map result = new HashMap(); - - Set set = value.entrySet(); - for (Iterator iter = set.iterator(); iter.hasNext();) { - Entry entry = (Entry)iter.next(); - String name = (String) entry.getKey(); - List values = (List) entry.getValue(); - - result.put(name, MetaAttributeBinder.toRealMetaAttribute(name, values)); + for (MapIterator iter = mvm.mapIterator(); iter.hasNext();) { + String key = iter.next(); + Collection values = mvm.get(key); + result.put(key, MetaAttributeBinder.toRealMetaAttribute(key, values)); } - return result; - } + } public ReverseEngineeringStrategy getReverseEngineeringStrategy() { return getReverseEngineeringStrategy(null); @@ -703,14 +699,19 @@ public void addForeignKeyInfo(String constraintName, String toOneProperty, Boole } - public void addMetaAttributeInfo(Table table, MultiMap map) { + public void addMetaAttributeInfo( + Table table, + MultiValuedMap map) { if(map!=null && !map.isEmpty()) { tableMetaAttributes.put(TableIdentifier.create(table), map); } } - public void addMetaAttributeInfo(TableIdentifier tableIdentifier, String name, MultiMap map) { + public void addMetaAttributeInfo( + TableIdentifier tableIdentifier, + String name, + MultiValuedMap map) { if(map!=null && !map.isEmpty()) { columnMetaAttributes.put(new TableColumnKey( tableIdentifier, name ), map); } diff --git a/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java b/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java index d634cf1475..0d612253d3 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java @@ -1,6 +1,6 @@ package org.hibernate.cfg.reveng; -import java.util.Map; +import org.apache.commons.collections4.MultiValuedMap; /** @@ -73,7 +73,7 @@ public String toString() { private Matcher catalogMatcher; private Matcher schemaMatcher; private Matcher nameMatcher; - private Map metaAttributes; + private MultiValuedMap metaAttributes; @@ -147,11 +147,11 @@ public Boolean getExclude() { return exclude; } - public Map getMetaAttributes(TableIdentifier identifier) { + public MultiValuedMap getMetaAttributes(TableIdentifier identifier) { return isRelevantFor(identifier) ? metaAttributes : null; } - public void setMetaAttributes(Map metaAttributes) { + public void setMetaAttributes(MultiValuedMap metaAttributes) { this.metaAttributes = metaAttributes; } } diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java index 359c4f57ee..2622310ea7 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java @@ -3,7 +3,8 @@ import java.util.Collection; import java.util.Iterator; -import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.MultiValuedMap; +import org.hibernate.cfg.reveng.SimpleMetaAttribute; import org.hibernate.mapping.MetaAttribute; /** @@ -62,27 +63,18 @@ static String getMetaAsString(Collection c) { return getMetaAsString(c, ""); } - /** - * Copies all the values from one MultiMap to another. - * This method is needed because the (undocumented) behaviour of - * MultiHashMap.putAll in versions of Commons Collections prior to 3.0 - * was to replace the collection in the destination, whereas in 3.0 - * it adds the collection from the source as an _element_ of the collection - * in the destination. This method makes no assumptions about the implementation - * of the MultiMap, and should work with all versions. - * - * @param destination - * @param specific - */ - public static void copyMultiMap(MultiMap destination, MultiMap specific) { - for (Iterator keyIterator = specific.keySet().iterator(); keyIterator.hasNext(); ) { - Object key = keyIterator.next(); - Collection c = (Collection)specific.get(key); - for (Iterator valueIterator = c.iterator(); valueIterator.hasNext(); ) + public static void copyMultiMap( + MultiValuedMap destination, + MultiValuedMap specific) { + for (Iterator keyIterator = specific.keySet().iterator(); keyIterator.hasNext(); ) { + String key = keyIterator.next(); + Collection c = specific.get(key); + for (Iterator valueIterator = c.iterator(); valueIterator.hasNext();) { destination.put(key, valueIterator.next() ); + } } } - + public static boolean getMetaAsBool(org.hibernate.mapping.MetaAttribute metaAttribute, boolean defaultValue) { return getMetaAsBool(metaAttribute==null?null:metaAttribute.getValues(), defaultValue); } From dfaa20ed93af717099bc2e96424bb5cf4ebf1a44 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 17 Oct 2019 09:33:33 +0200 Subject: [PATCH 115/454] HBX-1886: Replace commons-logging with java logging Signed-off-by: Koen Aers --- main/pom.xml | 4 - .../main/java/org/hibernate/tool/Version.java | 5 +- main/src/main/resources/dao/daohome.ftl | 80 +++++++++---------- pom.xml | 6 -- .../tool/hbm2x/Hbm2EJBDaoTest/TestCase.java | 2 - .../hbm2x/Hbm2HibernateDAOTest/TestCase.java | 2 - 6 files changed, 42 insertions(+), 57 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 3f7f56cf9c..2453bce94b 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -60,10 +60,6 @@ org.apache.commons commons-collections4 - - commons-logging - commons-logging - jaxen jaxen diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 8dfa3b6573..2716c84bcd 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -1,7 +1,6 @@ package org.hibernate.tool; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.logging.Logger; final public class Version { @@ -9,7 +8,7 @@ final public class Version { private static final Version instance = new Version(); - private static Log log = LogFactory.getLog( Version.class ); + private static Logger log = Logger.getLogger( Version.class.getName() ); static { log.info( "Hibernate Tools " + VERSION ); diff --git a/main/src/main/resources/dao/daohome.ftl b/main/src/main/resources/dao/daohome.ftl index 37d0f55816..d8766bd719 100644 --- a/main/src/main/resources/dao/daohome.ftl +++ b/main/src/main/resources/dao/daohome.ftl @@ -12,58 +12,58 @@ ${pojo.getPackageDeclaration()} public class ${declarationName}Home { - private static final ${pojo.importType("org.apache.commons.logging.Log")} log = ${pojo.importType("org.apache.commons.logging.LogFactory")}.getLog(${pojo.getDeclarationName()}Home.class); + private static final ${pojo.importType("java.util.logging.Logger")} logger = ${pojo.importType("Logger")}.getLogger(${pojo.getDeclarationName()}Home.class.getName()); <#if ejb3> @${pojo.importType("javax.persistence.PersistenceContext")} private ${pojo.importType("javax.persistence.EntityManager")} entityManager; public void persist(${declarationName} transientInstance) { - log.debug("persisting ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persisting ${declarationName} instance"); try { entityManager.persist(transientInstance); - log.debug("persist successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persist successful"); } catch (RuntimeException re) { - log.error("persist failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "persist failed", re); throw re; } } public void remove(${declarationName} persistentInstance) { - log.debug("removing ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "removing ${declarationName} instance"); try { entityManager.remove(persistentInstance); - log.debug("remove successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "remove successful"); } catch (RuntimeException re) { - log.error("remove failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "remove failed", re); throw re; } } public ${declarationName} merge(${declarationName} detachedInstance) { - log.debug("merging ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merging ${declarationName} instance"); try { ${declarationName} result = entityManager.merge(detachedInstance); - log.debug("merge successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merge successful"); return result; } catch (RuntimeException re) { - log.error("merge failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "merge failed", re); throw re; } } <#if clazz.identifierProperty?has_content> public ${declarationName} findById( ${pojo.getJavaTypeName(clazz.identifierProperty, jdk5)} id) { - log.debug("getting ${declarationName} instance with id: " + id); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance with id: " + id); try { ${declarationName} instance = entityManager.find(${pojo.getDeclarationName()}.class, id); - log.debug("get successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful"); return instance; } catch (RuntimeException re) { - log.error("get failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "get failed", re); throw re; } } @@ -76,89 +76,89 @@ public class ${declarationName}Home { return (${pojo.importType("org.hibernate.SessionFactory")}) new ${pojo.importType("javax.naming.InitialContext")}().lookup("${sessionFactoryName}"); } catch (Exception e) { - log.error("Could not locate SessionFactory in JNDI", e); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "Could not locate SessionFactory in JNDI", e); throw new IllegalStateException("Could not locate SessionFactory in JNDI"); } } public void persist(${declarationName} transientInstance) { - log.debug("persisting ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persisting ${declarationName} instance"); try { sessionFactory.getCurrentSession().persist(transientInstance); - log.debug("persist successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persist successful"); } catch (RuntimeException re) { - log.error("persist failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "persist failed", re); throw re; } } public void attachDirty(${declarationName} instance) { - log.debug("attaching dirty ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attaching dirty ${declarationName} instance"); try { sessionFactory.getCurrentSession().saveOrUpdate(instance); - log.debug("attach successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attach successful"); } catch (RuntimeException re) { - log.error("attach failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "attach failed", re); throw re; } } public void attachClean(${declarationName} instance) { - log.debug("attaching clean ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attaching clean ${declarationName} instance"); try { sessionFactory.getCurrentSession().lock(instance, ${pojo.importType("org.hibernate.LockMode")}.NONE); - log.debug("attach successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attach successful"); } catch (RuntimeException re) { - log.error("attach failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "attach failed", re); throw re; } } public void delete(${declarationName} persistentInstance) { - log.debug("deleting ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "deleting ${declarationName} instance"); try { sessionFactory.getCurrentSession().delete(persistentInstance); - log.debug("delete successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "delete successful"); } catch (RuntimeException re) { - log.error("delete failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "delete failed", re); throw re; } } public ${declarationName} merge(${declarationName} detachedInstance) { - log.debug("merging ${declarationName} instance"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merging ${declarationName} instance"); try { ${declarationName} result = (${declarationName}) sessionFactory.getCurrentSession() .merge(detachedInstance); - log.debug("merge successful"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merge successful"); return result; } catch (RuntimeException re) { - log.error("merge failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "merge failed", re); throw re; } } <#if clazz.identifierProperty?has_content> public ${declarationName} findById( ${c2j.getJavaTypeName(clazz.identifierProperty, jdk5)} id) { - log.debug("getting ${declarationName} instance with id: " + id); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance with id: " + id); try { ${declarationName} instance = (${declarationName}) sessionFactory.getCurrentSession() .get("${clazz.entityName}", id); if (instance==null) { - log.debug("get successful, no instance found"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, no instance found"); } else { - log.debug("get successful, instance found"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, instance found"); } return instance; } catch (RuntimeException re) { - log.error("get failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "get failed", re); throw re; } } @@ -166,7 +166,7 @@ public class ${declarationName}Home { <#if clazz.hasNaturalId()> public ${declarationName} findByNaturalId(${c2j.asNaturalIdParameterList(clazz)}) { - log.debug("getting ${declarationName} instance by natural id"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance by natural id"); try { ${declarationName} instance = (${declarationName}) sessionFactory.getCurrentSession() .createCriteria("${clazz.entityName}") @@ -183,15 +183,15 @@ public class ${declarationName}Home { ) .uniqueResult(); if (instance==null) { - log.debug("get successful, no instance found"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, no instance found"); } else { - log.debug("get successful, instance found"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, instance found"); } return instance; } catch (RuntimeException re) { - log.error("query failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "query failed", re); throw re; } } @@ -201,7 +201,7 @@ public class ${declarationName}Home { <#else> public ${pojo.importType("java.util.List")} findByExample(${declarationName} instance) { - log.debug("finding ${declarationName} instance by example"); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "finding ${declarationName} instance by example"); try { <#if jdk5> ${pojo.importType("java.util.List")}<${declarationName}> results = (List<${declarationName}>) sessionFactory.getCurrentSession() @@ -215,11 +215,11 @@ public class ${declarationName}Home { .add(${pojo.importType("org.hibernate.criterion.Example")}.create(instance)) .list(); - log.debug("find by example successful, result size: " + results.size()); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "find by example successful, result size: " + results.size()); return results; } catch (RuntimeException re) { - log.error("find by example failed", re); + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "find by example failed", re); throw re; } } diff --git a/pom.xml b/pom.xml index 6e53736c2e..b32e4303fd 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,6 @@ 1.10.7 4.4 - 1.2 3.18.0 2.3.29 1.4.199 @@ -72,11 +71,6 @@ commons-collections4 ${commons-collections.version} - - commons-logging - commons-logging - ${commons-logging.version} - javax javaee-api diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java index 5c95704957..4df7caabdf 100755 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java @@ -12,7 +12,6 @@ import javax.ejb.EJB; import javax.persistence.Persistence; -import org.apache.commons.logging.Log; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.DAOExporter; import org.hibernate.tool.hbm2x.POJOExporter; @@ -77,7 +76,6 @@ public void testCompilable() throws IOException { compiled.mkdir(); FileUtil.generateNoopComparator(outputDir); List jars = new ArrayList(); - jars.add(JavaUtil.resolvePathToJarFileFor(Log.class)); // for commons logging jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api jars.add(JavaUtil.resolvePathToJarFileFor(EJB.class)); // for javaee api JavaUtil.compile(outputDir, compiled); diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java index fb5870fb27..40c382c8a2 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java @@ -11,7 +11,6 @@ import javax.persistence.Persistence; -import org.apache.commons.logging.Log; import org.hibernate.Version; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.DAOExporter; @@ -79,7 +78,6 @@ public void testCompilable() throws IOException { compiled.mkdir(); FileUtil.generateNoopComparator(outputDir); List jars = new ArrayList(); - jars.add(JavaUtil.resolvePathToJarFileFor(Log.class)); // for commons logging jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api jars.add(JavaUtil.resolvePathToJarFileFor(Version.class)); // for hibernate core JavaUtil.compile(outputDir, compiled, jars); From 022743bc220f5950d4a9f4d8c699fa16ed6fd503 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 18 Oct 2019 15:13:12 +0200 Subject: [PATCH 116/454] HBX-1887: Update eclipse-jdt-core dependency to version 3.19.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b32e4303fd..a862bb8a76 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.7 4.4 - 3.18.0 + 3.19.0 2.3.29 1.4.199 5.1.0.Final From 0efd5d84cd97a65da3290fcc21afea56dcf016c5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 23 Oct 2019 15:31:46 +0200 Subject: [PATCH 117/454] HBX-1889: Remove unused dependency on jboss-logging Signed-off-by: Koen Aers --- main/pom.xml | 4 ---- pom.xml | 6 ------ 2 files changed, 10 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 2453bce94b..8147084efb 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -88,10 +88,6 @@ javax.persistence javax.persistence-api - - org.jboss.logging - jboss-logging - diff --git a/pom.xml b/pom.xml index a862bb8a76..a003653f1e 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,6 @@ 2.3.1 2.3.2 1.2.0 - 3.4.0.Final 4.12 6.0.6 12.2.0.1 @@ -157,11 +156,6 @@ ${hsqldb.version} test - - org.jboss.logging - jboss-logging - ${jboss-logging.version} - From 1198987a49c16e12501cc5953c674010c225ebcb Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Tue, 27 Mar 2018 22:08:39 +0200 Subject: [PATCH 118/454] HBX-1537 Add description for the individual properties of the mojo Signed-off-by: Koen Aers --- .../org/hibernate/mvn/AbstractHbm2xMojo.java | 24 ++++++++++++++--- .../java/org/hibernate/mvn/Hbm2DdlMojo.java | 26 +++++++++++++++++++ .../java/org/hibernate/mvn/Hbm2JavaMojo.java | 8 ++++++ 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index 1d7578110c..1d2d129320 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -1,8 +1,6 @@ package org.hibernate.mvn; import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Parameter; import org.apache.tools.ant.BuildException; import org.hibernate.cfg.reveng.OverrideRepository; @@ -20,34 +18,52 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { // For reveng strategy + /** The default package name to use when mappings for classes are created. */ @Parameter private String packageName; + + /** The name of a property file, e.g. hibernate.properties. */ @Parameter private File revengFile; + /** The class name of the reverse engineering strategy to use. * Extend the DefaultReverseEngineeringStrategy and override the corresponding methods, e.g. * to adapt the generate class names or to provide custom type mappings. */ @Parameter(defaultValue = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy") private String revengStrategy; + + /** If true, tables which are pure many-to-many link tables will be mapped as such. + * A pure many-to-many table is one which primary-key contains exactly two foreign-keys pointing + * to other entity tables and has no other columns. */ @Parameter(defaultValue = "true") private boolean detectManyToMany; + + /** If true, a one-to-one association will be created for each foreignkey found. */ @Parameter(defaultValue = "true") private boolean detectOneToOne; + + /** If true, columns named VERSION or TIMESTAMP with appropriate types will be mapped with the appropriate + * optimistic locking corresponding to <version> or <timestamp>. */ @Parameter(defaultValue = "true") private boolean detectOptimisticLock; + + /** If true, a collection will be mapped for each foreignkey. */ @Parameter(defaultValue = "true") private boolean createCollectionForForeignKey; + + /** If true, a many-to-one association will be created for each foreignkey found. */ @Parameter(defaultValue = "true") private boolean createManyToOneForForeignKey; // For configuration + /** The name of a property file, e.g. hibernate.properties. */ @Parameter(defaultValue = "${project.basedir}/src/main/hibernate/hibernate.properties") private File propertyFile; // Not exposed for now private boolean preferBasicCompositeIds = true; - public void execute() throws MojoExecutionException, MojoFailureException { + public void execute() { getLog().info("Starting " + this.getClass().getSimpleName() + "..."); ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); Properties properties = loadPropertiesFile(); @@ -89,7 +105,7 @@ private Properties loadPropertiesFile() { } Properties properties = new Properties(); - try (FileInputStream is = new FileInputStream(propertyFile);) { + try (FileInputStream is = new FileInputStream(propertyFile)) { properties.load(is); return properties; } catch (FileNotFoundException e) { diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java index b2b4fc2886..0e2a973b95 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java @@ -21,18 +21,44 @@ @Mojo(name = "hbm2ddl", defaultPhase = GENERATE_RESOURCES) public class Hbm2DdlMojo extends AbstractHbm2xMojo { + /** The directory into which the DDLs will be generated. */ @Parameter(defaultValue = "${project.build.directory}/generated-resources/") private File outputDirectory; + + /** The default filename of the generated DDL script. */ @Parameter(defaultValue = "schema.ddl") private String outputFileName; + + /** The type of output to produce. + *
    + *
  • DATABASE: Export to the database.
  • + *
  • SCRIPT (default): Write to a script file.
  • + *
  • STDOUT: Write to {@link System#out}.
  • + *
*/ @Parameter(defaultValue = "SCRIPT") private Set targetTypes; + + /** + * The DDLs statements to create. + *
    + *
  • NONE: None - duh :P.
  • + *
  • CREATE (default): Create only.
  • + *
  • DROP: Drop only.
  • + *
  • BOTH: Drop and then create.
  • + *
+ */ @Parameter(defaultValue = "CREATE") private SchemaExport.Action schemaExportAction; + + /** Set the end of statement delimiter. */ @Parameter(defaultValue = ";") private String delimiter; + + /** Should we format the sql strings? */ @Parameter(defaultValue = "true") private boolean format; + + /** Should we stop once an error occurs? */ @Parameter(defaultValue = "true") private boolean haltOnError; diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java index d600eee8e7..893ab33917 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java @@ -17,12 +17,20 @@ @Mojo(name = "hbm2java", defaultPhase = GENERATE_SOURCES) public class Hbm2JavaMojo extends AbstractHbm2xMojo { + /** The directory into which the JPA entities will be generated. */ @Parameter(defaultValue = "${project.build.directory}/generated-sources/") private File outputDirectory; + + /** Code will contain EJB 3 features, e.g. using annotations from javax.persistence + * and org.hibernate.annotations. */ @Parameter(defaultValue = "false") private boolean ejb3; + + /** Code will contain JDK 5 constructs such as generics and static imports. */ @Parameter(defaultValue = "false") private boolean jdk5; + + /** A path used for looking up user-edited templates. */ @Parameter private String templatePath; From 0c346e591d5fd0ea9ba1e152c83aa257fe38c7d4 Mon Sep 17 00:00:00 2001 From: Jacques Stadler Date: Tue, 27 Mar 2018 22:09:34 +0200 Subject: [PATCH 119/454] HBX-1537 Configure the github site-maven-plugin plugin Signed-off-by: Koen Aers --- maven-plugin/pom.xml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c6f55db5d1..5cc0dfddc0 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -14,8 +14,7 @@ Hibernate Tools Maven Plugin Maven plugin to provide hibernate-tools reverse engineering and code/schema generation abilities. - - https://stadler.github.io/hibernate-tools-maven-plugin/ + https://hibernate.github.io/hibernate-tools/ JIRA @@ -118,24 +117,23 @@ - - - - - - - - - - - - - - - - - - + + com.github.github + site-maven-plugin + ${site-maven-plugin.version} + + + + site + + site-deploy + + github + Creating site for ${project.version} + + + + From b6048a194b5a6577ab95551b0a09503ea589278d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Nov 2019 10:31:12 +0100 Subject: [PATCH 120/454] HBX-1880: Update hibernate core dependency to 5.3.14.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a003653f1e..5296c674d4 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.29 1.4.199 5.1.0.Final - 5.3.13.Final + 5.3.14.Final 2.5.0 7.0 1.2.0 From 67eb09be65d72a0c285974af1f6fd2d61eac0858 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Nov 2019 10:52:43 +0100 Subject: [PATCH 121/454] HBX-1879: Update version identifier to 5.3.14.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 8147084efb..109dad488f 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 2716c84bcd..9ce0738b23 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.14-SNAPSHOT"; + public static final String VERSION = "5.3.14.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 5cc0dfddc0..6824f0cc3a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 5296c674d4..8037795917 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.14-SNAPSHOT + 5.3.14.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index b1ddcede7f..11f659cc15 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 656f72ffba..11ff0c411e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 725e0cb957..602fbb1057 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index bcd30b9450..e19e218bc3 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c08883e2a2..24034c44e7 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index caa893428b..2def8cdaa5 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index e772811f7b..2e0d193c9f 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 45cbddcac8..151f09fa35 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d4da3362a1..d812109a31 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index f638331013..5bdfa43980 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14-SNAPSHOT + 5.3.14.Final hibernate-tools-tests-utils From 6116f415a958b7150a921db6a4bc63de5002106c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 16 Nov 2019 14:44:09 +0100 Subject: [PATCH 122/454] HBX-1913: Update version identifier to 5.3.15-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 109dad488f..bcfc807161 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 9ce0738b23..e38de777cd 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.14.Final"; + public static final String VERSION = "5.3.15-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 6824f0cc3a..c563229651 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 8037795917..2b871cfd7e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.14.Final + 5.3.15-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 11f659cc15..813ab5146e 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 11ff0c411e..c76a3a2dca 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 602fbb1057..f825c604a5 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index e19e218bc3..8498f260f6 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 24034c44e7..14e2a50cbb 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2def8cdaa5..6ed2238bd8 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 2e0d193c9f..c39f5d7663 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 151f09fa35..d4b1037c7a 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d812109a31..e0bbb54656 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 5bdfa43980..67401e9b0d 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.14.Final + 5.3.15-SNAPSHOT hibernate-tools-tests-utils From 0dd96ad36211c6c70cae4c91810feb92848d9bdd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 9 Jan 2020 11:05:13 +0100 Subject: [PATCH 123/454] HBX-1954: Update Hibernate core dependency to 5.3.15.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2b871cfd7e..8cf3cd67aa 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.29 1.4.199 5.1.0.Final - 5.3.14.Final + 5.3.15.Final 2.5.0 7.0 1.2.0 From ebdc952e23ebc7cee50f0977bff65f3500b7c369 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 9 Jan 2020 13:59:52 +0100 Subject: [PATCH 124/454] HBX-1955: Update version identifier to 5.3.15.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index bcfc807161..3f7ec9766a 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index e38de777cd..f0c8910c82 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.15-SNAPSHOT"; + public static final String VERSION = "5.3.15.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c563229651..c5141c4526 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 8cf3cd67aa..afe49e465c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.15-SNAPSHOT + 5.3.15.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 813ab5146e..7dfb81738f 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index c76a3a2dca..f585ddaec6 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index f825c604a5..762ab64487 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 8498f260f6..f7948cf862 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 14e2a50cbb..493b17842c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 6ed2238bd8..06c6dcb58f 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index c39f5d7663..17d0f695cd 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d4b1037c7a..d509c64464 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index e0bbb54656..53e0f4d3a1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 67401e9b0d..6434f194d0 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15-SNAPSHOT + 5.3.15.Final hibernate-tools-tests-utils From 41a6ff3013eb31b64f8e3f0c4aac99d75b6c3e6c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 10 Jan 2020 16:53:23 +0100 Subject: [PATCH 125/454] HBX-1956: Update version identifier to 5.3.16-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 3f7ec9766a..b5ce404d99 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f0c8910c82..11de157a60 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.15.Final"; + public static final String VERSION = "5.3.16-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c5141c4526..45ae4cbd53 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index afe49e465c..c30acf32ff 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.15.Final + 5.3.16-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 7dfb81738f..ccd7a133aa 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index f585ddaec6..6a662b6b20 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 762ab64487..24426172ab 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index f7948cf862..1e66926840 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 493b17842c..e32010d16c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 06c6dcb58f..f890da6489 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 17d0f695cd..71502fd026 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index d509c64464..c5456528c2 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 53e0f4d3a1..49b5818394 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 6434f194d0..36863dcb63 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.15.Final + 5.3.16-SNAPSHOT hibernate-tools-tests-utils From b994604dda8df68a6c789538bc70700a7c576b80 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 11 Feb 2020 11:59:45 +0000 Subject: [PATCH 126/454] HBX-1980: The Oracle JDBC driver is now available in Maven central Signed-off-by: Koen Aers --- pom.xml | 2 +- readme.txt | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index c30acf32ff..68fb114870 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 1.2.0 4.12 6.0.6 - 12.2.0.1 + 19.3.0.0 6.1.7.jre8-preview
diff --git a/readme.txt b/readme.txt index 48068ef272..8865422fcf 100644 --- a/readme.txt +++ b/readme.txt @@ -3,14 +3,3 @@ Development The project is developed under the form of a hierarchical multimodule Maven project. After cloning the git repository to your local machine you can import it as such into your favorite IDE. -However in order to compile and run the tests one additional step is required: you need -to download the Oracle JDBC driver (currently we are using ojdbc8.jar) and use the Maven -command to install it into your local repository: - - mvn install:install-file - -Dfile=/path/to/local/ojdbc8.jar - -DgroupId=com.oracle.jdbc - -DartifactId=ojdbc8 - -Dversion=12.2.0.1 - -Dpackaging=jar - \ No newline at end of file From d15ba74261b4014a485e0adce794542889291629 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Feb 2020 18:06:11 +0100 Subject: [PATCH 127/454] HBX-1980: Use 'com.oracle.ojdbc' groupid Signed-off-by: Koen Aers --- pom.xml | 8 ++++---- test/oracle/pom.xml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 68fb114870..fa0198a62c 100644 --- a/pom.xml +++ b/pom.xml @@ -60,10 +60,10 @@ test - com.oracle.jdbc - ojdbc8 - ${oracle.version} - test + com.oracle.ojdbc + ojdbc8 + ${oracle.version} + test org.apache.commons diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c5456528c2..34802b8266 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -21,7 +21,7 @@ junit - com.oracle.jdbc + com.oracle.ojdbc ojdbc8 From d5afb3396fb6683642e792560580fbdb008ddf64 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Tue, 11 Feb 2020 14:16:16 +0000 Subject: [PATCH 128/454] HBX-1983: Be more defensive on setting Environment.Variable properties Signed-off-by: Koen Aers --- .../org/hibernate/tool/ant/HibernateToolTask.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/org/hibernate/tool/ant/HibernateToolTask.java b/main/src/main/java/org/hibernate/tool/ant/HibernateToolTask.java index 3b722c587b..d0251f6c95 100644 --- a/main/src/main/java/org/hibernate/tool/ant/HibernateToolTask.java +++ b/main/src/main/java/org/hibernate/tool/ant/HibernateToolTask.java @@ -305,7 +305,18 @@ public void addConfiguredPropertySet(PropertySet ps) { } public void addConfiguredProperty(Environment.Variable property) { - properties.put(property.getKey(), property.getValue()); + String key = property.getKey(); + String value = property.getValue(); + if (key==null) { + log( "Ignoring unnamed task property", Project.MSG_WARN ); + return; + } + if (value==null){ + //This is legal in ANT, make sure we warn properly: + log( "Ignoring task property '" +key+"' as no value was specified", Project.MSG_WARN ); + return; + } + properties.put( key, value ); } From c79f14014649359a1a06f060c5d134975366870c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 12 Mar 2020 11:58:22 +0100 Subject: [PATCH 129/454] HBX-2003: Update eclipse-jdt-core dependency to version 3.20.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa0198a62c..8b8ae4f8b5 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.7 4.4 - 3.19.0 + 3.20.0 2.3.29 1.4.199 5.1.0.Final From 65e786a3c81a4efbc3d9c5e6309cdb2d285122bc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 19 Mar 2020 08:36:43 +0100 Subject: [PATCH 130/454] HBX-2004: Update freemarker version to 2.3.30 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b8ae4f8b5..d93d6b65aa 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.10.7 4.4 3.20.0 - 2.3.29 + 2.3.30 1.4.199 5.1.0.Final 5.3.15.Final From 767abaa64f60c36f9cc9f4cdfc1fc14408a1dfcf Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 1 Apr 2020 18:46:18 +0200 Subject: [PATCH 131/454] HBX-2008: Update hibernate core dependency to 5.3.16.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d93d6b65aa..bb2d60ef0a 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.30 1.4.199 5.1.0.Final - 5.3.15.Final + 5.3.16.Final 2.5.0 7.0 1.2.0 From 202ddd4b06c33e44b1e856088054e58c140ef237 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 2 Apr 2020 14:24:02 +0200 Subject: [PATCH 132/454] HBX-2009: Update version identifier to 5.3.16.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index b5ce404d99..cbd2c9e5e7 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 11de157a60..aaf87ad618 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.16-SNAPSHOT"; + public static final String VERSION = "5.3.16.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 45ae4cbd53..58fbc4f4cf 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index bb2d60ef0a..b6c6f85339 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.16-SNAPSHOT + 5.3.16.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index ccd7a133aa..533a2aff0e 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 6a662b6b20..3068dee04a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 24426172ab..183d697ae6 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 1e66926840..b33c24598d 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index e32010d16c..ce253812cf 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index f890da6489..e1689e81a0 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 71502fd026..d327c19925 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 34802b8266..366a551ba9 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 49b5818394..e3c5cd6bf2 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 36863dcb63..9ac2b0b327 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16-SNAPSHOT + 5.3.16.Final hibernate-tools-tests-utils From 76fb28d5b975703ab09c5f11ac29d81258b868b5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 3 Apr 2020 16:58:19 +0200 Subject: [PATCH 133/454] HBX-2010: Update version identifier to 5.3.17-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index cbd2c9e5e7..56049eba23 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index aaf87ad618..590fde2429 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.16.Final"; + public static final String VERSION = "5.3.17-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 58fbc4f4cf..f4f06dd037 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index b6c6f85339..f6fdac9f59 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.16.Final + 5.3.17-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 533a2aff0e..4c4fecaeac 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 3068dee04a..1bcddafc87 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 183d697ae6..3c1b1bf4b8 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index b33c24598d..0bd58d603a 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ce253812cf..bc4893c1a9 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index e1689e81a0..8ae75db858 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index d327c19925..561d9a1c38 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 366a551ba9..5d276ef5ea 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index e3c5cd6bf2..5cbccbeb02 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 9ac2b0b327..dd3f479733 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.16.Final + 5.3.17-SNAPSHOT hibernate-tools-tests-utils From 1c0af791448c06a29117acf7aba48f37641eff1c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 10 Apr 2020 17:09:21 +0200 Subject: [PATCH 134/454] HBX-2012: Update eclipse-jdt-core dependency to version 3.21.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f6fdac9f59..56bbd05d64 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.7 4.4 - 3.20.0 + 3.21.0 2.3.30 1.4.199 5.1.0.Final From a6535768ee6836e371fc27bde8ed7210493c61f5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 4 May 2020 18:53:55 +0200 Subject: [PATCH 135/454] HBX-2022: Update Hibernate core dependency to 5.3.17.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 56bbd05d64..0121704dc1 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.30 1.4.199 5.1.0.Final - 5.3.16.Final + 5.3.17.Final 2.5.0 7.0 1.2.0 From 65ea29874956db15ba587ae8369490ebb1f85251 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 4 May 2020 19:10:44 +0200 Subject: [PATCH 136/454] HBX-2024: Update version identifier to 5.3.17.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 56049eba23..4b0b253ef0 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 590fde2429..2486fdd864 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.17-SNAPSHOT"; + public static final String VERSION = "5.3.17.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index f4f06dd037..7ad7d4601e 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 0121704dc1..30a76af3c4 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.17-SNAPSHOT + 5.3.17.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 4c4fecaeac..a1574077ec 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 1bcddafc87..bccfddd0a5 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 3c1b1bf4b8..72400e7fb1 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 0bd58d603a..9724a9039f 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index bc4893c1a9..d8bed68110 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 8ae75db858..2ed3c95cb3 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 561d9a1c38..2af738a986 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 5d276ef5ea..c04cdecce6 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 5cbccbeb02..7b1701bcc1 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index dd3f479733..5a280ccaeb 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17-SNAPSHOT + 5.3.17.Final hibernate-tools-tests-utils From c3df9c72b5c95173ba8f4ead5bfc2fe682c0dac5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 4 May 2020 20:02:08 +0200 Subject: [PATCH 137/454] HBX-2025: Update version identifier to 5.3.18-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 4b0b253ef0..17452f86ce 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 2486fdd864..1a1f4aee7d 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.17.Final"; + public static final String VERSION = "5.3.18-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 7ad7d4601e..25d523e696 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 30a76af3c4..4e995aedae 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.17.Final + 5.3.18-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index a1574077ec..ef406a531d 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index bccfddd0a5..35fe6cbd4c 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 72400e7fb1..c4c46b3b45 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 9724a9039f..483600ba50 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index d8bed68110..44311d8ac7 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2ed3c95cb3..f4e0feeb09 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 2af738a986..377a8b24a0 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c04cdecce6..3f69229fe8 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 7b1701bcc1..566ebabc30 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 5a280ccaeb..2cc4a7ac14 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.17.Final + 5.3.18-SNAPSHOT hibernate-tools-tests-utils From 07af87b0f1aa87e4a944f12e921ebd78c823aa39 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 18 May 2020 10:25:16 +0200 Subject: [PATCH 138/454] HBX-2027: Update Ant version to 1.10.8 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e995aedae..15ab0195e1 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.7 + 1.10.8 4.4 3.21.0 2.3.30 From 21ed70d39c76ef5d9b543c76f5770c97edab550b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 21 May 2020 10:28:50 +0200 Subject: [PATCH 139/454] HBX-2031: Update dependency on javaee-api to version 8.0.1 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 15ab0195e1..77e6d11612 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 5.1.0.Final 5.3.17.Final 2.5.0 - 7.0 + 8.0.1 1.2.0 2.2 2.3.1 From 06ada0ba06d2fc60a817eecb134a68875b6eaa1d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 25 May 2020 16:21:49 +0200 Subject: [PATCH 140/454] HBX-2032: Update JUnit version to 4.13 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 77e6d11612..6ac78eb514 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2.3.1 2.3.2 1.2.0 - 4.12 + 4.13 6.0.6 19.3.0.0 6.1.7.jre8-preview From 617308d8ec18fc32944cb9591200b37aec03d86e Mon Sep 17 00:00:00 2001 From: Emanuel Ciuca Date: Thu, 4 Jun 2020 22:10:53 +0300 Subject: [PATCH 141/454] HBX-1646: Fix sql statement case sensitive collation Signed-off-by: Koen Aers --- .../hibernate/cfg/reveng/dialect/SQLServerMetaDataDialect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/SQLServerMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/SQLServerMetaDataDialect.java index 0740b24c32..46ee0f08df 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/SQLServerMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/SQLServerMetaDataDialect.java @@ -26,7 +26,7 @@ public Iterator> getSuggestedPrimaryKeyStrategyName(String c sql = "SELECT a.TABLE_CATALOG, a.TABLE_SCHEMA, a.TABLE_NAME as table_name, c.DATA_TYPE as data_type, b.CONSTRAINT_TYPE, OBJECTPROPERTY(OBJECT_ID(a.TABLE_NAME),'TableHasIdentity') as hasIdentity " + "FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE a " + "INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS b on a.CONSTRAINT_NAME = b.CONSTRAINT_NAME " + - "INNER JOIN INFORMATION_SCHEMA.Columns c on a.TABLE_CATALOG = c.TABLE_CATALOG AND a.TABLE_SCHEMA = c.TABLE_SCHEMA AND a.TABLE_NAME = c.TABLE_NAME AND a.COLUMN_NAME = c.COLUMN_NAME " + + "INNER JOIN INFORMATION_SCHEMA.COLUMNS c on a.TABLE_CATALOG = c.TABLE_CATALOG AND a.TABLE_SCHEMA = c.TABLE_SCHEMA AND a.TABLE_NAME = c.TABLE_NAME AND a.COLUMN_NAME = c.COLUMN_NAME " + "WHERE a.TABLE_NAME='"+table+"' AND a.TABLE_SCHEMA='"+schema+"' AND a.TABLE_CATALOG='"+catalog+"' AND b.CONSTRAINT_TYPE = 'Primary key'"; PreparedStatement statement = getConnection().prepareStatement( sql ); From 0cef8803bc39b09db907b113eabc9eebdb7a0009 Mon Sep 17 00:00:00 2001 From: Emanuel Ciuca Date: Fri, 5 Jun 2020 12:28:12 +0300 Subject: [PATCH 142/454] HBX-2041: Add GenerateDaoMojo (hbm2dao) to generate DAOs with the maven plugin Signed-off-by: Koen Aers --- .../org/hibernate/mvn/GenerateDaoMojo.java | 74 +++++ .../src/it/hbm2dao/invoker.properties | 2 + test/maven-plugin/src/it/hbm2dao/pom.xml | 52 ++++ .../src/main/hibernate/hibernate.properties | 7 + .../src/main/hibernate/hibernate.reveng.xml | 11 + .../main/resources/templates/dao/daohome.ftl | 253 ++++++++++++++++++ test/maven-plugin/src/it/hbm2dao/test.mv.db | Bin 0 -> 24576 bytes .../maven-plugin/src/it/hbm2dao/verify.groovy | 6 + 8 files changed, 405 insertions(+) create mode 100644 maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java create mode 100644 test/maven-plugin/src/it/hbm2dao/invoker.properties create mode 100644 test/maven-plugin/src/it/hbm2dao/pom.xml create mode 100644 test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties create mode 100644 test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml create mode 100644 test/maven-plugin/src/it/hbm2dao/src/main/resources/templates/dao/daohome.ftl create mode 100644 test/maven-plugin/src/it/hbm2dao/test.mv.db create mode 100644 test/maven-plugin/src/it/hbm2dao/verify.groovy diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java new file mode 100644 index 0000000000..3ac4f02f11 --- /dev/null +++ b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java @@ -0,0 +1,74 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2016-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.maven; + +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.tool.api.export.Exporter; +import org.hibernate.tool.api.export.ExporterConstants; +import org.hibernate.tool.api.export.ExporterFactory; +import org.hibernate.tool.api.export.ExporterType; +import org.hibernate.tool.api.metadata.MetadataDescriptor; + +import java.io.File; + +import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; + +/** + * Mojo to generate Data Access Objects (DAOs) from an existing database. + *

+ * See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 + */ +@Mojo(name = "hbm2dao", defaultPhase = GENERATE_SOURCES) +public class GenerateDaoMojo extends AbstractGenerationMojo { + + /** The directory into which the DAOs will be generated. */ + @Parameter(defaultValue = "${project.build.directory}/generated-sources/") + private File outputDirectory; + + /** Code will contain EJB 3 features, e.g. using annotations from javax.persistence + * and org.hibernate.annotations. */ + @Parameter(defaultValue = "false") + private boolean ejb3; + + /** Code will contain JDK 5 constructs such as generics and static imports. */ + @Parameter(defaultValue = "false") + private boolean jdk5; + + /** A path used for looking up user-edited templates. */ + @Parameter + private String templatePath; + + protected void executeExporter(MetadataDescriptor metadataDescriptor) { + Exporter pojoExporter = ExporterFactory.createExporter(ExporterType.DAO); + pojoExporter.getProperties().put(ExporterConstants.METADATA_DESCRIPTOR, metadataDescriptor); + pojoExporter.getProperties().put(ExporterConstants.DESTINATION_FOLDER, outputDirectory); + if (templatePath != null) { + getLog().info("Setting template path to: " + templatePath); + pojoExporter.getProperties().put(ExporterConstants.TEMPLATE_PATH, new String[] {templatePath}); + } + pojoExporter.getProperties().setProperty("ejb3", String.valueOf(ejb3)); + pojoExporter.getProperties().setProperty("jdk5", String.valueOf(jdk5)); + getLog().info("Starting DAO export to directory: " + outputDirectory + "..."); + pojoExporter.start(); + } + + +} diff --git a/test/maven-plugin/src/it/hbm2dao/invoker.properties b/test/maven-plugin/src/it/hbm2dao/invoker.properties new file mode 100644 index 0000000000..4537ab14c4 --- /dev/null +++ b/test/maven-plugin/src/it/hbm2dao/invoker.properties @@ -0,0 +1,2 @@ +invoker.java.version = 1.8+ +invoker.goals = generate-sources \ No newline at end of file diff --git a/test/maven-plugin/src/it/hbm2dao/pom.xml b/test/maven-plugin/src/it/hbm2dao/pom.xml new file mode 100644 index 0000000000..ca72011970 --- /dev/null +++ b/test/maven-plugin/src/it/hbm2dao/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.hibernate.tool.test + hbm2dao + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + 1.8 + 1.4.195 + + + + + + org.hibernate.tool + hibernate-tools-maven + @project.version@ + + + DAO generation + generate-sources + + hbm2dao + + + ${project.basedir}/src/main/resources/templates/ + + + + + ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + + + + + com.h2database + h2 + ${h2.version} + + + + + + + diff --git a/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties new file mode 100644 index 0000000000..71496b3adc --- /dev/null +++ b/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties @@ -0,0 +1,7 @@ +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE +hibernate.connection.username=sa +hibernate.connection.password= +hibernate.connection.pool_size=1 +hibernate.show_sql=true \ No newline at end of file diff --git a/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml new file mode 100644 index 0000000000..7ac52fd2cf --- /dev/null +++ b/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test/maven-plugin/src/it/hbm2dao/src/main/resources/templates/dao/daohome.ftl b/test/maven-plugin/src/it/hbm2dao/src/main/resources/templates/dao/daohome.ftl new file mode 100644 index 0000000000..7232452587 --- /dev/null +++ b/test/maven-plugin/src/it/hbm2dao/src/main/resources/templates/dao/daohome.ftl @@ -0,0 +1,253 @@ +${pojo.getPackageDeclaration()} +// Generated ${date} by Hibernate Tools ${version} + +<#assign classbody> +<#assign declarationName = pojo.importType(pojo.getDeclarationName())>/** + * Home object for domain model class ${declarationName}. + * @see ${pojo.getQualifiedDeclarationName()} + * @author Hibernate Tools + */ +<#if ejb3> +@${pojo.importType("javax.ejb.Stateless")} + +public class ${declarationName}Home { + + private static final ${pojo.importType("java.util.logging.Logger")} logger = ${pojo.importType("Logger")}.getLogger(${pojo.getDeclarationName()}Home.class.getName()); + +<#if ejb3> + @${pojo.importType("javax.persistence.PersistenceContext")} private ${pojo.importType("javax.persistence.EntityManager")} entityManager; + + public void persist(${declarationName} transientInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persisting ${declarationName} instance"); + try { + entityManager.persist(transientInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persist successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "persist failed", re); + throw re; + } + } + + public void remove(${declarationName} persistentInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "removing ${declarationName} instance"); + try { + entityManager.remove(persistentInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "remove successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "remove failed", re); + throw re; + } + } + + public ${declarationName} merge(${declarationName} detachedInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merging ${declarationName} instance"); + try { + ${declarationName} result = entityManager.merge(detachedInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merge successful"); + return result; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "merge failed", re); + throw re; + } + } + +<#if clazz.identifierProperty?has_content> + public ${declarationName} findById( ${pojo.getJavaTypeName(clazz.identifierProperty, jdk5)} id) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance with id: " + id); + try { + ${declarationName} instance = entityManager.find(${pojo.getDeclarationName()}.class, id); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful"); + return instance; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "get failed", re); + throw re; + } + } + +<#else> + private final ${pojo.importType("org.hibernate.SessionFactory")} sessionFactory = getSessionFactory(); + + protected ${pojo.importType("org.hibernate.SessionFactory")} getSessionFactory() { + try { + return (${pojo.importType("org.hibernate.SessionFactory")}) new ${pojo.importType("javax.naming.InitialContext")}().lookup("${sessionFactoryName}"); + } + catch (Exception e) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "Could not locate SessionFactory in JNDI", e); + throw new IllegalStateException("Could not locate SessionFactory in JNDI"); + } + } + + public void persist(${declarationName} transientInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persisting ${declarationName} instance"); + try { + sessionFactory.getCurrentSession().persist(transientInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "persist successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "persist failed", re); + throw re; + } + } + + public void attachDirty(${declarationName} instance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attaching dirty ${declarationName} instance"); + try { + sessionFactory.getCurrentSession().saveOrUpdate(instance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attach successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "attach failed", re); + throw re; + } + } + + public void attachClean(${declarationName} instance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attaching clean ${declarationName} instance"); + try { + sessionFactory.getCurrentSession().lock(instance, ${pojo.importType("org.hibernate.LockMode")}.NONE); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "attach successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "attach failed", re); + throw re; + } + } + + public void delete(${declarationName} persistentInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "deleting ${declarationName} instance"); + try { + sessionFactory.getCurrentSession().delete(persistentInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "delete successful"); + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "delete failed", re); + throw re; + } + } + + public ${declarationName} merge(${declarationName} detachedInstance) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merging ${declarationName} instance"); + try { + ${declarationName} result = (${declarationName}) sessionFactory.getCurrentSession() + .merge(detachedInstance); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "merge successful"); + return result; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "merge failed", re); + throw re; + } + } + +<#if clazz.identifierProperty?has_content> + public ${declarationName} findById( ${c2j.getJavaTypeName(clazz.identifierProperty, jdk5)} id) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance with id: " + id); + try { + ${declarationName} instance = (${declarationName}) sessionFactory.getCurrentSession() + .get("${clazz.entityName}", id); + if (instance==null) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, no instance found"); + } + else { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, instance found"); + } + return instance; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "get failed", re); + throw re; + } + } + + +<#if clazz.hasNaturalId()> + public ${declarationName} findByNaturalId(${c2j.asNaturalIdParameterList(clazz)}) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "getting ${declarationName} instance by natural id"); + try { + ${declarationName} instance = (${declarationName}) sessionFactory.getCurrentSession() + .createCriteria("${clazz.entityName}") +<#if jdk5> + .add( ${pojo.staticImport("org.hibernate.criterion.Restrictions", "naturalId")}() +<#else> + .add( ${pojo.importType("org.hibernate.criterion.Restrictions")}.naturalId() + +<#foreach property in pojo.getAllPropertiesIterator()> +<#if property.isNaturalIdentifier()> + .set("${property.name}", ${property.name}) + + + ) + .uniqueResult(); + if (instance==null) { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, no instance found"); + } + else { + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "get successful, instance found"); + } + return instance; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "query failed", re); + throw re; + } + } + +<#if jdk5> + public ${pojo.importType("java.util.List")}<${declarationName}> findByExample(${declarationName} instance) { +<#else> + public ${pojo.importType("java.util.List")} findByExample(${declarationName} instance) { + + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "finding ${declarationName} instance by example"); + try { +<#if jdk5> + ${pojo.importType("java.util.List")}<${declarationName}> results = (List<${declarationName}>) sessionFactory.getCurrentSession() +<#else> + ${pojo.importType("java.util.List")} results = sessionFactory.getCurrentSession() + + .createCriteria("${clazz.entityName}") +<#if jdk5> + .add( ${pojo.staticImport("org.hibernate.criterion.Example", "create")}(instance) ) +<#else> + .add(${pojo.importType("org.hibernate.criterion.Example")}.create(instance)) + + .list(); + logger.log(${pojo.importType("java.util.logging.Level")}.INFO, "find by example successful, result size: " + results.size()); + return results; + } + catch (RuntimeException re) { + logger.log(${pojo.importType("java.util.logging.Level")}.SEVERE, "find by example failed", re); + throw re; + } + } +<#foreach query in md.namedQueryDefinitions> +<#assign queryName = query.name> +<#if queryName.startsWith(clazz.entityName + ".")> +<#assign methname = c2j.unqualify(queryName)> +<#if jdk5 && methname.startsWith("find")> + public ${pojo.importType("java.util.List")}<${declarationName}> ${methname}(${argList}) { +<#elseif methname.startsWith("count")> + public int ${methname}(${argList}) { +<#else> + public ${pojo.importType("java.util.List")} ${methname}(${argList}) { + + ${pojo.importType("org.hibernate.Query")} query = sessionFactory.getCurrentSession() + .getNamedQuery("${queryName}"); +<#if jdk5 && methname.startsWith("find")> + return (List<${declarationName}>) query.list(); +<#elseif methname.startsWith("count")> + return ( (Integer) query.uniqueResult() ).intValue(); +<#else> + return query.list(); + + } + + +} + + +${pojo.generateImports()} +${classbody} diff --git a/test/maven-plugin/src/it/hbm2dao/test.mv.db b/test/maven-plugin/src/it/hbm2dao/test.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..aba76d3403bc1e1b54e2526be9b9bc7c2f09288c GIT binary patch literal 24576 zcmeI4TW=dh6vua+m^5xvWK{?rK$^57DUxMocD)x{MZ&SSvW4wLwo|oF(d?~_n%Gg| zL=jIFLOjAZ;7jnr3y4pEc;c<%fk(twK+Mk0thc_Dw2n%o9xK|}oxPkhKkwN2pL5oY zidJwBhTc=z_V&LFDgoj!@QwpI3j7K&F%HURnP^5K93CIiQH2!Fg5#6@ z;UGFLJP1bKli;{QZI6f00e*l5C8%|00>+zfh5Tu=N`84AZ9MEbeN^i@)xNX0wcBjf5h)w_<=g1?+E;4ak9K=b7d7vr&UPO;51YMy z5A~|-uhmDJB-BhD2W}7q)U`soi5k^j18v$iF?@_|;=5tlBiQh0Kv-AFEg7uj!K9%^ ztxzL`65H0Xsk?TmY`L}@>b`H;?k1|%+s#gXc>|%f@1!TSYOUeaQNOy?a?sB1R;yVn z?l|4vcIR#`qSLISW~a{`?d-N%1>V`IwjK1K+O0LJ-MD9~+3h##Y{)2D#C@%5ufJE@ zzJK3wP`}xBdi`p9C*D!bjFPuk-Q*qZG z>)Nx?b|>kNoo&|HB{tE=YmXU326x7Q*!b(Hw%zIVyVYn+VzlEPcHNZWyX=x|>~-g% zJW}k8U10b5M&|iSR>^19Nj`I1%V+LnbNS3hb~T^bWH*C+t!JJos;Vd-e6A=zc6h7a z`gY}JmfgfflifszOMfdX$~Atg7mZM?n3x|x_)_Cboi9s#X|Ph3sQ$$WMSYB3h^NNE z{#npw69X5bwH-buaC*W7V#1UrCXD4xOc)Xp&C<(mGGUDHOw30tjFu*h5<6`+Jx@!n zFl!03x}2xnD%LDHPq|scDlRgMBM|Pr0dZgeG5Fd`bEF#r=UFoELGt!OpMK5#<*srY;t( zvx{-3iZh)m3P0lO#2aS3A>4f@`j9GWaihnL#gC{6vmf#?2!}+C(*se=L_Xp>#f2w! zYQAczrdm=Bm8iN(RZYb=#&;kJ<00e*l5C8%|00;m9Mqo;R&#I^Q zENql9wHHy-v(L@V5jiRSzlfZfZS;b@vHt%I^nb+bE!F>jUP%A{%=Q2KzcBs3qbRIZ z^_$nm`v0$`UFBM$|2-K9@a0Ot73zNm0z9F~jR{SjR^&4S0p?^NAXen#$Qe`Q#L#Iu zQRIdv0s)3EjG7ZhUn3A;#R0n)0s+J@Tx)FBmqCv}nAIlC&KoO{(Fa|ORTI$%%jSc9 z(WvKosh~%2snLgLZ)NmB#FpadgV=!R1N?^p1b_e#00KY&2mpaANMK5TOa0ICj>+@% zp>7bbFjpDE*tx!y4W<(u+4D`{w%LCp6xG z4xH;nAT{v347{eN<*0U9Irz(zqnW!PM^kc?6&Xaa4$%MflB*9u|6jrHc5n#@00AHX z1b_e#00OfJi2VOpe@p$(BzdC$Jrmn@NXye2dC?xJ|K*PW%G~A*{V%haNnP<|W{=nZ z+pd|U6HRR)_hSA3N38#!3H{I7A5yv9%)6Q2Qn}r6ZMQ7)j Date: Fri, 26 Jun 2020 20:47:30 +0200 Subject: [PATCH 143/454] HBX-2041: Add GenerateDaoMojo (hbm2dao) to generate DAOs with the maven plugin - Backport commit 7948d4 for branch 5.x Signed-off-by: Koen Aers --- .../org/hibernate/mvn/GenerateDaoMojo.java | 31 +++++++++---------- test/maven-plugin/src/it/hbm2dao/pom.xml | 4 +-- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java index 3ac4f02f11..f4235153a5 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java @@ -17,19 +17,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.hibernate.tool.maven; +package org.hibernate.mvn; -import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; -import org.hibernate.tool.api.export.Exporter; -import org.hibernate.tool.api.export.ExporterConstants; -import org.hibernate.tool.api.export.ExporterFactory; -import org.hibernate.tool.api.export.ExporterType; -import org.hibernate.tool.api.metadata.MetadataDescriptor; +import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; import java.io.File; -import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.hbm2x.DAOExporter; /** * Mojo to generate Data Access Objects (DAOs) from an existing database. @@ -37,7 +34,7 @@ * See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 */ @Mojo(name = "hbm2dao", defaultPhase = GENERATE_SOURCES) -public class GenerateDaoMojo extends AbstractGenerationMojo { +public class GenerateDaoMojo extends AbstractHbm2xMojo { /** The directory into which the DAOs will be generated. */ @Parameter(defaultValue = "${project.build.directory}/generated-sources/") @@ -57,17 +54,17 @@ public class GenerateDaoMojo extends AbstractGenerationMojo { private String templatePath; protected void executeExporter(MetadataDescriptor metadataDescriptor) { - Exporter pojoExporter = ExporterFactory.createExporter(ExporterType.DAO); - pojoExporter.getProperties().put(ExporterConstants.METADATA_DESCRIPTOR, metadataDescriptor); - pojoExporter.getProperties().put(ExporterConstants.DESTINATION_FOLDER, outputDirectory); + DAOExporter daoExporter = new DAOExporter(); + daoExporter.setMetadataDescriptor(metadataDescriptor); + daoExporter.setOutputDirectory(outputDirectory); if (templatePath != null) { getLog().info("Setting template path to: " + templatePath); - pojoExporter.getProperties().put(ExporterConstants.TEMPLATE_PATH, new String[] {templatePath}); + daoExporter.setTemplatePath(new String[]{templatePath}); } - pojoExporter.getProperties().setProperty("ejb3", String.valueOf(ejb3)); - pojoExporter.getProperties().setProperty("jdk5", String.valueOf(jdk5)); + daoExporter.getProperties().setProperty("ejb3", String.valueOf(ejb3)); + daoExporter.getProperties().setProperty("jdk5", String.valueOf(jdk5)); getLog().info("Starting DAO export to directory: " + outputDirectory + "..."); - pojoExporter.start(); + daoExporter.start(); } diff --git a/test/maven-plugin/src/it/hbm2dao/pom.xml b/test/maven-plugin/src/it/hbm2dao/pom.xml index ca72011970..ebdf28aaaf 100644 --- a/test/maven-plugin/src/it/hbm2dao/pom.xml +++ b/test/maven-plugin/src/it/hbm2dao/pom.xml @@ -19,8 +19,8 @@ - org.hibernate.tool - hibernate-tools-maven + org.hibernate + hibernate-tools-maven-plugin @project.version@ From e97680df6ede1ff808491225246941d5c73466c0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 8 Jul 2020 20:03:44 +0200 Subject: [PATCH 144/454] HBX-2051: Update eclipse-jdt dependency to version 3.22.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ac78eb514..a05290ee0e 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.8 4.4 - 3.21.0 + 3.22.0 2.3.30 1.4.199 5.1.0.Final From a3f1e9d266d1d641dc8bb98ea963b21bf5646233 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 27 Jul 2020 12:18:00 +0200 Subject: [PATCH 145/454] HBX-2055: Update dependency on HSQLDB to version 2.5.1 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a05290ee0e..330870a950 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.4.199 5.1.0.Final 5.3.17.Final - 2.5.0 + 2.5.1 8.0.1 1.2.0 2.2 From 73db87853eb54b9d264bc2cb3474a3f62b1c7fe2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 27 Jul 2020 14:19:10 +0200 Subject: [PATCH 146/454] HBX-2056: Update jboss-parent dependency to version 37 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 330870a950..2c8632f312 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 36 + 37 org.hibernate From cb32cb48e1b31c968817db25c1eabf9e93f74ea0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 7 Aug 2020 07:26:20 +0200 Subject: [PATCH 147/454] HBX-2066: Update dependency on Hibernate ORM to version 5.3.18.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2c8632f312..f6b6ef8569 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.30 1.4.199 5.1.0.Final - 5.3.17.Final + 5.3.18.Final 2.5.1 8.0.1 1.2.0 From 1d7c5c418a6a3d63b2d752153d9ad59f0142e7b3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 8 Aug 2020 00:18:50 +0200 Subject: [PATCH 148/454] HBX-2067: Update version identifier to 5.3.18.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 17452f86ce..db224df8e6 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 1a1f4aee7d..1776a031f6 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.18-SNAPSHOT"; + public static final String VERSION = "5.3.18.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 25d523e696..a444c1bc20 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index f6b6ef8569..e12e16d6c2 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.18-SNAPSHOT + 5.3.18.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index ef406a531d..1748d9fdef 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 35fe6cbd4c..89b3f2c9e3 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index c4c46b3b45..0012853549 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 483600ba50..6f8c9cdeb3 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 44311d8ac7..622ed5e1fe 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index f4e0feeb09..3f4f30701c 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 377a8b24a0..ee7ef3c8b4 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 3f69229fe8..a0b6c5f2cb 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 566ebabc30..35a76f994a 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 2cc4a7ac14..20b82879d5 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18-SNAPSHOT + 5.3.18.Final hibernate-tools-tests-utils From 5f131e2f51402f001873e446d66ec7495d15d88c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 9 Aug 2020 20:28:19 +0200 Subject: [PATCH 149/454] HBX-2068: Update version identifier to 5.3.19-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index db224df8e6..5269ab0ef9 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 1776a031f6..8bd61f9ab6 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.18.Final"; + public static final String VERSION = "5.3.19-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index a444c1bc20..dfed06de4c 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e12e16d6c2..84e974ce59 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.18.Final + 5.3.19-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 1748d9fdef..52ce964dc8 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 89b3f2c9e3..f992000d56 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 0012853549..97f4637f8e 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 6f8c9cdeb3..731086fd00 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 622ed5e1fe..79e312ffd2 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 3f4f30701c..e1fb0dddd5 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index ee7ef3c8b4..5964408996 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index a0b6c5f2cb..c776a8399f 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 35a76f994a..cd4ef17212 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 20b82879d5..ab166c3c47 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.18.Final + 5.3.19-SNAPSHOT hibernate-tools-tests-utils From 60fbb2872be770c7c579d5666caf8c23bf8f488d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Sep 2020 15:03:48 +0200 Subject: [PATCH 150/454] =?UTF-8?q?HBX-2080:=20Maven=20should=20pickup=20?= =?UTF-8?q?=E2=80=98hibernate.properties=E2=80=99=20file=20from=20folder?= =?UTF-8?q?=20=E2=80=98src/main/resources=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Koen Aers --- .../src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java | 2 +- test/maven-plugin/src/it/hbm2dao/pom.xml | 2 +- .../src/main/{hibernate => resources}/hibernate.properties | 0 .../src/main/{hibernate => resources}/hibernate.reveng.xml | 0 test/maven-plugin/src/it/hbm2ddl/pom.xml | 2 +- .../src/main/{hibernate => resources}/hibernate.properties | 0 .../src/main/{hibernate => resources}/hibernate.reveng.xml | 0 test/maven-plugin/src/it/hbm2java/pom.xml | 2 +- .../src/main/{hibernate => resources}/hibernate.properties | 0 .../src/main/{hibernate => resources}/hibernate.reveng.xml | 0 10 files changed, 4 insertions(+), 4 deletions(-) rename test/maven-plugin/src/it/hbm2dao/src/main/{hibernate => resources}/hibernate.properties (100%) rename test/maven-plugin/src/it/hbm2dao/src/main/{hibernate => resources}/hibernate.reveng.xml (100%) rename test/maven-plugin/src/it/hbm2ddl/src/main/{hibernate => resources}/hibernate.properties (100%) rename test/maven-plugin/src/it/hbm2ddl/src/main/{hibernate => resources}/hibernate.reveng.xml (100%) rename test/maven-plugin/src/it/hbm2java/src/main/{hibernate => resources}/hibernate.properties (100%) rename test/maven-plugin/src/it/hbm2java/src/main/{hibernate => resources}/hibernate.reveng.xml (100%) diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index 1d2d129320..4f629467d5 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -57,7 +57,7 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { // For configuration /** The name of a property file, e.g. hibernate.properties. */ - @Parameter(defaultValue = "${project.basedir}/src/main/hibernate/hibernate.properties") + @Parameter(defaultValue = "${project.basedir}/src/main/resources/hibernate.properties") private File propertyFile; // Not exposed for now diff --git a/test/maven-plugin/src/it/hbm2dao/pom.xml b/test/maven-plugin/src/it/hbm2dao/pom.xml index ebdf28aaaf..66e7b39e9f 100644 --- a/test/maven-plugin/src/it/hbm2dao/pom.xml +++ b/test/maven-plugin/src/it/hbm2dao/pom.xml @@ -35,7 +35,7 @@ - ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + ${project.basedir}/src/main/resources/hibernate.reveng.xml diff --git a/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2dao/src/main/resources/hibernate.properties similarity index 100% rename from test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.properties rename to test/maven-plugin/src/it/hbm2dao/src/main/resources/hibernate.properties diff --git a/test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2dao/src/main/resources/hibernate.reveng.xml similarity index 100% rename from test/maven-plugin/src/it/hbm2dao/src/main/hibernate/hibernate.reveng.xml rename to test/maven-plugin/src/it/hbm2dao/src/main/resources/hibernate.reveng.xml diff --git a/test/maven-plugin/src/it/hbm2ddl/pom.xml b/test/maven-plugin/src/it/hbm2ddl/pom.xml index 1bb46c5661..00a4847b00 100644 --- a/test/maven-plugin/src/it/hbm2ddl/pom.xml +++ b/test/maven-plugin/src/it/hbm2ddl/pom.xml @@ -35,7 +35,7 @@ - ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + ${project.basedir}/src/main/resources/hibernate.reveng.xml diff --git a/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2ddl/src/main/resources/hibernate.properties similarity index 100% rename from test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.properties rename to test/maven-plugin/src/it/hbm2ddl/src/main/resources/hibernate.properties diff --git a/test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2ddl/src/main/resources/hibernate.reveng.xml similarity index 100% rename from test/maven-plugin/src/it/hbm2ddl/src/main/hibernate/hibernate.reveng.xml rename to test/maven-plugin/src/it/hbm2ddl/src/main/resources/hibernate.reveng.xml diff --git a/test/maven-plugin/src/it/hbm2java/pom.xml b/test/maven-plugin/src/it/hbm2java/pom.xml index 35fd6256d2..90666ccc09 100644 --- a/test/maven-plugin/src/it/hbm2java/pom.xml +++ b/test/maven-plugin/src/it/hbm2java/pom.xml @@ -35,7 +35,7 @@ - ${project.basedir}/src/main/hibernate/hibernate.reveng.xml + ${project.basedir}/src/main/resources/hibernate.reveng.xml diff --git a/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties b/test/maven-plugin/src/it/hbm2java/src/main/resources/hibernate.properties similarity index 100% rename from test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.properties rename to test/maven-plugin/src/it/hbm2java/src/main/resources/hibernate.properties diff --git a/test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml b/test/maven-plugin/src/it/hbm2java/src/main/resources/hibernate.reveng.xml similarity index 100% rename from test/maven-plugin/src/it/hbm2java/src/main/hibernate/hibernate.reveng.xml rename to test/maven-plugin/src/it/hbm2java/src/main/resources/hibernate.reveng.xml From 3dd9b1be267e3e6a2aeb613982ee91a0c5328033 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Oct 2020 15:18:00 +0200 Subject: [PATCH 151/454] HBX-1893: Maven plugin blows up when propertyFile is not configured while it should be optional Signed-off-by: Koen Aers --- .../org/hibernate/mvn/AbstractHbm2xMojo.java | 18 ++++----- .../it/noPropertiesFile/invoker.properties | 2 + .../src/it/noPropertiesFile/pom.xml | 38 +++++++++++++++++++ .../src/it/noPropertiesFile/verify.groovy | 26 +++++++++++++ 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 test/maven-plugin/src/it/noPropertiesFile/invoker.properties create mode 100644 test/maven-plugin/src/it/noPropertiesFile/pom.xml create mode 100644 test/maven-plugin/src/it/noPropertiesFile/verify.groovy diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index 4f629467d5..f9b4c27b50 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -66,9 +66,11 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { public void execute() { getLog().info("Starting " + this.getClass().getSimpleName() + "..."); ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); - Properties properties = loadPropertiesFile(); - MetadataDescriptor jdbcDescriptor = createJdbcDescriptor(strategy, properties); - executeExporter(jdbcDescriptor); + if (propertyFile.exists()) { + executeExporter(createJdbcDescriptor(strategy, loadPropertiesFile())); + } else { + getLog().info("Property file '" + propertyFile + "' cannot be found, aborting..."); + } getLog().info("Finished " + this.getClass().getSimpleName() + "!"); } @@ -100,14 +102,10 @@ private ReverseEngineeringStrategy setupReverseEngineeringStrategy() { } private Properties loadPropertiesFile() { - if (propertyFile == null) { - return null; - } - - Properties properties = new Properties(); try (FileInputStream is = new FileInputStream(propertyFile)) { - properties.load(is); - return properties; + Properties result = new Properties(); + result.load(is); + return result; } catch (FileNotFoundException e) { throw new BuildException(propertyFile + " not found.", e); } catch (IOException e) { diff --git a/test/maven-plugin/src/it/noPropertiesFile/invoker.properties b/test/maven-plugin/src/it/noPropertiesFile/invoker.properties new file mode 100644 index 0000000000..4537ab14c4 --- /dev/null +++ b/test/maven-plugin/src/it/noPropertiesFile/invoker.properties @@ -0,0 +1,2 @@ +invoker.java.version = 1.8+ +invoker.goals = generate-sources \ No newline at end of file diff --git a/test/maven-plugin/src/it/noPropertiesFile/pom.xml b/test/maven-plugin/src/it/noPropertiesFile/pom.xml new file mode 100644 index 0000000000..2431341e2c --- /dev/null +++ b/test/maven-plugin/src/it/noPropertiesFile/pom.xml @@ -0,0 +1,38 @@ + + + 4.0.0 + + org.hibernate.tool.test + no-properties-file + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + 1.8 + 1.4.195 + + + + + + org.hibernate + hibernate-tools-maven-plugin + @project.version@ + + + Entity generation + generate-sources + + hbm2java + + + + + + + + \ No newline at end of file diff --git a/test/maven-plugin/src/it/noPropertiesFile/verify.groovy b/test/maven-plugin/src/it/noPropertiesFile/verify.groovy new file mode 100644 index 0000000000..c71714aff6 --- /dev/null +++ b/test/maven-plugin/src/it/noPropertiesFile/verify.groovy @@ -0,0 +1,26 @@ +import java.io.*; + +println "start verify.groovy" + +File entity = new File(basedir, "build.log") + +if (!entity.isFile()) { + + throw new FileNotFoundException("Could not find generated JPA Entity: " + entity) + +} else { + + boolean found = false + String searchString = + "[INFO] Property file '" + + basedir.absolutePath + + "/src/main/resources/hibernate.properties' cannot be found, aborting..." + entity.eachLine { + line -> if (line.startsWith(searchString)) found = true + } + return found + +} + + +println "end verify.groovy" \ No newline at end of file From 16d8cade311cc3c307edfd9b8af06c92f5ab6281 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 4 Nov 2020 11:44:59 +0100 Subject: [PATCH 152/454] HBX-2088: Update Ant dependency to version 1.10.9 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84e974ce59..8222801e35 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.8 + 1.10.9 4.4 3.22.0 2.3.30 From 5a92ee6112fc6f65db7a178a848c8d55ed511ab4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 8 Nov 2020 20:12:37 +0100 Subject: [PATCH 153/454] HBX-2089: Update eclipse-jdt-core dependency to version 3.23.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8222801e35..fe04f39102 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.9 4.4 - 3.22.0 + 3.23.0 2.3.30 1.4.199 5.1.0.Final From 7f8aca8800e5b0401c47ce5ae1b11b64d46e0c50 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 16 Nov 2020 09:48:39 +0100 Subject: [PATCH 154/454] HBX-2090: Update Hibernate Commons Annotations dependency to version 5.1.2.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe04f39102..02d002ba3f 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.23.0 2.3.30 1.4.199 - 5.1.0.Final + 5.1.2.Final 5.3.18.Final 2.5.1 8.0.1 From 199ec13b87ae3ba4f1873eadebf3c772e27c8776 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 16 Nov 2020 13:33:19 +0100 Subject: [PATCH 155/454] HBX-2091: Update JUnit dependency to version 4.13.1 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 02d002ba3f..503470bb3e 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2.3.1 2.3.2 1.2.0 - 4.13 + 4.13.1 6.0.6 19.3.0.0 6.1.7.jre8-preview From 8bbc444ba6f079db71495ff65371aba415b22ac0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Nov 2020 10:54:36 +0100 Subject: [PATCH 156/454] HBX-2092: Update Hibernate ORM Dependency to Version 5.3.19.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 503470bb3e..d032801ff5 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.30 1.4.199 5.1.2.Final - 5.3.18.Final + 5.3.19.Final 2.5.1 8.0.1 1.2.0 From 1da368aafeb83589373b9bf3ce1ef09c905c6484 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Nov 2020 11:20:01 +0100 Subject: [PATCH 157/454] HBX-2093: Update version identifier to 5.3.19.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 5269ab0ef9..d0add42dab 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 8bd61f9ab6..60e988e258 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.19-SNAPSHOT"; + public static final String VERSION = "5.3.19.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index dfed06de4c..986dea2583 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index d032801ff5..e3096cc03f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.19-SNAPSHOT + 5.3.19.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 52ce964dc8..7caa3e772e 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index f992000d56..5fcbd95c23 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 97f4637f8e..8cd0e79ea1 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 731086fd00..62203ecbcf 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 79e312ffd2..e7f6f7743a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index e1fb0dddd5..d4d8695bd4 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 5964408996..5a3ee9a2de 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c776a8399f..40978d107c 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index cd4ef17212..582a50d061 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ab166c3c47..d8b1b34bd6 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19-SNAPSHOT + 5.3.19.Final hibernate-tools-tests-utils From 4c475545fa0104edd64e5e29b13f6879c997ff80 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Nov 2020 18:04:40 +0100 Subject: [PATCH 158/454] HBX-2094: Update version identifier to 5.3.20-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index d0add42dab..8f106f008a 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 60e988e258..0ec71aa557 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.19.Final"; + public static final String VERSION = "5.3.20-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 986dea2583..01b97bd100 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e3096cc03f..7869d48fd1 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.19.Final + 5.3.20-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 7caa3e772e..82c21b12a2 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 5fcbd95c23..3652585f5d 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 8cd0e79ea1..7fb057708f 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 62203ecbcf..372f3df6a3 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index e7f6f7743a..0241032eb7 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index d4d8695bd4..b9a44201a6 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 5a3ee9a2de..e818213f62 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 40978d107c..f361282414 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 582a50d061..7f1113d108 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index d8b1b34bd6..4ae4fb99f5 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.19.Final + 5.3.20-SNAPSHOT hibernate-tools-tests-utils From 078d05015942dc0267b21de27ca81356de02ee01 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 17 Nov 2020 18:16:01 +0100 Subject: [PATCH 159/454] HBX-2095: Update Hibernate ORM Dependency to Version 5.3.20.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7869d48fd1..0abbee5092 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ 2.3.30 1.4.199 5.1.2.Final - 5.3.19.Final + 5.3.20.Final 2.5.1 8.0.1 1.2.0 From 31ab80d438a1d7f2797bd021ab569cc50811f176 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 18 Nov 2020 08:55:42 +0100 Subject: [PATCH 160/454] HBX-2096: Update version identifier to 5.3.20.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 8f106f008a..4925ee6afe 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 0ec71aa557..f19c2f1238 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.20-SNAPSHOT"; + public static final String VERSION = "5.3.20.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 01b97bd100..f0923ab90b 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 0abbee5092..368f39ecff 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.20-SNAPSHOT + 5.3.20.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 82c21b12a2..e5e26a2397 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 3652585f5d..e5d0aded3c 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 7fb057708f..582c6ed323 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 372f3df6a3..d38e95edb8 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 0241032eb7..91394d7d7d 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index b9a44201a6..c9dca5f134 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index e818213f62..ebd8d56674 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index f361282414..45e2a218a3 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 7f1113d108..3366e939f8 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 4ae4fb99f5..e4fa20df46 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20-SNAPSHOT + 5.3.20.Final hibernate-tools-tests-utils From 671992be864db839effad3a3fd1bd89d241e1155 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 18 Nov 2020 09:55:12 +0100 Subject: [PATCH 161/454] HBX-2097: Update version identifier to 5.3.21-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 4925ee6afe..63835b8c99 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f19c2f1238..02fca4936a 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.20.Final"; + public static final String VERSION = "5.3.21-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index f0923ab90b..26f033beab 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 368f39ecff..0ccaa1ed67 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.20.Final + 5.3.21-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index e5e26a2397..b6c7762d42 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e5d0aded3c..311b597750 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 582c6ed323..563503bd58 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index d38e95edb8..d0d7aeaef0 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 91394d7d7d..5580376637 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index c9dca5f134..18648c7c41 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index ebd8d56674..4be1d2c90f 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 45e2a218a3..c5341dcb01 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 3366e939f8..1c859a86b6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index e4fa20df46..06ae19bfd5 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.20.Final + 5.3.21-SNAPSHOT hibernate-tools-tests-utils From 46e10abf00cbf85e00676fec9d24108e19388839 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 26 Nov 2020 17:36:34 +0100 Subject: [PATCH 162/454] HBX-2107: Create a test profile for SQL Server Signed-off-by: Koen Aers --- test/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/pom.xml b/test/pom.xml index 1c859a86b6..e61677325f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -50,6 +50,14 @@ h2 + + mssql + + utils + common + mssql + + From 5021a24a8d5930fe7f2eb5713a18f7b863a6f690 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 26 Nov 2020 17:45:20 +0100 Subject: [PATCH 163/454] HBX-2106: Update dependency on SQL Server JDBC Driver to version 9.1.0.jre8-preview Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ccaa1ed67..e74a7614ea 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 4.13.1 6.0.6 19.3.0.0 - 6.1.7.jre8-preview + 9.1.0.jre8-preview From b17427b5f450b75a2d6ef91decbd6a3bb011325d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 21 Dec 2020 12:48:06 +0100 Subject: [PATCH 164/454] HBX-2117: Update eclipse-jdt-core dependency to version 3.24.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e74a7614ea..bc15bd7a93 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.9 4.4 - 3.23.0 + 3.24.0 2.3.30 1.4.199 5.1.2.Final From ab5e52dc9ab9f07e83e69803d55bac10d7212cdc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Dec 2020 13:07:42 +0100 Subject: [PATCH 165/454] HBX-2119: Update dependency on SQL Server JDBC Driver to version 9.1.1.jre8-preview Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc15bd7a93..c7016df041 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 4.13.1 6.0.6 19.3.0.0 - 9.1.0.jre8-preview + 9.1.1.jre8-preview From 93accf420afb8027e15a7a77da307c6ec97413e1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 17 Feb 2021 14:31:33 +0100 Subject: [PATCH 166/454] HBX-2133: Update dependency on SQL Server JDBC Driver to version 9.2.0.jre8 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7016df041..977d337a63 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 4.13.1 6.0.6 19.3.0.0 - 9.1.1.jre8-preview + 9.2.0.jre8 From 8f4a52d792947886638a1e91b47c2068b9ec28a4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 19 Mar 2021 10:27:09 +0100 Subject: [PATCH 167/454] HBX-2140: Update eclipse-jdt-core dependency to version 3.25.0 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 977d337a63..89d2472d9b 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.9 4.4 - 3.24.0 + 3.25.0 2.3.30 1.4.199 5.1.2.Final From 5c67918bc89b6bf748bcb91aa137959bf04870f5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 21 Mar 2021 09:25:57 +0100 Subject: [PATCH 168/454] HBX-2142: Update SQL Server JDBC driver dependency to version 9.2.1.jre8 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89d2472d9b..88f61f80b1 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 4.13.1 6.0.6 19.3.0.0 - 9.2.0.jre8 + 9.2.1.jre8 From bdce544028778e6458744b1426bd23efc7c7d042 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 23 Mar 2021 08:00:11 +0100 Subject: [PATCH 169/454] HBX-2143: Update jUnit dependency to version 4.13.2 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 88f61f80b1..28d414c92c 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2.3.1 2.3.2 1.2.0 - 4.13.1 + 4.13.2 6.0.6 19.3.0.0 9.2.1.jre8 From f1f720a89a23e48dd630691711978809d1d81b0a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 26 Mar 2021 09:48:05 +0100 Subject: [PATCH 170/454] HBX-2141: Update freemarker dependency to version 2.3.31 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28d414c92c..08f47b8a86 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 1.10.9 4.4 3.25.0 - 2.3.30 + 2.3.31 1.4.199 5.1.2.Final 5.3.20.Final From 63be5a316989d42009a4ec43420be3cd87ac902f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 13 Apr 2021 18:04:38 +0200 Subject: [PATCH 171/454] HBX-2152: Bump jboss-parent version from 37 to 38 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08f47b8a86..d00b57d2ca 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 37 + 38 org.hibernate From 21e5e7652a613c3f17a67525d8f436015337c830 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 14 Apr 2021 17:09:27 +0200 Subject: [PATCH 172/454] HBX-2154: Create a test profile for HQSL Signed-off-by: Koen Aers --- test/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/pom.xml b/test/pom.xml index e61677325f..8313e80790 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -58,6 +58,14 @@ mssql + + hsql + + utils + common + hsql + + From bc417054880a7afd41e42f5b7cf83867b6628e62 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 15 Apr 2021 08:16:30 +0200 Subject: [PATCH 173/454] HBX-2153: Update HSQL version to 2.5.2 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d00b57d2ca..caaff06618 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.4.199 5.1.2.Final 5.3.20.Final - 2.5.1 + 2.5.2 8.0.1 1.2.0 2.2 From 760f43fc8906dec211f0e164669ccb389b3c0b61 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 20 Apr 2021 12:18:12 +0200 Subject: [PATCH 174/454] HBX-2155: Update Ant dependency to version 1.10.10 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index caaff06618..48960e5013 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.9 + 1.10.10 4.4 3.25.0 2.3.31 From c20730dca0f94c7e02a1c81116025e3cd59cc55a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Jun 2021 12:22:17 +0200 Subject: [PATCH 175/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.hbm2hbmxml.AbstractTest.TestCase#testAbstractPresent()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/AbstractTest/TestCase.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java index 0e29910da7..a6d054689c 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -39,6 +38,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -82,24 +84,22 @@ public void testAllFilesExistence() { } @Test - public void testAbstractPresent() { + public void testAbstractPresent() throws Exception { File outputXml = new File( outputDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document; - try { - document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one class element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertNotNull("Abstract attrinute was not exported.", node.attribute( "abstract" )); - Assert.assertEquals(node.attribute( "abstract" ).getText(),"true"); - } catch (DocumentException e) { - Assert.fail("Can't parse file " + outputXml.getAbsolutePath()); - } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals( "Expected to get one class element", 1, nodeList.getLength()); + Element node = (Element)nodeList.item(0); + Assert.assertNotNull(node.getAttribute("abstract"), "Abstract attrinute was not exported."); + Assert.assertEquals(node.getAttribute("abstract"), "true"); } public void testReadable() { From d277c70493dea0a6711eb80acb42fbce1cdb273a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Jun 2021 14:28:06 +0200 Subject: [PATCH 176/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest.TestCase#testCompositeElementNode()' Signed-off-by: Koen Aers --- .../CompositeElementTest/TestCase.java | 66 ++++++++++++------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java index 1b6689c631..7d8b713766 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -39,6 +38,10 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -99,28 +102,41 @@ public void testReadable() { } @Test - public void testCompositeElementNode() throws DocumentException { + public void testCompositeElementNode() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/list"); - Element node = (Element) xpath.selectNodes(document).get(1); //second list - List list = node.elements("composite-element"); - Assert.assertEquals("Expected to get one composite-element element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals("Expected to get two property element", 2, node.elements("property").size()); - - node = node.element("many-to-one"); - Assert.assertEquals(node.attribute( "name" ).getText(),"fee"); - Assert.assertEquals(node.attribute( "cascade" ).getText(),"all"); - //TODO: assertEquals(node.attribute( "outer-join" ).getText(),"true"); - node = node.getParent();//composite-element - node = node.element("nested-composite-element"); - Assert.assertEquals(node.attribute( "name" ).getText(),"subcomponent"); - Assert.assertEquals(node.attribute( "class" ).getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest.FooComponent"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/list") + .evaluate(document, XPathConstants.NODESET); + Element secondList = (Element)nodeList.item(1); + NodeList compositeElementList = secondList.getElementsByTagName("composite-element"); + Assert.assertEquals("Expected to get one composite-element element", 1, compositeElementList.getLength()); + Element compositeElement = (Element)compositeElementList.item(0); + NodeList compositeElementChildNodes = compositeElement.getChildNodes(); + int amountOfProperties = 0; + for (int i = 0; i < compositeElementChildNodes.getLength(); i++) { + Node node = compositeElementChildNodes.item(i); + if ("property".equals(node.getNodeName())) amountOfProperties++; + } + Assert.assertEquals("Expected to get two property element", 2, amountOfProperties); + NodeList manyToOneList = secondList.getElementsByTagName("many-to-one"); + Assert.assertEquals(1, manyToOneList.getLength()); + Element manyToOneElement = (Element)manyToOneList.item(0); + Assert.assertEquals("fee", manyToOneElement.getAttribute("name")); + Assert.assertEquals("all", manyToOneElement.getAttribute("cascade")); + NodeList nestedCompositeElementList = compositeElement.getElementsByTagName("nested-composite-element"); + Assert.assertEquals(1, nestedCompositeElementList.getLength()); + Element nestedCompositeElement = (Element)nestedCompositeElementList.item(0); + Assert.assertEquals("subcomponent", nestedCompositeElement.getAttribute("name")); + Assert.assertEquals( + "org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest.FooComponent", + nestedCompositeElement.getAttribute("class")); } } From 24bf4c9274a31a0b35510e2e658f39aaf9d05956 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 12 Jun 2021 11:48:59 +0200 Subject: [PATCH 177/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.TestCase#testClassProxy()' and ''org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.TestCase#testDynamicComponentNode()' Signed-off-by: Koen Aers --- .../DynamicComponentTest/TestCase.java | 56 +++++++++++-------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java index 4ab3213bf1..117236d66e 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -39,6 +38,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -99,33 +101,39 @@ public void testReadable() { } @Test - public void testClassProxy() throws DocumentException { + public void testClassProxy() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one class element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute("proxy").getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.GlarchProxy"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one class element", 1, nodeList.getLength()); + Element element = (Element) nodeList.item(0); + Assert.assertEquals(element.getAttribute("proxy"),"org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.GlarchProxy"); } @Test - public void testDynamicComponentNode() throws DocumentException { + public void testDynamicComponentNode() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/dynamic-component"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one dynamic-component element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"dynaBean"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/dynamic-component") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one dynamic-component element", 1, nodeList.getLength()); + Element element = (Element) nodeList.item(0); + Assert.assertEquals(element.getAttribute( "name" ),"dynaBean"); } - + } From 3630ee5fefd4026e2bce9d9620cadd06e9b85d86 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 10:13:58 +0200 Subject: [PATCH 178/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.CompositeElementTest.PropertiesTest.TestCase#testGenerationOfEmbeddedProperties()' Signed-off-by: Koen Aers --- .../tool/hbm2x/PropertiesTest/TestCase.java | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java index d5e099b816..84e1c836b4 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java @@ -6,14 +6,13 @@ import java.io.File; import java.nio.file.Files; -import java.util.List; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.ArtifactCollector; import org.hibernate.tool.hbm2x.Exporter; @@ -28,6 +27,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Josh Moore josh.moore@gmx.de @@ -74,31 +76,28 @@ public void testNoGenerationOfEmbeddedPropertiesComponent() { } @Test - public void testGenerationOfEmbeddedProperties() { + public void testGenerationOfEmbeddedProperties() throws Exception { File outputXml = new File(outputDir, "properties/PPerson.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document; - try { - document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/properties"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one properties element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"emergencyContact"); - Assert.assertNotNull( - FileUtil.findFirstString( - "name", - new File(outputDir, "properties/PPerson.java" ))); - Assert.assertNull( - "Embedded component/properties should not show up in .java", - FileUtil.findFirstString( - "emergencyContact", - new File(outputDir, "properties/PPerson.java" ))); - } catch (DocumentException e) { - Assert.fail("Can't parse file " + outputXml.getAbsolutePath()); - } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/properties") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one properties element", 1, nodeList.getLength()); + Element element = (Element) nodeList.item(0); + Assert.assertEquals(element.getAttribute( "name" ),"emergencyContact"); + Assert.assertNotNull( + FileUtil.findFirstString( + "name", + new File(outputDir, "properties/PPerson.java" ))); + Assert.assertNull( + "Embedded component/properties should not show up in .java", + FileUtil.findFirstString( + "emergencyContact", + new File(outputDir, "properties/PPerson.java" ))); } @Test From 69d66946dbab9488f5bafbeb68bf950dee7f5914 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 11:02:32 +0200 Subject: [PATCH 179/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.OtherCfg2HbmTest.TestCase#testVersioning()' Signed-off-by: Koen Aers --- .../tool/hbm2x/OtherCfg2HbmTest/TestCase.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java index 169a5991a1..c68316d8ac 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java @@ -5,14 +5,14 @@ package org.hibernate.tool.hbm2x.OtherCfg2HbmTest; import java.io.File; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.boot.Metadata; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; @@ -28,6 +28,8 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; /** * @author max @@ -99,13 +101,15 @@ public void testNoVelocityLeftOvers() { } @Test - public void testVersioning() throws DocumentException { - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml")); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/version"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one version element", 1, list.size()); + public void testVersioning() throws Exception { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml")); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/version") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one version element", 1, nodeList.getLength()); } } From 05dc5716825a7b702e4b626c08808b23a021bafa Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 12:14:43 +0200 Subject: [PATCH 180/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest.TestCase.testTypeParamsElements()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/TypeParamsTest/TestCase.java | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java index 7764ed443e..959c15beb9 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java @@ -18,17 +18,16 @@ import java.io.File; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -41,6 +40,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -95,33 +97,35 @@ public void testReadable() { } @Test - public void testTypeParamsElements() throws DocumentException { + public void testTypeParamsElements() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/property"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one property element", 2, list.size()); - Element statusElement = (Element) list.get(0); - Element nameElement = (Element) list.get(1); - if(!statusElement.attribute( "name" ).getText().equals("status")) { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/property") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one property element", 2, nodeList.getLength()); + Element statusElement = (Element) nodeList.item(0); + Element nameElement = (Element) nodeList.item(1); + if(!statusElement.getAttribute( "name" ).equals("status")) { Element temp = nameElement; nameElement = statusElement; statusElement = temp; } - Assert.assertEquals(statusElement.attribute( "name" ).getText(),"status"); - list = statusElement.elements("type"); - Assert.assertEquals("Expected to get one type element", 1, list.size()); - list = ((Element) list.get(0)).elements("param"); - Assert.assertEquals("Expected to get 5 params elements", list.size(), 5); + Assert.assertEquals(statusElement.getAttribute( "name" ),"status"); + nodeList = statusElement.getElementsByTagName("type"); + Assert.assertEquals("Expected to get one type element", 1, nodeList.getLength()); + nodeList = ((Element) nodeList.item(0)).getElementsByTagName("param"); + Assert.assertEquals("Expected to get 5 params elements", nodeList.getLength(), 5); Map params = new HashMap(); - for (int i = 0; i < list.size(); i++) { - Element param = (Element) list.get(i); - params.put(param.attribute( "name" ).getText(), param.getText()); + for (int i = 0; i < nodeList.getLength(); i++) { + Element param = (Element) nodeList.item(i); + params.put(param.getAttribute( "name" ), param.getTextContent()); } Set set = params.keySet(); Assert.assertEquals("Expected to get 5 different params elements", params.size(), 5); @@ -147,8 +151,8 @@ public void testTypeParamsElements() throws DocumentException { Assert.assertEquals( "org.hibernate.tool.hbm2x.hbm2hbmxml.Order$Status", params.get("enumClass")); - Assert.assertTrue("property name should not have any type element",nameElement.elements("type").isEmpty()); - Assert.assertEquals(nameElement.attribute("type").getText(), "string"); + Assert.assertTrue("property name should not have any type element",nameElement.getElementsByTagName("type").getLength() == 0); + Assert.assertEquals(nameElement.getAttribute("type"), "string"); } } From 7d861960dcb72b7c097dabedee82a9454ce0813c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 13:57:51 +0200 Subject: [PATCH 181/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest.TestCase#testKey()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest.TestCase#testSetElement()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/SetElementTest/TestCase.java | 83 ++++++++++--------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java index 04b46f381a..2f1cd6ea40 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java @@ -17,15 +17,14 @@ package org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest; import java.io.File; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -38,6 +37,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -92,52 +94,57 @@ public void testReadable() { } @Test - public void testKey() throws DocumentException { + public void testKey() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/key"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one key element", 1, list.size()); - Element node = (Element) list.get(0); - if (node.attribute( "column" ) != null){//implied attribute - Assert.assertEquals(node.attribute( "column" ).getText(),"searchString"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set/key") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one key element", 1, nodeList.getLength()); + Element node = (Element)nodeList.item(0); + if (node.getAttribute( "column" ) != null && !"".equals(node.getAttribute("column"))) {//implied attribute + Assert.assertEquals(node.getAttribute( "column" ),"searchString"); } else { - node = node.element("column"); - Assert.assertEquals(node.attribute( "name" ).getText(),"searchString"); + node = (Element)node.getElementsByTagName("column").item(0); + Assert.assertEquals(node.getAttribute( "name" ),"searchString"); } } @Test - public void testSetElement() throws DocumentException { + public void testSetElement() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one set element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"searchResults"); - Assert.assertEquals(node.attribute( "access" ).getText(),"field"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/element"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one element 'element'", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "type" ).getText(), "string"); - list = node.selectNodes("column"); - Assert.assertEquals("Expected to get one element 'column'", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(), "text"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ),"searchResults"); + Assert.assertEquals(node.getAttribute( "access" ),"field"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set/element") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one element 'element'", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "type" ), "string"); + nodeList = node.getElementsByTagName("column"); + Assert.assertEquals("Expected to get one element 'column'", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ), "text"); } } From bf90c43108d74c2952f3bc22dabbb6706dbb0df0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 14:37:45 +0200 Subject: [PATCH 182/454] HBX-2159: Remove the dependency on dom4j - Reimplement test 'org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest.TestCase#testOneToOne()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/OneToOneTest/TestCase.java | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java index 249238d390..3d2e401c5d 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java @@ -8,15 +8,14 @@ package org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest; import java.io.File; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -29,6 +28,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; @@ -97,30 +99,33 @@ public void testReadable() { Assert.assertNotNull(metadataDescriptor.createMetadata()); } - public void testOneToOne() throws DocumentException { - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); + public void testOneToOne() throws Exception { File xmlFile = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.hbm.xml"); - Document document = xmlReader.read(xmlFile); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/one-to-one"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one-to-one element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"address"); - Assert.assertEquals(node.attribute( "constrained" ).getText(),"false"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(xmlFile); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/one-to-one") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one-to-one element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ),"address"); + Assert.assertEquals(node.getAttribute( "constrained" ),"false"); xmlFile = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.hbm.xml"); - document = xmlReader.read(xmlFile); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/one-to-one"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one set element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"person"); - Assert.assertEquals(node.attribute( "constrained" ).getText(),"true"); - Assert.assertEquals(node.attribute( "access" ).getText(), "field"); + document = db.parse(xmlFile); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/one-to-one") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + node = (Element)nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ),"person"); + Assert.assertEquals(node.getAttribute( "constrained" ),"true"); + Assert.assertEquals(node.getAttribute( "access" ), "field"); } } From 1caa07ef3886f9a459d303bdca6d17728c93fe08 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 15:35:11 +0200 Subject: [PATCH 183/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest.TestCase#testAnyNode()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest.TestCase#testMapManyToAny()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/MapAndAnyTest/TestCase.java | 130 +++++++++--------- 1 file changed, 68 insertions(+), 62 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java index 537e48523e..b05811fd0a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.boot.Metadata; import org.hibernate.cfg.AvailableSettings; import org.hibernate.mapping.Any; @@ -43,6 +42,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -117,37 +119,39 @@ public void testReadable() { } @Test - public void testAnyNode() throws DocumentException { + public void testAnyNode() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/any"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one any element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"someSpecificProperty"); - Assert.assertEquals(node.attribute( "id-type" ).getText(),"long"); - Assert.assertEquals(node.attribute( "meta-type" ).getText(),"string"); - Assert.assertEquals(node.attribute( "cascade" ).getText(), "all"); - Assert.assertEquals(node.attribute( "access" ).getText(), "field"); - list = node.elements("column"); - Assert.assertEquals("Expected to get two column elements", 2, list.size()); - list = node.elements("meta-value"); - Assert.assertEquals("Expected to get three meta-value elements", 3, list.size()); - node = (Element) list.get(0); - String className = node.attribute( "class" ).getText(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/any") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one any element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ),"someSpecificProperty"); + Assert.assertEquals(node.getAttribute( "id-type" ),"long"); + Assert.assertEquals(node.getAttribute( "meta-type" ),"string"); + Assert.assertEquals(node.getAttribute( "cascade" ), "all"); + Assert.assertEquals(node.getAttribute( "access" ), "field"); + nodeList = node.getElementsByTagName("column"); + Assert.assertEquals("Expected to get two column elements", 2, nodeList.getLength()); + nodeList = node.getElementsByTagName("meta-value"); + Assert.assertEquals("Expected to get three meta-value elements", 3, nodeList.getLength()); + node = (Element) nodeList.item(0); + String className = node.getAttribute( "class" ); Assert.assertNotNull("Expected class attribute in meta-value", className); if (className.indexOf("IntegerPropertyValue") > 0){ - Assert.assertEquals(node.attribute( "value" ).getText(),"I"); + Assert.assertEquals(node.getAttribute( "value" ),"I"); } else if (className.indexOf("StringPropertyValue") > 0){ - Assert.assertEquals(node.attribute( "value" ).getText(),"S"); + Assert.assertEquals(node.getAttribute( "value" ),"S"); } else { Assert.assertTrue(className.indexOf("ComplexPropertyValue") > 0); - Assert.assertEquals(node.attribute( "value" ).getText(),"C"); + Assert.assertEquals(node.getAttribute( "value" ),"C"); } } @@ -164,45 +168,47 @@ public void testMetaValueRead() throws Exception{ } @Test - public void testMapManyToAny() throws DocumentException { + public void testMapManyToAny() throws Exception { File outputXml = new File(outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/map"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one any element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "name" ).getText(),"generalProperties"); - Assert.assertEquals(node.attribute( "table" ).getText(),"T_GEN_PROPS"); - Assert.assertEquals(node.attribute( "lazy" ).getText(),"true"); - Assert.assertEquals(node.attribute( "cascade" ).getText(), "all"); - Assert.assertEquals(node.attribute( "access" ).getText(), "field"); - list = node.elements("key"); - Assert.assertEquals("Expected to get one key element", 1, list.size()); - list = node.elements("map-key"); - Assert.assertEquals("Expected to get one map-key element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "type" ).getText(),"string"); - list = node.elements("column"); - Assert.assertEquals("Expected to get one column element", 1, list.size()); - node = node.getParent();//map - list = node.elements("many-to-any"); - Assert.assertEquals("Expected to get one many-to-any element", 1, list.size()); - node = (Element) list.get(0); - list = node.elements("column"); - Assert.assertEquals("Expected to get two column elements", 2, list.size()); - list = node.elements("meta-value"); - Assert.assertEquals("Expected to get two meta-value elements", 2, list.size()); - node = (Element) list.get(0); - String className = node.attribute( "class" ).getText(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/map") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one any element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "name" ),"generalProperties"); + Assert.assertEquals(node.getAttribute( "table" ),"T_GEN_PROPS"); + Assert.assertEquals(node.getAttribute( "lazy" ),"true"); + Assert.assertEquals(node.getAttribute( "cascade" ), "all"); + Assert.assertEquals(node.getAttribute( "access" ), "field"); + nodeList = node.getElementsByTagName("key"); + Assert.assertEquals("Expected to get one key element", 1, nodeList.getLength()); + nodeList = node.getElementsByTagName("map-key"); + Assert.assertEquals("Expected to get one map-key element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "type" ),"string"); + nodeList = node.getElementsByTagName("column"); + Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + node = (Element)node.getParentNode();//map + nodeList = node.getElementsByTagName("many-to-any"); + Assert.assertEquals("Expected to get one many-to-any element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + nodeList = node.getElementsByTagName("column"); + Assert.assertEquals("Expected to get two column elements", 2, nodeList.getLength()); + nodeList = node.getElementsByTagName("meta-value"); + Assert.assertEquals("Expected to get two meta-value elements", 2, nodeList.getLength()); + node = (Element) nodeList.item(0); + String className = node.getAttribute( "class" ); Assert.assertNotNull("Expected class attribute in meta-value", className); if (className.indexOf("IntegerPropertyValue") > 0){ - Assert.assertEquals(node.attribute( "value" ).getText(),"I"); + Assert.assertEquals(node.getAttribute( "value" ),"I"); } else { Assert.assertTrue(className.indexOf("StringPropertyValue") > 0); - Assert.assertEquals(node.attribute( "value" ).getText(),"S"); + Assert.assertEquals(node.getAttribute( "value" ),"S"); } } From bccf10c2450d99ce6f20fdd917df76168e3a69d5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 14 Jun 2021 16:33:45 +0200 Subject: [PATCH 184/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.TestCase#testManyToMany()', 'org.hibernate.tool.hbm2x.hbm2hbmxml.org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.TestCase#testCompositeId()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.TestCase#testSetAttributes()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/ManyToManyTest/TestCase.java | 121 +++++++++--------- 1 file changed, 64 insertions(+), 57 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java index d19f6bd7eb..0fd3dfc96e 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java @@ -9,15 +9,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -30,6 +29,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; public class TestCase { @@ -96,73 +98,78 @@ public void testReadable() { } @Test - public void testManyToMany() throws DocumentException { + public void testManyToMany() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/many-to-many"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one many-to-many element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "entity-name" ).getText(),"org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.Group"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one set element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "table" ).getText(),"UserGroup"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set/many-to-many") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one many-to-many element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "entity-name" ),"org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.Group"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + node = (Element)nodeList.item(0); + Assert.assertEquals(node.getAttribute( "table" ),"UserGroup"); } @Test - public void testCompositeId() throws DocumentException { + public void testCompositeId() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml"); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one class element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute("table").getText(), "`Group`"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/composite-id"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one composite-id element", 1, list.size()); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/composite-id/key-property"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get two key-property elements", 2, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute("name").getText(), "name"); - node = (Element) list.get(1); - Assert.assertEquals(node.attribute("name").getText(), "org"); + JUnitUtil.assertIsNonEmptyFile(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one class element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute("table"), "`Group`"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/composite-id") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one composite-id element", 1, nodeList.getLength()); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/composite-id/key-property") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get two key-property elements", 2, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute("name"), "name"); + node = (Element) nodeList.item(1); + Assert.assertEquals(node.getAttribute("name"), "org"); } @Test - public void testSetAttributes() { + public void testSetAttributes() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document; - try { - document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one set element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute("table").getText(), "UserGroup"); - Assert.assertEquals(node.attribute("name").getText(), "users"); - Assert.assertEquals(node.attribute("inverse").getText(), "true"); - Assert.assertEquals(node.attribute("lazy").getText(), "extra"); - } catch (DocumentException e) { - Assert.fail("Can't parse file " + outputXml.getAbsolutePath()); - } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute("table"), "UserGroup"); + Assert.assertEquals(node.getAttribute("name"), "users"); + Assert.assertEquals(node.getAttribute("inverse"), "true"); + Assert.assertEquals(node.getAttribute("lazy"), "extra"); } } From 6a48680ecf17d37c9a945c9e871450d3598f0708 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 09:52:13 +0200 Subject: [PATCH 185/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.TestCase#testListNode()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.TestCase#testArrayNode()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/ListArrayTest/TestCase.java | 121 ++++++++++-------- 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java index 09fdbef2f1..98964d5d64 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -39,6 +38,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -97,66 +99,75 @@ public void testReadable() { } @Test - public void testListNode() throws DocumentException { + public void testListNode() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/list"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get two list element", 2, list.size()); - Element node = (Element) list.get(1); //second list - Assert.assertEquals("fooComponents", node.attribute( "name" ).getText()); - Assert.assertEquals("true", node.attribute( "lazy" ).getText()); - Assert.assertEquals("all", node.attribute( "cascade" ).getText()); - list = node.elements("list-index"); - Assert.assertEquals("Expected to get one list-index element", 1, list.size()); - list = ((Element) list.get(0)).elements("column"); - Assert.assertEquals("Expected to get one column element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals("tha_indecks", node.attribute( "name" ).getText()); - node = node.getParent().getParent();//list - list = node.elements("composite-element"); - Assert.assertEquals("Expected to get one composite-element element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals("Expected to get two property element", 2, node.elements("property").size()); - node = node.element("many-to-one"); - Assert.assertEquals("fee", node.attribute( "name" ).getText()); - Assert.assertEquals("all", node.attribute( "cascade" ).getText()); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/list") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get two list element", 2, nodeList.getLength()); + Element node = (Element) nodeList.item(1); //second list + Assert.assertEquals("fooComponents", node.getAttribute( "name" )); + Assert.assertEquals("true", node.getAttribute( "lazy" )); + Assert.assertEquals("all", node.getAttribute( "cascade" )); + nodeList = node.getElementsByTagName("list-index"); + Assert.assertEquals("Expected to get one list-index element", 1, nodeList.getLength()); + nodeList = ((Element) nodeList.item(0)).getElementsByTagName("column"); + Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals("tha_indecks", node.getAttribute( "name" )); + node = (Element)node.getParentNode().getParentNode();//list + nodeList = node.getElementsByTagName("composite-element"); + Assert.assertEquals("Expected to get one composite-element element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + int propertyCount = 0; + nodeList = node.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + if ("property".equals(nodeList.item(i).getNodeName())) propertyCount++; + } + Assert.assertEquals("Expected to get two property element", 2, propertyCount); + node = (Element)node.getElementsByTagName("many-to-one").item(0); + Assert.assertEquals("fee", node.getAttribute( "name" )); + Assert.assertEquals("all", node.getAttribute( "cascade" )); //TODO :assertEquals(node.attribute( "outer-join" ).getText(),"true"); - node = node.getParent();//composite-element - node = node.element("nested-composite-element"); - Assert.assertEquals("subcomponent", node.attribute( "name" ).getText()); - Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.FooComponent", node.attribute( "class" ).getText()); + node = (Element)node.getParentNode();//composite-element + node = (Element)node.getElementsByTagName("nested-composite-element").item(0); + Assert.assertEquals("subcomponent", node.getAttribute( "name" )); + Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.FooComponent", node.getAttribute( "class" )); } @Test - public void testArrayNode() throws DocumentException { + public void testArrayNode() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/array"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one array element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals("proxyArray", node.attribute( "name" ).getText()); - Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.GlarchProxy", node.attribute( "element-class" ).getText()); - list = node.elements("list-index"); - Assert.assertEquals("Expected to get one list-index element", 1, list.size()); - list = ((Element) list.get(0)).elements("column"); - Assert.assertEquals("Expected to get one column element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals("array_indecks", node.attribute( "name" ).getText()); - node = node.getParent().getParent();//array - list = node.elements("one-to-many"); - Assert.assertEquals("Expected to get one 'one-to-many' element", 1, list.size()); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/array") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one array element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals("proxyArray", node.getAttribute( "name" )); + Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.GlarchProxy", node.getAttribute( "element-class" )); + nodeList = node.getElementsByTagName("list-index"); + Assert.assertEquals("Expected to get one list-index element", 1, nodeList.getLength()); + nodeList = ((Element) nodeList.item(0)).getElementsByTagName("column"); + Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals("array_indecks", node.getAttribute( "name" )); + node = (Element)node.getParentNode().getParentNode();//array + nodeList = node.getElementsByTagName("one-to-many"); + Assert.assertEquals("Expected to get one 'one-to-many' element", 1, nodeList.getLength()); } } From c1315bdcc29ef3dab72f504b1e753c1f04d6dff8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 10:51:55 +0200 Subject: [PATCH 186/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.InheritanceTest.TestCase#testComment()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.InheritanceTest.TestCase#testDiscriminator()' Signed-off-by: Koen Aers --- .../hbm2hbmxml/InheritanceTest/TestCase.java | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java index 9897bceca4..fc9f920842 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java @@ -9,15 +9,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -31,6 +30,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * this test should be fixed to have a proper model. currently a mix of subclass/joinedsubclass is in play. @@ -109,38 +111,37 @@ public void testReadable() { // TODO Re-enable this test: HBX-1247 @Ignore @Test - public void testComment() { + public void testComment() throws Exception { File outputXml = new File( outputDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Alien.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document; - try { - document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/joined-subclass/comment"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one comment element", 1, list.size()); - } catch (DocumentException e) { - Assert.fail("Can't parse file " + outputXml.getAbsolutePath()); - } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/joined-subclass/comment") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); } @Test - public void testDiscriminator() throws DocumentException { + public void testDiscriminator() throws Exception { File outputXml = new File( outputDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Animal.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/discriminator"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one discriminator element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "type" ).getText(), "string"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/discriminator") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one discriminator element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "type" ), "string"); } } From a9798c16b02fd8eb6901adbcd4cbba3a98a73c72 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 12:15:56 +0200 Subject: [PATCH 187/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest.TestCase#testIdBagAttributes()' and 'org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest.TestCase#testCollectionId()' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/IdBagTest/TestCase.java | 77 ++++++++++--------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java index a895a6cd47..67012398f7 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java @@ -18,15 +18,14 @@ import java.io.File; import java.util.ArrayList; -import java.util.List; import java.util.Properties; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.cfg.AvailableSettings; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; @@ -39,6 +38,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; /** * @author Dmitry Geraskov @@ -109,47 +111,46 @@ public void testReadable() { } @Test - public void testIdBagAttributes() { + public void testIdBagAttributes() throws Exception { File outputXml = new File( outputDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document; - try { - document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/idbag"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one idbag element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "table" ).getText(),"`UserGroups`"); - Assert.assertEquals(node.attribute( "name" ).getText(),"groups"); - Assert.assertEquals(node.attribute( "lazy" ).getText(),"false"); - Assert.assertEquals(node.attribute( "access" ).getText(),"field"); - } catch (DocumentException e) { - Assert.fail("Can't parse file " + outputXml.getAbsolutePath()); - } + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/idbag") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one idbag element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "table" ),"`UserGroups`"); + Assert.assertEquals(node.getAttribute( "name" ),"groups"); + Assert.assertEquals(node.getAttribute( "lazy" ),"false"); + Assert.assertEquals(node.getAttribute( "access" ),"field"); } @Test - public void testCollectionId() throws DocumentException { + public void testCollectionId() throws Exception { File outputXml = new File( outputDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml"); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/idbag/collection-id"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one collection-id element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "column" ).getText(),"userGroupId"); - Assert.assertEquals(node.attribute( "type" ).getText(),"long"); - list = node.elements("generator"); - Assert.assertEquals("Expected to get one generator element", 1, list.size()); - node = (Element) list.get(0); - Assert.assertEquals(node.attribute( "class" ).getText(),"increment"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/idbag/collection-id") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one collection-id element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "column" ),"userGroupId"); + Assert.assertEquals(node.getAttribute( "type" ),"long"); + nodeList = node.getElementsByTagName("generator"); + Assert.assertEquals("Expected to get one generator element", 1, nodeList.getLength()); + node = (Element) nodeList.item(0); + Assert.assertEquals(node.getAttribute( "class" ),"increment"); } } From e5a02d693695ad1d5162ffa06f7c680ad87eec69 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 13:44:53 +0200 Subject: [PATCH 188/454] HBX-2159: Remove the dependency on dom4j - Reimplement test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java | 500 ++++++++++-------- 1 file changed, 269 insertions(+), 231 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java index c34238f2be..bc73e5372c 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java @@ -8,16 +8,13 @@ package org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest; import java.io.File; -import java.util.List; -import org.dom4j.Attribute; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.Node; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.Exporter; import org.hibernate.tool.hbm2x.HibernateMappingExporter; @@ -29,6 +26,11 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Attr; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; /** * Initial implentation based on the Hbm2XTest class. @@ -125,15 +127,15 @@ public void testGlobalSettingsGeneratedDatabase() throws Exception { outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - Element root = document.getRootElement(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + Element root = document.getDocumentElement(); // There are 7 attributes because there are defaults defined by the DTD makes up the missing entries - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 7, root.attributeCount() ); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.attribute("package").getStringValue() ); - Assert.assertEquals("Unexpected schema name", "myschema", root.attribute("schema").getStringValue() ); - Assert.assertEquals("Unexpected mycatalog name", "mycatalog", root.attribute("catalog").getStringValue() ); + Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 7, root.getAttributes().getLength() ); + Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package") ); + Assert.assertEquals("Unexpected schema name", "myschema", root.getAttribute("schema") ); + Assert.assertEquals("Unexpected mycatalog name", "mycatalog", root.getAttribute("catalog")); } /** @@ -155,100 +157,113 @@ public void testGlobalSettingsGeneratedAccessAndCascadeNonDefault() throws Exce outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - Element root = document.getRootElement(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() ); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.attribute("package").getStringValue() ); - Assert.assertEquals("Unexpected access setting", "field", root.attribute("default-access").getStringValue() ); - Assert.assertEquals("Unexpected cascade setting", "save-update", root.attribute("default-cascade").getStringValue() ); + Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); + Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); + Assert.assertEquals("Unexpected access setting", "field", root.getAttribute("default-access")); + Assert.assertEquals("Unexpected cascade setting", "save-update", root.getAttribute("default-cascade") ); } @Test - public void testMetaAttributes() throws DocumentException { + public void testMetaAttributes() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/meta"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one meta element", 2, list.size()); - Node node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"Basic"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/meta"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one meta element", 1, list.size()); - node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"basicId"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/property/meta"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one meta element", 1, list.size()); - node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"description"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set/meta"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one meta element", 1, list.size()); - node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"anotherone"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/meta") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one meta element", 2, nodeList.getLength()); + Node node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"Basic"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/id/meta") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"basicId"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/property/meta") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"description"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set/meta") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"anotherone"); } @Test - public void testCollectionAttributes() throws DocumentException { + public void testCollectionAttributes() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/set"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one set element", 1, list.size()); - Element node = (Element) list.get(0); - Assert.assertEquals("delete, update", node.attributeValue("cascade")); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/set") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + Element node = (Element) nodeList.item(0); + Assert.assertEquals("delete, update", node.getAttribute("cascade")); } @Test - public void testComments() throws DocumentException { + public void testComments() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/ClassFullAttribute.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/comment"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one comment element", 1, list.size()); - Node node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"A comment for ClassFullAttribute"); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/property/column/comment"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get one comment element", 1, list.size()); - node = (Node) list.get(0); - Assert.assertEquals(node.getText(),"columnd comment"); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/comment") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); + Node node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"A comment for ClassFullAttribute"); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/property/column/comment") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); + node = (Node) nodeList.item(0); + Assert.assertEquals(node.getTextContent(),"columnd comment"); } @Test - public void testNoComments() throws DocumentException { + public void testNoComments() throws Exception { File outputXml = new File( outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/comment"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get no comment element", list.size(), 0); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/property/column/comment"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get no comment element", 0, list.size()); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/comment") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get no comment element", nodeList.getLength(), 0); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/property/column/comment") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get no comment element", 0, nodeList.getLength()); } /** @@ -271,15 +286,15 @@ public void testGlobalSettingsGeneratedAccessAndCascadeDefault() throws Excepti outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - Element root = document.getRootElement(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() ); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.attribute("package").getStringValue() ); - Assert.assertEquals("Unexpected access setting", "property", root.attribute("default-access").getStringValue() ); - Assert.assertEquals("Unexpected cascade setting", "none", root.attribute("default-cascade").getStringValue() ); + Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); + Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); + Assert.assertEquals("Unexpected access setting", "property", root.getAttribute("default-access")); + Assert.assertEquals("Unexpected cascade setting", "none", root.getAttribute("default-cascade")); } /** @@ -302,15 +317,15 @@ public void testGlobalSettingsLasyAndAutoImportNonDefault() throws Exception { outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); - Element root = document.getRootElement(); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.attributeCount() ); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.attribute("package").getStringValue() ); - Assert.assertEquals("Unexpected access setting", "false", root.attribute("default-lazy").getStringValue() ); - Assert.assertEquals("Unexpected cascade setting", "false", root.attribute("auto-import").getStringValue() ); + Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); + Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); + Assert.assertEquals("Unexpected access setting", "false", root.getAttribute("default-lazy")); + Assert.assertEquals("Unexpected cascade setting", "false", root.getAttribute("auto-import")); } @Test @@ -319,18 +334,21 @@ public void testIdGeneratorHasNotArgumentParameters() throws Exception { outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and it has no arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator"); - List list = xpath.selectNodes(document); - Assert.assertTrue("Expected to get one generator element", list.size() == 1); - Attribute genAtt = ( (Element)list.get(0) ).attribute("class"); - Assert.assertEquals("Unexpected generator class name", "assigned", genAtt.getStringValue() ); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator/param"); - list = xpath.selectNodes(document); - Assert.assertTrue("Expected to get no generator param elements", list.size() == 0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/id/generator") + .evaluate(document, XPathConstants.NODESET); + Assert.assertTrue("Expected to get one generator element", nodeList.getLength() == 1); + Node genAtt = ( (Element)nodeList.item(0)).getAttributeNode("class"); + Assert.assertEquals("Unexpected generator class name", "assigned", genAtt.getTextContent() ); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/id/generator/param") + .evaluate(document, XPathConstants.NODESET); + Assert.assertTrue("Expected to get no generator param elements", nodeList.getLength() == 0); } @Test @@ -339,35 +357,38 @@ public void testIdGeneratorHasArgumentParameters() throws Exception { outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator"); - List list = xpath.selectNodes(document); - Assert.assertTrue("Expected to get one generator element", list.size() == 1); - Attribute genAtt = ( (Element)list.get(0) ).attribute("class"); - Assert.assertEquals("Unexpected generator class name", "org.hibernate.id.TableHiLoGenerator", genAtt.getStringValue() ); - xpath = DocumentHelper.createXPath("//hibernate-mapping/class/id/generator/param"); - list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get correct number of generator param elements", 2, list.size() ); - Element tableElement = (Element)list.get(0); - Attribute paramTableAtt = tableElement.attribute("name"); - Element columnElement = (Element)list.get(1); - Attribute paramColumnAtt = columnElement.attribute("name"); - if(paramTableAtt.getStringValue().equals("column")) { + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/id/generator") + .evaluate(document, XPathConstants.NODESET); + Assert.assertTrue("Expected to get one generator element", nodeList.getLength() == 1); + Node genAtt = ( (Element)nodeList.item(0)).getAttributeNode("class"); + Assert.assertEquals("Unexpected generator class name", "org.hibernate.id.TableHiLoGenerator", genAtt.getTextContent()); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/class/id/generator/param") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get correct number of generator param elements", 2, nodeList.getLength()); + Element tableElement = (Element)nodeList.item(0); + Attr paramTableAtt = tableElement.getAttributeNode("name"); + Element columnElement = (Element)nodeList.item(1); + Attr paramColumnAtt = columnElement.getAttributeNode("name"); + if(paramTableAtt.getTextContent().equals("column")) { // to make sure the order of the elements doesn't matter. Element tempElement = tableElement; - Attribute temp = paramTableAtt; + Attr temp = paramTableAtt; paramTableAtt = paramColumnAtt; tableElement = columnElement; paramColumnAtt = temp; columnElement = tempElement; } - Assert.assertEquals("Unexpected generator param name", "table", paramTableAtt.getStringValue() ); - Assert.assertEquals("Unexpected generator param name", "column", paramColumnAtt.getStringValue() ); - Assert.assertEquals("Unexpected param value for table", "uni_table", tableElement.getStringValue() ); - Assert.assertEquals("Unexpected param value for column", "next_hi_value", columnElement.getStringValue() ); + Assert.assertEquals("Unexpected generator param name", "table", paramTableAtt.getTextContent() ); + Assert.assertEquals("Unexpected generator param name", "column", paramColumnAtt.getTextContent() ); + Assert.assertEquals("Unexpected param value for table", "uni_table", tableElement.getTextContent() ); + Assert.assertEquals("Unexpected param value for column", "next_hi_value", columnElement.getTextContent() ); } @Test @@ -376,29 +397,31 @@ public void testGeneralHbmSettingsQuery() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/query"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get correct number of query elements", 2, list.size() ); - Attribute genAtt = ( (Element)list.get(0) ).attribute("name"); - Assert.assertEquals("Unexpected query name", "test_query_1", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(0) ).attribute("flush-mode"); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/query") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get correct number of query elements", 2, nodeList.getLength() ); + Attr genAtt = ( (Element)nodeList.item(0) ).getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_query_1", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(0) ).getAttributeNode("flush-mode"); Assert.assertNull("Expected flush-mode value to be null", genAtt); - genAtt = ( (Element)list.get(1) ).attribute("name"); - Assert.assertEquals("Unexpected query name", "test_query_2", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(1) ).attribute("flush-mode"); - Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(1) ).attribute("cacheable"); - Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(1) ).attribute("cache-region"); - Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(1) ).attribute("fetch-size"); - Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getStringValue() ); - genAtt = ( (Element)list.get(1) ).attribute("timeout"); - Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getStringValue() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_query_2", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("flush-mode"); + Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("cacheable"); + Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("cache-region"); + Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("fetch-size"); + Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getTextContent() ); + genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("timeout"); + Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getTextContent() ); } @Test @@ -407,18 +430,21 @@ public void testGeneralHbmSettingsSQLQueryBasic() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query"); - List list = xpath.selectNodes(document); - Assert.assertEquals("Expected to get correct number of query elements", 6, list.size() ); - xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_1\"]"); - list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query") + .evaluate(document, XPathConstants.NODESET); + Assert.assertEquals("Expected to get correct number of query elements", 6, nodeList.getLength() ); + nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_1\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_1' not to be null", node); - Attribute genAtt = node.attribute("flush-mode"); + Attr genAtt = node.getAttributeNode("flush-mode"); Assert.assertNull("Expected flush-mode value to be null", genAtt); } @@ -428,27 +454,29 @@ public void testGeneralHbmSettingsSQLQueryAllAttributes() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_2\"]"); - List list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_2\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_2' not to be null", node); - Attribute genAtt = node.attribute("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_2", genAtt.getStringValue() ); - genAtt = node.attribute("flush-mode"); - Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getStringValue() ); - genAtt = node.attribute("cacheable"); - Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getStringValue() ); - genAtt = node.attribute("cache-region"); - Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getStringValue() ); - genAtt = node.attribute("fetch-size"); - Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getStringValue() ); - genAtt = node.attribute("timeout"); - Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getStringValue() ); - Element syncTable = node.element("synchronize"); + Attr genAtt = node.getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_sqlquery_2", genAtt.getTextContent() ); + genAtt = node.getAttributeNode("flush-mode"); + Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getTextContent() ); + genAtt = node.getAttributeNode("cacheable"); + Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getTextContent() ); + genAtt = node.getAttributeNode("cache-region"); + Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getTextContent() ); + genAtt = node.getAttributeNode("fetch-size"); + Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getTextContent() ); + genAtt = node.getAttributeNode("timeout"); + Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getTextContent() ); + Element syncTable = (Element)node.getElementsByTagName("synchronize").item(0); Assert.assertNull("Expected synchronize element to be null", syncTable); } @@ -458,21 +486,23 @@ public void testGeneralHbmSettingsSQLQuerySynchronize() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_3\"]"); - List list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_3\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_3' not to be null", node); - Attribute genAtt = node.attribute("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_3", genAtt.getStringValue() ); - Element syncTable = node.element("synchronize"); + Attr genAtt = node.getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_sqlquery_3", genAtt.getTextContent() ); + Element syncTable = (Element)node.getElementsByTagName("synchronize").item(0); Assert.assertNotNull("Expected synchronize element to not be null", syncTable); - genAtt = syncTable.attribute("table"); - Assert.assertEquals("Unexpected table value for synchronize element", "mytable", genAtt.getStringValue() ); - Element returnEl = node.element("return"); + genAtt = syncTable.getAttributeNode("table"); + Assert.assertEquals("Unexpected table value for synchronize element", "mytable", genAtt.getTextContent() ); + Element returnEl = (Element)node.getElementsByTagName("return").item(0); Assert.assertNull("Expected return element to be null", returnEl); } @@ -482,21 +512,24 @@ public void testGeneralHbmSettingsSQLQueryWithReturnRoot() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_4\"]"); - List list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_4\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_4' not to be null", node); - Attribute genAtt = node.attribute("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_4", genAtt.getStringValue() ); - Element returnEl = node.element("return"); + Attr genAtt = node.getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_sqlquery_4", genAtt.getTextContent() ); + Element returnEl = (Element)node.getElementsByTagName("return").item(0); Assert.assertNotNull("Expected return element to not be null", returnEl); - genAtt = returnEl.attribute("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getStringValue() ); - genAtt = returnEl.attribute("class"); - Assert.assertEquals("Unexpected class value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.BasicGlobals", genAtt.getStringValue()); + genAtt = returnEl.getAttributeNode("alias"); + Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent() ); + genAtt = returnEl.getAttributeNode("class"); + Assert.assertEquals("Unexpected class value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.BasicGlobals", genAtt.getTextContent()); } @Test @@ -505,22 +538,24 @@ public void testGeneralHbmSettingsSQLQueryWithReturnRole() throws Exception { outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_5\"]"); - List list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_5\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_5' not to be null", node); - Attribute genAtt = node.attribute("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_5", genAtt.getStringValue() ); - Element returnEl = node.element("return-join"); + Attr genAtt = node.getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_sqlquery_5", genAtt.getTextContent() ); + Element returnEl = (Element)node.getElementsByTagName("return-join").item(0); Assert.assertNotNull("Expected return element to not be null", returnEl); - genAtt = returnEl.attribute("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getStringValue() ); - genAtt = returnEl.attribute("property"); - Assert.assertEquals("Unexpected property role value for return element", "e.age", genAtt.getStringValue()); + genAtt = returnEl.getAttributeNode("alias"); + Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent() ); + genAtt = returnEl.getAttributeNode("property"); + Assert.assertEquals("Unexpected property role value for return element", "e.age", genAtt.getTextContent()); } @Test @@ -529,23 +564,26 @@ public void testGeneralHbmSettingsSQLQueryWithReturnCollection() throws Excepti outputDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); - SAXReader xmlReader = new SAXReader(); - Document document = xmlReader.read(outputXml); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(outputXml); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and that it does have arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-mapping/sql-query[@name=\"test_sqlquery_6\"]"); - List list = xpath.selectNodes(document); - Element node = (Element)list.get(0); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_6\"]") + .evaluate(document, XPathConstants.NODESET); + Element node = (Element)nodeList.item(0); Assert.assertNotNull("Expected sql-query named 'test_sqlquery_6' not to be null", node); - Attribute genAtt = node.attribute("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_6", genAtt.getStringValue()); - Element returnEl = node.element("load-collection"); + Attr genAtt = node.getAttributeNode("name"); + Assert.assertEquals("Unexpected query name", "test_sqlquery_6", genAtt.getTextContent()); + Element returnEl = (Element)node.getElementsByTagName("load-collection").item(0); Assert.assertNotNull("Expected return element to not be null", returnEl); - genAtt = returnEl.attribute("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getStringValue()); - genAtt = returnEl.attribute("role"); - Assert.assertEquals("Unexpected collection role value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.BasicGlobals.price", genAtt.getStringValue()); - genAtt = returnEl.attribute("lock-mode"); - Assert.assertEquals("Unexpected class lock-mode for return element", "none", genAtt.getStringValue()); + genAtt = returnEl.getAttributeNode("alias"); + Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent()); + genAtt = returnEl.getAttributeNode("role"); + Assert.assertEquals("Unexpected collection role value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.BasicGlobals.price", genAtt.getTextContent()); + genAtt = returnEl.getAttributeNode("lock-mode"); + Assert.assertEquals("Unexpected class lock-mode for return element", "none", genAtt.getTextContent()); } } From a59fd5ba8787b4b0735c357830625c81c519214e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 15:27:12 +0200 Subject: [PATCH 189/454] HBX-2159: Remove the dependency on dom4j - Reimplement tests 'org.hibernate.tool.hbm2x.GenerateFromJDBC.TestCase#testGenerateCfgXml()' and 'org.hibernate.tool.hbm2x.GenerateFromJDBC.TestCase#testGenerateAnnotationCfgXml()' Signed-off-by: Koen Aers --- .../tool/hbm2x/GenerateFromJDBC/TestCase.java | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java index 6a824134ca..1670d8eeb6 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java @@ -7,14 +7,13 @@ import java.io.File; import java.sql.SQLException; import java.util.Iterator; -import java.util.List; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.dom4j.Element; -import org.dom4j.XPath; -import org.dom4j.io.SAXReader; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathFactory; + import org.hibernate.boot.Metadata; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.ReverseEngineeringSettings; @@ -35,6 +34,9 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; /** * @author max @@ -96,32 +98,34 @@ public void testGenerateMappings() { } @Test - public void testGenerateCfgXml() throws DocumentException { + public void testGenerateCfgXml() throws Exception { Exporter exporter = new HibernateConfigurationExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(outputDir); exporter.start(); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "hibernate.cfg.xml")); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(new File(outputDir, "hibernate.cfg.xml")); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(new File(outputDir, "hibernate.cfg.xml")); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and it has no arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-configuration/session-factory/mapping"); - List list = xpath.selectNodes(document); - Element[] elements = new Element[list.size()]; - for (int i = 0; i < list.size(); i++) { - elements[i] = (Element)list.get(i); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-configuration/session-factory/mapping") + .evaluate(document, XPathConstants.NODESET); + Node[] elements = new Node[nodeList.getLength()]; + for (int i = 0; i < nodeList.getLength(); i++) { + elements[i] = (Node)nodeList.item(i); } - Assert.assertEquals(2,elements.length); + Assert.assertEquals(2, elements.length); for (int i = 0; i < elements.length; i++) { - Element element = elements[i]; - Assert.assertNotNull(element.attributeValue("resource")); - Assert.assertNull(element.attributeValue("class")); + Node element = elements[i]; + Assert.assertNotNull(element.getAttributes().getNamedItem("resource")); + Assert.assertNull(element.getAttributes().getNamedItem("class")); } } @Test - public void testGenerateAnnotationCfgXml() throws DocumentException { + public void testGenerateAnnotationCfgXml() throws Exception { HibernateConfigurationExporter exporter = new HibernateConfigurationExporter(); exporter.setMetadataDescriptor(metadataDescriptor); @@ -129,21 +133,23 @@ public void testGenerateAnnotationCfgXml() throws DocumentException { exporter.getProperties().setProperty("ejb3", "true"); exporter.start(); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "hibernate.cfg.xml")); - SAXReader xmlReader = new SAXReader(); - xmlReader.setValidation(true); - Document document = xmlReader.read(new File(outputDir, "hibernate.cfg.xml")); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + Document document = db.parse(new File(outputDir, "hibernate.cfg.xml")); + XPath xpath = XPathFactory.newInstance().newXPath(); // Validate the Generator and it has no arguments - XPath xpath = DocumentHelper.createXPath("//hibernate-configuration/session-factory/mapping"); - List list = xpath.selectNodes(document); - Element[] elements = new Element[list.size()]; - for (int i = 0; i < list.size(); i++) { - elements[i] = (Element)list.get(i); + NodeList nodeList = (NodeList)xpath + .compile("//hibernate-configuration/session-factory/mapping") + .evaluate(document, XPathConstants.NODESET); + Node[] elements = new Node[nodeList.getLength()]; + for (int i = 0; i < nodeList.getLength(); i++) { + elements[i] = (Node)nodeList.item(i); } Assert.assertEquals(2, elements.length); for (int i = 0; i < elements.length; i++) { - Element element = elements[i]; - Assert.assertNull(element.attributeValue("resource")); - Assert.assertNotNull(element.attributeValue("class")); + Node element = elements[i]; + Assert.assertNull(element.getAttributes().getNamedItem("resource")); + Assert.assertNotNull(element.getAttributes().getNamedItem("class")); } } From 776e87bb339bc114887fb7b8080135068cc34be7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 16 Jun 2021 14:48:02 +0200 Subject: [PATCH 190/454] HBX-2179: Replace 'org.hibernate.tool.api.java.Formatter' based on Eclipse JDT with 'org.hibernate.tool.api.java.DefaultJavaPrettyPrinterStrategy' based on 'google-java-format' Signed-off-by: Koen Aers --- main/pom.xml | 24 +++--- .../hibernate/tool/ant/JavaFormatterTask.java | 4 +- .../DefaultJavaPrettyPrinterStrategy.java | 27 +++++++ .../tool/ide/formatting/JavaFormatter.java | 75 ------------------- pom.xml | 13 ++-- .../tool/ant/JavaFormatter/TestCase.java | 6 +- 6 files changed, 51 insertions(+), 98 deletions(-) create mode 100644 main/src/main/java/org/hibernate/tool/ide/formatting/DefaultJavaPrettyPrinterStrategy.java delete mode 100644 main/src/main/java/org/hibernate/tool/ide/formatting/JavaFormatter.java diff --git a/main/pom.xml b/main/pom.xml index 63835b8c99..f5d29e3258 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -56,10 +56,14 @@ - - org.apache.commons - commons-collections4 - + + com.google.googlejavaformat + google-java-format + + + javax.persistence + javax.persistence-api + jaxen jaxen @@ -68,10 +72,10 @@ org.apache.ant ant - - org.eclipse.jdt - org.eclipse.jdt.core - + + org.apache.commons + commons-collections4 + org.freemarker freemarker @@ -84,10 +88,6 @@ org.hibernate.common hibernate-commons-annotations - - javax.persistence - javax.persistence-api - diff --git a/main/src/main/java/org/hibernate/tool/ant/JavaFormatterTask.java b/main/src/main/java/org/hibernate/tool/ant/JavaFormatterTask.java index 2bc3f93580..dc17ff7170 100644 --- a/main/src/main/java/org/hibernate/tool/ant/JavaFormatterTask.java +++ b/main/src/main/java/org/hibernate/tool/ant/JavaFormatterTask.java @@ -17,7 +17,7 @@ import org.apache.tools.ant.Task; import org.apache.tools.ant.types.FileSet; import org.hibernate.tool.hbm2x.ExporterException; -import org.hibernate.tool.ide.formatting.JavaFormatter; +import org.hibernate.tool.ide.formatting.DefaultJavaPrettyPrinterStrategy; public class JavaFormatterTask extends Task { @@ -72,7 +72,7 @@ public void execute() throws BuildException { if(files.length>0) { - JavaFormatter formatter = new JavaFormatter(settings); + DefaultJavaPrettyPrinterStrategy formatter = new DefaultJavaPrettyPrinterStrategy(settings); for (int i = 0; i < files.length; i++) { File file = files[i]; try { diff --git a/main/src/main/java/org/hibernate/tool/ide/formatting/DefaultJavaPrettyPrinterStrategy.java b/main/src/main/java/org/hibernate/tool/ide/formatting/DefaultJavaPrettyPrinterStrategy.java new file mode 100644 index 0000000000..2971d808d0 --- /dev/null +++ b/main/src/main/java/org/hibernate/tool/ide/formatting/DefaultJavaPrettyPrinterStrategy.java @@ -0,0 +1,27 @@ +package org.hibernate.tool.ide.formatting; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.util.Map; + +import com.google.googlejavaformat.java.Formatter; +import com.google.googlejavaformat.java.FormatterException; + +public class DefaultJavaPrettyPrinterStrategy { + + public DefaultJavaPrettyPrinterStrategy(Map settings) {} + + public boolean formatFile(File file) { + try { + Formatter formatter = new Formatter(); + String toFormat = new String(Files.readAllBytes(file.toPath())); + String toWrite = formatter.formatSource(toFormat); + Files.write(file.toPath(), toWrite.getBytes()); + return true; + } catch (IOException | FormatterException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/main/src/main/java/org/hibernate/tool/ide/formatting/JavaFormatter.java b/main/src/main/java/org/hibernate/tool/ide/formatting/JavaFormatter.java deleted file mode 100644 index ec67e7053e..0000000000 --- a/main/src/main/java/org/hibernate/tool/ide/formatting/JavaFormatter.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.hibernate.tool.ide.formatting; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.ToolFactory; -import org.eclipse.jdt.core.formatter.CodeFormatter; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IDocument; -import org.eclipse.text.edits.TextEdit; -import org.hibernate.tool.hbm2x.ExporterException; - - -public class JavaFormatter { - - private CodeFormatter codeFormatter; - - public JavaFormatter(Map settings) { - if(settings==null) { - // if no settings run with jdk 5 as default - settings = new HashMap(); - settings.put( JavaCore.COMPILER_SOURCE, "1.5"); - settings.put( JavaCore.COMPILER_COMPLIANCE, "1.5"); - settings.put( JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, "1.5"); - } - - this.codeFormatter = ToolFactory.createCodeFormatter(settings); - } - - /** - * Throws exception if not possible to read or write the file. - * Returns true if formatting went ok; returns false if the formatting could not finish because of errors in the input. - * - * @param file - * @param codeFormatter - * @return - */ - public boolean formatFile(File file) throws ExporterException { - IDocument doc = new Document(); - try { - String contents = new String(org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(file, null)); - doc.set(contents); - TextEdit edit = codeFormatter.format(CodeFormatter.K_COMPILATION_UNIT, contents, 0, contents.length(), 0, null); - if (edit != null) { - edit.apply(doc); - } else { - return false; // most likely syntax errror - } - - // write the file - final BufferedWriter out = new BufferedWriter(new FileWriter(file)); - try { - out.write(doc.get()); - out.flush(); - } finally { - try { - out.close(); - } catch (IOException e) { - /* ignore */ - } - } - return true; - } catch (IOException e) { - throw new ExporterException("Could not format " + file, e); - } catch (BadLocationException e) { - throw new ExporterException("Could not format " + file, e); - } - } - -} diff --git a/pom.xml b/pom.xml index 48960e5013..ceff882468 100644 --- a/pom.xml +++ b/pom.xml @@ -27,8 +27,9 @@ 1.10.10 4.4 - 3.25.0 2.3.31 + + 1.7 1.4.199 5.1.2.Final 5.3.20.Final @@ -47,6 +48,11 @@ + + com.google.googlejavaformat + google-java-format + ${google-java-format.version} + com.h2database h2 @@ -109,11 +115,6 @@ ant ${ant.version} - - org.eclipse.jdt - org.eclipse.jdt.core - ${eclipse-jdt-core.version} - org.freemarker freemarker diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java index 614d3ce375..0e52a5a814 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java @@ -2,7 +2,7 @@ import java.io.File; -import org.hibernate.tool.ide.formatting.JavaFormatter; +import org.hibernate.tool.ide.formatting.DefaultJavaPrettyPrinterStrategy; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.ResourceUtil; @@ -53,7 +53,7 @@ public void testJavaFormatFile() { .findFirstString("public", simpleOne) .contains("SimpleOne")); - JavaFormatter formatter = new JavaFormatter(null); + DefaultJavaPrettyPrinterStrategy formatter = new DefaultJavaPrettyPrinterStrategy(null); formatter.formatFile( simpleOne ); Assert.assertTrue(FileUtil @@ -90,7 +90,7 @@ public void testJavaJdk5FormatFile() { Assert.assertFalse(log.contains("Exception")); - JavaFormatter formatter = new JavaFormatter(null); + DefaultJavaPrettyPrinterStrategy formatter = new DefaultJavaPrettyPrinterStrategy(null); Assert.assertTrue( "formatting should pass when using default settings", formatter.formatFile(simple5One)); From eba89ba502ca44a2c4a0ae581e054e8bb05ac76d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 15 Jun 2021 16:32:29 +0200 Subject: [PATCH 191/454] HBX-2159: Remove the dependency on dom4j - Reimplement classes 'org.hibernate.cfg.reveng.OverrideRepository' and 'org.hibernate.cfg.reveng.OverrideBinder' without dom4j Signed-off-by: Koen Aers --- .../cfg/reveng/MetaAttributeBinder.java | 104 --- .../hibernate/cfg/reveng/OverrideBinder.java | 720 +++++++++--------- .../cfg/reveng/OverrideRepository.java | 19 +- .../cfg/reveng/SimpleMetaAttribute.java | 17 - .../org/hibernate/cfg/reveng/TableFilter.java | 1 + .../utils/JdbcToHibernateTypeHelper.java | 199 +++++ .../cfg/reveng/utils/MetaAttributeHelper.java | 131 ++++ .../cfg/reveng/utils/RevengUtils.java | 32 + .../tool/hbm2x/MetaAttributeHelper.java | 2 +- .../org/hibernate/tool/xml/XMLHelper.java | 44 -- 10 files changed, 734 insertions(+), 535 deletions(-) delete mode 100644 main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java delete mode 100644 main/src/main/java/org/hibernate/cfg/reveng/SimpleMetaAttribute.java create mode 100644 main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java create mode 100644 main/src/main/java/org/hibernate/cfg/reveng/utils/MetaAttributeHelper.java create mode 100644 main/src/main/java/org/hibernate/cfg/reveng/utils/RevengUtils.java delete mode 100644 main/src/main/java/org/hibernate/tool/xml/XMLHelper.java diff --git a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java deleted file mode 100644 index 6c557afa90..0000000000 --- a/main/src/main/java/org/hibernate/cfg/reveng/MetaAttributeBinder.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.hibernate.cfg.reveng; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.collections4.MultiValuedMap; -import org.apache.commons.collections4.multimap.HashSetValuedHashMap; -import org.dom4j.Element; -import org.hibernate.mapping.MetaAttribute; -import org.hibernate.tool.hbm2x.MetaAttributeHelper; - -public class MetaAttributeBinder { - - /** - * Merges a Multimap with inherited maps. - * Values specified always overrules/replaces the inherited values. - * - * @param specific - * @param general - * @return a MultiMap with all values from local and extra values - * from inherited - */ - public static MultiValuedMap mergeMetaMaps( - MultiValuedMap specific, - MultiValuedMap general) { - MultiValuedMap result = new HashSetValuedHashMap(); - MetaAttributeHelper.copyMultiMap(result, specific); - if (general != null) { - for (Iterator iter = general.keySet().iterator();iter.hasNext();) { - String key = iter.next(); - if (!specific.containsKey(key) ) { - // inheriting a meta attribute only if it is inheritable - Collection ml = general.get(key); - for (Iterator iterator = ml.iterator(); iterator.hasNext();) { - SimpleMetaAttribute element = iterator.next(); - if (element.inheritable) { - result.put(key, element); - } - } - } - } - } - - return result; - - } - - public static MetaAttribute toRealMetaAttribute(String name, Collection values) { - MetaAttribute attribute = new MetaAttribute(name); - for (Iterator iter = values.iterator(); iter.hasNext();) { - SimpleMetaAttribute element = iter.next(); - attribute.addValue(element.value); - } - - return attribute; - } - - /** - * Method loadAndMergeMetaMap. - * @param classElement - * @param inheritedMeta - * @return MultiMap - */ - public static MultiValuedMap loadAndMergeMetaMap( - Element classElement, - MultiValuedMap inheritedMeta) { - return MetaAttributeBinder.mergeMetaMaps(loadMetaMap(classElement), inheritedMeta); - } - - - /** - * Load meta attributes from jdom element into a MultiMap. - * - * @param element - * @return MultiMap - */ - protected static MultiValuedMap loadMetaMap(Element element) { - MultiValuedMap result = new HashSetValuedHashMap(); - List metaAttributeList = new ArrayList(); - for (Object obj : element.elements("meta")) { - metaAttributeList.add((Element)obj); - } - - for (Iterator iter = metaAttributeList.iterator(); iter.hasNext();) { - Element metaAttrib = iter.next(); - // does not use getTextNormalize() or getTextTrim() as that would remove the formatting in new lines in items like description for javadocs. - String attribute = metaAttrib.attributeValue("attribute"); - String value = metaAttrib.getText(); - String inheritStr= metaAttrib.attributeValue("inherit"); - boolean inherit = true; - if(inheritStr!=null) { - inherit = Boolean.valueOf(inheritStr).booleanValue(); - } - - SimpleMetaAttribute ma = new SimpleMetaAttribute(value, inherit); - result.put(attribute, ma); - } - return result; - - } - -} diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java index d9ce82a6ff..25a667767f 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideBinder.java @@ -1,451 +1,429 @@ package org.hibernate.cfg.reveng; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.Properties; import org.apache.commons.collections4.MultiValuedMap; import org.apache.commons.collections4.multimap.HashSetValuedHashMap; -import org.dom4j.Document; -import org.dom4j.Element; import org.hibernate.MappingException; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper.SimpleMetaAttribute; +import org.hibernate.cfg.reveng.utils.RevengUtils; import org.hibernate.internal.util.StringHelper; import org.hibernate.mapping.Column; import org.hibernate.mapping.ForeignKey; import org.hibernate.mapping.Table; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +public class OverrideBinder { -public final class OverrideBinder { - - private OverrideBinder() { - // empty + public static void bindRoot(OverrideRepository repository, Document doc) { + Element rootElement = doc.getDocumentElement(); + bindSchemaSelections(getChildElements(rootElement, "schema-selection"), repository); + bindTypeMappings(getChildElements(rootElement, "type-mapping"), repository); + bindTableFilters(getChildElements(rootElement, "table-filter"), repository); + bindTables(getChildElements(rootElement, "table"), repository); } - public static void bindRoot(OverrideRepository repository, Document doc) { - - Element rootElement = doc.getRootElement(); - - Element element; - List elements; - - elements = rootElement.elements("schema-selection"); - bindSchemaSelection(elements, repository); - - element = rootElement.element("type-mapping"); - - if(element!=null) { - bindTypeMappings(element, repository); + private static void bindSchemaSelections( + ArrayList schemaSelections, + OverrideRepository repository) { + for (Element schemaSelection : schemaSelections) { + bindSchemaSelection(schemaSelection, repository); } - - - elements = rootElement.elements("table-filter"); - bindTableFilters(elements, repository); - - List tables = rootElement.elements("table"); - bindTables(tables, repository); - } - - static boolean bindManyToOneAndCollection(Element element, String constraintName, OverrideRepository repository) { - - String manyToOneProperty = null; - Boolean excludeManyToOne = null; - - DefaulAssociationInfo associationInfo = null; - DefaulAssociationInfo inverseAssociationInfo = null; - Element manyToOne = element.element("many-to-one"); - if(manyToOne!=null) { - manyToOneProperty = manyToOne.attributeValue("property"); - excludeManyToOne = BooleanValue(manyToOne.attributeValue("exclude")); - associationInfo = extractAssociationInfo(manyToOne); - } - - String collectionProperty = null; - Boolean excludeCollection = null; - Element collection = element.element("set"); - if(collection!=null) { - collectionProperty = collection.attributeValue("property"); - excludeCollection = BooleanValue(collection.attributeValue("exclude")); - inverseAssociationInfo = extractAssociationInfo(collection); - } - - if ( (manyToOne!=null) || (collection!=null) ) { - repository.addForeignKeyInfo(constraintName, manyToOneProperty, excludeManyToOne, collectionProperty, excludeCollection, associationInfo, inverseAssociationInfo); - return true; - } else { - return false; + + private static void bindTypeMappings( + ArrayList typeMappings, + OverrideRepository repository) { + if (typeMappings.size() > 0) { + bindTypeMapping(typeMappings.get(0), repository); } } - private static void bindSchemaSelection(List selection, OverrideRepository repository) { - Iterator iterator = selection.iterator(); - - while ( iterator.hasNext() ) { - Element element = (Element) iterator.next(); - SchemaSelection schemaSelection = new SchemaSelection(); - schemaSelection.setMatchCatalog( element.attributeValue("match-catalog") ); - schemaSelection.setMatchSchema( element.attributeValue("match-schema") ); - schemaSelection.setMatchTable( element.attributeValue("match-table") ); - - repository.addSchemaSelection(schemaSelection); - - } + private static void bindTableFilters( + ArrayList tableFilters, + OverrideRepository repository) { + for (Element element : tableFilters) { + TableFilter tableFilter = new TableFilter(); + tableFilter.setMatchCatalog(getAttribute(element, "match-catalog")); + tableFilter.setMatchSchema(getAttribute(element, "match-schema")); + tableFilter.setMatchName(getAttribute(element, "match-name")); + tableFilter.setExclude(Boolean.valueOf(getAttribute(element, "exclude"))); + tableFilter.setPackage(getAttribute(element, "package")); + MultiValuedMap map = + MetaAttributeHelper.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); + if (map != null && !map.isEmpty()) { + tableFilter.setMetaAttributes(map); + } else { + tableFilter.setMetaAttributes(null); + } + repository.addTableFilter(tableFilter); + } } - - private static void bindTables(List tables, OverrideRepository repository) { - Iterator iterator = tables.iterator(); - while ( iterator.hasNext() ) { - Element element = (Element) iterator.next(); + private static void bindTables( + ArrayList tables, + OverrideRepository repository) { + for (Element element : tables) { Table table = new Table(); - table.setCatalog( element.attributeValue("catalog") ); - table.setSchema( element.attributeValue("schema") ); - table.setName( element.attributeValue("name") ); - - String wantedClassName = element.attributeValue("class"); - - Element primaryKey = element.element("primary-key"); - bindPrimaryKey(primaryKey, table, repository); - List columns = element.elements("column"); - bindColumns(columns, table, repository); - - - List foreignKeys = element.elements("foreign-key"); - bindForeignKeys(foreignKeys, table, repository); - + table.setCatalog(getAttribute(element, "catalog")); + table.setSchema(getAttribute(element, "schema")); + table.setName(getAttribute(element, "name")); + ArrayList primaryKeys = getChildElements(element, "primary-key"); + if (primaryKeys.size() > 0) { + bindPrimaryKey(primaryKeys.get(0), table, repository); + } + bindColumns(getChildElements(element, "column"), table, repository); + bindForeignKeys(getChildElements(element, "foreign-key"), table, repository); bindMetaAttributes(element, table, repository); - - repository.addTable(table,wantedClassName); - - } - - } - - private static void bindMetaAttributes(Element element, Table table, OverrideRepository repository) { - MultiValuedMap map = - MetaAttributeBinder.loadAndMergeMetaMap( - element, - new HashSetValuedHashMap()); - if(map!=null && !map.isEmpty()) { - repository.addMetaAttributeInfo( table, map); - } + repository.addTable(table, getAttribute(element, "class")); + } } - - private static void bindPrimaryKey(Element identifier, Table table, OverrideRepository repository) { - if(identifier==null) return; - - String propertyName = identifier.attributeValue("property"); - String compositeIdName = identifier.attributeValue("id-class"); - - Element element = identifier.element("generator"); - if(element!=null) { - String identifierClass = element.attributeValue("class"); - + + private static void bindPrimaryKey( + Element element, + Table table, + OverrideRepository repository) { + String propertyName = getAttribute(element, "property"); + String compositeIdName = getAttribute(element, "id-class"); + ArrayList generators = getChildElements(element, "generator"); + if (generators.size() > 0) { + Element generator = generators.get(0); + String identifierClass = getAttribute(generator, "class"); Properties params = new Properties(); - Iterator iter = element.elementIterator( "param" ); - while ( iter.hasNext() ) { - Element childNode = (Element) iter.next(); - params.setProperty( childNode.attributeValue( "name" ), childNode.getText() ); + ArrayList parameterList = getChildElements(generator, "param"); + for (int i = 0; i < parameterList.size(); i++) { + Element parameter = parameterList.get(i); + params.setProperty(getAttribute(parameter, "name"), parameter.getTextContent()); } - repository.addTableIdentifierStrategy(table, identifierClass, params); } - - List boundColumnNames = bindColumns(identifier.elements("key-column"), table, repository); - + List boundColumnNames = bindColumns(getChildElements(element, "key-column"), table, repository); repository.addPrimaryKeyNamesForTable(table, boundColumnNames, propertyName, compositeIdName); - } - - private static void bindForeignKeys(List foreignKeys, Table table, OverrideRepository repository) { - Iterator iterator = foreignKeys.iterator(); - - while( iterator.hasNext() ) { - Element element = (Element) iterator.next(); - - String constraintName = element.attributeValue("constraint-name"); - - String foreignTableName = element.attributeValue("foreign-table"); - if(foreignTableName!=null) { + + private static List bindColumns( + ArrayList columns, + Table table, + OverrideRepository repository) { + List columnNames = new ArrayList(); + for (Element element : columns) { + Column column = new Column(); + column.setName(getAttribute(element, "name")); + String attributeValue = getAttribute(element, "jdbc-type"); + if (StringHelper.isNotEmpty(attributeValue)) { + column.setSqlTypeCode(Integer.valueOf(JdbcToHibernateTypeHelper.getJDBCType(attributeValue))); + } + TableIdentifier tableIdentifier = TableIdentifier.create(table); + if (table.getColumn(column) != null) { + throw new MappingException("Column " + column.getName() + " already exists in table " + tableIdentifier ); + } + MultiValuedMap map = + MetaAttributeHelper.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); + if(map!=null && !map.isEmpty()) { + repository.addMetaAttributeInfo( tableIdentifier, column.getName(), map); + } + table.addColumn(column); + columnNames.add(column.getName()); + repository.setTypeNameForColumn( + tableIdentifier, + column.getName(), + getAttribute(element, "type")); + repository.setPropertyNameForColumn( + tableIdentifier, + column.getName(), + getAttribute(element, "property")); + boolean excluded = Boolean.valueOf(element.getAttribute("exclude") ); + if(excluded) { + repository.setExcludedColumn(tableIdentifier, column.getName()); + } + if (element.hasAttribute("foreign-table")) { + String foreignTableName = element.getAttribute("foreign-table"); + List localColumns = new ArrayList(); + localColumns.add(column); + List foreignColumns = new ArrayList(); Table foreignTable = new Table(); foreignTable.setName(foreignTableName); - foreignTable.setCatalog(getValue(element.attributeValue( "foreign-catalog"), table.getCatalog()) ); - foreignTable.setSchema(getValue(element.attributeValue( "foreign-schema"), table.getSchema()) ); - + foreignTable.setCatalog( + element.hasAttribute("foreign-catalog") ? + element.getAttribute("foreign-catalog") : + table.getCatalog()); + foreignTable.setSchema( + element.hasAttribute("foreign-schema") ? + element.getAttribute("foreign-schema") : + table.getSchema()); + if (element.hasAttribute("foreign-column")) { + String foreignColumnName = element.getAttribute("foreign-column"); + Column foreignColumn = new Column(); + foreignColumn.setName(foreignColumnName); + foreignColumns.add(foreignColumn); + } else { + throw new MappingException("foreign-column is required when foreign-table is specified on " + column); + } + ForeignKey key = table.createForeignKey( + null, + localColumns, + foreignTableName, + null, + foreignColumns); + key.setReferencedTable(foreignTable); // only possible if foreignColumns is explicitly specified (workaround on aligncolumns) + } + } + return columnNames; + } + + private static void bindForeignKeys( + ArrayList foreignKeys, + Table table, + OverrideRepository repository) { + for (Element element : foreignKeys) { + String constraintName = getAttribute(element, "constraint-name"); + String foreignTableName = getAttribute(element, "foreign-table"); + if (foreignTableName != null) { + Table foreignTable = new Table(); + foreignTable.setName(foreignTableName); + foreignTable.setCatalog( + element.hasAttribute("foreign-catalog") ? + element.getAttribute("foreign-catalog") : + table.getCatalog()); + foreignTable.setSchema( + element.hasAttribute("foreign-schema") ? + element.getAttribute("foreign-schema") : + table.getSchema()); List localColumns = new ArrayList(); List foreignColumns = new ArrayList(); - - Iterator columnRefs = element.elements("column-ref").iterator(); - while ( columnRefs.hasNext() ) { - Element columnRef = (Element) columnRefs.next(); - String localColumnName = columnRef.attributeValue("local-column"); - String foreignColumnName = columnRef.attributeValue("foreign-column"); - - Column localColumn = new Column(localColumnName); - Column foreignColumn = new Column(foreignColumnName); - - localColumns.add(localColumn); - foreignColumns.add(foreignColumn); + ArrayList columnRefs = getChildElements(element, "column-ref"); + for (Element columnRef : columnRefs) { + localColumns.add(new Column(columnRef.getAttribute("local-column"))); + foreignColumns.add(new Column(columnRef.getAttribute("foreign-column"))); } - - ForeignKey key = table.createForeignKey(constraintName, localColumns, foreignTableName, null, foreignColumns); + ForeignKey key = table.createForeignKey( + constraintName, + localColumns, + foreignTableName, + null, + foreignColumns); key.setReferencedTable(foreignTable); // only possible if foreignColumns is explicitly specified (workaround on aligncolumns) } - - if(StringHelper.isNotEmpty(constraintName)) { - if (!validateFkAssociations(element)) + if (StringHelper.isNotEmpty(constraintName)) { + if (!validateFkAssociations(element)) { throw new IllegalArgumentException("you can't mix or with <(inverse-)one-to-one/> "); - - if(!bindManyToOneAndCollection(element, constraintName, repository)) { + } + if (!bindManyToOneAndCollection(element, constraintName, repository)) { bindOneToOne(element, constraintName, repository); - } + } } + } - } - + private static void bindOneToOne(Element element, String constraintName, OverrideRepository repository) { String oneToOneProperty = null; Boolean excludeOneToOne = null; - Element oneToOne = element.element("one-to-one"); - DefaulAssociationInfo associationInfo = null; - if(oneToOne!=null) { - oneToOneProperty = oneToOne.attributeValue("property"); - excludeOneToOne = BooleanValue(oneToOne.attributeValue("exclude")); + ArrayList oneToOnes = getChildElements(element, "one-to-one"); + Element oneToOne = null; + AssociationInfo associationInfo = null; + if(oneToOnes.size() > 0) { + oneToOne = oneToOnes.get(0); + oneToOneProperty = getAttribute(oneToOne, "property"); + excludeOneToOne = Boolean.valueOf(oneToOne.getAttribute("exclude")); associationInfo = extractAssociationInfo(oneToOne); } String inverseOneToOneProperty = null; Boolean excludeInverseOneToOne = null; - Element inverseOneToOne = element.element("inverse-one-to-one"); - DefaulAssociationInfo inverseAssociationInfo = null; - if(inverseOneToOne!=null) { - inverseOneToOneProperty = inverseOneToOne.attributeValue("property"); - excludeInverseOneToOne = BooleanValue(inverseOneToOne.attributeValue("exclude")); + ArrayList inverseOneToOnes = getChildElements(element, "inverse-one-to-one"); + Element inverseOneToOne = null; + AssociationInfo inverseAssociationInfo = null; + if(inverseOneToOnes.size() > 0) { + inverseOneToOne = inverseOneToOnes.get(0); + inverseOneToOneProperty = getAttribute(inverseOneToOne, "property"); + excludeInverseOneToOne = Boolean.valueOf(inverseOneToOne.getAttribute("exclude")); inverseAssociationInfo = extractAssociationInfo(inverseOneToOne); - } - + } // having oneToOne = null and inverseOneToOne != null doesn't make sense - // we cannot have the inverse side without the owning side in this case - + // we cannot have the inverse side without the owning side in this case if ( (oneToOne!=null) ) { - repository.addForeignKeyInfo(constraintName, oneToOneProperty, excludeOneToOne, inverseOneToOneProperty, excludeInverseOneToOne, associationInfo, inverseAssociationInfo); + repository.addForeignKeyInfo( + constraintName, + oneToOneProperty, + excludeOneToOne, + inverseOneToOneProperty, + excludeInverseOneToOne, + associationInfo, + inverseAssociationInfo); } } - private static DefaulAssociationInfo extractAssociationInfo(Element manyToOne) { - String attributeValue = manyToOne.attributeValue("cascade"); - DefaulAssociationInfo associationInfo = null; - if(attributeValue!=null) { - associationInfo = ensureInit(associationInfo); - associationInfo.setCascade(attributeValue); + private static boolean bindManyToOneAndCollection( + Element element, + String constraintName, + OverrideRepository repository) { + String manyToOneProperty = null; + Boolean excludeManyToOne = null; + AssociationInfo associationInfo = null; + AssociationInfo inverseAssociationInfo = null; + ArrayList manyToOnes = getChildElements(element, "many-to-one"); + Element manyToOne = null; + if (manyToOnes.size() > 0) { + manyToOne = manyToOnes.get(0); + manyToOneProperty = getAttribute(manyToOne, "property"); + excludeManyToOne = Boolean.valueOf(manyToOne.getAttribute("exclude")); + associationInfo = extractAssociationInfo(manyToOne); } - - - attributeValue = manyToOne.attributeValue("fetch"); - if(attributeValue!=null) { - associationInfo = ensureInit(associationInfo); - associationInfo.setFetch(attributeValue); - } - - - attributeValue = manyToOne.attributeValue("insert"); - if(attributeValue!=null) { - associationInfo = ensureInit(associationInfo); - associationInfo.setInsert(new Boolean(attributeValue)); - } - - - attributeValue = manyToOne.attributeValue("update"); - if(attributeValue!=null) { - associationInfo = ensureInit(associationInfo); - associationInfo.setUpdate(new Boolean(attributeValue)); + String collectionProperty = null; + Boolean excludeCollection = null; + ArrayList sets = getChildElements(element, "set"); + Element set = null; + if (sets.size() > 0) { + set = sets.get(0); + collectionProperty = getAttribute(set, "property"); + excludeCollection = Boolean.valueOf(set.getAttribute("exclude")); + inverseAssociationInfo = extractAssociationInfo(set); + } + if ( (manyToOne!=null) || (set!=null) ) { + repository.addForeignKeyInfo( + constraintName, + manyToOneProperty, + excludeManyToOne, + collectionProperty, + excludeCollection, + associationInfo, + inverseAssociationInfo); + return true; + } else { + return false; } - return associationInfo; } - - private static DefaulAssociationInfo ensureInit( - DefaulAssociationInfo associationInfo) { - return associationInfo==null?new DefaulAssociationInfo():associationInfo; + + private static AssociationInfo extractAssociationInfo(Element manyToOne) { + return RevengUtils.createAssociationInfo( + manyToOne.hasAttribute("cascade") ? manyToOne.getAttribute("cascade") : null, + manyToOne.hasAttribute("fetch") ? manyToOne.getAttribute("fetch") : null, + manyToOne.hasAttribute("insert") ? + Boolean.parseBoolean(manyToOne.getAttribute("insert")) : null, + manyToOne.hasAttribute("update") ? + Boolean.parseBoolean(manyToOne.getAttribute("update")) : null); } private static boolean validateFkAssociations(Element element){ - Element manyToOne = element.element("many-to-one"); - Element oneToOne = element.element("one-to-one"); - Element set = element.element("set"); - Element inverseOneToOne = element.element("inverse-one-to-one"); - - if((manyToOne != null) && ( (oneToOne != null) || (inverseOneToOne != null))) { + ArrayList manyToOnes = getChildElements(element, "many-to-one"); + ArrayList oneToOnes = getChildElements(element, "one-to-one"); + ArrayList sets = getChildElements(element, "set"); + ArrayList inverseOneToOnes = getChildElements(element, "inverse-one-to-one"); + if (manyToOnes.size() != 0 && + (oneToOnes.size() != 0 || inverseOneToOnes.size() != 0)) { return false; - } - - if((oneToOne != null) && (set != null)) { + if (oneToOnes.size() != 0 && sets.size() != 0) { return false; } - - if ((inverseOneToOne != null) && (set != null)) { + if (inverseOneToOnes.size() != 0 && sets.size() != 0) { return false; } - return true; } - private static Boolean BooleanValue(String string) { - if(string==null) return null; - return Boolean.valueOf(string); - } - - private static String getValue(String first, String second) { - if(first==null) { - return second; - } else { - return first; - } + private static void bindMetaAttributes( + Element element, + Table table, + OverrideRepository repository) { + MultiValuedMap map = + MetaAttributeHelper.loadAndMergeMetaMap( + element, + new HashSetValuedHashMap()); + if(map!=null && !map.isEmpty()) { + repository.addMetaAttributeInfo( table, map); + } } - - private static List bindColumns(List columns, Table table, OverrideRepository repository) { - Iterator iterator = columns.iterator(); - List columnNames = new ArrayList(); - while( iterator.hasNext() ) { - Element element = (Element) iterator.next(); - Column column = new Column(); - column.setName( element.attributeValue("name") ); - String attributeValue = element.attributeValue("jdbc-type"); - if(StringHelper.isNotEmpty(attributeValue)) { - column.setSqlTypeCode(new Integer(JDBCToHibernateTypeHelper.getJDBCType(attributeValue))); - } - - TableIdentifier tableIdentifier = TableIdentifier.create(table); - if(table.getColumn(column)!=null) { - throw new MappingException("Column " + column.getName() + " already exists in table " + tableIdentifier ); - } - - MultiValuedMap map = - MetaAttributeBinder.loadAndMergeMetaMap( - element, - new HashSetValuedHashMap()); - if(map!=null && !map.isEmpty()) { - repository.addMetaAttributeInfo( tableIdentifier, column.getName(), map); - } - - table.addColumn(column); - columnNames.add(column.getName()); - repository.setTypeNameForColumn(tableIdentifier, column.getName(), element.attributeValue("type")); - repository.setPropertyNameForColumn(tableIdentifier, column.getName(), element.attributeValue("property")); - - boolean excluded = booleanValue( element.attributeValue("exclude") ); - if(excluded) { - repository.setExcludedColumn(tableIdentifier, column.getName()); - } - - String foreignTableName = element.attributeValue("foreign-table"); - if(foreignTableName!=null) { - List localColumns = new ArrayList(); - localColumns.add(column); - List foreignColumns = new ArrayList(); - - Table foreignTable = new Table(); - foreignTable.setName(foreignTableName); - foreignTable.setCatalog(getValue(element.attributeValue( "foreign-catalog"),table.getCatalog()) ); - foreignTable.setSchema(getValue(element.attributeValue( "foreign-schema"), table.getSchema()) ); - - String foreignColumnName = element.attributeValue("foreign-column"); - if(foreignColumnName!=null) { - Column foreignColumn = new Column(); - foreignColumn.setName(foreignColumnName); - foreignColumns.add(foreignColumn); - } - else { - throw new MappingException("foreign-column is required when foreign-table is specified on " + column); - } - - ForeignKey key = table.createForeignKey(null, localColumns, foreignTableName, null, foreignColumns); - key.setReferencedTable(foreignTable); // only possible if foreignColumns is explicitly specified (workaround on aligncolumns) - } - - - - } - return columnNames; - } - - private static boolean booleanValue(String value) { - return Boolean.valueOf(value).booleanValue(); + private static void bindSchemaSelection( + Element schemaSelectionElement, + OverrideRepository repository) { + repository.addSchemaSelection( + new SchemaSelection() { + @Override + public String getMatchCatalog() { + return getAttribute(schemaSelectionElement, "match-catalog"); + } + @Override + public String getMatchSchema() { + return getAttribute(schemaSelectionElement, "match-schema"); + } + @Override + public String getMatchTable() { + return getAttribute(schemaSelectionElement, "match-table"); + } + + }); } - - private static void bindTableFilters(List filters, OverrideRepository respository) { - Iterator iterator = filters.iterator(); - - while(iterator.hasNext() ) { - Element element = (Element) iterator.next(); - TableFilter filter = new TableFilter(); - filter.setMatchCatalog(element.attributeValue("match-catalog") ); - filter.setMatchSchema(element.attributeValue("match-schema") ); - filter.setMatchName(element.attributeValue("match-name") ); - filter.setExclude(Boolean.valueOf(element.attributeValue("exclude") ) ); - filter.setPackage(element.attributeValue("package") ); - - MultiValuedMap map = - MetaAttributeBinder.loadAndMergeMetaMap( - element, - new HashSetValuedHashMap()); - if(map!=null && !map.isEmpty()) { - filter.setMetaAttributes( map ); - } else { - filter.setMetaAttributes( null ); - } - respository.addTableFilter(filter); + + private static void bindTypeMapping( + Element typeMapping, + OverrideRepository repository) { + ArrayList sqlTypes = getChildElements(typeMapping, "sql-type"); + for (int i = 0; i < sqlTypes.size(); i++) { + bindSqlType(sqlTypes.get(i), repository); } - } - - private static void bindTypeMappings(Element typeMapping, OverrideRepository repository) { - Iterator iterator = typeMapping.elements("sql-type").iterator(); - - while (iterator.hasNext() ) { - Element element = (Element) iterator.next(); - int jdbcType = JDBCToHibernateTypeHelper.getJDBCType(element.attributeValue("jdbc-type") ); - SQLTypeMapping mapping = new SQLTypeMapping(jdbcType ); - mapping.setHibernateType( getHibernateType( element ) ); - mapping.setLength(getInteger(element.attributeValue("length"), SQLTypeMapping.UNKNOWN_LENGTH) ); - mapping.setPrecision(getInteger(element.attributeValue("precision"), SQLTypeMapping.UNKNOWN_PRECISION) ); - mapping.setScale(getInteger(element.attributeValue("scale"), SQLTypeMapping.UNKNOWN_SCALE) ); - String notNull = element.attributeValue("not-null"); - if(notNull==null) { - mapping.setNullable(null); - } else { - boolean nullable = notNull.equals( "false" ); - mapping.setNullable( Boolean.valueOf(nullable) ); - } - - if(StringHelper.isEmpty(mapping.getHibernateType())) { - throw new MappingException("No hibernate-type specified for " + element.attributeValue("jdbc-type") + " at " + element.getUniquePath()); - } - repository.addTypeMapping(mapping); + + private static void bindSqlType(Element sqlType, OverrideRepository repository) { + int jdbcType = JdbcToHibernateTypeHelper.getJDBCType( + getAttribute(sqlType, "jdbc-type")); + SQLTypeMapping sqlTypeMapping = new SQLTypeMapping(jdbcType); + sqlTypeMapping.setHibernateType(getHibernateType(sqlType)); + sqlTypeMapping.setLength(getInteger( + getAttribute(sqlType, "length"), + SQLTypeMapping.UNKNOWN_LENGTH)); + sqlTypeMapping.setPrecision(getInteger( + getAttribute(sqlType, "precision"), + SQLTypeMapping.UNKNOWN_PRECISION)); + sqlTypeMapping.setScale(getInteger( + getAttribute(sqlType, "scale"), + SQLTypeMapping.UNKNOWN_SCALE)); + String notNull = getAttribute(sqlType, "not-null"); + if (StringHelper.isEmpty(notNull)) { + sqlTypeMapping.setNullable(null); + } else { + sqlTypeMapping.setNullable(notNull.equals("false")); } - + if (StringHelper.isEmpty(sqlTypeMapping.getHibernateType())) { + throw new MappingException( + "No hibernate-type specified for " + + sqlType.getAttribute("jdbc-type") + + " at " + + sqlType.getTagName()); + } + repository.addTypeMapping(sqlTypeMapping); } - + private static String getHibernateType(Element element) { - String attributeValue = element.attributeValue("hibernate-type"); - + String attributeValue = getAttribute(element, "hibernate-type"); if(StringHelper.isEmpty(attributeValue)) { - Element child = element.element("hibernate-type"); - if(child==null) { - return null; + ArrayList hibernateTypes = getChildElements(element, "hibernate-type"); + if (hibernateTypes.size() > 0) { + Element hibernateType = hibernateTypes.get(0); + if (hibernateType.hasAttribute("name")) { + return hibernateType.getAttribute("name"); + } } else { - return child.attributeValue("name"); + return null; } - } - return attributeValue; } - + private static int getInteger(String string, int defaultValue) { if(string==null) { return defaultValue; @@ -454,11 +432,27 @@ private static int getInteger(String string, int defaultValue) { return Integer.parseInt(string); } } - - String getMatchString(String input) { - return input.toUpperCase(); + + private static ArrayList getChildElements(Element parent, String tagName) { + ArrayList result = new ArrayList(); + NodeList nodeList = parent.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + Node node = nodeList.item(i); + if (node instanceof Element) { + if (tagName.equals(((Element)node).getTagName())) { + result.add((Element)node); + } + } + } + return result; } - + private static String getAttribute(Element element, String attributeName) { + String result = null; + if (element.hasAttribute(attributeName)) { + result = element.getAttribute(attributeName); + } + return result; + } } diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java index f8ea2d538e..b729a6637e 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java @@ -14,10 +14,14 @@ import java.util.Properties; import java.util.Set; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + import org.apache.commons.collections4.MapIterator; import org.apache.commons.collections4.MultiValuedMap; -import org.dom4j.Document; import org.hibernate.MappingException; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper.SimpleMetaAttribute; import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.xml.ErrorLogger; import org.hibernate.mapping.Column; @@ -25,9 +29,8 @@ import org.hibernate.mapping.MetaAttribute; import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; -import org.hibernate.tool.xml.XMLHelper; import org.jboss.logging.Logger; -import org.xml.sax.InputSource; +import org.w3c.dom.Document; public class OverrideRepository { @@ -140,9 +143,12 @@ public OverrideRepository addResource(String path) throws MappingException { public OverrideRepository addInputStream(InputStream xmlInputStream) throws MappingException { try { ErrorLogger errorLogger = new ErrorLogger( "XML InputStream" ); - org.dom4j.Document doc = XMLHelper.createSAXReader( errorLogger).read( new InputSource( xmlInputStream ) ); + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db = dbf.newDocumentBuilder(); + db.setErrorHandler(errorLogger); + Document document = db.parse(xmlInputStream); if ( errorLogger.hasErrors() ) throw new MappingException( "invalid override definition", ( Throwable ) errorLogger.getErrors().get( 0 ) ); - add( doc ); + add( document ); return this; } catch ( MappingException me ) { @@ -162,6 +168,7 @@ public OverrideRepository addInputStream(InputStream xmlInputStream) throws Mapp } } + private OverrideRepository add(Document doc) { OverrideBinder.bindRoot(this, doc); return this; @@ -555,7 +562,7 @@ private Map toMetaAttributes(MultiValuedMap iter = mvm.mapIterator(); iter.hasNext();) { String key = iter.next(); Collection values = mvm.get(key); - result.put(key, MetaAttributeBinder.toRealMetaAttribute(key, values)); + result.put(key, MetaAttributeHelper.toRealMetaAttribute(key, values)); } return result; } diff --git a/main/src/main/java/org/hibernate/cfg/reveng/SimpleMetaAttribute.java b/main/src/main/java/org/hibernate/cfg/reveng/SimpleMetaAttribute.java deleted file mode 100644 index a5d6e00d68..0000000000 --- a/main/src/main/java/org/hibernate/cfg/reveng/SimpleMetaAttribute.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.hibernate.cfg.reveng; - -public class SimpleMetaAttribute { - String value; - boolean inheritable = true; - - public SimpleMetaAttribute(String value, boolean inherit) { - this.value = value; - this.inheritable = inherit; - } - - public String toString() { - return value; - } - -} - diff --git a/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java b/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java index 0d612253d3..55fce363ca 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/TableFilter.java @@ -1,6 +1,7 @@ package org.hibernate.cfg.reveng; import org.apache.commons.collections4.MultiValuedMap; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper.SimpleMetaAttribute; /** diff --git a/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java b/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java new file mode 100644 index 0000000000..cca86a6029 --- /dev/null +++ b/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java @@ -0,0 +1,199 @@ +package org.hibernate.cfg.reveng.utils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.sql.SQLException; +import java.sql.Types; +import java.util.HashMap; +import java.util.Map; + +import org.hibernate.MappingException; + + +/** + * Utility class for mapping between sqltypes and hibernate type names. + * + * @author max (based on parts from Sql2Java from Middlegen) + * + */ +public final class JdbcToHibernateTypeHelper { + + private JdbcToHibernateTypeHelper() { + + } + + /** The Map containing the preferred conversion type values. */ + private static final Map PREFERRED_HIBERNATETYPE_FOR_SQLTYPE = new HashMap(); + + static { + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.TINYINT), new String[] { "byte", Byte.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.SMALLINT), new String[] { "short", Short.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.INTEGER), new String[] { "int", Integer.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.BIGINT), new String[] { "long", Long.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.REAL), new String[] { "float", Float.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.FLOAT), new String[] { "double", Double.class.getName()} ); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.DOUBLE), new String[] { "double", Double.class.getName()}); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.DECIMAL), new String[] { "big_decimal", "big_decimal" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.NUMERIC), new String[] { "big_decimal", "big_decimal" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.BIT), new String[] { "boolean", Boolean.class.getName()}); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.BOOLEAN), new String[] { "boolean", Boolean.class.getName()}); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.CHAR), new String[] { "char", Character.class.getName()}); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.VARCHAR), new String[] { "string", "string" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.LONGVARCHAR), new String[] { "string", "string" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.BINARY), new String[] { "binary", "binary" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.VARBINARY), new String[] { "binary", "binary" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.LONGVARBINARY), new String[] { "binary", "binary" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.DATE), new String[] { "date", "date" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.TIME), new String[] { "time", "time" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.TIMESTAMP), new String[] { "timestamp", "timestamp" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.CLOB), new String[] { "clob", "clob" }); + PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(Integer.valueOf(Types.BLOB), new String[] { "blob", "blob" }); + + //Hibernate does not have any built-in Type for these: + //preferredJavaTypeForSqlType.put(new Integer(Types.ARRAY), "java.sql.Array"); + //preferredJavaTypeForSqlType.put(new Integer(Types.REF), "java.sql.Ref"); + //preferredJavaTypeForSqlType.put(new Integer(Types.STRUCT), "java.lang.Object"); + //preferredJavaTypeForSqlType.put(new Integer(Types.JAVA_OBJECT), "java.lang.Object"); + } + + /* (non-Javadoc) + * @see org.hibernate.cfg.JDBCTypeToHibernateTypesStrategy#getPreferredHibernateType(int, int, int, int) + */ + public static String getPreferredHibernateType(int sqlType, int size, int precision, int scale, boolean nullable, boolean generatedIdentifier) { + boolean returnNullable = nullable || generatedIdentifier; + if ( (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) && scale <= 0) { // <= + if (precision == 1) { + // NUMERIC(1) is a often used idiom for storing boolean thus providing it out of the box. + return returnNullable?Boolean.class.getName():"boolean"; + } + else if (precision < 3) { + return returnNullable?Byte.class.getName():"byte"; + } + else if (precision < 5) { + return returnNullable?Short.class.getName():"short"; + } + else if (precision < 10) { + return returnNullable?Integer.class.getName():"int"; + } + else if (precision < 19) { + return returnNullable?Long.class.getName():"long"; + } + else { + return "big_integer"; + } + } + + if ( sqlType == Types.CHAR && size>1 ) { + return "string"; + } + + String[] result = (String[]) PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.get(Integer.valueOf(sqlType) ); + + if(result==null) { + return null; + } else if(returnNullable) { + return result[1]; + } else { + return result[0]; + } + } + + static Map jdbcTypes; // Name to value + static Map jdbcTypeValues; // value to Name + + public static String[] getJDBCTypes() { + checkTypes(); + + return (String[]) jdbcTypes.keySet().toArray(new String[jdbcTypes.size()]); + } + + public static int getJDBCType(String value) { + checkTypes(); + + Integer number = (Integer) jdbcTypes.get(value); + + if(number==null) { + try { + return Integer.parseInt(value); + } + catch (NumberFormatException nfe) { + throw new MappingException("jdbc-type: " + value + " is not a known JDBC Type nor a valid number"); + } + } + else { + return number.intValue(); + } + } + + private static void checkTypes() { + if(jdbcTypes==null) { + jdbcTypes = new HashMap(); + Field[] fields = Types.class.getFields(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + if(Modifier.isStatic(field.getModifiers() ) ) { + try { + jdbcTypes.put(field.getName(), (Integer)field.get(Types.class) ); + } + catch (IllegalArgumentException e) { + // ignore + } + catch (IllegalAccessException e) { + // ignore + } + } + } + } + } + + public static String getJDBCTypeName(int value) { + if(jdbcTypeValues==null) { + jdbcTypeValues = new HashMap(); + Field[] fields = Types.class.getFields(); + for (int i = 0; i < fields.length; i++) { + Field field = fields[i]; + if(Modifier.isStatic(field.getModifiers() ) ) { + try { + jdbcTypeValues.put((Integer)field.get(Types.class), field.getName() ); + } + catch (IllegalArgumentException e) { + // ignore + } + catch (IllegalAccessException e) { + // ignore + } + } + } + } + + String name = (String) jdbcTypeValues.get(Integer.valueOf(value) ); + + if(name!=null) { + return name; + } + else { + return ""+value; + } + } + + /** + * @param table + * @param schema + * @param catalog + * @throws SQLException + */ + + // scale and precision have numeric column + public static boolean typeHasScaleAndPrecision(int sqlType) { + return (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC + || sqlType == Types.REAL || sqlType == Types.FLOAT || sqlType == Types.DOUBLE); + } + + // length is for string column + public static boolean typeHasLength(int sqlType) { + return (sqlType == Types.CHAR || sqlType == Types.DATE + || sqlType == Types.LONGVARCHAR || sqlType == Types.TIME || sqlType == Types.TIMESTAMP + || sqlType == Types.VARCHAR ); + } +} + diff --git a/main/src/main/java/org/hibernate/cfg/reveng/utils/MetaAttributeHelper.java b/main/src/main/java/org/hibernate/cfg/reveng/utils/MetaAttributeHelper.java new file mode 100644 index 0000000000..4f8fb0ad41 --- /dev/null +++ b/main/src/main/java/org/hibernate/cfg/reveng/utils/MetaAttributeHelper.java @@ -0,0 +1,131 @@ +package org.hibernate.cfg.reveng.utils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.multimap.HashSetValuedHashMap; +import org.hibernate.mapping.MetaAttribute; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class MetaAttributeHelper { + + public static MetaAttribute toRealMetaAttribute(String name, Collection values) { + MetaAttribute attribute = new MetaAttribute(name); + for (Iterator iter = values.iterator(); iter.hasNext();) { + SimpleMetaAttribute element = (SimpleMetaAttribute) iter.next(); + attribute.addValue(element.value); + } + + return attribute; + } + + + public static MultiValuedMap loadAndMergeMetaMap( + Element classElement, + MultiValuedMap inheritedMeta) { + return MetaAttributeHelper.mergeMetaMaps( + loadMetaMap(classElement), + inheritedMeta); + } + + public static MultiValuedMap loadMetaMap(Element element) { + MultiValuedMap result = new HashSetValuedHashMap(); + List metaAttributeList = new ArrayList(); + ArrayList metaNodes = getChildElements(element, "meta"); + for (Element metaNode : metaNodes) { + metaAttributeList.add(metaNode); + } + for (Iterator iter = metaAttributeList.iterator(); iter.hasNext();) { + Element metaAttribute = iter.next(); + String attribute = metaAttribute.getAttribute("attribute"); + String value = metaAttribute.getTextContent(); + String inheritStr= null; + if (metaAttribute.hasAttribute("inherit")) { + inheritStr = metaAttribute.getAttribute("inherit"); + } + boolean inherit = true; + if(inheritStr!=null) { + inherit = Boolean.valueOf(inheritStr).booleanValue(); + } + SimpleMetaAttribute ma = new SimpleMetaAttribute(value, inherit); + result.put(attribute, ma); + } + return result; + } + + /** + * Merges a Multimap with inherited maps. + * Values specified always overrules/replaces the inherited values. + * + * @param specific + * @param general + * @return a MultiMap with all values from local and extra values + * from inherited + */ + private static MultiValuedMap mergeMetaMaps( + MultiValuedMap specific, + MultiValuedMap general) { + MultiValuedMap result = new HashSetValuedHashMap(); + copyMultiMap(result, specific); + if (general != null) { + for (Iterator iter = general.keySet().iterator();iter.hasNext();) { + String key = iter.next(); + if (!specific.containsKey(key) ) { + // inheriting a meta attribute only if it is inheritable + Collection ml = general.get(key); + for (Iterator iterator = ml.iterator(); iterator.hasNext();) { + SimpleMetaAttribute element = iterator.next(); + if (element.inheritable) { + result.put(key, element); + } + } + } + } + } + + return result; + + } + + private static void copyMultiMap( + MultiValuedMap destination, + MultiValuedMap specific) { + for (Iterator keyIterator = specific.keySet().iterator(); keyIterator.hasNext(); ) { + String key = keyIterator.next(); + Collection c = specific.get(key); + for (Iterator valueIterator = c.iterator(); valueIterator.hasNext(); ) + destination.put(key, valueIterator.next() ); + } + } + + private static ArrayList getChildElements(Element parent, String tagName) { + ArrayList result = new ArrayList(); + NodeList nodeList = parent.getChildNodes(); + for (int i = 0; i < nodeList.getLength(); i++) { + Node node = nodeList.item(i); + if (node instanceof Element) { + if (tagName.equals(((Element)node).getTagName())) { + result.add((Element)node); + } + } + } + return result; + } + + public static class SimpleMetaAttribute { + String value; + boolean inheritable = true; + public SimpleMetaAttribute(String value, boolean inherit) { + this.value = value; + this.inheritable = inherit; + } + public String toString() { + return value; + } + } +} diff --git a/main/src/main/java/org/hibernate/cfg/reveng/utils/RevengUtils.java b/main/src/main/java/org/hibernate/cfg/reveng/utils/RevengUtils.java new file mode 100644 index 0000000000..0903bf9b07 --- /dev/null +++ b/main/src/main/java/org/hibernate/cfg/reveng/utils/RevengUtils.java @@ -0,0 +1,32 @@ +package org.hibernate.cfg.reveng.utils; + +import org.hibernate.cfg.reveng.AssociationInfo; + +public class RevengUtils { + + public static AssociationInfo createAssociationInfo( + String cascade, + String fetch, + Boolean insert, + Boolean update) { + return new AssociationInfo() { + @Override + public String getCascade() { + return cascade; + } + @Override + public String getFetch() { + return fetch; + } + @Override + public Boolean getUpdate() { + return update; + } + @Override + public Boolean getInsert() { + return insert; + } + + }; + } +} diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java index 2622310ea7..4567c4ee2c 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/MetaAttributeHelper.java @@ -4,7 +4,7 @@ import java.util.Iterator; import org.apache.commons.collections4.MultiValuedMap; -import org.hibernate.cfg.reveng.SimpleMetaAttribute; +import org.hibernate.cfg.reveng.utils.MetaAttributeHelper.SimpleMetaAttribute; import org.hibernate.mapping.MetaAttribute; /** diff --git a/main/src/main/java/org/hibernate/tool/xml/XMLHelper.java b/main/src/main/java/org/hibernate/tool/xml/XMLHelper.java deleted file mode 100644 index 1813f26068..0000000000 --- a/main/src/main/java/org/hibernate/tool/xml/XMLHelper.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Hibernate, Relational Persistence for Idiomatic Java - * - * Copyright (c) 2010, Red Hat Inc. or third-party contributors as - * indicated by the @author tags or express copyright attribution - * statements applied by the authors. All third-party contributions are - * distributed under license by Red Hat Inc. - * - * This copyrighted material is made available to anyone wishing to use, modify, - * copy, or redistribute it subject to the terms and conditions of the GNU - * Lesser General Public License, as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this distribution; if not, write to: - * Free Software Foundation, Inc. - * 51 Franklin Street, Fifth Floor - * Boston, MA 02110-1301 USA - */ -package org.hibernate.tool.xml; - -import org.dom4j.io.SAXReader; -import org.xml.sax.ErrorHandler; - -public final class XMLHelper { - - public static SAXReader createSAXReader(ErrorHandler errorHandler) { - SAXReader saxReader = resolveSAXReader(); - saxReader.setErrorHandler( errorHandler ); - return saxReader; - } - - private static SAXReader resolveSAXReader() { - SAXReader saxReader = new SAXReader(); - saxReader.setMergeAdjacentText( true ); - saxReader.setValidation( true ); - return saxReader; - } - -} From 8cde536f69b4e0be63b5bd4dcd2973e02dcc9f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Thu, 10 Jun 2021 08:54:03 +0200 Subject: [PATCH 192/454] Configure Hibernate GitHub bot and pull request template See https://github.com/hibernate/hibernate-github-bot --- .github/PULL_REQUEST_TEMPLATE.md | 5 +++++ .github/hibernate-github-bot.yml | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/hibernate-github-bot.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..5fe6eaef67 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ +Please delete this text, and add a link to the Jira issue solved by this PR; +see https://hibernate.atlassian.net/browse/HBX. + +Remember to prepend the title of this PR, as well as all commit messages, +with the key of the Jira issue (`HBX-`). diff --git a/.github/hibernate-github-bot.yml b/.github/hibernate-github-bot.yml new file mode 100644 index 0000000000..01c56ba41d --- /dev/null +++ b/.github/hibernate-github-bot.yml @@ -0,0 +1,3 @@ +--- +jira: + projectKey: "HBX" From bf17d8ac8658793a48d831c5beba77a7506349b2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 22 Jul 2021 09:05:44 +0200 Subject: [PATCH 193/454] HBX-2098: Update Hibernate ORM Dependency to Version 5.3.21.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ceff882468..e1e1e9abd8 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.20.Final + 5.3.21.Final 2.5.2 8.0.1 1.2.0 From 9e5a7c785116d75062fb3e6e8537c4d7ee499a2f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 22 Jul 2021 09:37:40 +0200 Subject: [PATCH 194/454] HBX-2099: Update version identifier to 5.3.21.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index f5d29e3258..24a6c6a7d6 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 02fca4936a..f1a9343dfb 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.21-SNAPSHOT"; + public static final String VERSION = "5.3.21.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 26f033beab..ffc998583d 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e1e1e9abd8..9a48a6815d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.21-SNAPSHOT + 5.3.21.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index b6c7762d42..da0e1a6ed4 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 311b597750..9007325afb 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 563503bd58..1f9f8a033d 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index d0d7aeaef0..b38cea7220 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 5580376637..ef488e6478 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 18648c7c41..7d262f6c00 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 4be1d2c90f..b0f568d654 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c5341dcb01..b40518712b 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 8313e80790..f4661f5a8c 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 06ae19bfd5..fb24c4411f 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21-SNAPSHOT + 5.3.21.Final hibernate-tools-tests-utils From e5861e426872bef1a5ffde1d21d8937035027690 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 23 Jul 2021 11:38:30 +0200 Subject: [PATCH 195/454] HBX-2191: Update version identifier to 5.3.22-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 24a6c6a7d6..afaca6de22 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f1a9343dfb..2213278dcd 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.21.Final"; + public static final String VERSION = "5.3.22-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index ffc998583d..bc3c9e9964 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 9a48a6815d..19513af5fb 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.21.Final + 5.3.22-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index da0e1a6ed4..8652a14911 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 9007325afb..05e1811a49 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 1f9f8a033d..1b38afab73 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index b38cea7220..e5d071a6fe 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ef488e6478..69c7d98ea5 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 7d262f6c00..bf17b08e90 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index b0f568d654..03077c61dd 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index b40518712b..0eb17b5ca1 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index f4661f5a8c..2db0055768 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index fb24c4411f..bfe518795a 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.21.Final + 5.3.22-SNAPSHOT hibernate-tools-tests-utils From 2848aa5016216202f7c1fac1d51756ef95f9798e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 12 Aug 2021 17:36:46 +0200 Subject: [PATCH 196/454] HBX-2200: Increment Apache Ant dependency to version 1.10.11 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19513af5fb..141481a208 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.10 + 1.10.11 4.4 2.3.31 From 06bd442ed4da4982afd65f24f7817e43c07a3c9c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 25 Aug 2021 11:10:12 +0300 Subject: [PATCH 197/454] HBX-2192: Update Hibernate Core dependency to version 5.3.22.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 141481a208..eb2ee3c2e5 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.21.Final + 5.3.22.Final 2.5.2 8.0.1 1.2.0 From 25459d7ca3f40bc3c41dd59df00bfa3688b09ece Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 26 Aug 2021 09:55:58 +0300 Subject: [PATCH 198/454] HBX-2193: Update version identifier to 5.3.22.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index afaca6de22..94797a2bf1 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 2213278dcd..240579b95c 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.22-SNAPSHOT"; + public static final String VERSION = "5.3.22.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index bc3c9e9964..bd0ac0c259 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index eb2ee3c2e5..e0761475a2 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.22-SNAPSHOT + 5.3.22.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 8652a14911..613c510520 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 05e1811a49..972c6ca093 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 1b38afab73..0e5e9079ba 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index e5d071a6fe..3eccc457da 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 69c7d98ea5..de4af5635c 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index bf17b08e90..1575b20766 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 03077c61dd..5e01fdd3fc 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 0eb17b5ca1..2f5169ea0c 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 2db0055768..b207b3e388 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index bfe518795a..13383cf028 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22-SNAPSHOT + 5.3.22.Final hibernate-tools-tests-utils From ec69e9d04ef3dc9eb84b3defb3ca4ca2ec212f29 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 1 Sep 2021 11:02:16 +0200 Subject: [PATCH 199/454] HBX-2208: Update version identifier to 5.3.23-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 94797a2bf1..e0ab2744d0 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 240579b95c..59e0e4acc2 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.22.Final"; + public static final String VERSION = "5.3.23-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index bd0ac0c259..4f7176d444 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e0761475a2..c4b97bec67 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.22.Final + 5.3.23-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 613c510520..40bbfb2b14 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 972c6ca093..38dfdcdf69 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 0e5e9079ba..a185448205 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 3eccc457da..f3af7b1cb2 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index de4af5635c..4c9675f7de 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 1575b20766..1b7ff6dc7e 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 5e01fdd3fc..0d8bb5baaa 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 2f5169ea0c..4c9a3a7fa9 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index b207b3e388..3eb28e40f6 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 13383cf028..96961bafdb 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.22.Final + 5.3.23-SNAPSHOT hibernate-tools-tests-utils From 18318e8ba98e58b6daff41e480295563b860506d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 1 Oct 2021 10:31:48 +0200 Subject: [PATCH 200/454] HBX-2208: Update Hibernate Core dependency to version 5.3.23.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4b97bec67..728ff1d6f3 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.22.Final + 5.3.23.Final 2.5.2 8.0.1 1.2.0 From 7aebc8726ff550dc556e0c0c606030b1c9565238 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 1 Oct 2021 11:47:20 +0200 Subject: [PATCH 201/454] HBX-2217: Update version identifier to 5.3.23.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index e0ab2744d0..68f2c0653d 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 59e0e4acc2..ea8a2cdc03 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.23-SNAPSHOT"; + public static final String VERSION = "5.3.23.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 4f7176d444..fa01a70b0f 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 728ff1d6f3..78c2f41c74 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.23-SNAPSHOT + 5.3.23.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 40bbfb2b14..274a5d2b51 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 38dfdcdf69..db99645be9 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index a185448205..ca1614e6e9 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index f3af7b1cb2..15f329c9a2 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 4c9675f7de..d20ebf3c06 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 1b7ff6dc7e..1a91dd9c44 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 0d8bb5baaa..e53870301e 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 4c9a3a7fa9..51749a7af1 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 3eb28e40f6..c8e4847cdc 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 96961bafdb..eafdd8b652 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23-SNAPSHOT + 5.3.23.Final hibernate-tools-tests-utils From d29872d54aa7e587e5f39553d6d48c7f2c5a3526 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 26 Nov 2021 17:06:19 +0200 Subject: [PATCH 202/454] HBX-2227: Update version identifier to 5.3.24-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 68f2c0653d..a8cad3b523 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index ea8a2cdc03..c90f9aa10a 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.23.Final"; + public static final String VERSION = "5.3.24-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index fa01a70b0f..315e9379fb 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 78c2f41c74..c4ece6f33f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.23.Final + 5.3.24-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 274a5d2b51..2992cffc7e 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index db99645be9..3c6523cd91 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index ca1614e6e9..0ed0317ac8 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 15f329c9a2..049f162521 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index d20ebf3c06..85048bb038 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 1a91dd9c44..2c950b99c9 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index e53870301e..ef33402af4 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 51749a7af1..90e7d741a2 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index c8e4847cdc..a3a1be8a1f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index eafdd8b652..a54ff26f96 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.23.Final + 5.3.24-SNAPSHOT hibernate-tools-tests-utils From 1b3603ec7b2ed02807ffb54bcbb1c10df46cb5fe Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 4 Oct 2021 10:57:36 +0200 Subject: [PATCH 203/454] HBX-2228: Add a 'mysql' test profile Signed-off-by: Koen Aers --- test/pom.xml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/pom.xml b/test/pom.xml index a3a1be8a1f..d862dfc93b 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -50,6 +50,14 @@ h2 + + hsql + + utils + common + hsql + + mssql @@ -58,12 +66,20 @@ mssql + + mysql + + utils + common + mysql + + - hsql + oracle utils common - hsql + oracle From 6991b7625648643a7773289146fb300c217b65cd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 5 Oct 2021 08:49:25 +0200 Subject: [PATCH 204/454] HBX-2229: Remove the dependency on 'com.microsoft.sqlserver.mssql-jdbc' from module 'org.hibernate.tool.hibernate-tools-tests-utils' Signed-off-by: Koen Aers --- test/utils/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/utils/pom.xml b/test/utils/pom.xml index a54ff26f96..2d7c0b43d0 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -25,10 +25,6 @@ com.h2database h2 - - - com.microsoft.sqlserver - mssql-jdbc org.hibernate From c5cc76dac3d98a9cfb53c351bc45a898a21451e9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 3 Nov 2021 10:07:14 +0100 Subject: [PATCH 205/454] HBX-2248: Make sure the 'embed-xml' attribute is not generated in the HBM files Signed-off-by: Koen Aers --- .../tool/hbm2x/xml/AbstractXMLPrettyPrinterStrategy.java | 4 +++- .../hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml | 2 +- .../hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/xml/AbstractXMLPrettyPrinterStrategy.java b/main/src/main/java/org/hibernate/tool/hbm2x/xml/AbstractXMLPrettyPrinterStrategy.java index e73fa3adab..7016d9df05 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/xml/AbstractXMLPrettyPrinterStrategy.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/xml/AbstractXMLPrettyPrinterStrategy.java @@ -19,7 +19,9 @@ public abstract class AbstractXMLPrettyPrinterStrategy implements XMLPrettyPrinterStrategy { protected Document newDocument(String xml, String encoding) throws SAXException, IOException, ParserConfigurationException { - final Document document = DocumentBuilderFactory.newInstance() + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + final Document document = dbf .newDocumentBuilder() .parse(new InputSource(new ByteArrayInputStream(xml.getBytes(encoding)))); document.normalize(); diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml index 53074aa846..5ef3000e29 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml @@ -12,7 +12,7 @@ - + diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml index b3f575dc55..a79f26cbd2 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml @@ -12,7 +12,7 @@ - + From 75fb5040d79a4308bc6b2c2c96562c354f17e706 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 24 Jun 2021 10:15:04 +0200 Subject: [PATCH 206/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add JUnit Jupiter dependency to the 'hibernate-tools-parent' and 'hibernate-tools-tests-nodb' modules Signed-off-by: Koen Aers --- pom.xml | 15 ++++++++++++++- test/nodb/pom.xml | 8 ++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c4ece6f33f..34f34442d3 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ 2.3.2 1.2.0 4.13.2 + 5.7.1 6.0.6 19.3.0.0 9.2.1.jre8 @@ -157,7 +158,19 @@ ${hsqldb.version} test - + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index ef33402af4..a4df77a7e4 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -37,6 +37,14 @@ javax javaee-api + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + From 5ae5677c7c16f6d942e1c4ffbaead7abd033239c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 24 Jun 2021 10:46:47 +0200 Subject: [PATCH 207/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Exception.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/Exception/TestCase.java | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/Exception/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/Exception/TestCase.java index 41ea5fee9b..a2c119a436 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/Exception/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/Exception/TestCase.java @@ -1,30 +1,49 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Exception; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); } @@ -42,10 +61,10 @@ public void testException() throws Exception { try { project.executeTarget("testException"); - Assert.fail("An exception should occur"); + fail("An exception should occur"); } catch (BuildException e) { - Assert.assertTrue(e.getMessage(), e.getMessage().contains("Error while processing Entity")); + assertTrue(e.getMessage().contains("Error while processing Entity"), e.getMessage()); } From ebcc43ff4a7be36a5236b0705a6eb38863957f9a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 24 Jun 2021 12:51:57 +0200 Subject: [PATCH 208/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JavaFormatter.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/JavaFormatter/TestCase.java | 116 ++++++++++-------- 1 file changed, 68 insertions(+), 48 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java index 0e52a5a814..4b3d5d7a3a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/JavaFormatter/TestCase.java @@ -1,31 +1,51 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.ant.JavaFormatter; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tool.ide.formatting.DefaultJavaPrettyPrinterStrategy; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); } @@ -41,22 +61,22 @@ public void testJavaFormatFile() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File simpleOne = new File(destinationDir, "formatting/SimpleOne.java"); - Assert.assertFalse(simpleOne.exists()); + assertFalse(simpleOne.exists()); project.executeTarget("copyfiles"); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(simpleOne.exists()); - Assert.assertFalse(FileUtil + assertTrue(simpleOne.exists()); + assertFalse(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); DefaultJavaPrettyPrinterStrategy formatter = new DefaultJavaPrettyPrinterStrategy(null); formatter.formatFile( simpleOne ); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); @@ -74,28 +94,28 @@ public void testJavaJdk5FormatFile() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File simple5One = new File(destinationDir, "formatting/Simple5One.java"); - Assert.assertFalse(simple5One.exists()); + assertFalse(simple5One.exists()); project.executeTarget("copyfiles"); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(simple5One.exists()); - Assert.assertFalse(FileUtil + assertTrue(simple5One.exists()); + assertFalse(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); project.executeTarget("copyfiles"); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); DefaultJavaPrettyPrinterStrategy formatter = new DefaultJavaPrettyPrinterStrategy(null); - Assert.assertTrue( - "formatting should pass when using default settings", - formatter.formatFile(simple5One)); + assertTrue( + formatter.formatFile(simple5One), + "formatting should pass when using default settings"); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); } @@ -112,21 +132,21 @@ public void testAntFormatTask() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File simpleOne = new File(destinationDir, "formatting/SimpleOne.java"); - Assert.assertFalse(simpleOne.exists()); + assertFalse(simpleOne.exists()); project.executeTarget("copyfiles"); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(simpleOne.exists()); - Assert.assertFalse(FileUtil + assertTrue(simpleOne.exists()); + assertFalse(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); project.executeTarget("formatfiles"); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); @@ -144,58 +164,58 @@ public void testConfig() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File simpleOne = new File(destinationDir, "formatting/SimpleOne.java"); - Assert.assertFalse(simpleOne.exists()); + assertFalse(simpleOne.exists()); File simple5One = new File(destinationDir, "formatting/Simple5One.java"); - Assert.assertFalse(simple5One.exists()); + assertFalse(simple5One.exists()); project.executeTarget("copyfiles"); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(simpleOne.exists()); - Assert.assertTrue(simple5One.exists()); + assertTrue(simpleOne.exists()); + assertTrue(simple5One.exists()); - Assert.assertFalse(FileUtil + assertFalse(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); - Assert.assertFalse(FileUtil + assertFalse(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); project.executeTarget("configtest"); log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); - Assert.assertTrue(simpleOne.delete()); - Assert.assertTrue(simple5One.delete()); + assertTrue(simpleOne.delete()); + assertTrue(simple5One.delete()); project.executeTarget("copyfiles"); log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertFalse(FileUtil + assertFalse(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); - Assert.assertFalse(FileUtil + assertFalse(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); project.executeTarget("noconfigtest"); log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simpleOne) .contains("SimpleOne")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("public", simple5One) .contains("Simple5One")); From e331f5254796832451a96d1a2bcbc90bcb840b24 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 26 Jun 2021 14:32:41 +0200 Subject: [PATCH 209/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.NoConfig.TestCase' Signed-off-by: Koen Aers --- .../hibernate/tool/ant/NoConfig/TestCase.java | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/NoConfig/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/NoConfig/TestCase.java index 3eaaedbbab..23b1446ec1 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/NoConfig/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/NoConfig/TestCase.java @@ -1,30 +1,51 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.ant.NoConfig; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); } @@ -40,20 +61,20 @@ public void testNoConfig() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File generatedSchema = new File(destinationDir, "generated-schema.sql"); - Assert.assertFalse(generatedSchema.exists()); + assertFalse(generatedSchema.exists()); try { project.executeTarget("testNoConfig"); - Assert.fail("Exception should happen"); + fail("Exception should happen"); } catch (BuildException e) { - Assert.assertTrue(e.getMessage().contains("No configuration specified")); + assertTrue(e.getMessage().contains("No configuration specified")); } - Assert.assertFalse(generatedSchema.exists()); + assertFalse(generatedSchema.exists()); } From 724dbf9ca05e370c971d8ef526a2a8666780b1d3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 27 Jun 2021 13:53:12 +0200 Subject: [PATCH 210/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.NoConnInfoExport.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/NoConnInfoExport/TestCase.java | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/NoConnInfoExport/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/NoConnInfoExport/TestCase.java index cd288eeb0f..9c41134b2c 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/NoConnInfoExport/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/NoConnInfoExport/TestCase.java @@ -1,30 +1,50 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.ant.NoConnInfoExport; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); } @@ -40,12 +60,12 @@ public void testNoConnInfoExport() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File noConnInfo = new File(destinationDir, "noConnInfo.sql"); - Assert.assertFalse(noConnInfo.exists()); + assertFalse(noConnInfo.exists()); project.executeTarget("testNoConnInfoExport"); - Assert.assertTrue(noConnInfo.exists()); - Assert.assertTrue(FileUtil + assertTrue(noConnInfo.exists()); + assertTrue(FileUtil .findFirstString("create", noConnInfo) .contains("create table TopDown (id bigint not null, name varchar(255), primary key (id));")); } From e175e6c6efd6b4bdb667fe32e9ff397c54f7fd94 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 09:55:41 +0200 Subject: [PATCH 211/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.NoExporters.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/NoExporters/TestCase.java | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ant/NoExporters/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ant/NoExporters/TestCase.java index c749b633a6..7eed121b83 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ant/NoExporters/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ant/NoExporters/TestCase.java @@ -1,26 +1,47 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.ant.NoExporters; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); } @@ -37,12 +58,12 @@ public void testNoConnInfoExport() { try { project.executeTarget("testNoExporters"); - Assert.fail("should have failed with no exporters!"); + fail("should have failed with no exporters!"); } catch (BuildException e) { // should happen! - Assert.assertTrue(e.getMessage().indexOf("No exporters specified")>=0); + assertTrue(e.getMessage().indexOf("No exporters specified")>=0); } From 550f6dd65d4ae15326d9a3793564170c3f5ce749 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 10:12:05 +0200 Subject: [PATCH 212/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.cfg.MetaDataDialectFactoryTest.TestCase' Signed-off-by: Koen Aers --- .../MetaDataDialectFactoryTest/TestCase.java | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/cfg/MetaDataDialectFactoryTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/cfg/MetaDataDialectFactoryTest/TestCase.java index f3e2d51a51..5d45b529dd 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/cfg/MetaDataDialectFactoryTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/cfg/MetaDataDialectFactoryTest/TestCase.java @@ -1,5 +1,28 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.cfg.MetaDataDialectFactoryTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.Properties; import org.hibernate.cfg.JDBCBinderException; @@ -17,8 +40,7 @@ import org.hibernate.dialect.Oracle10gDialect; import org.hibernate.dialect.Oracle8iDialect; import org.hibernate.dialect.Oracle9iDialect; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TestCase { @@ -63,11 +85,11 @@ public void testCreateMetaDataDialectNonExistingOverride() { p.setProperty("hibernatetool.metadatadialect", "DoesNotExists"); try { MetaDataDialectFactory.createMetaDataDialect(new MySQL5Dialect(), p); - Assert.fail(); + fail(); } catch (JDBCBinderException jbe) { // expected } catch(Exception e) { - Assert.fail(); + fail(); } } @@ -126,33 +148,33 @@ public void testFromDialectName() { private void assertSameClass(Class clazz, Object instance) { if(clazz==null && instance==null) { - Assert.assertEquals((Object)null, (Object)null); + assertEquals((Object)null, (Object)null); return; } if(clazz==null) { - Assert.assertEquals(null, instance); + assertEquals(null, instance); return; } if(instance==null) { - Assert.assertEquals(clazz.getCanonicalName(), null); + assertEquals(clazz.getCanonicalName(), null); return; } - Assert.assertEquals(clazz.getCanonicalName(), instance.getClass().getName()); + assertEquals(clazz.getCanonicalName(), instance.getClass().getName()); } private void assertSameClass(String msg, Class clazz, Object instance) { if(clazz==null && instance==null) { - Assert.assertEquals((Object)null, (Object)null); + assertEquals((Object)null, (Object)null); return; } if(clazz==null) { - Assert.assertEquals(msg, null, instance); + assertEquals(null, instance, msg); return; } if(instance==null) { - Assert.assertEquals(msg, clazz.getCanonicalName(), null); + assertEquals(clazz.getCanonicalName(), null, msg); return; } - Assert.assertEquals(msg, clazz.getCanonicalName(), instance.getClass().getName()); + assertEquals(clazz.getCanonicalName(), instance.getClass().getName(), msg); } } From a84faa590f91de6ba8cff0841cc5c7507dd6694d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 11:05:03 +0200 Subject: [PATCH 213/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.cfg.reveng.ReverseEngineeringStrategyUtilTest.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/cfg/reveng/ReverseEngineeringStrategyUtilTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/cfg/reveng/ReverseEngineeringStrategyUtilTest/TestCase.java index 361174739d..331b94eb3d 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/cfg/reveng/ReverseEngineeringStrategyUtilTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/cfg/reveng/ReverseEngineeringStrategyUtilTest/TestCase.java @@ -1,27 +1,47 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.cfg.reveng.ReverseEngineeringStrategyUtilTest; -import org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil; -import org.junit.Assert; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil; +import org.junit.jupiter.api.Test; public class TestCase { @Test public void testSimplePluralizeWithSingleH() throws Exception { String plural = ReverseEngineeringStrategyUtil.simplePluralize("h"); - Assert.assertEquals("hs", plural); + assertEquals("hs", plural); } @Test public void testPluralize(){ - Assert.assertEquals("boxes", ReverseEngineeringStrategyUtil.simplePluralize("box")); - Assert.assertEquals("buses", ReverseEngineeringStrategyUtil.simplePluralize("bus")); - Assert.assertEquals("keys", ReverseEngineeringStrategyUtil.simplePluralize("key")); - Assert.assertEquals("countries", ReverseEngineeringStrategyUtil.simplePluralize("country")); - Assert.assertEquals("churches", ReverseEngineeringStrategyUtil.simplePluralize("church")); - Assert.assertEquals("bushes", ReverseEngineeringStrategyUtil.simplePluralize("bush")); - Assert.assertEquals("roofs", ReverseEngineeringStrategyUtil.simplePluralize("roof")); + assertEquals("boxes", ReverseEngineeringStrategyUtil.simplePluralize("box")); + assertEquals("buses", ReverseEngineeringStrategyUtil.simplePluralize("bus")); + assertEquals("keys", ReverseEngineeringStrategyUtil.simplePluralize("key")); + assertEquals("countries", ReverseEngineeringStrategyUtil.simplePluralize("country")); + assertEquals("churches", ReverseEngineeringStrategyUtil.simplePluralize("church")); + assertEquals("bushes", ReverseEngineeringStrategyUtil.simplePluralize("bush")); + assertEquals("roofs", ReverseEngineeringStrategyUtil.simplePluralize("roof")); } } \ No newline at end of file From d04b0a4263503bad18bda2ce593ced63a18fb5d6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 11:20:56 +0200 Subject: [PATCH 214/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.DocExporterTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/DocExporterTest/TestCase.java | 121 +++++++++++------- 1 file changed, 73 insertions(+), 48 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/DocExporterTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/DocExporterTest/TestCase.java index d30297ea15..1533775609 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/DocExporterTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/DocExporterTest/TestCase.java @@ -1,5 +1,32 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.DocExporterTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -14,11 +41,9 @@ import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; @@ -41,19 +66,19 @@ public class TestCase { "DependentValue.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private boolean ignoreDot; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "src"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); @@ -73,59 +98,59 @@ public void setUp() throws Exception { properties.setProperty("dot.ignoreerror", Boolean.toString(ignoreDot)); exporter.getProperties().putAll(properties); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); } @Test public void testExporter() { - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "index.html") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "assets/doc-style.css") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "assets/hibernate_logo.gif") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "tables/default/summary.html") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "tables/default/Customer.html") ); - Assert.assertFalse(new File(outputDir, "tables/default/UPerson.html").exists() ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "tables/CROWN/CROWN_USERS.html") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "entities/org/hibernate/tool/hbm2x/Customer.html") ); - Assert.assertTrue(new File(outputDir, "entities/org/hibernate/tool/hbm2x/UPerson.html").exists() ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "entities/org/hibernate/tool/hbm2x/UUser.html") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "index.html") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "assets/doc-style.css") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "assets/hibernate_logo.gif") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "tables/default/summary.html") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "tables/default/Customer.html") ); + assertFalse(new File(srcDir, "tables/default/UPerson.html").exists() ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "tables/CROWN/CROWN_USERS.html") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "entities/org/hibernate/tool/hbm2x/Customer.html") ); + assertTrue(new File(srcDir, "entities/org/hibernate/tool/hbm2x/UPerson.html").exists() ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "entities/org/hibernate/tool/hbm2x/UUser.html") ); if (!ignoreDot) { - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "entities/entitygraph.dot")); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "entities/entitygraph.png")); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "tables/tablegraph.dot")); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "tables/tablegraph.png")); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "entities/entitygraph.dot")); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "entities/entitygraph.png")); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "tables/tablegraph.dot")); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "tables/tablegraph.png")); } - checkHtml(outputDir); + checkHtml(srcDir); } @Test public void testCommentIncluded() { - // A unique customer comment! - File tableFile = new File(outputDir, "tables/default/Customer.html"); - JUnitUtil.assertIsNonEmptyFile(tableFile ); - Assert.assertNotNull(FileUtil.findFirstString("A unique customer comment!", tableFile)); + // A unique customer comment! + File tableFile = new File(srcDir, "tables/default/Customer.html"); + JUnitUtil.assertIsNonEmptyFile(tableFile ); + assertNotNull(FileUtil.findFirstString("A unique customer comment!", tableFile)); } @Test public void testGenericsRenderedCorrectly() { - // A unique customer comment! - File tableFile = new File(outputDir, "entities/org/hibernate/tool/hbm2x/Customer.html"); - JUnitUtil.assertIsNonEmptyFile(tableFile); - Assert.assertNull( - "Generics syntax should not occur verbatim in html", - FileUtil.findFirstString("List<", tableFile)); - Assert.assertNotNull( - "Generics syntax occur verbatim in html", - FileUtil.findFirstString("List<", tableFile)); + // A unique customer comment! + File tableFile = new File(srcDir, "entities/org/hibernate/tool/hbm2x/Customer.html"); + JUnitUtil.assertIsNonEmptyFile(tableFile); + assertNull( + FileUtil.findFirstString("List<", tableFile), + "Generics syntax should not occur verbatim in html"); + assertNotNull( + FileUtil.findFirstString("List<", tableFile), + "Generics syntax occur verbatim in html"); } @Test public void testInheritedProperties() { - File entityFile = new File(outputDir, "entities/org/hibernate/tool/hbm2x/UUser.html"); + File entityFile = new File(srcDir, "entities/org/hibernate/tool/hbm2x/UUser.html"); JUnitUtil.assertIsNonEmptyFile(entityFile); - Assert.assertNotNull( - "Missing inherited property", - FileUtil.findFirstString("firstName", entityFile)); + assertNotNull( + FileUtil.findFirstString("firstName", entityFile), + "Missing inherited property"); } private void checkHtml(File file) { @@ -141,10 +166,10 @@ private void checkHtml(File file) { parser.setErrorHandler(handler); parser.setEntityResolver(new TestResolver()); parser.parse(new InputSource(new FileInputStream(file))); - Assert.assertEquals(file + "has errors ", 0, handler.errors); - Assert.assertEquals(file + "has warnings ", 0, handler.warnings); + assertEquals(0, handler.errors, file + "has errors "); + assertEquals(0, handler.warnings, file + "has warnings "); } catch (Exception e) { - Assert.fail(e.getMessage()); + fail(e.getMessage()); } } } From 5fa68b84461804bef6203e4e43ed1f8ec84bb29c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 12:09:21 +0200 Subject: [PATCH 215/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.GenericExporterTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/GenericExporterTest/TestCase.java | 78 ++++++++++++------- 1 file changed, 49 insertions(+), 29 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java index 05afe4c136..465dd32c4a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java @@ -1,9 +1,31 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.GenericExporterTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -17,11 +39,9 @@ import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -35,19 +55,19 @@ public class TestCase { "HelloWorld.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + private MetadataDescriptor metadataDescriptor = null; private File outputDir = null; private File resourcesDir = null; private String resourcesLocation = null; - @Before + @BeforeEach public void setUp() { - outputDir = new File(temporaryFolder.getRoot(), "output"); + outputDir = new File(outputFolder, "src"); outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); @@ -64,10 +84,10 @@ public void testSingleFileGeneration() { ge.start(); JUnitUtil.assertIsNonEmptyFile(new File( outputDir,"artifacts.txt")); JUnitUtil.assertIsNonEmptyFile(new File( outputDir, "templates.txt")); - Assert.assertEquals( + assertEquals( null, FileUtil.findFirstString("$", new File(outputDir, "artifacts.txt"))); - Assert.assertEquals( + assertEquals( "File for artifacts in " + Version.getDefault().getVersion(), FileUtil.findFirstString("artifacts", new File( outputDir, "artifacts.txt"))); } @@ -127,14 +147,14 @@ public void testForEachGeneration() { JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/genericAuthor.txt")); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/genericArticle.txt")); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/genericArticle.txt")); - Assert.assertFalse( - "component file should not exist", - new File(outputDir, "genericUniversalAddress.txt" ).exists()); + assertFalse( + new File(outputDir, "genericUniversalAddress.txt" ).exists(), + "component file should not exist"); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "genericHelloUniverse.txt" ) ); try { ge.setForEach( "does, not, exist" ); ge.start(); - Assert.fail(); + fail(); } catch(Exception e) { //e.printStackTrace(); //expected @@ -151,23 +171,23 @@ public void testForEachWithExceptionGeneration() { try { ge.setForEach("entity"); ge.start(); - Assert.fail(); + fail(); } catch(ExporterException e) { - Assert.assertTrue(e.getMessage().startsWith("Error while processing Entity:")); + assertTrue(e.getMessage().startsWith("Error while processing Entity:")); } try { ge.setForEach("component"); ge.start(); - Assert.fail(); + fail(); } catch(ExporterException e) { - Assert.assertTrue(e.getMessage().startsWith("Error while processing Component: UniversalAddress")); + assertTrue(e.getMessage().startsWith("Error while processing Component: UniversalAddress")); } try { ge.setForEach("configuration"); ge.start(); - Assert.fail(); + fail(); } catch(ExporterException e) { - Assert.assertTrue(e.getMessage().startsWith("Error while processing Configuration")); + assertTrue(e.getMessage().startsWith("Error while processing Configuration")); } } @@ -195,11 +215,11 @@ public void testPropertySet() throws FileNotFoundException, IOException { is.close(); } } - Assert.assertEquals(generated.getProperty("booleanProperty"), "true"); - Assert.assertEquals(generated.getProperty("hibernatetool.booleanProperty"), "true"); - Assert.assertNull(generated.getProperty("booleanWasTrue")); - Assert.assertEquals(generated.getProperty("myTool.value"), "value"); - Assert.assertEquals(generated.getProperty("refproperty"), "proptest=A value"); + assertEquals(generated.getProperty("booleanProperty"), "true"); + assertEquals(generated.getProperty("hibernatetool.booleanProperty"), "true"); + assertNull(generated.getProperty("booleanWasTrue")); + assertEquals(generated.getProperty("myTool.value"), "value"); + assertEquals(generated.getProperty("refproperty"), "proptest=A value"); } } From 296bbfef69c45188c6b4d9eff331b18b76d8e8df Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 12:36:58 +0200 Subject: [PATCH 216/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.HashcodeEqualsTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/HashcodeEqualsTest/TestCase.java | 65 ++++++++++++------- 1 file changed, 41 insertions(+), 24 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HashcodeEqualsTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HashcodeEqualsTest/TestCase.java index b1c9481458..d6743dabf8 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HashcodeEqualsTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HashcodeEqualsTest/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.HashcodeEqualsTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + import java.io.File; import org.hibernate.tool.api.metadata.MetadataDescriptor; @@ -14,11 +33,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -30,25 +47,25 @@ public class TestCase { "HashEquals.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private ArtifactCollector artifactCollector = null; private MetadataDescriptor metadataDescriptor = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); artifactCollector = new ArtifactCollector(); exporter.setArtifactCollector(artifactCollector); exporter.start(); @@ -58,7 +75,7 @@ public void setUp() throws Exception { public void testJDK5FailureExpectedOnJDK4() { POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.getProperties().setProperty("jdk5", "true"); artifactCollector = new ArtifactCollector(); exporter.setArtifactCollector(artifactCollector); @@ -71,17 +88,17 @@ public void testJDK5FailureExpectedOnJDK4() { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/HashEquals.java")); + srcDir, "org/hibernate/tool/hbm2x/HashEquals.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/Address.java")); - Assert.assertEquals(2, artifactCollector.getFileCount("java")); + srcDir, "org/hibernate/tool/hbm2x/Address.java")); + assertEquals(2, artifactCollector.getFileCount("java")); } @Test public void testCompilable() { - File compiled = new File(temporaryFolder.getRoot(), "compiled"); + File compiled = new File(outputFolder, "compiled"); compiled.mkdir(); - JavaUtil.compile(outputDir, compiled); + JavaUtil.compile(srcDir, compiled); JUnitUtil.assertIsNonEmptyFile(new File( compiled, "org/hibernate/tool/hbm2x/HashEquals.class")); JUnitUtil.assertIsNonEmptyFile(new File( @@ -90,17 +107,17 @@ public void testCompilable() { @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/HashEquals.java"))); - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Address.java"))); } From 79bc3a7a91ca274e1d8cc6ceeb809b0a0cfe6caa Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 13:44:28 +0200 Subject: [PATCH 217/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2CfgTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/Hbm2CfgTest/TestCase.java | 75 ++++++++++++------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2CfgTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2CfgTest/TestCase.java index 4a1969b1bf..86dc9b79e3 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2CfgTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2CfgTest/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2CfgTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + import java.io.File; import java.util.Properties; @@ -15,11 +35,9 @@ import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -31,25 +49,25 @@ public class TestCase { "HelloWorld.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private File outputDir = null; + @TempDir + public File outputFolder = new File("output"); + + private File srcDir = null; private File resourcesDir = null; private HibernateConfigurationExporter cfgexporter; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "src"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); cfgexporter = new HibernateConfigurationExporter(); cfgexporter.setMetadataDescriptor(metadataDescriptor); - cfgexporter.setOutputDirectory(outputDir); + cfgexporter.setOutputDirectory(srcDir); cfgexporter.start(); } @@ -64,17 +82,17 @@ public void testMagicPropertyHandling() { properties.setProperty("hibernate.dialect", HibernateUtil.Dialect.class.getName()); exporter.setMetadataDescriptor(MetadataDescriptorFactory .createNativeDescriptor(null, null, properties)); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); - File file = new File(outputDir, "hibernate.cfg.xml"); - Assert.assertNull( + File file = new File(srcDir, "hibernate.cfg.xml"); + assertNull( FileUtil.findFirstString( Environment.SESSION_FACTORY_NAME, file )); - Assert.assertNotNull( + assertNotNull( FileUtil.findFirstString( "hibernate.basic\">aValue<", file )); - Assert.assertNull( + assertNull( FileUtil.findFirstString( Environment.HBM2DDL_AUTO, file )); - Assert.assertNull( + assertNull( FileUtil.findFirstString("hibernate.temp.use_jdbc_metadata_defaults", file )); exporter = new HibernateConfigurationExporter(); properties = exporter.getProperties(); @@ -82,9 +100,9 @@ public void testMagicPropertyHandling() { properties.setProperty("hibernate.dialect", HibernateUtil.Dialect.class.getName()); exporter.setMetadataDescriptor(MetadataDescriptorFactory .createNativeDescriptor(null, null, properties)); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); - Assert.assertNotNull( + assertNotNull( FileUtil.findFirstString( Environment.HBM2DDL_AUTO, file )); exporter = new HibernateConfigurationExporter(); properties = exporter.getProperties(); @@ -92,26 +110,25 @@ public void testMagicPropertyHandling() { properties.setProperty("hibernate.dialect", HibernateUtil.Dialect.class.getName()); exporter.setMetadataDescriptor(MetadataDescriptorFactory .createNativeDescriptor(null, null, properties)); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); - Assert.assertNull( + assertNull( FileUtil.findFirstString( AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY, file )); } @Test public void testFileExistence() { - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "hibernate.cfg.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "hibernate.cfg.xml") ); } @Test public void testArtifactCollection() { - Assert.assertEquals(1, cfgexporter.getArtifactCollector().getFileCount("cfg.xml")); + assertEquals(1, cfgexporter.getArtifactCollector().getFileCount("cfg.xml")); } - @SuppressWarnings("el-syntax") @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil.findFirstString("${",new File(outputDir, "hibernate.cfg.xml"))); + assertNull(FileUtil.findFirstString("${",new File(srcDir, "hibernate.cfg.xml"))); } } From 856afb08670d7ac7ff5dc2488bdedba7db02e4ce Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 14:15:18 +0200 Subject: [PATCH 218/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2DaoTest' Signed-off-by: Koen Aers --- .../tool/hbm2x/Hbm2DaoTest/TestCase.java | 79 +++++++++++-------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2DaoTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2DaoTest/TestCase.java index eb5f7c4ac6..27d376b63a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2DaoTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2DaoTest/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2DaoTest; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.IOException; @@ -14,11 +33,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -31,26 +48,26 @@ public class TestCase { "Author.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir; + private File srcDir; private File resourcesDir; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "src"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); POJOExporter javaExporter = new POJOExporter(); javaExporter.setMetadataDescriptor(metadataDescriptor); - javaExporter.setOutputDirectory(outputDir); + javaExporter.setOutputDirectory(srcDir); POJOExporter exporter = new DAOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.getProperties().setProperty("ejb3", "false"); exporter.getProperties().setProperty("jdk5", "true"); exporter.start(); @@ -60,47 +77,47 @@ public void setUp() throws Exception { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/ArticleHome.java")); + srcDir, "org/hibernate/tool/hbm2x/ArticleHome.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/AuthorHome.java")); + srcDir, "org/hibernate/tool/hbm2x/AuthorHome.java")); } @Test public void testCompilable() throws IOException { - File compiled = new File(temporaryFolder.getRoot(), "compiled"); + File compiled = new File(outputFolder, "compiled"); compiled.mkdir(); - FileUtil.generateNoopComparator(outputDir); - JavaUtil.compile(outputDir, compiled); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Article.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/ArticleHome.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Author.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/AuthorHome.class").exists()); - Assert.assertTrue(new File(compiled, "comparator/NoopComparator.class").exists()); + FileUtil.generateNoopComparator(srcDir); + JavaUtil.compile(srcDir, compiled); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Article.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/ArticleHome.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Author.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/AuthorHome.class").exists()); + assertTrue(new File(compiled, "comparator/NoopComparator.class").exists()); } @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/ArticleHome.java"))); - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/AuthorHome.java"))); } @Test public void testNamedQueries() { - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString( "findByNameAndAddress", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/AuthorHome.java") ) .trim().startsWith("public List" )); } From 8b35519bf76ab76171a2f671478eae21383e6d24 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 14:29:37 +0200 Subject: [PATCH 219/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2EJBDaoTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/Hbm2EJBDaoTest/TestCase.java | 77 +++++++++++-------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java index 4df7caabdf..3b88845dcc 100755 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2EJBDaoTest/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2EJBDaoTest; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -19,11 +38,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -36,26 +53,26 @@ public class TestCase { "Author.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; - private File resourcesDir = null; + private File srcDir; + private File resourcesDir; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "src"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); POJOExporter javaExporter = new POJOExporter(); javaExporter.setMetadataDescriptor(metadataDescriptor); - javaExporter.setOutputDirectory(outputDir); + javaExporter.setOutputDirectory(srcDir); POJOExporter exporter = new DAOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.getProperties().setProperty("ejb3", "true"); exporter.getProperties().setProperty("jdk5", "true"); exporter.start(); @@ -65,40 +82,40 @@ public void setUp() throws Exception { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/ArticleHome.java")); + srcDir, "org/hibernate/tool/hbm2x/ArticleHome.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, "org/hibernate/tool/hbm2x/AuthorHome.java")); + srcDir, "org/hibernate/tool/hbm2x/AuthorHome.java")); } @Test public void testCompilable() throws IOException { - File compiled = new File(temporaryFolder.getRoot(), "compiled"); + File compiled = new File(outputFolder, "compiled"); compiled.mkdir(); - FileUtil.generateNoopComparator(outputDir); + FileUtil.generateNoopComparator(srcDir); List jars = new ArrayList(); jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api jars.add(JavaUtil.resolvePathToJarFileFor(EJB.class)); // for javaee api - JavaUtil.compile(outputDir, compiled); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Article.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/ArticleHome.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Author.class").exists()); - Assert.assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/AuthorHome.class").exists()); - Assert.assertTrue(new File(compiled, "comparator/NoopComparator.class").exists()); + JavaUtil.compile(srcDir, compiled); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Article.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/ArticleHome.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/Author.class").exists()); + assertTrue(new File(compiled, "org/hibernate/tool/hbm2x/AuthorHome.class").exists()); + assertTrue(new File(compiled, "comparator/NoopComparator.class").exists()); } @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/ArticleHome.java"))); - Assert.assertNull(FileUtil + assertNull(FileUtil .findFirstString( "$", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/AuthorHome.java"))); } From 70ca51f0e23f7f9d040beffe9f60d5edd0436df2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 18:31:09 +0200 Subject: [PATCH 220/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.AbstractTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/AbstractTest/Car.java | 20 +++++ .../hbm2hbmxml/AbstractTest/CarPart.java | 20 +++++ .../hbm2hbmxml/AbstractTest/TestCase.java | 74 ++++++++++--------- 3 files changed, 80 insertions(+), 34 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.java index dd1e0c6aaa..d43ef2c004 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.AbstractTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.java index 77d943fb06..2f15f4db35 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.AbstractTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java index a6d054689c..bc8816d69c 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.AbstractTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -33,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -52,41 +57,41 @@ public class TestCase { "Car.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.hbm.xml") ); } @Test public void testAbstractPresent() throws Exception { File outputXml = new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -96,25 +101,26 @@ public void testAbstractPresent() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals( "Expected to get one class element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one class element"); Element node = (Element)nodeList.item(0); - Assert.assertNotNull(node.getAttribute("abstract"), "Abstract attrinute was not exported."); - Assert.assertEquals(node.getAttribute("abstract"), "true"); + assertNotNull(node.getAttribute("abstract"), "Abstract attrinute was not exported."); + assertEquals(node.getAttribute("abstract"), "true"); } + @Test public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/AbstractTest/CarPart.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } } From 49a907d1d253b9b2381c8eb0df93de99c1e03f10 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 19:49:22 +0200 Subject: [PATCH 221/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.BackrefTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/BackrefTest/Car.java | 20 ++++++ .../hbm2x/hbm2hbmxml/BackrefTest/CarPart.java | 20 ++++++ .../hbm2hbmxml/BackrefTest/TestCase.java | 67 ++++++++++--------- 3 files changed, 76 insertions(+), 31 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.java index c22d13fa09..f1c6f414df 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.BackrefTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.java index 5a06a40539..a6fe612a49 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.BackrefTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/TestCase.java index 5ea48cfd51..754a1dfc17 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.BackrefTest; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.util.ArrayList; import java.util.Iterator; @@ -31,11 +38,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author Dmitry Geraskov @@ -47,36 +52,36 @@ public class TestCase { "Car.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private Metadata metadata = null; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "src"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); metadata = metadataDescriptor.createMetadata(); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.hbm.xml") ); } @@ -88,23 +93,23 @@ public void testBackrefPresent() { while (iterator.hasNext() && !hasBackrefs) { hasBackrefs = (iterator.next() instanceof Backref); } - Assert.assertTrue("Class mapping should create Backref for this testcase", hasBackrefs); + assertTrue(hasBackrefs, "Class mapping should create Backref for this testcase"); } @Test public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/BackrefTest/CarPart.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } } From 2c49db5703a88bb2cc685d71a2e333c4886ede09 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 20:14:50 +0200 Subject: [PATCH 222/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.Cfg2HbmToolTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/Cfg2HbmToolTest/TestCase.java | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Cfg2HbmToolTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Cfg2HbmToolTest/TestCase.java index 9ee4abc683..7590a36832 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Cfg2HbmToolTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Cfg2HbmToolTest/TestCase.java @@ -1,6 +1,28 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.hbm2hbmxml.Cfg2HbmToolTest; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.hibernate.mapping.JoinedSubclass; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.RootClass; @@ -8,8 +30,7 @@ import org.hibernate.mapping.Subclass; import org.hibernate.mapping.UnionSubclass; import org.hibernate.tool.hbm2x.Cfg2HbmTool; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author Dmitry Geraskov @@ -21,11 +42,11 @@ public class TestCase { public void testNeedsTable(){ Cfg2HbmTool c2h = new Cfg2HbmTool(); PersistentClass pc = new RootClass(null); - Assert.assertTrue(c2h.needsTable(pc)); - Assert.assertTrue(c2h.needsTable(new JoinedSubclass(pc, null))); - Assert.assertTrue(c2h.needsTable(new UnionSubclass(pc, null))); - Assert.assertFalse(c2h.needsTable(new SingleTableSubclass(pc, null))); - Assert.assertFalse(c2h.needsTable(new Subclass(pc, null))); + assertTrue(c2h.needsTable(pc)); + assertTrue(c2h.needsTable(new JoinedSubclass(pc, null))); + assertTrue(c2h.needsTable(new UnionSubclass(pc, null))); + assertFalse(c2h.needsTable(new SingleTableSubclass(pc, null))); + assertFalse(c2h.needsTable(new Subclass(pc, null))); } } From 3da1fe0b34a01c1ad42c67bd984174cc943bcc1e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 21:33:18 +0200 Subject: [PATCH 223/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/CompositeElementTest/Fee.java | 21 ++++- .../CompositeElementTest/FooComponent.java | 21 ++++- .../CompositeElementTest/GlarchProxy.java | 20 +++++ .../CompositeElementTest/TestCase.java | 83 ++++++++++--------- 4 files changed, 104 insertions(+), 41 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.java index 908a3491d4..e2beb80225 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/FooComponent.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/FooComponent.java index a7f5ebfdb3..9afc590a3d 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/FooComponent.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/FooComponent.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/GlarchProxy.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/GlarchProxy.java index e5df1fb63a..1aa9f47a72 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/GlarchProxy.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/GlarchProxy.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest; import java.util.List; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java index 7d8b713766..1056b44d99 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -33,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -53,35 +58,35 @@ public class TestCase { "Glarch.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Glarch.hbm.xml") ); } @@ -89,22 +94,22 @@ public void testAllFilesExistence() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Fee.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Glarch.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testCompositeElementNode() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/CompositeElementTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -116,7 +121,7 @@ public void testCompositeElementNode() throws Exception { .evaluate(document, XPathConstants.NODESET); Element secondList = (Element)nodeList.item(1); NodeList compositeElementList = secondList.getElementsByTagName("composite-element"); - Assert.assertEquals("Expected to get one composite-element element", 1, compositeElementList.getLength()); + assertEquals(1, compositeElementList.getLength(), "Expected to get one composite-element element"); Element compositeElement = (Element)compositeElementList.item(0); NodeList compositeElementChildNodes = compositeElement.getChildNodes(); int amountOfProperties = 0; @@ -124,17 +129,17 @@ public void testCompositeElementNode() throws Exception { Node node = compositeElementChildNodes.item(i); if ("property".equals(node.getNodeName())) amountOfProperties++; } - Assert.assertEquals("Expected to get two property element", 2, amountOfProperties); + assertEquals(2, amountOfProperties, "Expected to get two property element"); NodeList manyToOneList = secondList.getElementsByTagName("many-to-one"); - Assert.assertEquals(1, manyToOneList.getLength()); + assertEquals(1, manyToOneList.getLength()); Element manyToOneElement = (Element)manyToOneList.item(0); - Assert.assertEquals("fee", manyToOneElement.getAttribute("name")); - Assert.assertEquals("all", manyToOneElement.getAttribute("cascade")); + assertEquals("fee", manyToOneElement.getAttribute("name")); + assertEquals("all", manyToOneElement.getAttribute("cascade")); NodeList nestedCompositeElementList = compositeElement.getElementsByTagName("nested-composite-element"); - Assert.assertEquals(1, nestedCompositeElementList.getLength()); + assertEquals(1, nestedCompositeElementList.getLength()); Element nestedCompositeElement = (Element)nestedCompositeElementList.item(0); - Assert.assertEquals("subcomponent", nestedCompositeElement.getAttribute("name")); - Assert.assertEquals( + assertEquals("subcomponent", nestedCompositeElement.getAttribute("name")); + assertEquals( "org.hibernate.tool.hbm2x.hbm2hbmxml.CompositeElementTest.FooComponent", nestedCompositeElement.getAttribute("class")); } From 5164a32a252c01db5703e19ab6c124b76fd417ec Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 22:02:34 +0200 Subject: [PATCH 224/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/DynamicComponentTest/Fee.java | 21 ++++- .../DynamicComponentTest/FooComponent.java | 21 ++++- .../DynamicComponentTest/GlarchProxy.java | 20 +++++ .../DynamicComponentTest/TestCase.java | 77 ++++++++++--------- 4 files changed, 101 insertions(+), 38 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.java index ba73297aef..3c24bd11bb 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/FooComponent.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/FooComponent.java index 0076010d78..8a9687b5c5 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/FooComponent.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/FooComponent.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/GlarchProxy.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/GlarchProxy.java index 1fac2cfe33..28bb1eb6d8 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/GlarchProxy.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/GlarchProxy.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest; import java.util.List; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java index 117236d66e..c950e45bcc 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -33,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -52,35 +57,35 @@ public class TestCase { "Glarch.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml") ); } @@ -88,22 +93,22 @@ public void testAllFilesExistence() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Fee.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testClassProxy() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -113,15 +118,15 @@ public void testClassProxy() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one class element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one class element"); Element element = (Element) nodeList.item(0); - Assert.assertEquals(element.getAttribute("proxy"),"org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.GlarchProxy"); + assertEquals(element.getAttribute("proxy"),"org.hibernate.tool.hbm2x.hbm2hbmxml.DynamicComponentTest.GlarchProxy"); } @Test public void testDynamicComponentNode() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -131,9 +136,9 @@ public void testDynamicComponentNode() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/dynamic-component") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one dynamic-component element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one dynamic-component element"); Element element = (Element) nodeList.item(0); - Assert.assertEquals(element.getAttribute( "name" ),"dynaBean"); + assertEquals(element.getAttribute( "name" ),"dynaBean"); } } From d069f8e9e7dab00892763e8add70cce8d479a5c6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 22:38:36 +0200 Subject: [PATCH 225/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/FormulaTest/Address.java | 20 ++++++ .../hbm2hbmxml/FormulaTest/AddressId.java | 20 ++++++ .../hbm2hbmxml/FormulaTest/Customer.java | 20 ++++++ .../hbm2hbmxml/FormulaTest/TestCase.java | 62 ++++++++++--------- 4 files changed, 93 insertions(+), 29 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java index 3c157182d5..48ad11ae6a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Address.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; public class Address { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java index 43ca6b1be1..f7efc64057 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/AddressId.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; public class AddressId { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java index 0af5a2ee64..a7ef84bba6 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; public class Customer { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java index fa51742be4..9e5a76bb4e 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/TestCase.java @@ -1,21 +1,27 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.FormulaTest; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -26,11 +32,9 @@ import org.hibernate.tool.hbm2x.Exporter; import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author koen @@ -41,25 +45,25 @@ public class TestCase { "Customer.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @@ -67,19 +71,19 @@ public void setUp() throws Exception { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml")); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/BillingAddress.hbm.xml")); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/ShippingAddress.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } } From a254efeb5efa6321d87e09816699c1e8b7dd9674 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 23:34:46 +0200 Subject: [PATCH 226/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java | 281 ++++++++++-------- 1 file changed, 149 insertions(+), 132 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java index bc73e5372c..5a63ae711b 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/TestCase.java @@ -1,12 +1,31 @@ -//$Id$ - -/* - * Tests for generating the HBM documents from the Configuration data structure. - * The generated XML document will be validated and queried to make sure the - * basic structure is correct in each test. +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import javax.xml.parsers.DocumentBuilder; @@ -21,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -59,53 +76,53 @@ public static class Persister { "ClassFullAttribute.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private MetadataDescriptor metadataDescriptor = null; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml") ); - Assert.assertFalse(new File( - outputDir, + assertFalse(new File( + srcDir, "org/hibernate/tool/cfg2hbm/GeneralHbmSettings.hbm.xml").exists() ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicCompositeId.hbm.xml") ); } @Test public void testArtifactCollection() { - Assert.assertEquals( - "4 mappings + 1 global", + assertEquals( 5, - hbmexporter.getArtifactCollector().getFileCount("hbm.xml")); + hbmexporter.getArtifactCollector().getFileCount("hbm.xml"), + "4 mappings + 1 global"); } /** @@ -120,11 +137,11 @@ public void testGlobalSettingsGeneratedDatabase() throws Exception { hgs.setCatalogName("mycatalog"); Exporter gsExporter = new HibernateMappingExporter(); gsExporter.setMetadataDescriptor(metadataDescriptor); - gsExporter.setOutputDirectory(outputDir); + gsExporter.setOutputDirectory(srcDir); ( (HibernateMappingExporter)gsExporter).setGlobalSettings(hgs); gsExporter.start(); File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -132,10 +149,10 @@ public void testGlobalSettingsGeneratedDatabase() throws Exception { Document document = db.parse(outputXml); Element root = document.getDocumentElement(); // There are 7 attributes because there are defaults defined by the DTD makes up the missing entries - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 7, root.getAttributes().getLength() ); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package") ); - Assert.assertEquals("Unexpected schema name", "myschema", root.getAttribute("schema") ); - Assert.assertEquals("Unexpected mycatalog name", "mycatalog", root.getAttribute("catalog")); + assertEquals(7, root.getAttributes().getLength(), "Unexpected number of hibernate-mapping elements "); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package"), "Unexpected package name"); + assertEquals("myschema", root.getAttribute("schema"), "Unexpected schema name"); + assertEquals("mycatalog", root.getAttribute("catalog"), "Unexpected mycatalog name"); } /** @@ -150,11 +167,11 @@ public void testGlobalSettingsGeneratedAccessAndCascadeNonDefault() throws Exce hgs.setDefaultCascade("save-update"); Exporter gbsExporter = new HibernateMappingExporter(); gbsExporter.setMetadataDescriptor(metadataDescriptor); - gbsExporter.setOutputDirectory(outputDir); + gbsExporter.setOutputDirectory(srcDir); ( (HibernateMappingExporter)gbsExporter).setGlobalSettings(hgs); gbsExporter.start(); File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -162,16 +179,16 @@ public void testGlobalSettingsGeneratedAccessAndCascadeNonDefault() throws Exce Document document = db.parse(outputXml); Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); - Assert.assertEquals("Unexpected access setting", "field", root.getAttribute("default-access")); - Assert.assertEquals("Unexpected cascade setting", "save-update", root.getAttribute("default-cascade") ); + assertEquals(5, root.getAttributes().getLength(), "Unexpected number of hibernate-mapping elements "); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package"), "Unexpected package name"); + assertEquals("field", root.getAttribute("default-access"), "Unexpected access setting"); + assertEquals("save-update", root.getAttribute("default-cascade"), "Unexpected cascade setting"); } @Test public void testMetaAttributes() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -181,33 +198,33 @@ public void testMetaAttributes() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/meta") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one meta element", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get one meta element"); Node node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"Basic"); + assertEquals(node.getTextContent(),"Basic"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/id/meta") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one meta element"); node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"basicId"); + assertEquals(node.getTextContent(),"basicId"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/property/meta") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one meta element"); node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"description"); + assertEquals(node.getTextContent(),"description"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set/meta") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one meta element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one meta element"); node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"anotherone"); + assertEquals(node.getTextContent(),"anotherone"); } @Test public void testCollectionAttributes() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -217,15 +234,15 @@ public void testCollectionAttributes() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one set element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals("delete, update", node.getAttribute("cascade")); + assertEquals("delete, update", node.getAttribute("cascade")); } @Test public void testComments() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/ClassFullAttribute.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -235,21 +252,21 @@ public void testComments() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/comment") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one comment element"); Node node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"A comment for ClassFullAttribute"); + assertEquals(node.getTextContent(),"A comment for ClassFullAttribute"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/property/column/comment") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one comment element"); node = (Node) nodeList.item(0); - Assert.assertEquals(node.getTextContent(),"columnd comment"); + assertEquals(node.getTextContent(),"columnd comment"); } @Test public void testNoComments() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -259,11 +276,11 @@ public void testNoComments() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/comment") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get no comment element", nodeList.getLength(), 0); + assertEquals(nodeList.getLength(), 0, "Expected to get no comment element"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/property/column/comment") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get no comment element", 0, nodeList.getLength()); + assertEquals(0, nodeList.getLength(), "Expected to get no comment element"); } /** @@ -279,11 +296,11 @@ public void testGlobalSettingsGeneratedAccessAndCascadeDefault() throws Excepti hgs.setDefaultCascade("none"); Exporter gbsExporter = new HibernateMappingExporter(); gbsExporter.setMetadataDescriptor(metadataDescriptor); - gbsExporter.setOutputDirectory(outputDir); + gbsExporter.setOutputDirectory(srcDir); ( (HibernateMappingExporter)gbsExporter).setGlobalSettings(hgs); gbsExporter.start(); File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -291,10 +308,10 @@ public void testGlobalSettingsGeneratedAccessAndCascadeDefault() throws Excepti Document document = db.parse(outputXml); Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); - Assert.assertEquals("Unexpected access setting", "property", root.getAttribute("default-access")); - Assert.assertEquals("Unexpected cascade setting", "none", root.getAttribute("default-cascade")); + assertEquals(5, root.getAttributes().getLength(), "Unexpected number of hibernate-mapping elements "); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package"), "Unexpected package name"); + assertEquals("property", root.getAttribute("default-access"), "Unexpected access setting"); + assertEquals("none", root.getAttribute("default-cascade"), "Unexpected cascade setting"); } /** @@ -310,11 +327,11 @@ public void testGlobalSettingsLasyAndAutoImportNonDefault() throws Exception { hgs.setAutoImport(false); Exporter gbsExporter = new HibernateMappingExporter(); gbsExporter.setMetadataDescriptor(metadataDescriptor); - gbsExporter.setOutputDirectory(outputDir); + gbsExporter.setOutputDirectory(srcDir); ( (HibernateMappingExporter)gbsExporter).setGlobalSettings(hgs); gbsExporter.start(); File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -322,16 +339,16 @@ public void testGlobalSettingsLasyAndAutoImportNonDefault() throws Exception { Document document = db.parse(outputXml); Element root = document.getDocumentElement(); // There are 5 attributes because there are non-defaults not set for this test - Assert.assertEquals("Unexpected number of hibernate-mapping elements ", 5, root.getAttributes().getLength()); - Assert.assertEquals("Unexpected package name", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package")); - Assert.assertEquals("Unexpected access setting", "false", root.getAttribute("default-lazy")); - Assert.assertEquals("Unexpected cascade setting", "false", root.getAttribute("auto-import")); + assertEquals(5, root.getAttributes().getLength(), "Unexpected number of hibernate-mapping elements "); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest", root.getAttribute("package"), "Unexpected package name"); + assertEquals("false", root.getAttribute("default-lazy"), "Unexpected access setting"); + assertEquals("false", root.getAttribute("auto-import"), "Unexpected cascade setting"); } @Test public void testIdGeneratorHasNotArgumentParameters() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -342,19 +359,19 @@ public void testIdGeneratorHasNotArgumentParameters() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/id/generator") .evaluate(document, XPathConstants.NODESET); - Assert.assertTrue("Expected to get one generator element", nodeList.getLength() == 1); + assertTrue(nodeList.getLength() == 1, "Expected to get one generator element"); Node genAtt = ( (Element)nodeList.item(0)).getAttributeNode("class"); - Assert.assertEquals("Unexpected generator class name", "assigned", genAtt.getTextContent() ); + assertEquals("assigned", genAtt.getTextContent(), "Unexpected generator class name"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/id/generator/param") .evaluate(document, XPathConstants.NODESET); - Assert.assertTrue("Expected to get no generator param elements", nodeList.getLength() == 0); + assertTrue(nodeList.getLength() == 0, "Expected to get no generator param elements"); } @Test public void testIdGeneratorHasArgumentParameters() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -365,13 +382,13 @@ public void testIdGeneratorHasArgumentParameters() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/id/generator") .evaluate(document, XPathConstants.NODESET); - Assert.assertTrue("Expected to get one generator element", nodeList.getLength() == 1); + assertTrue(nodeList.getLength() == 1, "Expected to get one generator element"); Node genAtt = ( (Element)nodeList.item(0)).getAttributeNode("class"); - Assert.assertEquals("Unexpected generator class name", "org.hibernate.id.TableHiLoGenerator", genAtt.getTextContent()); + assertEquals("org.hibernate.id.TableHiLoGenerator", genAtt.getTextContent(), "Unexpected generator class name"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/id/generator/param") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get correct number of generator param elements", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get correct number of generator param elements"); Element tableElement = (Element)nodeList.item(0); Attr paramTableAtt = tableElement.getAttributeNode("name"); Element columnElement = (Element)nodeList.item(1); @@ -385,16 +402,16 @@ public void testIdGeneratorHasArgumentParameters() throws Exception { paramColumnAtt = temp; columnElement = tempElement; } - Assert.assertEquals("Unexpected generator param name", "table", paramTableAtt.getTextContent() ); - Assert.assertEquals("Unexpected generator param name", "column", paramColumnAtt.getTextContent() ); - Assert.assertEquals("Unexpected param value for table", "uni_table", tableElement.getTextContent() ); - Assert.assertEquals("Unexpected param value for column", "next_hi_value", columnElement.getTextContent() ); + assertEquals("table", paramTableAtt.getTextContent(), "Unexpected generator param name"); + assertEquals("column", paramColumnAtt.getTextContent(), "Unexpected generator param name"); + assertEquals("uni_table", tableElement.getTextContent(), "Unexpected param value for table"); + assertEquals("next_hi_value", columnElement.getTextContent(), "Unexpected param value for column"); } @Test public void testGeneralHbmSettingsQuery() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -405,29 +422,29 @@ public void testGeneralHbmSettingsQuery() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/query") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get correct number of query elements", 2, nodeList.getLength() ); + assertEquals(2, nodeList.getLength(), "Expected to get correct number of query elements"); Attr genAtt = ( (Element)nodeList.item(0) ).getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_query_1", genAtt.getTextContent() ); + assertEquals("test_query_1", genAtt.getTextContent(), "Unexpected query name"); genAtt = ( (Element)nodeList.item(0) ).getAttributeNode("flush-mode"); - Assert.assertNull("Expected flush-mode value to be null", genAtt); + assertNull(genAtt, "Expected flush-mode value to be null"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_query_2", genAtt.getTextContent() ); + assertEquals("test_query_2", genAtt.getTextContent(), "Unexpected query name"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("flush-mode"); - Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getTextContent() ); + assertEquals("auto", genAtt.getTextContent(), "Unexpected flush-mode value"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("cacheable"); - Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getTextContent() ); + assertEquals("true", genAtt.getTextContent(), "Unexpected cacheable value"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("cache-region"); - Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getTextContent() ); + assertEquals("myregion", genAtt.getTextContent(), "Unexpected cache-region value"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("fetch-size"); - Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getTextContent() ); + assertEquals("10", genAtt.getTextContent(), "Unexpected fetch-size value"); genAtt = ( (Element)nodeList.item(1) ).getAttributeNode("timeout"); - Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getTextContent() ); + assertEquals("1000", genAtt.getTextContent(), "Unexpected timeout value"); } @Test public void testGeneralHbmSettingsSQLQueryBasic() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -438,20 +455,20 @@ public void testGeneralHbmSettingsSQLQueryBasic() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/sql-query") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get correct number of query elements", 6, nodeList.getLength() ); + assertEquals(6, nodeList.getLength(), "Expected to get correct number of query elements"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_1\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_1' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_1' not to be null"); Attr genAtt = node.getAttributeNode("flush-mode"); - Assert.assertNull("Expected flush-mode value to be null", genAtt); + assertNull(genAtt, "Expected flush-mode value to be null"); } @Test public void testGeneralHbmSettingsSQLQueryAllAttributes() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -463,27 +480,27 @@ public void testGeneralHbmSettingsSQLQueryAllAttributes() throws Exception { .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_2\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_2' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_2' not to be null"); Attr genAtt = node.getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_2", genAtt.getTextContent() ); + assertEquals("test_sqlquery_2", genAtt.getTextContent(), "Unexpected query name"); genAtt = node.getAttributeNode("flush-mode"); - Assert.assertEquals("Unexpected flush-mode value", "auto", genAtt.getTextContent() ); + assertEquals("auto", genAtt.getTextContent(), "Unexpected flush-mode value"); genAtt = node.getAttributeNode("cacheable"); - Assert.assertEquals("Unexpected cacheable value", "true", genAtt.getTextContent() ); + assertEquals("true", genAtt.getTextContent(), "Unexpected cacheable value"); genAtt = node.getAttributeNode("cache-region"); - Assert.assertEquals("Unexpected cache-region value", "myregion", genAtt.getTextContent() ); + assertEquals("myregion", genAtt.getTextContent(), "Unexpected cache-region value"); genAtt = node.getAttributeNode("fetch-size"); - Assert.assertEquals("Unexpected fetch-size value", "10", genAtt.getTextContent() ); + assertEquals("10", genAtt.getTextContent(), "Unexpected fetch-size value"); genAtt = node.getAttributeNode("timeout"); - Assert.assertEquals("Unexpected timeout value", "1000", genAtt.getTextContent() ); + assertEquals("1000", genAtt.getTextContent(), "Unexpected timeout value"); Element syncTable = (Element)node.getElementsByTagName("synchronize").item(0); - Assert.assertNull("Expected synchronize element to be null", syncTable); + assertNull(syncTable, "Expected synchronize element to be null"); } @Test public void testGeneralHbmSettingsSQLQuerySynchronize() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -495,21 +512,21 @@ public void testGeneralHbmSettingsSQLQuerySynchronize() throws Exception { .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_3\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_3' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_3' not to be null"); Attr genAtt = node.getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_3", genAtt.getTextContent() ); + assertEquals("test_sqlquery_3", genAtt.getTextContent(), "Unexpected query name"); Element syncTable = (Element)node.getElementsByTagName("synchronize").item(0); - Assert.assertNotNull("Expected synchronize element to not be null", syncTable); + assertNotNull(syncTable, "Expected synchronize element to not be null"); genAtt = syncTable.getAttributeNode("table"); - Assert.assertEquals("Unexpected table value for synchronize element", "mytable", genAtt.getTextContent() ); + assertEquals("mytable", genAtt.getTextContent(), "Unexpected table value for synchronize element"); Element returnEl = (Element)node.getElementsByTagName("return").item(0); - Assert.assertNull("Expected return element to be null", returnEl); + assertNull(returnEl, "Expected return element to be null"); } @Test public void testGeneralHbmSettingsSQLQueryWithReturnRoot() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -521,21 +538,21 @@ public void testGeneralHbmSettingsSQLQueryWithReturnRoot() throws Exception { .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_4\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_4' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_4' not to be null"); Attr genAtt = node.getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_4", genAtt.getTextContent() ); + assertEquals(genAtt.getTextContent(), "test_sqlquery_4", "Unexpected query name"); Element returnEl = (Element)node.getElementsByTagName("return").item(0); - Assert.assertNotNull("Expected return element to not be null", returnEl); + assertNotNull(returnEl, "Expected return element to not be null"); genAtt = returnEl.getAttributeNode("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent() ); + assertEquals("e", genAtt.getTextContent(), "Unexpected alias value for return element"); genAtt = returnEl.getAttributeNode("class"); - Assert.assertEquals("Unexpected class value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.BasicGlobals", genAtt.getTextContent()); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.BasicGlobals", genAtt.getTextContent(), "Unexpected class value for return element"); } @Test public void testGeneralHbmSettingsSQLQueryWithReturnRole() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -547,21 +564,21 @@ public void testGeneralHbmSettingsSQLQueryWithReturnRole() throws Exception { .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_5\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_5' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_5' not to be null"); Attr genAtt = node.getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_5", genAtt.getTextContent() ); + assertEquals("test_sqlquery_5", genAtt.getTextContent(), "Unexpected query name"); Element returnEl = (Element)node.getElementsByTagName("return-join").item(0); - Assert.assertNotNull("Expected return element to not be null", returnEl); + assertNotNull(returnEl, "Expected return element to not be null"); genAtt = returnEl.getAttributeNode("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent() ); + assertEquals("e", genAtt.getTextContent(), "Unexpected alias value for return element"); genAtt = returnEl.getAttributeNode("property"); - Assert.assertEquals("Unexpected property role value for return element", "e.age", genAtt.getTextContent()); + assertEquals("e.age", genAtt.getTextContent(), "Unexpected property role value for return element"); } @Test public void testGeneralHbmSettingsSQLQueryWithReturnCollection() throws Exception { File outputXml = new File( - outputDir, + srcDir, "GeneralHbmSettings.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -573,17 +590,17 @@ public void testGeneralHbmSettingsSQLQueryWithReturnCollection() throws Excepti .compile("//hibernate-mapping/sql-query[@name=\"test_sqlquery_6\"]") .evaluate(document, XPathConstants.NODESET); Element node = (Element)nodeList.item(0); - Assert.assertNotNull("Expected sql-query named 'test_sqlquery_6' not to be null", node); + assertNotNull(node, "Expected sql-query named 'test_sqlquery_6' not to be null"); Attr genAtt = node.getAttributeNode("name"); - Assert.assertEquals("Unexpected query name", "test_sqlquery_6", genAtt.getTextContent()); + assertEquals("test_sqlquery_6", genAtt.getTextContent(), "Unexpected query name"); Element returnEl = (Element)node.getElementsByTagName("load-collection").item(0); - Assert.assertNotNull("Expected return element to not be null", returnEl); + assertNotNull(returnEl, "Expected return element to not be null"); genAtt = returnEl.getAttributeNode("alias"); - Assert.assertEquals("Unexpected alias value for return element", "e", genAtt.getTextContent()); + assertEquals("e", genAtt.getTextContent(), "Unexpected alias value for return element"); genAtt = returnEl.getAttributeNode("role"); - Assert.assertEquals("Unexpected collection role value for return element", "org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.BasicGlobals.price", genAtt.getTextContent()); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.Hbm2HbmXmlTest.BasicGlobals.price", genAtt.getTextContent(), "Unexpected collection role value for return element"); genAtt = returnEl.getAttributeNode("lock-mode"); - Assert.assertEquals("Unexpected class lock-mode for return element", "none", genAtt.getTextContent()); + assertEquals("none", genAtt.getTextContent(), "Unexpected class lock-mode for return element"); } } From 5c303b6b02c7d07f6445e93562a8e2475f2d69e0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 28 Jun 2021 23:49:39 +0200 Subject: [PATCH 227/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/IdBagTest/Group.java | 20 ++++ .../hbm2x/hbm2hbmxml/IdBagTest/TestCase.java | 96 ++++++++++--------- .../tool/hbm2x/hbm2hbmxml/IdBagTest/User.java | 20 ++++ 3 files changed, 91 insertions(+), 45 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.java index 3c2aa42d43..bc315e6bee 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest; public class Group { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java index 67012398f7..f98a8c92ef 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/TestCase.java @@ -1,21 +1,29 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -33,11 +41,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -52,44 +58,44 @@ public class TestCase { "UserGroup.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { - Assert.assertFalse(new File( - outputDir, + assertFalse(new File( + srcDir, "/GeneralHbmSettings.hbm.xml").exists()); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.hbm.xml")); } @Test public void testArtifactCollection() { - Assert.assertEquals( + assertEquals( 2, hbmexporter.getArtifactCollector().getFileCount("hbm.xml")); } @@ -98,22 +104,22 @@ public void testArtifactCollection() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml")); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/Group.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testIdBagAttributes() throws Exception { File outputXml = new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -123,18 +129,18 @@ public void testIdBagAttributes() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/idbag") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one idbag element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one idbag element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "table" ),"`UserGroups`"); - Assert.assertEquals(node.getAttribute( "name" ),"groups"); - Assert.assertEquals(node.getAttribute( "lazy" ),"false"); - Assert.assertEquals(node.getAttribute( "access" ),"field"); + assertEquals(node.getAttribute( "table" ),"`UserGroups`"); + assertEquals(node.getAttribute( "name" ),"groups"); + assertEquals(node.getAttribute( "lazy" ),"false"); + assertEquals(node.getAttribute( "access" ),"field"); } @Test public void testCollectionId() throws Exception { File outputXml = new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.hbm.xml"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -143,14 +149,14 @@ public void testCollectionId() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/idbag/collection-id") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one collection-id element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one collection-id element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "column" ),"userGroupId"); - Assert.assertEquals(node.getAttribute( "type" ),"long"); + assertEquals(node.getAttribute( "column" ),"userGroupId"); + assertEquals(node.getAttribute( "type" ),"long"); nodeList = node.getElementsByTagName("generator"); - Assert.assertEquals("Expected to get one generator element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one generator element"); node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "class" ),"increment"); + assertEquals(node.getAttribute( "class" ),"increment"); } } diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.java index 4f603a3e5f..4047d4b10a 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/IdBagTest/User.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.IdBagTest; import java.util.ArrayList; From 04d2a258f77b5c99e6e554586795b3eb555bc36d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 00:07:06 +0200 Subject: [PATCH 228/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.InheritanceTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/InheritanceTest/TestCase.java | 85 +++++++++++-------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java index fc9f920842..1051cb5375 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/TestCase.java @@ -1,12 +1,29 @@ -//$Id$ - /* - * Tests for generating the HBM documents from the Configuration data structure. - * The generated XML document will be validated and queried to make sure the - * basic structure is correct in each test. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.InheritanceTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -24,12 +41,10 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -45,47 +60,47 @@ public class TestCase { "Aliens.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { - Assert.assertFalse(new File( - outputDir, + assertFalse(new File( + srcDir, "GeneralHbmSettings.hbm.xml").exists() ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Human.hbm.xml")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Alien.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Animal.hbm.xml") ); } @Test public void testArtifactCollection() { - Assert.assertEquals( + assertEquals( 3, hbmexporter.getArtifactCollector().getFileCount("hbm.xml")); } @@ -93,27 +108,27 @@ public void testArtifactCollection() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Alien.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Human.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Animal.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[3]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } // TODO Re-enable this test: HBX-1247 - @Ignore + @Disabled @Test public void testComment() throws Exception { File outputXml = new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Alien.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -123,13 +138,13 @@ public void testComment() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/joined-subclass/comment") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one comment element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one comment element"); } @Test public void testDiscriminator() throws Exception { File outputXml = new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/InheritanceTest/Animal.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -139,9 +154,9 @@ public void testDiscriminator() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/discriminator") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one discriminator element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one discriminator element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "type" ), "string"); + assertEquals(node.getAttribute( "type" ), "string"); } } From edee8009c488dae8a390a743e437ba5ba6d82833 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 00:24:49 +0200 Subject: [PATCH 229/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/hbm2hbmxml/JoinTest/Child.java | 21 ++++++- .../hbm2x/hbm2hbmxml/JoinTest/Parent.java | 21 ++++++- .../hbm2x/hbm2hbmxml/JoinTest/TestCase.java | 60 ++++++++++--------- 3 files changed, 72 insertions(+), 30 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java index 7fc6739d69..ed82ae0f91 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; /** diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java index 0a272620d8..97285a43ac 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; import java.util.Collection; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java index 9171be79de..866b135823 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/TestCase.java @@ -1,21 +1,27 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.JoinTest; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -26,11 +32,9 @@ import org.hibernate.tool.hbm2x.Exporter; import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author koen @@ -41,25 +45,25 @@ public class TestCase { "Parent.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @@ -67,16 +71,16 @@ public void setUp() throws Exception { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Parent.hbm.xml")); files.add(new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/JoinTest/Child.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } } From 07185af0bbb7885c9b986d8e5922e3cb97a5fa89 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 09:30:00 +0200 Subject: [PATCH 230/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/hbm2hbmxml/ListArrayTest/Fee.java | 21 +++- .../ListArrayTest/FooComponent.java | 21 +++- .../hbm2hbmxml/ListArrayTest/Glarch.java | 21 +++- .../hbm2hbmxml/ListArrayTest/GlarchProxy.java | 20 ++++ .../hbm2hbmxml/ListArrayTest/TestCase.java | 109 +++++++++--------- 5 files changed, 137 insertions(+), 55 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.java index 1ca5787c4a..8b3c316e55 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/FooComponent.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/FooComponent.java index d87cb38fb5..e6e6eac27f 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/FooComponent.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/FooComponent.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.java index 1a0635e9a7..5ef4556f91 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/GlarchProxy.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/GlarchProxy.java index 17be373c87..6a7918144f 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/GlarchProxy.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/GlarchProxy.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest; import java.util.List; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java index 98964d5d64..8aa9625372 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -33,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -52,33 +57,33 @@ public class TestCase { "Glarch.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml") ); } @@ -86,22 +91,22 @@ public void testAllFilesExistence() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Fee.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testListNode() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -111,41 +116,41 @@ public void testListNode() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/list") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get two list element", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get two list element"); Element node = (Element) nodeList.item(1); //second list - Assert.assertEquals("fooComponents", node.getAttribute( "name" )); - Assert.assertEquals("true", node.getAttribute( "lazy" )); - Assert.assertEquals("all", node.getAttribute( "cascade" )); + assertEquals("fooComponents", node.getAttribute( "name" )); + assertEquals("true", node.getAttribute( "lazy" )); + assertEquals("all", node.getAttribute( "cascade" )); nodeList = node.getElementsByTagName("list-index"); - Assert.assertEquals("Expected to get one list-index element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one list-index element"); nodeList = ((Element) nodeList.item(0)).getElementsByTagName("column"); - Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one column element"); node = (Element) nodeList.item(0); - Assert.assertEquals("tha_indecks", node.getAttribute( "name" )); + assertEquals("tha_indecks", node.getAttribute( "name" )); node = (Element)node.getParentNode().getParentNode();//list nodeList = node.getElementsByTagName("composite-element"); - Assert.assertEquals("Expected to get one composite-element element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one composite-element element"); node = (Element) nodeList.item(0); int propertyCount = 0; nodeList = node.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { if ("property".equals(nodeList.item(i).getNodeName())) propertyCount++; } - Assert.assertEquals("Expected to get two property element", 2, propertyCount); + assertEquals(2, propertyCount, "Expected to get two property element"); node = (Element)node.getElementsByTagName("many-to-one").item(0); - Assert.assertEquals("fee", node.getAttribute( "name" )); - Assert.assertEquals("all", node.getAttribute( "cascade" )); + assertEquals("fee", node.getAttribute( "name" )); + assertEquals("all", node.getAttribute( "cascade" )); //TODO :assertEquals(node.attribute( "outer-join" ).getText(),"true"); node = (Element)node.getParentNode();//composite-element node = (Element)node.getElementsByTagName("nested-composite-element").item(0); - Assert.assertEquals("subcomponent", node.getAttribute( "name" )); - Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.FooComponent", node.getAttribute( "class" )); + assertEquals("subcomponent", node.getAttribute( "name" )); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.FooComponent", node.getAttribute( "class" )); } @Test public void testArrayNode() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -155,19 +160,19 @@ public void testArrayNode() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/array") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one array element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one array element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals("proxyArray", node.getAttribute( "name" )); - Assert.assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.GlarchProxy", node.getAttribute( "element-class" )); + assertEquals("proxyArray", node.getAttribute( "name" )); + assertEquals("org.hibernate.tool.hbm2x.hbm2hbmxml.ListArrayTest.GlarchProxy", node.getAttribute( "element-class" )); nodeList = node.getElementsByTagName("list-index"); - Assert.assertEquals("Expected to get one list-index element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one list-index element"); nodeList = ((Element) nodeList.item(0)).getElementsByTagName("column"); - Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one column element"); node = (Element) nodeList.item(0); - Assert.assertEquals("array_indecks", node.getAttribute( "name" )); + assertEquals("array_indecks", node.getAttribute( "name" )); node = (Element)node.getParentNode().getParentNode();//array nodeList = node.getElementsByTagName("one-to-many"); - Assert.assertEquals("Expected to get one 'one-to-many' element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one 'one-to-many' element"); } } From 3bb45ce07d1496f4e0f5f86f81ef57fa0a5e3998 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 14:24:18 +0200 Subject: [PATCH 231/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/ManyToManyTest/Group.java | 21 +++- .../hbm2hbmxml/ManyToManyTest/TestCase.java | 103 ++++++++++-------- .../hbm2x/hbm2hbmxml/ManyToManyTest/User.java | 21 +++- 3 files changed, 99 insertions(+), 46 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.java index bdb9a052f5..83566d1098 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.java @@ -1,4 +1,23 @@ -//$Id: Group.java 7085 2005-06-08 17:59:47Z oneovthafew $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest; import java.io.ObjectStreamClass; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java index 0fd3dfc96e..82716a0b60 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/TestCase.java @@ -1,12 +1,29 @@ -//$Id$ - /* - * Tests for generating the HBM documents from the Configuration data structure. - * The generated XML document will be validated and queried to make sure the - * basic structure is correct in each test. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -24,11 +41,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -39,44 +54,44 @@ public class TestCase { "UserGroup.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private Exporter hbmexporter = null; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { - Assert.assertFalse(new File( - outputDir, + assertFalse(new File( + srcDir, "GeneralHbmSettings.hbm.xml") .exists() ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml") ); } @Test public void testArtifactCollection() { - Assert.assertEquals( + assertEquals( 2, hbmexporter.getArtifactCollector().getFileCount("hbm.xml")); } @@ -85,22 +100,22 @@ public void testArtifactCollection() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[2]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testManyToMany() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -110,21 +125,21 @@ public void testManyToMany() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set/many-to-many") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one many-to-many element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one many-to-many element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "entity-name" ),"org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.Group"); + assertEquals(node.getAttribute( "entity-name" ),"org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest.Group"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one set element"); node = (Element)nodeList.item(0); - Assert.assertEquals(node.getAttribute( "table" ),"UserGroup"); + assertEquals(node.getAttribute( "table" ),"UserGroup"); } @Test public void testCompositeId() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -134,27 +149,27 @@ public void testCompositeId() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one class element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one class element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute("table"), "`Group`"); + assertEquals(node.getAttribute("table"), "`Group`"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/composite-id") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one composite-id element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one composite-id element"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/composite-id/key-property") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get two key-property elements", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get two key-property elements"); node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute("name"), "name"); + assertEquals(node.getAttribute("name"), "name"); node = (Element) nodeList.item(1); - Assert.assertEquals(node.getAttribute("name"), "org"); + assertEquals(node.getAttribute("name"), "org"); } @Test public void testSetAttributes() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/Group.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -164,12 +179,12 @@ public void testSetAttributes() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one set element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute("table"), "UserGroup"); - Assert.assertEquals(node.getAttribute("name"), "users"); - Assert.assertEquals(node.getAttribute("inverse"), "true"); - Assert.assertEquals(node.getAttribute("lazy"), "extra"); + assertEquals(node.getAttribute("table"), "UserGroup"); + assertEquals(node.getAttribute("name"), "users"); + assertEquals(node.getAttribute("inverse"), "true"); + assertEquals(node.getAttribute("lazy"), "extra"); } } diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.java index d56f0b106d..a45ef84f1e 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/ManyToManyTest/User.java @@ -1,4 +1,23 @@ -//$Id: User.java 7085 2005-06-08 17:59:47Z oneovthafew $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.ManyToManyTest; import java.io.ObjectStreamClass; From 552cc662caf2fe5210f3d75ef06128d3f1c39abc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 15:19:16 +0200 Subject: [PATCH 232/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/MapAndAnyTest/Address.java | 20 +++ .../hbm2hbmxml/MapAndAnyTest/Person.java | 20 +++ .../hbm2hbmxml/MapAndAnyTest/TestCase.java | 148 +++++++++--------- 3 files changed, 117 insertions(+), 71 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Address.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Address.java index 0dfa7b3645..5f5b0b7b4f 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Address.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Address.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest; import java.util.Set; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Person.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Person.java index 65042d30ac..1bfa8b6d3b 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Person.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/Person.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest; /** diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java index b05811fd0a..6c8ca3c1f4 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/TestCase.java @@ -1,21 +1,29 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.util.ArrayList; import java.util.Properties; @@ -37,11 +45,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -57,42 +63,42 @@ public class TestCase { "Person.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private Exporter hbmexporter = null; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Metadata metadata = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); metadata = metadataDescriptor.createMetadata(); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/ComplexPropertyValue.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/IntegerPropertyValue.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/StringPropertyValue.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml") ); } @@ -100,28 +106,28 @@ public void testAllFilesExistence() { public void testReadable() { ArrayList files = new ArrayList(4); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/ComplexPropertyValue.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/IntegerPropertyValue.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/StringPropertyValue.hbm.xml")); files.add(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml")); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files.toArray(new File[4]), properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testAnyNode() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -131,45 +137,45 @@ public void testAnyNode() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/any") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one any element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one any element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ),"someSpecificProperty"); - Assert.assertEquals(node.getAttribute( "id-type" ),"long"); - Assert.assertEquals(node.getAttribute( "meta-type" ),"string"); - Assert.assertEquals(node.getAttribute( "cascade" ), "all"); - Assert.assertEquals(node.getAttribute( "access" ), "field"); + assertEquals(node.getAttribute( "name" ),"someSpecificProperty"); + assertEquals(node.getAttribute( "id-type" ),"long"); + assertEquals(node.getAttribute( "meta-type" ),"string"); + assertEquals(node.getAttribute( "cascade" ), "all"); + assertEquals(node.getAttribute( "access" ), "field"); nodeList = node.getElementsByTagName("column"); - Assert.assertEquals("Expected to get two column elements", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get two column elements"); nodeList = node.getElementsByTagName("meta-value"); - Assert.assertEquals("Expected to get three meta-value elements", 3, nodeList.getLength()); + assertEquals(3, nodeList.getLength(), "Expected to get three meta-value elements"); node = (Element) nodeList.item(0); String className = node.getAttribute( "class" ); - Assert.assertNotNull("Expected class attribute in meta-value", className); + assertNotNull(className, "Expected class attribute in meta-value"); if (className.indexOf("IntegerPropertyValue") > 0){ - Assert.assertEquals(node.getAttribute( "value" ),"I"); + assertEquals(node.getAttribute( "value" ),"I"); } else if (className.indexOf("StringPropertyValue") > 0){ - Assert.assertEquals(node.getAttribute( "value" ),"S"); + assertEquals(node.getAttribute( "value" ),"S"); } else { - Assert.assertTrue(className.indexOf("ComplexPropertyValue") > 0); - Assert.assertEquals(node.getAttribute( "value" ),"C"); + assertTrue(className.indexOf("ComplexPropertyValue") > 0); + assertEquals(node.getAttribute( "value" ),"C"); } } @Test public void testMetaValueRead() throws Exception{ PersistentClass pc = metadata.getEntityBinding("org.hibernate.tool.hbm2x.hbm2hbmxml.MapAndAnyTest.Person"); - Assert.assertNotNull(pc); + assertNotNull(pc); Property prop = pc.getProperty("data"); - Assert.assertNotNull(prop); - Assert.assertTrue(prop.getValue() instanceof Any); + assertNotNull(prop); + assertTrue(prop.getValue() instanceof Any); Any any = (Any) prop.getValue(); - Assert.assertTrue("Expected to get one meta-value element", any.getMetaValues() != null); - Assert.assertEquals("Expected to get one meta-value element", 1, any.getMetaValues().size()); + assertTrue(any.getMetaValues() != null, "Expected to get one meta-value element"); + assertEquals(1, any.getMetaValues().size(), "Expected to get one meta-value element"); } @Test public void testMapManyToAny() throws Exception { - File outputXml = new File(outputDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml"); + File outputXml = new File(srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/MapAndAnyTest/PropertySet.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -178,37 +184,37 @@ public void testMapManyToAny() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/map") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one any element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one any element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ),"generalProperties"); - Assert.assertEquals(node.getAttribute( "table" ),"T_GEN_PROPS"); - Assert.assertEquals(node.getAttribute( "lazy" ),"true"); - Assert.assertEquals(node.getAttribute( "cascade" ), "all"); - Assert.assertEquals(node.getAttribute( "access" ), "field"); + assertEquals(node.getAttribute( "name" ),"generalProperties"); + assertEquals(node.getAttribute( "table" ),"T_GEN_PROPS"); + assertEquals(node.getAttribute( "lazy" ),"true"); + assertEquals(node.getAttribute( "cascade" ), "all"); + assertEquals(node.getAttribute( "access" ), "field"); nodeList = node.getElementsByTagName("key"); - Assert.assertEquals("Expected to get one key element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one key element"); nodeList = node.getElementsByTagName("map-key"); - Assert.assertEquals("Expected to get one map-key element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one map-key element"); node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "type" ),"string"); + assertEquals(node.getAttribute( "type" ),"string"); nodeList = node.getElementsByTagName("column"); - Assert.assertEquals("Expected to get one column element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one column element"); node = (Element)node.getParentNode();//map nodeList = node.getElementsByTagName("many-to-any"); - Assert.assertEquals("Expected to get one many-to-any element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one many-to-any element"); node = (Element) nodeList.item(0); nodeList = node.getElementsByTagName("column"); - Assert.assertEquals("Expected to get two column elements", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get two column elements"); nodeList = node.getElementsByTagName("meta-value"); - Assert.assertEquals("Expected to get two meta-value elements", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get two meta-value elements"); node = (Element) nodeList.item(0); String className = node.getAttribute( "class" ); - Assert.assertNotNull("Expected class attribute in meta-value", className); + assertNotNull(className, "Expected class attribute in meta-value"); if (className.indexOf("IntegerPropertyValue") > 0){ - Assert.assertEquals(node.getAttribute( "value" ),"I"); + assertEquals(node.getAttribute( "value" ),"I"); } else { - Assert.assertTrue(className.indexOf("StringPropertyValue") > 0); - Assert.assertEquals(node.getAttribute( "value" ),"S"); + assertTrue(className.indexOf("StringPropertyValue") > 0); + assertEquals(node.getAttribute( "value" ),"S"); } } From e6525250b051b42a2ce08994133b0b817cd7cd9e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 15:40:56 +0200 Subject: [PATCH 233/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/OneToOneTest/Address.java | 20 +++++ .../hbm2x/hbm2hbmxml/OneToOneTest/Person.java | 20 +++++ .../hbm2hbmxml/OneToOneTest/TestCase.java | 87 +++++++++++-------- 3 files changed, 91 insertions(+), 36 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.java index 136ec9f30f..0e973468ba 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest; public class Address { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.java index 2f24e2ca10..83fb219005 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest; public class Person { diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java index 3d2e401c5d..45c14e3cea 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/TestCase.java @@ -1,12 +1,29 @@ -//$Id$ - -/* - * Tests for generating the HBM documents from the Configuration data structure. - * The generated XML document will be validated and queried to make sure the - * basic structure is correct in each test. +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.OneToOneTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.Properties; @@ -23,11 +40,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -40,45 +55,45 @@ public class TestCase { "PersonAddressOneToOnePrimaryKey.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Exporter hbmexporter = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testAllFilesExistence() { - Assert.assertFalse(new File( - outputDir, "GeneralHbmSettings.hbm.xml") + assertFalse(new File( + srcDir, "GeneralHbmSettings.hbm.xml") .exists()); JUnitUtil.assertIsNonEmptyFile( new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.hbm.xml")); JUnitUtil.assertIsNonEmptyFile( new File( - outputDir, + srcDir, "/org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.hbm.xml")); } @Test public void testArtifactCollection() { - Assert.assertEquals( + assertEquals( 2, hbmexporter.getArtifactCollector().getFileCount("hbm.xml")); } @@ -86,22 +101,22 @@ public void testArtifactCollection() { @Test public void testReadable() { File personHbmXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.hbm.xml"); File addressHbmXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.hbm.xml"); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); File[] files = new File[] { personHbmXml, addressHbmXml }; MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files, properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } public void testOneToOne() throws Exception { File xmlFile = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Person.hbm.xml"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -110,22 +125,22 @@ public void testOneToOne() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/one-to-one") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one-to-one element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one-to-one element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ),"address"); - Assert.assertEquals(node.getAttribute( "constrained" ),"false"); + assertEquals(node.getAttribute( "name" ),"address"); + assertEquals(node.getAttribute( "constrained" ),"false"); xmlFile = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/OneToOneTest/Address.hbm.xml"); document = db.parse(xmlFile); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/one-to-one") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one set element"); node = (Element)nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ),"person"); - Assert.assertEquals(node.getAttribute( "constrained" ),"true"); - Assert.assertEquals(node.getAttribute( "access" ), "field"); + assertEquals(node.getAttribute( "name" ),"person"); + assertEquals(node.getAttribute( "constrained" ),"true"); + assertEquals(node.getAttribute( "access" ), "field"); } } From 079a6ce804259d551858ff1a395973d909a11301 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 16:02:51 +0200 Subject: [PATCH 234/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/SetElementTest/Search.java | 21 ++++- .../hbm2hbmxml/SetElementTest/TestCase.java | 85 ++++++++++--------- 2 files changed, 65 insertions(+), 41 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.java index c98b066c8a..86f57699eb 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.java @@ -1,4 +1,23 @@ -//$Id$ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest; import java.util.SortedSet; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java index 2f1cd6ea40..f74346e048 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/TestCase.java @@ -1,21 +1,28 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.SetElementTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.Properties; @@ -32,11 +39,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -51,24 +56,24 @@ public class TestCase { "Search.hbm.xml", }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private Exporter hbmexporter = null; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @@ -76,28 +81,28 @@ public void setUp() throws Exception { public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile( new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml")); } @Test public void testReadable() { File searchHbmXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml"); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); File[] files = new File[] { searchHbmXml }; MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files, properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testKey() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -107,13 +112,13 @@ public void testKey() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set/key") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one key element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one key element"); Element node = (Element)nodeList.item(0); if (node.getAttribute( "column" ) != null && !"".equals(node.getAttribute("column"))) {//implied attribute - Assert.assertEquals(node.getAttribute( "column" ),"searchString"); + assertEquals(node.getAttribute( "column" ),"searchString"); } else { node = (Element)node.getElementsByTagName("column").item(0); - Assert.assertEquals(node.getAttribute( "name" ),"searchString"); + assertEquals(node.getAttribute( "name" ),"searchString"); } } @@ -121,7 +126,7 @@ public void testKey() throws Exception { public void testSetElement() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -131,20 +136,20 @@ public void testSetElement() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one set element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one set element"); Element node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ),"searchResults"); - Assert.assertEquals(node.getAttribute( "access" ),"field"); + assertEquals(node.getAttribute( "name" ),"searchResults"); + assertEquals(node.getAttribute( "access" ),"field"); nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/set/element") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one element 'element'", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one element 'element'"); node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "type" ), "string"); + assertEquals(node.getAttribute( "type" ), "string"); nodeList = node.getElementsByTagName("column"); - Assert.assertEquals("Expected to get one element 'column'", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one element 'column'"); node = (Element) nodeList.item(0); - Assert.assertEquals(node.getAttribute( "name" ), "text"); + assertEquals(node.getAttribute( "name" ), "text"); } } From 550d5ec91519d1cb5ec11e38bef0780bb2c0f144 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 16:20:06 +0200 Subject: [PATCH 235/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2hbmxml/TypeParamsTest/TestCase.java | 118 +++++++++--------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java index 959c15beb9..2e5bb19dfa 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java @@ -1,21 +1,29 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.util.HashMap; import java.util.Map; @@ -35,11 +43,9 @@ import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -54,23 +60,23 @@ public class TestCase { "Order.hbm.xml", }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @@ -78,7 +84,7 @@ public void setUp() throws Exception { public void testAllFilesExistence() { JUnitUtil.assertIsNonEmptyFile( new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml")); } @@ -86,20 +92,20 @@ public void testAllFilesExistence() { public void testReadable() { File orderHbmXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml"); Properties properties = new Properties(); properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); File[] files = new File[] { orderHbmXml }; MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, files, properties); - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); } @Test public void testTypeParamsElements() throws Exception { File outputXml = new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); @@ -109,7 +115,7 @@ public void testTypeParamsElements() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/property") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one property element", 2, nodeList.getLength()); + assertEquals(2, nodeList.getLength(), "Expected to get one property element"); Element statusElement = (Element) nodeList.item(0); Element nameElement = (Element) nodeList.item(1); if(!statusElement.getAttribute( "name" ).equals("status")) { @@ -117,42 +123,42 @@ public void testTypeParamsElements() throws Exception { nameElement = statusElement; statusElement = temp; } - Assert.assertEquals(statusElement.getAttribute( "name" ),"status"); + assertEquals(statusElement.getAttribute( "name" ),"status"); nodeList = statusElement.getElementsByTagName("type"); - Assert.assertEquals("Expected to get one type element", 1, nodeList.getLength()); + assertEquals( 1, nodeList.getLength(), "Expected to get one type element"); nodeList = ((Element) nodeList.item(0)).getElementsByTagName("param"); - Assert.assertEquals("Expected to get 5 params elements", nodeList.getLength(), 5); + assertEquals(nodeList.getLength(), 5, "Expected to get 5 params elements"); Map params = new HashMap(); for (int i = 0; i < nodeList.getLength(); i++) { Element param = (Element) nodeList.item(i); params.put(param.getAttribute( "name" ), param.getTextContent()); } Set set = params.keySet(); - Assert.assertEquals("Expected to get 5 different params elements", params.size(), 5); - Assert.assertTrue( - "Can't find 'catalog' param", - set.contains("catalog")); - Assert.assertEquals("", params.get("catalog")); - Assert.assertTrue( - "Can't find 'column' param", - set.contains("column")); - Assert.assertEquals("STATUS", params.get("column")); - Assert.assertTrue( - "Can't find 'table' param", - set.contains("table")); - Assert.assertEquals("ORDERS", params.get("table")); - Assert.assertTrue( - "Can't find 'schema' param", - set.contains("schema")); - Assert.assertEquals("", params.get("schema")); - Assert.assertTrue( - "Can't find 'enumClass' param", - set.contains("enumClass")); - Assert.assertEquals( + assertEquals(params.size(), 5, "Expected to get 5 different params elements"); + assertTrue( + set.contains("catalog"), + "Can't find 'catalog' param"); + assertEquals("", params.get("catalog")); + assertTrue( + set.contains("column"), + "Can't find 'column' param"); + assertEquals("STATUS", params.get("column")); + assertTrue( + set.contains("table"), + "Can't find 'table' param"); + assertEquals("ORDERS", params.get("table")); + assertTrue( + set.contains("schema"), + "Can't find 'schema' param"); + assertEquals("", params.get("schema")); + assertTrue( + set.contains("enumClass"), + "Can't find 'enumClass' param"); + assertEquals( "org.hibernate.tool.hbm2x.hbm2hbmxml.Order$Status", params.get("enumClass")); - Assert.assertTrue("property name should not have any type element",nameElement.getElementsByTagName("type").getLength() == 0); - Assert.assertEquals(nameElement.getAttribute("type"), "string"); + assertTrue(nameElement.getElementsByTagName("type").getLength() == 0, "property name should not have any type element"); + assertEquals(nameElement.getAttribute("type"), "string"); } } From d4773929619f8fd9feb31c2a9c1053a2f6e58c10 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 16:34:33 +0200 Subject: [PATCH 236/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2HibernateDAOTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/Hbm2HibernateDAOTest/TestCase.java | 66 ++++++++++++------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java index 40c382c8a2..a9a7cb2dd6 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2HibernateDAOTest; +import static org.junit.jupiter.api.Assertions.assertNull; + import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -19,11 +37,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -36,26 +52,26 @@ public class TestCase { "Author.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private File outputDir = null; + @TempDir + public File outputFolder = new File("output"); + + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); POJOExporter javaExporter = new POJOExporter(); javaExporter.setMetadataDescriptor(metadataDescriptor); - javaExporter.setOutputDirectory(outputDir); + javaExporter.setOutputDirectory(srcDir); POJOExporter exporter = new DAOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.getProperties().setProperty("ejb3", "false"); exporter.getProperties().setProperty("jdk5", "true"); exporter.start(); @@ -65,22 +81,22 @@ public void setUp() throws Exception { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/ArticleHome.java") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/AuthorHome.java") ); } @Test public void testCompilable() throws IOException { - File compiled = new File(temporaryFolder.getRoot(), "compiled"); + File compiled = new File(outputFolder, "compiled"); compiled.mkdir(); - FileUtil.generateNoopComparator(outputDir); + FileUtil.generateNoopComparator(srcDir); List jars = new ArrayList(); jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api jars.add(JavaUtil.resolvePathToJarFileFor(Version.class)); // for hibernate core - JavaUtil.compile(outputDir, compiled, jars); + JavaUtil.compile(srcDir, compiled, jars); JUnitUtil.assertIsNonEmptyFile(new File( compiled, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/AuthorHome.class") ); @@ -100,12 +116,12 @@ public void testCompilable() throws IOException { @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", - new File(outputDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/ArticleHome.java"))); - Assert.assertNull(FileUtil.findFirstString( + new File(srcDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/ArticleHome.java"))); + assertNull(FileUtil.findFirstString( "$", - new File(outputDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/AuthorHome.java") ) ); + new File(srcDir, "org/hibernate/tool/hbm2x/Hbm2HibernateDAOTest/AuthorHome.java") ) ); } } From 981f694574529476fe0bf0ba6468f06fc2ed8d42 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 16:51:41 +0200 Subject: [PATCH 237/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaConstructorTest.TestCase' Signed-off-by: Koen Aers --- .../Hbm2JavaConstructorTest/TestCase.java | 99 +++++++++++-------- 1 file changed, 59 insertions(+), 40 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaConstructorTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaConstructorTest/TestCase.java index cf812b235a..1ccd15d943 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaConstructorTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaConstructorTest/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2JavaConstructorTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.nio.file.Files; import java.util.HashSet; @@ -22,11 +43,9 @@ import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -38,26 +57,26 @@ public class TestCase { "Constructors.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; private Metadata metadata = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); metadata = metadataDescriptor.createMetadata(); Exporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); } @@ -65,28 +84,28 @@ public void setUp() throws Exception { public void testCompilable() throws Exception { String constructorUsageResourcePath = "/org/hibernate/tool/hbm2x/Hbm2JavaConstructorTest/ConstructorUsage.java_"; File constructorUsageOrigin = new File(getClass().getResource(constructorUsageResourcePath).toURI()); - File constructorUsageDestination = new File(outputDir, "ConstructorUsage.java"); - File targetDir = new File(temporaryFolder.getRoot(), "compilerOutput" ); + File constructorUsageDestination = new File(srcDir, "ConstructorUsage.java"); + File targetDir = new File(outputFolder, "compilerOutput" ); targetDir.mkdir(); Files.copy(constructorUsageOrigin.toPath(), constructorUsageDestination.toPath()); - JavaUtil.compile(outputDir, targetDir); - Assert.assertTrue(new File(targetDir, "ConstructorUsage.class").exists()); - Assert.assertTrue(new File(targetDir, "Company.class").exists()); - Assert.assertTrue(new File(targetDir, "BigCompany.class").exists()); - Assert.assertTrue(new File(targetDir, "EntityAddress.class").exists()); + JavaUtil.compile(srcDir, targetDir); + assertTrue(new File(targetDir, "ConstructorUsage.class").exists()); + assertTrue(new File(targetDir, "Company.class").exists()); + assertTrue(new File(targetDir, "BigCompany.class").exists()); + assertTrue(new File(targetDir, "EntityAddress.class").exists()); } @Test public void testNoVelocityLeftOvers() { - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", - new File(outputDir, "Company.java" ) ) ); - Assert.assertNull(FileUtil.findFirstString( + new File(srcDir, "Company.java" ) ) ); + assertNull(FileUtil.findFirstString( "$", - new File(outputDir,"BigCompany.java" ) ) ); - Assert.assertNull(FileUtil.findFirstString( + new File(srcDir,"BigCompany.java" ) ) ); + assertNull(FileUtil.findFirstString( "$", - new File(outputDir,"EntityAddress.java" ) ) ); + new File(srcDir,"EntityAddress.java" ) ) ); } @Test @@ -95,31 +114,31 @@ public void testEntityConstructorLogic() { POJOClass company = c2j.getPOJOClass(metadata.getEntityBinding("Company")); List all = company.getPropertyClosureForFullConstructor(); assertNoDuplicates(all); - Assert.assertEquals(3, all.size()); + assertEquals(3, all.size()); List superCons = company.getPropertyClosureForSuperclassFullConstructor(); - Assert.assertEquals("company is a base class, should not have superclass cons",0, superCons.size()); + assertEquals(0, superCons.size(), "company is a base class, should not have superclass cons"); List subCons = company.getPropertiesForFullConstructor(); assertNoDuplicates(subCons); - Assert.assertEquals(3, subCons.size()); + assertEquals(3, subCons.size()); assertNoOverlap(superCons, subCons); POJOClass bigCompany = c2j.getPOJOClass(metadata.getEntityBinding("BigCompany")); List bigsuperCons = bigCompany.getPropertyClosureForSuperclassFullConstructor(); assertNoDuplicates(bigsuperCons); //assertEquals(3, bigsuperCons.size()); List bigsubCons = bigCompany.getPropertiesForFullConstructor(); - Assert.assertEquals(1, bigsubCons.size()); + assertEquals(1, bigsubCons.size()); assertNoOverlap(bigsuperCons, bigsubCons); List bigall = bigCompany.getPropertyClosureForFullConstructor(); assertNoDuplicates(bigall); - Assert.assertEquals(4, bigall.size()); + assertEquals(4, bigall.size()); PersistentClass classMapping = metadata.getEntityBinding("Person"); POJOClass person = c2j.getPOJOClass(classMapping); List propertiesForMinimalConstructor = person.getPropertiesForMinimalConstructor(); - Assert.assertEquals(2,propertiesForMinimalConstructor.size()); - Assert.assertFalse(propertiesForMinimalConstructor.contains(classMapping.getIdentifierProperty())); + assertEquals(2,propertiesForMinimalConstructor.size()); + assertFalse(propertiesForMinimalConstructor.contains(classMapping.getIdentifierProperty())); List propertiesForFullConstructor = person.getPropertiesForFullConstructor(); - Assert.assertEquals(2,propertiesForFullConstructor.size()); - Assert.assertFalse(propertiesForFullConstructor.contains(classMapping.getIdentifierProperty())); + assertEquals(2,propertiesForFullConstructor.size()); + assertFalse(propertiesForFullConstructor.contains(classMapping.getIdentifierProperty())); } @Test @@ -128,22 +147,22 @@ public void testMinimal() { metadata.getEntityBinding("BrandProduct"), new Cfg2JavaTool()); List propertiesForMinimalConstructor = bp.getPropertiesForMinimalConstructor(); - Assert.assertEquals(1,propertiesForMinimalConstructor.size()); + assertEquals(1,propertiesForMinimalConstructor.size()); List propertiesForFullConstructor = bp.getPropertiesForFullConstructor(); - Assert.assertEquals(2, propertiesForFullConstructor.size()); + assertEquals(2, propertiesForFullConstructor.size()); } private void assertNoDuplicates(List bigall) { Set set = new HashSet(); set.addAll(bigall); - Assert.assertEquals("list had duplicates!",set.size(),bigall.size()); + assertEquals(set.size(),bigall.size(), "list had duplicates!"); } private void assertNoOverlap(List first, List second) { Set set = new HashSet(); set.addAll(first); set.addAll(second); - Assert.assertEquals(set.size(),first.size()+second.size()); + assertEquals(set.size(),first.size()+second.size()); } } From 7f6c8a32ad13d7d8273991bcbd4b6faaf560f153 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 17:42:01 +0200 Subject: [PATCH 238/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaDidirectionalIndexedCollectionMappingTest.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaDidirectionalIndexedCollectionMappingTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaDidirectionalIndexedCollectionMappingTest/TestCase.java index ccea98c70f..8fa5a9d9cd 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaDidirectionalIndexedCollectionMappingTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaDidirectionalIndexedCollectionMappingTest/TestCase.java @@ -1,20 +1,36 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2JavaDidirectionalIndexedCollectionMappingTest; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.Exporter; import org.hibernate.tool.hbm2x.POJOExporter; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -26,30 +42,30 @@ public class TestCase { "GenericModel.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); } @Test public void testReflection() throws Exception { - Assert.assertTrue(new File(outputDir, "GenericObject.java").exists()); - Assert.assertTrue(new File(outputDir, "GenericValue.java").exists()); + assertTrue(new File(srcDir, "GenericObject.java").exists()); + assertTrue(new File(srcDir, "GenericValue.java").exists()); } } From 802fb92b26877098478d85d34d765e246e32a4e1 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 17:58:46 +0200 Subject: [PATCH 239/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaEjb3Test.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/Hbm2JavaEjb3Test/TestCase.java | 127 ++++++++++-------- 1 file changed, 73 insertions(+), 54 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TestCase.java index b836db861d..cb9b387eae 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2JavaEjb3Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.util.ArrayList; import java.util.List; @@ -25,11 +46,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -44,27 +63,27 @@ public class TestCase { "Passenger.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private File outputDir = null; + @TempDir + public File outputFolder = new File("output"); + + private File srcDir = null; private File resourcesDir = null; private Metadata metadata = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); metadata = metadataDescriptor.createMetadata(); - FileUtil.generateNoopComparator(outputDir); + FileUtil.generateNoopComparator(srcDir); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.setTemplatePath(new String[0]); exporter.getProperties().setProperty("ejb3", "true"); exporter.getProperties().setProperty("jdk5", "true"); @@ -74,41 +93,41 @@ public void setUp() throws Exception { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/Author.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/Article.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/Train.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/Passenger.java") ); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TransportationPk.java") ); } @Test public void testBasicComponent() { - Assert.assertEquals( + assertEquals( "@Embeddable", FileUtil.findFirstString( "@Embeddable", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/TransportationPk.java"))); } @Test public void testCompile() { - File compiled = new File(temporaryFolder.getRoot(), "compiled"); + File compiled = new File(outputFolder, "compiled"); compiled.mkdir(); List jars = new ArrayList(); jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api jars.add(JavaUtil.resolvePathToJarFileFor(Version.class)); // for hibernate core - JavaUtil.compile(outputDir, compiled, jars); + JavaUtil.compile(srcDir, compiled, jars); JUnitUtil.assertIsNonEmptyFile(new File( compiled, "comparator/NoopComparator.class") ); @@ -133,10 +152,10 @@ public void testCompile() { public void testEqualsHashCode() { PersistentClass classMapping = metadata.getEntityBinding("org.hibernate.tool.hbm2x.Hbm2JavaEjb3Test.Passenger"); POJOClass clazz = new Cfg2JavaTool().getPOJOClass(classMapping); - Assert.assertFalse(clazz.needsEqualsHashCode()); + assertFalse(clazz.needsEqualsHashCode()); classMapping = metadata.getEntityBinding("org.hibernate.tool.hbm2x.Hbm2JavaEjb3Test.Article"); clazz = new Cfg2JavaTool().getPOJOClass(classMapping); - Assert.assertTrue(clazz.needsEqualsHashCode()); + assertTrue(clazz.needsEqualsHashCode()); } @Test @@ -146,30 +165,30 @@ public void testAnnotationColumnDefaults() { POJOClass clazz = cfg2java.getPOJOClass(classMapping); Property p = classMapping.getProperty("content"); String string = clazz.generateAnnColumnAnnotation( p ); - Assert.assertNotNull(string); - Assert.assertEquals(-1, string.indexOf("unique=")); - Assert.assertTrue(string.indexOf("nullable=")>=0); - Assert.assertEquals(-1, string.indexOf("insertable=")); - Assert.assertEquals(-1, string.indexOf("updatable=")); - Assert.assertTrue(string.indexOf("length=10000")>0); + assertNotNull(string); + assertEquals(-1, string.indexOf("unique=")); + assertTrue(string.indexOf("nullable=")>=0); + assertEquals(-1, string.indexOf("insertable=")); + assertEquals(-1, string.indexOf("updatable=")); + assertTrue(string.indexOf("length=10000")>0); p = classMapping.getProperty("name"); string = clazz.generateAnnColumnAnnotation( p ); - Assert.assertNotNull(string); - Assert.assertEquals(-1, string.indexOf("unique=")); - Assert.assertTrue(string.indexOf("nullable=")>=0); - Assert.assertEquals(-1, string.indexOf("insertable=")); - Assert.assertTrue(string.indexOf("updatable=false")>0); - Assert.assertTrue(string.indexOf("length=100")>0); + assertNotNull(string); + assertEquals(-1, string.indexOf("unique=")); + assertTrue(string.indexOf("nullable=")>=0); + assertEquals(-1, string.indexOf("insertable=")); + assertTrue(string.indexOf("updatable=false")>0); + assertTrue(string.indexOf("length=100")>0); classMapping = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaEjb3Test.Train" ); clazz = cfg2java.getPOJOClass(classMapping); p = classMapping.getProperty( "name" ); string = clazz.generateAnnColumnAnnotation( p ); - Assert.assertNotNull(string); - Assert.assertTrue(string.indexOf("unique=true")>0); - Assert.assertTrue(string.indexOf("nullable=")>=0); - Assert.assertEquals(-1, string.indexOf("insertable=")); - Assert.assertEquals(-1,string.indexOf("updatable=")); - Assert.assertEquals(-1, string.indexOf("length=")); + assertNotNull(string); + assertTrue(string.indexOf("unique=true")>0); + assertTrue(string.indexOf("nullable=")>=0); + assertEquals(-1, string.indexOf("insertable=")); + assertEquals(-1,string.indexOf("updatable=")); + assertEquals(-1, string.indexOf("length=")); } @Test @@ -178,36 +197,36 @@ public void testEmptyCascade() { Cfg2JavaTool cfg2java = new Cfg2JavaTool(); EntityPOJOClass clazz = (EntityPOJOClass) cfg2java.getPOJOClass(classMapping); Property property = classMapping.getProperty( "author" ); - Assert.assertEquals(0, clazz.getCascadeTypes( property ).length); - Assert.assertEquals( + assertEquals(0, clazz.getCascadeTypes( property ).length); + assertEquals( null, FileUtil.findFirstString( "cascade={}", new File( - outputDir, + srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEjb3Test/Article.java") )); } @Test public void testAnnotationBuilder() { AnnotationBuilder builder = AnnotationBuilder.createAnnotation("SingleCleared").resetAnnotation( "Single" ); - Assert.assertEquals("@Single", builder.getResult()); + assertEquals("@Single", builder.getResult()); builder = AnnotationBuilder.createAnnotation("javax.persistence.OneToMany") .addAttribute("willbecleared", (String)null) .resetAnnotation("javax.persistence.OneToMany") .addAttribute("cascade", new String[] { "val1", "val2"}) .addAttribute("fetch", "singleValue"); - Assert.assertEquals("@javax.persistence.OneToMany(cascade={val1, val2}, fetch=singleValue)", builder.getResult()); + assertEquals("@javax.persistence.OneToMany(cascade={val1, val2}, fetch=singleValue)", builder.getResult()); builder = AnnotationBuilder.createAnnotation("javax.persistence.OneToMany"); builder.addAttribute("cascade", (String[])null); builder.addAttribute("fetch", (String)null); - Assert.assertEquals("@javax.persistence.OneToMany", builder.getResult()); + assertEquals("@javax.persistence.OneToMany", builder.getResult()); builder = AnnotationBuilder.createAnnotation("abc"); ArrayList list = new ArrayList(); list.add(new Integer(42)); list.add( new String("xxx") ); builder.addQuotedAttributes( "it", list.iterator() ); - Assert.assertEquals("@abc(it={\"42\", \"xxx\"})", builder.getResult()); + assertEquals("@abc(it={\"42\", \"xxx\"})", builder.getResult()); List columns = new ArrayList(); columns.add("first"); columns.add("second"); @@ -219,8 +238,8 @@ public String transform(String object) { }); constraint.addAttribute( "single", "value" ); String attribute = constraint.getAttributeAsString("columnNames"); - Assert.assertEquals("{\"first\", \"second\"}", attribute); - Assert.assertEquals("value", constraint.getAttributeAsString( "single" )); + assertEquals("{\"first\", \"second\"}", attribute); + assertEquals("value", constraint.getAttributeAsString( "single" )); } } From ca3c8976caf5a556be476010c5a91fb163b45a0a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 18:15:04 +0200 Subject: [PATCH 240/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaEqualsTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/Hbm2JavaEqualsTest/TestCase.java | 91 ++++++++++++------- 1 file changed, 56 insertions(+), 35 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEqualsTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEqualsTest/TestCase.java index feb3618a99..fb995b734b 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEqualsTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaEqualsTest/TestCase.java @@ -1,5 +1,28 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.Hbm2JavaEqualsTest; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.FileWriter; import java.lang.reflect.InvocationHandler; @@ -16,11 +39,9 @@ import org.hibernate.tool.hbm2x.POJOExporter; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { @@ -44,18 +65,18 @@ public class TestCase { " int getId(); "+ System.lineSeparator() + "} "; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { // create output folder - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); // export class ProxiedTestEntity.java and UnProxiedTestEntity File hbmXml = new File(resourcesDir, "testEntity.hbm.xml"); @@ -68,21 +89,21 @@ public void setUp() throws Exception { .createNativeDescriptor(null, new File[] { hbmXml }, properties); Exporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.start(); // copy interface EntityProxy.java - File file = new File(outputDir, "org/hibernate/tool/hbm2x/Hbm2JavaEquals/TestEntityProxy.java"); + File file = new File(srcDir, "org/hibernate/tool/hbm2x/Hbm2JavaEquals/TestEntityProxy.java"); FileWriter writer = new FileWriter(file); writer.write(TEST_ENTITY_PROXY_JAVA); writer.close(); // compile the source files - JavaUtil.compile(outputDir); + JavaUtil.compile(srcDir); } @Test public void testEqualsWithoutProxy() throws Exception { // load the entity class and lookup the setId method - URL[] urls = new URL[] { outputDir.toURI().toURL() }; + URL[] urls = new URL[] { srcDir.toURI().toURL() }; ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader ucl = new URLClassLoader(urls, oldLoader ); Class entityClass = ucl.loadClass("org.hibernate.tool.hbm2x.Hbm2JavaEquals.UnProxiedTestEntity"); @@ -94,20 +115,20 @@ public void testEqualsWithoutProxy() throws Exception { // - 'false' when comparing against an object of a different class Object firstEntity = entityClass.newInstance(); setId.invoke(firstEntity, new Object[] { Integer.MAX_VALUE }); - Assert.assertTrue(firstEntity.equals(firstEntity)); - Assert.assertFalse(firstEntity.equals(null)); - Assert.assertFalse(firstEntity.equals(new Object())); + assertTrue(firstEntity.equals(firstEntity)); + assertFalse(firstEntity.equals(null)); + assertFalse(firstEntity.equals(new Object())); // create a second entity and check the 'normal behavior // - 'true' if the id property is the same // - 'false' if the id property is different Object secondEntity = entityClass.newInstance(); setId.invoke(secondEntity, new Object[] { Integer.MAX_VALUE }); - Assert.assertTrue(firstEntity.equals(secondEntity)); - Assert.assertTrue(secondEntity.equals(firstEntity)); + assertTrue(firstEntity.equals(secondEntity)); + assertTrue(secondEntity.equals(firstEntity)); setId.invoke(secondEntity, new Object[] { Integer.MIN_VALUE }); - Assert.assertFalse(firstEntity.equals(secondEntity)); - Assert.assertFalse(secondEntity.equals(firstEntity)); + assertFalse(firstEntity.equals(secondEntity)); + assertFalse(secondEntity.equals(firstEntity)); ucl.close(); } @@ -116,7 +137,7 @@ public void testEqualsWithoutProxy() throws Exception { public void testEqualsWithProxy() throws Exception { // load the entity and proxy classes, lookup the setId method and create a proxy object - URL[] urls = new URL[] { outputDir.toURI().toURL() }; + URL[] urls = new URL[] { srcDir.toURI().toURL() }; ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); URLClassLoader ucl = new URLClassLoader(urls, oldLoader ); Class entityClass = ucl.loadClass("org.hibernate.tool.hbm2x.Hbm2JavaEquals.ProxiedTestEntity"); @@ -134,28 +155,28 @@ public void testEqualsWithProxy() throws Exception { // - 'false' when comparing against an object of a different class (that is not the proxy class) Object firstEntity = entityClass.newInstance(); setId.invoke(firstEntity, new Object[] { Integer.MAX_VALUE }); - Assert.assertTrue(firstEntity.equals(firstEntity)); - Assert.assertFalse(firstEntity.equals(null)); - Assert.assertFalse(firstEntity.equals(new Object())); + assertTrue(firstEntity.equals(firstEntity)); + assertFalse(firstEntity.equals(null)); + assertFalse(firstEntity.equals(new Object())); // create a second proxied entity and check the 'normal behavior // - 'true' if the id property is the same // - 'false' if the id property is different Object secondEntity = entityClass.newInstance(); setId.invoke(secondEntity, new Object[] { Integer.MAX_VALUE }); - Assert.assertTrue(firstEntity.equals(secondEntity)); - Assert.assertTrue(secondEntity.equals(firstEntity)); + assertTrue(firstEntity.equals(secondEntity)); + assertTrue(secondEntity.equals(firstEntity)); setId.invoke(secondEntity, new Object[] { Integer.MIN_VALUE }); - Assert.assertFalse(firstEntity.equals(secondEntity)); - Assert.assertFalse(secondEntity.equals(firstEntity)); + assertFalse(firstEntity.equals(secondEntity)); + assertFalse(secondEntity.equals(firstEntity)); // compare both proxied entities with the proxy handler.id = Integer.MAX_VALUE; - Assert.assertTrue(firstEntity.equals(testEntityProxy)); - Assert.assertFalse(secondEntity.equals(testEntityProxy)); + assertTrue(firstEntity.equals(testEntityProxy)); + assertFalse(secondEntity.equals(testEntityProxy)); handler.id = Integer.MIN_VALUE; - Assert.assertFalse(firstEntity.equals(testEntityProxy)); - Assert.assertTrue(secondEntity.equals(testEntityProxy)); + assertFalse(firstEntity.equals(testEntityProxy)); + assertTrue(secondEntity.equals(testEntityProxy)); ucl.close(); } From d50c624da93405592f3bf57ec723ee28e8c045a8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 29 Jun 2021 18:29:32 +0200 Subject: [PATCH 241/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaInitializationTest.TestCase' Signed-off-by: Koen Aers --- .../Hbm2JavaInitializationTest/TestCase.java | 108 +++++++++++------- 1 file changed, 64 insertions(+), 44 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaInitializationTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaInitializationTest/TestCase.java index 596661a580..cbca11ca2b 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaInitializationTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaInitializationTest/TestCase.java @@ -1,9 +1,31 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2JavaInitializationTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; + import org.hibernate.boot.Metadata; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; @@ -11,11 +33,9 @@ import org.hibernate.tool.hbm2x.pojo.ImportContextImpl; import org.hibernate.tool.hbm2x.pojo.POJOClass; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -30,18 +50,18 @@ public class TestCase { "Passenger.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + private Metadata metadata = null; - @Before + @BeforeEach public void setUp() throws Exception { metadata = HibernateUtil .initializeMetadataDescriptor( this, HBM_XML_FILES, - temporaryFolder.getRoot()) + outputFolder) .createMetadata(); } @@ -51,47 +71,47 @@ public void testFieldInitializationAndTypeNames() { Cfg2JavaTool cfg2java = new Cfg2JavaTool(); POJOClass clazz = cfg2java.getPOJOClass(classMapping); Property p = classMapping.getProperty("AMap"); - Assert.assertEquals("all types should be fully qualified when no importcontext","java.util.Map",cfg2java.getJavaTypeName(p, true)); - Assert.assertEquals("Map",cfg2java.getJavaTypeName(p, true, clazz)); - Assert.assertEquals("new HashMap(0)", clazz.getFieldInitialization(p, true)); - Assert.assertEquals("new HashMap(0)", clazz.getFieldInitialization(p, false)); + assertEquals("java.util.Map",cfg2java.getJavaTypeName(p, true), "all types should be fully qualified when no importcontext"); + assertEquals("Map",cfg2java.getJavaTypeName(p, true, clazz)); + assertEquals("new HashMap(0)", clazz.getFieldInitialization(p, true)); + assertEquals("new HashMap(0)", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("aList"); - Assert.assertEquals("lists should not have the index visible in the declaration", "List
",cfg2java.getJavaTypeName(p, true, clazz)); - Assert.assertEquals("all types should be fully qualified when no importcontext","java.util.List",cfg2java.getJavaTypeName(p, true)); - Assert.assertEquals("new ArrayList
(0)", clazz.getFieldInitialization(p, true)); - Assert.assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); + assertEquals("List
",cfg2java.getJavaTypeName(p, true, clazz), "lists should not have the index visible in the declaration"); + assertEquals("java.util.List",cfg2java.getJavaTypeName(p, true), "all types should be fully qualified when no importcontext"); + assertEquals("new ArrayList
(0)", clazz.getFieldInitialization(p, true)); + assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("content"); - Assert.assertEquals("\"what can I say\"",clazz.getFieldInitialization(p, false)); + assertEquals("\"what can I say\"",clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("bagarticles"); - Assert.assertEquals("Should be a list via property-type", "java.util.List", cfg2java.getJavaTypeName( p, false )); - Assert.assertEquals("Should be a a generic'd list when generics=true", "java.util.List", cfg2java.getJavaTypeName( p, true )); - Assert.assertEquals("List
",cfg2java.getJavaTypeName(p, true, clazz)); - Assert.assertEquals("new ArrayList
(0)", clazz.getFieldInitialization(p, true)); - Assert.assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); + assertEquals("java.util.List", cfg2java.getJavaTypeName( p, false ), "Should be a list via property-type"); + assertEquals("java.util.List", cfg2java.getJavaTypeName( p, true ), "Should be a a generic'd list when generics=true"); + assertEquals("List
",cfg2java.getJavaTypeName(p, true, clazz)); + assertEquals("new ArrayList
(0)", clazz.getFieldInitialization(p, true)); + assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("bagstrings"); - Assert.assertEquals("Bag's are just a collection", "java.util.Collection", cfg2java.getJavaTypeName( p, false )); - Assert.assertEquals("Should be a a generic'd collection when generics=true", "java.util.Collection", cfg2java.getJavaTypeName( p, true )); - Assert.assertEquals("Collection",cfg2java.getJavaTypeName(p, true, clazz)); - Assert.assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, true)); - Assert.assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); + assertEquals("java.util.Collection", cfg2java.getJavaTypeName( p, false ), "Bag's are just a collection"); + assertEquals("java.util.Collection", cfg2java.getJavaTypeName( p, true ), "Should be a a generic'd collection when generics=true"); + assertEquals("Collection",cfg2java.getJavaTypeName(p, true, clazz)); + assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, true)); + assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("bagstrings"); - Assert.assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); + assertEquals("new ArrayList(0)", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("naturalSortedArticlesMap"); - Assert.assertEquals("java.util.SortedMap", cfg2java.getJavaTypeName( p, false)); - Assert.assertEquals("SortedMap", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); - Assert.assertEquals("new TreeMap()", clazz.getFieldInitialization(p, true)); - Assert.assertEquals("new TreeMap()", clazz.getFieldInitialization(p, false)); + assertEquals("java.util.SortedMap", cfg2java.getJavaTypeName( p, false)); + assertEquals("SortedMap", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); + assertEquals("new TreeMap()", clazz.getFieldInitialization(p, true)); + assertEquals("new TreeMap()", clazz.getFieldInitialization(p, false)); p = classMapping.getProperty("sortedArticlesMap"); - Assert.assertEquals("java.util.SortedMap", cfg2java.getJavaTypeName( p, false)); - Assert.assertEquals("SortedMap", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); - Assert.assertFalse(clazz.generateImports().contains("import comparator.NoopComparator;")); - Assert.assertEquals("new TreeMap(new NoopComparator())", clazz.getFieldInitialization(p, false)); - Assert.assertTrue(clazz.generateImports().contains("import comparator.NoopComparator;")); - Assert.assertEquals("new TreeMap(new NoopComparator())", clazz.getFieldInitialization(p, true)); + assertEquals("java.util.SortedMap", cfg2java.getJavaTypeName( p, false)); + assertEquals("SortedMap", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); + assertFalse(clazz.generateImports().contains("import comparator.NoopComparator;")); + assertEquals("new TreeMap(new NoopComparator())", clazz.getFieldInitialization(p, false)); + assertTrue(clazz.generateImports().contains("import comparator.NoopComparator;")); + assertEquals("new TreeMap(new NoopComparator())", clazz.getFieldInitialization(p, true)); p = classMapping.getProperty("sortedArticlesSet"); - Assert.assertEquals("java.util.SortedSet", cfg2java.getJavaTypeName( p, false)); - Assert.assertEquals("SortedSet
", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); - Assert.assertEquals("new TreeSet
(new NoopComparator())", clazz.getFieldInitialization(p, true)); + assertEquals("java.util.SortedSet", cfg2java.getJavaTypeName( p, false)); + assertEquals("SortedSet
", cfg2java.getJavaTypeName( p, true, new ImportContextImpl("") )); + assertEquals("new TreeSet
(new NoopComparator())", clazz.getFieldInitialization(p, true)); } } From fa5552a7951760a8d5762556d04d9a3495238f23 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 09:41:07 +0200 Subject: [PATCH 242/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.Hbm2JavaTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/Hbm2JavaTest/DummyDateType.java | 20 ++ .../tool/hbm2x/Hbm2JavaTest/TestCase.java | 337 +++++++++--------- 2 files changed, 198 insertions(+), 159 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/DummyDateType.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/DummyDateType.java index 43fbf89ea5..3cbb1147b5 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/DummyDateType.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/DummyDateType.java @@ -1,3 +1,23 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.Hbm2JavaTest; import java.io.Serializable; diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/TestCase.java index c8678b4a29..d77264dcab 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/Hbm2JavaTest/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.Hbm2JavaTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.nio.file.Files; import java.util.HashMap; @@ -31,12 +52,10 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -54,26 +73,26 @@ public class TestCase { "Passenger.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + private Metadata metadata = null; private MetadataDescriptor metadataDescriptor = null; - private File outputDir = null; + private File scDir = null; private File resourcesDir = null; private ArtifactCollector artifactCollector = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + scDir = new File(outputFolder, "output"); + scDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); metadata = metadataDescriptor.createMetadata(); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(scDir); artifactCollector = new ArtifactCollector(); exporter.setArtifactCollector(artifactCollector); exporter.start(); @@ -82,60 +101,60 @@ public void setUp() throws Exception { @Test public void testFileExistence() { JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Customer.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/LineItem.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Order.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Train.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Passenger.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Product.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "generated/BaseHelloWorld.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "HelloUniverse.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/FatherComponent.java")); JUnitUtil.assertIsNonEmptyFile(new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/ChildComponent.java")); - Assert.assertEquals(15, artifactCollector.getFileCount("java")); + assertEquals(15, artifactCollector.getFileCount("java")); } // TODO Re-enable this test: HBX-1248 - @Ignore + @Disabled @Test public void testCompilable() throws Exception { String helloWorldResourcePath = "/org/hibernate/tool/hbm2x/Hbm2JavaTest/HelloWorld.java_"; File helloWorldOrigin = new File(getClass().getResource(helloWorldResourcePath).toURI()); - File helloWorldDestination = new File(outputDir, "HelloWorld.java"); - File targetDir = new File(temporaryFolder.getRoot(), "compilerOutput" ); + File helloWorldDestination = new File(scDir, "HelloWorld.java"); + File targetDir = new File(outputFolder, "compilerOutput" ); targetDir.mkdir(); Files.copy(helloWorldOrigin.toPath(), helloWorldDestination.toPath()); - JavaUtil.compile(outputDir, targetDir); - Assert.assertTrue(new File(targetDir, "HelloWorld.class").exists()); + JavaUtil.compile(scDir, targetDir); + assertTrue(new File(targetDir, "HelloWorld.class").exists()); } // TODO Implement HBX-606 so that the following test succeeds - @Ignore + @Disabled @Test public void testParentComponentFailureExpected() { File file = new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/FatherComponent.java"); - Assert.assertEquals( + assertEquals( "test", FileUtil.findFirstString( "testParent", @@ -144,30 +163,30 @@ public void testParentComponentFailureExpected() { @Test public void testNoFreeMarkerLeftOvers() { - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Customer.java"))); - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/LineItem.java"))); - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Order.java"))); - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Product.java"))); - Assert.assertNull(FileUtil.findFirstString( + assertNull(FileUtil.findFirstString( "$", new File( - outputDir, + scDir, "org/hibernate/tool/hbm2x/Hbm2JavaTest/Address.java"))); } @@ -176,36 +195,36 @@ public void testPackageName() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass classMapping = metadata.getEntityBinding("org.hibernate.tool.hbm2x.Hbm2JavaTest.Order"); POJOClass pc = c2j.getPOJOClass(classMapping); - Assert.assertEquals( "org.hibernate.tool.hbm2x.Hbm2JavaTest", pc.getPackageName() ); - Assert.assertEquals( "package org.hibernate.tool.hbm2x.Hbm2JavaTest;", pc.getPackageDeclaration() ); - Assert.assertEquals( - "did not honor generated-class", + assertEquals( "org.hibernate.tool.hbm2x.Hbm2JavaTest", pc.getPackageName() ); + assertEquals( "package org.hibernate.tool.hbm2x.Hbm2JavaTest;", pc.getPackageDeclaration() ); + assertEquals( "package generated;", c2j.getPOJOClass(metadata.getEntityBinding("HelloWorld")) - .getPackageDeclaration()); + .getPackageDeclaration(), + "did not honor generated-class"); } // TODO Re-enable this test: HBX-1242 - @Ignore + @Disabled @Test public void testFieldNotThere() { - Assert.assertNull(FileUtil.findFirstString( - "notgenerated", + assertNull(FileUtil.findFirstString( + "notgenerated", new File( - outputDir, + scDir, "HelloUniverse.java"))); } @Test public void testJavaDoc() { Cfg2JavaTool c2j = new Cfg2JavaTool(); - Assert.assertEquals( " * test", c2j.toJavaDoc( "test", 0 ) ); - Assert.assertEquals( " * test", c2j.toJavaDoc( "test", 2 ) ); - Assert.assertEquals( " * test\n * me", c2j.toJavaDoc( "test\nme", 2 ) ); + assertEquals( " * test", c2j.toJavaDoc( "test", 0 ) ); + assertEquals( " * test", c2j.toJavaDoc( "test", 2 ) ); + assertEquals( " * test\n * me", c2j.toJavaDoc( "test\nme", 2 ) ); PersistentClass local = metadata.getEntityBinding( "HelloWorld" ); POJOClass pc = c2j.getPOJOClass(local); - Assert.assertEquals( " * Hey there", pc.getClassJavaDoc( "fallback", 0 ) ); - Assert.assertEquals( + assertEquals( " * Hey there", pc.getClassJavaDoc( "fallback", 0 ) ); + assertEquals( " * Test Field Description", pc.getFieldJavaDoc(local.getIdentifierProperty(), 0 ) ); } @@ -213,11 +232,11 @@ public void testJavaDoc() { @Test public void testExtraCode() { Cfg2JavaTool c2j = new Cfg2JavaTool(); - Assert.assertFalse(c2j.hasMetaAttribute( + assertFalse(c2j.hasMetaAttribute( metadata.getEntityBinding("HelloWorld" ), "class-code" ) ); PersistentClass classMapping = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); - Assert.assertEquals( + assertEquals( "// extra code line 1\n// extra code line 2\n{ Collator.getInstance(); }", c2j.getPOJOClass(classMapping).getExtraClassCode() ); } @@ -227,8 +246,8 @@ public void testScope() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); - Assert.assertEquals( "public strictfp", c2j.getClassModifiers( pc ) ); - Assert.assertEquals("public", c2j.getClassModifiers(metadata.getEntityBinding( "HelloWorld" ) ) ); + assertEquals( "public strictfp", c2j.getClassModifiers( pc ) ); + assertEquals("public", c2j.getClassModifiers(metadata.getEntityBinding( "HelloWorld" ) ) ); } @Test @@ -236,8 +255,8 @@ public void testDeclarationType() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); - Assert.assertEquals( "class", c2j.getPOJOClass(pc).getDeclarationType() ); - Assert.assertEquals( "interface", c2j.getPOJOClass(metadata.getEntityBinding( "HelloWorld" ) ).getDeclarationType() ); + assertEquals( "class", c2j.getPOJOClass(pc).getDeclarationType() ); + assertEquals( "interface", c2j.getPOJOClass(metadata.getEntityBinding( "HelloWorld" ) ).getDeclarationType() ); } @Test @@ -246,7 +265,7 @@ public void testTypeName() { PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); Property property = pc.getProperty( "lineItems" ); - Assert.assertEquals( "java.util.Collection", c2j.getJavaTypeName( property, false ) ); + assertEquals( "java.util.Collection", c2j.getJavaTypeName( property, false ) ); } @Test @@ -255,34 +274,34 @@ public void testUseRawTypeNullability() { PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Product" ); Property property = pc.getProperty( "numberAvailable" ); - Assert.assertFalse( property.getValue().isNullable() ); - Assert.assertEquals( - "typename should be used when rawtypemode", + assertFalse( property.getValue().isNullable() ); + assertEquals( "int", - c2j.getJavaTypeName( property, false ) ); + c2j.getJavaTypeName( property, false ), + "typename should be used when rawtypemode"); property = pc.getProperty( "minStock" ); - Assert.assertTrue( property.getValue().isNullable() ); - Assert.assertEquals( - "typename should be used when rawtypemode", + assertTrue( property.getValue().isNullable() ); + assertEquals( "long", - c2j.getJavaTypeName( property, false ) ); + c2j.getJavaTypeName( property, false ), + "typename should be used when rawtypemode"); property = pc.getProperty( "otherStock" ); - Assert.assertFalse( property.getValue().isNullable() ); - Assert.assertEquals( - "type should still be overriden by meta attribute", + assertFalse( property.getValue().isNullable() ); + assertEquals( "java.lang.Integer", - c2j.getJavaTypeName( property, false ) ); + c2j.getJavaTypeName( property, false ), + "type should still be overriden by meta attribute"); property = pc.getIdentifierProperty(); - Assert.assertFalse( property.getValue().isNullable() ); - Assert.assertEquals( - "wrappers should be used by default", + assertFalse( property.getValue().isNullable() ); + assertEquals( "long", - c2j.getJavaTypeName( property, false ) ); + c2j.getJavaTypeName( property, false ), + "wrappers should be used by default"); pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer" ); Component identifier = (Component) pc.getIdentifier(); - Assert.assertFalse(((Property) identifier.getPropertyIterator().next() ) + assertFalse(((Property) identifier.getPropertyIterator().next() ) .getValue().isNullable() ); - Assert.assertEquals( "long", c2j.getJavaTypeName( property, false ) ); + assertEquals( "long", c2j.getJavaTypeName( property, false ) ); } @Test @@ -290,22 +309,22 @@ public void testExtendsImplements() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); - Assert.assertEquals( null, c2j.getPOJOClass(pc).getExtends() ); + assertEquals( null, c2j.getPOJOClass(pc).getExtends() ); POJOClass entityPOJOClass = c2j.getPOJOClass(metadata.getEntityBinding("HelloWorld" )); - Assert.assertEquals( "Comparable", entityPOJOClass.getExtends() ); - Assert.assertNull( - "should be interface which cannot have implements", - entityPOJOClass.getImplements() ); - Assert.assertEquals( - "should be interface which cannot have implements", + assertEquals( "Comparable", entityPOJOClass.getExtends() ); + assertNull( + entityPOJOClass.getImplements(), + "should be interface which cannot have implements"); + assertEquals( "", - entityPOJOClass.getImplementsDeclaration() ); + entityPOJOClass.getImplementsDeclaration(), + "should be interface which cannot have implements"); PersistentClass base = new RootClass(null); base.setClassName( "Base" ); PersistentClass sub = new SingleTableSubclass( base, null ); sub.setClassName( "Sub" ); - Assert.assertEquals( null, c2j.getPOJOClass(base).getExtends() ); - Assert.assertEquals( "Base", c2j.getPOJOClass(sub).getExtends() ); + assertEquals( null, c2j.getPOJOClass(base).getExtends() ); + assertEquals( "Base", c2j.getPOJOClass(sub).getExtends() ); Map m = new HashMap(); MetaAttribute attribute = new MetaAttribute( "extends" ); attribute.addValue( "x" ); @@ -315,13 +334,13 @@ public void testExtendsImplements() { attribute.addValue( "true" ); m.put( attribute.getName(), attribute ); sub.setMetaAttributes( m ); - Assert.assertEquals( "Base,x,y", c2j.getPOJOClass(sub).getExtends() ); + assertEquals( "Base,x,y", c2j.getPOJOClass(sub).getExtends() ); m = new HashMap(); attribute = new MetaAttribute( "implements" ); attribute.addValue( "intf" ); m.put( attribute.getName(), attribute ); base.setMetaAttributes( m ); - Assert.assertEquals( "intf,java.io.Serializable", c2j.getPOJOClass(base).getImplements() ); + assertEquals( "intf,java.io.Serializable", c2j.getPOJOClass(base).getImplements() ); } @Test @@ -331,9 +350,9 @@ public void testDeclarationName() { "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); PersistentClass hw = metadata.getEntityBinding( "HelloWorld" ); POJOClass epc = c2j.getPOJOClass(pc); - Assert.assertEquals( "Order", epc.getDeclarationName() ); + assertEquals( "Order", epc.getDeclarationName() ); epc = c2j.getPOJOClass(hw); - Assert.assertEquals( "BaseHelloWorld", epc.getDeclarationName() ); + assertEquals( "BaseHelloWorld", epc.getDeclarationName() ); } @Test @@ -341,11 +360,11 @@ public void testAsArguments() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); - Assert.assertEquals( + assertEquals( "java.util.Calendar orderDate, java.math.BigDecimal total, org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer customer, java.util.Collection lineItems", c2j.asParameterList( pc.getPropertyIterator(), false, new NoopImportContext() )); - Assert.assertEquals( + assertEquals( "orderDate, total, customer, lineItems", c2j.asArgumentList( pc.getPropertyIterator() ) ); } @@ -356,13 +375,13 @@ public void testPropertiesForFullConstructor() { PersistentClass pc = metadata.getEntityBinding( "HelloWorld" ); POJOClass pjc = c2j.getPOJOClass(pc); List wl = pjc.getPropertiesForFullConstructor(); - Assert.assertEquals( 3, wl.size() ); + assertEquals( 3, wl.size() ); PersistentClass uni = metadata.getEntityBinding( "HelloUniverse" ); pjc = c2j.getPOJOClass(uni); List local = pjc.getPropertyClosureForFullConstructor(); - Assert.assertEquals( 6, local.size() ); + assertEquals( 6, local.size() ); for(int i=0;i iter = pjc.getToStringPropertiesIterator(); // in HelloWorld.hbm.xml there're 2 Properties for toString - Assert.assertEquals( "id", (iter.next() ).getName() ); - Assert.assertEquals( "hello", (iter.next() ).getName() ); - Assert.assertFalse( iter.hasNext() ); + assertEquals( "id", (iter.next() ).getName() ); + assertEquals( "hello", (iter.next() ).getName() ); + assertFalse( iter.hasNext() ); pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Order" ); pjc = c2j.getPOJOClass(pc); - Assert.assertFalse( pjc.needsToString() ); + assertFalse( pjc.needsToString() ); pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer" ); Component c = (Component) pc.getProperty( "addressComponent" ) .getValue(); POJOClass cc = c2j.getPOJOClass(c); - Assert.assertTrue( cc.needsToString() ); + assertTrue( cc.needsToString() ); iter = cc.getToStringPropertiesIterator(); // in Customer.hbm.xml there's 1 Property for toString - Assert.assertEquals( "city", (iter.next() ).getName() ); - Assert.assertFalse( iter.hasNext() ); + assertEquals( "city", (iter.next() ).getName() ); + assertFalse( iter.hasNext() ); } @Test public void testImportOfSameName() { ImportContext ic = new ImportContextImpl("foobar"); - Assert.assertEquals("CascadeType", ic.importType("javax.persistence.CascadeType")); - Assert.assertEquals("org.hibernate.annotations.CascadeType", ic.importType("org.hibernate.annotations.CascadeType")); - Assert.assertTrue("The hibernate annotation should not be imported to avoid name clashes", ic.generateImports().indexOf("hibernate")<0); + assertEquals("CascadeType", ic.importType("javax.persistence.CascadeType")); + assertEquals("org.hibernate.annotations.CascadeType", ic.importType("org.hibernate.annotations.CascadeType")); + assertTrue(ic.generateImports().indexOf("hibernate")<0, "The hibernate annotation should not be imported to avoid name clashes"); } @Test public void testImporter() { ImportContext context = new ImportContextImpl( "org.hibernate" ); - Assert.assertEquals("byte", context.importType("byte")); - Assert.assertEquals("Session", context.importType("org.hibernate.Session")); - Assert.assertEquals("Long", context.importType("java.lang.Long")); - Assert.assertEquals("org.test.Session", context.importType("org.test.Session")); - Assert.assertEquals("Entity", context.importType("org.test.Entity")); - Assert.assertEquals("org.other.test.Entity", context.importType("org.other.test.Entity")); - Assert.assertEquals("Collection", context.importType("java.util.Collection")); - Assert.assertEquals("Map", context.importType("java.util.Map")); - Assert.assertEquals("Collection[]", context.importType("java.util.Collection[]")); - Assert.assertEquals("Map", context.importType("java.util.Map")); + assertEquals("byte", context.importType("byte")); + assertEquals("Session", context.importType("org.hibernate.Session")); + assertEquals("Long", context.importType("java.lang.Long")); + assertEquals("org.test.Session", context.importType("org.test.Session")); + assertEquals("Entity", context.importType("org.test.Entity")); + assertEquals("org.other.test.Entity", context.importType("org.other.test.Entity")); + assertEquals("Collection", context.importType("java.util.Collection")); + assertEquals("Map", context.importType("java.util.Map")); + assertEquals("Collection[]", context.importType("java.util.Collection[]")); + assertEquals("Map", context.importType("java.util.Map")); String string = context.generateImports(); - Assert.assertTrue(string.indexOf("import org.hibernate.Session;")<0); - Assert.assertTrue(string.indexOf("import org.test.Entity;")>0); - Assert.assertTrue("Entity can only be imported once", string.indexOf("import org.other.test.Entity;")<0); - Assert.assertFalse(string.indexOf("<")>=0); - Assert.assertEquals("Outer.Entity", context.importType("org.test.Outer$Entity")); - Assert.assertEquals("org.other.test.Outer.Entity", context.importType("org.other.test.Outer$Entity")); - Assert.assertEquals("Collection", context.importType("java.util.Collection")); - Assert.assertEquals("Map", context.importType("java.util.Map")); - Assert.assertEquals("Collection[]", context.importType("java.util.Collection[]")); - Assert.assertEquals("Map", context.importType("java.util.Map")); + assertTrue(string.indexOf("import org.hibernate.Session;")<0); + assertTrue(string.indexOf("import org.test.Entity;")>0); + assertTrue(string.indexOf("import org.other.test.Entity;")<0, "Entity can only be imported once"); + assertFalse(string.indexOf("<")>=0); + assertEquals("Outer.Entity", context.importType("org.test.Outer$Entity")); + assertEquals("org.other.test.Outer.Entity", context.importType("org.other.test.Outer$Entity")); + assertEquals("Collection", context.importType("java.util.Collection")); + assertEquals("Map", context.importType("java.util.Map")); + assertEquals("Collection[]", context.importType("java.util.Collection[]")); + assertEquals("Map", context.importType("java.util.Map")); //assertEquals("Test.Entry", context.importType("org.hibernate.Test.Entry")); what should be the behavior for this ? - Assert.assertEquals("Test.Entry", context.importType("org.hibernate.Test$Entry")); - Assert.assertEquals("Map.Entry", context.importType("java.util.Map$Entry")); - Assert.assertEquals("Entry", context.importType("java.util.Map.Entry")); // we can't detect that it is the same class here unless we try an load all strings so we fall back to default class name. - Assert.assertEquals("List", context.importType( "java.util.List" )); - Assert.assertEquals("List", context.importType( "java.util.List" )); + assertEquals("Test.Entry", context.importType("org.hibernate.Test$Entry")); + assertEquals("Map.Entry", context.importType("java.util.Map$Entry")); + assertEquals("Entry", context.importType("java.util.Map.Entry")); // we can't detect that it is the same class here unless we try an load all strings so we fall back to default class name. + assertEquals("List", context.importType( "java.util.List" )); + assertEquals("List", context.importType( "java.util.List" )); string = context.generateImports(); - Assert.assertTrue(string.indexOf("import java.util.Map")>=0); - Assert.assertTrue(string.indexOf("import java.utilMap$")<0); - Assert.assertTrue(string.indexOf("$")<0); + assertTrue(string.indexOf("import java.util.Map")>=0); + assertTrue(string.indexOf("import java.utilMap$")<0); + assertTrue(string.indexOf("$")<0); } @Test @@ -440,20 +459,20 @@ public void testEqualsHashCode() { Cfg2JavaTool c2j = new Cfg2JavaTool(); PersistentClass pc = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer" ); POJOClass pjc = c2j.getPOJOClass((Component) pc.getProperty("addressComponent").getValue()); - Assert.assertTrue( pjc.needsEqualsHashCode() ); + assertTrue( pjc.needsEqualsHashCode() ); Iterator iter = pjc.getEqualsHashCodePropertiesIterator(); // in HelloWorld.hbm.xml there're 2 Properties for toString - Assert.assertEquals( "streetAddress1", iter.next().getName() ); - Assert.assertEquals( "city", iter.next().getName() ); - Assert.assertEquals( "verified", iter.next().getName() ); - Assert.assertFalse( iter.hasNext() ); + assertEquals( "streetAddress1", iter.next().getName() ); + assertEquals( "city", iter.next().getName() ); + assertEquals( "verified", iter.next().getName() ); + assertFalse( iter.hasNext() ); } // TODO Re-enable this test: HBX-1249 - @Ignore + @Disabled @Test public void testGenerics() throws Exception { - File genericsSource = new File(temporaryFolder.getRoot(), "genericssource"); + File genericsSource = new File(outputFolder, "genericssource"); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(genericsSource); @@ -461,23 +480,23 @@ public void testGenerics() throws Exception { exporter.setArtifactCollector(artifactCollector); exporter.getProperties().setProperty("jdk5", "true"); exporter.start(); - File genericsTarget = new File(temporaryFolder.getRoot(), "genericstarget" ); + File genericsTarget = new File(outputFolder, "genericstarget" ); genericsTarget.mkdir(); String helloWorldResourcePath = "/org/hibernate/tool/hbm2x/Hbm2JavaTest/HelloWorld.java_"; File helloWorldOrigin = new File(getClass().getResource(helloWorldResourcePath).toURI()); - File helloWorldDestination = new File(outputDir, "HelloWorld.java"); + File helloWorldDestination = new File(scDir, "HelloWorld.java"); Files.copy(helloWorldOrigin.toPath(), helloWorldDestination.toPath()); JavaUtil.compile(genericsSource, genericsTarget); - Assert.assertTrue(new File(genericsTarget, "HelloWorld.class").exists()); + assertTrue(new File(genericsTarget, "HelloWorld.class").exists()); } - @Ignore + @Disabled @Test public void testDynamicComponent() { PersistentClass classMapping = metadata.getEntityBinding( "org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer"); - Assert.assertEquals( + assertEquals( "java.util.Map", new Cfg2JavaTool().getJavaTypeName( classMapping.getProperty("dynaMap"), false)); @@ -485,17 +504,17 @@ public void testDynamicComponent() { @Test public void testCapitializaiton() { - Assert.assertEquals("Mail", BasicPOJOClass.beanCapitalize("Mail")); - Assert.assertEquals("Mail", BasicPOJOClass.beanCapitalize("mail")); - Assert.assertEquals("eMail", BasicPOJOClass.beanCapitalize("eMail")); - Assert.assertEquals("EMail", BasicPOJOClass.beanCapitalize("EMail")); + assertEquals("Mail", BasicPOJOClass.beanCapitalize("Mail")); + assertEquals("Mail", BasicPOJOClass.beanCapitalize("mail")); + assertEquals("eMail", BasicPOJOClass.beanCapitalize("eMail")); + assertEquals("EMail", BasicPOJOClass.beanCapitalize("EMail")); } @Test public void testUserTypes() { PersistentClass classMapping = metadata.getEntityBinding("org.hibernate.tool.hbm2x.Hbm2JavaTest.Customer"); Property property = classMapping.getProperty("customDate"); - Assert.assertEquals("java.sql.Date", new Cfg2JavaTool().getJavaTypeName(property, false)); + assertEquals("java.sql.Date", new Cfg2JavaTool().getJavaTypeName(property, false)); } } From 2aae2c9816b965021f43eef4fcddf418c6c8021d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 09:54:43 +0200 Subject: [PATCH 243/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.HibernateMappingExporterTest.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HibernateMappingExporterTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HibernateMappingExporterTest/TestCase.java index 5eb9a55ed6..f7c2dcd0cb 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HibernateMappingExporterTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/HibernateMappingExporterTest/TestCase.java @@ -1,5 +1,28 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.hibernate.tool.hbm2x.HibernateMappingExporterTest; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.FileWriter; import java.util.Properties; @@ -8,10 +31,8 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { @@ -24,12 +45,12 @@ public class TestCase { " "+ " "; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + @Test public void testStart() throws Exception { - File resources = new File(temporaryFolder.getRoot(), "resources"); + File resources = new File(outputFolder, "resources"); resources.mkdir(); File fooHbmXmlOrigin = new File(resources, "origin.hbm.xml"); FileWriter writer = new FileWriter(fooHbmXmlOrigin); @@ -39,16 +60,16 @@ public void testStart() throws Exception { properties.setProperty("hibernate.dialect", HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, new File[] { fooHbmXmlOrigin }, properties); - final File outputDir = new File(temporaryFolder.getRoot(), "output"); + final File outputDir = new File(outputFolder, "output"); outputDir.mkdir(); HibernateMappingExporter exporter = new HibernateMappingExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(outputDir); final File fooHbmXml = new File(outputDir, "Foo.hbm.xml"); - Assert.assertFalse(fooHbmXml.exists()); + assertFalse(fooHbmXml.exists()); exporter.start(); - Assert.assertTrue(fooHbmXml.exists()); - Assert.assertTrue(fooHbmXml.delete()); + assertTrue(fooHbmXml.exists()); + assertTrue(fooHbmXml.delete()); } } From 9e18019af8100b10be690ba82c1bc9e0bfc9249e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 10:10:12 +0200 Subject: [PATCH 244/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.OtherCfg2HbmTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/OtherCfg2HbmTest/TestCase.java | 81 +++++++++++-------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java index c68316d8ac..28f9ec90b6 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/OtherCfg2HbmTest/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.OtherCfg2HbmTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.Properties; @@ -23,11 +42,9 @@ import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.NodeList; @@ -45,34 +62,34 @@ public class TestCase { "HelloWorld.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private File outputDir = null; + @TempDir + public File outputFolder = new File("output"); + + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.start(); } @Test public void testFileExistence() { - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/Order.hbm.xml") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "HelloWorld.hbm.xml") ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "HelloUniverse.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "org/hibernate/tool/hbm2x/Order.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "org/hibernate/tool/hbm2x/Product.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "HelloWorld.hbm.xml") ); + JUnitUtil.assertIsNonEmptyFile(new File(srcDir, "HelloUniverse.hbm.xml") ); } @Test @@ -82,34 +99,34 @@ public void testReadable() { Properties properties = new Properties(); properties.put(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); File[] hbmFiles = new File[4]; - hbmFiles[0] = new File(outputDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml"); - hbmFiles[1] = new File(outputDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml"); - hbmFiles[2] = new File(outputDir, "org/hibernate/tool/hbm2x/Order.hbm.xml"); - hbmFiles[3] = new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml"); + hbmFiles[0] = new File(srcDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml"); + hbmFiles[1] = new File(srcDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml"); + hbmFiles[2] = new File(srcDir, "org/hibernate/tool/hbm2x/Order.hbm.xml"); + hbmFiles[3] = new File(srcDir, "org/hibernate/tool/hbm2x/Product.hbm.xml"); Metadata metadata = MetadataDescriptorFactory .createNativeDescriptor(null, hbmFiles, properties) .createMetadata(); - Assert.assertNotNull(metadata); + assertNotNull(metadata); } @Test public void testNoVelocityLeftOvers() { - Assert.assertEquals(null, FileUtil.findFirstString("$",new File(outputDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml") ) ); - Assert.assertEquals(null, FileUtil.findFirstString("$",new File(outputDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml") ) ); - Assert.assertEquals(null, FileUtil.findFirstString("$",new File(outputDir, "org/hibernate/tool/hbm2x/Order.hbm.xml") ) ); - Assert.assertEquals(null, FileUtil.findFirstString("$",new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml") ) ); + assertEquals(null, FileUtil.findFirstString("$",new File(srcDir, "org/hibernate/tool/hbm2x/Customer.hbm.xml") ) ); + assertEquals(null, FileUtil.findFirstString("$",new File(srcDir, "org/hibernate/tool/hbm2x/LineItem.hbm.xml") ) ); + assertEquals(null, FileUtil.findFirstString("$",new File(srcDir, "org/hibernate/tool/hbm2x/Order.hbm.xml") ) ); + assertEquals(null, FileUtil.findFirstString("$",new File(srcDir, "org/hibernate/tool/hbm2x/Product.hbm.xml") ) ); } @Test public void testVersioning() throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); - Document document = db.parse(new File(outputDir, "org/hibernate/tool/hbm2x/Product.hbm.xml")); + Document document = db.parse(new File(srcDir, "org/hibernate/tool/hbm2x/Product.hbm.xml")); XPath xpath = XPathFactory.newInstance().newXPath(); NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/version") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one version element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one version element"); } } From b3af437af5f2c2a4991a1aacd57e7a19232e503a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 10:24:46 +0200 Subject: [PATCH 245/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.PropertiesTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/PropertiesTest/TestCase.java | 83 ++++++++++++------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java index 84e1c836b4..f1a3ca2ed9 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/PropertiesTest/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbm2x.PropertiesTest; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.nio.file.Files; @@ -22,11 +43,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -41,29 +60,29 @@ public class TestCase { "Properties.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + private ArtifactCollector artifactCollector; - private File outputDir = null; + private File srcDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() throws Exception { artifactCollector = new ArtifactCollector(); - outputDir = new File(temporaryFolder.getRoot(), "output"); - outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + srcDir = new File(outputFolder, "output"); + srcDir.mkdir(); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); MetadataDescriptor metadataDescriptor = HibernateUtil .initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); Exporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(outputDir); + exporter.setOutputDirectory(srcDir); exporter.setArtifactCollector(artifactCollector); Exporter hbmexporter = new HibernateMappingExporter(); hbmexporter.setMetadataDescriptor(metadataDescriptor); - hbmexporter.setOutputDirectory(outputDir); + hbmexporter.setOutputDirectory(srcDir); hbmexporter.setArtifactCollector(artifactCollector); exporter.start(); hbmexporter.start(); @@ -71,13 +90,13 @@ public void setUp() throws Exception { @Test public void testNoGenerationOfEmbeddedPropertiesComponent() { - Assert.assertEquals(2, artifactCollector.getFileCount("java")); - Assert.assertEquals(2, artifactCollector.getFileCount("hbm.xml")); + assertEquals(2, artifactCollector.getFileCount("java")); + assertEquals(2, artifactCollector.getFileCount("hbm.xml")); } @Test public void testGenerationOfEmbeddedProperties() throws Exception { - File outputXml = new File(outputDir, "properties/PPerson.hbm.xml"); + File outputXml = new File(srcDir, "properties/PPerson.hbm.xml"); JUnitUtil.assertIsNonEmptyFile(outputXml); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -86,32 +105,32 @@ public void testGenerationOfEmbeddedProperties() throws Exception { NodeList nodeList = (NodeList)xpath .compile("//hibernate-mapping/class/properties") .evaluate(document, XPathConstants.NODESET); - Assert.assertEquals("Expected to get one properties element", 1, nodeList.getLength()); + assertEquals(1, nodeList.getLength(), "Expected to get one properties element"); Element element = (Element) nodeList.item(0); - Assert.assertEquals(element.getAttribute( "name" ),"emergencyContact"); - Assert.assertNotNull( + assertEquals(element.getAttribute( "name" ),"emergencyContact"); + assertNotNull( FileUtil.findFirstString( "name", - new File(outputDir, "properties/PPerson.java" ))); - Assert.assertNull( - "Embedded component/properties should not show up in .java", + new File(srcDir, "properties/PPerson.java" ))); + assertNull( FileUtil.findFirstString( "emergencyContact", - new File(outputDir, "properties/PPerson.java" ))); + new File(srcDir, "properties/PPerson.java" )), + "Embedded component/properties should not show up in .java"); } @Test public void testCompilable() throws Exception { String propertiesUsageResourcePath = "/org/hibernate/tool/hbm2x/PropertiesTest/PropertiesUsage.java_"; File propertiesUsageOrigin = new File(getClass().getResource(propertiesUsageResourcePath).toURI()); - File propertiesUsageDestination = new File(outputDir, "properties/PropertiesUsage.java"); - File targetDir = new File(temporaryFolder.getRoot(), "compilerOutput" ); + File propertiesUsageDestination = new File(srcDir, "properties/PropertiesUsage.java"); + File targetDir = new File(outputFolder, "compilerOutput" ); targetDir.mkdir(); Files.copy(propertiesUsageOrigin.toPath(), propertiesUsageDestination.toPath()); - JavaUtil.compile(outputDir, targetDir); - Assert.assertTrue(new File(targetDir, "properties/PCompany.class").exists()); - Assert.assertTrue(new File(targetDir, "properties/PPerson.class").exists()); - Assert.assertTrue(new File(targetDir, "properties/PropertiesUsage.class").exists()); + JavaUtil.compile(srcDir, targetDir); + assertTrue(new File(targetDir, "properties/PCompany.class").exists()); + assertTrue(new File(targetDir, "properties/PPerson.class").exists()); + assertTrue(new File(targetDir, "properties/PropertiesUsage.class").exists()); } } From 8f1e8d7574a42e56c32ab99910c762dfd98b2eb2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 10:41:42 +0200 Subject: [PATCH 246/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ide.completion.CompletionHelperTest.TestCase' Signed-off-by: Koen Aers --- .../CompletionHelperTest/TestCase.java | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/CompletionHelperTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/CompletionHelperTest/TestCase.java index bd3426938c..265e5f85fe 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/CompletionHelperTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/CompletionHelperTest/TestCase.java @@ -1,29 +1,33 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.ide.completion.CompletionHelperTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.util.ArrayList; import java.util.List; import org.hibernate.tool.ide.completion.CompletionHelper; import org.hibernate.tool.ide.completion.EntityNameReference; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author leon @@ -36,17 +40,17 @@ public void testGetCanonicalPath() { qts.add(new EntityNameReference("Article", "art")); qts.add(new EntityNameReference("art.descriptions", "descr")); qts.add(new EntityNameReference("descr.name", "n")); - Assert.assertEquals("Invalid path", "Article/descriptions/name/locale", CompletionHelper.getCanonicalPath(qts, "n.locale")); - Assert.assertEquals("Invalid path", "Article/descriptions", CompletionHelper.getCanonicalPath(qts, "descr")); + assertEquals("Article/descriptions/name/locale", CompletionHelper.getCanonicalPath(qts, "n.locale"), "Invalid path"); + assertEquals("Article/descriptions", CompletionHelper.getCanonicalPath(qts, "descr"), "Invalid path"); // qts.clear(); qts.add(new EntityNameReference("com.company.Clazz", "clz")); qts.add(new EntityNameReference("clz.attr", "a")); - Assert.assertEquals("Invalid path", "com.company.Clazz/attr", CompletionHelper.getCanonicalPath(qts, "a")); + assertEquals("com.company.Clazz/attr", CompletionHelper.getCanonicalPath(qts, "a"), "Invalid path"); // qts.clear(); qts.add(new EntityNameReference("Agga", "a")); - Assert.assertEquals("Invalid path", "Agga", CompletionHelper.getCanonicalPath(qts, "a")); + assertEquals("Agga", CompletionHelper.getCanonicalPath(qts, "a"), "Invalid path"); } @Test From 3f104f80c9bf78636ebf5a2eba2dbdcc19e84569 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 10:57:12 +0200 Subject: [PATCH 247/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ide.completion.HqlAnalyzer.TestCase' Signed-off-by: Koen Aers --- .../ide/completion/HqlAnalyzer/TestCase.java | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/HqlAnalyzer/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/HqlAnalyzer/TestCase.java index 115106a566..053f2c1923 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/HqlAnalyzer/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/HqlAnalyzer/TestCase.java @@ -1,30 +1,36 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.ide.completion.HqlAnalyzer; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.Iterator; import java.util.List; import org.hibernate.tool.ide.completion.EntityNameReference; import org.hibernate.tool.ide.completion.HQLAnalyzer; import org.hibernate.tool.ide.completion.SubQuery; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author leon @@ -119,24 +125,24 @@ public void testVisibleSubQueries() { public void doTestVisibleSubQueries(String query, int size) { char[] cs = query.replaceAll("\\|", "").toCharArray(); List visible = new HQLAnalyzer().getVisibleSubQueries(cs, query.indexOf("|")); - Assert.assertEquals("Invalid visible query size", size, visible.size()); + assertEquals(size, visible.size(), "Invalid visible query size"); } private void doTestSubQueries(String query, int size) { List l = new HQLAnalyzer().getSubQueries(query.toCharArray(), 0).subQueries; - Assert.assertEquals("Incorrent subqueries count", size, l.size()); + assertEquals(size, l.size(), "Incorrent subqueries count"); } private void doTestPrefix(String query, String prefix) { - Assert.assertEquals(prefix, HQLAnalyzer.getEntityNamePrefix(query.toCharArray(), query.indexOf("|"))); + assertEquals(prefix, HQLAnalyzer.getEntityNamePrefix(query.toCharArray(), query.indexOf("|"))); } private void doTestShouldShowTables(String query, boolean expectedValue) { char[] ch = query.replaceAll("\\|", "").toCharArray(); if (expectedValue) { - Assert.assertTrue(new HQLAnalyzer().shouldShowEntityNames(ch, getCaretPosition(query))); + assertTrue(new HQLAnalyzer().shouldShowEntityNames(ch, getCaretPosition(query))); } else { - Assert.assertFalse(new HQLAnalyzer().shouldShowEntityNames(ch, getCaretPosition(query))); + assertFalse(new HQLAnalyzer().shouldShowEntityNames(ch, getCaretPosition(query))); } } @@ -251,12 +257,12 @@ public void testVisibleTablesInQueries() { private void doTestVisibleTables(String query, String[] types, String aliases[]) { char[] toCharArray = query.replaceAll("\\|", "").toCharArray(); List qts = new HQLAnalyzer().getVisibleEntityNames(toCharArray, getCaretPosition(query)); - Assert.assertEquals("Incorrect table count", types.length, qts.size()); + assertEquals(types.length, qts.size(), "Incorrect table count"); int i = 0; for (Iterator iter = qts.iterator(); iter.hasNext();) { EntityNameReference qt = iter.next(); - Assert.assertEquals("Incorrect query table type [" + i + "]", types[i], qt.getEntityName()); - Assert.assertEquals("Incorrect query table alias [" + i + "]", aliases[i++], qt.getAlias()); + assertEquals(types[i], qt.getEntityName(), "Incorrect query table type [" + i + "]"); + assertEquals(aliases[i++], qt.getAlias(), "Incorrect query table alias [" + i + "]"); } } From 62b3d8c82d28bd002fd4519f5a8a5de15bc17938 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 11:30:25 +0200 Subject: [PATCH 248/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ide.completion.ModelCompletion.TestCase' Signed-off-by: Koen Aers --- .../completion/ModelCompletion/TestCase.java | 341 ++++++++++-------- 1 file changed, 181 insertions(+), 160 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/ModelCompletion/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/ModelCompletion/TestCase.java index 5fb4d66184..9731afe5f3 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/ide/completion/ModelCompletion/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/ide/completion/ModelCompletion/TestCase.java @@ -1,22 +1,29 @@ /* - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.ide.completion.ModelCompletion; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.net.URL; import java.net.URLClassLoader; @@ -39,13 +46,12 @@ import org.hibernate.tool.ide.completion.IHQLCompletionRequestor; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author leon @@ -77,17 +83,17 @@ public boolean accept(HQLCompletionProposal proposal) { public void completionFailure(String errorMessage) {} } - @ClassRule - public static TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public static File outputFolder = new File("output"); + private Metadata metadata; private ConfigurationCompletion cc; private ClassLoader originalClassLoader = null; - @BeforeClass + @BeforeAll public static void beforeClass() throws Exception { - File folder = temporaryFolder.getRoot(); File originFolder = new File(TestCase.class .getClassLoader() @@ -95,7 +101,7 @@ public static void beforeClass() throws Exception { .toURI()) .getParentFile(); File destinationFolder = new File( - folder, + outputFolder, "org/hibernate/tool/ide/completion/ModelCompletion"); destinationFolder.mkdirs(); for (File f : originFolder.listFiles()) { @@ -106,21 +112,21 @@ public static void beforeClass() throws Exception { new File(destinationFolder, f.getName()).toPath()); } } - JavaUtil.compile(temporaryFolder.getRoot()); + JavaUtil.compile(outputFolder); } - @Before + @BeforeEach public void setUp() throws Exception { originalClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( new URLClassLoader( - new URL[] { temporaryFolder.getRoot().toURI().toURL() }, + new URL[] { outputFolder.toURI().toURL() }, originalClassLoader)); metadata = buildMetadata(); cc = new ConfigurationCompletion(metadata); } - @After + @AfterEach public void tearDown() throws Exception { Thread.currentThread().setContextClassLoader(originalClassLoader); } @@ -129,28 +135,28 @@ public void tearDown() throws Exception { public void testGetMappedClasses() { Collector hcc = new Collector(); cc.getMatchingImports("", hcc); - Assert.assertEquals("Invalid entity names count", 11, hcc.getCompletionProposals().length); + assertEquals(11, hcc.getCompletionProposals().length, "Invalid entity names count"); hcc.clear(); cc.getMatchingImports( " ", hcc ); - Assert.assertTrue("Space prefix should have no classes", hcc.getCompletionProposals().length==0); + assertTrue(hcc.getCompletionProposals().length==0, "Space prefix should have no classes"); hcc.clear(); cc.getMatchingImports( "pro", hcc ); - Assert.assertTrue("Completion should not be case sensitive", hcc.getCompletionProposals().length==2); + assertTrue(hcc.getCompletionProposals().length==2, "Completion should not be case sensitive"); hcc.clear(); cc.getMatchingImports( "StoreC", hcc ); - Assert.assertEquals("Invalid entity names count", 1, hcc.getCompletionProposals().length); - Assert.assertEquals("StoreCity should have been found", "StoreCity", hcc.getCompletionProposals()[0].getSimpleName()); + assertEquals(1, hcc.getCompletionProposals().length, "Invalid entity names count"); + assertEquals("StoreCity", hcc.getCompletionProposals()[0].getSimpleName(), "StoreCity should have been found"); hcc.clear(); cc.getMatchingImports( "NotThere", hcc ); - Assert.assertTrue(hcc.getCompletionProposals().length==0); + assertTrue(hcc.getCompletionProposals().length==0); hcc.clear(); cc.getMatchingImports( "Uni", hcc ); - Assert.assertEquals("Universe", hcc.getCompletionProposals()[0].getSimpleName()); + assertEquals(hcc.getCompletionProposals()[0].getSimpleName(), "Universe"); } @@ -201,26 +207,26 @@ public void testKeywordFunction() { HQLCompletionProposal[] completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(4, completionProposals.length); - Assert.assertEquals("alse", completionProposals[0].getCompletion()); + assertEquals(4, completionProposals.length); + assertEquals("alse", completionProposals[0].getCompletion()); hcc.clear(); cc.getMatchingFunctions( "ma", 2, hcc ); completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); - Assert.assertEquals("x", completionProposals[0].getCompletion()); + assertEquals(1, completionProposals.length); + assertEquals("x", completionProposals[0].getCompletion()); hcc.clear(); cc.getMatchingKeywords("FR", 3, hcc); completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); + assertEquals(1, completionProposals.length); hcc.clear(); cc.getMatchingFunctions( "MA", 2, hcc ); completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); + assertEquals(1, completionProposals.length); } @@ -234,16 +240,16 @@ public void testUnmappedClassFields() { private void doTestFields(HQLCompletionProposal[] proposals, String[] fields) { if (fields == null || fields.length==0) { - Assert.assertTrue("No fields should have been found", proposals.length==0); + assertTrue(proposals.length==0, "No fields should have been found"); return; } - Assert.assertEquals("Invalid field count", fields.length, proposals.length); + assertEquals(fields.length, proposals.length, "Invalid field count"); for (int j = 0; j < fields.length; j++) { String f = fields[j]; HQLCompletionProposal proposal = proposals[j]; - Assert.assertEquals("Invalid field name at " + j, f, proposal.getSimpleName()); - Assert.assertEquals("Invalid kind at " + j, proposal.getCompletionKind(), HQLCompletionProposal.PROPERTY); + assertEquals(f, proposal.getSimpleName(), "Invalid field name at " + j); + assertEquals(proposal.getCompletionKind(), HQLCompletionProposal.PROPERTY, "Invalid kind at " + j); } } @@ -295,25 +301,27 @@ private void doTestUnaliasedProductQuery(final String query) { cc.getMatchingProperties( cc.getCanonicalPath(visible, "owner"), "f", hcc ); HQLCompletionProposal[] completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); - Assert.assertEquals("firstName", completionProposals[0].getSimpleName()); + assertEquals(1, completionProposals.length); + assertEquals("firstName", completionProposals[0].getSimpleName()); hcc.clear(); cc.getMatchingProperties( cc.getCanonicalPath(visible, "owner"), "l", hcc ); completionProposals = hcc.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); - Assert.assertEquals("lastName", completionProposals[0].getSimpleName()); + assertEquals(1, completionProposals.length); + assertEquals("lastName", completionProposals[0].getSimpleName()); hcc.clear(); cc.getMatchingProperties( cc.getCanonicalPath(visible, "owner"), "", hcc ); - Assert.assertEquals(3, hcc.getCompletionProposals().length); + assertEquals(3, hcc.getCompletionProposals().length); hcc.clear(); cc.getMatchingProperties( cc.getCanonicalPath(visible, "owner"), "g", hcc ); - Assert.assertEquals(0, hcc.getCompletionProposals().length); + assertEquals(0, hcc.getCompletionProposals().length); } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testBasicFrom() { Collector c = new Collector(); @@ -326,15 +334,15 @@ public void testBasicFrom() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(11, completionProposals.length); + assertEquals(11, completionProposals.length); for (int i = 0; i < completionProposals.length; i++) { HQLCompletionProposal proposal = completionProposals[i]; - Assert.assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(proposal.getReplaceStart(), proposal.getReplaceEnd()); // nothing to replace - Assert.assertNotNull(proposal.getShortEntityName()); - Assert.assertNotNull(proposal.getEntityName()); + assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(proposal.getReplaceStart(), proposal.getReplaceEnd()); // nothing to replace + assertNotNull(proposal.getShortEntityName()); + assertNotNull(proposal.getEntityName()); //assertNotNull(proposal.getShortEntityName()); } @@ -345,10 +353,12 @@ public void testBasicFrom() { completionProposals = c.getCompletionProposals(); - Assert.assertEquals(11, completionProposals.length); + assertEquals(11, completionProposals.length); } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testFromNonWhitespace() { Collector c = new Collector(); @@ -364,24 +374,26 @@ public void testFromNonWhitespace() { caretPosition = getCaretPosition(query); hqlEval.codeComplete(query, caretPosition, c); completionProposals = c.getCompletionProposals(); - Assert.assertEquals("should get results after a nonwhitespace separator", 11, completionProposals.length); + assertEquals(11, completionProposals.length, "should get results after a nonwhitespace separator"); c.clear(); query = "from Store s where "; caretPosition = getCaretPosition(query); hqlEval.codeComplete(query, caretPosition, c); completionProposals = c.getCompletionProposals(); - Assert.assertTrue(completionProposals.length > 0); + assertTrue(completionProposals.length > 0); c.clear(); query = "from Store s where ("; caretPosition = getCaretPosition(query); hqlEval.codeComplete(query, caretPosition, c); completionProposals = c.getCompletionProposals(); - Assert.assertTrue(completionProposals.length > 0); + assertTrue(completionProposals.length > 0); } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testFromWithTabs() { Collector c = new Collector(); @@ -398,15 +410,17 @@ public void testFromWithTabs() { caretPosition = query.indexOf(codeCompletionPlaceMarker); hqlEval.codeComplete(query, caretPosition, c); completionProposals = c.getCompletionProposals(); - Assert.assertTrue(completionProposals.length == 0); + assertTrue(completionProposals.length == 0); c.clear(); query = query.replace('\t', ' '); hqlEval.codeComplete(query, caretPosition, c); completionProposals = c.getCompletionProposals(); - Assert.assertTrue(completionProposals.length > 0); + assertTrue(completionProposals.length > 0); } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testBasicFromPartialEntityName() { Collector c = new Collector(); @@ -419,46 +433,50 @@ public void testBasicFromPartialEntityName() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(2, completionProposals.length); - Assert.assertEquals("Product", completionProposals[0].getSimpleName()); - Assert.assertEquals("duct", completionProposals[0].getCompletion()); - Assert.assertEquals("ProductOwnerAddress", completionProposals[1].getSimpleName()); - Assert.assertEquals("ductOwnerAddress", completionProposals[1].getCompletion()); + assertEquals(2, completionProposals.length); + assertEquals("Product", completionProposals[0].getSimpleName()); + assertEquals("duct", completionProposals[0].getCompletion()); + assertEquals("ProductOwnerAddress", completionProposals[1].getSimpleName()); + assertEquals("ductOwnerAddress", completionProposals[1].getCompletion()); for (int i = 0; i < completionProposals.length; i++) { HQLCompletionProposal proposal = completionProposals[i]; - Assert.assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); + assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); } } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testBasicFromPartialDifferentCaseEntityName() { - Collector c = new Collector(); - - IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); - - String query = "from pro| "; - int caretPosition = getCaretPosition(query); - hqlEval.codeComplete(query, caretPosition, c); - - HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - - Assert.assertEquals(2, completionProposals.length); - Assert.assertEquals("Product", completionProposals[0].getSimpleName()); - Assert.assertEquals("Product", completionProposals[0].getCompletion()); - Assert.assertEquals("ProductOwnerAddress", completionProposals[1].getSimpleName()); - Assert.assertEquals("ProductOwnerAddress", completionProposals[1].getCompletion()); - for (int i = 0; i < completionProposals.length; i++) { + Collector c = new Collector(); + + IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); + + String query = "from pro| "; + int caretPosition = getCaretPosition(query); + hqlEval.codeComplete(query, caretPosition, c); + + HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); + + assertEquals(2, completionProposals.length); + assertEquals("Product", completionProposals[0].getSimpleName()); + assertEquals("Product", completionProposals[0].getCompletion()); + assertEquals("ProductOwnerAddress", completionProposals[1].getSimpleName()); + assertEquals("ProductOwnerAddress", completionProposals[1].getCompletion()); + for (int i = 0; i < completionProposals.length; i++) { HQLCompletionProposal proposal = completionProposals[i]; - Assert.assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition-3, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); + assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition-3, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); } } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testDottedFromPartialEntityName() { Collector c = new Collector(); @@ -471,69 +489,71 @@ public void testDottedFromPartialEntityName() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(5, completionProposals.length); + assertEquals(5, completionProposals.length); for (int i = 0; i < completionProposals.length; i++) { HQLCompletionProposal proposal = completionProposals[i]; - Assert.assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); - Assert.assertTrue(proposal.getCompletion().startsWith( "ool.ide.completion" )); + assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); + assertTrue(proposal.getCompletion().startsWith( "ool.ide.completion" )); } } @Test public void testBadInputBeforeCursor() { - Collector c = new Collector(); - - IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); - - String query = "from org.;hibernate.t| "; - int caretPosition = getCaretPosition(query); + Collector c = new Collector(); + + IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); + + String query = "from org.;hibernate.t| "; + int caretPosition = getCaretPosition(query); hqlEval.codeComplete(query, caretPosition, c); - - HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - - Assert.assertEquals(0, completionProposals.length); + + HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); + + assertEquals(0, completionProposals.length); } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testBadInputAfterCursor() { - Collector c = new Collector(); - - IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); - - String query = "from org.hibernate.t| ;"; - int caretPosition = getCaretPosition(query); + Collector c = new Collector(); + + IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); + + String query = "from org.hibernate.t| ;"; + int caretPosition = getCaretPosition(query); hqlEval.codeComplete(query, caretPosition, c); HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(5, completionProposals.length); + assertEquals(5, completionProposals.length); } @Test public void testAliasRef() { - Collector c = new Collector(); - - IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); - - String query = "from Product as pr_od where pr_|"; - int caretPosition = getCaretPosition(query); + Collector c = new Collector(); + + IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); + + String query = "from Product as pr_od where pr_|"; + int caretPosition = getCaretPosition(query); hqlEval.codeComplete(getCleanQuery(query), caretPosition, c); HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); + assertEquals(1, completionProposals.length); HQLCompletionProposal proposal = completionProposals[0]; - Assert.assertEquals( "od", proposal.getCompletion()); - Assert.assertEquals(HQLCompletionProposal.ALIAS_REF, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); - Assert.assertEquals("org.hibernate.tool.ide.completion.ModelCompletion.Product", proposal.getEntityName()); + assertEquals( "od", proposal.getCompletion()); + assertEquals(HQLCompletionProposal.ALIAS_REF, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); + assertEquals("org.hibernate.tool.ide.completion.ModelCompletion.Product", proposal.getEntityName()); } @@ -543,28 +563,28 @@ private String getCleanQuery(String query) { @Test public void testBasicPropertyNames() { - Collector c = new Collector(); - - IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); - - String query = "from Product as p where p.v|"; //TODO: is non-aliased references allowed ? - int caretPosition = getCaretPosition(query); + Collector c = new Collector(); + + IHQLCodeAssist hqlEval = new HQLCodeAssist(metadata); + + String query = "from Product as p where p.v|"; //TODO: is non-aliased references allowed ? + int caretPosition = getCaretPosition(query); hqlEval.codeComplete(getCleanQuery(query), caretPosition, c); HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(1, completionProposals.length); + assertEquals(1, completionProposals.length); HQLCompletionProposal proposal = completionProposals[0]; - Assert.assertEquals( "ersion", proposal.getCompletion()); - Assert.assertEquals(HQLCompletionProposal.PROPERTY, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); + assertEquals( "ersion", proposal.getCompletion()); + assertEquals(HQLCompletionProposal.PROPERTY, proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); //TODO: keep a path/context assertEquals("Product", proposal.getShortEntityName()); - Assert.assertEquals("org.hibernate.tool.ide.completion.ModelCompletion.Product", proposal.getEntityName()); - Assert.assertEquals("version", proposal.getPropertyName()); - Assert.assertNotNull(proposal.getProperty()); - Assert.assertEquals(proposal.getPropertyName(), proposal.getProperty().getName()); + assertEquals("org.hibernate.tool.ide.completion.ModelCompletion.Product", proposal.getEntityName()); + assertEquals("version", proposal.getPropertyName()); + assertNotNull(proposal.getProperty()); + assertEquals(proposal.getPropertyName(), proposal.getProperty().getName()); } @@ -581,8 +601,8 @@ public void testComponentPropertyNames() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(3, completionProposals.length); - Assert.assertNotNull(completionProposals[0]); + assertEquals(3, completionProposals.length); + assertNotNull(completionProposals[0]); c.clear(); @@ -592,7 +612,7 @@ public void testComponentPropertyNames() { completionProposals = c.getCompletionProposals(); - Assert.assertEquals(3, completionProposals.length); + assertEquals(3, completionProposals.length); c.clear(); @@ -602,11 +622,12 @@ public void testComponentPropertyNames() { completionProposals = c.getCompletionProposals(); - Assert.assertEquals(3, completionProposals.length); + assertEquals(3, completionProposals.length); - } + // TODO HBX-2063: Investigate and reenable + @Disabled @Test public void testInFromAfterEntityAlias() { Collector c = new Collector(); @@ -619,13 +640,13 @@ public void testInFromAfterEntityAlias() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertEquals(11, completionProposals.length); + assertEquals(11, completionProposals.length); HQLCompletionProposal proposal = completionProposals[0]; - Assert.assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); + assertEquals(HQLCompletionProposal.ENTITY_NAME, proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); } @@ -641,13 +662,13 @@ public void testKeywordsFunctions() { HQLCompletionProposal[] completionProposals = c.getCompletionProposals(); - Assert.assertTrue(completionProposals.length>0); + assertTrue(completionProposals.length>0); for (int i = 0; i < completionProposals.length; i++) { HQLCompletionProposal proposal = completionProposals[i]; - Assert.assertTrue(HQLCompletionProposal.KEYWORD==proposal.getCompletionKind() || HQLCompletionProposal.FUNCTION==proposal.getCompletionKind()); - Assert.assertEquals(caretPosition, proposal.getCompletionLocation()); - Assert.assertEquals(caretPosition, proposal.getReplaceStart()); - Assert.assertEquals(caretPosition, proposal.getReplaceEnd()); + assertTrue(HQLCompletionProposal.KEYWORD==proposal.getCompletionKind() || HQLCompletionProposal.FUNCTION==proposal.getCompletionKind()); + assertEquals(caretPosition, proposal.getCompletionLocation()); + assertEquals(caretPosition, proposal.getReplaceStart()); + assertEquals(caretPosition, proposal.getReplaceEnd()); } } From a83c496d590e67e78f81146e8a6e3f9b9e103b30 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 12:11:04 +0200 Subject: [PATCH 249/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.DefaultReverseEngineeringStrategy.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 101 ++++++++++-------- 1 file changed, 59 insertions(+), 42 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/jdbc2cfg/DefaultReverseEngineeringStrategy/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/jdbc2cfg/DefaultReverseEngineeringStrategy/TestCase.java index c1c53d2fca..d160c57111 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/jdbc2cfg/DefaultReverseEngineeringStrategy/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/jdbc2cfg/DefaultReverseEngineeringStrategy/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.jdbc2cfg.DefaultReverseEngineeringStrategy; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.sql.Types; import java.util.ArrayList; import java.util.List; @@ -14,8 +32,7 @@ import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; import org.hibernate.cfg.reveng.TableIdentifier; import org.hibernate.mapping.Column; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * @author max @@ -28,70 +45,70 @@ public class TestCase { @Test public void testColumnKeepCase() { - Assert.assertEquals("name", rns.columnToPropertyName(null, "name") ); - Assert.assertEquals("nameIsValid", rns.columnToPropertyName(null, "nameIsValid") ); + assertEquals("name", rns.columnToPropertyName(null, "name") ); + assertEquals("nameIsValid", rns.columnToPropertyName(null, "nameIsValid") ); } @Test public void testColumnUpperToLower() { - Assert.assertEquals("name", rns.columnToPropertyName(null, "NAME") ); - Assert.assertEquals("name", rns.columnToPropertyName(null, "Name") ); + assertEquals("name", rns.columnToPropertyName(null, "NAME") ); + assertEquals("name", rns.columnToPropertyName(null, "Name") ); } @Test public void testColumnRemoveChars() { - Assert.assertEquals("name", rns.columnToPropertyName(null, "_Name") ); - Assert.assertEquals("name", rns.columnToPropertyName(null, "_name") ); - Assert.assertEquals("name", rns.columnToPropertyName(null, "_name") ); + assertEquals("name", rns.columnToPropertyName(null, "_Name") ); + assertEquals("name", rns.columnToPropertyName(null, "_name") ); + assertEquals("name", rns.columnToPropertyName(null, "_name") ); } @Test public void testColumnToCamelCase() { - Assert.assertEquals("labelForField", rns.columnToPropertyName(null, "LABEL_FOR_FIELD") ); - Assert.assertEquals("nameToMe", rns.columnToPropertyName(null, "_name-To-Me") ); + assertEquals("labelForField", rns.columnToPropertyName(null, "LABEL_FOR_FIELD") ); + assertEquals("nameToMe", rns.columnToPropertyName(null, "_name-To-Me") ); } @Test public void testColumnChangeCamelCase() { - Assert.assertEquals("labelForField", rns.columnToPropertyName(null, "LabelForField") ); + assertEquals("labelForField", rns.columnToPropertyName(null, "LabelForField") ); } @Test public void testTableKeepCase() { - Assert.assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("SickPatients") ) ); + assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("SickPatients") ) ); } @Test public void testTableUpperToLower() { - Assert.assertEquals("Patients", rns.tableToClassName(new TableIdentifier("PATIENTS") ) ); - Assert.assertEquals("Patients", rns.tableToClassName(new TableIdentifier("patients") ) ); + assertEquals("Patients", rns.tableToClassName(new TableIdentifier("PATIENTS") ) ); + assertEquals("Patients", rns.tableToClassName(new TableIdentifier("patients") ) ); } @Test public void testTableRemoveChars() { - Assert.assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_Patients") ) ); - Assert.assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_patients") ) ); - Assert.assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_patients") ) ); - Assert.assertEquals("PatientInterventions", rns.tableToClassName(new TableIdentifier("_PATIENT_INTERVENTIONS") ) ); + assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_Patients") ) ); + assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_patients") ) ); + assertEquals("Patients", rns.tableToClassName(new TableIdentifier("_patients") ) ); + assertEquals("PatientInterventions", rns.tableToClassName(new TableIdentifier("_PATIENT_INTERVENTIONS") ) ); } @Test public void testTableToCamelCase() { - Assert.assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("Sick_Patients") ) ); - Assert.assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("_Sick-Patients") ) ); + assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("Sick_Patients") ) ); + assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("_Sick-Patients") ) ); } @Test public void testTableKeepCamelCase() { - Assert.assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("SickPatients") ) ); + assertEquals("SickPatients", rns.tableToClassName(new TableIdentifier("SickPatients") ) ); } @Test public void testBasicForeignKeyNames() { - Assert.assertEquals("products", rns.foreignKeyToCollectionName("something", new TableIdentifier("product"), null, new TableIdentifier("order"), null, true ) ); - Assert.assertEquals("willies", rns.foreignKeyToCollectionName("something", new TableIdentifier("willy"), null, new TableIdentifier("order"), null, true ) ); - Assert.assertEquals("boxes", rns.foreignKeyToCollectionName("something", new TableIdentifier("box"), null, new TableIdentifier("order"), null, true ) ); - Assert.assertEquals("order", rns.foreignKeyToEntityName("something", new TableIdentifier("product"), null, new TableIdentifier("order"), null, true ) ); + assertEquals("products", rns.foreignKeyToCollectionName("something", new TableIdentifier("product"), null, new TableIdentifier("order"), null, true ) ); + assertEquals("willies", rns.foreignKeyToCollectionName("something", new TableIdentifier("willy"), null, new TableIdentifier("order"), null, true ) ); + assertEquals("boxes", rns.foreignKeyToCollectionName("something", new TableIdentifier("box"), null, new TableIdentifier("order"), null, true ) ); + assertEquals("order", rns.foreignKeyToEntityName("something", new TableIdentifier("product"), null, new TableIdentifier("order"), null, true ) ); } @Test @@ -106,9 +123,9 @@ public String tableToClassName(TableIdentifier tableIdentifier) { custom.setSettings( new ReverseEngineeringSettings(custom) ); TableIdentifier productTable = new TableIdentifier("product"); - Assert.assertEquals("ProductImpl", custom.tableToClassName( productTable )); + assertEquals("ProductImpl", custom.tableToClassName( productTable )); - Assert.assertEquals("productImpls", custom.foreignKeyToCollectionName("something", productTable, null, new TableIdentifier("order"), null, true ) ); + assertEquals("productImpls", custom.foreignKeyToCollectionName("something", productTable, null, new TableIdentifier("order"), null, true ) ); /*assertEquals("willies", custom.foreignKeyToCollectionName("something", new TableIdentifier("willy"), null, new TableIdentifier("order"), null, true ) ); assertEquals("boxes", custom.foreignKeyToCollectionName("something", new TableIdentifier("box"), null, new TableIdentifier("order"), null, true ) ); assertEquals("order", custom.foreignKeyToEntityName("something", productTable, null, new TableIdentifier("order"), null, true ) );*/ @@ -124,34 +141,34 @@ public void testForeignKeyNamesToPropertyNames() { TableIdentifier toTable = new TableIdentifier("address"); List toColumns = new ArrayList(); - Assert.assertEquals("address", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, true) ); - Assert.assertEquals("companies", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, true) ); + assertEquals("address", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, true) ); + assertEquals("companies", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, true) ); fkName = "billing"; fromColumns.clear(); fromColumns.add(new Column("bill_adr") ); - Assert.assertEquals("addressByBillAdr", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); - Assert.assertEquals("companiesForBillAdr", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); + assertEquals("addressByBillAdr", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); + assertEquals("companiesForBillAdr", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); fromColumns.add(new Column("bill_adrtype") ); - Assert.assertEquals("addressByBilling", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); - Assert.assertEquals("companiesForBilling", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); + assertEquals("addressByBilling", rns.foreignKeyToEntityName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); + assertEquals("companiesForBilling", rns.foreignKeyToCollectionName(fkName, fromTable, fromColumns, toTable, toColumns, false) ); } @Test public void testPreferredTypes() { - Assert.assertEquals("int",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, false, false)); - Assert.assertEquals("because nullable it should not be int", "java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, true, false)); - Assert.assertEquals("java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.NUMERIC,0,9,0, true, false)); - Assert.assertEquals("java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, true, false)); - Assert.assertEquals("serializable",rns.columnToHibernateTypeName(new TableIdentifier("sdf"), "bogus",-567,0,0,0, false, false)); + assertEquals("int",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, false, false)); + assertEquals("java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, true, false), "because nullable it should not be int"); + assertEquals("java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.NUMERIC,0,9,0, true, false)); + assertEquals("java.lang.Integer",rns.columnToHibernateTypeName(null, "bogus",Types.INTEGER,0,0,0, true, false)); + assertEquals("serializable",rns.columnToHibernateTypeName(new TableIdentifier("sdf"), "bogus",-567,0,0,0, false, false)); - Assert.assertEquals("string",rns.columnToHibernateTypeName(new TableIdentifier("sdf"), "bogus",12,0,0,0, false, false)); + assertEquals("string",rns.columnToHibernateTypeName(new TableIdentifier("sdf"), "bogus",12,0,0,0, false, false)); } @Test public void testReservedKeywordsHandling() { - Assert.assertEquals("class_", rns.columnToPropertyName(new TableIdentifier("blah"), "class")); + assertEquals("class_", rns.columnToPropertyName(new TableIdentifier("blah"), "class")); } } From 6a310f16d6cdca8e07d03de259e2d9af0897210d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 12:28:23 +0200 Subject: [PATCH 250/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.VersionTest.TestCase' Signed-off-by: Koen Aers --- .../test/java/org/hibernate/tool/VersionTest/TestCase.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java index 07632660a1..dfd3676725 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/VersionTest/TestCase.java @@ -1,5 +1,7 @@ package org.hibernate.tool.VersionTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.io.File; import java.io.FileInputStream; import java.io.InputStream; @@ -11,8 +13,7 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -23,7 +24,7 @@ public class TestCase { @Test public void testVersion() throws Exception { - Assert.assertEquals( + assertEquals( org.hibernate.tool.Version.VERSION, extractVersion(getPomXml())); } From b3b1c6b555dd9f53e982ed509967279ebbe791d5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 30 Jun 2021 12:48:39 +0200 Subject: [PATCH 251/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove JUnit dependency from module 'hibernate-tools-tests-nodb' Signed-off-by: Koen Aers --- test/nodb/pom.xml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a4df77a7e4..1818fa02f2 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -17,18 +17,14 @@ Hibernate Tools No Database Tests Project - - org.hibernate - hibernate-tools - - - org.hibernate - hibernate-tools-tests-utils - - - junit - junit - + + org.hibernate + hibernate-tools + + + org.hibernate + hibernate-tools-tests-utils + jaxen jaxen From dff1dca4f815c08a74534ea9d9bd296b056c54ee Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 1 Jul 2021 09:45:28 +0200 Subject: [PATCH 252/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'junit-vintage-engine' from module 'hibernate-tools-tests-nodb' Signed-off-by: Koen Aers --- test/nodb/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 1818fa02f2..c6e9f74268 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -37,10 +37,6 @@ org.junit.jupiter junit-jupiter-engine - - org.junit.vintage - junit-vintage-engine - From d368739e1b9d279466ebc50bd114e72b6dbc4456 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 1 Jul 2021 10:07:00 +0200 Subject: [PATCH 253/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add 'junit-jupiter-engine' and 'junit-vintage-engine' dependencies to module 'hibernate-tools-tests-h2' Signed-off-by: Koen Aers --- test/h2/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 3c6523cd91..e041b172df 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -28,6 +28,14 @@ org.hibernate hibernate-tools-tests-common + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + From bf4f557f58b12fce1fa53e152cce804d524f5ab5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 1 Jul 2021 10:40:34 +0200 Subject: [PATCH 254/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbx1093.TestCase' Signed-off-by: Koen Aers --- .../org/hibernate/tool/hbx1093/TestCase.java | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java b/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java index 420eec7d59..59acd9179e 100644 --- a/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java +++ b/test/h2/src/test/java/org/hibernate/tool/hbx1093/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 07-Dec-2004 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.hibernate.tool.hbx1093; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -14,35 +32,31 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tool.hbm2x.POJOExporter; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author koen */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputDir = new File("output"); private MetadataDescriptor metadataDescriptor = null; - private File outputDir = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); - outputDir = temporaryFolder.getRoot(); DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy(); c.setSettings(new ReverseEngineeringSettings(c).setDetectManyToMany(true)); metadataDescriptor = MetadataDescriptorFactory .createJdbcDescriptor(c, null, true); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -56,10 +70,10 @@ public void testGenerateJava() throws IOException { exporter.start(); File etManyToManyComp1 = new File(outputDir, "EtManyToManyComp1.java"); String str = new String(Files.readAllBytes(etManyToManyComp1.toPath())); - Assert.assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP22_ID\"")); + assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP22_ID\"")); File etManyToManyComp2 = new File(outputDir, "EtManyToManyComp2.java"); str = new String(Files.readAllBytes(etManyToManyComp2.toPath())); - Assert.assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP11_ID\"")); + assertTrue(str.contains("@JoinColumn(name=\"FK_ET_MANY_TO_MANY_COMP11_ID\"")); } } From ae0dff2dc53930ef30e92756cd9a42b19d33d7e4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 09:34:04 +0200 Subject: [PATCH 255/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add 'junit-jupiter-engine' and 'junit-vintage-engine' dependencies to module 'hibernate-tools-tests-common' Signed-off-by: Koen Aers --- test/common/pom.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/common/pom.xml b/test/common/pom.xml index 2992cffc7e..806e524ec5 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -16,6 +16,14 @@ Hibernate Tools Common Database Tests Project + + junit + junit + + + jaxen + jaxen + org.hibernate hibernate-tools @@ -24,13 +32,13 @@ org.hibernate hibernate-tools-tests-utils - - junit - junit - - jaxen - jaxen + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine From 294e483014e237a837697a56cea74c054a0fd724 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 11:06:55 +0200 Subject: [PATCH 256/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add 'junit-jupiter-engine' and 'junit-vintage-engine' dependencies to module 'hibernate-tools-tests-utils' Signed-off-by: Koen Aers --- test/utils/pom.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 2d7c0b43d0..66c3affdfd 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -30,14 +30,14 @@ org.hibernate hibernate-tools - - javax.xml.bind - jaxb-api - - - org.glassfish.jaxb - jaxb-runtime - + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + From 515fb15dedcee65b411dc9c7db15ae54754f84a5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 11:23:44 +0200 Subject: [PATCH 257/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.ResourceUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/ResourceUtilTest.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java index 9c2c50ff47..23407f4876 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java @@ -1,20 +1,22 @@ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class ResourceUtilTest { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); @Test public void testGetResourcesLocation() { - Assert.assertEquals( + assertEquals( "/org/hibernate/tools/test/util/", ResourceUtil.getResourcesLocation(this)); } @@ -22,12 +24,11 @@ public void testGetResourcesLocation() { @Test public void testCreateResources() { String[] resources = new String[] { "HelloWorld.hbm.xml" }; - File outputFolder = temporaryFolder.getRoot(); File helloWorldFile = new File(outputFolder, "HelloWorld.hbm.xml"); - Assert.assertFalse(helloWorldFile.exists()); + assertFalse(helloWorldFile.exists()); ResourceUtil.createResources(this, resources, outputFolder); - Assert.assertTrue(helloWorldFile.exists()); - Assert.assertTrue(FileUtil + assertTrue(helloWorldFile.exists()); + assertTrue(FileUtil .findFirstString("class", helloWorldFile) .contains("HelloWorld")); } From 92c00fc52bc422087df3f32b8fe07adf77dd95e7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 15:46:04 +0200 Subject: [PATCH 258/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor class 'org.hibernate.tools.test.util.JUnitUtil' and test class 'org.hibernate.tools.test.util.JUnitUtilTest.java' Signed-off-by: Koen Aers --- test/utils/pom.xml | 1 + .../hibernate/tools/test/util/JUnitUtil.java | 37 ++++++++++---- .../tools/test/util/JUnitUtilTest.java | 51 +++++++++++++------ 3 files changed, 64 insertions(+), 25 deletions(-) diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 66c3affdfd..f0d6acbbc7 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -33,6 +33,7 @@ org.junit.jupiter junit-jupiter-engine + compile org.junit.vintage diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/JUnitUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/JUnitUtil.java index 9dd13f5118..a3a63ad226 100644 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/JUnitUtil.java +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/JUnitUtil.java @@ -1,10 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.util.Iterator; -import org.junit.Assert; -import org.junit.ComparisonFailure; +import org.opentest4j.AssertionFailedError; public class JUnitUtil { @@ -18,18 +38,15 @@ public static void assertIteratorContainsExactly( actualAmountOfElements++; iterator.next(); } - if (actualAmountOfElements != expectedAmountOfElements) { - throw new ComparisonFailure( - reason, - Integer.toString(expectedAmountOfElements), - Integer.toString(actualAmountOfElements)); + if (expectedAmountOfElements != actualAmountOfElements) { + throw new AssertionFailedError(reason, expectedAmountOfElements, actualAmountOfElements); } } public static void assertIsNonEmptyFile(File file) { - Assert.assertTrue(file + " does not exist", file.exists() ); - Assert.assertTrue(file + " not a file", file.isFile() ); - Assert.assertTrue(file + " does not have any contents", file.length()>0); + assertTrue(file.exists(), file + " does not exist"); + assertTrue(file.isFile(), file + " not a file"); + assertTrue(file.length()>0, file + " does not have any contents"); } } diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/JUnitUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/JUnitUtilTest.java index 74da50ec16..acb8b20800 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/JUnitUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/JUnitUtilTest.java @@ -1,11 +1,32 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.util.ArrayList; -import org.junit.Assert; -import org.junit.ComparisonFailure; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.opentest4j.AssertionFailedError; public class JUnitUtilTest { @@ -16,21 +37,21 @@ public void testAssertIteratorContainsExactly() { list.add("bar"); try { JUnitUtil.assertIteratorContainsExactly("less", list.iterator(), 1); - Assert.fail(); - } catch (ComparisonFailure e) { - Assert.assertTrue(e.getMessage().contains("less")); + fail(); + } catch (AssertionFailedError e) { + assertTrue(e.getMessage().contains("less")); } try { JUnitUtil.assertIteratorContainsExactly("more", list.iterator(), 3); - Assert.fail(); - } catch (ComparisonFailure e) { - Assert.assertTrue(e.getMessage().contains("more")); + fail(); + } catch (AssertionFailedError e) { + assertTrue(e.getMessage().contains("more")); } try { JUnitUtil.assertIteratorContainsExactly("exact", list.iterator(), 2); - Assert.assertTrue(true); - } catch (ComparisonFailure e) { - Assert.fail(); + assertTrue(true); + } catch (AssertionFailedError e) { + fail(); } } @@ -41,14 +62,14 @@ public void testAssertIsNonEmptyFile() throws Exception { try { JUnitUtil.assertIsNonEmptyFile(exists); } catch (Exception e) { - Assert.fail(); + fail(); } File doesNotExist = new File(exists.getAbsolutePath() + '_'); try { JUnitUtil.assertIsNonEmptyFile(doesNotExist); - Assert.fail(); + fail(); } catch (AssertionError e) { - Assert.assertTrue(e.getMessage().contains("does not exist")); + assertTrue(e.getMessage().contains("does not exist")); } } From 4e9cf276ab77b039db40220d6f0deb5507855f2a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 16:31:17 +0200 Subject: [PATCH 259/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.JdbcUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/JdbcUtilTest.java | 80 ++++++++++++------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/JdbcUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/JdbcUtilTest.java index 997a9c7d19..4acf7162ee 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/JdbcUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/JdbcUtilTest.java @@ -1,5 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.FileWriter; import java.lang.reflect.InvocationHandler; @@ -13,26 +38,24 @@ import java.sql.ResultSet; import java.util.Properties; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class JdbcUtilTest { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); - @Before + @BeforeEach public void setUp() throws Exception { clearConnectionTable(); createHibernateProperties("sa", "", "jdbc:h2:mem:test"); setUpClassLoader(); } - @After + @AfterEach public void tearDown() throws Exception { clearConnectionTable(); restoreClassLoader(); @@ -41,17 +64,17 @@ public void tearDown() throws Exception { @Test public void testGetConnectionProperties() throws Exception { Properties properties = JdbcUtil.getConnectionProperties(); - Assert.assertEquals("jdbc:h2:mem:test", properties.get("url")); - Assert.assertEquals("sa", properties.get("user")); - Assert.assertEquals("", properties.get("password")); + assertEquals("jdbc:h2:mem:test", properties.get("url")); + assertEquals("sa", properties.get("user")); + assertEquals("", properties.get("password")); } @Test public void testEstablishJdbcConnection() throws Exception { - Assert.assertNull(JdbcUtil.CONNECTION_TABLE.get(this)); + assertNull(JdbcUtil.CONNECTION_TABLE.get(this)); JdbcUtil.establishJdbcConnection(this); Connection connection = JdbcUtil.CONNECTION_TABLE.get(this); - Assert.assertFalse(connection.isClosed()); + assertFalse(connection.isClosed()); } @Test @@ -59,11 +82,11 @@ public void testReleaseJdbcConnection() throws Exception { Connection connection = DriverManager.getConnection("jdbc:h2:mem:test;USER=sa"); JdbcUtil.CONNECTION_TABLE.put(this, connection); - Assert.assertNotNull(JdbcUtil.CONNECTION_TABLE.get(this)); - Assert.assertFalse(connection.isClosed()); + assertNotNull(JdbcUtil.CONNECTION_TABLE.get(this)); + assertFalse(connection.isClosed()); JdbcUtil.releaseJdbcConnection(this); - Assert.assertNull(JdbcUtil.CONNECTION_TABLE.get(this)); - Assert.assertTrue(connection.isClosed()); + assertNull(JdbcUtil.CONNECTION_TABLE.get(this)); + assertTrue(connection.isClosed()); } @Test @@ -74,7 +97,7 @@ public void testExecuteDDL() throws Exception { ResultSet resultSet = connection .getMetaData() .getTables(null, null, "FOO", null); - Assert.assertFalse(resultSet.next()); + assertFalse(resultSet.next()); String[] sqls = new String[] { "CREATE TABLE FOO (BAR INT)" }; @@ -82,7 +105,7 @@ public void testExecuteDDL() throws Exception { resultSet = connection .getMetaData() .getTables(null, null, "FOO", null); - Assert.assertTrue(resultSet.next()); + assertTrue(resultSet.next()); } @Test @@ -96,19 +119,19 @@ public void testToIdentifier() throws Exception { connectionInvocationHandler ); JdbcUtil.CONNECTION_TABLE.put(this, connection); metaDataInvocationHandler.whichCase = "MIXED"; - Assert.assertEquals("Foo", JdbcUtil.toIdentifier(this, "Foo")); + assertEquals("Foo", JdbcUtil.toIdentifier(this, "Foo")); metaDataInvocationHandler.whichCase = "UPPER"; - Assert.assertEquals("FOO", JdbcUtil.toIdentifier(this, "Foo")); + assertEquals("FOO", JdbcUtil.toIdentifier(this, "Foo")); metaDataInvocationHandler.whichCase = "LOWER"; - Assert.assertEquals("foo", JdbcUtil.toIdentifier(this, "Foo")); + assertEquals("foo", JdbcUtil.toIdentifier(this, "Foo")); } @Test public void testIsDatabaseOnline() throws Exception { - Assert.assertTrue(JdbcUtil.isDatabaseOnline()); - new File(temporaryFolder.getRoot(), "hibernate.properties").delete(); + assertTrue(JdbcUtil.isDatabaseOnline()); + new File(outputFolder, "hibernate.properties").delete(); createHibernateProperties("foo", "bar", "jdbc:sqlserver://org.foo.bar:1433"); - Assert.assertFalse(JdbcUtil.isDatabaseOnline()); + assertFalse(JdbcUtil.isDatabaseOnline()); } private void clearConnectionTable() throws Exception { @@ -127,7 +150,6 @@ private void createHibernateProperties( properties.put("hibernate.connection.username", user); properties.put("hibernate.connection.password", password); properties.put("hibernate.connection.url", url); - File outputFolder = temporaryFolder.getRoot(); File propertiesFile = new File(outputFolder, "hibernate.properties"); FileWriter writer = new FileWriter(propertiesFile); properties.store(writer, null); @@ -138,7 +160,7 @@ private void setUpClassLoader() throws Exception { ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( new URLClassLoader( - new URL[] { temporaryFolder.getRoot().toURI().toURL() }, + new URL[] { outputFolder.toURI().toURL() }, currentClassLoader)); } From 57787bd5af87eb5d986a87da0dbde27a2972f918 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 17:38:43 +0200 Subject: [PATCH 260/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.HibernateUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/HibernateUtilTest.java | 58 +++++++++++++------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java index b4d6459ea5..c93d8d3fa9 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/HibernateUtilTest.java @@ -1,5 +1,29 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + +import java.io.File; import java.util.Collections; import java.util.Properties; @@ -11,29 +35,27 @@ import org.hibernate.mapping.Table; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class HibernateUtilTest { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + @Test public void testGetForeignKey() { Table table = new Table(); - Assert.assertNull(HibernateUtil.getForeignKey(table, "foo")); - Assert.assertNull(HibernateUtil.getForeignKey(table, "bar")); - table.createForeignKey("foo", Collections.emptyList(), null, null); - Assert.assertNotNull(HibernateUtil.getForeignKey(table, "foo")); - Assert.assertNull(HibernateUtil.getForeignKey(table, "bar")); + assertNull(HibernateUtil.getForeignKey(table, "foo")); + assertNull(HibernateUtil.getForeignKey(table, "bar")); + table.createForeignKey("foo", Collections.emptyList(), "Bar", null); + assertNotNull(HibernateUtil.getForeignKey(table, "foo")); + assertNull(HibernateUtil.getForeignKey(table, "bar")); } @Test public void testDialectInstantiation() { - Assert.assertNotNull(new HibernateUtil.Dialect()); + assertNotNull(new HibernateUtil.Dialect()); } @Test @@ -42,12 +64,12 @@ public void testInitializeConfiguration() { .initializeMetadataDescriptor( this, new String[] { "HelloWorld.hbm.xml" }, - temporaryFolder.getRoot()) + outputFolder) .createMetadata(); - Assert.assertSame( + assertSame( HibernateUtil.Dialect.class, metadata.getDatabase().getDialect().getClass()); - Assert.assertNotNull(metadata.getEntityBinding("HelloWorld")); + assertNotNull(metadata.getEntityBinding("HelloWorld")); } @Test @@ -56,12 +78,12 @@ public void testAddAnnotatedClass() { properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName()); MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createNativeDescriptor(null, null, properties); - Assert.assertNull(metadataDescriptor + assertNull(metadataDescriptor .createMetadata() .getEntityBinding( "org.hibernate.tools.test.util.HibernateUtilTest$Dummy")); HibernateUtil.addAnnotatedClass(metadataDescriptor, Dummy.class); - Assert.assertNotNull(metadataDescriptor + assertNotNull(metadataDescriptor .createMetadata() .getEntityBinding( "org.hibernate.tools.test.util.HibernateUtilTest$Dummy")); From 2116ca3b82b7121b4f7a7d43f1e7323e7c4b1cad Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 17:51:45 +0200 Subject: [PATCH 261/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.JavaUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/JavaUtilTest.java | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/JavaUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/JavaUtilTest.java index 828302fc09..b07c1974f5 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/JavaUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/JavaUtilTest.java @@ -1,12 +1,32 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.io.FileWriter; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class JavaUtilTest { @@ -22,13 +42,12 @@ public class JavaUtilTest { " public Foo foo; "+ "} "; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); @Test public void testCompile() throws Exception { - File testFolder = temporaryFolder.getRoot(); - File packageFolder = new File(testFolder, "org/hibernate/tool/test"); + File packageFolder = new File(outputFolder, "org/hibernate/tool/test"); packageFolder.mkdirs(); File fooFile = new File(packageFolder, "Foo.java"); FileWriter fileWriter = new FileWriter(fooFile); @@ -38,11 +57,11 @@ public void testCompile() throws Exception { fileWriter = new FileWriter(barFile); fileWriter.write(BAR_STRING); fileWriter.close(); - Assert.assertFalse(new File(packageFolder, "Foo.class").exists()); - Assert.assertFalse(new File(packageFolder, "Bar.class").exists()); - JavaUtil.compile(testFolder); - Assert.assertTrue(new File(packageFolder, "Foo.class").exists()); - Assert.assertTrue(new File(packageFolder, "Bar.class").exists()); + assertFalse(new File(packageFolder, "Foo.class").exists()); + assertFalse(new File(packageFolder, "Bar.class").exists()); + JavaUtil.compile(outputFolder); + assertTrue(new File(packageFolder, "Foo.class").exists()); + assertTrue(new File(packageFolder, "Bar.class").exists()); } } From a05d86b9a6b53d14f4182d18c4509e661241a92d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Jul 2021 18:06:00 +0200 Subject: [PATCH 262/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.FileUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/FileUtilTest.java | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/FileUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/FileUtilTest.java index e10e3b6f19..86bd1605cf 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/FileUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/FileUtilTest.java @@ -1,35 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class FileUtilTest { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); @Test public void testFindFirstString() throws Exception { String resource = "/org/hibernate/tools/test/util/FileUtilTest.resource"; File file = new File(getClass().getResource(resource).toURI()); - Assert.assertEquals("or would it be a bar test?", FileUtil.findFirstString("bar", file)); - Assert.assertNull(FileUtil.findFirstString("foobar", file)); - Assert.assertEquals("This is a foo test", FileUtil.findFirstString("test", file)); - Assert.assertEquals("And a third line...", FileUtil.findFirstString("third", file)); + assertEquals("or would it be a bar test?", FileUtil.findFirstString("bar", file)); + assertNull(FileUtil.findFirstString("foobar", file)); + assertEquals("This is a foo test", FileUtil.findFirstString("test", file)); + assertEquals("And a third line...", FileUtil.findFirstString("third", file)); } @Test public void testGenerateNoopComparator() throws Exception { - FileUtil.generateNoopComparator(temporaryFolder.getRoot()); - File pkg = new File(temporaryFolder.getRoot(), "comparator"); - Assert.assertTrue(pkg.isDirectory() && pkg.exists()); + FileUtil.generateNoopComparator(outputFolder); + File pkg = new File(outputFolder, "comparator"); + assertTrue(pkg.isDirectory() && pkg.exists()); File comp = new File(pkg, "NoopComparator.java"); - Assert.assertTrue(comp.isFile() && comp.exists()); - Assert.assertEquals( + assertTrue(comp.isFile() && comp.exists()); + assertEquals( "public class NoopComparator implements Comparator {", FileUtil.findFirstString("NoopComparator", comp)); } From 7478df866688520cca84d1d65b735c3e3e2811a9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 3 Jul 2021 14:24:23 +0200 Subject: [PATCH 263/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.ConnectionLeakUtilTest' Signed-off-by: Koen Aers --- .../test/util/ConnectionLeakUtilTest.java | 30 +++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java index 262ef0430b..da6c09daec 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/ConnectionLeakUtilTest.java @@ -1,17 +1,37 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2018-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.sql.Connection; import java.sql.DriverManager; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ConnectionLeakUtilTest { private ConnectionLeakUtil connectionLeakUtil = null; - @Before + @BeforeEach public void before() { connectionLeakUtil = ConnectionLeakUtil.forH2(); connectionLeakUtil.initialize(); @@ -24,7 +44,7 @@ public void testLeaks() throws Exception { connectionLeakUtil.assertNoLeaks(); throw new RuntimeException("should not happen"); } catch (AssertionError e) { - Assert.assertEquals("1 connections are leaked.", e.getMessage()); + assertEquals("1 connections are leaked.", e.getMessage()); } } From e1cd5e729eb09bf1335074b5835440dfd4a4f355 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 4 Jul 2021 15:05:10 +0200 Subject: [PATCH 264/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tools.test.util.AntUtilTest' Signed-off-by: Koen Aers --- .../tools/test/util/AntUtilTest.java | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/AntUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/AntUtilTest.java index 9bd9ead03a..c5cf8a6cbe 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/AntUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/AntUtilTest.java @@ -1,15 +1,36 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.ByteArrayInputStream; import java.io.File; import java.nio.file.Files; import org.apache.tools.ant.Target; import org.apache.tools.ant.taskdefs.Echo; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class AntUtilTest { @@ -18,21 +39,21 @@ public class AntUtilTest { " \n" + " \n"; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - + @TempDir + public File outputFolder = new File("output"); + @Test public void testCreateProject() throws Exception { - File buildFile = new File(temporaryFolder.getRoot(), "build.xml"); + File buildFile = new File(outputFolder, "build.xml"); Files.copy(new ByteArrayInputStream(BUILD_XML.getBytes()), buildFile.toPath()); AntUtil.Project project = AntUtil.createProject(buildFile); - Assert.assertEquals("AntUtilTest", project.getName()); + assertEquals("AntUtilTest", project.getName()); } @Test public void testGetLog() { AntUtil.Project project = new AntUtil.Project(); - Assert.assertNull(project.logBuffer); + assertNull(project.logBuffer); Target target = new Target(); target.setName("foobar"); Echo echo = new Echo(); @@ -41,7 +62,7 @@ public void testGetLog() { target.addTask(echo); project.addTarget(target); project.executeTarget("foobar"); - Assert.assertTrue(AntUtil.getLog(project).contains("Executing foobar")); + assertTrue(AntUtil.getLog(project).contains("Executing foobar")); } } From be9b494670905053bd00686b2aae5f8c9665ff4a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 09:29:27 +0200 Subject: [PATCH 265/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename class 'org.hibernate.tool.test.db.h2.TestSuite' to 'org.hibernate.tool.test.db.h2.JUnit4TestSuite' Signed-off-by: Koen Aers --- .../tool/test/db/h2/{TestSuite.java => JUnit4TestSuite.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/h2/src/test/java/org/hibernate/tool/test/db/h2/{TestSuite.java => JUnit4TestSuite.java} (89%) diff --git a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java similarity index 89% rename from test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java rename to test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java index 32cd7ea86b..9127facc0d 100644 --- a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java +++ b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java @@ -8,4 +8,4 @@ @SuiteClasses({ org.hibernate.tool.test.db.CommonTestSuite.class }) -public class TestSuite {} +public class JUnit4TestSuite {} From 5134992fbff8c8df5982199bf63b072a00fcefe9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 10:41:05 +0200 Subject: [PATCH 266/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename class 'org.hibernate.tool.test.db.h2.JUnit4TestSuite' to 'org.hibernate.tool.test.db.h2.TestSuiteJUnit4' Signed-off-by: Koen Aers --- .../test/db/h2/{JUnit4TestSuite.java => TestSuiteJUnit4.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/h2/src/test/java/org/hibernate/tool/test/db/h2/{JUnit4TestSuite.java => TestSuiteJUnit4.java} (89%) diff --git a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java similarity index 89% rename from test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java rename to test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java index 9127facc0d..b9b86c3598 100644 --- a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/JUnit4TestSuite.java +++ b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java @@ -8,4 +8,4 @@ @SuiteClasses({ org.hibernate.tool.test.db.CommonTestSuite.class }) -public class JUnit4TestSuite {} +public class TestSuiteJUnit4 {} From f1937d71c708005fe698a2009b0564c1785c2bc2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 11:37:35 +0200 Subject: [PATCH 267/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor class 'org.hibernate.tools.test.util.ResourceUtil' and test class 'org.hibernate.tools.test.util.ResourceUtilTest' Signed-off-by: Koen Aers --- .../hibernate/tools/test/util/JdbcUtil.java | 3 +- .../tools/test/util/ResourceUtil.java | 53 +++++++++++++++---- .../tools/test/util/ResourceUtilTest.java | 35 ++++++++++-- .../test/resources/ResourceUtilTest.resource | 0 .../tools/test/util/JUnitUtilTest.resource | 1 - .../tools/test/util/hibernate.properties | 1 - 6 files changed, 73 insertions(+), 20 deletions(-) create mode 100644 test/utils/src/test/resources/ResourceUtilTest.resource delete mode 100644 test/utils/src/test/resources/org/hibernate/tools/test/util/JUnitUtilTest.resource delete mode 100644 test/utils/src/test/resources/org/hibernate/tools/test/util/hibernate.properties diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/JdbcUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/JdbcUtil.java index 68a920f462..283b280da9 100644 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/JdbcUtil.java +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/JdbcUtil.java @@ -112,8 +112,7 @@ public static void dropDatabase(Object test) { private static String[] getSqls(Object test, String scriptName) { String[] result = new String[] {}; - String location = ResourceUtil.getResourcesLocation(test) + scriptName; - InputStream inputStream = test.getClass().getResourceAsStream(location); + InputStream inputStream = ResourceUtil.resolveResourceLocation(test.getClass(), scriptName); if (inputStream != null) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/ResourceUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/ResourceUtil.java index 8feb6d8768..6e5ff068e8 100644 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/ResourceUtil.java +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/ResourceUtil.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; import java.io.File; @@ -7,20 +26,10 @@ public class ResourceUtil { - public static String getResourcesLocation(Object test) { - return '/' + test.getClass().getPackage().getName().replace('.', '/') + '/'; - } - public static void createResources(Object test, String[] resources, File resourcesDir) { try { - String defaultResourceLocation = getResourcesLocation(test); for (String resource : resources) { - String resourceLocation = - (resource.startsWith("/")) - ? resource : defaultResourceLocation + resource; - InputStream inputStream = test - .getClass() - .getResourceAsStream(resourceLocation); + InputStream inputStream = resolveResourceLocation(test.getClass(), resource); File resourceFile = new File(resourcesDir, resource); File parent = resourceFile.getParentFile(); if (!parent.exists()) { @@ -33,4 +42,26 @@ public static void createResources(Object test, String[] resources, File resourc } } + public static InputStream resolveResourceLocation(Class testClass, String resourceName) { + InputStream result = null; + if (resourceName.startsWith("/")) { + result = testClass.getResourceAsStream(resourceName); + } else { + result = resolveRelativeResourceLocation(testClass, resourceName); + } + return result; + } + + private static String getRelativeResourcesRoot(Class testClass) { + return '/' + testClass.getPackage().getName().replace('.', '/') + '/'; + } + + private static InputStream resolveRelativeResourceLocation(Class testClass, String resourceName) { + InputStream result = testClass.getResourceAsStream(getRelativeResourcesRoot(testClass) + resourceName); + if (result == null && testClass.getSuperclass() != Object.class) { + result = resolveRelativeResourceLocation(testClass.getSuperclass(), resourceName); + } + return result; + } + } diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java index 23407f4876..5a72c059f3 100644 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java +++ b/test/utils/src/test/java/org/hibernate/tools/test/util/ResourceUtilTest.java @@ -1,10 +1,31 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2017-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tools.test.util; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; +import java.io.InputStream; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -15,10 +36,14 @@ public class ResourceUtilTest { public File outputFolder = new File("output"); @Test - public void testGetResourcesLocation() { - assertEquals( - "/org/hibernate/tools/test/util/", - ResourceUtil.getResourcesLocation(this)); + public void testResolveResourceLocation() { + InputStream is = ResourceUtil.resolveResourceLocation(getClass(), "/foo"); + assertNull(is); + is = ResourceUtil.resolveResourceLocation(getClass(), "/ResourceUtilTest.resource"); + assertNotNull(is); + is = ResourceUtil.resolveResourceLocation(getClass(), "HelloWorld.foo.bar"); + assertNull(is); + is = ResourceUtil.resolveResourceLocation(getClass(), "HelloWorld.hbm.xml"); } @Test diff --git a/test/utils/src/test/resources/ResourceUtilTest.resource b/test/utils/src/test/resources/ResourceUtilTest.resource new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/utils/src/test/resources/org/hibernate/tools/test/util/JUnitUtilTest.resource b/test/utils/src/test/resources/org/hibernate/tools/test/util/JUnitUtilTest.resource deleted file mode 100644 index 52f9fc2b35..0000000000 --- a/test/utils/src/test/resources/org/hibernate/tools/test/util/JUnitUtilTest.resource +++ /dev/null @@ -1 +0,0 @@ -the file is not empty \ No newline at end of file diff --git a/test/utils/src/test/resources/org/hibernate/tools/test/util/hibernate.properties b/test/utils/src/test/resources/org/hibernate/tools/test/util/hibernate.properties deleted file mode 100644 index da21574937..0000000000 --- a/test/utils/src/test/resources/org/hibernate/tools/test/util/hibernate.properties +++ /dev/null @@ -1 +0,0 @@ -hibernate.dialect org.hibernate.tools.test.util.HibernateUtil$Dialect \ No newline at end of file From 601b75d9d798754761d32f5e9d95a968f42b7f10 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 11:59:08 +0200 Subject: [PATCH 268/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add test suite 'org.hibernate.tool.test.db.DbTestSuite' assembling the JUnit Jupiter database tests Signed-off-by: Koen Aers --- test/common/pom.xml | 1 + .../hibernate/tool/test/db/DbTestSuite.java | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 test/common/src/main/java/org/hibernate/tool/test/db/DbTestSuite.java diff --git a/test/common/pom.xml b/test/common/pom.xml index 806e524ec5..3763d27858 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -35,6 +35,7 @@ org.junit.jupiter junit-jupiter-engine + compile org.junit.vintage diff --git a/test/common/src/main/java/org/hibernate/tool/test/db/DbTestSuite.java b/test/common/src/main/java/org/hibernate/tool/test/db/DbTestSuite.java new file mode 100644 index 0000000000..cd3dd17c13 --- /dev/null +++ b/test/common/src/main/java/org/hibernate/tool/test/db/DbTestSuite.java @@ -0,0 +1,79 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.test.db; + +import org.junit.jupiter.api.Nested; + +public class DbTestSuite { + + @Nested public class AntHibernateToolTests extends org.hibernate.tool.ant.AntHibernateTool.TestCase {} + @Nested public class Cfg2HbmNoError extends org.hibernate.tool.ant.Cfg2HbmNoError.TestCase {} + @Nested public class Cfg2HbmWithCustomReverseNamingStrategy extends org.hibernate.tool.ant.Cfg2HbmWithCustomReverseNamingStrategy.TestCase {} + @Nested public class Cfg2HbmWithInvalidReverseNamingStrategy extends org.hibernate.tool.ant.Cfg2HbmWithInvalidReverseNamingStrategy.TestCase {} + @Nested public class Cfg2HbmWithPackageName extends org.hibernate.tool.ant.Cfg2HbmWithPackageName.TestCase {} + @Nested public class Cfg2HbmWithPackageNameAndReverseNamingStrategy extends org.hibernate.tool.ant.Cfg2HbmWithPackageNameAndReverseNamingStrategy.TestCase {} + @Nested public class EJB3Configuration extends org.hibernate.tool.ant.EJB3Configuration.TestCase {} + @Nested public class GenericExport extends org.hibernate.tool.ant.GenericExport.TestCase {} + @Nested public class Hbm2JavaConfiguration extends org.hibernate.tool.ant.Hbm2JavaConfiguration.TestCase {} + @Nested public class Hbm2JavaEJB3Configuration extends org.hibernate.tool.ant.Hbm2JavaEJB3Configuration.TestCase {} + @Nested public class HbmLint extends org.hibernate.tool.ant.HbmLint.TestCase {} + @Nested public class JDBCConfiguration extends org.hibernate.tool.ant.JDBCConfiguration.TestCase {} + @Nested public class JDBCConfigWithRevEngXml extends org.hibernate.tool.ant.JDBCConfigWithRevEngXml.TestCase {} + @Nested public class JPABogusPUnit extends org.hibernate.tool.ant.JPABogusPUnit.TestCase {} + @Nested public class JPAPropertyOverridesPUnit extends org.hibernate.tool.ant.JPAPropertyOverridesPUnit.TestCase {} + @Nested public class JPAPUnit extends org.hibernate.tool.ant.JPAPUnit.TestCase {} + @Nested public class Properties extends org.hibernate.tool.ant.Properties.TestCase {} + @Nested public class Query extends org.hibernate.tool.ant.Query.TestCase {} + @Nested public class SchemaExportWarning extends org.hibernate.tool.ant.SchemaExportWarning.TestCase {} + @Nested public class SchemaUpdateWarning extends org.hibernate.tool.ant.SchemaUpdateWarning.TestCase {} + @Nested public class DriverMetaData extends org.hibernate.tool.cfg.DriverMetaData.TestCase {} + @Nested public class JDBCMetaDataConfiguration extends org.hibernate.tool.cfg.JDBCMetaDataConfiguration.TestCase {} + @Nested public class CachedMetaData extends org.hibernate.tool.hbm2x.CachedMetaData.TestCase {} + @Nested public class DefaultDatabaseCollector extends org.hibernate.tool.hbm2x.DefaultDatabaseCollector.TestCase {} + @Nested public class DefaultSchemaCatalog extends org.hibernate.tool.hbm2x.DefaultSchemaCatalog.TestCase {} + @Nested public class GenerateFromJDBC extends org.hibernate.tool.hbm2x.GenerateFromJDBC.TestCase {} + @Nested public class GenerateFromJDBCWithJavaKeyword extends org.hibernate.tool.hbm2x.GenerateFromJDBCWithJavaKeyword.TestCase {} + @Nested public class IncrementalSchemaReading extends org.hibernate.tool.hbm2x.IncrementalSchemaReading.TestCase {} + @Nested public class JdbcHbm2JavaEjb3 extends org.hibernate.tool.hbm2x.JdbcHbm2JavaEjb3.TestCase {} + @Nested public class QueryExporterTest extends org.hibernate.tool.hbm2x.query.QueryExporterTest.TestCase {} + @Nested public class HbmLintTest extends org.hibernate.tool.hbmlint.HbmLintTest.TestCase {} + @Nested public class SchemaAnalyzer extends org.hibernate.tool.hbmlint.SchemaAnalyzer.TestCase {} + @Nested public class AutoQuote extends org.hibernate.tool.jdbc2cfg.AutoQuote.TestCase {} + @Nested public class Basic extends org.hibernate.tool.jdbc2cfg.Basic.TestCase {} + @Nested public class BasicMultiSchema extends org.hibernate.tool.jdbc2cfg.BasicMultiSchema.TestCase {} + @Nested public class CompositeId extends org.hibernate.tool.jdbc2cfg.CompositeId.TestCase {} + @Nested public class ForeignKeys extends org.hibernate.tool.jdbc2cfg.ForeignKeys.TestCase {} + @Nested public class Identity extends org.hibernate.tool.jdbc2cfg.Identity.TestCase {} + @Nested public class Index extends org.hibernate.tool.jdbc2cfg.Index.TestCase {} + @Nested public class KeyPropertyCompositeId extends org.hibernate.tool.jdbc2cfg.KeyPropertyCompositeId.TestCase {} + @Nested public class ManyToMany extends org.hibernate.tool.jdbc2cfg.ManyToMany.TestCase {} + @Nested public class MetaData extends org.hibernate.tool.jdbc2cfg.MetaData.TestCase {} + @Nested public class NoPrimaryKey extends org.hibernate.tool.jdbc2cfg.NoPrimaryKey.TestCase {} + @Nested public class OneToOne extends org.hibernate.tool.jdbc2cfg.OneToOne.TestCase {} + @Nested public class OverrideBinder extends org.hibernate.tool.jdbc2cfg.OverrideBinder.TestCase {} + @Nested public class Performance extends org.hibernate.tool.jdbc2cfg.Performance.TestCase {} + @Nested public class PersistentClasses extends org.hibernate.tool.jdbc2cfg.PersistentClasses.TestCase {} + @Nested public class RevEngForeignKey extends org.hibernate.tool.jdbc2cfg.RevEngForeignKey.TestCase {} + @Nested public class SearchEscapeString extends org.hibernate.tool.jdbc2cfg.SearchEscapeString.TestCase {} + @Nested public class TernarySchema extends org.hibernate.tool.jdbc2cfg.TernarySchema.TestCase {} + @Nested public class Versioning extends org.hibernate.tool.jdbc2cfg.Versioning.TestCase {} + @Nested public class Statistics extends org.hibernate.tool.stat.Statistics.TestCase {} + +} From 7f81d8c163799a74143ef5fd28127ce17dfec330 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 13:28:38 +0200 Subject: [PATCH 269/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add 'org.hibernate.tool.test.db.h2.TestSuiteJupiter' assembling the JUnit Jupiter tests for H2 Signed-off-by: Koen Aers --- .../tool/test/db/h2/TestSuiteJupiter.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java diff --git a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java new file mode 100644 index 0000000000..21b632d197 --- /dev/null +++ b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java @@ -0,0 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.test.db.h2; + +import org.hibernate.tool.test.db.DbTestSuite; +import org.junit.jupiter.api.Nested; + +public class TestSuiteJupiter { + + @Nested + public class H2TestSuite extends DbTestSuite {} + +} From d50733f9512d6564cadfde39e89b400346632ecc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 13:50:53 +0200 Subject: [PATCH 270/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.AntHibernateTool.TestCase' Signed-off-by: Koen Aers --- .../AntHibernateTool/AnyKindOfUserType.java | 19 +++ .../tool/ant/AntHibernateTool/TestCase.java | 127 +++++++++++------- 2 files changed, 94 insertions(+), 52 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/AnyKindOfUserType.java b/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/AnyKindOfUserType.java index 13095b4851..7c6e906642 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/AnyKindOfUserType.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/AnyKindOfUserType.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.AntHibernateTool; import java.io.Serializable; import java.sql.PreparedStatement; diff --git a/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/TestCase.java index d850663cf7..48ab99e46b 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/AntHibernateTool/TestCase.java @@ -1,36 +1,59 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.AntHibernateTool; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -51,36 +74,36 @@ public void testHbm2DDLLogic() throws Exception { File dropAndCreate = new File(destinationDir, "dropandcreate.sql"); File update = new File(destinationDir, "update.sql"); - Assert.assertFalse(topDown.exists()); - Assert.assertFalse(onlyDrop.exists()); - Assert.assertFalse(onlyCreate.exists()); - Assert.assertFalse(dropAndCreate.exists()); - Assert.assertFalse(update.exists()); + assertFalse(topDown.exists()); + assertFalse(onlyDrop.exists()); + assertFalse(onlyCreate.exists()); + assertFalse(dropAndCreate.exists()); + assertFalse(update.exists()); project.executeTarget("testHbm2DDLLogic"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(topDown.exists()); + assertTrue(topDown.exists()); - Assert.assertTrue(onlyDrop.exists()); - Assert.assertNull(FileUtil.findFirstString("create", onlyDrop)); - Assert.assertNotNull(FileUtil.findFirstString("drop", onlyDrop)); + assertTrue(onlyDrop.exists()); + assertNull(FileUtil.findFirstString("create", onlyDrop)); + assertNotNull(FileUtil.findFirstString("drop", onlyDrop)); - Assert.assertTrue(onlyCreate.exists()); - Assert.assertNull(FileUtil.findFirstString("drop", onlyCreate)); - Assert.assertNotNull(FileUtil.findFirstString("create", onlyCreate)); - Assert.assertNotNull(FileUtil.findFirstString("---", onlyCreate)); + assertTrue(onlyCreate.exists()); + assertNull(FileUtil.findFirstString("drop", onlyCreate)); + assertNotNull(FileUtil.findFirstString("create", onlyCreate)); + assertNotNull(FileUtil.findFirstString("---", onlyCreate)); - Assert.assertTrue(dropAndCreate.exists()); - Assert.assertNotNull(FileUtil.findFirstString("drop", dropAndCreate)); - Assert.assertNotNull(FileUtil.findFirstString("create", dropAndCreate)); - Assert.assertNotNull(FileUtil.findFirstString("---", dropAndCreate)); + assertTrue(dropAndCreate.exists()); + assertNotNull(FileUtil.findFirstString("drop", dropAndCreate)); + assertNotNull(FileUtil.findFirstString("create", dropAndCreate)); + assertNotNull(FileUtil.findFirstString("---", dropAndCreate)); - Assert.assertTrue(update.exists()); - Assert.assertNotNull(FileUtil.findFirstString("create", update)); - Assert.assertNotNull(FileUtil.findFirstString("---", update)); + assertTrue(update.exists()); + assertNotNull(FileUtil.findFirstString("create", update)); + assertNotNull(FileUtil.findFirstString("---", update)); } @@ -99,22 +122,22 @@ public void testHbm2DDLUpdateExecution() { File update1 = new File(destinationDir, "update1.sql"); File update2 = new File(destinationDir, "update2.sql"); - Assert.assertFalse(topDown.exists()); - Assert.assertFalse(onlyDrop.exists()); - Assert.assertFalse(update1.exists()); - Assert.assertFalse(update2.exists()); + assertFalse(topDown.exists()); + assertFalse(onlyDrop.exists()); + assertFalse(update1.exists()); + assertFalse(update2.exists()); project.executeTarget("testantcfgUpdateExecuted"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(topDown.exists()); - Assert.assertTrue(onlyDrop.exists()); - Assert.assertTrue(update1.exists()); - Assert.assertNotNull(FileUtil.findFirstString("create", update1)); - Assert.assertTrue(update2.exists()); - Assert.assertEquals(0, update2.length()); + assertTrue(topDown.exists()); + assertTrue(onlyDrop.exists()); + assertTrue(update1.exists()); + assertNotNull(FileUtil.findFirstString("create", update1)); + assertTrue(update2.exists()); + assertEquals(0, update2.length()); } @@ -132,20 +155,20 @@ public void testHbm2DDLExportExecution() throws Exception { File update = new File(destinationDir, "update.sql"); File onlydrop = new File(destinationDir, "onlydrop.sql"); - Assert.assertFalse(export.exists()); - Assert.assertFalse(update.exists()); - Assert.assertFalse(onlydrop.exists()); + assertFalse(export.exists()); + assertFalse(update.exists()); + assertFalse(onlydrop.exists()); project.executeTarget("testantcfgExportExecuted"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(export.exists()); - Assert.assertTrue(update.exists()); - Assert.assertNotNull(FileUtil.findFirstString("create", export)); + assertTrue(export.exists()); + assertTrue(update.exists()); + assertNotNull(FileUtil.findFirstString("create", export)); // if export is executed, update should be empty - Assert.assertEquals(0, update.length()); + assertEquals(0, update.length()); } From ce0255f80cbcb16b37b3a1febb7ccf285ebbfc2c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 14:12:56 +0200 Subject: [PATCH 271/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Cfg2HbmNoError.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/Cfg2HbmNoError/TestCase.java | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmNoError/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmNoError/TestCase.java index 538874672f..58e0b2bbd9 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmNoError/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmNoError/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmNoError; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,12 +68,12 @@ public void testCfg2HbmNoError() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hbmxml = new File(destinationDir, "VerySimpleTable.hbm.xml"); - Assert.assertFalse(hbmxml.exists()); + assertFalse(hbmxml.exists()); project.executeTarget("testCfg2HbmNoError"); - Assert.assertTrue(hbmxml.exists()); - Assert.assertTrue(FileUtil + assertTrue(hbmxml.exists()); + assertTrue(FileUtil .findFirstString("class", hbmxml) .contains("VerySimpleTable")); From 9cc72d2983f040813c353d3a136af25e3d9d1091 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 14:27:33 +0200 Subject: [PATCH 272/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Cfg2HbmWithCustomReverseNamingStrategy.TestCase' Signed-off-by: Koen Aers --- .../Strategy.java | 19 +++++++ .../TestCase.java | 50 +++++++++++++------ 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/Strategy.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/Strategy.java index 65210dc5dd..3e60a7c301 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/Strategy.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/Strategy.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithCustomReverseNamingStrategy; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/TestCase.java index 64bb5901ae..a3996ed461 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithCustomReverseNamingStrategy; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,12 +68,12 @@ public void testCfg2HbmWithCustomReverseNamingStrategy() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hbmxml = new File(destinationDir, "foo/Bar.hbm.xml"); - Assert.assertFalse(hbmxml.exists()); + assertFalse(hbmxml.exists()); project.executeTarget("testCfg2HbmWithCustomReverseNamingStrategy"); - Assert.assertTrue(hbmxml.exists()); - Assert.assertTrue(FileUtil + assertTrue(hbmxml.exists()); + assertTrue(FileUtil .findFirstString("class", hbmxml) .contains("foo.Bar")); From 56dbbb191473e22e31515fc96f8bc9bb968c52f7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 14:42:33 +0200 Subject: [PATCH 273/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Cfg2HbmWithInvalidReverseNamingStrategy.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 48 +++++++++++++------ 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithInvalidReverseNamingStrategy/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithInvalidReverseNamingStrategy/TestCase.java index 40e84739a2..94ae1e8749 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithInvalidReverseNamingStrategy/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithInvalidReverseNamingStrategy/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithInvalidReverseNamingStrategy; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -50,11 +70,11 @@ public void testCfg2HbmWithInvalidReverseNamingStrategy() { try { project.executeTarget("testCfg2HbmWithInvalidReverseNamingStrategy"); - Assert.fail("A BuildException should happen!"); + fail("A BuildException should happen!"); } catch (BuildException e) { - Assert.assertTrue(e + assertTrue(e .getMessage() .contains("Could not create or find invalid.Strategy")); From fd4dfefdd199f720d931d470b3cc9eb5da769ced Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 15:15:32 +0200 Subject: [PATCH 274/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Cfg2HbmWithPackageName.TestCase' Signed-off-by: Koen Aers --- .../ant/Cfg2HbmWithPackageName/TestCase.java | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageName/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageName/TestCase.java index f70f6fa191..eaab0018dd 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageName/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageName/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithPackageName; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,12 +68,12 @@ public void testCfg2HbmWithPackageName() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hbmxml = new File(destinationDir, "foo/bar/VerySimpleTable.hbm.xml"); - Assert.assertFalse(hbmxml.exists()); + assertFalse(hbmxml.exists()); project.executeTarget("testCfg2HbmWithPackageName"); - Assert.assertTrue(hbmxml.exists()); - Assert.assertTrue(FileUtil + assertTrue(hbmxml.exists()); + assertTrue(FileUtil .findFirstString("class", hbmxml) .contains("foo.bar.VerySimpleTable")); From ada07488c28163891f1329585de8ba826820ac22 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 15:36:20 +0200 Subject: [PATCH 275/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Cfg2HbmWithPackageNameAndReverseNamingStrategy.TestCase' Signed-off-by: Koen Aers --- .../Strategy.java | 19 ++++++++ .../TestCase.java | 45 +++++++++++++------ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/Strategy.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/Strategy.java index 8b0ec9f45e..fef4ea8386 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/Strategy.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/Strategy.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithPackageNameAndReverseNamingStrategy; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/TestCase.java index 49ae729b08..4a561f39cf 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/TestCase.java @@ -1,35 +1,54 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Cfg2HbmWithPackageNameAndReverseNamingStrategy; +import static org.junit.jupiter.api.Assertions.assertFalse; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -47,7 +66,7 @@ public void testCfg2HbmWithPackageNameAndReverseNamingStrategy() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hbmxml = new File(destinationDir, "foo/Bar.hbm.xml"); - Assert.assertFalse(hbmxml.exists()); + assertFalse(hbmxml.exists()); project.executeTarget("testCfg2HbmWithPackageNameAndReverseNamingStrategy"); From eeb1c00a1b578d3ad11de7fdd9112b62d131d407 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 15:53:32 +0200 Subject: [PATCH 276/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.EJB3Configuration.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/EJB3Configuration/TestCase.java | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/EJB3Configuration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/EJB3Configuration/TestCase.java index 2944b7b434..c315f68ee7 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/EJB3Configuration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/EJB3Configuration/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.EJB3Configuration; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,12 +69,12 @@ public void testEJB3ConfigurationFailureExpected() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File ejb3 = new File(destinationDir, "ejb3.sql"); - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); project.executeTarget("testEJB3Configuration"); - Assert.assertTrue(ejb3.exists()); - Assert.assertNotNull(FileUtil.findFirstString("create", ejb3)); + assertTrue(ejb3.exists()); + assertNotNull(FileUtil.findFirstString("create", ejb3)); } From b029ff064a0d418418784e7f3761621cc279fecd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 16:38:41 +0200 Subject: [PATCH 277/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.GenericExport.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/GenericExport/TestCase.java | 68 ++++++++++++------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/GenericExport/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/GenericExport/TestCase.java index 83b37c2f2a..b860a3685d 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/GenericExport/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/GenericExport/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.GenericExport; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,36 +68,36 @@ public void testGenericExport() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File xTopDownJava = new File(destinationDir, "Xorg/hibernate/tool/hbm2x/ant/TopDown.java"); - Assert.assertFalse(xTopDownJava.exists()); + assertFalse(xTopDownJava.exists()); File topDownJava = new File(destinationDir, "org/hibernate/tool/hbm2x/ant/TopDown.java"); - Assert.assertFalse(topDownJava.exists()); + assertFalse(topDownJava.exists()); File topDownQuote = new File(destinationDir, "org/hibernate/tool/hbm2x/ant/TopDown.quote"); - Assert.assertFalse(topDownQuote.exists()); + assertFalse(topDownQuote.exists()); File topDownPojo = new File(destinationDir, "org/hibernate/tool/hbm2x/ant/TopDown.pojo"); - Assert.assertFalse(topDownPojo.exists()); + assertFalse(topDownPojo.exists()); project.executeTarget("testGenericExport"); - Assert.assertTrue(xTopDownJava.exists()); - Assert.assertTrue(FileUtil + assertTrue(xTopDownJava.exists()); + assertTrue(FileUtil .findFirstString("TopDown", xTopDownJava) .contains("TopDown generated by hbm2java")); - Assert.assertTrue(topDownJava.exists()); - Assert.assertTrue(FileUtil + assertTrue(topDownJava.exists()); + assertTrue(FileUtil .findFirstString("TopDown", topDownJava) .contains("TopDown generated by hbm2java")); - Assert.assertTrue(topDownQuote.exists()); - Assert.assertTrue(FileUtil + assertTrue(topDownQuote.exists()); + assertTrue(FileUtil .findFirstString("TopDown", topDownQuote) .contains("pojo=TopDown")); - Assert.assertTrue(topDownPojo.exists()); - Assert.assertTrue(FileUtil + assertTrue(topDownPojo.exists()); + assertTrue(FileUtil .findFirstString("TopDown", topDownPojo) .contains("TopDown generated by hbm2java")); From 44de589cfdd3fce673e50e40c5298f97753f5cd7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 17:11:31 +0200 Subject: [PATCH 278/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Hbm2JavaConfiguration.TestCase' Signed-off-by: Koen Aers --- .../ant/Hbm2JavaConfiguration/TestCase.java | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaConfiguration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaConfiguration/TestCase.java index 5782a6f696..f1875d6276 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaConfiguration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaConfiguration/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Hbm2JavaConfiguration; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,15 +69,15 @@ public void testHbm2JavaConfiguration() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File someClass = new File(destinationDir, "SomeClass.java"); - Assert.assertFalse(someClass.exists()); + assertFalse(someClass.exists()); project.executeTarget("testHbm2JavaConfiguration"); - Assert.assertTrue(someClass.exists()); - Assert.assertTrue(FileUtil + assertTrue(someClass.exists()); + assertTrue(FileUtil .findFirstString("SomeClass", someClass) .contains("SomeClass generated by hbm2java")); - Assert.assertNull(FileUtil.findFirstString("@Entity", someClass)); + assertNull(FileUtil.findFirstString("@Entity", someClass)); } From e456e346f1a03abf0960f3ab2f5cf5b6db298ef3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 20:37:49 +0200 Subject: [PATCH 279/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Hbm2JavaEJB3Configuration.TestCase' Signed-off-by: Koen Aers --- .../Hbm2JavaEJB3Configuration/TestCase.java | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/TestCase.java index 26aab4c1b5..f82798fa86 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Hbm2JavaEJB3Configuration; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,15 +69,15 @@ public void testHbm2JavaConfiguration() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File someClass = new File(destinationDir, "SomeClass.java"); - Assert.assertFalse(someClass.exists()); + assertFalse(someClass.exists()); project.executeTarget("testHbm2JavaEJB3Configuration"); - Assert.assertTrue(someClass.exists()); - Assert.assertTrue(FileUtil + assertTrue(someClass.exists()); + assertTrue(FileUtil .findFirstString("SomeClass", someClass) .contains("SomeClass generated by hbm2java")); - Assert.assertNotNull(FileUtil.findFirstString("@Entity", someClass)); + assertNotNull(FileUtil.findFirstString("@Entity", someClass)); } From 558de1da64702e78cc3bb7dcb66b5d7dc580e1b2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 20:52:17 +0200 Subject: [PATCH 280/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.HbmLint.TestCase' Signed-off-by: Koen Aers --- .../hibernate/tool/ant/HbmLint/TestCase.java | 62 ++++++++++++------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/HbmLint/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/HbmLint/TestCase.java index d9479d51a6..68548877e8 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/HbmLint/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/HbmLint/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.HbmLint; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,37 +68,37 @@ public void testHbmLint() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hbmLintResult = new File(destinationDir, "hbmlint-result.txt"); - Assert.assertFalse(hbmLintResult.exists()); + assertFalse(hbmLintResult.exists()); project.executeTarget("testHbmLint"); - Assert.assertTrue(hbmLintResult.exists()); + assertTrue(hbmLintResult.exists()); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("BadType", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("Category", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("Column", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("does_not_exist", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("hilo_table", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("MissingTable", hbmLintResult) .contains("SCHEMA_TABLE_MISSING")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("MISSING_ID_GENERATOR", hbmLintResult) .contains("does_not_exist")); From b1b14a0073eb091bbcaeb345da7e0b82c699dc59 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 22:09:34 +0200 Subject: [PATCH 281/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JDBCConfiguration.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/JDBCConfiguration/TestCase.java | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfiguration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfiguration/TestCase.java index 339aeba7e4..237cc35e73 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfiguration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfiguration/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.JDBCConfiguration; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -56,27 +76,27 @@ public void testJDBCConfiguration() { File withTemplate = new File(destinationDir, "with-template/BottomUp.java"); File cfgxml = new File(destinationDir, "cfgxml/hibernate.cfg.xml"); - Assert.assertFalse(noTemplate.exists()); - Assert.assertFalse(withTemplate.exists()); - Assert.assertFalse(cfgxml.exists()); + assertFalse(noTemplate.exists()); + assertFalse(withTemplate.exists()); + assertFalse(cfgxml.exists()); project.executeTarget("testJDBCConfiguration"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(noTemplate.exists()); - Assert.assertTrue(FileUtil + assertTrue(noTemplate.exists()); + assertTrue(FileUtil .findFirstString("public", noTemplate) .contains("BottomUp")); - Assert.assertTrue(withTemplate.exists()); - Assert.assertTrue(FileUtil + assertTrue(withTemplate.exists()); + assertTrue(FileUtil .findFirstString("template", withTemplate) .contains("/** Made by a template in your neighborhood */")); - Assert.assertTrue(cfgxml.exists()); - Assert.assertTrue(FileUtil + assertTrue(cfgxml.exists()); + assertTrue(FileUtil .findFirstString("mapping", cfgxml) .contains("BottomUp.hbm.xml")); From 8fb00bfa708ae5ab518aaba4f975c5929e777aa7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 22:28:31 +0200 Subject: [PATCH 282/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JDBCConfigWithRevEngXml.TestCase' Signed-off-by: Koen Aers --- .../ant/JDBCConfigWithRevEngXml/TestCase.java | 54 +++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/TestCase.java index 8cdba6814d..3eb3f71ed0 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.JDBCConfigWithRevEngXml; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,18 +68,18 @@ public void testJDBCConfigWithRevEngXml() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File bottomUp = new File(destinationDir, "foo/BottomUp.java"); - Assert.assertFalse(bottomUp.exists()); + assertFalse(bottomUp.exists()); project.executeTarget("testJDBCConfigWithRevEngXml"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(bottomUp.exists()); - Assert.assertTrue(FileUtil + assertTrue(bottomUp.exists()); + assertTrue(FileUtil .findFirstString("good", bottomUp) .contains("Boolean")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("something", bottomUp) .contains("SomeUserType")); From 5dd8fed29844a1decb8a9f8ebcbf8e569ff93535 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 22:45:39 +0200 Subject: [PATCH 283/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JPABogusPUnit.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/JPABogusPUnit/TestCase.java | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/JPABogusPUnit/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/JPABogusPUnit/TestCase.java index 88308fdcce..325f68e068 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/JPABogusPUnit/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/JPABogusPUnit/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.JPABogusPUnit; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,17 +69,17 @@ public void testJPABogusPUnit() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File ejb3 = new File(destinationDir, "ejb3.sql"); - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); try { project.executeTarget("testJPABogusPUnit"); - Assert.fail("The Bogus unit was accepted"); + fail("The Bogus unit was accepted"); } catch (BuildException e) { String log = AntUtil.getLog(project); - Assert.assertTrue(log, log.contains("Persistence unit not found: 'shouldnotbethere'")); + assertTrue(log.contains("Persistence unit not found: 'shouldnotbethere'"), log); } - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); } From 70c6244f97395bb6bb02e01e938b0c29dfcf86c2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 23:02:43 +0200 Subject: [PATCH 284/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JPAPropertyOverridesPUnit.TestCase' Signed-off-by: Koen Aers --- .../JPAPropertyOverridesPUnit/TestCase.java | 53 +++++++++++++------ 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/TestCase.java index 6053a3466b..c12d81b2ae 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.JPAPropertyOverridesPUnit; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.apache.tools.ant.BuildException; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,17 +69,17 @@ public void testJPAPUnit() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File ejb3 = new File(destinationDir, "ejb3.sql"); - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); try { project.executeTarget("testJPAPropertyOverridesPUnit"); - Assert.fail("property overrides not accepted"); + fail("property overrides not accepted"); } catch (BuildException e) { // should happen - Assert.assertTrue(e.getMessage().contains("FAKEDialect")); + assertTrue(e.getMessage().contains("FAKEDialect")); } - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); } From 3f327b9bfa3ee0c60de5819c8ca32fb1a9c41ef3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 5 Jul 2021 23:25:43 +0200 Subject: [PATCH 285/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.JPAPUnit.TestCase' Signed-off-by: Koen Aers --- .../hibernate/tool/ant/JPAPUnit/TestCase.java | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/JPAPUnit/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/JPAPUnit/TestCase.java index eab81f2871..0efbf88c22 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/JPAPUnit/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/JPAPUnit/TestCase.java @@ -1,36 +1,57 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.JPAPUnit; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,12 +69,12 @@ public void testJPAPUnit() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File ejb3 = new File(destinationDir, "ejb3.sql"); - Assert.assertFalse(ejb3.exists()); + assertFalse(ejb3.exists()); project.executeTarget("testJPAPUnit"); - Assert.assertTrue(ejb3.exists()); - Assert.assertNotNull(FileUtil.findFirstString("create", ejb3)); + assertTrue(ejb3.exists()); + assertNotNull(FileUtil.findFirstString("create", ejb3)); } From f6070ed770930eead5bf637208ba4d8a2b61f01a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 02:15:32 +0200 Subject: [PATCH 286/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Properties.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/Properties/TestCase.java | 62 ++++++++++++------- 1 file changed, 41 insertions(+), 21 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Properties/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Properties/TestCase.java index 90a0aa38aa..d737b0557c 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Properties/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Properties/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Properties; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -53,31 +73,31 @@ public void testProperties() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File file = new File(destinationDir, "SomeClass.java"); - Assert.assertFalse(file.exists()); + assertFalse(file.exists()); project.executeTarget("testProperties"); String log = AntUtil.getLog(project); - Assert.assertTrue(log, !log.contains("Exception")); + assertTrue(!log.contains("Exception"), log); - Assert.assertTrue(file.exists()); + assertTrue(file.exists()); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("hbm2java.weirdAl", file) .contains("foo3")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("ant.project.name", file) .contains("PropertiesTest")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("foo.weirdAl", file) .contains("does not exist")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("bar", file) .contains("foo2")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("file", file) .contains("some.file")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("value", file) .contains("some value")); From b764b5befacc5c02d98f0f8700849aec93f0e4a7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 02:30:40 +0200 Subject: [PATCH 287/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.Query.TestCase' Signed-off-by: Koen Aers --- .../tool/ant/Query/ObjectResult.java | 19 ++++++ .../tool/ant/Query/SerializableResult.java | 19 ++++++ .../hibernate/tool/ant/Query/TestCase.java | 62 +++++++++++++------ 3 files changed, 80 insertions(+), 20 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Query/ObjectResult.java b/test/common/src/main/java/org/hibernate/tool/ant/Query/ObjectResult.java index b0e04ed065..08bdf143fd 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Query/ObjectResult.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Query/ObjectResult.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Query; public class ObjectResult { diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Query/SerializableResult.java b/test/common/src/main/java/org/hibernate/tool/ant/Query/SerializableResult.java index 171e7b2fab..e5c1b2a15f 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Query/SerializableResult.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Query/SerializableResult.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Query; import java.io.Serializable; diff --git a/test/common/src/main/java/org/hibernate/tool/ant/Query/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/Query/TestCase.java index bf09e3e9d1..527d0548da 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/Query/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/Query/TestCase.java @@ -1,36 +1,58 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.Query; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -48,25 +70,25 @@ public void testQuery() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File hqlQuery = new File(destinationDir, "hqlQuery.txt"); - Assert.assertFalse(hqlQuery.exists()); + assertFalse(hqlQuery.exists()); File textQuery = new File(destinationDir, "textQuery.txt"); - Assert.assertFalse(textQuery.exists()); + assertFalse(textQuery.exists()); project.executeTarget("testQuery"); - Assert.assertTrue(hqlQuery.exists()); - Assert.assertTrue(FileUtil + assertTrue(hqlQuery.exists()); + assertTrue(FileUtil .findFirstString("First", hqlQuery) .contains("SerializableResult(id:First,length:1023)")); - Assert.assertTrue(FileUtil + assertTrue(FileUtil .findFirstString("Third", hqlQuery) .contains("ObjectResult(id:Third,length:4095)")); - Assert.assertTrue(textQuery.exists()); - Assert.assertTrue(FileUtil + assertTrue(textQuery.exists()); + assertTrue(FileUtil .findFirstString("First", textQuery) .contains("SerializableResult(id:First,length:1023)")); - Assert.assertNull(FileUtil.findFirstString("Third", textQuery)); + assertNull(FileUtil.findFirstString("Third", textQuery)); } From dd39e2067e45766303c52b2ed919079b31fba70a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 16:03:51 +0200 Subject: [PATCH 288/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.SchemaExportWarning.TestCase' Signed-off-by: Koen Aers --- .../ant/SchemaExportWarning/TestCase.java | 52 +++++++++++++------ 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/SchemaExportWarning/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/SchemaExportWarning/TestCase.java index a3abfd42e8..caa54354f0 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/SchemaExportWarning/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/SchemaExportWarning/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.SchemaExportWarning; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -47,17 +67,17 @@ public void testSchemaExport() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File schemaExport = new File(destinationDir, "schemaexport.sql"); - Assert.assertFalse(schemaExport.exists()); + assertFalse(schemaExport.exists()); project.executeTarget("testSchemaExportWarning"); - Assert.assertTrue(schemaExport.exists()); - Assert.assertTrue(FileUtil + assertTrue(schemaExport.exists()); + assertTrue(FileUtil .findFirstString("drop", schemaExport) .contains("TopDown")); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); + assertFalse(log.contains("Exception")); } From 4b7702165dbc9a816e49e5aa368084228454fd4b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 16:30:39 +0200 Subject: [PATCH 289/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.ant.SchemaUpdateWarning.TestCase' Signed-off-by: Koen Aers --- .../ant/SchemaUpdateWarning/TestCase.java | 56 +++++++++++++------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/ant/SchemaUpdateWarning/TestCase.java b/test/common/src/main/java/org/hibernate/tool/ant/SchemaUpdateWarning/TestCase.java index f2e1c021ac..e88bac6cbe 100644 --- a/test/common/src/main/java/org/hibernate/tool/ant/SchemaUpdateWarning/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/ant/SchemaUpdateWarning/TestCase.java @@ -1,36 +1,56 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.ant.SchemaUpdateWarning; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.tools.test.util.AntUtil; import org.hibernate.tools.test.util.FileUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("output"); private File destinationDir = null; private File resourcesDir = null; - @Before + @BeforeEach public void setUp() { - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(outputFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(outputFolder, "resources"); resourcesDir.mkdir(); JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -47,19 +67,19 @@ public void testSchemaUpdateWarning() { project.setProperty("resourcesDir", resourcesDir.getAbsolutePath()); File schemaUpdate = new File(destinationDir, "schemaupdate.sql"); - Assert.assertFalse(schemaUpdate.exists()); + assertFalse(schemaUpdate.exists()); project.executeTarget("testSchemaUpdateWarning"); - Assert.assertTrue(schemaUpdate.exists()); - Assert.assertTrue(FileUtil + assertTrue(schemaUpdate.exists()); + assertTrue(FileUtil .findFirstString("create", schemaUpdate) .contains("TopDown")); String log = AntUtil.getLog(project); - Assert.assertFalse(log.contains("Exception")); - Assert.assertTrue(log.contains("Hibernate Core SchemaUpdate")); - Assert.assertTrue(log.contains("tools.hibernate.org")); + assertFalse(log.contains("Exception")); + assertTrue(log.contains("Hibernate Core SchemaUpdate")); + assertTrue(log.contains("tools.hibernate.org")); } From bfa049297b2894c91a5b46f9ab126964b8c6a7d8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 17:04:24 +0200 Subject: [PATCH 290/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.cfg.DriverMetaData.TestCase' Signed-off-by: Koen Aers --- .../tool/cfg/DriverMetaData/TestCase.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/cfg/DriverMetaData/TestCase.java b/test/common/src/main/java/org/hibernate/tool/cfg/DriverMetaData/TestCase.java index 648c276d26..32715ccc47 100644 --- a/test/common/src/main/java/org/hibernate/tool/cfg/DriverMetaData/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/cfg/DriverMetaData/TestCase.java @@ -4,6 +4,9 @@ */ package org.hibernate.tool.cfg.DriverMetaData; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.Iterator; import java.util.Map; import java.util.Properties; @@ -21,10 +24,9 @@ import org.hibernate.service.ServiceRegistry; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -35,7 +37,7 @@ public class TestCase { private Properties properties = null; private ServiceRegistry serviceRegistry; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); properties = Environment.getProperties(); @@ -43,7 +45,7 @@ public void setUp() { serviceRegistry = ssrb.build(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -86,10 +88,10 @@ public void testExportedKeys() { exportedKeys.next(); cnt++; } - Assert.assertEquals(1,cnt); + assertEquals(1,cnt); } } - Assert.assertTrue(foundMaster); + assertTrue(foundMaster); } @Test From 99e47b615333bdfa89fa22ab55bccce8d1c2ad39 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 17:20:34 +0200 Subject: [PATCH 291/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.cfg.JDBCMetaDataConfiguration.TestCase' Signed-off-by: Koen Aers --- .../JDBCMetaDataConfiguration/TestCase.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java index 403d490328..623b182a7d 100644 --- a/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java @@ -1,13 +1,14 @@ package org.hibernate.tool.cfg.JDBCMetaDataConfiguration; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.hibernate.boot.Metadata; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -15,12 +16,12 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -30,15 +31,15 @@ public void testReadFromJDBC() throws Exception { Metadata metadata = MetadataDescriptorFactory .createJdbcDescriptor(null, null, true) .createMetadata(); - Assert.assertNotNull("WithRealTimestamp", metadata.getEntityBinding("WithRealTimestamp")); - Assert.assertNotNull("NoVersion", metadata.getEntityBinding("NoVersion")); - Assert.assertNotNull("WithFakeTimestamp", metadata.getEntityBinding("WithFakeTimestamp")); - Assert.assertNotNull("WithVersion", metadata.getEntityBinding("WithVersion")); + assertNotNull(metadata.getEntityBinding("WithRealTimestamp"), "WithRealTimestamp"); + assertNotNull(metadata.getEntityBinding("NoVersion"), "NoVersion"); + assertNotNull(metadata.getEntityBinding("WithFakeTimestamp"), "WithFakeTimestamp"); + assertNotNull(metadata.getEntityBinding("WithVersion"), "WithVersion"); } @Test public void testGetTable() throws Exception { - Assert.assertNotNull( + assertNotNull( HibernateUtil.getTable( MetadataDescriptorFactory .createJdbcDescriptor(null, null, true) From ceaf8914ba42bdf906c26e68511e8986487d915d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 17:38:07 +0200 Subject: [PATCH 292/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.CachedMetaData.TestCase' Signed-off-by: Koen Aers --- .../JDBCMetaDataConfiguration/TestCase.java | 19 ++++++++ .../tool/hbm2x/CachedMetaData/TestCase.java | 46 +++++++++++++------ 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java b/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java index 623b182a7d..cd6bd1d892 100644 --- a/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/TestCase.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.cfg.JDBCMetaDataConfiguration; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/CachedMetaData/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/CachedMetaData/TestCase.java index 1e67ca4f62..effef1004f 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/CachedMetaData/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/CachedMetaData/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbm2x.CachedMetaData; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.Iterator; import java.util.Map; import java.util.Properties; @@ -25,12 +44,9 @@ import org.hibernate.service.ServiceRegistry; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -121,12 +137,12 @@ public Iterator> getSuggestedPrimaryKeyStrategyName(String c } - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -178,15 +194,15 @@ private void validate(DatabaseCollector dc) { child = table; master = iterator.next(); } else { - Assert.fail("Only tables named 'MASTER' and 'CHILD' should exist"); + fail("Only tables named 'MASTER' and 'CHILD' should exist"); } - Assert.assertNotNull(child); - Assert.assertNotNull(master); + assertNotNull(child); + assertNotNull(master); iterator = dc.iterateTables(); - Assert.assertNotNull(iterator.next()); - Assert.assertNotNull(iterator.next()); - Assert.assertFalse(iterator.hasNext()); + assertNotNull(iterator.next()); + assertNotNull(iterator.next()); + assertFalse(iterator.hasNext()); JUnitUtil.assertIteratorContainsExactly( "should have recorded one foreignkey to child table", From a7326292d07ec17618413791e4adc882758e6664 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 17:56:51 +0200 Subject: [PATCH 293/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.DefaultDatabaseCollector.TestCase' Signed-off-by: Koen Aers --- .../DefaultDatabaseCollector/TestCase.java | 65 +++++++++++-------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java index 64bbf918f0..b227e1858b 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java @@ -1,15 +1,29 @@ -/******************************************************************************* - * Copyright (c) 2010 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * - * Contributor: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.DefaultDatabaseCollector; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -35,10 +49,9 @@ import org.hibernate.service.ServiceRegistry; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author Dmitry Geraskov @@ -46,12 +59,12 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -64,7 +77,7 @@ public void testReadOnlySpecificSchema() { List

tables = getTables(MetadataDescriptorFactory .createJdbcDescriptor(res, null, true) .createMetadata()); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("cat.master")) { @@ -73,8 +86,8 @@ public void testReadOnlySpecificSchema() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals(new TableIdentifier(null, "cat.cat", "cat.child"), childid); - Assert.assertEquals(new TableIdentifier(null, "cat.cat", "cat.master"), masterid); + assertEquals(new TableIdentifier(null, "cat.cat", "cat.child"), childid); + assertEquals(new TableIdentifier(null, "cat.cat", "cat.master"), masterid); } @Test @@ -84,9 +97,9 @@ public void testNeedQuote() { ssrb.applySettings(properties); ServiceRegistry serviceRegistry = ssrb.build(); MetaDataDialect realMetaData = MetaDataDialectFactory.createMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), properties ); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.cat")); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.child")); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.master")); + assertTrue(realMetaData.needQuote("cat.cat"), "The name must be quoted!"); + assertTrue(realMetaData.needQuote("cat.child"), "The name must be quoted!"); + assertTrue(realMetaData.needQuote("cat.master"), "The name must be quoted!"); } /** @@ -111,11 +124,11 @@ properties, new DefaultReverseEngineeringStrategy(), DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect()); reader.readDatabaseSchema( dc, null, "cat.cat" ); String defaultCatalog = properties.getProperty(AvailableSettings.DEFAULT_CATALOG); - Assert.assertNotNull("The table should be found", dc.getTable("cat.cat", defaultCatalog, "cat.child")); - Assert.assertNotNull("The table should be found", dc.getTable("cat.cat", defaultCatalog, "cat.master")); - Assert.assertNull("Quoted names should not return the table", dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.child"))); - Assert.assertNull("Quoted names should not return the table", dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.master"))); - Assert.assertEquals("Foreign key 'masterref' was filtered!", 1, dc.getOneToManyCandidates().size()); + assertNotNull(dc.getTable("cat.cat", defaultCatalog, "cat.child"), "The table should be found"); + assertNotNull(dc.getTable("cat.cat", defaultCatalog, "cat.master"), "The table should be found"); + assertNull(dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.child")), "Quoted names should not return the table"); + assertNull(dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.master")), "Quoted names should not return the table"); + assertEquals(1, dc.getOneToManyCandidates().size(), "Foreign key 'masterref' was filtered!"); } private static String quote(String name) { From 192311222c4f7fa8773b5d88a47b563589fb77f6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 18:11:39 +0200 Subject: [PATCH 294/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.DefaultSchemaCatalog.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/DefaultSchemaCatalog/TestCase.java | 49 ++++++++++++------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java index d7a019d80c..0c351227d8 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbm2x.DefaultSchemaCatalog; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -21,12 +39,9 @@ import org.hibernate.mapping.Table; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -34,12 +49,12 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -52,7 +67,7 @@ public void testReadOnlySpecificSchema() { List
tables = getTables(MetadataDescriptorFactory .createJdbcDescriptor(res, null, true) .createMetadata()); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("CATMASTER")) { @@ -61,8 +76,8 @@ public void testReadOnlySpecificSchema() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals(new TableIdentifier(null, "OVRTEST", "CATMASTER"), masterid); - Assert.assertEquals(new TableIdentifier(null, "OVRTEST", "CATCHILD"), childid); + assertEquals(new TableIdentifier(null, "OVRTEST", "CATMASTER"), masterid); + assertEquals(new TableIdentifier(null, "OVRTEST", "CATCHILD"), childid); } @Test @@ -82,9 +97,9 @@ public void testOverlapping() { Table element = iter.next(); boolean added = tables.add(TableIdentifier.create(element)); if(!added) - Assert.fail("duplicate table found for " + element); + fail("duplicate table found for " + element); } - Assert.assertEquals(4,tables.size()); + assertEquals(4,tables.size()); } @Test @@ -95,7 +110,7 @@ public void testUseDefault() { List
tables = getTables(MetadataDescriptorFactory .createJdbcDescriptor(null, properties, true) .createMetadata()); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("CATMASTER")) { @@ -104,8 +119,8 @@ public void testUseDefault() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals("jdbcreader has not nulled out according to default schema", new TableIdentifier(null, null, "CATMASTER"), masterid); - Assert.assertEquals("jdbcreader has not nulled out according to default schema", new TableIdentifier(null, null, "CATCHILD"), childid); + assertEquals(new TableIdentifier(null, null, "CATMASTER"), masterid, "jdbcreader has not nulled out according to default schema"); + assertEquals(new TableIdentifier(null, null, "CATCHILD"), childid, "jdbcreader has not nulled out according to default schema"); } private List
getTables(Metadata metadata) { From dc361f31f9fdb37c9749e45bc772cbe03e067821 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 18:37:44 +0200 Subject: [PATCH 295/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.GenerateFromJDBC.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/GenerateFromJDBC/TestCase.java | 62 ++++++++++++------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java index 1670d8eeb6..cf563534d2 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBC/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 07-Dec-2004 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbm2x.GenerateFromJDBC; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.sql.SQLException; import java.util.Iterator; @@ -28,12 +48,10 @@ import org.hibernate.tool.hbm2x.POJOExporter; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -44,23 +62,21 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputDir = new File("output"); private MetadataDescriptor metadataDescriptor = null; - private File outputDir = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); - outputDir = temporaryFolder.getRoot(); DefaultReverseEngineeringStrategy configurableNamingStrategy = new DefaultReverseEngineeringStrategy(); configurableNamingStrategy.setSettings(new ReverseEngineeringSettings(configurableNamingStrategy).setDefaultPackageName("org.reveng").setCreateCollectionForForeignKey(false)); metadataDescriptor = MetadataDescriptorFactory .createJdbcDescriptor(configurableNamingStrategy, null, true); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -86,15 +102,15 @@ public void testGenerateMappings() { exporter.start(); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "org/reveng/Child.hbm.xml")); File file = new File(outputDir, "GeneralHbmSettings.hbm.xml"); - Assert.assertTrue(file + " should not exist", !file.exists() ); + assertTrue(!file.exists(), file + " should not exist" ); File[] files = new File[2]; files[0] = new File(outputDir, "org/reveng/Child.hbm.xml"); files[1] = new File(outputDir, "org/reveng/Master.hbm.xml"); Metadata metadata = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) .createMetadata(); - Assert.assertNotNull(metadata.getEntityBinding("org.reveng.Child") ); - Assert.assertNotNull(metadata.getEntityBinding("org.reveng.Master") ); + assertNotNull(metadata.getEntityBinding("org.reveng.Child") ); + assertNotNull(metadata.getEntityBinding("org.reveng.Master") ); } @Test @@ -116,11 +132,11 @@ public void testGenerateCfgXml() throws Exception { for (int i = 0; i < nodeList.getLength(); i++) { elements[i] = (Node)nodeList.item(i); } - Assert.assertEquals(2, elements.length); + assertEquals(2, elements.length); for (int i = 0; i < elements.length; i++) { Node element = elements[i]; - Assert.assertNotNull(element.getAttributes().getNamedItem("resource")); - Assert.assertNull(element.getAttributes().getNamedItem("class")); + assertNotNull(element.getAttributes().getNamedItem("resource")); + assertNull(element.getAttributes().getNamedItem("class")); } } @@ -145,11 +161,11 @@ public void testGenerateAnnotationCfgXml() throws Exception { for (int i = 0; i < nodeList.getLength(); i++) { elements[i] = (Node)nodeList.item(i); } - Assert.assertEquals(2, elements.length); + assertEquals(2, elements.length); for (int i = 0; i < elements.length; i++) { Node element = elements[i]; - Assert.assertNull(element.getAttributes().getNamedItem("resource")); - Assert.assertNotNull(element.getAttributes().getNamedItem("class")); + assertNull(element.getAttributes().getNamedItem("resource")); + assertNotNull(element.getAttributes().getNamedItem("class")); } } @@ -170,7 +186,7 @@ public void testPackageNames() { .iterator(); while (iter.hasNext() ) { PersistentClass element = iter.next(); - Assert.assertEquals("org.reveng", StringHelper.qualifier(element.getClassName() ) ); + assertEquals("org.reveng", StringHelper.qualifier(element.getClassName() ) ); } } } From 644740140e656db3e9b7074d481d321468a3689d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 19:26:09 +0200 Subject: [PATCH 296/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.GenerateFromJDBCWithJavaKeyword.TestCase' Signed-off-by: Koen Aers --- .../TestCase.java | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/TestCase.java index 4b735ce9f5..6cce22bbf7 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/TestCase.java @@ -1,5 +1,27 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.GenerateFromJDBCWithJavaKeyword; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.InputStream; @@ -17,12 +39,10 @@ import org.hibernate.tool.hbm2x.POJOExporter; import org.hibernate.tools.test.util.JavaUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author koen@hibernate.org @@ -44,18 +64,15 @@ public class TestCase { "
\n"+ " "; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - private File outputDir = null; + @TempDir + public File outputDir = new File("output"); - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); - outputDir = temporaryFolder.getRoot(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -67,19 +84,19 @@ public void testGenerateJava() throws Exception { exporter.setOutputDirectory(outputDir); exporter.start(); File myReturn = new File(outputDir, "org/reveng/MyReturn.java"); - Assert.assertTrue(myReturn.exists()); + assertTrue(myReturn.exists()); File myReturnHistory = new File(outputDir, "org/reveng/MyReturnHistory.java"); - Assert.assertTrue(myReturnHistory.exists()); + assertTrue(myReturnHistory.exists()); JavaUtil.compile(outputDir); URLClassLoader loader = new URLClassLoader(new URL[] { outputDir.toURI().toURL() } ); Class returnClass = loader.loadClass("org.reveng.MyReturn"); - Assert.assertNotNull(returnClass); + assertNotNull(returnClass); Class returnHistoryClass = loader.loadClass("org.reveng.MyReturnHistory"); - Assert.assertNotNull(returnHistoryClass); + assertNotNull(returnHistoryClass); Field returnField = returnHistoryClass.getDeclaredField("return_"); - Assert.assertNotNull(returnField); + assertNotNull(returnField); Method returnSetter = returnHistoryClass.getMethod("setReturn", new Class[] { returnClass }); - Assert.assertNotNull(returnSetter); + assertNotNull(returnSetter); loader.close(); } From b99760d61c28331cd0ff68d60666dadc3d24eff9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 19:40:54 +0200 Subject: [PATCH 297/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.IncrementalSchemaReading.TestCase' Signed-off-by: Koen Aers --- .../IncrementalSchemaReading/TestCase.java | 58 ++++++++++++------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java index 936fb95e2b..52bd3a0420 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbm2x.IncrementalSchemaReading; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -25,11 +45,9 @@ import org.hibernate.tool.hbmlint.detector.TableSelectorStrategy; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -52,7 +70,7 @@ public Iterator> getColumns(String catalog, String schema, S } } - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); properties = Environment.getProperties(); @@ -60,7 +78,7 @@ public void setUp() { defaultCatalog = properties.getProperty(AvailableSettings.DEFAULT_CATALOG); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -79,15 +97,15 @@ public void testReadSchemaIncremental() { DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect()); reader.readDatabaseSchema( dc, null, null ); - Assert.assertEquals(mockedMetaDataDialect.gottenTables.size(),1); - Assert.assertEquals(mockedMetaDataDialect.gottenTables.get(0),"CHILD"); + assertEquals(mockedMetaDataDialect.gottenTables.size(),1); + assertEquals(mockedMetaDataDialect.gottenTables.get(0),"CHILD"); Iterator iterator = dc.iterateTables(); Table firstChild = iterator.next(); - Assert.assertEquals(firstChild.getName(), "CHILD"); - Assert.assertFalse(iterator.hasNext()); + assertEquals(firstChild.getName(), "CHILD"); + assertFalse(iterator.hasNext()); - Assert.assertFalse("should not record foreignkey to table it doesn't know about yet",firstChild.getForeignKeyIterator().hasNext()); + assertFalse(firstChild.getForeignKeyIterator().hasNext(), "should not record foreignkey to table it doesn't know about yet"); tss.clearSchemaSelections(); tss.addSchemaSelection( new SchemaSelection(null, null, "MASTER") ); @@ -95,17 +113,17 @@ public void testReadSchemaIncremental() { mockedMetaDataDialect.gottenTables.clear(); reader.readDatabaseSchema( dc, null, null ); - Assert.assertEquals(mockedMetaDataDialect.gottenTables.size(),1); - Assert.assertEquals(mockedMetaDataDialect.gottenTables.get(0),"MASTER"); + assertEquals(mockedMetaDataDialect.gottenTables.size(),1); + assertEquals(mockedMetaDataDialect.gottenTables.get(0),"MASTER"); iterator = dc.iterateTables(); - Assert.assertNotNull(iterator.next()); - Assert.assertNotNull(iterator.next()); - Assert.assertFalse(iterator.hasNext()); + assertNotNull(iterator.next()); + assertNotNull(iterator.next()); + assertFalse(iterator.hasNext()); Table table = dc.getTable( defaultSchema, defaultCatalog, "CHILD" ); - Assert.assertSame( firstChild, table ); + assertSame( firstChild, table ); JUnitUtil.assertIteratorContainsExactly( "should have recorded one foreignkey to child table", @@ -118,7 +136,7 @@ public void testReadSchemaIncremental() { Table finalMaster = dc.getTable( defaultSchema, defaultCatalog, "MASTER" ); - Assert.assertSame(firstChild, dc.getTable( defaultSchema, defaultCatalog, "CHILD" )); + assertSame(firstChild, dc.getTable( defaultSchema, defaultCatalog, "CHILD" )); JUnitUtil.assertIteratorContainsExactly( null, firstChild.getForeignKeyIterator(), From cecc5b67713268408c22662d0cf921c47a34178b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 19:55:12 +0200 Subject: [PATCH 298/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.JdbcHbm2JavaEjb3.TestCase' Signed-off-by: Koen Aers --- .../tool/hbm2x/JdbcHbm2JavaEjb3/TestCase.java | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/TestCase.java index 342a328420..bf832ab16a 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbm2x.JdbcHbm2JavaEjb3; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.util.ArrayList; import java.util.List; @@ -16,12 +34,10 @@ import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JavaUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -30,15 +46,12 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputDir = new File("output"); - private File outputDir = null; - - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); - outputDir = temporaryFolder.getRoot(); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(MetadataDescriptorFactory .createJdbcDescriptor(null, null, true)); @@ -49,7 +62,7 @@ public void setUp() { exporter.start(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -61,13 +74,13 @@ public void testFileExistence() { @Test public void testUniqueConstraints() { - Assert.assertEquals(null, FileUtil.findFirstString( "uniqueConstraints", new File(outputDir,"Master.java") )); - Assert.assertNotNull(FileUtil.findFirstString( "uniqueConstraints", new File(outputDir,"Uniquemaster.java") )); + assertEquals(null, FileUtil.findFirstString( "uniqueConstraints", new File(outputDir,"Master.java") )); + assertNotNull(FileUtil.findFirstString( "uniqueConstraints", new File(outputDir,"Uniquemaster.java") )); } @Test public void testCompile() { - File destination = new File(temporaryFolder.getRoot(), "destination"); + File destination = new File(outputDir, "destination"); destination.mkdir(); List jars = new ArrayList(); jars.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api From 6a880ba07156b1ebfe640f750b5b76654c241219 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 21:07:43 +0200 Subject: [PATCH 299/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbmlint.HbmLintTest.TestCase' Signed-off-by: Koen Aers --- .../tool/hbmlint/HbmLintTest/BrokenLazy.java | 19 ++++++++ .../hbmlint/HbmLintTest/BrokenNonLazy.java | 19 ++++++++ .../tool/hbmlint/HbmLintTest/TestCase.java | 45 +++++++++++++------ 3 files changed, 70 insertions(+), 13 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenLazy.java b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenLazy.java index 50f29a821d..f0a6f4dd07 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenLazy.java +++ b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenLazy.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbmlint.HbmLintTest; public class BrokenLazy { diff --git a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenNonLazy.java b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenNonLazy.java index 4dcf47dcdc..c918bc510e 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenNonLazy.java +++ b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/BrokenNonLazy.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbmlint.HbmLintTest; public class BrokenNonLazy { diff --git a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/TestCase.java index 508b38fe52..643d5f5cb1 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbmlint/HbmLintTest/TestCase.java @@ -1,5 +1,26 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbmlint.HbmLintTest; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.io.File; import org.hibernate.tool.api.metadata.MetadataDescriptor; @@ -10,11 +31,9 @@ import org.hibernate.tool.hbmlint.detector.InstrumentationDetector; import org.hibernate.tool.hbmlint.detector.ShadowedIdentifierDetector; import org.hibernate.tools.test.util.HibernateUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { @@ -24,19 +43,19 @@ public class TestCase { "BrokenLazy.hbm.xml" }; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); private File outputDir = null; private File resourcesDir = null; private MetadataDescriptor metadataDescriptor = null; - @Before + @BeforeEach public void setUp() { - outputDir = new File(temporaryFolder.getRoot(), "output"); + outputDir = new File(temporaryFolder, "output"); outputDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(temporaryFolder, "resources"); resourcesDir.mkdir(); metadataDescriptor = HibernateUtil.initializeMetadataDescriptor(this, HBM_XML_FILES, resourcesDir); } @@ -53,21 +72,21 @@ public void testExporter() { public void testValidateCache() { HbmLint analyzer = new HbmLint(new Detector[] { new BadCachingDetector() }); analyzer.analyze(metadataDescriptor.createMetadata()); - Assert.assertEquals(1,analyzer.getResults().size()); + assertEquals(1,analyzer.getResults().size()); } @Test public void testValidateIdentifier() { HbmLint analyzer = new HbmLint(new Detector[] { new ShadowedIdentifierDetector() }); analyzer.analyze(metadataDescriptor.createMetadata()); - Assert.assertEquals(1,analyzer.getResults().size()); + assertEquals(1,analyzer.getResults().size()); } @Test public void testBytecodeRestrictions() { HbmLint analyzer = new HbmLint(new Detector[] { new InstrumentationDetector() }); analyzer.analyze(metadataDescriptor.createMetadata()); - Assert.assertEquals(analyzer.getResults().toString(), 2,analyzer.getResults().size()); + assertEquals(2,analyzer.getResults().size(), analyzer.getResults().toString()); } } From d4d4e71f331ffe56257c47dcca56291b4f382742 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 21:22:12 +0200 Subject: [PATCH 300/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbmlint.SchemaAnalyzer.TestCase' Signed-off-by: Koen Aers --- .../tool/hbmlint/SchemaAnalyzer/TestCase.java | 55 ++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbmlint/SchemaAnalyzer/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbmlint/SchemaAnalyzer/TestCase.java index 80eeed373c..531d33adb3 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbmlint/SchemaAnalyzer/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbmlint/SchemaAnalyzer/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.hbmlint.SchemaAnalyzer; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -15,27 +34,25 @@ import org.hibernate.tool.hbmlint.IssueCollector; import org.hibernate.tool.hbmlint.detector.SchemaByMetaDataDetector; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author koen */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -59,27 +76,27 @@ public void testSchemaAnalyzer() { if(table.getName().equalsIgnoreCase( "MISSING_TABLE" )) { analyzer.visit(table, mc ); - Assert.assertEquals(mc.problems.size(),1); + assertEquals(mc.problems.size(),1); Issue ap = (Issue) mc.problems.get( 0 ); - Assert.assertTrue(ap.getDescription().indexOf( "Missing table" ) >=0); + assertTrue(ap.getDescription().indexOf( "Missing table" ) >=0); } else if(table.getName().equalsIgnoreCase( "CATEGORY" )) { analyzer.visit(table, mc ); - Assert.assertEquals(mc.problems.size(),1); + assertEquals(mc.problems.size(),1); Issue ap = (Issue) mc.problems.get( 0 ); - Assert.assertTrue(ap.getDescription().indexOf( "missing column: name" ) >=0); + assertTrue(ap.getDescription().indexOf( "missing column: name" ) >=0); } else if(table.getName().equalsIgnoreCase( "BAD_TYPE" )) { analyzer.visit(table, mc ); - Assert.assertEquals(mc.problems.size(),1); + assertEquals(mc.problems.size(),1); Issue ap = (Issue) mc.problems.get( 0 ); - Assert.assertTrue(ap.getDescription().indexOf( "wrong column type for name" ) >=0); + assertTrue(ap.getDescription().indexOf( "wrong column type for name" ) >=0); } } MockCollector mc = new MockCollector(); analyzer.visitGenerators(mc); - Assert.assertEquals(1,mc.problems.size()); + assertEquals(1,mc.problems.size()); Issue issue = (Issue) mc.problems.get( 0 ); - Assert.assertTrue(issue.getDescription().indexOf( "does_not_exist" ) >=0); + assertTrue(issue.getDescription().indexOf( "does_not_exist" ) >=0); } From f9e02992a49eef305e2410a114821940e4a8e167 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 21:42:55 +0200 Subject: [PATCH 301/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.AutoQuote.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/AutoQuote/TestCase.java | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/AutoQuote/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/AutoQuote/TestCase.java index 71276d8cd4..c97395f6e1 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/AutoQuote/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/AutoQuote/TestCase.java @@ -1,9 +1,28 @@ /* - * Created on 2004-11-24 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.AutoQuote; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.hibernate.boot.Metadata; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.Property; @@ -11,10 +30,9 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -24,7 +42,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -32,7 +50,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -40,13 +58,13 @@ public void tearDown() { @Test public void testForQuotes() { Table table = HibernateUtil.getTable(metadata, "us-ers"); - Assert.assertNotNull(table); - Assert.assertTrue(table.isQuoted()); - Assert.assertEquals(2, table.getColumnSpan()); + assertNotNull(table); + assertTrue(table.isQuoted()); + assertEquals(2, table.getColumnSpan()); PersistentClass classMapping = metadata.getEntityBinding("Worklogs"); - Assert.assertNotNull(classMapping); + assertNotNull(classMapping); Property property = classMapping.getProperty("usErs"); - Assert.assertNotNull(property); + assertNotNull(property); } } From 8be7ca6de5dbfec233e9d4a1401cd87f29d0f10d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 22:14:21 +0200 Subject: [PATCH 302/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Basic.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Basic/TestCase.java | 55 +++++++++++++------ 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Basic/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Basic/TestCase.java index fc6a338ef0..7474541885 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Basic/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Basic/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Basic; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -14,10 +34,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -27,7 +46,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -35,7 +54,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -49,20 +68,20 @@ public void testBasic() throws SQLException { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "BASIC")); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "BASIC"), JdbcUtil.toIdentifier(this, table.getName())); - Assert.assertEquals(2, table.getColumnSpan()); + assertEquals(2, table.getColumnSpan()); Column basicColumn = table.getColumn(0); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "A"), JdbcUtil.toIdentifier(this, basicColumn.getName())); PrimaryKey key = table.getPrimaryKey(); - Assert.assertNotNull("There should be a primary key!", key); - Assert.assertEquals(key.getColumnSpan(), 1); + assertNotNull(key, "There should be a primary key!"); + assertEquals(key.getColumnSpan(), 1); Column column = key.getColumn(0); - Assert.assertTrue(column.isUnique()); - Assert.assertSame(basicColumn, column); + assertTrue(column.isUnique()); + assertSame(basicColumn, column); } @Test @@ -71,9 +90,9 @@ public void testScalePrecisionLength() { metadata, JdbcUtil.toIdentifier(this, "BASIC")); Column nameCol = table.getColumn(new Column(JdbcUtil.toIdentifier(this, "NAME"))); - Assert.assertEquals(nameCol.getLength(), 20); - Assert.assertEquals(nameCol.getPrecision(), Column.DEFAULT_PRECISION); - Assert.assertEquals(nameCol.getScale(), Column.DEFAULT_SCALE); + assertEquals(nameCol.getLength(), 20); + assertEquals(nameCol.getPrecision(), Column.DEFAULT_PRECISION); + assertEquals(nameCol.getScale(), Column.DEFAULT_SCALE); } @Test @@ -82,7 +101,7 @@ public void testCompositeKeys() { metadata, JdbcUtil.toIdentifier(this, "MULTIKEYED")); PrimaryKey primaryKey = table.getPrimaryKey(); - Assert.assertEquals(2, primaryKey.getColumnSpan()); + assertEquals(2, primaryKey.getColumnSpan()); } } From f34f8b251dce69806d559785dad086d4603375ae Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 22:29:38 +0200 Subject: [PATCH 303/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.BasicMultiSchema.TestCase' Signed-off-by: Koen Aers --- .../jdbc2cfg/BasicMultiSchema/TestCase.java | 101 +++++++----------- 1 file changed, 37 insertions(+), 64 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/TestCase.java index 9741c425fa..9d2a56d14b 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.BasicMultiSchema; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -14,10 +34,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -27,7 +46,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -35,7 +54,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -52,29 +71,24 @@ public void testBasic() throws SQLException { metadata, JdbcUtil.toIdentifier(this, "BASIC" ) ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "BASIC"), JdbcUtil.toIdentifier(this, table.getName()) ); - Assert.assertEquals( 2, table.getColumnSpan() ); + assertEquals( 2, table.getColumnSpan() ); Column basicColumn = table.getColumn( 0 ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "A"), JdbcUtil.toIdentifier(this, basicColumn.getName() )); - - // TODO: we cannot call getSqlType(dialect,cfg) without a - // MappingassertEquals("INTEGER", basicColumn.getSqlType() ); // at - // least on hsqldb - // assertEquals(22, basicColumn.getLength() ); // at least on oracle PrimaryKey key = table.getPrimaryKey(); - Assert.assertNotNull( "There should be a primary key!", key ); - Assert.assertEquals( key.getColumnSpan(), 1 ); + assertNotNull(key, "There should be a primary key!" ); + assertEquals( key.getColumnSpan(), 1 ); Column column = key.getColumn( 0 ); - Assert.assertTrue( column.isUnique() ); + assertTrue( column.isUnique() ); - Assert.assertSame( basicColumn, column ); + assertSame( basicColumn, column ); } @@ -84,59 +98,18 @@ public void testScalePrecisionLength() { metadata, JdbcUtil.toIdentifier(this, "BASIC" ) ); Column nameCol = table.getColumn( new Column( JdbcUtil.toIdentifier(this, "NAME" ) ) ); - Assert.assertEquals( nameCol.getLength(), 20 ); - Assert.assertEquals( nameCol.getPrecision(), Column.DEFAULT_PRECISION ); - Assert.assertEquals( nameCol.getScale(), Column.DEFAULT_SCALE ); + assertEquals( nameCol.getLength(), 20 ); + assertEquals( nameCol.getPrecision(), Column.DEFAULT_PRECISION ); + assertEquals( nameCol.getScale(), Column.DEFAULT_SCALE ); } - -/* public void testAutoDetectSingleSchema() { - - //read single schema without default schema: result = no schema info in tables. - JDBCMetaDataConfiguration mycfg = new JDBCMetaDataConfiguration(); - mycfg.setReverseEngineeringStrategy(new DelegatingReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()) { - public boolean excludeTable(TableIdentifier ti) { - return !"PUBLIC".equals(ti.getSchema()); - } - }); - mycfg.getProperties().remove(org.hibernate.cfg.Environment.DEFAULT_SCHEMA); - mycfg.readFromJDBC(); - - Table table = getTable(mycfg, identifier("otherschema")); - assertNull("rev.eng.strategy should have excluded this table",table); - - table = getTable(mycfg, identifier("basic")); - assertNotNull(table); - assertNull(table.getSchema()); - - - //read single schema with default schema: result = no schema info in tables. - - //read other single schema than default schema: result = schema info in tables. - - }*/ - - /* - * public void testGetTables() { - * - * Table table = new Table(); table.setName("dummy"); cfg.addTable(table); - * - * Table foundTable = cfg.getTable(null,null,"dummy"); - * - * assertSame(table,foundTable); - * - * foundTable = cfg.getTable(null,"dschema", "dummy"); - * - * assertNotSame(table, foundTable); } - */ - @Test public void testCompositeKeys() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "MULTIKEYED")); PrimaryKey primaryKey = table.getPrimaryKey(); - Assert.assertEquals( 2, primaryKey.getColumnSpan() ); + assertEquals( 2, primaryKey.getColumnSpan() ); } } From 6081d88be31e66c050a0fd877243e0b3a2a7d4f9 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 22:56:03 +0200 Subject: [PATCH 304/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.CompositeId.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/CompositeId/TestCase.java | 122 ++++++++++-------- 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java index ae6a91a905..bd655b3f39 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 13-Jan-2005 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.CompositeId; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.net.URL; import java.net.URLClassLoader; @@ -31,12 +52,10 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -47,10 +66,10 @@ public class TestCase { private MetadataDescriptor metadataDescriptor = null; private ReverseEngineeringStrategy reverseEngineeringStrategy = null; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy(); @@ -58,7 +77,7 @@ public void setUp() { .createJdbcDescriptor(reverseEngineeringStrategy, null, true); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this);; } @@ -69,39 +88,39 @@ public void testMultiColumnForeignKeys() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "LINE_ITEM") ); - Assert.assertNotNull(table); + assertNotNull(table); ForeignKey foreignKey = HibernateUtil.getForeignKey( table, JdbcUtil.toIdentifier(this, "TO_CUSTOMER_ORDER") ); - Assert.assertNotNull(foreignKey); - Assert.assertEquals( + assertNotNull(foreignKey); + assertEquals( reverseEngineeringStrategy.tableToClassName( new TableIdentifier( null, null, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER"))), foreignKey.getReferencedEntityName() ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "LINE_ITEM"), foreignKey.getTable().getName() ); - Assert.assertEquals(2,foreignKey.getColumnSpan() ); - Assert.assertEquals(foreignKey.getColumn(0).getName(), "CUSTOMER_ID_REF"); - Assert.assertEquals(foreignKey.getColumn(1).getName(), "ORDER_NUMBER"); + assertEquals(2,foreignKey.getColumnSpan() ); + assertEquals(foreignKey.getColumn(0).getName(), "CUSTOMER_ID_REF"); + assertEquals(foreignKey.getColumn(1).getName(), "ORDER_NUMBER"); Table tab = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER")); - Assert.assertEquals(tab.getPrimaryKey().getColumn(0).getName(), "CUSTOMER_ID"); - Assert.assertEquals(tab.getPrimaryKey().getColumn(1).getName(), "ORDER_NUMBER"); + assertEquals(tab.getPrimaryKey().getColumn(0).getName(), "CUSTOMER_ID"); + assertEquals(tab.getPrimaryKey().getColumn(1).getName(), "ORDER_NUMBER"); PersistentClass lineMapping = metadata.getEntityBinding( reverseEngineeringStrategy.tableToClassName( new TableIdentifier( null, null, JdbcUtil.toIdentifier(this, "LINE_ITEM")))); - Assert.assertEquals(4,lineMapping.getIdentifier().getColumnSpan() ); + assertEquals(4,lineMapping.getIdentifier().getColumnSpan() ); Iterator columnIterator = lineMapping.getIdentifier().getColumnIterator(); - Assert.assertEquals(((Column)(columnIterator.next())).getName(), "CUSTOMER_ID_REF"); - Assert.assertEquals(((Column)(columnIterator.next())).getName(), "ORDER_NUMBER"); + assertEquals(((Column)(columnIterator.next())).getName(), "CUSTOMER_ID_REF"); + assertEquals(((Column)(columnIterator.next())).getName(), "ORDER_NUMBER"); } @Test @@ -113,24 +132,24 @@ public void testPossibleKeyManyToOne() { null, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER")))); Property identifierProperty = product.getIdentifierProperty(); - Assert.assertTrue(identifierProperty.getValue() instanceof Component); + assertTrue(identifierProperty.getValue() instanceof Component); Component cmpid = (Component) identifierProperty.getValue(); - Assert.assertEquals(2, cmpid.getPropertySpan() ); + assertEquals(2, cmpid.getPropertySpan() ); Iterator iter = cmpid.getPropertyIterator(); Property id = (Property) iter.next(); Property extraId = (Property) iter.next(); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "CUSTOMER_ID"), id.getName() ); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "ORDER_NUMBER"), extraId.getName() ); - Assert.assertFalse(id.getValue() instanceof ManyToOne); - Assert.assertFalse(extraId.getValue() instanceof ManyToOne); + assertFalse(id.getValue() instanceof ManyToOne); + assertFalse(extraId.getValue() instanceof ManyToOne); } @Test @@ -142,49 +161,48 @@ public void testKeyProperty() { null, JdbcUtil.toIdentifier(this, "PRODUCT")))); Property identifierProperty = product.getIdentifierProperty(); - Assert.assertTrue(identifierProperty.getValue() instanceof Component); + assertTrue(identifierProperty.getValue() instanceof Component); Component cmpid = (Component) identifierProperty.getValue(); - Assert.assertEquals(2, cmpid.getPropertySpan() ); + assertEquals(2, cmpid.getPropertySpan() ); Iterator iter = cmpid.getPropertyIterator(); Property id = (Property) iter.next(); Property extraId = (Property) iter.next(); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "PRODUCT_ID"), id.getName() ); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "EXTRA_ID"), extraId.getName() ); - Assert.assertFalse(id.getValue() instanceof ManyToOne); - Assert.assertFalse(extraId.getValue() instanceof ManyToOne); + assertFalse(id.getValue() instanceof ManyToOne); + assertFalse(extraId.getValue() instanceof ManyToOne); } @Test public void testGeneration() throws Exception { - final File testFolder = temporaryFolder.getRoot(); Exporter exporter = new HibernateMappingExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(testFolder); + exporter.setOutputDirectory(temporaryFolder); Exporter javaExp = new POJOExporter(); javaExp.setMetadataDescriptor(metadataDescriptor); - javaExp.setOutputDirectory(testFolder); + javaExp.setOutputDirectory(temporaryFolder); exporter.start(); javaExp.start(); - JavaUtil.compile(testFolder); - URL[] urls = new URL[] { testFolder.toURI().toURL() }; + JavaUtil.compile(temporaryFolder); + URL[] urls = new URL[] { temporaryFolder.toURI().toURL() }; URLClassLoader ucl = new URLClassLoader( urls, Thread.currentThread().getContextClassLoader()); File[] files = new File[6]; - files[0] = new File(testFolder, "Simplecustomerorder.hbm.xml"); - files[1] = new File(testFolder, "Simplelineitem.hbm.xml"); - files[2] = new File(testFolder, "Product.hbm.xml"); - files[3] = new File(testFolder, "Customer.hbm.xml"); - files[4] = new File(testFolder, "Lineitem.hbm.xml"); - files[5] = new File(testFolder, "Customerorder.hbm.xml"); + files[0] = new File(temporaryFolder, "Simplecustomerorder.hbm.xml"); + files[1] = new File(temporaryFolder, "Simplelineitem.hbm.xml"); + files[2] = new File(temporaryFolder, "Product.hbm.xml"); + files[3] = new File(temporaryFolder, "Customer.hbm.xml"); + files[4] = new File(temporaryFolder, "Lineitem.hbm.xml"); + files[5] = new File(temporaryFolder, "Customerorder.hbm.xml"); Thread.currentThread().setContextClassLoader(ucl); SessionFactory factory = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) @@ -194,22 +212,22 @@ public void testGeneration() throws Exception { JdbcUtil.populateDatabase(this); session.createQuery("from LineItem").getResultList(); List list = session.createQuery("from Product").getResultList(); - Assert.assertEquals(2,list.size() ); + assertEquals(2,list.size() ); list = session .createQuery("select li.customerOrder.id from LineItem as li") .getResultList(); - Assert.assertTrue(list.size()>0); + assertTrue(list.size()>0); Class productIdClass = ucl.loadClass("ProductId"); Object object = productIdClass.newInstance(); int hash = -1; try { hash = object.hashCode(); } catch(Throwable t) { - Assert.fail("Hashcode on new instance should not fail " + t); + fail("Hashcode on new instance should not fail " + t); } - Assert.assertFalse( - "hashcode should be different from system", - hash==System.identityHashCode(object)); + assertFalse( + hash==System.identityHashCode(object), + "hashcode should be different from system"); factory.close(); Thread.currentThread().setContextClassLoader(ucl.getParent() ); } From 1a5d3d09f284c125f29bdf36cafdb154b056662d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 23:15:18 +0200 Subject: [PATCH 305/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.ForeignKeys.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/ForeignKeys/TestCase.java | 56 +++++++++++++------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ForeignKeys/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ForeignKeys/TestCase.java index 44ca79208c..b5fce40ab1 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ForeignKeys/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ForeignKeys/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-11-24 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.ForeignKeys; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + import java.util.EnumSet; import java.util.Iterator; @@ -20,10 +41,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -34,7 +54,7 @@ public class TestCase { private Metadata metadata = null; private ReverseEngineeringStrategy reverseEngineeringStrategy = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy(); @@ -43,7 +63,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this);; } @@ -56,28 +76,28 @@ public void testMultiRefs() { ForeignKey foreignKey = HibernateUtil.getForeignKey( table, JdbcUtil.toIdentifier(this, "CON2MASTER") ); - Assert.assertNotNull(foreignKey); - Assert.assertEquals( + assertNotNull(foreignKey); + assertEquals( reverseEngineeringStrategy.tableToClassName( new TableIdentifier(null, null, "MASTER")), foreignKey.getReferencedEntityName() ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "CONNECTION"), foreignKey.getTable().getName() ); - Assert.assertEquals( + assertEquals( HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "MASTER") ), foreignKey.getReferencedTable() ); - Assert.assertNotNull( + assertNotNull( HibernateUtil.getForeignKey( table, JdbcUtil.toIdentifier(this, "CHILDREF1") ) ); - Assert.assertNotNull( + assertNotNull( HibernateUtil.getForeignKey( table, JdbcUtil.toIdentifier(this, "CHILDREF2") ) ); - Assert.assertNull( + assertNull( HibernateUtil.getForeignKey( table, JdbcUtil.toIdentifier(this, "DUMMY") ) ); @@ -86,7 +106,7 @@ public void testMultiRefs() { @Test public void testMasterChild() { - Assert.assertNotNull(HibernateUtil.getTable( + assertNotNull(HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "MASTER"))); Table child = HibernateUtil.getTable( @@ -94,9 +114,9 @@ public void testMasterChild() { JdbcUtil.toIdentifier(this, "CHILD") ); Iterator iterator = child.getForeignKeyIterator(); ForeignKey fk = (ForeignKey) iterator.next(); - Assert.assertFalse("should only be one fk", iterator.hasNext() ); - Assert.assertEquals(1, fk.getColumnSpan() ); - Assert.assertSame( + assertFalse(iterator.hasNext(), "should only be one fk" ); + assertEquals(1, fk.getColumnSpan() ); + assertSame( fk.getColumn(0), child.getColumn( new Column(JdbcUtil.toIdentifier(this, "MASTERREF")))); From 6a624549b1559cdf02cf4faf8be017a6a36420b7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 01:42:56 +0200 Subject: [PATCH 306/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Identity.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Identity/TestCase.java | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java index 864bff3e19..f628e9df3c 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Identity; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -11,10 +29,9 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -24,7 +41,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -32,7 +49,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -41,8 +58,8 @@ public void tearDown() { public void testIdentity() throws SQLException { PersistentClass classMapping = metadata.getEntityBinding("Autoinc"); - Assert.assertNotNull(classMapping); - Assert.assertEquals( + assertNotNull(classMapping); + assertEquals( "identity", ((SimpleValue)classMapping .getIdentifierProperty() @@ -50,7 +67,7 @@ public void testIdentity() throws SQLException { .getIdentifierGeneratorStrategy()); classMapping = metadata.getEntityBinding("Noautoinc"); - Assert.assertEquals( + assertEquals( "assigned", ((SimpleValue)classMapping .getIdentifierProperty() From 2ed379341af301351f6e6c40184bed8532803e25 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 11:06:27 +0200 Subject: [PATCH 307/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Index.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Index/TestCase.java | 65 ++++++++++++------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java index 93aa71f68e..b0cd021d46 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-11-24 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Index; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.Iterator; import org.hibernate.boot.Metadata; @@ -14,10 +35,9 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -27,7 +47,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -35,7 +55,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -47,11 +67,11 @@ public void testUniqueKey() { JdbcUtil.toIdentifier(this, "WITH_INDEX") ); UniqueKey uniqueKey = table.getUniqueKey( JdbcUtil.toIdentifier(this, "OTHER_IDX") ); - Assert.assertNotNull(uniqueKey); - Assert.assertEquals(1, uniqueKey.getColumnSpan() ); + assertNotNull(uniqueKey); + assertEquals(1, uniqueKey.getColumnSpan() ); Column keyCol = uniqueKey.getColumn(0); - Assert.assertTrue(keyCol.isUnique() ); - Assert.assertSame(keyCol, table.getColumn(keyCol) ); + assertTrue(keyCol.isUnique() ); + assertSame(keyCol, table.getColumn(keyCol) ); } @Test @@ -59,38 +79,37 @@ public void testWithIndex() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "WITH_INDEX")); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "WITH_INDEX"), JdbcUtil.toIdentifier(this, table.getName())); - Assert.assertNull("there should be no pk", table.getPrimaryKey() ); + assertNull(table.getPrimaryKey(), "there should be no pk" ); Iterator iterator = table.getIndexIterator(); int cnt=0; while(iterator.hasNext() ) { iterator.next(); cnt++; } - Assert.assertEquals(1, cnt); + assertEquals(1, cnt); Index index = table.getIndex(JdbcUtil.toIdentifier(this, "MY_INDEX") ); - Assert.assertNotNull("No index ?", index); - Assert.assertEquals( + assertNotNull(index, "No index ?"); + assertEquals( JdbcUtil.toIdentifier(this, "MY_INDEX"), JdbcUtil.toIdentifier(this, index.getName())); - Assert.assertEquals(2, index.getColumnSpan() ); - Assert.assertSame(index.getTable(), table); + assertEquals(2, index.getColumnSpan() ); + assertSame(index.getTable(), table); Iterator cols = index.getColumnIterator(); Column col1 = cols.next(); Column col2 = cols.next(); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "FIRST"), JdbcUtil.toIdentifier(this, col1.getName())); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "THIRD"), JdbcUtil.toIdentifier(this, col2.getName())); Column example = new Column(); example.setName(col2.getName() ); - Assert.assertSame( - "column with same name should be same instance!", - table.getColumn(example), col2); + assertSame( + table.getColumn(example), col2, "column with same name should be same instance!"); } } From 631d6a2e114125a2d8814c9505571d29afe35f93 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 13:14:20 +0200 Subject: [PATCH 308/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.KeyPropertyCompositeId.TestCase' Signed-off-by: Koen Aers --- .../KeyPropertyCompositeId/TestCase.java | 120 +++++++++++------- 1 file changed, 71 insertions(+), 49 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java index 05850c51e4..a323b0b06d 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java @@ -1,5 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.jdbc2cfg.KeyPropertyCompositeId; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.net.URL; import java.net.URLClassLoader; @@ -27,12 +52,10 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -40,13 +63,13 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); private MetadataDescriptor metadataDescriptor = null; private ReverseEngineeringStrategy reverseEngineeringStrategy = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy(); @@ -54,7 +77,7 @@ public void setUp() { .createJdbcDescriptor(reverseEngineeringStrategy, null, false); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this);; } @@ -65,29 +88,29 @@ public void testMultiColumnForeignKeys() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "LINE_ITEM")); - Assert.assertNotNull(table); + assertNotNull(table); ForeignKey foreignKey = HibernateUtil.getForeignKey(table, JdbcUtil.toIdentifier(this, "TO_CUSTOMER_ORDER")); - Assert.assertNotNull(foreignKey); - Assert.assertEquals( + assertNotNull(foreignKey); + assertEquals( reverseEngineeringStrategy.tableToClassName( new TableIdentifier(null, null, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER"))), foreignKey.getReferencedEntityName()); - Assert.assertEquals(JdbcUtil.toIdentifier(this, "LINE_ITEM"), foreignKey.getTable().getName()); - Assert.assertEquals(2, foreignKey.getColumnSpan()); - Assert.assertEquals(foreignKey.getColumn(0).getName(), "CUSTOMER_ID_REF"); - Assert.assertEquals(foreignKey.getColumn(1).getName(), "ORDER_NUMBER"); + assertEquals(JdbcUtil.toIdentifier(this, "LINE_ITEM"), foreignKey.getTable().getName()); + assertEquals(2, foreignKey.getColumnSpan()); + assertEquals(foreignKey.getColumn(0).getName(), "CUSTOMER_ID_REF"); + assertEquals(foreignKey.getColumn(1).getName(), "ORDER_NUMBER"); Table tab = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER")); - Assert.assertEquals(tab.getPrimaryKey().getColumn(0).getName(), "CUSTOMER_ID"); - Assert.assertEquals(tab.getPrimaryKey().getColumn(1).getName(), "ORDER_NUMBER"); + assertEquals(tab.getPrimaryKey().getColumn(0).getName(), "CUSTOMER_ID"); + assertEquals(tab.getPrimaryKey().getColumn(1).getName(), "ORDER_NUMBER"); PersistentClass lineMapping = metadata.getEntityBinding( reverseEngineeringStrategy .tableToClassName(new TableIdentifier(null, null, JdbcUtil.toIdentifier(this, "LINE_ITEM")))); - Assert.assertEquals(4, lineMapping.getIdentifier().getColumnSpan()); + assertEquals(4, lineMapping.getIdentifier().getColumnSpan()); Iterator columnIterator = lineMapping.getIdentifier().getColumnIterator(); - Assert.assertEquals(((Column) (columnIterator.next())).getName(), "CUSTOMER_ID_REF"); - Assert.assertEquals(((Column) (columnIterator.next())).getName(), "ORDER_NUMBER"); + assertEquals(((Column) (columnIterator.next())).getName(), "CUSTOMER_ID_REF"); + assertEquals(((Column) (columnIterator.next())).getName(), "ORDER_NUMBER"); } @Test @@ -96,24 +119,24 @@ public void testPossibleKeyManyToOne() { reverseEngineeringStrategy .tableToClassName(new TableIdentifier(null, null, JdbcUtil.toIdentifier(this, "CUSTOMER_ORDER")))); Property identifierProperty = product.getIdentifierProperty(); - Assert.assertTrue(identifierProperty.getValue() instanceof Component); + assertTrue(identifierProperty.getValue() instanceof Component); Component cmpid = (Component) identifierProperty.getValue(); - Assert.assertEquals(2, cmpid.getPropertySpan()); + assertEquals(2, cmpid.getPropertySpan()); Iterator iter = cmpid.getPropertyIterator(); Property id = (Property) iter.next(); Property extraId = (Property) iter.next(); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "customer"), id.getName()); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "orderNumber"), extraId.getName()); - Assert.assertTrue(id.getValue() instanceof ManyToOne); - Assert.assertFalse(extraId.getValue() instanceof ManyToOne); + assertTrue(id.getValue() instanceof ManyToOne); + assertFalse(extraId.getValue() instanceof ManyToOne); } @Test @@ -122,47 +145,46 @@ public void testKeyProperty() { reverseEngineeringStrategy .tableToClassName(new TableIdentifier(null, null, JdbcUtil.toIdentifier(this, "PRODUCT")))); Property identifierProperty = product.getIdentifierProperty(); - Assert.assertTrue(identifierProperty.getValue() instanceof Component); + assertTrue(identifierProperty.getValue() instanceof Component); Component cmpid = (Component) identifierProperty.getValue(); - Assert.assertEquals(2, cmpid.getPropertySpan()); + assertEquals(2, cmpid.getPropertySpan()); Iterator iter = cmpid.getPropertyIterator(); Property id = (Property) iter.next(); Property extraId = (Property) iter.next(); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "productId"), id.getName()); - Assert.assertEquals( + assertEquals( reverseEngineeringStrategy.columnToPropertyName( null, "extraId"), extraId.getName()); - Assert.assertFalse(id.getValue() instanceof ManyToOne); - Assert.assertFalse(extraId.getValue() instanceof ManyToOne); + assertFalse(id.getValue() instanceof ManyToOne); + assertFalse(extraId.getValue() instanceof ManyToOne); } @Test public void testGeneration() throws Exception { - final File testFolder = temporaryFolder.getRoot(); Exporter exporter = new HibernateMappingExporter(); exporter.setMetadataDescriptor(metadataDescriptor); - exporter.setOutputDirectory(testFolder); + exporter.setOutputDirectory(temporaryFolder); Exporter javaExp = new POJOExporter(); javaExp.setMetadataDescriptor(metadataDescriptor); - javaExp.setOutputDirectory(testFolder); + javaExp.setOutputDirectory(temporaryFolder); exporter.start(); javaExp.start(); - JavaUtil.compile(testFolder); - URL[] urls = new URL[] { testFolder.toURI().toURL() }; + JavaUtil.compile(temporaryFolder); + URL[] urls = new URL[] { temporaryFolder.toURI().toURL() }; URLClassLoader ucl = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()); File[] files = new File[6]; - files[0] = new File(testFolder, "Simplecustomerorder.hbm.xml"); - files[1] = new File(testFolder, "Simplelineitem.hbm.xml"); - files[2] = new File(testFolder, "Product.hbm.xml"); - files[3] = new File(testFolder, "Customer.hbm.xml"); - files[4] = new File(testFolder, "Lineitem.hbm.xml"); - files[5] = new File(testFolder, "Customerorder.hbm.xml"); + files[0] = new File(temporaryFolder, "Simplecustomerorder.hbm.xml"); + files[1] = new File(temporaryFolder, "Simplelineitem.hbm.xml"); + files[2] = new File(temporaryFolder, "Product.hbm.xml"); + files[3] = new File(temporaryFolder, "Customer.hbm.xml"); + files[4] = new File(temporaryFolder, "Lineitem.hbm.xml"); + files[5] = new File(temporaryFolder, "Customerorder.hbm.xml"); Thread.currentThread().setContextClassLoader(ucl); SessionFactory factory = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) @@ -172,20 +194,20 @@ public void testGeneration() throws Exception { JdbcUtil.populateDatabase(this);; session.createQuery("from LineItem").getResultList(); List list = session.createQuery("from Product").getResultList(); - Assert.assertEquals(2, list.size()); + assertEquals(2, list.size()); list = session .createQuery("select li.id.customerOrder.id from LineItem as li") .getResultList(); - Assert.assertTrue(list.size() > 0); + assertTrue(list.size() > 0); Class productIdClass = ucl.loadClass("ProductId"); Object object = productIdClass.newInstance(); int hash = -1; try { hash = object.hashCode(); } catch (Throwable t) { - Assert.fail("Hashcode on new instance should not fail " + t); + fail("Hashcode on new instance should not fail " + t); } - Assert.assertFalse("hashcode should be different from system", hash == System.identityHashCode(object)); + assertFalse(hash == System.identityHashCode(object), "hashcode should be different from system"); factory.close(); Thread.currentThread().setContextClassLoader(ucl.getParent()); } From 7835a7f65956d86708c47eeee72a9541c563f839 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 13:49:37 +0200 Subject: [PATCH 309/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.ManyToMany.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/ManyToMany/TestCase.java | 120 ++++++++++-------- 1 file changed, 69 insertions(+), 51 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ManyToMany/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ManyToMany/TestCase.java index 5273c3e657..c423f3a02b 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ManyToMany/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/ManyToMany/TestCase.java @@ -1,9 +1,31 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.ManyToMany; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import org.hibernate.MappingException; @@ -16,12 +38,10 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tool.hbm2x.HibernateMappingExporter; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -29,15 +49,15 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -53,26 +73,26 @@ public void testNoManyToManyBiDirectional() { PersistentClass project = metadata.getEntityBinding("Project"); - Assert.assertNotNull(project.getProperty("worksOns")); + assertNotNull(project.getProperty("worksOns")); //assertNotNull(project.getProperty("employee")); - Assert.assertEquals(3, project.getPropertyClosureSpan()); - Assert.assertEquals("projectId", project.getIdentifierProperty().getName()); + assertEquals(3, project.getPropertyClosureSpan()); + assertEquals("projectId", project.getIdentifierProperty().getName()); PersistentClass employee = metadata.getEntityBinding("Employee"); - Assert.assertNotNull(employee.getProperty("worksOns")); - Assert.assertNotNull(employee.getProperty("employees")); - Assert.assertNotNull(employee.getProperty("employee")); + assertNotNull(employee.getProperty("worksOns")); + assertNotNull(employee.getProperty("employees")); + assertNotNull(employee.getProperty("employee")); //assertNotNull(employee.getProperty("projects")); - Assert.assertEquals(6, employee.getPropertyClosureSpan()); - Assert.assertEquals("id", employee.getIdentifierProperty().getName()); + assertEquals(6, employee.getPropertyClosureSpan()); + assertEquals("id", employee.getIdentifierProperty().getName()); PersistentClass worksOn = metadata.getEntityBinding("WorksOn"); - Assert.assertNotNull(worksOn.getProperty("project")); - Assert.assertNotNull(worksOn.getProperty("employee")); - Assert.assertEquals(2, worksOn.getPropertyClosureSpan()); - Assert.assertEquals("id", worksOn.getIdentifierProperty().getName()); + assertNotNull(worksOn.getProperty("project")); + assertNotNull(worksOn.getProperty("employee")); + assertEquals(2, worksOn.getPropertyClosureSpan()); + assertEquals("id", worksOn.getIdentifierProperty().getName()); } @Test @@ -81,22 +101,22 @@ public void testAutoCreation() { .createJdbcDescriptor(null, null, true) .createMetadata(); - Assert.assertNull("No middle class should be generated.", metadata.getEntityBinding( "WorksOn" )); + assertNull(metadata.getEntityBinding( "WorksOn" ), "No middle class should be generated."); - Assert.assertNotNull("Should create worksontext since one of the foreign keys is not part of pk", metadata.getEntityBinding( "WorksOnContext" )); + assertNotNull(metadata.getEntityBinding( "WorksOnContext" ), "Should create worksontext since one of the foreign keys is not part of pk"); PersistentClass projectClass = metadata.getEntityBinding("Project"); - Assert.assertNotNull( projectClass ); + assertNotNull( projectClass ); PersistentClass employeeClass = metadata.getEntityBinding("Employee"); - Assert.assertNotNull( employeeClass ); + assertNotNull( employeeClass ); assertPropertyNotExist( projectClass, "worksOns" ); assertPropertyNotExist( employeeClass, "worksOns" ); Property property = employeeClass.getProperty( "projects" ); - Assert.assertNotNull( property); - Assert.assertNotNull( projectClass.getProperty( "employees" )); + assertNotNull( property); + assertNotNull( projectClass.getProperty( "employees" )); } @@ -105,7 +125,7 @@ public void testFalsePositive() { Metadata metadata = MetadataDescriptorFactory .createJdbcDescriptor(null, null, true) .createMetadata(); - Assert.assertNotNull("Middle class should be generated.", metadata.getEntityBinding( "NonMiddle" )); + assertNotNull(metadata.getEntityBinding( "NonMiddle" ), "Middle class should be generated."); } @Test @@ -113,7 +133,7 @@ public void testBuildMappings() { Metadata metadata = MetadataDescriptorFactory .createJdbcDescriptor(null, null, true) .createMetadata(); - Assert.assertNotNull(metadata); + assertNotNull(metadata); } @Test @@ -121,33 +141,31 @@ public void testGenerateAndReadable() { MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory .createJdbcDescriptor(null, null, true); - File outputDir = temporaryFolder.getRoot(); - - Assert.assertNotNull(metadataDescriptor.createMetadata()); + assertNotNull(metadataDescriptor.createMetadata()); HibernateMappingExporter hme = new HibernateMappingExporter(); hme.setMetadataDescriptor(metadataDescriptor); - hme.setOutputDirectory(outputDir); + hme.setOutputDirectory(temporaryFolder); hme.start(); - assertFileAndExists( new File(outputDir, "Employee.hbm.xml") ); - assertFileAndExists( new File(outputDir, "Project.hbm.xml") ); - assertFileAndExists( new File(outputDir, "WorksOnContext.hbm.xml") ); + assertFileAndExists( new File(temporaryFolder, "Employee.hbm.xml") ); + assertFileAndExists( new File(temporaryFolder, "Project.hbm.xml") ); + assertFileAndExists( new File(temporaryFolder, "WorksOnContext.hbm.xml") ); - assertFileAndExists( new File(outputDir, "RightTable.hbm.xml") ); - assertFileAndExists( new File(outputDir, "LeftTable.hbm.xml") ); - assertFileAndExists( new File(outputDir, "NonMiddle.hbm.xml") ); //Must be there since it has a fkey that is not part of the pk + assertFileAndExists( new File(temporaryFolder, "RightTable.hbm.xml") ); + assertFileAndExists( new File(temporaryFolder, "LeftTable.hbm.xml") ); + assertFileAndExists( new File(temporaryFolder, "NonMiddle.hbm.xml") ); //Must be there since it has a fkey that is not part of the pk - Assert.assertFalse(new File(outputDir, "WorksOn.hbm.xml").exists() ); + assertFalse(new File(temporaryFolder, "WorksOn.hbm.xml").exists() ); - Assert.assertEquals(6, outputDir.listFiles().length); + assertEquals(6, temporaryFolder.listFiles().length); File[] files = new File[3]; - files[0] = new File(outputDir, "Employee.hbm.xml"); - files[1] = new File(outputDir, "Project.hbm.xml"); - files[2] = new File(outputDir, "WorksOnContext.hbm.xml"); + files[0] = new File(temporaryFolder, "Employee.hbm.xml"); + files[1] = new File(temporaryFolder, "Project.hbm.xml"); + files[2] = new File(temporaryFolder, "WorksOnContext.hbm.xml"); - Assert.assertNotNull(MetadataDescriptorFactory + assertNotNull(MetadataDescriptorFactory .createNativeDescriptor(null, files, null) .createMetadata()); @@ -157,16 +175,16 @@ public void testGenerateAndReadable() { private void assertPropertyNotExist(PersistentClass projectClass, String prop) { try { projectClass.getProperty(prop); - Assert.fail("property " + prop + " should not exist on " + projectClass); + fail("property " + prop + " should not exist on " + projectClass); } catch(MappingException e) { // expected } } private void assertFileAndExists(File file) { - Assert.assertTrue(file + " does not exist", file.exists() ); - Assert.assertTrue(file + " not a file", file.isFile() ); - Assert.assertTrue(file + " does not have any contents", file.length()>0); + assertTrue(file.exists(), file + " does not exist" ); + assertTrue(file.isFile(), file + " not a file" ); + assertTrue(file.length()>0, file + " does not have any contents"); } } From ecac96cb3eb993a32cc7976090d7f8f81008c6b4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 14:24:05 +0200 Subject: [PATCH 310/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.MetaData.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/MetaData/TestCase.java | 73 ++++++++++--------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/MetaData/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/MetaData/TestCase.java index 877b83a96f..55f568e6db 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/MetaData/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/MetaData/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.MetaData; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.hibernate.boot.Metadata; import org.hibernate.mapping.Column; import org.hibernate.mapping.PrimaryKey; @@ -12,10 +32,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -25,7 +44,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -33,7 +52,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -47,24 +66,20 @@ public void testBasic() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "BASIC" ) ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "BASIC"), JdbcUtil.toIdentifier(this, table.getName())); - Assert.assertEquals( 2, table.getColumnSpan() ); + assertEquals( 2, table.getColumnSpan() ); Column basicColumn = table.getColumn( 0 ); - Assert.assertEquals( + assertEquals( JdbcUtil.toIdentifier(this, "A"), JdbcUtil.toIdentifier(this, basicColumn.getName())); - // TODO: we cannot call getSqlType(dialect,cfg) without a - // MappingassertEquals("INTEGER", basicColumn.getSqlType() ); // at - // least on hsqldb - // assertEquals(22, basicColumn.getLength() ); // at least on oracle PrimaryKey key = table.getPrimaryKey(); - Assert.assertNotNull( "There should be a primary key!", key ); - Assert.assertEquals( key.getColumnSpan(), 1 ); + assertNotNull(key, "There should be a primary key!" ); + assertEquals( key.getColumnSpan(), 1 ); Column column = key.getColumn( 0 ); - Assert.assertTrue( column.isUnique() ); - Assert.assertSame( basicColumn, column ); + assertTrue( column.isUnique() ); + assertSame( basicColumn, column ); } @Test @@ -73,32 +88,18 @@ public void testScalePrecisionLength() { metadata, JdbcUtil.toIdentifier(this, "BASIC")); Column nameCol = table.getColumn(new Column( JdbcUtil.toIdentifier(this, "NAME" ) ) ); - Assert.assertEquals( nameCol.getLength(), 20 ); - Assert.assertEquals( nameCol.getPrecision(), Column.DEFAULT_PRECISION ); - Assert.assertEquals( nameCol.getScale(), Column.DEFAULT_SCALE ); + assertEquals( nameCol.getLength(), 20 ); + assertEquals( nameCol.getPrecision(), Column.DEFAULT_PRECISION ); + assertEquals( nameCol.getScale(), Column.DEFAULT_SCALE ); } - /* - * public void testGetTables() { - * - * Table table = new Table(); table.setName("dummy"); cfg.addTable(table); - * - * Table foundTable = cfg.getTable(null,null,"dummy"); - * - * assertSame(table,foundTable); - * - * foundTable = cfg.getTable(null,"dschema", "dummy"); - * - * assertNotSame(table, foundTable); } - */ - @Test public void testCompositeKeys() { Table table = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "MULTIKEYED")); PrimaryKey primaryKey = table.getPrimaryKey(); - Assert.assertEquals( 2, primaryKey.getColumnSpan() ); + assertEquals( 2, primaryKey.getColumnSpan() ); } } From c15ccadd2a41efa03d2ee9376b8cd5eefe9a3a21 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 16:57:42 +0200 Subject: [PATCH 311/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.NoPrimaryKey.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/NoPrimaryKey/TestCase.java | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/TestCase.java index ae5eb821a7..f56f4a8453 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/TestCase.java @@ -1,17 +1,31 @@ /* - * Created on 2004-11-24 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.NoPrimaryKey; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -19,19 +33,19 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @Test public void testMe() { - Assert.assertNotNull( + assertNotNull( MetadataDescriptorFactory .createJdbcDescriptor(null, null, true) .createMetadata()); From b6374311699566a09b4e6f1cca22e980ba68de6a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 17:32:17 +0200 Subject: [PATCH 312/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.OneToOne.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/OneToOne/TestCase.java | 120 ++++++++++-------- 1 file changed, 68 insertions(+), 52 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OneToOne/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OneToOne/TestCase.java index 403153642f..4d5e621b16 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OneToOne/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OneToOne/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.OneToOne; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import java.net.MalformedURLException; import java.net.URL; @@ -31,12 +51,10 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JavaUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -44,20 +62,20 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputDir = new File("output"); private MetadataDescriptor metadataDescriptor = null; private Metadata metadata = null; - @Before + @BeforeEach public void setUp() throws Exception { JdbcUtil.createDatabase(this); metadataDescriptor = MetadataDescriptorFactory.createJdbcDescriptor(null, null, true); metadata = metadataDescriptor.createMetadata(); } - @After + @AfterEach public void tearDown() throws Exception { JdbcUtil.dropDatabase(this); } @@ -66,68 +84,67 @@ public void tearDown() throws Exception { public void testOneToOneSingleColumnBiDirectional() { PersistentClass person = metadata.getEntityBinding("Person"); Property addressProperty = person.getProperty("addressPerson"); - Assert.assertNotNull(addressProperty); - Assert.assertTrue(addressProperty.getValue() instanceof OneToOne); + assertNotNull(addressProperty); + assertTrue(addressProperty.getValue() instanceof OneToOne); OneToOne oto = (OneToOne) addressProperty.getValue(); - Assert.assertEquals(oto.getColumnSpan(),1); - Assert.assertEquals("Person", oto.getEntityName()); - Assert.assertEquals("AddressPerson", oto.getReferencedEntityName()); - Assert.assertEquals(2, person.getPropertyClosureSpan()); - Assert.assertEquals("personId", person.getIdentifierProperty().getName()); - Assert.assertFalse(oto.isConstrained()); + assertEquals(oto.getColumnSpan(),1); + assertEquals("Person", oto.getEntityName()); + assertEquals("AddressPerson", oto.getReferencedEntityName()); + assertEquals(2, person.getPropertyClosureSpan()); + assertEquals("personId", person.getIdentifierProperty().getName()); + assertFalse(oto.isConstrained()); PersistentClass addressPerson = metadata.getEntityBinding("AddressPerson"); Property personProperty = addressPerson.getProperty("person"); - Assert.assertNotNull(personProperty); - Assert.assertTrue(personProperty.getValue() instanceof OneToOne); + assertNotNull(personProperty); + assertTrue(personProperty.getValue() instanceof OneToOne); oto = (OneToOne) personProperty.getValue(); - Assert.assertTrue(oto.isConstrained()); - Assert.assertEquals(oto.getColumnSpan(),1); - Assert.assertEquals("AddressPerson", oto.getEntityName()); - Assert.assertEquals("Person", oto.getReferencedEntityName()); - Assert.assertEquals(2, addressPerson.getPropertyClosureSpan()); - Assert.assertEquals("addressId", addressPerson.getIdentifierProperty().getName()); + assertTrue(oto.isConstrained()); + assertEquals(oto.getColumnSpan(),1); + assertEquals("AddressPerson", oto.getEntityName()); + assertEquals("Person", oto.getReferencedEntityName()); + assertEquals(2, addressPerson.getPropertyClosureSpan()); + assertEquals("addressId", addressPerson.getIdentifierProperty().getName()); } @Test public void testAddressWithForeignKeyGeneration() { PersistentClass address = metadata.getEntityBinding("AddressPerson"); - Assert.assertEquals("foreign", ((SimpleValue)address.getIdentifier()).getIdentifierGeneratorStrategy()); + assertEquals("foreign", ((SimpleValue)address.getIdentifier()).getIdentifierGeneratorStrategy()); } @Test public void testOneToOneMultiColumnBiDirectional() { PersistentClass person = metadata.getEntityBinding("MultiPerson"); Property addressProperty = person.getProperty("addressMultiPerson"); - Assert.assertNotNull(addressProperty); - Assert.assertTrue(addressProperty.getValue() instanceof OneToOne); + assertNotNull(addressProperty); + assertTrue(addressProperty.getValue() instanceof OneToOne); OneToOne oto = (OneToOne) addressProperty.getValue(); - Assert.assertEquals(oto.getColumnSpan(),2); - Assert.assertEquals("MultiPerson", oto.getEntityName()); - Assert.assertEquals("AddressMultiPerson", oto.getReferencedEntityName()); - Assert.assertFalse(oto.isConstrained()); - Assert.assertEquals(2, person.getPropertyClosureSpan()); - Assert.assertEquals("compositeid gives generic id name", "id", person.getIdentifierProperty().getName()); + assertEquals(oto.getColumnSpan(),2); + assertEquals("MultiPerson", oto.getEntityName()); + assertEquals("AddressMultiPerson", oto.getReferencedEntityName()); + assertFalse(oto.isConstrained()); + assertEquals(2, person.getPropertyClosureSpan()); + assertEquals("id", person.getIdentifierProperty().getName(), "compositeid gives generic id name"); PersistentClass addressPerson = metadata.getEntityBinding("AddressMultiPerson"); Property personProperty = addressPerson.getProperty("multiPerson"); - Assert.assertNotNull(personProperty); - Assert.assertTrue(personProperty.getValue() instanceof OneToOne); + assertNotNull(personProperty); + assertTrue(personProperty.getValue() instanceof OneToOne); oto = (OneToOne) personProperty.getValue(); - Assert.assertEquals(oto.getColumnSpan(),2); - Assert.assertEquals("AddressMultiPerson", oto.getEntityName()); - Assert.assertEquals("MultiPerson", oto.getReferencedEntityName()); - Assert.assertEquals(2, addressPerson.getPropertyClosureSpan()); - Assert.assertEquals("compositeid gives generic id name","id", addressPerson.getIdentifierProperty().getName()); - Assert.assertTrue(oto.isConstrained()); + assertEquals(oto.getColumnSpan(),2); + assertEquals("AddressMultiPerson", oto.getEntityName()); + assertEquals("MultiPerson", oto.getReferencedEntityName()); + assertEquals(2, addressPerson.getPropertyClosureSpan()); + assertEquals("id", addressPerson.getIdentifierProperty().getName(), "compositeid gives generic id name"); + assertTrue(oto.isConstrained()); } @Test public void testBuildMappings() { - Assert.assertNotNull(metadata); + assertNotNull(metadata); } @Test public void testGenerateMappingAndReadable() throws MalformedURLException { - File outputDir = temporaryFolder.getRoot(); HibernateMappingExporter hme = new HibernateMappingExporter(); hme.setMetadataDescriptor(metadataDescriptor); hme.setOutputDirectory(outputDir); @@ -139,7 +156,7 @@ public void testGenerateMappingAndReadable() throws MalformedURLException { assertFileAndExists( new File(outputDir, "MiddleTable.hbm.xml") ); assertFileAndExists( new File(outputDir, "LeftTable.hbm.xml") ); assertFileAndExists( new File(outputDir, "RightTable.hbm.xml") ); - Assert.assertEquals(7, outputDir.listFiles().length); + assertEquals(7, outputDir.listFiles().length); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(outputDir); @@ -175,7 +192,6 @@ public void testGenerateMappingAndReadable() throws MalformedURLException { @Test public void testGenerateAnnotatedClassesAndReadable() throws MappingException, ClassNotFoundException, MalformedURLException { - File outputDir = temporaryFolder.getRoot(); POJOExporter exporter = new POJOExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(outputDir); @@ -189,7 +205,7 @@ public void testGenerateAnnotatedClassesAndReadable() throws MappingException, C assertFileAndExists( new File(outputDir, "AddressMultiPerson.java") ); assertFileAndExists( new File(outputDir, "AddressMultiPersonId.java") ); assertFileAndExists( new File(outputDir, "MultiPerson.java") ); - Assert.assertEquals(9, outputDir.listFiles().length); + assertEquals(9, outputDir.listFiles().length); List paths = new ArrayList(); paths.add(JavaUtil.resolvePathToJarFileFor(Persistence.class)); // for jpa api paths.add(JavaUtil.resolvePathToJarFileFor(Version.class)); // for hibernate core @@ -228,9 +244,9 @@ public void testGenerateAnnotatedClassesAndReadable() throws MappingException, C } private void assertFileAndExists(File file) { - Assert.assertTrue(file + " does not exist", file.exists() ); - Assert.assertTrue(file + " not a file", file.isFile() ); - Assert.assertTrue(file + " does not have any contents", file.length()>0); + assertTrue(file.exists(), file + " does not exist"); + assertTrue(file.isFile(), file + " not a file"); + assertTrue(file.length()>0, file + " does not have any contents"); } } From 43d798d84398e4b1246b305f18d56bd524dab4cf Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 18:04:15 +0200 Subject: [PATCH 313/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.OverrideBinder.TestCase' Signed-off-by: Koen Aers --- .../jdbc2cfg/OverrideBinder/TestCase.java | 320 ++++++++++-------- 1 file changed, 170 insertions(+), 150 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OverrideBinder/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OverrideBinder/TestCase.java index 3781b9c7ce..d7ce01f773 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OverrideBinder/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/OverrideBinder/TestCase.java @@ -1,9 +1,30 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.OverrideBinder; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.sql.Types; import java.util.Iterator; import java.util.List; @@ -30,10 +51,9 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -48,7 +68,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); OverrideRepository or = new OverrideRepository(); @@ -60,7 +80,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -72,23 +92,23 @@ public void testReadTypeMappings() { or.addResource(TEST_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null); - Assert.assertEquals("int", repository.columnToHibernateTypeName(null, null, Types.INTEGER, 5, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("long", repository.columnToHibernateTypeName(null, null, Types.INTEGER, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("byte[]", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 5, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("java.math.BigInteger", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 2, 3, false, false) ); - Assert.assertEquals("string", repository.columnToHibernateTypeName(null, null, Types.CHAR, 1, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("int", repository.columnToHibernateTypeName(null, null, Types.INTEGER, 5, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("long", repository.columnToHibernateTypeName(null, null, Types.INTEGER, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("byte[]", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 5, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("java.math.BigInteger", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 2, 3, false, false) ); + assertEquals("string", repository.columnToHibernateTypeName(null, null, Types.CHAR, 1, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); //Assert.assertEquals("string", repository.jdbcToHibernateType(Types.CHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE) ); - Assert.assertEquals("Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, 0, false, false) ); - Assert.assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, 43, false, false) ); + assertEquals("Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, 0, false, false) ); + assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, null, Types.NUMERIC, 1, 10, 43, false, false) ); // nullability - Assert.assertEquals("nonnull-float", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,17,false, false) ); - Assert.assertEquals("null-float", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,17,true, false) ); + assertEquals("nonnull-float", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,17,false, false) ); + assertEquals("null-float", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,17,true, false) ); - Assert.assertEquals("onlynotnull", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,SQLTypeMapping.UNKNOWN_SCALE,false, false) ); - Assert.assertEquals("donotcare", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,SQLTypeMapping.UNKNOWN_SCALE,true, false) ); + assertEquals("onlynotnull", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,SQLTypeMapping.UNKNOWN_SCALE,false, false) ); + assertEquals("donotcare", repository.columnToHibernateTypeName(null, null, Types.FLOAT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION,SQLTypeMapping.UNKNOWN_SCALE,true, false) ); } @@ -100,12 +120,12 @@ public void testDocExample() { or.addResource(DOC_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()); - Assert.assertEquals("int", repository.columnToHibernateTypeName(null, "ID", Types.INTEGER, SQLTypeMapping.UNKNOWN_LENGTH, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("your.package.TrimStringUserType", repository.columnToHibernateTypeName(null, "NAME", Types.VARCHAR, 30, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); - Assert.assertEquals("char", repository.columnToHibernateTypeName(null, "INITIAL", Types.VARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); - Assert.assertEquals("java.lang.Character", repository.columnToHibernateTypeName(null, "CODE", Types.VARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("big_decimal", repository.columnToHibernateTypeName(null, "SALARY", Types.NUMERIC, SQLTypeMapping.UNKNOWN_LENGTH, 15, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); - Assert.assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, "AGE", Types.NUMERIC, SQLTypeMapping.UNKNOWN_LENGTH, 3, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); + assertEquals("int", repository.columnToHibernateTypeName(null, "ID", Types.INTEGER, SQLTypeMapping.UNKNOWN_LENGTH, 10, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("your.package.TrimStringUserType", repository.columnToHibernateTypeName(null, "NAME", Types.VARCHAR, 30, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); + assertEquals("char", repository.columnToHibernateTypeName(null, "INITIAL", Types.VARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); + assertEquals("java.lang.Character", repository.columnToHibernateTypeName(null, "CODE", Types.VARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("big_decimal", repository.columnToHibernateTypeName(null, "SALARY", Types.NUMERIC, SQLTypeMapping.UNKNOWN_LENGTH, 15, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); + assertEquals("java.lang.Long", repository.columnToHibernateTypeName(null, "AGE", Types.NUMERIC, SQLTypeMapping.UNKNOWN_LENGTH, 3, SQLTypeMapping.UNKNOWN_SCALE, true, false) ); } @@ -118,29 +138,29 @@ public void testSchemaSelection() { List schemaSelectors = repository.getSchemaSelections(); - Assert.assertNotNull(schemaSelectors); - Assert.assertEquals(4,schemaSelectors.size()); + assertNotNull(schemaSelectors); + assertEquals(4,schemaSelectors.size()); SchemaSelection ss; ss = (SchemaSelection) schemaSelectors.get(0); - Assert.assertEquals(null,ss.getMatchCatalog()); - Assert.assertEquals(null,ss.getMatchSchema()); - Assert.assertEquals(null,ss.getMatchTable()); + assertEquals(null,ss.getMatchCatalog()); + assertEquals(null,ss.getMatchSchema()); + assertEquals(null,ss.getMatchTable()); ss = (SchemaSelection) schemaSelectors.get(1); - Assert.assertEquals(null,ss.getMatchCatalog()); - Assert.assertEquals("OVRTEST",ss.getMatchSchema()); - Assert.assertEquals(null,ss.getMatchTable()); + assertEquals(null,ss.getMatchCatalog()); + assertEquals("OVRTEST",ss.getMatchSchema()); + assertEquals(null,ss.getMatchTable()); ss = (SchemaSelection) schemaSelectors.get(2); - Assert.assertEquals("UBERCATALOG",ss.getMatchCatalog()); - Assert.assertEquals("OVRTEST",ss.getMatchSchema()); - Assert.assertEquals(null,ss.getMatchTable()); + assertEquals("UBERCATALOG",ss.getMatchCatalog()); + assertEquals("OVRTEST",ss.getMatchSchema()); + assertEquals(null,ss.getMatchTable()); ss = (SchemaSelection) schemaSelectors.get(3); - Assert.assertEquals("PUBLIC.*",ss.getMatchCatalog()); - Assert.assertEquals("OVRTEST",ss.getMatchSchema()); - Assert.assertEquals(".*",ss.getMatchTable()); + assertEquals("PUBLIC.*",ss.getMatchCatalog()); + assertEquals("OVRTEST",ss.getMatchSchema()); + assertEquals(".*",ss.getMatchTable()); OverrideRepository ox = new OverrideRepository(); ox.addSchemaSelection(new SchemaSelection(null, null, "DUMMY.*")); @@ -151,8 +171,8 @@ public void testSchemaSelection() { Iterator
tableMappings = md.collectTableMappings().iterator(); Table t = (Table) tableMappings.next(); - Assert.assertEquals(t.getName(), "DUMMY"); - Assert.assertFalse(tableMappings.hasNext()); + assertEquals(t.getName(), "DUMMY"); + assertFalse(tableMappings.hasNext()); } @Test @@ -162,24 +182,24 @@ public void testColumnTypeMappings() { or.addResource(OVERRIDETEST_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null); - Assert.assertNull(repository.columnToHibernateTypeName(new TableIdentifier("blah"), "bogus",0,0,0,0, false, false)); - Assert.assertNull(repository.columnToHibernateTypeName(new TableIdentifier("ORDERS"), "CUSTID",0,0,0,0, false, false)); - Assert.assertEquals("string", repository.columnToHibernateTypeName(new TableIdentifier(null, null, "ORDERS"), "NAME",0,0,0,0, false, false)); + assertNull(repository.columnToHibernateTypeName(new TableIdentifier("blah"), "bogus",0,0,0,0, false, false)); + assertNull(repository.columnToHibernateTypeName(new TableIdentifier("ORDERS"), "CUSTID",0,0,0,0, false, false)); + assertEquals("string", repository.columnToHibernateTypeName(new TableIdentifier(null, null, "ORDERS"), "NAME",0,0,0,0, false, false)); PersistentClass classMapping = metadata.getEntityBinding("Orders"); Property property = classMapping.getProperty("completed"); - Assert.assertEquals("boolean because of not null", "boolean", ((SimpleValue)property.getValue()).getTypeName()); + assertEquals("boolean", ((SimpleValue)property.getValue()).getTypeName(), "boolean because of not null"); property = classMapping.getProperty("verified"); - Assert.assertEquals("java.lang.Boolean because of null","java.lang.Boolean", ((SimpleValue)property.getValue()).getTypeName()); + assertEquals("java.lang.Boolean", ((SimpleValue)property.getValue()).getTypeName(), "java.lang.Boolean because of null"); classMapping = metadata.getEntityBinding("MiscTypes"); property = classMapping.getIdentifierProperty(); - Assert.assertFalse(((SimpleValue)property.getValue()).isNullable()); - Assert.assertEquals("java.lang.Long because of primary key", "java.lang.Long", ((SimpleValue)property.getValue()).getTypeName()); + assertFalse(((SimpleValue)property.getValue()).isNullable()); + assertEquals("java.lang.Long", ((SimpleValue)property.getValue()).getTypeName(), "java.lang.Long because of primary key"); } @Test @@ -189,18 +209,18 @@ public void testColumnPropertyNameMappings() { or.addResource(OVERRIDETEST_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null); - Assert.assertNull(repository.columnToPropertyName(new TableIdentifier("blah"), "bogus")); - Assert.assertNull(repository.columnToPropertyName(new TableIdentifier("ORDERS"), "cust_id")); - Assert.assertEquals("orderName", repository.columnToPropertyName(new TableIdentifier(null, null, "ORDERS"), "NAME")); + assertNull(repository.columnToPropertyName(new TableIdentifier("blah"), "bogus")); + assertNull(repository.columnToPropertyName(new TableIdentifier("ORDERS"), "cust_id")); + assertEquals("orderName", repository.columnToPropertyName(new TableIdentifier(null, null, "ORDERS"), "NAME")); } @Test public void testMetaAttributeMappings() { PersistentClass classMapping = metadata.getEntityBinding( "Orders" ); - Assert.assertEquals("order table value", classMapping.getMetaAttribute( "order-meta" ).getValue()); + assertEquals("order table value", classMapping.getMetaAttribute( "order-meta" ).getValue()); Property property = classMapping.getProperty("orderName"); - Assert.assertEquals("order column value", property.getMetaAttribute( "order-meta" ).getValue()); + assertEquals("order column value", property.getMetaAttribute( "order-meta" ).getValue()); //TODO: test sequence of meta } @@ -212,46 +232,46 @@ public void testIdGenerator() { ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null); TableIdentifier miscTable = new TableIdentifier(null,null, "MISC_TYPES"); - Assert.assertEquals("sequence",repository.getTableIdentifierStrategyName(miscTable)); + assertEquals("sequence",repository.getTableIdentifierStrategyName(miscTable)); Map props = repository.getTableIdentifierProperties(miscTable); - Assert.assertEquals("seq_table", props.get("table")); + assertEquals("seq_table", props.get("table")); - Assert.assertNull(repository.getTableIdentifierStrategyName(new TableIdentifier("blah"))); - Assert.assertNull(repository.getTableIdentifierProperties(new TableIdentifier("blah"))); + assertNull(repository.getTableIdentifierStrategyName(new TableIdentifier("blah"))); + assertNull(repository.getTableIdentifierProperties(new TableIdentifier("blah"))); TableIdentifier ordersTable = new TableIdentifier(null,null, "ORDERS"); - Assert.assertEquals("customOrderId", repository.tableToIdentifierPropertyName(ordersTable)); - Assert.assertEquals(null, repository.tableToIdentifierPropertyName(new TableIdentifier("blah"))); + assertEquals("customOrderId", repository.tableToIdentifierPropertyName(ordersTable)); + assertEquals(null, repository.tableToIdentifierPropertyName(new TableIdentifier("blah"))); - Assert.assertEquals("CustomOID", repository.tableToCompositeIdName(ordersTable)); - Assert.assertEquals(null, repository.tableToCompositeIdName(new TableIdentifier("blah"))); + assertEquals("CustomOID", repository.tableToCompositeIdName(ordersTable)); + assertEquals(null, repository.tableToCompositeIdName(new TableIdentifier("blah"))); List primaryKeyColumnNames = repository.getPrimaryKeyColumnNames(new TableIdentifier("blah")); - Assert.assertNull(primaryKeyColumnNames); + assertNull(primaryKeyColumnNames); primaryKeyColumnNames = repository.getPrimaryKeyColumnNames(ordersTable); - Assert.assertNotNull(primaryKeyColumnNames); - Assert.assertEquals(2, primaryKeyColumnNames.size()); - Assert.assertEquals("ORDERID", primaryKeyColumnNames.get(0)); - Assert.assertEquals("CUSTID", primaryKeyColumnNames.get(1)); - Assert.assertFalse(repository.excludeColumn(ordersTable, "CUSTID")); + assertNotNull(primaryKeyColumnNames); + assertEquals(2, primaryKeyColumnNames.size()); + assertEquals("ORDERID", primaryKeyColumnNames.get(0)); + assertEquals("CUSTID", primaryKeyColumnNames.get(1)); + assertFalse(repository.excludeColumn(ordersTable, "CUSTID")); // applied PersistentClass classMapping = metadata.getEntityBinding("Orders"); SimpleValue sv = (SimpleValue) classMapping.getIdentifier(); - Assert.assertEquals("CustomOID", ((Component)sv).getComponentClassName()); + assertEquals("CustomOID", ((Component)sv).getComponentClassName()); - Assert.assertEquals(2,classMapping.getIdentifierProperty().getColumnSpan()); + assertEquals(2,classMapping.getIdentifierProperty().getColumnSpan()); Property identifierProperty = classMapping.getIdentifierProperty(); - Assert.assertEquals("customOrderId", identifierProperty.getName()); + assertEquals("customOrderId", identifierProperty.getName()); classMapping = metadata.getEntityBinding("MiscTypes"); sv = (SimpleValue) classMapping.getIdentifier(); - Assert.assertEquals("sequence", sv.getIdentifierGeneratorStrategy()); // will fail if default schema is not set since then there is no match in the override binder + assertEquals("sequence", sv.getIdentifierGeneratorStrategy()); // will fail if default schema is not set since then there is no match in the override binder - Assert.assertNotNull(sv.getIdentifierGeneratorProperties()); - Assert.assertEquals("seq_table", sv.getIdentifierGeneratorProperties().getProperty("table")); + assertNotNull(sv.getIdentifierGeneratorProperties()); + assertEquals("seq_table", sv.getIdentifierGeneratorProperties().getProperty("table")); } @@ -262,11 +282,11 @@ public void testReadExcludeTables() { or.addResource(OVERRIDETEST_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null); - Assert.assertTrue(repository.excludeTable(new TableIdentifier(null,null, "DoNotWantIt") ) ); - Assert.assertFalse(repository.excludeTable(new TableIdentifier(null,null, "NotListedThere") ) ); - Assert.assertFalse(repository.excludeTable(new TableIdentifier("cat","sch", "WantedTable") ) ); - Assert.assertFalse(repository.excludeTable(new TableIdentifier("BAD","SCHEMA", "WantedTable") ) ); - Assert.assertTrue(repository.excludeTable(new TableIdentifier("BAD","SCHEMA", "SomethingElse") ) ); + assertTrue(repository.excludeTable(new TableIdentifier(null,null, "DoNotWantIt") ) ); + assertFalse(repository.excludeTable(new TableIdentifier(null,null, "NotListedThere") ) ); + assertFalse(repository.excludeTable(new TableIdentifier("cat","sch", "WantedTable") ) ); + assertFalse(repository.excludeTable(new TableIdentifier("BAD","SCHEMA", "WantedTable") ) ); + assertTrue(repository.excludeTable(new TableIdentifier("BAD","SCHEMA", "SomethingElse") ) ); } @@ -277,28 +297,28 @@ public void testReadPackageName() { or.addResource(OVERRIDETEST_REVENG_XML); ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()); - Assert.assertEquals("org.werd.Q", repository.tableToClassName(new TableIdentifier("q","Werd", "Q") ) ); - Assert.assertEquals("Notknown", repository.tableToClassName(new TableIdentifier(null,null, "notknown") ) ); + assertEquals("org.werd.Q", repository.tableToClassName(new TableIdentifier("q","Werd", "Q") ) ); + assertEquals("Notknown", repository.tableToClassName(new TableIdentifier(null,null, "notknown") ) ); - Assert.assertEquals("org.werd.MyWorld", repository.tableToClassName(new TableIdentifier(null,"Werd", "TBL_PKG") ) ); - Assert.assertEquals("other.MyWorld", repository.tableToClassName(new TableIdentifier(null,"Werd", "TBL_OTHER") ) ); + assertEquals("org.werd.MyWorld", repository.tableToClassName(new TableIdentifier(null,"Werd", "TBL_PKG") ) ); + assertEquals("other.MyWorld", repository.tableToClassName(new TableIdentifier(null,"Werd", "TBL_OTHER") ) ); } @Test public void testRevEngExclude() { - Assert.assertNull(HibernateUtil.getTable( + assertNull(HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "DEFUNCT_TABLE") ) ); Table foundTable = HibernateUtil.getTable( metadata, JdbcUtil.toIdentifier(this, "INTHEMIDDLE") ); - Assert.assertNotNull(foundTable); + assertNotNull(foundTable); Iterator fkiter = foundTable.getForeignKeyIterator(); ForeignKey fk1 = (ForeignKey) fkiter.next(); - Assert.assertNotNull(fk1); - Assert.assertFalse(fkiter.hasNext() ); + assertNotNull(fk1); + assertFalse(fkiter.hasNext() ); } @@ -312,25 +332,25 @@ public void testSQLTypeMappingComparisons() { SQLTypeMapping morespecific = new SQLTypeMapping(Types.BIGINT, 2, 3, 4, Boolean.TRUE); SQLTypeMapping equalmorespecific = new SQLTypeMapping(Types.BIGINT, 2, 3, 4, Boolean.TRUE); - Assert.assertFalse(one.equals(two) ); - Assert.assertFalse(two.equals(one) ); - Assert.assertTrue(two.equals(two) ); - Assert.assertTrue(one.equals(one) ); - Assert.assertTrue(morespecific.equals(equalmorespecific)); + assertFalse(one.equals(two) ); + assertFalse(two.equals(one) ); + assertTrue(two.equals(two) ); + assertTrue(one.equals(one) ); + assertTrue(morespecific.equals(equalmorespecific)); - Assert.assertEquals(-1, one.compareTo(two) ); - Assert.assertEquals(1, two.compareTo(one) ); + assertEquals(-1, one.compareTo(two) ); + assertEquals(1, two.compareTo(one) ); - Assert.assertEquals(1, generic.compareTo(one) ); - Assert.assertEquals(1, generic.compareTo(two) ); - Assert.assertEquals(1, generic.compareTo(specific) ); + assertEquals(1, generic.compareTo(one) ); + assertEquals(1, generic.compareTo(two) ); + assertEquals(1, generic.compareTo(specific) ); - Assert.assertEquals(-1, specific.compareTo(one) ); - Assert.assertEquals(-1, specific.compareTo(two) ); - Assert.assertEquals(-1, specific.compareTo(generic) ); - Assert.assertEquals(1, specific.compareTo(morespecific) ); - Assert.assertEquals(-1, morespecific.compareTo(specific) ); + assertEquals(-1, specific.compareTo(one) ); + assertEquals(-1, specific.compareTo(two) ); + assertEquals(-1, specific.compareTo(generic) ); + assertEquals(1, specific.compareTo(morespecific) ); + assertEquals(-1, morespecific.compareTo(specific) ); } @@ -351,9 +371,9 @@ public void testSqlTypeOverride() { or.addTypeMapping(sqltype); ReverseEngineeringStrategy res = or.getReverseEngineeringStrategy(null); - Assert.assertEquals("boolean",res.columnToHibernateTypeName(null,null, Types.BINARY, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals(null,res.columnToHibernateTypeName(null,null, Types.LONGVARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); - Assert.assertEquals("yes_no",res.columnToHibernateTypeName(null,null, Types.BIT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("boolean",res.columnToHibernateTypeName(null,null, Types.BINARY, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals(null,res.columnToHibernateTypeName(null,null, Types.LONGVARCHAR, 1, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); + assertEquals("yes_no",res.columnToHibernateTypeName(null,null, Types.BIT, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) ); } @Test @@ -361,18 +381,18 @@ public void testTableExclude() { TableFilter tf = new TableFilter(); tf.setMatchName("max"); tf.setExclude(Boolean.TRUE); - Assert.assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); - Assert.assertNull(tf.exclude(new TableIdentifier("maxnotexact") ) ); + assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); + assertNull(tf.exclude(new TableIdentifier("maxnotexact") ) ); tf.setMatchName(".*max"); - Assert.assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); - Assert.assertNull(tf.exclude(new TableIdentifier("maxnotending") ) ); - Assert.assertTrue(tf.exclude(new TableIdentifier("endingWithmax") ).booleanValue() ); + assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); + assertNull(tf.exclude(new TableIdentifier("maxnotending") ) ); + assertTrue(tf.exclude(new TableIdentifier("endingWithmax") ).booleanValue() ); tf.setMatchName("max.*"); - Assert.assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); + assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); tf.setMatchName(".*max.*"); - Assert.assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); - Assert.assertNull(tf.exclude(new TableIdentifier("notxam") ) ); - Assert.assertTrue(tf.exclude(new TableIdentifier("heremaxsub") ).booleanValue() ); + assertTrue(tf.exclude(new TableIdentifier("max") ).booleanValue() ); + assertNull(tf.exclude(new TableIdentifier("notxam") ) ); + assertTrue(tf.exclude(new TableIdentifier("heremaxsub") ).booleanValue() ); } @Test @@ -383,15 +403,15 @@ public void testColumnExclude() { ReverseEngineeringStrategy reverseEngineeringStrategy = or.getReverseEngineeringStrategy(); - Assert.assertFalse(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "blah")); - Assert.assertFalse(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "NAME")); - Assert.assertTrue(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "EXCOLUMN")); + assertFalse(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "blah")); + assertFalse(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "NAME")); + assertTrue(reverseEngineeringStrategy.excludeColumn(new TableIdentifier("EXCOLUMNS"), "EXCOLUMN")); Table table = HibernateUtil.getTable(metadata, JdbcUtil.toIdentifier(this, "EXCOLUMNS")); - Assert.assertNotNull(table); + assertNotNull(table); - Assert.assertNotNull(table.getColumn(new Column("name"))); - Assert.assertNull(table.getColumn(new Column("excolumn"))); + assertNotNull(table.getColumn(new Column("name"))); + assertNull(table.getColumn(new Column("excolumn"))); } @@ -402,7 +422,7 @@ public void testSimpleUserDefinedForeignKeys() { Iterator foreignKeyIterator = table.getForeignKeyIterator(); ForeignKey fk = (ForeignKey) foreignKeyIterator.next(); - Assert.assertEquals(fk.getReferencedTable().getName(), JdbcUtil.toIdentifier(this, "CUSTOMER") ); + assertEquals(fk.getReferencedTable().getName(), JdbcUtil.toIdentifier(this, "CUSTOMER") ); PersistentClass classMapping = metadata.getEntityBinding("Orders"); classMapping.getProperty("customer"); @@ -419,13 +439,13 @@ public void testCompositeUserDefinedForeignKeys() { Iterator foreignKeyIterator = table.getForeignKeyIterator(); ForeignKey fk = (ForeignKey) foreignKeyIterator.next(); - Assert.assertEquals(fk.getReferencedTable().getName(), JdbcUtil.toIdentifier(this, "PARENT") ); - Assert.assertEquals(2, fk.getReferencedColumns().size()); - Assert.assertEquals("child_to_parent", fk.getName()); + assertEquals(fk.getReferencedTable().getName(), JdbcUtil.toIdentifier(this, "PARENT") ); + assertEquals(2, fk.getReferencedColumns().size()); + assertEquals("child_to_parent", fk.getName()); PersistentClass classMapping = metadata.getEntityBinding("Children"); Property property = classMapping.getProperty("propertyParent"); - Assert.assertEquals(2,property.getColumnSpan()); + assertEquals(2,property.getColumnSpan()); classMapping = metadata.getEntityBinding("Parent"); property = classMapping.getProperty("propertyChildren"); @@ -435,13 +455,13 @@ public void testCompositeUserDefinedForeignKeys() { @Test public void testTypes() { PersistentClass classMapping = metadata.getEntityBinding("MiscTypes"); - Assert.assertEquals( + assertEquals( "SomeUserType", ((SimpleValue)classMapping.getProperty("name").getValue()).getTypeName()); - Assert.assertEquals( + assertEquals( "string", ((SimpleValue)classMapping.getProperty("shortname").getValue()).getTypeName()); - Assert.assertEquals( + assertEquals( "yes_no", ((SimpleValue)classMapping.getProperty("flag").getValue()).getTypeName()); } @@ -452,7 +472,7 @@ public void testTableToClass() { ReverseEngineeringStrategy res = new OverrideRepository().addResource(OVERRIDETEST_REVENG_XML).getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()); TableIdentifier tableIdentifier = new TableIdentifier(null, null, "TblTest"); - Assert.assertEquals("org.test.Test", res.tableToClassName(tableIdentifier)); + assertEquals("org.test.Test", res.tableToClassName(tableIdentifier)); tableIdentifier = new TableIdentifier( Environment @@ -460,10 +480,10 @@ public void testTableToClass() { .getProperty(AvailableSettings.DEFAULT_CATALOG), "Werd", "Testy"); - Assert.assertEquals("org.werd.Testy", res.tableToClassName(tableIdentifier)); + assertEquals("org.werd.Testy", res.tableToClassName(tableIdentifier)); tableIdentifier = new TableIdentifier(null, null, "Nothing"); - Assert.assertEquals("Nothing", res.tableToClassName(tableIdentifier)); + assertEquals("Nothing", res.tableToClassName(tableIdentifier)); } @@ -474,11 +494,11 @@ public void testMetaAttributes() { TableIdentifier tableIdentifier = new TableIdentifier(null, null, "TblTest"); Map attributes = res.tableToMetaAttributes(tableIdentifier); - Assert.assertNotNull(attributes); - Assert.assertEquals(attributes.size(),1); + assertNotNull(attributes); + assertEquals(attributes.size(),1); MetaAttribute ma = (MetaAttribute) attributes.get("use-in-test"); - Assert.assertEquals(ma.getName(), "use-in-test"); - Assert.assertEquals(ma.getValue(), "true"); + assertEquals(ma.getName(), "use-in-test"); + assertEquals(ma.getValue(), "true"); tableIdentifier = new TableIdentifier( Environment @@ -487,34 +507,34 @@ public void testMetaAttributes() { "Werd", "Testy"); attributes = res.tableToMetaAttributes( tableIdentifier ); - Assert.assertNotNull(attributes); + assertNotNull(attributes); ma = attributes.get( "werd-meta" ); - Assert.assertEquals(ma.getName(), "werd-meta"); - Assert.assertEquals(ma.getValues().size(), 2); + assertEquals(ma.getName(), "werd-meta"); + assertEquals(ma.getValues().size(), 2); tableIdentifier = new TableIdentifier(null, "Werd", "MetaTable"); attributes = res.tableToMetaAttributes( tableIdentifier ); - Assert.assertNotNull(attributes); - Assert.assertEquals(2, attributes.size()); + assertNotNull(attributes); + assertEquals(2, attributes.size()); ma = attributes.get("specific-werd"); - Assert.assertEquals(ma.getName(), "specific-werd"); - Assert.assertEquals(ma.getValue(), "a one"); + assertEquals(ma.getName(), "specific-werd"); + assertEquals(ma.getValue(), "a one"); ma = attributes.get( "werd-meta" ); - Assert.assertEquals(ma.getName(), "werd-meta"); - Assert.assertEquals(1, ma.getValues().size()); // as long as no inherit this should be one - Assert.assertEquals("value three", ma.getValue()); + assertEquals(ma.getName(), "werd-meta"); + assertEquals(1, ma.getValues().size()); // as long as no inherit this should be one + assertEquals("value three", ma.getValue()); tableIdentifier = new TableIdentifier(null, null, "Nothing"); - Assert.assertEquals(null, res.tableToMetaAttributes(tableIdentifier)); + assertEquals(null, res.tableToMetaAttributes(tableIdentifier)); - Assert.assertNull(res.columnToMetaAttributes(new TableIdentifier("Nothing"), "bogus")); - Assert.assertNull(res.columnToMetaAttributes( new TableIdentifier(null, "Werd", "MetaTable"), "bogusColumn" )); + assertNull(res.columnToMetaAttributes(new TableIdentifier("Nothing"), "bogus")); + assertNull(res.columnToMetaAttributes( new TableIdentifier(null, "Werd", "MetaTable"), "bogusColumn" )); attributes = res.columnToMetaAttributes( new TableIdentifier(null, "Werd", "MetaTable"), "MetaColumn" ); - Assert.assertEquals(1, attributes.size()); + assertEquals(1, attributes.size()); ma = attributes.get("specific-column"); - Assert.assertEquals("specific-column",ma.getName()); - Assert.assertEquals("yes a column with meta",ma.getValue()); + assertEquals("specific-column",ma.getName()); + assertEquals("yes a column with meta",ma.getValue()); } From 92bf69d5fa550fb508d537dbb4cfcf9226414d9c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 22:12:16 +0200 Subject: [PATCH 314/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Performance.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Performance/TestCase.java | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Performance/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Performance/TestCase.java index f367a520a6..89f7ecbd44 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Performance/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Performance/TestCase.java @@ -1,9 +1,26 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Performance; +import static org.junit.jupiter.api.Assertions.assertEquals; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -11,10 +28,9 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -25,12 +41,12 @@ public class TestCase { private static final int TABLECOUNT = 200; private static final int COLCOUNT = 10; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -45,7 +61,7 @@ public void testBasic() throws SQLException { metadata.collectTableMappings().iterator(), TABLECOUNT); Table tab = (Table) metadata.collectTableMappings().iterator().next(); - Assert.assertEquals(tab.getColumnSpan(), COLCOUNT+1); + assertEquals(tab.getColumnSpan(), COLCOUNT+1); } } From 49f99eae61f5d6472ef4756d184666e1235bde12 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 22:53:52 +0200 Subject: [PATCH 315/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.PersistentClasses.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/PersistentClasses/Item.java | 20 ++++- .../jdbc2cfg/PersistentClasses/Orders.java | 20 ++++- .../jdbc2cfg/PersistentClasses/TestCase.java | 77 ++++++++++++------- 3 files changed, 86 insertions(+), 31 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Item.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Item.java index dfecf2e303..340b041de8 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Item.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Item.java @@ -1,4 +1,22 @@ - +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.jdbc2cfg.PersistentClasses; public class Item { diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Orders.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Orders.java index 27734faf38..7f9d0c10f9 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Orders.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/Orders.java @@ -1,4 +1,22 @@ - +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.jdbc2cfg.PersistentClasses; import java.util.HashSet; import java.util.Set; diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/TestCase.java index 5ec29d6867..dd1151efb5 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/PersistentClasses/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.PersistentClasses; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.sql.SQLException; import org.hibernate.Hibernate; @@ -24,10 +44,9 @@ import org.hibernate.mapping.Set; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -39,7 +58,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy(); @@ -49,7 +68,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -57,22 +76,22 @@ public void tearDown() { @Test public void testCreatePersistentClasses() { PersistentClass classMapping = metadata.getEntityBinding(PACKAGE_NAME + ".Orders"); - Assert.assertNotNull("class not found", classMapping); + assertNotNull(classMapping, "class not found"); KeyValue identifier = classMapping.getIdentifier(); - Assert.assertNotNull(identifier); + assertNotNull(identifier); } @Test public void testCreateManyToOne() { PersistentClass classMapping = metadata.getEntityBinding(PACKAGE_NAME + ".Item"); - Assert.assertNotNull(classMapping); + assertNotNull(classMapping); KeyValue identifier = classMapping.getIdentifier(); - Assert.assertNotNull(identifier); - Assert.assertEquals(3,classMapping.getPropertyClosureSpan() ); + assertNotNull(identifier); + assertEquals(3,classMapping.getPropertyClosureSpan() ); Property property = classMapping.getProperty("ordersByRelatedOrderId"); - Assert.assertNotNull(property); + assertNotNull(property); property = classMapping.getProperty("ordersByOrderId"); - Assert.assertNotNull(property); + assertNotNull(property); } @Test @@ -81,11 +100,11 @@ public void testCreateOneToMany() { Property itemset = orders.getProperty("itemsForRelatedOrderId"); Collection col = (Collection) itemset.getValue(); OneToMany otm = (OneToMany) col.getElement(); - Assert.assertEquals(otm.getReferencedEntityName(), PACKAGE_NAME + ".Item"); - Assert.assertEquals(otm.getAssociatedClass().getClassName(), PACKAGE_NAME + ".Item"); - Assert.assertEquals(otm.getTable().getName(), "ORDERS"); - Assert.assertNotNull(itemset); - Assert.assertTrue(itemset.getValue() instanceof Set); + assertEquals(otm.getReferencedEntityName(), PACKAGE_NAME + ".Item"); + assertEquals(otm.getAssociatedClass().getClassName(), PACKAGE_NAME + ".Item"); + assertEquals(otm.getTable().getName(), "ORDERS"); + assertNotNull(itemset); + assertTrue(itemset.getValue() instanceof Set); } @Test @@ -124,15 +143,15 @@ public void testBinding() throws HibernateException, SQLException { Item loadeditem = (Item) session.get(PACKAGE_NAME + ".Item", new Integer(42) ); - Assert.assertEquals(item.getName(),loadeditem.getName() ); - Assert.assertEquals(item.getChildId(),loadeditem.getChildId() ); - Assert.assertEquals(item.getOrderId().getId(),loadeditem.getOrderId().getId() ); + assertEquals(item.getName(),loadeditem.getName() ); + assertEquals(item.getChildId(),loadeditem.getChildId() ); + assertEquals(item.getOrderId().getId(),loadeditem.getOrderId().getId() ); - Assert.assertTrue(loadeditem.getOrderId().getItemsForOrderId().contains(loadeditem) ); - Assert.assertTrue(item.getOrderId().getItemsForOrderId().contains(item) ); + assertTrue(loadeditem.getOrderId().getItemsForOrderId().contains(loadeditem) ); + assertTrue(item.getOrderId().getItemsForOrderId().contains(item) ); - Assert.assertEquals(5,item.getOrderId().getItemsForOrderId().size() ); - Assert.assertEquals(5,loadeditem.getOrderId().getItemsForOrderId().size() ); + assertEquals(5,item.getOrderId().getItemsForOrderId().size() ); + assertEquals(5,loadeditem.getOrderId().getItemsForOrderId().size() ); t.commit(); session.close(); @@ -141,12 +160,12 @@ public void testBinding() throws HibernateException, SQLException { t = session.beginTransaction(); order = (Orders) session.load(Orders.class, new Integer(1) ); - Assert.assertFalse(Hibernate.isInitialized(order) ); - Assert.assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) ); + assertFalse(Hibernate.isInitialized(order) ); + assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) ); order = (Orders) session.createQuery("from " + PACKAGE_NAME + ".Orders").getSingleResult(); - Assert.assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) ); + assertFalse(Hibernate.isInitialized(order.getItemsForOrderId() ) ); t.commit(); session.close(); sf.close(); From 9c5cd482817e0a666d2e599e96fce0b66b166e90 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 7 Jul 2021 23:13:33 +0200 Subject: [PATCH 316/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.RevEngForeignKey.TestCase' Signed-off-by: Koen Aers --- .../jdbc2cfg/RevEngForeignKey/TestCase.java | 123 ++++++++++-------- 1 file changed, 71 insertions(+), 52 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/TestCase.java index 8447b0c1bf..96dab2f797 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.RevEngForeignKey; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import java.net.MalformedURLException; import org.hibernate.MappingException; @@ -16,10 +36,9 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -30,12 +49,12 @@ public class TestCase { private static final String FOREIGN_KEY_TEST_XML = "org/hibernate/tool/jdbc2cfg/RevEngForeignKey/foreignkeytest.reveng.xml"; private static final String BAD_FOREIGNKEY_XML = "org/hibernate/tool/jdbc2cfg/RevEngForeignKey/badforeignkeytest.reveng.xml"; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -46,22 +65,22 @@ public void testDefaultBiDirectional() { .createJdbcDescriptor(null, null, true) .createMetadata(); PersistentClass project = metadata.getEntityBinding("Project"); - Assert.assertNotNull(project.getProperty("worksOns")); - Assert.assertNotNull(project.getProperty("employee")); - Assert.assertEquals(3, project.getPropertyClosureSpan()); - Assert.assertEquals("projectId", project.getIdentifierProperty().getName()); + assertNotNull(project.getProperty("worksOns")); + assertNotNull(project.getProperty("employee")); + assertEquals(3, project.getPropertyClosureSpan()); + assertEquals("projectId", project.getIdentifierProperty().getName()); PersistentClass employee = metadata.getEntityBinding("Employee"); - Assert.assertNotNull(employee.getProperty("worksOns")); - Assert.assertNotNull(employee.getProperty("employees")); - Assert.assertNotNull(employee.getProperty("employee")); - Assert.assertNotNull(employee.getProperty("projects")); - Assert.assertEquals(5, employee.getPropertyClosureSpan()); - Assert.assertEquals("id", employee.getIdentifierProperty().getName()); + assertNotNull(employee.getProperty("worksOns")); + assertNotNull(employee.getProperty("employees")); + assertNotNull(employee.getProperty("employee")); + assertNotNull(employee.getProperty("projects")); + assertEquals(5, employee.getPropertyClosureSpan()); + assertEquals("id", employee.getIdentifierProperty().getName()); PersistentClass worksOn = metadata.getEntityBinding("WorksOn"); - Assert.assertNotNull(worksOn.getProperty("project")); - Assert.assertNotNull(worksOn.getProperty("employee")); - Assert.assertEquals(4, worksOn.getPropertyClosureSpan()); - Assert.assertEquals("id", worksOn.getIdentifierProperty().getName()); + assertNotNull(worksOn.getProperty("project")); + assertNotNull(worksOn.getProperty("employee")); + assertEquals(4, worksOn.getPropertyClosureSpan()); + assertEquals("id", worksOn.getIdentifierProperty().getName()); } @Test @@ -73,27 +92,27 @@ public void testSetAndManyToOne() { .createJdbcDescriptor(repository, null, true) .createMetadata(); PersistentClass project = metadata.getEntityBinding("Project"); - Assert.assertNotNull(project.getProperty("worksOns")); + assertNotNull(project.getProperty("worksOns")); assertPropertyNotExists(project, "employee", "should be removed by reveng.xml"); Property property = project.getProperty("teamLead"); - Assert.assertNotNull(property); - Assert.assertTrue(property.getValue() instanceof SimpleValue); - Assert.assertEquals(3, project.getPropertyClosureSpan()); - Assert.assertEquals("projectId", project.getIdentifierProperty().getName()); + assertNotNull(property); + assertTrue(property.getValue() instanceof SimpleValue); + assertEquals(3, project.getPropertyClosureSpan()); + assertEquals("projectId", project.getIdentifierProperty().getName()); PersistentClass employee = metadata.getEntityBinding("Employee"); - Assert.assertNotNull(employee.getProperty("worksOns")); - Assert.assertNotNull("property should be renamed by reveng.xml", employee.getProperty("manager")); + assertNotNull(employee.getProperty("worksOns")); + assertNotNull(employee.getProperty("manager"), "property should be renamed by reveng.xml"); assertPropertyNotExists( employee, "employees", "set should be excluded by reveng.xml" ); Property setProperty = employee.getProperty("managedProjects"); - Assert.assertNotNull("should be renamed by reveng.xml", setProperty); - Assert.assertEquals("delete, update", setProperty.getCascade()); - Assert.assertEquals(4, employee.getPropertyClosureSpan()); - Assert.assertEquals("id", employee.getIdentifierProperty().getName()); + assertNotNull(setProperty); + assertEquals("delete, update", setProperty.getCascade()); + assertEquals(4, employee.getPropertyClosureSpan()); + assertEquals("id", employee.getIdentifierProperty().getName()); PersistentClass worksOn = metadata.getEntityBinding("WorksOn"); - Assert.assertNotNull(worksOn.getProperty("project")); - Assert.assertNotNull(worksOn.getProperty("employee")); - Assert.assertEquals(4, worksOn.getPropertyClosureSpan()); - Assert.assertEquals("id", worksOn.getIdentifierProperty().getName()); + assertNotNull(worksOn.getProperty("project")); + assertNotNull(worksOn.getProperty("employee")); + assertEquals(4, worksOn.getPropertyClosureSpan()); + assertEquals("id", worksOn.getIdentifierProperty().getName()); } @Test @@ -111,13 +130,13 @@ public void testOneToOne() throws MalformedURLException, ClassNotFoundException assertPropertyNotExists(addressPerson, "person", "should be removed by reveng.xml"); assertPropertyNotExists(person, "addressPerson", "should be removed by reveng.xml"); Property property = addressMultiPerson.getProperty("renamedOne"); - Assert.assertNotNull(property); - Assert.assertEquals("Casade should be set to delete by reveng.xml", "delete", property.getCascade()); + assertNotNull(property); + assertEquals("delete", property.getCascade(), "Casade should be set to delete by reveng.xml"); assertPropertyNotExists(multiPerson, "addressMultiPerson", "should not be there"); Property o2o = multiPerson.getProperty("renamedInversedOne"); - Assert.assertNotNull(o2o); - Assert.assertEquals("update", o2o.getCascade()); - Assert.assertEquals("JOIN", o2o.getValue().getFetchMode().toString()); + assertNotNull(o2o); + assertEquals("update", o2o.getCascade()); + assertEquals("JOIN", o2o.getValue().getFetchMode().toString()); } @Test @@ -129,9 +148,9 @@ public void testDuplicateForeignKeyDefinition() { MetadataDescriptorFactory .createJdbcDescriptor(repository, null, true) .createMetadata(); - Assert.fail("Should fail because foreign key is already defined in the database"); // maybe we should ignore the definition and only listen to what is overwritten ? For now we error. + fail("Should fail because foreign key is already defined in the database"); // maybe we should ignore the definition and only listen to what is overwritten ? For now we error. } catch(MappingException me) { - Assert.assertTrue(me.getMessage().indexOf("already defined")>=0); + assertTrue(me.getMessage().indexOf("already defined")>=0); } } @@ -142,10 +161,10 @@ public void testManyToOneAttributeDefaults() { .createMetadata(); PersistentClass classMapping = metadata.getEntityBinding("Employee"); Property property = classMapping.getProperty("employee"); - Assert.assertEquals("none", property.getCascade()); - Assert.assertEquals(true, property.isUpdateable()); - Assert.assertEquals(true, property.isInsertable()); - Assert.assertEquals("SELECT", property.getValue().getFetchMode().toString()); + assertEquals("none", property.getCascade()); + assertEquals(true, property.isUpdateable()); + assertEquals(true, property.isInsertable()); + assertEquals("SELECT", property.getValue().getFetchMode().toString()); } @Test @@ -158,16 +177,16 @@ public void testManyToOneAttributeOverrides() { .createMetadata(); PersistentClass classMapping = metadata.getEntityBinding("Employee"); Property property = classMapping.getProperty("manager"); - Assert.assertEquals("all", property.getCascade()); - Assert.assertEquals(false, property.isUpdateable()); - Assert.assertEquals(false, property.isInsertable()); - Assert.assertEquals("JOIN", property.getValue().getFetchMode().toString()); + assertEquals("all", property.getCascade()); + assertEquals(false, property.isUpdateable()); + assertEquals(false, property.isInsertable()); + assertEquals("JOIN", property.getValue().getFetchMode().toString()); } private void assertPropertyNotExists(PersistentClass employee, String name, String msg) { try { employee.getProperty(name); - Assert.fail(msg); + fail(msg); } catch(MappingException me) { // excpected } From 31fe650e1278cc28f5cb209dd34cc3406df3b071 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 08:45:29 +0200 Subject: [PATCH 317/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.SearchEscapeString.TestCase' Signed-off-by: Koen Aers --- .../jdbc2cfg/SearchEscapeString/TestCase.java | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/SearchEscapeString/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/SearchEscapeString/TestCase.java index 38ea061ceb..6ace5a31de 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/SearchEscapeString/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/SearchEscapeString/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.SearchEscapeString; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -12,10 +30,9 @@ import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -25,7 +42,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -33,7 +50,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -49,11 +66,11 @@ public void testBasic() throws SQLException { Table table = HibernateUtil.getTable(metadata, JdbcUtil.toIdentifier(this, "B_TAB" ) ); Table table2 = HibernateUtil.getTable(metadata, JdbcUtil.toIdentifier(this, "B2TAB" ) ); - Assert.assertNotNull(table); - Assert.assertNotNull(table2); + assertNotNull(table); + assertNotNull(table2); - Assert.assertEquals(table.getColumnSpan(), 2); - Assert.assertEquals(table2.getColumnSpan(), 2); + assertEquals(table.getColumnSpan(), 2); + assertEquals(table2.getColumnSpan(), 2); } From 2c857275494629601a04678b98382fecde02068b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 09:26:11 +0200 Subject: [PATCH 318/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.TernarySchema.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/TernarySchema/TestCase.java | 67 ++++++++++++------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/TernarySchema/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/TernarySchema/TestCase.java index e4c60b0330..a1742bff20 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/TernarySchema/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/TernarySchema/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.TernarySchema; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.io.File; import java.sql.SQLException; import java.util.ArrayList; @@ -21,13 +39,11 @@ import org.hibernate.tool.hbm2x.visitor.DefaultValueVisitor; import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author max @@ -35,12 +51,12 @@ */ public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File outputFolder = new File("temp"); private MetadataDescriptor metadataDescriptor = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy() { @@ -56,23 +72,22 @@ public List getSchemaSelections() { .createJdbcDescriptor(c, null, true); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } // TODO Investigate the ignored test: HBX-1410 - @Ignore + @Disabled @Test public void testTernaryModel() throws SQLException { assertMultiSchema(metadataDescriptor.createMetadata()); } // TODO Investigate the ignored test: HBX-1410 - @Ignore + @Disabled @Test public void testGeneration() { - File outputFolder = temporaryFolder.getRoot(); HibernateMappingExporter hme = new HibernateMappingExporter(); hme.setMetadataDescriptor(metadataDescriptor); hme.setOutputDirectory(outputFolder); @@ -80,7 +95,7 @@ public void testGeneration() { JUnitUtil.assertIsNonEmptyFile( new File(outputFolder, "Role.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile( new File(outputFolder, "User.hbm.xml") ); JUnitUtil.assertIsNonEmptyFile( new File(outputFolder, "Plainrole.hbm.xml") ); - Assert.assertEquals(3, outputFolder.listFiles().length); + assertEquals(3, outputFolder.listFiles().length); File[] files = new File[3]; files[0] = new File(outputFolder, "Role.hbm.xml"); files[0] = new File(outputFolder, "User.hbm.xml"); @@ -96,28 +111,28 @@ private void assertMultiSchema(Metadata metadata) { metadata.getEntityBindings().iterator(), 5); final PersistentClass role = metadata.getEntityBinding("Role"); - Assert.assertNotNull(role); + assertNotNull(role); PersistentClass userroles = metadata.getEntityBinding("Userroles"); - Assert.assertNotNull(userroles); + assertNotNull(userroles); PersistentClass user = metadata.getEntityBinding("User"); - Assert.assertNotNull(user); + assertNotNull(user); PersistentClass plainRole = metadata.getEntityBinding("Plainrole"); - Assert.assertNotNull(plainRole); + assertNotNull(plainRole); Property property = role.getProperty("users"); - Assert.assertEquals(role.getTable().getSchema(), "OTHERSCHEMA"); - Assert.assertNotNull(property); + assertEquals(role.getTable().getSchema(), "OTHERSCHEMA"); + assertNotNull(property); property.getValue().accept(new DefaultValueVisitor(true) { public Object accept(Set o) { - Assert.assertEquals(o.getCollectionTable().getSchema(), "THIRDSCHEMA"); + assertEquals(o.getCollectionTable().getSchema(), "THIRDSCHEMA"); return null; } }); property = plainRole.getProperty("users"); - Assert.assertEquals(role.getTable().getSchema(), "OTHERSCHEMA"); - Assert.assertNotNull(property); + assertEquals(role.getTable().getSchema(), "OTHERSCHEMA"); + assertNotNull(property); property.getValue().accept(new DefaultValueVisitor(true) { public Object accept(Set o) { - Assert.assertEquals(o.getCollectionTable().getSchema(), null); + assertEquals(o.getCollectionTable().getSchema(), null); return null; } }); From 91d3a1e336eb2e9e74a7f9c5f6426b906e31adba Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 11:49:42 +0200 Subject: [PATCH 319/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Versioning' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Versioning/TestCase.java | 69 ++++++++++++------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java index 36d36210c9..d451472d67 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java @@ -1,9 +1,29 @@ /* - * Created on 2004-11-24 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Versioning; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.io.File; import org.hibernate.boot.Metadata; @@ -18,12 +38,10 @@ import org.hibernate.type.IntegerType; import org.hibernate.type.RowVersionType; import org.hibernate.type.TimestampType; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * To be extended by VersioningForJDK50Test for the JPA generation part @@ -35,10 +53,10 @@ public class TestCase { private Metadata metadata = null; private MetadataDescriptor metadataDescriptor = null; - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File testFolder = new File("test"); - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadataDescriptor = MetadataDescriptorFactory @@ -47,7 +65,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this);; } @@ -56,17 +74,16 @@ public void tearDown() { public void testVersion() { PersistentClass cl = metadata.getEntityBinding("WithVersion"); Property version = cl.getVersion(); - Assert.assertNotNull(version); - Assert.assertEquals("version", version.getName()); + assertNotNull(version); + assertEquals("version", version.getName()); cl = metadata.getEntityBinding("NoVersion"); - Assert.assertNotNull(cl); + assertNotNull(cl); version = cl.getVersion(); - Assert.assertNull(version); + assertNull(version); } @Test public void testGenerateMappings() { - File testFolder = temporaryFolder.getRoot(); Exporter exporter = new HibernateMappingExporter(); exporter.setMetadataDescriptor(metadataDescriptor); exporter.setOutputDirectory(testFolder); @@ -81,24 +98,24 @@ public void testGenerateMappings() { .createMetadata(); PersistentClass cl = metadata.getEntityBinding( "WithVersion" ); Property version = cl.getVersion(); - Assert.assertNotNull(version); - Assert.assertEquals("version", version.getName()); + assertNotNull(version); + assertEquals("version", version.getName()); cl = metadata.getEntityBinding( "NoVersion" ); - Assert.assertNotNull(cl); + assertNotNull(cl); version = cl.getVersion(); - Assert.assertNull(version); + assertNull(version); cl = metadata.getEntityBinding( "WithRealTimestamp" ); - Assert.assertNotNull(cl); + assertNotNull(cl); version = cl.getVersion(); - Assert.assertNotNull(version); - Assert.assertTrue( + assertNotNull(version); + assertTrue( version.getType() instanceof TimestampType || version.getType() instanceof RowVersionType); // on MS SQL Server cl = metadata.getEntityBinding( "WithFakeTimestamp" ); - Assert.assertNotNull(cl); + assertNotNull(cl); version = cl.getVersion(); - Assert.assertNotNull(version); - Assert.assertTrue( + assertNotNull(version); + assertTrue( version.getType() instanceof IntegerType || version.getType() instanceof BigDecimalType); // on Oracle } From 39336b6f311be11671003a9c5821aadd45c296b4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 13:43:09 +0200 Subject: [PATCH 320/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.stat.Statistics.TestCase' Signed-off-by: Koen Aers --- .../hibernate/tool/stat/Statistics/Group.java | 20 ++++++++++++- .../stat/Statistics/SessionAttribute.java | 20 ++++++++++++- .../tool/stat/Statistics/TestCase.java | 29 +++++++++++++++---- .../hibernate/tool/stat/Statistics/User.java | 20 ++++++++++++- 4 files changed, 81 insertions(+), 8 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/Group.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/Group.java index 3e0f748c97..864ad6025d 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/Group.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/Group.java @@ -1,4 +1,22 @@ -//$Id: Group.java 5686 2005-02-12 07:27:32Z steveebersole $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.stat.Statistics; import java.util.HashSet; diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/SessionAttribute.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/SessionAttribute.java index 20e7ffa6cd..b6de132772 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/SessionAttribute.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/SessionAttribute.java @@ -1,4 +1,22 @@ -//$Id: SessionAttribute.java 5686 2005-02-12 07:27:32Z steveebersole $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.stat.Statistics; diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java index 471e6e3592..a86b718270 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.stat.Statistics; import org.hibernate.Session; @@ -7,18 +26,18 @@ import org.hibernate.boot.MetadataSources; import org.hibernate.tool.stat.StatisticsBrowser; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/User.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/User.java index 65bc88a005..3fb975a14d 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/User.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/User.java @@ -1,4 +1,22 @@ -//$Id: User.java 5686 2005-02-12 07:27:32Z steveebersole $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.stat.Statistics; import java.util.HashSet; From 76914b6134196d58de1c34fe77f8bdc266cd94e3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 14:07:09 +0200 Subject: [PATCH 321/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove class 'org.hibernate.tool.test.db.h2.TestSuiteJUnit4' Signed-off-by: Koen Aers --- .../hibernate/tool/test/db/h2/TestSuiteJUnit4.java | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java diff --git a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java deleted file mode 100644 index b9b86c3598..0000000000 --- a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJUnit4.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.hibernate.tool.test.db.h2; - -import org.hibernate.tools.test.util.DbSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(DbSuite.class) -@SuiteClasses({ - org.hibernate.tool.test.db.CommonTestSuite.class -}) -public class TestSuiteJUnit4 {} From 98398c4feca0c204755eb9b4d4339a9bc4bc99df Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 8 Jul 2021 14:23:26 +0200 Subject: [PATCH 322/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependencies on 'junit' and 'junit-vintage-engine' from pom.xml Signed-off-by: Koen Aers --- test/h2/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e041b172df..04c0c8b031 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -16,10 +16,6 @@ Hibernate Tools H2 Tests Project - - junit - junit - com.h2database h2 @@ -32,10 +28,6 @@ org.junit.jupiter junit-jupiter-engine - - org.junit.vintage - junit-vintage-engine - From d72090971954d7cc1583b8dffdf601680ece5e50 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 9 Jul 2021 11:02:50 +0200 Subject: [PATCH 323/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename 'org.hibernate.tool.test.db.h2.TestSuiteJupiter' to 'org.hibernate.tool.test.db.h2.TestSuite' Signed-off-by: Koen Aers --- .../tool/test/db/h2/{TestSuiteJupiter.java => TestSuite.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/h2/src/test/java/org/hibernate/tool/test/db/h2/{TestSuiteJupiter.java => TestSuite.java} (96%) diff --git a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java similarity index 96% rename from test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java rename to test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java index 21b632d197..23dd25f664 100644 --- a/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuiteJupiter.java +++ b/test/h2/src/test/java/org/hibernate/tool/test/db/h2/TestSuite.java @@ -22,7 +22,7 @@ import org.hibernate.tool.test.db.DbTestSuite; import org.junit.jupiter.api.Nested; -public class TestSuiteJupiter { +public class TestSuite { @Nested public class H2TestSuite extends DbTestSuite {} From 1c0ebfe51b4004d0fed565ae6cc1dd658e7c3643 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 9 Jul 2021 13:48:03 +0200 Subject: [PATCH 324/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Create test suite 'org.hibernate.tool.test.db.oracle.TestSuiteJupiter' incorporating the common database tests for Oracle Signed-off-by: Koen Aers --- test/oracle/pom.xml | 10 ++++++- .../tool/test/db/oracle/TestSuiteJupiter.java | 30 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 90e7d741a2..4812fe39df 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -28,6 +28,14 @@ org.hibernate hibernate-tools-tests-common - + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + + diff --git a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java new file mode 100644 index 0000000000..e7e9c740ef --- /dev/null +++ b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java @@ -0,0 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.test.db.oracle; + +import org.hibernate.tool.test.db.DbTestSuite; +import org.junit.jupiter.api.Nested; + +public class TestSuiteJupiter { + + @Nested + public class OracleTestSuite extends DbTestSuite {} + +} From 858ff8fb79068f3c9603276cd794082c5f76a99f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 9 Jul 2021 16:58:36 +0200 Subject: [PATCH 325/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.cfg.reveng.dialect.TestCase' Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/TestCase.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) rename test/oracle/src/{main => test}/java/org/hibernate/cfg/reveng/dialect/TestCase.java (84%) diff --git a/test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java b/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java similarity index 84% rename from test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java rename to test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java index dab7e9b9b9..f973fa644e 100644 --- a/test/oracle/src/main/java/org/hibernate/cfg/reveng/dialect/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java @@ -1,5 +1,12 @@ package org.hibernate.cfg.reveng.dialect; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; @@ -9,23 +16,16 @@ import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.service.ServiceRegistry; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.Iterator; -import java.util.Map; -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.assertThat; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class TestCase { private Properties properties = null; private ServiceRegistry serviceRegistry; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); properties = Environment.getProperties(); @@ -33,7 +33,7 @@ public void setUp() { serviceRegistry = ssrb.build(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -76,12 +76,12 @@ private void assertSqlTypeLengths(MetaDataDialect dialect, String columnName, St boolean found = false; while (columns.hasNext()) { Map column = columns.next(); - assertThat(column.get("COLUMN_NAME"), equalTo(columnName.toUpperCase())); - assertThat(column.get("TYPE_NAME"), equalTo(typeName)); - assertThat(column.get("COLUMN_SIZE"), equalTo(columnSize)); - assertThat(column.get("DECIMAL_DIGITS"), equalTo(decimalDigits)); + assertEquals(column.get("COLUMN_NAME"),columnName.toUpperCase()); + assertEquals(column.get("TYPE_NAME"), typeName); + assertEquals(column.get("COLUMN_SIZE"), columnSize); + assertEquals(column.get("DECIMAL_DIGITS"), decimalDigits); found = true; } - assertThat("Expected column '" + columnName + "'to exist.", found, equalTo(true)); + assertTrue(found, "Expected column '" + columnName + "'to exist."); } } From 067c54293bd7083e026f3ad99d3ef2a1780b8d50 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 10 Jul 2021 22:32:38 +0200 Subject: [PATCH 326/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.CompositeIdOrder.TestCase' Signed-off-by: Koen Aers --- .../jdbc2cfg/CompositeIdOrder/TestCase.java | 82 ---------------- .../cfg/reveng/dialect/TestCase.java | 19 ++++ .../jdbc2cfg/CompositeIdOrder/TestCase.java | 97 +++++++++++++++++++ 3 files changed, 116 insertions(+), 82 deletions(-) delete mode 100644 test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java create mode 100644 test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java diff --git a/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java b/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java deleted file mode 100644 index 33bf9a57e7..0000000000 --- a/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Created on 2004-12-01 - * - */ -package org.hibernate.tool.jdbc2cfg.CompositeIdOrder; - -import java.sql.SQLException; -import java.util.Iterator; - -import org.hibernate.boot.Metadata; -import org.hibernate.mapping.Column; -import org.hibernate.mapping.ForeignKey; -import org.hibernate.mapping.PersistentClass; -import org.hibernate.mapping.Property; -import org.hibernate.mapping.Selectable; -import org.hibernate.mapping.Table; -import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; -import org.hibernate.tools.test.util.HibernateUtil; -import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - - -/** - * @author max - * @author koen - */ -public class TestCase { - - private Metadata metadata = null; - - @Before - public void setUp() { - JdbcUtil.createDatabase(this); - metadata = MetadataDescriptorFactory - .createJdbcDescriptor(null, null, true) - .createMetadata(); - } - - @After - public void tearDown() { - JdbcUtil.dropDatabase(this); - } - - @Test - public void testMultiColumnForeignKeys() throws SQLException { - - Table table = HibernateUtil.getTable(metadata, "COURSE"); - Assert.assertNotNull(table); - ForeignKey foreignKey = HibernateUtil.getForeignKey(table, "FK_COURSE__SCHEDULE"); - Assert.assertNotNull(foreignKey); - - Assert.assertEquals("Schedule", foreignKey.getReferencedEntityName() ); - Assert.assertEquals("COURSE", foreignKey.getTable().getName() ); - - Assert.assertEquals(1,foreignKey.getColumnSpan() ); - Assert.assertEquals(foreignKey.getColumn(0).getName(), "SCHEDULE_KEY"); - - Assert.assertEquals(table.getPrimaryKey().getColumn(0).getName(), "SCHEDULE_KEY"); - Assert.assertEquals(table.getPrimaryKey().getColumn(1).getName(), "REQUEST_KEY"); - - PersistentClass course = metadata.getEntityBinding("Course"); - - Assert.assertEquals(2,course.getIdentifier().getColumnSpan() ); - Iterator columnIterator = course.getIdentifier().getColumnIterator(); - Assert.assertEquals(((Column)(columnIterator.next())).getName(), "SCHEDULE_KEY"); - Assert.assertEquals(((Column)(columnIterator.next())).getName(), "REQUEST_KEY"); - - PersistentClass topic = metadata.getEntityBinding("CourseTopic"); - - Property property = topic.getProperty("course"); - columnIterator = property.getValue().getColumnIterator(); - Assert. assertEquals(((Column)(columnIterator.next())).getName(), "SCHEDULE_KEY"); - Assert.assertEquals(((Column)(columnIterator.next())).getName(), "REQUEST_KEY"); - - } - - -} diff --git a/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java b/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java index f973fa644e..ed3cf4f6e8 100644 --- a/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/cfg/reveng/dialect/TestCase.java @@ -1,3 +1,22 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.cfg.reveng.dialect; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java new file mode 100644 index 0000000000..6ae43a3529 --- /dev/null +++ b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/TestCase.java @@ -0,0 +1,97 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.jdbc2cfg.CompositeIdOrder; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.sql.SQLException; +import java.util.Iterator; + +import org.hibernate.boot.Metadata; +import org.hibernate.mapping.Column; +import org.hibernate.mapping.ForeignKey; +import org.hibernate.mapping.PersistentClass; +import org.hibernate.mapping.Property; +import org.hibernate.mapping.Selectable; +import org.hibernate.mapping.Table; +import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; +import org.hibernate.tools.test.util.HibernateUtil; +import org.hibernate.tools.test.util.JdbcUtil; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * @author max + * @author koen + */ +public class TestCase { + + private Metadata metadata = null; + + @BeforeEach + public void setUp() { + JdbcUtil.createDatabase(this); + metadata = MetadataDescriptorFactory + .createJdbcDescriptor(null, null, true) + .createMetadata(); + } + + @AfterEach + public void tearDown() { + JdbcUtil.dropDatabase(this); + } + + @Test + public void testMultiColumnForeignKeys() throws SQLException { + + Table table = HibernateUtil.getTable(metadata, "COURSE"); + assertNotNull(table); + ForeignKey foreignKey = HibernateUtil.getForeignKey(table, "FK_COURSE__SCHEDULE"); + assertNotNull(foreignKey); + + assertEquals("Schedule", foreignKey.getReferencedEntityName() ); + assertEquals("COURSE", foreignKey.getTable().getName() ); + + assertEquals(1,foreignKey.getColumnSpan() ); + assertEquals(foreignKey.getColumn(0).getName(), "SCHEDULE_KEY"); + + assertEquals(table.getPrimaryKey().getColumn(0).getName(), "SCHEDULE_KEY"); + assertEquals(table.getPrimaryKey().getColumn(1).getName(), "REQUEST_KEY"); + + PersistentClass course = metadata.getEntityBinding("Course"); + + assertEquals(2,course.getIdentifier().getColumnSpan() ); + Iterator columnIterator = course.getIdentifier().getColumnIterator(); + assertEquals(((Column)(columnIterator.next())).getName(), "SCHEDULE_KEY"); + assertEquals(((Column)(columnIterator.next())).getName(), "REQUEST_KEY"); + + PersistentClass topic = metadata.getEntityBinding("CourseTopic"); + + Property property = topic.getProperty("course"); + columnIterator = property.getValue().getColumnIterator(); + assertEquals(((Column)(columnIterator.next())).getName(), "SCHEDULE_KEY"); + assertEquals(((Column)(columnIterator.next())).getName(), "REQUEST_KEY"); + + } + + +} From f1697f2a72a60e7ad3a16ab0600252a35c79267c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 11 Jul 2021 23:58:07 +0200 Subject: [PATCH 327/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Identity.TestCaase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Identity/TestCase.java | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) rename test/oracle/src/{main => test}/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java (51%) diff --git a/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java similarity index 51% rename from test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java rename to test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java index cb7cad2dd6..e10e57365d 100644 --- a/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java @@ -1,9 +1,27 @@ /* - * Created on 2004-11-23 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Identity; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -11,11 +29,10 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * @author max @@ -25,7 +42,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -33,19 +50,19 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } // TODO HBX-1412: Enable the test below and make sure it passes. - @Ignore +// @Disabled @Test public void testIdentity() throws SQLException { PersistentClass classMapping = metadata.getEntityBinding("Autoinc"); - Assert.assertNotNull(classMapping); - Assert.assertEquals( + assertNotNull(classMapping); + assertEquals( "identity", ((SimpleValue)classMapping .getIdentifierProperty() @@ -53,7 +70,7 @@ public void testIdentity() throws SQLException { .getIdentifierGeneratorStrategy()); classMapping = metadata.getEntityBinding("Noautoinc"); - Assert.assertEquals( + assertEquals( "assigned", ((SimpleValue)classMapping .getIdentifierProperty() From 47d3a7382d00a6ff5873139974a9a7fac3e60e31 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 13 Jul 2021 21:23:04 +0200 Subject: [PATCH 328/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Create test suite 'org.hibernate.tool.test.db.hsql.TestSuiteJupiter' incorporating the common database tests for HSQL Signed-off-by: Koen Aers --- test/hsql/pom.xml | 8 +++++ .../tool/test/db/hsql/TestSuiteJupiter.java | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 0ed0317ac8..28c064a57a 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -29,6 +29,14 @@ org.hibernate hibernate-tools-tests-common + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + diff --git a/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java b/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java new file mode 100644 index 0000000000..a6ae3f180c --- /dev/null +++ b/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java @@ -0,0 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.test.db.hsql; + +import org.hibernate.tool.test.db.DbTestSuite; +import org.junit.jupiter.api.Nested; + +public class TestSuiteJupiter { + + @Nested + public class HsqlTestSuite extends DbTestSuite {} + +} From 2dfce9d6314a4f04062e6229f968ca55ed638d17 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 14 Jul 2021 08:35:54 +0200 Subject: [PATCH 329/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove JUnit4 test suite 'org.hibernate.tool.test.db.hsql.TestSuite' Signed-off-by: Koen Aers --- .../org/hibernate/tool/test/db/hsql/TestSuite.java | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java diff --git a/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java b/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java deleted file mode 100644 index c3a5c806fe..0000000000 --- a/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.hibernate.tool.test.db.hsql; - -import org.hibernate.tools.test.util.DbSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(DbSuite.class) -@SuiteClasses({ - org.hibernate.tool.test.db.CommonTestSuite.class -}) -public class TestSuite {} From 496096481ec4b5f3e783e29b4878215a86e6f648 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 15 Jul 2021 00:32:30 +0200 Subject: [PATCH 330/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename 'org.hibernate.tool.test.db.hsql.TestSuiteJupiter' into 'org.hibernate.tool.test.db.hsql.TestSuite' Signed-off-by: Koen Aers --- .../tool/test/db/hsql/{TestSuiteJupiter.java => TestSuite.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/{TestSuiteJupiter.java => TestSuite.java} (96%) diff --git a/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java b/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java similarity index 96% rename from test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java rename to test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java index a6ae3f180c..3dfb23da8f 100644 --- a/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuiteJupiter.java +++ b/test/hsql/src/test/java/org/hibernate/tool/test/db/hsql/TestSuite.java @@ -22,7 +22,7 @@ import org.hibernate.tool.test.db.DbTestSuite; import org.junit.jupiter.api.Nested; -public class TestSuiteJupiter { +public class TestSuite { @Nested public class HsqlTestSuite extends DbTestSuite {} From b1b0142e0e6b6cf27d32efab6ef0672115b29c62 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 16 Jul 2021 22:48:29 +0200 Subject: [PATCH 331/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove 'junit' and 'junit-vintage-engine' dependencies from pom.xml Signed-off-by: Koen Aers --- test/hsql/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 28c064a57a..d21ee0e858 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -17,10 +17,6 @@ Hibernate Tools HSQL Tests Project - - junit - junit - org.hsqldb hsqldb @@ -33,10 +29,6 @@ org.junit.jupiter junit-jupiter-engine - - org.junit.vintage - junit-vintage-engine - From b0fca0224de1a10d08e352189d25e5f5bbda27f3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 17 Jul 2021 18:41:56 +0200 Subject: [PATCH 332/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add 'junit' and 'junit-vintage-engine' dependencies to 'test/mssql/pom.xml' Signed-off-by: Koen Aers --- test/mssql/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 85048bb038..ac9457f012 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -28,6 +28,14 @@ org.hibernate hibernate-tools-tests-common + + org.junit.jupiter + junit-jupiter-engine + + + org.junit.vintage + junit-vintage-engine + From a0040350f256c54fbe5597099e43902854628e31 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 18 Jul 2021 20:08:52 +0200 Subject: [PATCH 333/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Add test suite 'org.hibernate.tool.test.db.sqlserver.TestSuiteJupiter' Signed-off-by: Koen Aers --- .../test/db/sqlserver/TestSuiteJupiter.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java diff --git a/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java b/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java new file mode 100644 index 0000000000..cff71f0401 --- /dev/null +++ b/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java @@ -0,0 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.tool.test.db.sqlserver; + +import org.hibernate.tool.test.db.DbTestSuite; +import org.junit.jupiter.api.Nested; + +public class TestSuiteJupiter { + + @Nested + public class SqlServerTestSuite extends DbTestSuite {} + +} From 991414163f1bb230ea6c3f8cb91a3f96eaa2fcd3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 18 Jul 2021 21:13:38 +0200 Subject: [PATCH 334/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.jdbc2cfg.Identity.TestCaase' for mssql Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Identity/TestCase.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename test/mssql/src/{main => test}/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java (75%) diff --git a/test/mssql/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java b/test/mssql/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java similarity index 75% rename from test/mssql/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java rename to test/mssql/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java index 3d9f6dae29..7ba7df2b0d 100644 --- a/test/mssql/src/main/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java +++ b/test/mssql/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java @@ -4,6 +4,9 @@ */ package org.hibernate.tool.jdbc2cfg.Identity; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -11,11 +14,10 @@ import org.hibernate.mapping.SimpleValue; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * @author max @@ -25,7 +27,7 @@ public class TestCase { private Metadata metadata = null; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); MetadataDescriptorFactory @@ -33,18 +35,18 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } // TODO HBX-1413: Enable the test below - @Ignore + @Disabled @Test public void testIdentity() throws SQLException { PersistentClass classMapping = metadata.getEntityBinding("WithIdentity"); - Assert.assertNotNull(classMapping); - Assert.assertEquals( + assertNotNull(classMapping); + assertEquals( "identity", ((SimpleValue)classMapping .getIdentifierProperty() @@ -53,12 +55,12 @@ public void testIdentity() throws SQLException { } // TODO HBX-1413: Enable the test below - @Ignore + @Disabled @Test public void testGuid() throws SQLException { PersistentClass classMapping = metadata.getEntityBinding("WithGuid"); - Assert.assertNotNull(classMapping); - Assert.assertEquals( + assertNotNull(classMapping); + assertEquals( "guid", ((SimpleValue)classMapping .getIdentifierProperty() From e13b0dfc435c60e92cab49120f106976cc1442e3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 20 Jul 2021 18:15:49 +0200 Subject: [PATCH 335/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove unused test suite 'org.hibernate.tool.test.db.sqlserver.TestSuite' Signed-off-by: Koen Aers --- .../hibernate/tool/test/db/sqlserver/TestSuite.java | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java diff --git a/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java b/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java deleted file mode 100644 index 39cfef5d7f..0000000000 --- a/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.hibernate.tool.test.db.sqlserver; - -import org.hibernate.tools.test.util.DbSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(DbSuite.class) -@SuiteClasses({ - org.hibernate.tool.test.db.CommonTestSuite.class -}) -public class TestSuite {} From f35cd9fd94bf302ee71b5b80de9b25cdbeb708d5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 21 Jul 2021 21:50:08 +0200 Subject: [PATCH 336/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename 'org.hibernate.tool.test.db.sqlserver.TestSuiteJupiter' to 'org.hibernate.tool.test.db.sqlserver.TestSuite' Signed-off-by: Koen Aers --- .../test/db/sqlserver/{TestSuiteJupiter.java => TestSuite.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/{TestSuiteJupiter.java => TestSuite.java} (96%) diff --git a/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java b/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java similarity index 96% rename from test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java rename to test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java index cff71f0401..c3e74df41a 100644 --- a/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuiteJupiter.java +++ b/test/mssql/src/test/java/org/hibernate/tool/test/db/sqlserver/TestSuite.java @@ -22,7 +22,7 @@ import org.hibernate.tool.test.db.DbTestSuite; import org.junit.jupiter.api.Nested; -public class TestSuiteJupiter { +public class TestSuite { @Nested public class SqlServerTestSuite extends DbTestSuite {} From 5fc8e515d9d0b1613600cf9b9832a9fe4e2b7c73 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 4 Sep 2021 10:38:28 +0200 Subject: [PATCH 337/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependencies on 'junit' and 'junit-vintage-engine' from 'test/common' Signed-off-by: Koen Aers --- test/common/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/common/pom.xml b/test/common/pom.xml index 3763d27858..5d6cf57065 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -16,10 +16,6 @@ Hibernate Tools Common Database Tests Project - - junit - junit - jaxen jaxen @@ -37,10 +33,6 @@ junit-jupiter-engine compile - - org.junit.vintage - junit-vintage-engine - From 9e899a870992b0d504db681433d33b93e5f4440f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 6 Sep 2021 08:37:43 +0200 Subject: [PATCH 338/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependencies on 'junit' and 'junit-vintage-engine' from 'test/mssql' Signed-off-by: Koen Aers --- test/mssql/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ac9457f012..55638f84d8 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -16,10 +16,6 @@ Hibernate Tools MS SQL Server Tests Project - - junit - junit - com.microsoft.sqlserver mssql-jdbc @@ -32,10 +28,6 @@ org.junit.jupiter junit-jupiter-engine - - org.junit.vintage - junit-vintage-engine - From b8c83dfa313ea5a1df016085a91db32b41d7434d Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 4 Oct 2021 18:29:58 +0200 Subject: [PATCH 339/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Perform changes in module 'test/mysql' Signed-off-by: Koen Aers --- pom.xml | 4 +- test/mysql/pom.xml | 10 ++--- .../DefaultDatabaseCollector/TestCase.java | 44 ++++++++++--------- .../hbm2x/DefaultSchemaCatalog/TestCase.java | 39 ++++++++-------- .../tool/test/db/mysql/TestSuite.java | 35 +++++++++++---- .../src/test/resources/hibernate.properties | 4 +- 6 files changed, 80 insertions(+), 56 deletions(-) rename test/mysql/src/{main => test}/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java (77%) rename test/mysql/src/{main => test}/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java (80%) diff --git a/pom.xml b/pom.xml index 34f34442d3..81981e089c 100644 --- a/pom.xml +++ b/pom.xml @@ -41,8 +41,8 @@ 2.3.2 1.2.0 4.13.2 - 5.7.1 - 6.0.6 + 5.7.2 + 8.0.22 19.3.0.0 9.2.1.jre8 diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 2c950b99c9..73ec6eb94e 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -16,11 +16,7 @@ Hibernate Tools MySQL Tests Project - - junit - junit - - + mysql mysql-connector-java @@ -28,6 +24,10 @@ org.hibernate hibernate-tools-tests-common + + org.junit.jupiter + junit-jupiter-engine + diff --git a/test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java b/test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java similarity index 77% rename from test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java rename to test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java index c3b9eca2e8..87e2fe2153 100644 --- a/test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java +++ b/test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/TestCase.java @@ -10,6 +10,11 @@ ******************************************************************************/ package org.hibernate.tool.hbm2x.DefaultDatabaseCollector; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -35,11 +40,10 @@ import org.hibernate.service.ServiceRegistry; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** * @author Dmitry Geraskov @@ -47,18 +51,18 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } // TODO Reenable this test (HBX-1401) - @Ignore + @Disabled @Test public void testReadOnlySpecificSchema() { OverrideRepository or = new OverrideRepository(); @@ -68,7 +72,7 @@ public void testReadOnlySpecificSchema() { .createJdbcDescriptor(res, null, true) .createMetadata(); List
tables = getTables(metadata); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("cat.master")) { @@ -77,8 +81,8 @@ public void testReadOnlySpecificSchema() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals(new TableIdentifier(null, "cat.cat", "cat.child"), childid); - Assert.assertEquals(new TableIdentifier(null, "cat.cat", "cat.master"), masterid); + assertEquals(new TableIdentifier(null, "cat.cat", "cat.child"), childid); + assertEquals(new TableIdentifier(null, "cat.cat", "cat.master"), masterid); } @Test @@ -88,9 +92,9 @@ public void testNeedQuote() { ssrb.applySettings(properties); ServiceRegistry serviceRegistry = ssrb.build(); MetaDataDialect realMetaData = MetaDataDialectFactory.createMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), properties); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.cat")); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.child")); - Assert.assertTrue("The name must be quoted!", realMetaData.needQuote("cat.master")); + assertTrue(realMetaData.needQuote("cat.cat"), "The name must be quoted!"); + assertTrue(realMetaData.needQuote("cat.child"), "The name must be quoted!"); + assertTrue(realMetaData.needQuote("cat.master"), "The name must be quoted!"); } /** @@ -102,7 +106,7 @@ public void testNeedQuote() { * but getTable uses non-quoted names ) */ // TODO Reenable this test (HBX-1401) - @Ignore + @Disabled @Test public void testQuotedNamesAndDefaultDatabaseCollector() { Properties properties = Environment.getProperties(); @@ -117,11 +121,11 @@ properties, new DefaultReverseEngineeringStrategy(), DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect()); reader.readDatabaseSchema( dc, null, "cat.cat" ); String defaultCatalog = properties.getProperty(AvailableSettings.DEFAULT_CATALOG); - Assert.assertNotNull("The table should be found", dc.getTable("cat.cat", defaultCatalog, "cat.child")); - Assert.assertNotNull("The table should be found", dc.getTable("cat.cat", defaultCatalog, "cat.master")); - Assert.assertNull("Quoted names should not return the table", dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.child"))); - Assert.assertNull("Quoted names should not return the table", dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.master"))); - Assert.assertEquals("Foreign key 'masterref' was filtered!", 1, dc.getOneToManyCandidates().size()); + assertNotNull(dc.getTable("cat.cat", defaultCatalog, "cat.child"), "The table should be found"); + assertNotNull(dc.getTable("cat.cat", defaultCatalog, "cat.master"), "The table should be found"); + assertNull(dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.child")), "Quoted names should not return the table"); + assertNull(dc.getTable(quote("cat.cat"), defaultCatalog, quote("cat.master")), "Quoted names should not return the table"); + assertEquals(1, dc.getOneToManyCandidates().size(), "Foreign key 'masterref' was filtered!"); } private static String quote(String name) { diff --git a/test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java b/test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java similarity index 80% rename from test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java rename to test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java index 054736c384..87359d00d7 100644 --- a/test/mysql/src/main/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java +++ b/test/mysql/src/test/java/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/TestCase.java @@ -4,6 +4,9 @@ */ package org.hibernate.tool.hbm2x.DefaultSchemaCatalog; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -21,12 +24,10 @@ import org.hibernate.mapping.Table; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; /** @@ -36,17 +37,17 @@ */ public class TestCase { - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } - @Ignore + @Disabled @Test public void testReadOnlySpecificSchema() { OverrideRepository or = new OverrideRepository(); @@ -56,7 +57,7 @@ public void testReadOnlySpecificSchema() { .createJdbcDescriptor(res, null, true) .createMetadata(); List
tables = getTables(metadata); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("CATMASTER")) { @@ -65,11 +66,11 @@ public void testReadOnlySpecificSchema() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals(new TableIdentifier(null, "OVRTEST", "CATMASTER"), masterid); - Assert.assertEquals(new TableIdentifier(null, "OVRTEST", "CATCHILD"), childid); + assertEquals(new TableIdentifier(null, "OVRTEST", "CATMASTER"), masterid); + assertEquals(new TableIdentifier(null, "OVRTEST", "CATCHILD"), childid); } - @Ignore + @Disabled @Test public void testOverlapping() { OverrideRepository or = new OverrideRepository(); @@ -86,12 +87,12 @@ public void testOverlapping() { Table element = iter.next(); boolean added = tables.add(TableIdentifier.create(element)); if(!added) - Assert.fail("duplicate table found for " + element); + fail("duplicate table found for " + element); } - Assert.assertEquals(4,tables.size()); + assertEquals(4,tables.size()); } - @Ignore + @Disabled @Test public void testUseDefault() { Properties properties = new Properties(); @@ -101,7 +102,7 @@ public void testUseDefault() { .createJdbcDescriptor(null, properties, true) .createMetadata(); List
tables = getTables(metadata); - Assert.assertEquals(2,tables.size()); + assertEquals(2,tables.size()); Table catchild = (Table) tables.get(0); Table catmaster = (Table) tables.get(1); if(catchild.getName().equals("CATMASTER")) { @@ -110,8 +111,8 @@ public void testUseDefault() { } TableIdentifier masterid = TableIdentifier.create(catmaster); TableIdentifier childid = TableIdentifier.create(catchild); - Assert.assertEquals("jdbcreader has not nulled out according to default schema", new TableIdentifier(null, null, "CATMASTER"), masterid); - Assert.assertEquals("jdbcreader has not nulled out according to default schema", new TableIdentifier(null, null, "CATCHILD"), childid); + assertEquals(new TableIdentifier(null, null, "CATMASTER"), masterid, "jdbcreader has not nulled out according to default schema"); + assertEquals(new TableIdentifier(null, null, "CATCHILD"), childid, "jdbcreader has not nulled out according to default schema"); } private List
getTables(Metadata metadata) { diff --git a/test/mysql/src/test/java/org/hibernate/tool/test/db/mysql/TestSuite.java b/test/mysql/src/test/java/org/hibernate/tool/test/db/mysql/TestSuite.java index 93d88907ff..79cc65bedd 100644 --- a/test/mysql/src/test/java/org/hibernate/tool/test/db/mysql/TestSuite.java +++ b/test/mysql/src/test/java/org/hibernate/tool/test/db/mysql/TestSuite.java @@ -1,11 +1,30 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.test.db.mysql; -import org.hibernate.tools.test.util.DbSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; +import org.hibernate.tool.test.db.DbTestSuite; +import org.junit.jupiter.api.Nested; -@RunWith(DbSuite.class) -@SuiteClasses({ - org.hibernate.tool.test.db.CommonTestSuite.class -}) -public class TestSuite {} +public class TestSuite { + + @Nested + public class SqlServerTestSuite extends DbTestSuite {} + +} diff --git a/test/mysql/src/test/resources/hibernate.properties b/test/mysql/src/test/resources/hibernate.properties index 0cebc65bb3..c10d836970 100644 --- a/test/mysql/src/test/resources/hibernate.properties +++ b/test/mysql/src/test/resources/hibernate.properties @@ -1,7 +1,7 @@ -hibernate.dialect org.hibernate.dialect.MySQL5InnoDBDialect +hibernate.dialect org.hibernate.dialect.MySQLDialect hibernate.connection.driver_class com.mysql.cj.jdbc.Driver hibernate.connection.username root hibernate.connection.password P@55w0rd -hibernate.connection.url jdbc:mysql://localhost:3306/htt?useSSL=false +hibernate.connection.url jdbc:mysql://localhost:3306/htt?useSSL=false&allowPublicKeyRetrieval=true hibernate.default_catalog htt From eb548a64167d491d46e23c77122d527e5bf79c77 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 18:43:46 +0200 Subject: [PATCH 340/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Move content of 'src/main/' to 'src/test/' in module 'test/h2' Signed-off-by: Koen Aers --- .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/h2/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql (100%) rename test/h2/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql (100%) diff --git a/test/h2/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql similarity index 100% rename from test/h2/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql rename to test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql diff --git a/test/h2/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql b/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql similarity index 100% rename from test/h2/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql rename to test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql From 155e6fdc4f72a708cc5c58925ce1e78dd88d1cfd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sat, 9 Oct 2021 09:32:38 +0200 Subject: [PATCH 341/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Move content of 'src/main/' to 'src/test/' in module 'test/hsql' Signed-off-by: Koen Aers --- .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/hsql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql (100%) rename test/hsql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql (100%) diff --git a/test/hsql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/hsql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql similarity index 100% rename from test/hsql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql rename to test/hsql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql diff --git a/test/hsql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql b/test/hsql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql similarity index 100% rename from test/hsql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql rename to test/hsql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql From 077d423a0be43358ad09e55b16328a400f8db0a0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Sun, 10 Oct 2021 22:08:41 +0200 Subject: [PATCH 342/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Move content of 'src/main/' to 'src/test/' in module 'test/mysql' Signed-off-by: Koen Aers --- .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql | 0 .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql | 0 .../hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml | 0 .../org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql | 0 .../resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql (100%) rename test/mysql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql (100%) diff --git a/test/mysql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql b/test/mysql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql rename to test/mysql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql b/test/mysql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql rename to test/mysql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml b/test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml rename to test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml diff --git a/test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql b/test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql rename to test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql b/test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql rename to test/mysql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql b/test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql rename to test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql b/test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql rename to test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql rename to test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql b/test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql rename to test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql diff --git a/test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql b/test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql similarity index 100% rename from test/mysql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql rename to test/mysql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql From ae618e5a3f576a9241bbd839e531fae7cdaf7aca Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 11 Oct 2021 11:27:41 +0200 Subject: [PATCH 343/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Move content of 'src/main/' to 'src/test/' in module 'test/mssql' Signed-off-by: Koen Aers --- .../resources/org/hibernate/tool/ant/AntHibernateTool/create.sql | 0 .../resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql | 0 .../resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql | 0 .../resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql | 0 .../tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql | 0 .../tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql | 0 .../org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql | 0 .../org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql | 0 .../ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql | 0 .../ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql | 0 .../resources/org/hibernate/tool/ant/EJB3Configuration/create.sql | 0 .../resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql | 0 .../org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql | 0 .../org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql | 0 .../resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql | 0 .../resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql | 0 .../resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql | 0 .../resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql | 0 .../resources/org/hibernate/tool/ant/JPAPUnit/create.sql | 0 .../resources/org/hibernate/tool/ant/JPAPUnit/drop.sql | 0 .../org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql | 0 .../org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql | 0 .../resources/org/hibernate/tool/ant/Query/create.sql | 0 .../resources/org/hibernate/tool/ant/Query/drop.sql | 0 .../resources/org/hibernate/tool/cfg/DriverMetaData/create.sql | 0 .../resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql | 0 .../org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql | 0 .../org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql | 0 .../resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql | 0 .../resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql | 0 .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql | 0 .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql | 0 .../org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql | 0 .../org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql | 0 .../org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql | 0 .../resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql | 0 .../tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql | 0 .../hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql | 0 .../org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql | 0 .../org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql | 0 .../org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql | 0 .../resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql | 0 .../org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql | 0 .../org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql | 0 .../org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql | 0 .../resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Index/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql | 0 .../org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql | 0 .../resources/org/hibernate/tool/stat/Statistics/create.sql | 0 .../resources/org/hibernate/tool/stat/Statistics/drop.sql | 0 86 files changed, 0 insertions(+), 0 deletions(-) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/AntHibernateTool/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/EJB3Configuration/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPAPUnit/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPAPUnit/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Query/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/ant/Query/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/cfg/DriverMetaData/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/stat/Statistics/create.sql (100%) rename test/mssql/src/{main => test}/resources/org/hibernate/tool/stat/Statistics/drop.sql (100%) diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/AntHibernateTool/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/AntHibernateTool/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/AntHibernateTool/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmNoError/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmNoError/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithCustomReverseNamingStrategy/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageName/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Cfg2HbmWithPackageNameAndReverseNamingStrategy/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/EJB3Configuration/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/EJB3Configuration/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/EJB3Configuration/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/EJB3Configuration/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/EJB3Configuration/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfigWithRevEngXml/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfiguration/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JDBCConfiguration/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPABogusPUnit/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPABogusPUnit/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPUnit/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPUnit/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPUnit/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPUnit/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPUnit/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPUnit/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPUnit/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPUnit/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/JPAPropertyOverridesPUnit/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Query/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Query/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Query/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Query/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/ant/Query/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/ant/Query/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/ant/Query/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/ant/Query/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/cfg/DriverMetaData/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/cfg/DriverMetaData/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/cfg/DriverMetaData/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/cfg/DriverMetaData/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/cfg/DriverMetaData/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/CachedMetaData/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/CachedMetaData/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBC/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/GenerateFromJDBCWithJavaKeyword/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/IncrementalSchemaReading/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/JdbcHbm2JavaEjb3/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbm2x/query/QueryExporterTest/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/AutoQuote/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Basic/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Basic/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/data.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeId/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ForeignKeys/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Index/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/data.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/ManyToMany/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/MetaData/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/MetaData/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/NoPrimaryKey/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OneToOne/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OneToOne/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Performance/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Performance/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/SearchEscapeString/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/jdbc2cfg/Versioning/drop.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/stat/Statistics/create.sql b/test/mssql/src/test/resources/org/hibernate/tool/stat/Statistics/create.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/stat/Statistics/create.sql rename to test/mssql/src/test/resources/org/hibernate/tool/stat/Statistics/create.sql diff --git a/test/mssql/src/main/resources/org/hibernate/tool/stat/Statistics/drop.sql b/test/mssql/src/test/resources/org/hibernate/tool/stat/Statistics/drop.sql similarity index 100% rename from test/mssql/src/main/resources/org/hibernate/tool/stat/Statistics/drop.sql rename to test/mssql/src/test/resources/org/hibernate/tool/stat/Statistics/drop.sql From 2c730bc400c3169c8c65d3abbad5fa5e2ccc4ecf Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 11 Oct 2021 23:36:26 +0200 Subject: [PATCH 344/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Move content of 'src/main/' to 'src/test/' in module 'test/oracle' Signed-off-by: Koen Aers --- .../java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java | 0 .../resources/org/hibernate/cfg/reveng/dialect/create.sql | 0 .../resources/org/hibernate/cfg/reveng/dialect/drop.sql | 0 .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql | 0 .../org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql | 0 .../org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql | 0 .../org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql | 0 .../hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml | 0 .../org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql | 0 .../org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql | 0 .../org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Views/create.sql | 0 .../resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql | 0 19 files changed, 0 insertions(+), 0 deletions(-) rename test/oracle/src/{main => test}/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/cfg/reveng/dialect/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/cfg/reveng/dialect/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Views/create.sql (100%) rename test/oracle/src/{main => test}/resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql (100%) diff --git a/test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java similarity index 100% rename from test/oracle/src/main/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java rename to test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java diff --git a/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql b/test/oracle/src/test/resources/org/hibernate/cfg/reveng/dialect/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/create.sql rename to test/oracle/src/test/resources/org/hibernate/cfg/reveng/dialect/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql b/test/oracle/src/test/resources/org/hibernate/cfg/reveng/dialect/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/cfg/reveng/dialect/drop.sql rename to test/oracle/src/test/resources/org/hibernate/cfg/reveng/dialect/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultDatabaseCollector/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/hbm2x/DefaultSchemaCatalog/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml b/test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml rename to test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/BasicMultiSchema/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/CompositeIdOrder/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/PersistentClasses/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/TernarySchema/drop.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Views/create.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Views/create.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Views/create.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Views/create.sql diff --git a/test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql b/test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql similarity index 100% rename from test/oracle/src/main/resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql rename to test/oracle/src/test/resources/org/hibernate/tool/jdbc2cfg/Views/drop.sql From 4046b220f8231a1e0164fe73a93c8e87fd0a1e87 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 12 Oct 2021 21:26:44 +0200 Subject: [PATCH 345/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'junit.junit' Signed-off-by: Koen Aers --- test/oracle/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 4812fe39df..be9f6871ec 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -16,10 +16,6 @@ Hibernate Tools Oracle Tests Project - - junit - junit - com.oracle.ojdbc ojdbc8 From d415ef22803854a62bb22922cd53d71525717889 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 12 Oct 2021 21:46:34 +0200 Subject: [PATCH 346/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'org.junit.vintage.junit-vintage-engine' from 'test/oracle' Signed-off-by: Koen Aers --- test/oracle/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index be9f6871ec..10ab6a8ec0 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -28,10 +28,6 @@ org.junit.jupiter junit-jupiter-engine - - org.junit.vintage - junit-vintage-engine - From 7b6f9bb637ab0157f163260593039963d5435fad Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 12 Oct 2021 22:08:15 +0200 Subject: [PATCH 347/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Cleanup of 'org.hibernate.tool.jdbc2cfg.Identity.TestCase' Signed-off-by: Koen Aers --- .../test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java | 1 - 1 file changed, 1 deletion(-) diff --git a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java index e10e57365d..c7b805bcb3 100644 --- a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Identity/TestCase.java @@ -31,7 +31,6 @@ import org.hibernate.tools.test.util.JdbcUtil; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** From 0f40115b918e1ec839f185fc9efd9be892d727ad Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 12 Oct 2021 22:37:46 +0200 Subject: [PATCH 348/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Perform changes in 'org.hibernate.tool.jdbc2cfg.Views.TestCase' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/Views/TestCase.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java index cade7f0a1e..87ace7fb7a 100644 --- a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java @@ -4,6 +4,11 @@ */ package org.hibernate.tool.jdbc2cfg.Views; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + import java.sql.SQLException; import org.hibernate.boot.Metadata; @@ -12,12 +17,9 @@ import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; import org.hibernate.tools.test.util.HibernateUtil; import org.hibernate.tools.test.util.JdbcUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - - +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @author max @@ -27,7 +29,7 @@ public class TestCase { private Metadata metadata; - @Before + @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); metadata = MetadataDescriptorFactory @@ -35,7 +37,7 @@ public void setUp() { .createMetadata(); } - @After + @AfterEach public void tearDown() { JdbcUtil.dropDatabase(this); } @@ -44,19 +46,19 @@ public void tearDown() { public void testViewAndSynonyms() throws SQLException { PersistentClass classMapping = metadata.getEntityBinding("Basicview"); - Assert.assertNotNull(classMapping); + assertNotNull(classMapping); classMapping = metadata.getEntityBinding("Weirdname"); - Assert.assertTrue("If this is not-null synonyms apparently work!",classMapping==null); + assertTrue(classMapping==null, "If this is not-null synonyms apparently work!"); // get comments Table table = HibernateUtil.getTable(metadata, "BASIC"); - Assert.assertEquals("a basic comment", table.getComment()); - Assert.assertEquals("a solid key", table.getPrimaryKey().getColumn(0).getComment()); + assertEquals("a basic comment", table.getComment()); + assertEquals("a solid key", table.getPrimaryKey().getColumn(0).getComment()); table = HibernateUtil.getTable(metadata, "MULTIKEYED"); - Assert.assertNull(table.getComment()); - Assert.assertNull(table.getColumn(0).getComment()); + assertNull(table.getComment()); + assertNull(table.getColumn(0).getComment()); } From 32aa47ec0cb8724c275efdf85e8d629400404b9c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 11:24:32 +0200 Subject: [PATCH 349/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove class 'org.hibernate.tool.test.db.oracle.TestSuite' Signed-off-by: Koen Aers --- .../hibernate/tool/jdbc2cfg/Views/TestCase.java | 17 ++++++++++++++++- .../tool/test/db/oracle/TestSuite.java | 14 -------------- 2 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java diff --git a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java index 87ace7fb7a..6134bb0207 100644 --- a/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java +++ b/test/oracle/src/test/java/org/hibernate/tool/jdbc2cfg/Views/TestCase.java @@ -1,6 +1,21 @@ /* - * Created on 2004-12-01 + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.hibernate.tool.jdbc2cfg.Views; diff --git a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java deleted file mode 100644 index c0aec0a645..0000000000 --- a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.hibernate.tool.test.db.oracle; - -import org.hibernate.tools.test.util.DbSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(DbSuite.class) -@SuiteClasses({ - org.hibernate.cfg.reveng.dialect.TestCase.class, - org.hibernate.tool.jdbc2cfg.CompositeIdOrder.TestCase.class, - org.hibernate.tool.jdbc2cfg.Views.TestCase.class, - org.hibernate.tool.test.db.CommonTestSuite.class -}) -public class TestSuite {} From 3b6554be5bfa6815ec1f8b3e7addeeae807d4dfd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 11:41:21 +0200 Subject: [PATCH 350/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Rename class 'org.hibernate.tool.test.db.oracle.TestSuiteJupiter' into 'org.hibernate.tool.test.db.oracle.TestSuite' Signed-off-by: Koen Aers --- .../test/db/oracle/{TestSuiteJupiter.java => TestSuite.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/{TestSuiteJupiter.java => TestSuite.java} (96%) diff --git a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java similarity index 96% rename from test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java rename to test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java index e7e9c740ef..9516b2b21c 100644 --- a/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuiteJupiter.java +++ b/test/oracle/src/test/java/org/hibernate/tool/test/db/oracle/TestSuite.java @@ -22,7 +22,7 @@ import org.hibernate.tool.test.db.DbTestSuite; import org.junit.jupiter.api.Nested; -public class TestSuiteJupiter { +public class TestSuite { @Nested public class OracleTestSuite extends DbTestSuite {} From 9059abfcc0cd1b26af305a983f089661abaa768a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 12:06:12 +0200 Subject: [PATCH 351/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove the unneeded class 'org.hibernate.tools.test.util.DbSuite' and test class 'org.hibernate.tools.test.util.DbSuiteTest' Signed-off-by: Koen Aers --- .../hibernate/tools/test/util/DbSuite.java | 60 ------ .../tools/test/util/DbSuiteTest.java | 171 ------------------ 2 files changed, 231 deletions(-) delete mode 100644 test/utils/src/main/java/org/hibernate/tools/test/util/DbSuite.java delete mode 100644 test/utils/src/test/java/org/hibernate/tools/test/util/DbSuiteTest.java diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/DbSuite.java b/test/utils/src/main/java/org/hibernate/tools/test/util/DbSuite.java deleted file mode 100644 index a14671a4bf..0000000000 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/DbSuite.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.hibernate.tools.test.util; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; - -public class DbSuite extends Suite { - - public static final String SQL_SCRIPT_ROOT = "org.hibernate.tools.test.db.sqlScriptRoot"; - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE) - @Inherited - public @interface SqlScriptRoot { - public String value(); - } - - boolean ignore = false; - String sqlScriptRoot; - - public DbSuite(Class klass, RunnerBuilder builder) throws InitializationError { - super(klass, builder); - ignore = !JdbcUtil.isDatabaseOnline(); - setSqlScriptRoot(klass); - } - - @Override - protected void runChild(Runner runner, final RunNotifier notifier) { - if (!ignore) { - if (sqlScriptRoot != null) { - System.setProperty( - SQL_SCRIPT_ROOT, - sqlScriptRoot); - } - runner.run(notifier); - if (sqlScriptRoot != null) { - System.getProperties().remove( - SQL_SCRIPT_ROOT); - } - } else { - notifier.fireTestIgnored(getDescription()); - } - } - - private void setSqlScriptRoot(Class klass) { - SqlScriptRoot annotation = klass.getAnnotation(SqlScriptRoot.class); - if (annotation != null) { - sqlScriptRoot = annotation.value(); - } - } - -} diff --git a/test/utils/src/test/java/org/hibernate/tools/test/util/DbSuiteTest.java b/test/utils/src/test/java/org/hibernate/tools/test/util/DbSuiteTest.java deleted file mode 100644 index 11e6986817..0000000000 --- a/test/utils/src/test/java/org/hibernate/tools/test/util/DbSuiteTest.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.hibernate.tools.test.util; - -import java.io.File; -import java.io.FileWriter; -import java.net.URL; -import java.net.URLClassLoader; -import java.util.Properties; - -import org.hibernate.tools.test.util.DbSuite.SqlScriptRoot; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.Description; -import org.junit.runner.RunWith; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunListener; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite.SuiteClasses; -import org.junit.runners.model.RunnerBuilder; - - -public class DbSuiteTest { - - private class DummyRunner extends Runner { - @Override - public Description getDescription() { - return Description.EMPTY; - } - @Override - public void run(RunNotifier notifier) { - sqlScriptRoot = System.getProperty(DbSuite.SQL_SCRIPT_ROOT); - notifier.fireTestStarted(getDescription());; - } - } - - private class DummyListener extends RunListener { - boolean isStarted = false; - boolean isIgnored = false; - public void testStarted(Description description) throws Exception { - isStarted = true; - } - public void testIgnored(Description description) throws Exception { - isIgnored = true; - } - } - - public class DummyTest { - @Test - public void testDummy() { - Assert.assertTrue(true); - } - } - - @RunWith(DbSuite.class) - @SuiteClasses(DummyTest.class) - public class FirstSuite {} - - @RunWith(DbSuite.class) - @SuiteClasses(DummyTest.class) - @SqlScriptRoot("foo.bar") - public class SecondSuite {} - - private class TestRunnerBuilder extends RunnerBuilder { - @Override - public Runner runnerForClass(Class testClass) throws Throwable { - return null; - } - } - - private DbSuite dbSuite; - private String sqlScriptRoot = null; - - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); - - @Before - public void setUp() throws Exception { - createHibernateProperties("sa", "", "jdbc:h2:mem:test"); - setUpClassLoader(); - } - - @After - public void tearDown() throws Exception { - restoreClassLoader(); - } - - @Test - public void testDbSuiteConstruction() throws Exception { - dbSuite = new DbSuite(FirstSuite.class, new TestRunnerBuilder()); - Assert.assertNull(dbSuite.sqlScriptRoot); - Assert.assertFalse(dbSuite.ignore); - dbSuite = new DbSuite(SecondSuite.class, new TestRunnerBuilder()); - Assert.assertEquals("foo.bar", dbSuite.sqlScriptRoot); - Assert.assertFalse(dbSuite.ignore); - new File(temporaryFolder.getRoot(), "hibernate.properties").delete(); - createHibernateProperties("foo", "bar", "jdbc:sqlserver://org.foo.bar:1433"); - dbSuite = new DbSuite(FirstSuite.class, new TestRunnerBuilder()); - Assert.assertNull(dbSuite.sqlScriptRoot); - Assert.assertTrue(dbSuite.ignore); - dbSuite = new DbSuite(SecondSuite.class, new TestRunnerBuilder()); - Assert.assertEquals("foo.bar", dbSuite.sqlScriptRoot); - Assert.assertTrue(dbSuite.ignore); - } - - @Test - public void testRunChild() throws Exception { - dbSuite = new DbSuite(FirstSuite.class, new TestRunnerBuilder()); - Runner runner = new DummyRunner(); - RunNotifier notifier = new RunNotifier(); - DummyListener listener = new DummyListener(); - notifier.addListener(listener); - dbSuite.ignore = true; - listener.isStarted = false; - listener.isIgnored = false; - dbSuite.runChild(runner, notifier); - Assert.assertFalse(listener.isStarted); - Assert.assertTrue(listener.isIgnored); - dbSuite.ignore = false; - dbSuite.sqlScriptRoot = null; - listener.isStarted = false; - listener.isIgnored = false; - dbSuite.runChild(runner, notifier); - Assert.assertTrue(listener.isStarted); - Assert.assertFalse(listener.isIgnored); - Assert.assertNull(sqlScriptRoot); - dbSuite.ignore = false; - dbSuite.sqlScriptRoot = "foo.bar"; - listener.isStarted = false; - listener.isIgnored = false; - dbSuite.runChild(runner, notifier); - Assert.assertTrue(listener.isStarted); - Assert.assertFalse(listener.isIgnored); - Assert.assertEquals("foo.bar", sqlScriptRoot); - } - - private void createHibernateProperties( - String user, - String password, - String url) - throws Exception { - Properties properties = new Properties(); - properties.put("hibernate.connection.username", user); - properties.put("hibernate.connection.password", password); - properties.put("hibernate.connection.url", url); - File outputFolder = temporaryFolder.getRoot(); - File propertiesFile = new File(outputFolder, "hibernate.properties"); - FileWriter writer = new FileWriter(propertiesFile); - properties.store(writer, null); - writer.close(); - } - - private void setUpClassLoader() throws Exception { - ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader( - new URLClassLoader( - new URL[] { temporaryFolder.getRoot().toURI().toURL() }, - currentClassLoader)); - } - - private void restoreClassLoader() { - URLClassLoader currentClassLoader = - (URLClassLoader)Thread.currentThread().getContextClassLoader(); - Thread.currentThread().setContextClassLoader(currentClassLoader.getParent()); - } - - - -} From b8d34cf2a20549007d4cb51ab7f54a2c15a33d84 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 12:45:31 +0200 Subject: [PATCH 352/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Perform change for 'org.hibernate.tools.test.util.ConnectionLeakUtil' Signed-off-by: Koen Aers --- .../org/hibernate/tools/test/util/ConnectionLeakUtil.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java index 82858df7ef..37d6200b84 100644 --- a/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java +++ b/test/utils/src/main/java/org/hibernate/tools/test/util/ConnectionLeakUtil.java @@ -6,7 +6,7 @@ import java.sql.SQLException; import java.sql.Statement; -import org.junit.Assert; +import org.opentest4j.AssertionFailedError; public class ConnectionLeakUtil { @@ -26,7 +26,9 @@ public void initialize() { public void assertNoLeaks() { int leaked = getLeakedConnectionCount(); - Assert.assertTrue(leaked + " connections are leaked.", leaked == 0); + if (leaked != 0) { + throw new AssertionFailedError(leaked + " connections are leaked."); + } } private int getLeakedConnectionCount() { From fc2496813c204267b438da55d4cea680cdca7eff Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 13:00:06 +0200 Subject: [PATCH 353/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove the unneeded class 'org.hibernate.tool.test.db.CommonTestSuite' Signed-off-by: Koen Aers --- .../tool/test/db/CommonTestSuite.java | 60 ------------------- 1 file changed, 60 deletions(-) delete mode 100644 test/common/src/main/java/org/hibernate/tool/test/db/CommonTestSuite.java diff --git a/test/common/src/main/java/org/hibernate/tool/test/db/CommonTestSuite.java b/test/common/src/main/java/org/hibernate/tool/test/db/CommonTestSuite.java deleted file mode 100644 index 828096dd0f..0000000000 --- a/test/common/src/main/java/org/hibernate/tool/test/db/CommonTestSuite.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.hibernate.tool.test.db; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(Suite.class) -@SuiteClasses({ - org.hibernate.tool.ant.AntHibernateTool.TestCase.class, - org.hibernate.tool.ant.Cfg2HbmNoError.TestCase.class, - org.hibernate.tool.ant.Cfg2HbmWithCustomReverseNamingStrategy.TestCase.class, - org.hibernate.tool.ant.Cfg2HbmWithInvalidReverseNamingStrategy.TestCase.class, - org.hibernate.tool.ant.Cfg2HbmWithPackageName.TestCase.class, - org.hibernate.tool.ant.Cfg2HbmWithPackageNameAndReverseNamingStrategy.TestCase.class, - org.hibernate.tool.ant.EJB3Configuration.TestCase.class, - org.hibernate.tool.ant.GenericExport.TestCase.class, - org.hibernate.tool.ant.Hbm2JavaConfiguration.TestCase.class, - org.hibernate.tool.ant.HbmLint.TestCase.class, - org.hibernate.tool.ant.JDBCConfiguration.TestCase.class, - org.hibernate.tool.ant.JDBCConfigWithRevEngXml.TestCase.class, - org.hibernate.tool.ant.JPABogusPUnit.TestCase.class, - org.hibernate.tool.ant.JPAPropertyOverridesPUnit.TestCase.class, - org.hibernate.tool.ant.JPAPUnit.TestCase.class, - org.hibernate.tool.ant.Properties.TestCase.class, - org.hibernate.tool.ant.Query.TestCase.class, - org.hibernate.tool.ant.SchemaExportWarning.TestCase.class, - org.hibernate.tool.cfg.DriverMetaData.TestCase.class, - org.hibernate.tool.cfg.JDBCMetaDataConfiguration.TestCase.class, - org.hibernate.tool.hbm2x.CachedMetaData.TestCase.class, - org.hibernate.tool.hbm2x.DefaultDatabaseCollector.TestCase.class, - org.hibernate.tool.hbm2x.DefaultSchemaCatalog.TestCase.class, - org.hibernate.tool.hbm2x.GenerateFromJDBC.TestCase.class, - org.hibernate.tool.hbm2x.GenerateFromJDBCWithJavaKeyword.TestCase.class, - org.hibernate.tool.hbm2x.JdbcHbm2JavaEjb3.TestCase.class, - org.hibernate.tool.hbm2x.IncrementalSchemaReading.TestCase.class, - org.hibernate.tool.hbm2x.query.QueryExporterTest.TestCase.class, - org.hibernate.tool.hbmlint.HbmLintTest.TestCase.class, - org.hibernate.tool.hbmlint.SchemaAnalyzer.TestCase.class, - org.hibernate.tool.jdbc2cfg.AutoQuote.TestCase.class, - org.hibernate.tool.jdbc2cfg.Basic.TestCase.class, - org.hibernate.tool.jdbc2cfg.BasicMultiSchema.TestCase.class, - org.hibernate.tool.jdbc2cfg.CompositeId.TestCase.class, - org.hibernate.tool.jdbc2cfg.ForeignKeys.TestCase.class, - org.hibernate.tool.jdbc2cfg.Identity.TestCase.class, - org.hibernate.tool.jdbc2cfg.Index.TestCase.class, - org.hibernate.tool.jdbc2cfg.KeyPropertyCompositeId.TestCase.class, - org.hibernate.tool.jdbc2cfg.ManyToMany.TestCase.class, - org.hibernate.tool.jdbc2cfg.MetaData.TestCase.class, - org.hibernate.tool.jdbc2cfg.NoPrimaryKey.TestCase.class, - org.hibernate.tool.jdbc2cfg.OneToOne.TestCase.class, - org.hibernate.tool.jdbc2cfg.OverrideBinder.TestCase.class, - org.hibernate.tool.jdbc2cfg.Performance.TestCase.class, - org.hibernate.tool.jdbc2cfg.PersistentClasses.TestCase.class, - org.hibernate.tool.jdbc2cfg.RevEngForeignKey.TestCase.class, - org.hibernate.tool.jdbc2cfg.SearchEscapeString.TestCase.class, - org.hibernate.tool.jdbc2cfg.TernarySchema.TestCase.class, - org.hibernate.tool.jdbc2cfg.Versioning.TestCase.class, - org.hibernate.tool.stat.Statistics.TestCase.class -}) -public class CommonTestSuite {} From 76d4424ea60aa0c79202b7417b44a00ba5cdaf69 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 6 Jul 2021 20:15:39 +0200 Subject: [PATCH 354/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Refactor test class 'org.hibernate.tool.hbm2x.query.QueryExporterTest.TestCase' Signed-off-by: Koen Aers --- .../hbm2x/query/QueryExporterTest/Group.java | 20 ++++++++- .../query/QueryExporterTest/TestCase.java | 45 +++++++++++++------ .../hbm2x/query/QueryExporterTest/User.java | 20 ++++++++- 3 files changed, 70 insertions(+), 15 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/Group.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/Group.java index 3c2159210f..073ff271c1 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/Group.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/Group.java @@ -1,4 +1,22 @@ -//$Id: Group.java 7085 2005-06-08 17:59:47Z oneovthafew $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.query.QueryExporterTest; import java.io.ObjectStreamClass; diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/TestCase.java index b026a29e54..c64b1a6f76 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/TestCase.java @@ -1,5 +1,26 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.query.QueryExporterTest; +import static org.junit.jupiter.api.Assertions.fail; + import java.io.File; import java.util.ArrayList; import java.util.EnumSet; @@ -19,28 +40,26 @@ import org.hibernate.tools.test.util.JUnitUtil; import org.hibernate.tools.test.util.JdbcUtil; import org.hibernate.tools.test.util.ResourceUtil; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class TestCase { - @Rule - public TemporaryFolder temporaryFolder = new TemporaryFolder(); + @TempDir + public File temporaryFolder = new File("temp"); private File destinationDir = null; private File resourcesDir = null; private File userGroupHbmXmlFile = null; - @Before + @BeforeEach public void setUp() throws Exception { JdbcUtil.createDatabase(this); - destinationDir = new File(temporaryFolder.getRoot(), "destination"); + destinationDir = new File(temporaryFolder, "destination"); destinationDir.mkdir(); - resourcesDir = new File(temporaryFolder.getRoot(), "resources"); + resourcesDir = new File(temporaryFolder, "resources"); resourcesDir.mkdir(); String[] resources = { "UserGroup.hbm.xml" }; ResourceUtil.createResources(this, resources, resourcesDir); @@ -77,14 +96,14 @@ public void testQueryExporter() throws Exception { JUnitUtil.assertIsNonEmptyFile(new File(destinationDir, "queryresult.txt")); } - @After + @AfterEach public void tearDown() throws Exception { SchemaExport export = new SchemaExport(); final EnumSet targetTypes = EnumSet.noneOf( TargetType.class ); targetTypes.add( TargetType.DATABASE ); export.drop(targetTypes, createMetadata()); if (export.getExceptions() != null && export.getExceptions().size() > 0){ - Assert.fail("Schema export failed"); + fail("Schema export failed"); } JdbcUtil.dropDatabase(this); } diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/User.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/User.java index 0aa90c4996..41e98986dd 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/User.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/query/QueryExporterTest/User.java @@ -1,4 +1,22 @@ -//$Id: User.java 7085 2005-06-08 17:59:47Z oneovthafew $ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2004-2021 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.hibernate.tool.hbm2x.query.QueryExporterTest; import java.io.ObjectStreamClass; From dbad20a6f5ac57295af054afc90d2501727848cd Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 13:24:34 +0200 Subject: [PATCH 355/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'junit.junit' from 'test/utils' Signed-off-by: Koen Aers --- test/utils/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/utils/pom.xml b/test/utils/pom.xml index f0d6acbbc7..cf13a52afb 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -17,11 +17,6 @@ Hibernate Tools Test Utilities Project - - junit - junit - compile - com.h2database h2 From 0de3f1c1ba4a0078462db0ce1df1e0efd17c9057 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 13:45:30 +0200 Subject: [PATCH 356/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'org.junit.vintage:junit-vintage-engine' from 'test/utils' Signed-off-by: Koen Aers --- test/utils/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/utils/pom.xml b/test/utils/pom.xml index cf13a52afb..687dd7795b 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -30,10 +30,6 @@ junit-jupiter-engine compile - - org.junit.vintage - junit-vintage-engine - From 8361c11d42503aa991264c50b30940cd54910209 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 14:34:01 +0200 Subject: [PATCH 357/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'junit.junit:4.13.2' from parent module Signed-off-by: Koen Aers --- pom.xml | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 81981e089c..e755f40d72 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,6 @@ 2.3.1 2.3.2 1.2.0 - 4.13.2 5.7.2 8.0.22 19.3.0.0 @@ -99,34 +98,23 @@ jaxen ${jaxen.version} runtime - - - junit - junit - ${junit.version} + + + mysql + mysql-connector-java + ${mysql.version} + test + + + org.apache.ant + ant + ${ant.version} + + + org.freemarker + freemarker + ${freemarker.version} - - mysql - mysql-connector-java - ${mysql.version} - test - - - org.apache.ant - ant - ${ant.version} - - - org.freemarker - freemarker - ${freemarker.version} - - - org.glassfish.jaxb - jaxb-runtime - ${jaxb-runtime.version} - runtime - org.hibernate hibernate-core From ffed1cc1bfbb635371296882ae9e7a120d8ee682 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Oct 2021 15:27:20 +0200 Subject: [PATCH 358/454] HBX-2184: Replace JUnit4 tests with JUnit Jupiter tests - Remove dependency on 'org.junit.vintage:junit-vintage-engine:5.7.2' Signed-off-by: Koen Aers --- pom.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pom.xml b/pom.xml index e755f40d72..990e501f30 100644 --- a/pom.xml +++ b/pom.xml @@ -152,12 +152,6 @@ ${junit-jupiter.version} test - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - From de2db7b8317eeec32d31d22146471b94883b3b9c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 15:08:29 +0200 Subject: [PATCH 359/454] HBX-2230: Adapt the tests that fail when run on the GitHub workflows - Adapt 'org.hibernate.tool.jdbc2cfg.Versioning.TestCase#testGenerateMappings()' Signed-off-by: Koen Aers --- .../org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java index d451472d67..24af9c6cb4 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Versioning/TestCase.java @@ -89,10 +89,10 @@ public void testGenerateMappings() { exporter.setOutputDirectory(testFolder); exporter.start(); File[] files = new File[4]; - files[0] = new File(testFolder, "Withversion.hbm.xml"); - files[1] = new File(testFolder, "Noversion.hbm.xml"); - files[2] = new File(testFolder, "Withrealtimestamp.hbm.xml"); - files[3] = new File(testFolder, "Withfaketimestamp.hbm.xml"); + files[0] = new File(testFolder, "WithVersion.hbm.xml"); + files[1] = new File(testFolder, "NoVersion.hbm.xml"); + files[2] = new File(testFolder, "WithRealTimestamp.hbm.xml"); + files[3] = new File(testFolder, "WithFakeTimestamp.hbm.xml"); Metadata metadata = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) .createMetadata(); From 349c1615622c9136a80be742174a560d83a36dab Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 15:54:43 +0200 Subject: [PATCH 360/454] HBX-2230: Adapt the tests that fail when run on the GitHub workflows - Adapt 'org.hibernate.tool.jdbc2cfg.KeyPropertyCompositeId.TestCase#testGeneration()' Signed-off-by: Koen Aers --- .../tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java index a323b0b06d..064deca7a4 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/KeyPropertyCompositeId/TestCase.java @@ -179,12 +179,12 @@ public void testGeneration() throws Exception { URL[] urls = new URL[] { temporaryFolder.toURI().toURL() }; URLClassLoader ucl = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader()); File[] files = new File[6]; - files[0] = new File(temporaryFolder, "Simplecustomerorder.hbm.xml"); - files[1] = new File(temporaryFolder, "Simplelineitem.hbm.xml"); + files[0] = new File(temporaryFolder, "SimpleCustomerOrder.hbm.xml"); + files[1] = new File(temporaryFolder, "SimpleLineItem.hbm.xml"); files[2] = new File(temporaryFolder, "Product.hbm.xml"); files[3] = new File(temporaryFolder, "Customer.hbm.xml"); - files[4] = new File(temporaryFolder, "Lineitem.hbm.xml"); - files[5] = new File(temporaryFolder, "Customerorder.hbm.xml"); + files[4] = new File(temporaryFolder, "LineItem.hbm.xml"); + files[5] = new File(temporaryFolder, "CustomerOrder.hbm.xml"); Thread.currentThread().setContextClassLoader(ucl); SessionFactory factory = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) From 6123f994122b210d45e01bea59575f4433687a71 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 17:29:12 +0200 Subject: [PATCH 361/454] HBX-2230: Adapt the tests that fail when run on the GitHub workflows - Adapt 'org.hibernate.tool.jdbc2cfg.CompositeId.TestCase' Signed-off-by: Koen Aers --- .../org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java index bd655b3f39..08fb245e6d 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/CompositeId/TestCase.java @@ -197,12 +197,12 @@ public void testGeneration() throws Exception { urls, Thread.currentThread().getContextClassLoader()); File[] files = new File[6]; - files[0] = new File(temporaryFolder, "Simplecustomerorder.hbm.xml"); - files[1] = new File(temporaryFolder, "Simplelineitem.hbm.xml"); + files[0] = new File(temporaryFolder, "SimpleCustomerOrder.hbm.xml"); + files[1] = new File(temporaryFolder, "SimpleLineItem.hbm.xml"); files[2] = new File(temporaryFolder, "Product.hbm.xml"); files[3] = new File(temporaryFolder, "Customer.hbm.xml"); - files[4] = new File(temporaryFolder, "Lineitem.hbm.xml"); - files[5] = new File(temporaryFolder, "Customerorder.hbm.xml"); + files[4] = new File(temporaryFolder, "LineItem.hbm.xml"); + files[5] = new File(temporaryFolder, "CustomerOrder.hbm.xml"); Thread.currentThread().setContextClassLoader(ucl); SessionFactory factory = MetadataDescriptorFactory .createNativeDescriptor(null, files, null) From 8b31c600778aafb29a95466914ee0fb949ccb37a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 17:53:57 +0200 Subject: [PATCH 362/454] HBX-2230: Adapt the tests that fail when run on the GitHub workflows - Adapt 'org.hibernate.tool.hbm2x.GenericExporterTest.TestCase#testFreeMarkerSyntaxFailureExpected()' Signed-off-by: Koen Aers --- .../tool/hbm2x/GenericExporterTest/TestCase.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java index 465dd32c4a..a99a929429 100644 --- a/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java +++ b/test/nodb/src/test/java/org/hibernate/tool/hbm2x/GenericExporterTest/TestCase.java @@ -102,10 +102,10 @@ public void testFreeMarkerSyntaxFailureExpected() { ge.setFilePattern("{class-name}.ftltest"); ge.start(); JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "Author.ftltest" ) ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "Article.ftlTest" ) ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "BaseHelloWorld.ftlTest" ) ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "HelloUniverse.ftlTest" ) ); - JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "UniversalAddress.ftlTest" ) ); + JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "Article.ftltest" ) ); + JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "BaseHelloWorld.ftltest" ) ); + JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "HelloUniverse.ftltest" ) ); + JUnitUtil.assertIsNonEmptyFile(new File(outputDir, "UniversalAddress.ftltest" ) ); } @Test From d5f29ad0b57a71b0b95207a093f7d35c010f45ec Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 8 Oct 2021 13:53:35 +0200 Subject: [PATCH 363/454] HBX-2185: Create GitHub yaml file to build and test automatically when opening PR Signed-off-by: Koen Aers --- .github/workflows/build_test.yml | 36 +++++++++++++++++++ .github/workflows/publish_reports.yml | 50 +++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/build_test.yml create mode 100644 .github/workflows/publish_reports.yml diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000000..54fba73b5e --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,36 @@ +name: Build and Test + +on: + pull_request + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout PR Branch + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + + - name: Setup Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + java-package: jdk + architecture: x64 + + - name: Build and Test + uses: GabrielBB/xvfb-action@v1 + with: + run: mvn clean install -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true + + - name: Archive Test Artifacts + uses: actions/upload-artifact@v2 + with: + name: test-reports + path: | + **/*target/surefire-reports/ + **/*.log + diff --git a/.github/workflows/publish_reports.yml b/.github/workflows/publish_reports.yml new file mode 100644 index 0000000000..f67be72b62 --- /dev/null +++ b/.github/workflows/publish_reports.yml @@ -0,0 +1,50 @@ +name: Publish Reports + +on: + workflow_run: + workflows: ["Build and Test"] + types: + - completed + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Download artifacts + uses: actions/github-script@v3.1.0 + with: + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id}}, + }); + for (var artifact of artifacts.data.artifacts) { + if (artifact.name.endsWith('test-reports')) { + var zipfile = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + var path = require('path'); + var pathFile = path.format({ + root: '${{github.workspace}}/', + name: artifact.name, + ext: '.zip' + }); + fs.writeFileSync(pathFile, Buffer.from(zipfile.data)); + } + } + - name: Unzip artifacts + run: | + find . -name '*.zip' -exec sh -c 'unzip -d "${1%.*}" "$1"' _ {} \; + - name: Publish aggregated tests reports + uses: scacap/action-surefire-report@v1 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + report_paths: '${{github.workspace}}/*test-reports/**/TEST-*.xml' + commit: ${{github.event.workflow_run.head_sha}} + From 6cc2c2ceea4b6a159760f0a16ca2efe60b42c564 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 26 Nov 2021 17:52:32 +0200 Subject: [PATCH 364/454] HBX-2252: Update Hibernate ORM Dependency to Version 5.3.24.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 990e501f30..21c3e725f2 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.23.Final + 5.3.24.Final 2.5.2 8.0.1 1.2.0 From e047e38d1b3e67e4b48cec0a4a269b3b39f45c19 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 29 Nov 2021 10:02:40 +0100 Subject: [PATCH 365/454] HBX-2251: Update version identifier to 5.3.24.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index a8cad3b523..6c3d7e505c 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index c90f9aa10a..54cdf36378 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.24-SNAPSHOT"; + public static final String VERSION = "5.3.24.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 315e9379fb..0176e200d7 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 21c3e725f2..8e3607ed31 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.24-SNAPSHOT + 5.3.24.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 5d6cf57065..9b2ca1f106 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 04c0c8b031..560768c264 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index d21ee0e858..2590f5800e 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 049f162521..8331c2c5fd 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 55638f84d8..c7ba7d12c3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 73ec6eb94e..3da9dcd211 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index c6e9f74268..07fd2949f9 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 10ab6a8ec0..caa609cb58 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index d862dfc93b..be60686c7b 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 687dd7795b..3062a571e3 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24-SNAPSHOT + 5.3.24.Final hibernate-tools-tests-utils From 774bbe6bdb7becb2eab751cd4045cdf67a6d5735 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 29 Nov 2021 14:48:20 +0100 Subject: [PATCH 366/454] HBX-2253: Update version identifier to 5.3.25-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6c3d7e505c..b3ce093aeb 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 54cdf36378..f569150441 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.24.Final"; + public static final String VERSION = "5.3.25-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 0176e200d7..2a5395f42a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 8e3607ed31..119cabf43e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.24.Final + 5.3.25-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 9b2ca1f106..81b6288838 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 560768c264..ce63ee6a3a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 2590f5800e..8761fba37f 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 8331c2c5fd..145e8a563d 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c7ba7d12c3..e59e605a2a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 3da9dcd211..fecf018f73 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 07fd2949f9..a846e25bad 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index caa609cb58..5f1442a1c8 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index be60686c7b..be30b87699 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 3062a571e3..815bfb8f43 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.24.Final + 5.3.25-SNAPSHOT hibernate-tools-tests-utils From 93dba8272913810abe6d5fe4f839e059e02f1e2f Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 30 Nov 2021 20:38:14 +0100 Subject: [PATCH 367/454] HBX-2252: HBX-2252: Update dependency on jboss-parent to version 39 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 119cabf43e..c016c5f032 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 38 + 39 org.hibernate From cb876f58842e89672e629ce9f55143e38443e014 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 1 Dec 2021 14:15:34 +0100 Subject: [PATCH 368/454] HBX-2257: Update dependency on ant to version 1.10.12 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c016c5f032..94866b4cbe 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ - 1.10.11 + 1.10.12 4.4 2.3.31 From c3a19ee4942da716f45ab122c822217c4cc7f352 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 2 Dec 2021 17:50:16 +0100 Subject: [PATCH 369/454] HBX-2259: Update dependency on junit-jupiter to version 5.8.2 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94866b4cbe..980cf48c10 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 2.3.1 2.3.2 1.2.0 - 5.7.2 + 5.8.2 8.0.22 19.3.0.0 9.2.1.jre8 From 8499e00422ac34e4987b961229c944228a61bd89 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Jan 2022 10:08:01 +0100 Subject: [PATCH 370/454] HBX-2254: Update Hibernate ORM Dependency to Version 5.3.25.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 980cf48c10..2e30fe6e1f 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.24.Final + 5.3.25.Final 2.5.2 8.0.1 1.2.0 From b1efd39c8f41402f04e8c01fa22dde8f31e05fe8 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Jan 2022 10:18:13 +0100 Subject: [PATCH 371/454] HBX-2255: Update version identifier to 5.3.25.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index b3ce093aeb..e30d3a2900 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index f569150441..07ab95da15 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.25-SNAPSHOT"; + public static final String VERSION = "5.3.25.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2a5395f42a..bc2e95c408 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 2e30fe6e1f..719371c201 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.25-SNAPSHOT + 5.3.25.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 81b6288838..28e2ccab38 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index ce63ee6a3a..3c0540e77b 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 8761fba37f..f3c96c2640 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 145e8a563d..32f2bd78e3 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index e59e605a2a..bcd9814944 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index fecf018f73..1e0db8d993 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a846e25bad..2714dcf60d 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 5f1442a1c8..3d495f7d4e 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index be30b87699..33763ed361 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 815bfb8f43..3fdb57d53c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25-SNAPSHOT + 5.3.25.Final hibernate-tools-tests-utils From 23169586a6766f765974bd5626089d38c7e37306 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Jan 2022 10:56:33 +0100 Subject: [PATCH 372/454] HBX-2273: Update version identifier to 5.3.26-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index e30d3a2900..6963c21f28 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 07ab95da15..def35d72b6 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.25.Final"; + public static final String VERSION = "5.3.26-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index bc2e95c408..09144b939a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 719371c201..74b35b9713 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.25.Final + 5.3.26-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 28e2ccab38..3af1af0eff 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 3c0540e77b..f64699894e 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index f3c96c2640..acc0a6d851 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 32f2bd78e3..86cf446952 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index bcd9814944..fe00c5a3cb 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 1e0db8d993..82d296e519 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 2714dcf60d..af3cb1e40f 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 3d495f7d4e..7400a44e94 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 33763ed361..c40568d303 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 3fdb57d53c..7b50c75056 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.25.Final + 5.3.26-SNAPSHOT hibernate-tools-tests-utils From 19f9d4bf2eeccc55540dabe8ce52746a76eb7bd7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 3 Feb 2022 09:16:46 +0100 Subject: [PATCH 373/454] HBX-2304: Update the dependency for H2 to 2.x.x - Adapt the returned table type from 'BASE TABLE' to 'TABLE' Signed-off-by: Koen Aers --- .../hibernate/cfg/reveng/dialect/H2MetaDataDialect.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java index 663f27e600..b3775f49c2 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java @@ -35,6 +35,14 @@ public H2MetaDataDialect() { } } + protected void putTableType(Map element, ResultSet tableRs) throws SQLException { + String tableType = tableRs.getString("TABLE_TYPE"); + if ("BASE TABLE".equals(tableType)) { + tableType = "TABLE"; + } + element.put("TABLE_TYPE", tableType); + } + protected void putTablePart(Map element, ResultSet tableRs) throws SQLException { super.putTablePart( element, tableRs ); if ( !understandsCatalogName ) { From 3be408c94e688398170f8732d4ec47c3f45fe591 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 3 Feb 2022 09:37:11 +0100 Subject: [PATCH 374/454] HBX-2304: Update the dependency for H2 to 2.x.x - Isolate SQL string for the 1.x.xxx versions Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/H2MetaDataDialect.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java index b3775f49c2..a915feb8c1 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java @@ -19,6 +19,24 @@ */ public class H2MetaDataDialect extends JDBCMetaDataDialect { + private static final String H2_1_X_SQL = + "SELECT " + + " idx.TABLE_CATALOG TABLE_CAT, " + + " idx.TABLE_SCHEMA TABLE_SCHEM, " + + " idx.TABLE_NAME, " + + " idx.COLUMN_NAME, " + + " cols.COLUMN_DEFAULT COLUMN_DEFAULT " + + "FROM " + + " INFORMATION_SCHEMA.INDEXES idx, " + + " INFORMATION_SCHEMA.COLUMNS cols " + + "WHERE " + + " idx.TABLE_CATALOG = cols.TABLE_CATALOG AND " + + " idx.TABLE_SCHEMA = cols.TABLE_SCHEMA AND " + + " idx.TABLE_NAME = cols.TABLE_NAME AND " + + " idx.PRIMARY_KEY = TRUE AND " + + " COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; + + private static boolean understandsCatalogName = true; public H2MetaDataDialect() { @@ -65,14 +83,7 @@ public Iterator> getSuggestedPrimaryKeyStrategyName(String c log.debug("geSuggestedPrimaryKeyStrategyName(" + catalog + "." + schema + "." + table + ")"); - String sql = "SELECT idx.TABLE_CATALOG TABLE_CAT, idx.TABLE_SCHEMA TABLE_SCHEM, idx.TABLE_NAME, idx.COLUMN_NAME, cols.COLUMN_DEFAULT COLUMN_DEFAULT FROM " + - "INFORMATION_SCHEMA.INDEXES idx, INFORMATION_SCHEMA.COLUMNS cols " + - "WHERE " + - "idx.TABLE_CATALOG = cols.TABLE_CATALOG " + - "and idx.TABLE_SCHEMA = cols.TABLE_SCHEMA " + - "and idx.TABLE_NAME = cols.TABLE_NAME " + - "AND idx.PRIMARY_KEY = TRUE " + - "AND COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; + String sql = H2_1_X_SQL; if(catalog!=null) { sql += "AND idx.TABLE_CATALOG like '" + catalog + "' "; } From 92b9a0b4bf9c944914c4e17a57b7321b4602e796 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 09:23:16 +0100 Subject: [PATCH 375/454] HBX-2304: Update the dependency for H2 to 2.x.x - Add switch to change the suggested primary key strategy query depending on version 1.x or 2.x Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/H2MetaDataDialect.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java index a915feb8c1..fc52df079b 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java @@ -19,7 +19,7 @@ */ public class H2MetaDataDialect extends JDBCMetaDataDialect { - private static final String H2_1_X_SQL = + private static final String SPKSQ_H2_1_X = "SELECT " + " idx.TABLE_CATALOG TABLE_CAT, " + " idx.TABLE_SCHEMA TABLE_SCHEM, " + @@ -34,11 +34,29 @@ public class H2MetaDataDialect extends JDBCMetaDataDialect { " idx.TABLE_SCHEMA = cols.TABLE_SCHEMA AND " + " idx.TABLE_NAME = cols.TABLE_NAME AND " + " idx.PRIMARY_KEY = TRUE AND " + - " COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; - + " COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; + + private static final String SPKSQ_H2_2_X = + "SELECT " + + " idx.TABLE_CATALOG TABLE_CAT, " + + " idx.TABLE_SCHEMA TABLE_SCHEM, " + + " idx.TABLE_NAME, " + + " cols.COLUMN_NAME, " + + " cols.COLUMN_DEFAULT " + + "FROM " + + " INFORMATION_SCHEMA.INDEXES idx, " + + " INFORMATION_SCHEMA.COLUMNS cols " + + "WHERE " + + " idx.TABLE_CATALOG = cols.TABLE_CATALOG AND " + + " idx.TABLE_SCHEMA = cols.TABLE_SCHEMA AND " + + " idx.TABLE_NAME = cols.TABLE_NAME AND " + + " idx.INDEX_TYPE_NAME = 'PRIMARY KEY' AND " + + " cols.COLUMN_DEFAULT LIKE '%NEXT VALUE FOR%'"; private static boolean understandsCatalogName = true; + private String suggested_primary_key_strategy_query = null; + public H2MetaDataDialect() { super(); try { @@ -47,6 +65,7 @@ public H2MetaDataDialect() { if ( build.intValue() < 55 ) { understandsCatalogName = false; } + suggested_primary_key_strategy_query = build.intValue() > 200 ? SPKSQ_H2_2_X : SPKSQ_H2_1_X; } catch( Throwable e ) { // ignore (probably H2 not in the classpath) @@ -83,7 +102,7 @@ public Iterator> getSuggestedPrimaryKeyStrategyName(String c log.debug("geSuggestedPrimaryKeyStrategyName(" + catalog + "." + schema + "." + table + ")"); - String sql = H2_1_X_SQL; + String sql = suggested_primary_key_strategy_query; if(catalog!=null) { sql += "AND idx.TABLE_CATALOG like '" + catalog + "' "; } From 2361ae8b2be2cafa610d3d89882c0cc6350dab8c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 10:50:16 +0100 Subject: [PATCH 376/454] HBX-2304: Update the dependency for H2 to 2.x.x - Add 'dbtimestamp' as possible column name for auto detection for optimistic lock (as 'timestamp' is a reserved word for H2 2.x) Signed-off-by: Koen Aers --- .../hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java | 1 + 1 file changed, 1 insertion(+) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java index 8805261f3e..fb4718468b 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java @@ -32,6 +32,7 @@ public class DefaultReverseEngineeringStrategy implements ReverseEngineeringStra AUTO_OPTIMISTICLOCK_COLUMNS = new HashSet(); AUTO_OPTIMISTICLOCK_COLUMNS.add("version"); AUTO_OPTIMISTICLOCK_COLUMNS.add("timestamp"); + AUTO_OPTIMISTICLOCK_COLUMNS.add("dbtimestamp"); } From f443059985a78ee6b58bb2a638ce5a10ce002367 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 11:43:55 +0100 Subject: [PATCH 377/454] HBX-2304: Update the dependency for H2 to 2.x.x - Use 'ONE', 'TWO' and 'DBTIMESTAMP' instead of 'FIRST', 'SECOND' and 'TIMESTAMP' in DB creation script for test class 'org.hibernate.tool.jdbc2cfg.Versioning.TestCase' (as 'SECOND' and 'TIMESTAMP' are reserved words in H2 2.x) Signed-off-by: Koen Aers --- .../org/hibernate/tool/jdbc2cfg/Versioning/create.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql index d8a2f6776c..03b653a3ab 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Versioning/create.sql @@ -1,4 +1,4 @@ -CREATE TABLE WITH_VERSION (FIRST INT, SECOND INT, VERSION INT, NAME VARCHAR(256), PRIMARY KEY (FIRST)) -CREATE TABLE NO_VERSION (FIRST INT, SECOND INT, NAME VARCHAR(256), PRIMARY KEY (SECOND)) -CREATE TABLE WITH_REAL_TIMESTAMP (FIRST INT, SECOND INT, TIMESTAMP TIMESTAMP, NAME VARCHAR(256), PRIMARY KEY (FIRST)) -CREATE TABLE WITH_FAKE_TIMESTAMP (FIRST INT, SECOND INT, TIMESTAMP INT, NAME VARCHAR(256), PRIMARY KEY (FIRST)) +CREATE TABLE WITH_VERSION (ONE INT, TWO INT, VERSION INT, NAME VARCHAR(256), PRIMARY KEY (ONE)) +CREATE TABLE NO_VERSION (ONE INT, TWO INT, NAME VARCHAR(256), PRIMARY KEY (TWO)) +CREATE TABLE WITH_REAL_TIMESTAMP (ONE INT, TWO INT, DBTIMESTAMP TIMESTAMP, NAME VARCHAR(256), PRIMARY KEY (ONE)) +CREATE TABLE WITH_FAKE_TIMESTAMP (ONE INT, TWO INT, DBTIMESTAMP INT, NAME VARCHAR(256), PRIMARY KEY (ONE)) From b30c8ef2b6e2258ba93a823c8f2b96d95ee03887 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 12:03:29 +0100 Subject: [PATCH 378/454] HBX-2304: Update the dependency for H2 to 2.x.x - Use 'ONE', 'TWO' and 'THREE' instead of 'FIRST', 'SECOND' and 'THIRD' in DB creation script for test class 'org.hibernate.tool.jdbc2cfg.Index.TestCase' (as 'SECOND' is a reserved word in H2 2.x) Signed-off-by: Koen Aers --- .../java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java | 4 ++-- .../resources/org/hibernate/tool/jdbc2cfg/Index/create.sql | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java index b0cd021d46..0f1ac69acd 100644 --- a/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/jdbc2cfg/Index/TestCase.java @@ -101,10 +101,10 @@ public void testWithIndex() { Column col1 = cols.next(); Column col2 = cols.next(); assertEquals( - JdbcUtil.toIdentifier(this, "FIRST"), + JdbcUtil.toIdentifier(this, "ONE"), JdbcUtil.toIdentifier(this, col1.getName())); assertEquals( - JdbcUtil.toIdentifier(this, "THIRD"), + JdbcUtil.toIdentifier(this, "THREE"), JdbcUtil.toIdentifier(this, col2.getName())); Column example = new Column(); example.setName(col2.getName() ); diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql index 1fd5c554cf..d9a9acb5a0 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/Index/create.sql @@ -1,3 +1,3 @@ -CREATE TABLE WITH_INDEX (FIRST INT, SECOND INT, THIRD INT) -CREATE INDEX MY_INDEX ON WITH_INDEX(FIRST,THIRD) -CREATE UNIQUE INDEX OTHER_IDX on WITH_INDEX(THIRD) +CREATE TABLE WITH_INDEX (ONE INT, TWO INT, THREE INT) +CREATE INDEX MY_INDEX ON WITH_INDEX(ONE,THREE) +CREATE UNIQUE INDEX OTHER_IDX on WITH_INDEX(THREE) From 5cf4d53a6453b1e65c4325fd31ec2988089d2c6e Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 12:19:24 +0100 Subject: [PATCH 379/454] HBX-2304: Update the dependency for H2 to 2.x.x - Use 'ONE' and 'TWO' instead of 'FIRST' and 'SECOND' in DB creation script for test class 'org.hibernate.tool.cfg.JDBCMetaDataConfiguration.TestCase' (as 'SECOND' is a reserved word in H2 2.x) Signed-off-by: Koen Aers --- .../tool/cfg/JDBCMetaDataConfiguration/create.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/common/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql b/test/common/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql index d8a2f6776c..daee2519a0 100644 --- a/test/common/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql +++ b/test/common/src/main/resources/org/hibernate/tool/cfg/JDBCMetaDataConfiguration/create.sql @@ -1,4 +1,4 @@ -CREATE TABLE WITH_VERSION (FIRST INT, SECOND INT, VERSION INT, NAME VARCHAR(256), PRIMARY KEY (FIRST)) -CREATE TABLE NO_VERSION (FIRST INT, SECOND INT, NAME VARCHAR(256), PRIMARY KEY (SECOND)) -CREATE TABLE WITH_REAL_TIMESTAMP (FIRST INT, SECOND INT, TIMESTAMP TIMESTAMP, NAME VARCHAR(256), PRIMARY KEY (FIRST)) -CREATE TABLE WITH_FAKE_TIMESTAMP (FIRST INT, SECOND INT, TIMESTAMP INT, NAME VARCHAR(256), PRIMARY KEY (FIRST)) +CREATE TABLE WITH_VERSION (ONE INT, TWO INT, VERSION INT, NAME VARCHAR(256), PRIMARY KEY (ONE)) +CREATE TABLE NO_VERSION (ONE INT, TWO INT, NAME VARCHAR(256), PRIMARY KEY (TWO)) +CREATE TABLE WITH_REAL_TIMESTAMP (ONE INT, TWO INT, TIMESTAMP TIMESTAMP, NAME VARCHAR(256), PRIMARY KEY (ONE)) +CREATE TABLE WITH_FAKE_TIMESTAMP (ONE INT, TWO INT, TIMESTAMP INT, NAME VARCHAR(256), PRIMARY KEY (ONE)) From a470fe6f4d8c5a950228adb64235a9316f9d647b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 13:39:06 +0100 Subject: [PATCH 380/454] HBX-2304: Update the dependency for H2 to 2.x.x - Make sure the MetaDataDialect that is used in test class 'org.hibernate.tool.hbm2x.IncrementalSchemaReading.TestCase' delegates to the proper database MetaDataDialect Signed-off-by: Koen Aers --- .../IncrementalSchemaReading/TestCase.java | 62 +++++++++++++------ 1 file changed, 43 insertions(+), 19 deletions(-) diff --git a/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java b/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java index 52bd3a0420..7e23a6943f 100644 --- a/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/hbm2x/IncrementalSchemaReading/TestCase.java @@ -24,22 +24,27 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertSame; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import java.util.Map; import java.util.Properties; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Environment; import org.hibernate.cfg.JDBCReaderFactory; +import org.hibernate.cfg.MetaDataDialectFactory; import org.hibernate.cfg.reveng.DatabaseCollector; import org.hibernate.cfg.reveng.DefaultDatabaseCollector; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.JDBCReader; import org.hibernate.cfg.reveng.SchemaSelection; -import org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect; +import org.hibernate.cfg.reveng.dialect.MetaDataDialect; +import org.hibernate.dialect.Dialect; +import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.mapping.Table; import org.hibernate.service.ServiceRegistry; import org.hibernate.tool.hbmlint.detector.TableSelectorStrategy; @@ -58,18 +63,8 @@ public class TestCase { private Properties properties = null; private String defaultSchema = null; private String defaultCatalog = null; + private List gottenTables = new ArrayList(); - public class MockedMetaDataDialect extends JDBCMetaDataDialect { - List gottenTables = new ArrayList(); - public Iterator> getTables(String catalog, String schema, String table) { - gottenTables.add(table); - return super.getTables( catalog, schema, table == null ? "%" : table ); - } - public Iterator> getColumns(String catalog, String schema, String table, String column) { - return super.getColumns(catalog, schema, table == null ? "%" : table, column == null ? "%" : column); - } - } - @BeforeEach public void setUp() { JdbcUtil.createDatabase(this); @@ -89,7 +84,9 @@ public void testReadSchemaIncremental() { builder.applySettings(properties); ServiceRegistry serviceRegistry = builder.build(); TableSelectorStrategy tss = new TableSelectorStrategy(new DefaultReverseEngineeringStrategy()); - MockedMetaDataDialect mockedMetaDataDialect = new MockedMetaDataDialect(); + Dialect dialect = serviceRegistry.getService(JdbcServices.class).getDialect(); + MetaDataDialect mockedMetaDataDialect = createMockedMetaDataDialect( + MetaDataDialectFactory.fromDialect(dialect)); JDBCReader reader = JDBCReaderFactory.newJDBCReader( properties, tss, mockedMetaDataDialect, serviceRegistry); tss.addSchemaSelection( new SchemaSelection(null,null, "CHILD") ); @@ -97,8 +94,8 @@ public void testReadSchemaIncremental() { DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect()); reader.readDatabaseSchema( dc, null, null ); - assertEquals(mockedMetaDataDialect.gottenTables.size(),1); - assertEquals(mockedMetaDataDialect.gottenTables.get(0),"CHILD"); + assertEquals(gottenTables.size(),1); + assertEquals(gottenTables.get(0),"CHILD"); Iterator
iterator = dc.iterateTables(); Table firstChild = iterator.next(); @@ -110,11 +107,11 @@ public void testReadSchemaIncremental() { tss.clearSchemaSelections(); tss.addSchemaSelection( new SchemaSelection(null, null, "MASTER") ); - mockedMetaDataDialect.gottenTables.clear(); + gottenTables.clear(); reader.readDatabaseSchema( dc, null, null ); - assertEquals(mockedMetaDataDialect.gottenTables.size(),1); - assertEquals(mockedMetaDataDialect.gottenTables.get(0),"MASTER"); + assertEquals(gottenTables.size(),1); + assertEquals(gottenTables.get(0),"MASTER"); iterator = dc.iterateTables(); @@ -147,4 +144,31 @@ public void testReadSchemaIncremental() { 0); } + private MetaDataDialect createMockedMetaDataDialect(MetaDataDialect delegate) { + return (MetaDataDialect)Proxy.newProxyInstance( + getClass().getClassLoader(), + new Class[] { MetaDataDialect.class }, + new InvocationHandler() { + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + if ("getTables".equals(method.getName())) { + gottenTables.add((String)args[2]); + return delegate.getTables( + (String)args[0], + (String)args[1], + args[2] == null ? "%" : (String)args[2]); + } else if ("getColumns".equals(method.getName())) { + return delegate.getColumns( + (String)args[0], + (String)args[1], + args[2] == null ? "%" : (String)args[2], + args[3] == null ? "%" : (String)args[3]); + } else { + return method.invoke(delegate, args); + + } + } + }); + } + } From b3768644d8a7e31a1fe00e277ae28449210d9c88 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 16:19:07 +0100 Subject: [PATCH 381/454] HBX-2304: Update the dependency for H2 to 2.x.x - Adapt the suggested primary key strategy SQL strings Signed-off-by: Koen Aers --- .../cfg/reveng/dialect/H2MetaDataDialect.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java index fc52df079b..729c578d5e 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java @@ -7,7 +7,6 @@ import java.util.Iterator; import java.util.Map; -import org.hibernate.internal.util.StringHelper; import org.hibernate.tool.util.ReflectHelper; @@ -24,8 +23,7 @@ public class H2MetaDataDialect extends JDBCMetaDataDialect { " idx.TABLE_CATALOG TABLE_CAT, " + " idx.TABLE_SCHEMA TABLE_SCHEM, " + " idx.TABLE_NAME, " + - " idx.COLUMN_NAME, " + - " cols.COLUMN_DEFAULT COLUMN_DEFAULT " + + " idx.COLUMN_NAME " + "FROM " + " INFORMATION_SCHEMA.INDEXES idx, " + " INFORMATION_SCHEMA.COLUMNS cols " + @@ -34,24 +32,25 @@ public class H2MetaDataDialect extends JDBCMetaDataDialect { " idx.TABLE_SCHEMA = cols.TABLE_SCHEMA AND " + " idx.TABLE_NAME = cols.TABLE_NAME AND " + " idx.PRIMARY_KEY = TRUE AND " + - " COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; + " cols.COLUMN_DEFAULT like '%NEXT VALUE FOR%' "; private static final String SPKSQ_H2_2_X = "SELECT " + " idx.TABLE_CATALOG TABLE_CAT, " + " idx.TABLE_SCHEMA TABLE_SCHEM, " + " idx.TABLE_NAME, " + - " cols.COLUMN_NAME, " + - " cols.COLUMN_DEFAULT " + + " cols.COLUMN_NAME " + "FROM " + " INFORMATION_SCHEMA.INDEXES idx, " + + " INFORMATION_SCHEMA.INDEX_COLUMNS idx_cols, " + " INFORMATION_SCHEMA.COLUMNS cols " + "WHERE " + " idx.TABLE_CATALOG = cols.TABLE_CATALOG AND " + " idx.TABLE_SCHEMA = cols.TABLE_SCHEMA AND " + " idx.TABLE_NAME = cols.TABLE_NAME AND " + " idx.INDEX_TYPE_NAME = 'PRIMARY KEY' AND " + - " cols.COLUMN_DEFAULT LIKE '%NEXT VALUE FOR%'"; + " cols.COLUMN_NAME = idx_cols.COLUMN_NAME AND " + + " cols.IS_IDENTITY = 'YES'"; private static boolean understandsCatalogName = true; @@ -121,8 +120,7 @@ public Iterator> getSuggestedPrimaryKeyStrategyName(String c protected Map convertRow(ResultSet tableRs) throws SQLException { element.clear(); putTablePart( element, tableRs ); - String string = tableRs.getString("COLUMN_DEFAULT"); - element.put("HIBERNATE_STRATEGY", StringHelper.isEmpty( string )?null:"identity"); + element.put("HIBERNATE_STRATEGY", "identity"); return element; } protected Throwable handleSQLException(SQLException e) { From 210ba99ad252b507e0f0fc5d18a51dc75c043377 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 16:54:42 +0100 Subject: [PATCH 382/454] HBX-2304: Update the dependency for H2 to 2.x.x - Use 'IDENTITY' as the type in the DB creation script for test class 'org.hibernate.tool.jdbc2cfg.Identity.TestCase' Signed-off-by: Koen Aers --- .../resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql b/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql index 7f6a6095ce..99a63b36da 100644 --- a/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql +++ b/test/h2/src/test/resources/org/hibernate/tool/jdbc2cfg/Identity/create.sql @@ -1,2 +1,2 @@ -CREATE TABLE `autoinc` (`id` int(11) NOT NULL identity, `data` varchar(100) default NULL, PRIMARY KEY (`id`)) -CREATE TABLE `noautoinc` (`id` int(11) NOT NULL, `data` varchar(100) default NULL, PRIMARY KEY (`id`)) +CREATE TABLE `autoinc` (`id` IDENTITY NOT NULL, `data` varchar(100) default NULL, PRIMARY KEY (`id`)) +CREATE TABLE `noautoinc` (`id` int NOT NULL, `data` varchar(100) default NULL, PRIMARY KEY (`id`)) From 94ee6ed7679752a11e565fc01c28c4d79aa7793a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 4 Feb 2022 18:58:47 +0100 Subject: [PATCH 383/454] HBX-2304: Update the dependency for H2 to 2.x.x - Create and call method 'JDBCMetaDataDialect#putTableType(...)' Signed-off-by: Koen Aers --- .../hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/org/hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java b/main/src/main/java/org/hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java index bec184a2d5..1f10c5fdcb 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/dialect/JDBCMetaDataDialect.java @@ -32,7 +32,7 @@ public Iterator> getTables(String xcatalog, String xschema, S protected Map convertRow(ResultSet tableResultSet) throws SQLException { element.clear(); putTablePart( element, tableResultSet ); - element.put("TABLE_TYPE", tableResultSet.getString("TABLE_TYPE")); + putTableType(element, tableResultSet); element.put("REMARKS", tableResultSet.getString("REMARKS")); return element; } @@ -88,6 +88,10 @@ protected void putTablePart(Map element, ResultSet tableRs) thro element.put("TABLE_CAT", tableRs.getString("TABLE_CAT")); } + protected void putTableType(Map element, ResultSet tableRs) throws SQLException { + element.put("TABLE_TYPE", tableRs.getString("TABLE_TYPE")); + } + public Iterator> getColumns(final String xcatalog, final String xschema, final String xtable, String xcolumn) { try { final String catalog = caseForSearch( xcatalog ); From b0232955d1200076a11dcbe8f0311fd76675433a Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 14 Apr 2022 10:41:01 +0200 Subject: [PATCH 384/454] HBX-2342: Change protocol in references to DTD's from http to https Signed-off-by: Koen Aers --- main/pom.xml | 14 +++++++------- .../tool/hbm2x/HibernateConfigurationExporter.java | 2 +- main/src/main/resources/doc/common.ftl | 2 +- main/src/main/resources/hbm/generalhbm.hbm.ftl | 2 +- .../main/resources/hbm/hibernate-mapping.hbm.ftl | 2 +- maven-plugin/pom.xml | 2 +- .../tool/ant/AntHibernateTool/TopDown.hbm.xml | 2 +- .../tool/ant/EJB3Configuration/hibernate.cfg.xml | 2 +- .../tool/ant/GenericExport/TopDown.hbm.xml | 2 +- .../ant/Hbm2JavaConfiguration/SomeClass.hbm.xml | 2 +- .../Hbm2JavaEJB3Configuration/SomeClass.hbm.xml | 2 +- .../org/hibernate/tool/ant/HbmLint/Column.hbm.xml | 2 +- .../tool/ant/HbmLint/SchemaIssues.hbm.xml | 2 +- .../hibernate/tool/ant/HbmLint/hibernate.cfg.xml | 2 +- .../tool/ant/JPABogusPUnit/hibernate.cfg.xml | 2 +- .../hibernate/tool/ant/JPAPUnit/hibernate.cfg.xml | 2 +- .../JPAPropertyOverridesPUnit/hibernate.cfg.xml | 2 +- .../tool/ant/Properties/SomeClass.hbm.xml | 2 +- .../org/hibernate/tool/ant/Query/hibernate.cfg.xml | 2 +- .../org/hibernate/tool/ant/Query/query.hbm.xml | 2 +- .../tool/ant/SchemaExportWarning/TopDown.hbm.xml | 2 +- .../tool/ant/SchemaUpdateWarning/TopDown.hbm.xml | 2 +- .../query/QueryExporterTest/UserGroup.hbm.xml | 2 +- .../tool/hbmlint/HbmLintTest/BrokenLazy.hbm.xml | 2 +- .../hbmlint/HbmLintTest/CachingSettings.hbm.xml | 2 +- .../hbmlint/HbmLintTest/IdentifierIssues.hbm.xml | 2 +- .../hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../tool/stat/Statistics/UserGroup.hbm.xml | 2 +- .../src/main/resources/hibernate.reveng.xml | 2 +- .../src/main/resources/hibernate.reveng.xml | 2 +- .../src/main/resources/hibernate.reveng.xml | 2 +- .../hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../hibernate/tool/ant/Exception/TopDown.hbm.xml | 2 +- .../tool/ant/NoConnInfoExport/TopDown.hbm.xml | 2 +- .../tool/ant/NoConnInfoExport/hibernate.cfg.xml | 2 +- .../tool/hbm2x/DocExporterTest/Customer.hbm.xml | 2 +- .../hbm2x/DocExporterTest/DependentValue.hbm.xml | 2 +- .../tool/hbm2x/DocExporterTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/DocExporterTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/DocExporterTest/Order.hbm.xml | 2 +- .../tool/hbm2x/DocExporterTest/Product.hbm.xml | 2 +- .../hbm2x/DocExporterTest/UnionSubclass.hbm.xml | 2 +- .../tool/hbm2x/GenericExporterTest/Article.hbm.xml | 2 +- .../tool/hbm2x/GenericExporterTest/Author.hbm.xml | 2 +- .../hbm2x/GenericExporterTest/HelloWorld.hbm.xml | 2 +- .../hbm2x/HashcodeEqualsTest/HashEquals.hbm.xml | 2 +- .../tool/hbm2x/Hbm2CfgTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/Hbm2DaoTest/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2DaoTest/Author.hbm.xml | 2 +- .../tool/hbm2x/Hbm2EJBDaoTest/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2EJBDaoTest/Author.hbm.xml | 2 +- .../hbm2x/Hbm2HibernateDAOTest/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2HibernateDAOTest/Author.hbm.xml | 2 +- .../Hbm2JavaConstructorTest/Constructors.hbm.xml | 2 +- .../GenericModel.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaEjb3Test/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaEjb3Test/Author.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaEjb3Test/Passenger.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaEjb3Test/Train.hbm.xml | 2 +- .../Hbm2JavaInitializationTest/Article.hbm.xml | 2 +- .../Hbm2JavaInitializationTest/Author.hbm.xml | 2 +- .../Hbm2JavaInitializationTest/Passenger.hbm.xml | 2 +- .../hbm2x/Hbm2JavaInitializationTest/Train.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Customer.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Order.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Passenger.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Product.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Train.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/Customer.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/Order.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/Product.hbm.xml | 2 +- .../tool/hbm2x/PropertiesTest/Properties.hbm.xml | 2 +- .../tool/hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml | 2 +- .../tool/hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml | 2 +- .../hbm2hbmxml/CompositeElementTest/Glarch.hbm.xml | 2 +- .../hbm2hbmxml/DynamicComponentTest/Glarch.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml | 2 +- .../Hbm2HbmXmlTest/BasicCompositeId.hbm.xml | 2 +- .../hbm2hbmxml/Hbm2HbmXmlTest/BasicGlobals.hbm.xml | 2 +- .../Hbm2HbmXmlTest/ClassFullAttribute.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/IdBagTest/UserGroup.hbm.xml | 2 +- .../hbm2hbmxml/InheritanceTest/Aliens.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/ListArrayTest/Glarch.hbm.xml | 2 +- .../hbm2hbmxml/ManyToManyTest/UserGroup.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/MapAndAnyTest/Person.hbm.xml | 2 +- .../hbm2hbmxml/MapAndAnyTest/Properties.hbm.xml | 2 +- .../PersonAddressOneToOnePrimaryKey.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/SetElementTest/Search.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml | 2 +- .../ide/completion/ModelCompletion/City.hbm.xml | 2 +- .../ide/completion/ModelCompletion/Product.hbm.xml | 2 +- .../ModelCompletion/ProductOwnerAddress.hbm.xml | 2 +- .../ide/completion/ModelCompletion/Store.hbm.xml | 2 +- .../completion/ModelCompletion/StoreCity.hbm.xml | 2 +- .../hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../hibernate/tools/test/util/HelloWorld.hbm.xml | 2 +- 100 files changed, 106 insertions(+), 106 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6963c21f28..bd02b6678b 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -15,28 +15,28 @@ Hibernate Tools Hibernate Tools - http://hibernate.org/tools/ + https://hibernate.org/tools/ JIRA - http://hibernate.onjira.com/browse/HBX + https://hibernate.onjira.com/browse/HBX scm:git:git://github.com/hibernate/hibernate-tools.git scm:git:git@github.com:hibernate/hibernate-tools.git - http://github.com/hibernate/hibernate-tools + https://github.com/hibernate/hibernate-tools Hibernate - http://www.hibernate.org + https://www.hibernate.org GNU Lesser General Public License - http://www.gnu.org/licenses/lgpl-2.1.html + https://www.gnu.org/licenses/lgpl-2.1.html @@ -45,13 +45,13 @@ maxandersen Max Andersen max@hibernate.org - http://in.relation.to/Bloggers/Max + https://in.relation.to/Bloggers/Max koentsje Koen Aersn koen@hibernate.org - http://koentsje.blogspot.be + https://koentsje.blogspot.be diff --git a/main/src/main/java/org/hibernate/tool/hbm2x/HibernateConfigurationExporter.java b/main/src/main/java/org/hibernate/tool/hbm2x/HibernateConfigurationExporter.java index ea16e66f3f..2287eacead 100644 --- a/main/src/main/java/org/hibernate/tool/hbm2x/HibernateConfigurationExporter.java +++ b/main/src/main/java/org/hibernate/tool/hbm2x/HibernateConfigurationExporter.java @@ -67,7 +67,7 @@ public void doStart() throws ExporterException { pw.println("\n" + "\r\n" + + " \"https://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd\">\r\n" + ""); boolean ejb3 = Boolean.valueOf((String)getProperties().get("ejb3")).booleanValue(); diff --git a/main/src/main/resources/doc/common.ftl b/main/src/main/resources/doc/common.ftl index 4e260ebf36..6db27ad411 100644 --- a/main/src/main/resources/doc/common.ftl +++ b/main/src/main/resources/doc/common.ftl @@ -2,7 +2,7 @@
\n"+ " - + diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/docexample.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/docexample.reveng.xml index c40cc46778..fbc9d4cd71 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/docexample.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/docexample.reveng.xml @@ -1,5 +1,5 @@ - + diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/overridetest.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/overridetest.reveng.xml index e15afa7259..d9a38c8107 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/overridetest.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/overridetest.reveng.xml @@ -1,5 +1,5 @@ - + diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/schemaselection.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/schemaselection.reveng.xml index dd0f758036..157fd23e4d 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/schemaselection.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/schemaselection.reveng.xml @@ -1,5 +1,5 @@ - + diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/test.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/test.reveng.xml index 211b7a3fe0..622b826bd2 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/test.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/OverrideBinder/test.reveng.xml @@ -1,5 +1,5 @@ - + diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/badforeignkeytest.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/badforeignkeytest.reveng.xml index f579587c79..79754cbd0a 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/badforeignkeytest.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/badforeignkeytest.reveng.xml @@ -1,5 +1,5 @@ - +
diff --git a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/foreignkeytest.reveng.xml b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/foreignkeytest.reveng.xml index f5e0b82f95..895235913d 100644 --- a/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/foreignkeytest.reveng.xml +++ b/test/common/src/main/resources/org/hibernate/tool/jdbc2cfg/RevEngForeignKey/foreignkeytest.reveng.xml @@ -1,5 +1,5 @@ - + diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml index 5a878b2209..e048b71b32 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/FormulaTest/Customer.hbm.xml @@ -1,7 +1,7 @@ + "http://hibernate.org/dtd/hibernate-mapping-3.0.dtd"> From 9485bdbfa95d449375faf393de9ebc1a56e61ab5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 11:57:35 +0100 Subject: [PATCH 421/454] HBX-2647: Update Hibernate ORM Dependency to Version 5.3.33.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 42831ed95a..96fdcf47b9 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.32.Final + 5.3.33.Final 2.5.2 8.0.1 1.2.0 From 25dfa4a661afcd465eece6f0d49512023f40a9f7 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 12:50:38 +0100 Subject: [PATCH 422/454] HBX-2648: Update version identifier to 5.3.33.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index e4762c608d..8183a7fd6e 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index cb5c9c7cde..16442042c8 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.33-SNAPSHOT"; + public static final String VERSION = "5.3.33.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index e7cdc60fe4..5711072c0a 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 96fdcf47b9..3759303b69 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.33-SNAPSHOT + 5.3.33.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 29c0865bd6..9de5274357 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 076071580d..851dd9ef5c 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index b70a9ba360..3d5847b5d7 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 4ec6fca018..e02d88a41a 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 8c5ed011ee..c80636c386 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 05e6cd8dd7..6386827976 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 0b71c0526d..d622e127cc 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 607d249f52..c1c84af2ec 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 00ff3f9ed5..f7ea88c890 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index e5d793f7fa..15e3fe3202 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33-SNAPSHOT + 5.3.33.Final hibernate-tools-tests-utils From 1034fa3760d3d815b3865a2359f0c0c5f34b6e9b Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 14:32:29 +0100 Subject: [PATCH 423/454] HBX-2655: Update version identifier to 5.3.34-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 8183a7fd6e..b4177d611c 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 16442042c8..9004ddd615 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.33.Final"; + public static final String VERSION = "5.3.34-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 5711072c0a..2b4463db51 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 3759303b69..c90127c4ce 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.33.Final + 5.3.34-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 9de5274357..41b29e4ef5 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 851dd9ef5c..d618d5f31a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 3d5847b5d7..845f17fe77 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index e02d88a41a..b1a5882502 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index c80636c386..defd33f81a 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 6386827976..4c888277cc 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index d622e127cc..dc90a4f497 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c1c84af2ec..414ebd3951 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index f7ea88c890..f819263ba5 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 15e3fe3202..ee4416de14 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.33.Final + 5.3.34-SNAPSHOT hibernate-tools-tests-utils From 6fbd4f0455e13e1a63347735e582ca61df42ee93 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 14:42:34 +0100 Subject: [PATCH 424/454] HBX-2673: Update Hibernate ORM Dependency to Version 5.3.34.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c90127c4ce..a60c48718e 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.33.Final + 5.3.34.Final 2.5.2 8.0.1 1.2.0 From 1d94b3dde0befa9f0bac04ca79b949df2fe4fff0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 14:59:16 +0100 Subject: [PATCH 425/454] HBX-2679: Update version identifier to 5.3.34.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index b4177d611c..5950baa09b 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 9004ddd615..d511374fa6 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.34-SNAPSHOT"; + public static final String VERSION = "5.3.34.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2b4463db51..c763598ea3 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index a60c48718e..d9ac477f27 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.34-SNAPSHOT + 5.3.34.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 41b29e4ef5..cb319e2b58 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index d618d5f31a..86aa259755 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 845f17fe77..b49ac8ed59 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index b1a5882502..669dc8f1ee 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index defd33f81a..9c52621535 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 4c888277cc..e0e06369f0 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index dc90a4f497..824f986fb8 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 414ebd3951..65e0917313 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index f819263ba5..6edc310ca4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index ee4416de14..7c8ece5148 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34-SNAPSHOT + 5.3.34.Final hibernate-tools-tests-utils From 7c114bae6129bc44b903ddced5ad668b33e10551 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 8 Jan 2024 17:55:40 +0100 Subject: [PATCH 426/454] HBX-2681: Update version identifier to 5.3.35-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 5950baa09b..773bccf48a 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index d511374fa6..8d90d402cb 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.34.Final"; + public static final String VERSION = "5.3.35-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index c763598ea3..0502cbb227 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index d9ac477f27..3bfa6b860c 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.34.Final + 5.3.35-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index cb319e2b58..391fddf800 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 86aa259755..793ba8f969 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index b49ac8ed59..509f8bc278 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 669dc8f1ee..cba8ca387b 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 9c52621535..1352d20b83 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index e0e06369f0..a97547c399 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 824f986fb8..5ccfcd5d35 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 65e0917313..6ebbd633db 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 6edc310ca4..9dd9de865b 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 7c8ece5148..9b9093387c 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.34.Final + 5.3.35-SNAPSHOT hibernate-tools-tests-utils From 8ff79683e4b304dbb92f7c4ed9fbf7381462df52 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 15 Jan 2024 13:53:20 +0100 Subject: [PATCH 427/454] HBX-2636: Update dependency on FreeMarker to version 2.3.32 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3bfa6b860c..8202581671 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 1.10.14 4.4 - 2.3.31 + 2.3.32 1.7 1.4.199 From de7d507de3abd1379ea19203f1a36d530142c803 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 16 Jan 2024 13:26:57 +0100 Subject: [PATCH 428/454] HBX-2641: Update dependency on JUnit to version 5.10.1 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8202581671..a0d7034276 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 2.2 2.3.1 2.3.2 - 5.9.1 + 5.10.1 8.0.22 19.3.0.0 9.2.1.jre8 From fb935cada381468216f091d6ce2b89721a277b77 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 1 Feb 2024 15:53:32 +0100 Subject: [PATCH 429/454] HBX-2703: Update Hibernate ORM Dependency to Version 5.3.35.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a0d7034276..2f3721b9c1 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.34.Final + 5.3.35.Final 2.5.2 8.0.1 1.2.0 From b2c185a7290382035f49752c4bfc5a827718c8d5 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Feb 2024 12:17:13 +0100 Subject: [PATCH 430/454] HBX-2704: Update version identifier to 5.3.35.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 773bccf48a..7747ebf017 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 8d90d402cb..5030c667b5 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.35-SNAPSHOT"; + public static final String VERSION = "5.3.35.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 0502cbb227..2b75431960 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 2f3721b9c1..e47aab8dd6 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.35-SNAPSHOT + 5.3.35.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 391fddf800..629e7fe519 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 793ba8f969..7db1848216 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 509f8bc278..c2d3b59047 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index cba8ca387b..6b36b94dc6 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 1352d20b83..ab318bcb16 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index a97547c399..d8bcdf94a5 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 5ccfcd5d35..a07e8f5542 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 6ebbd633db..ccf3cbe3f1 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 9dd9de865b..4e11c464b8 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 9b9093387c..f45f435a64 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35-SNAPSHOT + 5.3.35.Final hibernate-tools-tests-utils From 6ea3eee8733c64fa25a954e9e13d57f049ac9db6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 2 Feb 2024 12:51:22 +0100 Subject: [PATCH 431/454] HBX-2714: Update version identifier to 5.3.36-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 7747ebf017..f806d072ea 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index 5030c667b5..e59a41c77c 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.35.Final"; + public static final String VERSION = "5.3.36-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 2b75431960..7faaa259e1 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index e47aab8dd6..042f8d9cdf 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.35.Final + 5.3.36-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 629e7fe519..985a997e49 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 7db1848216..7d8ee26775 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index c2d3b59047..fb5f5b0d2b 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 6b36b94dc6..c8d6a17342 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index ab318bcb16..486d74f4f9 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index d8bcdf94a5..da0f60b40a 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index a07e8f5542..ee44df5de0 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index ccf3cbe3f1..c5fa64601c 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 4e11c464b8..2ea2422d74 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index f45f435a64..e08428c370 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.35.Final + 5.3.36-SNAPSHOT hibernate-tools-tests-utils From 7b69c7ee6d2d6e466ae2a93132ababa5684ea36d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Mon, 8 Jan 2024 09:41:38 +0100 Subject: [PATCH 432/454] HBX-2716 - Remove floating point types from types advertised to support precision & scale Signed-off-by: Koen Aers --- .../java/org/hibernate/cfg/JDBCBinder.java | 4 +- .../cfg/reveng/BasicColumnProcessor.java | 7 +- .../DefaultReverseEngineeringStrategy.java | 5 +- .../cfg/reveng/JDBCToHibernateTypeHelper.java | 199 ------------------ .../cfg/reveng/OverrideRepository.java | 3 +- .../utils/JdbcToHibernateTypeHelper.java | 34 +-- .../detector/SchemaByMetaDataDetector.java | 4 +- 7 files changed, 34 insertions(+), 222 deletions(-) delete mode 100644 main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java diff --git a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java index ecf142329b..48736db54f 100644 --- a/main/src/main/java/org/hibernate/cfg/JDBCBinder.java +++ b/main/src/main/java/org/hibernate/cfg/JDBCBinder.java @@ -28,11 +28,11 @@ import org.hibernate.cfg.reveng.AssociationInfo; import org.hibernate.cfg.reveng.DatabaseCollector; import org.hibernate.cfg.reveng.JDBCReader; -import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper; import org.hibernate.cfg.reveng.MappingsDatabaseCollector; import org.hibernate.cfg.reveng.RevEngUtils; import org.hibernate.cfg.reveng.ReverseEngineeringStrategy; import org.hibernate.cfg.reveng.TableIdentifier; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; import org.hibernate.engine.OptimisticLockStyle; import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.Mapping; @@ -934,7 +934,7 @@ private String guessAndAlignType(Table table, Column column, Mapping mapping, bo } private String typeCodeName(int sqlTypeCode) { - return sqlTypeCode + "(" + JDBCToHibernateTypeHelper.getJDBCTypeName(sqlTypeCode) + ")"; + return sqlTypeCode + "(" + JdbcToHibernateTypeHelper.getJDBCTypeName(sqlTypeCode) + ")"; } /** diff --git a/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java b/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java index e3a87fd0cd..ab274d98e9 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/BasicColumnProcessor.java @@ -7,6 +7,7 @@ import org.hibernate.JDBCException; import org.hibernate.cfg.JDBCBinderException; import org.hibernate.cfg.reveng.dialect.MetaDataDialect; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; import org.hibernate.mapping.Column; import org.hibernate.mapping.Table; import org.hibernate.tool.util.TableNameQualifier; @@ -82,15 +83,15 @@ public static void processBasicColumns( column.setComment(comment); column.setSqlTypeCode(new Integer(sqlType) ); if(intBounds(size) ) { - if(JDBCToHibernateTypeHelper.typeHasLength(sqlType) ) { + if(JdbcToHibernateTypeHelper.typeHasLength(sqlType) ) { column.setLength(size); } - if(JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(sqlType) ) { + if(JdbcToHibernateTypeHelper.typeHasPrecision(sqlType) ) { column.setPrecision(size); } } if(intBounds(decimalDigits) ) { - if(JDBCToHibernateTypeHelper.typeHasScaleAndPrecision(sqlType) ) { + if(JdbcToHibernateTypeHelper.typeHasScale(sqlType) ) { column.setScale(decimalDigits); } } diff --git a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java index fb4718468b..b5d5959afd 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/DefaultReverseEngineeringStrategy.java @@ -10,6 +10,7 @@ import java.util.Properties; import java.util.Set; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; import org.hibernate.internal.util.StringHelper; import org.hibernate.mapping.Column; import org.hibernate.mapping.ForeignKey; @@ -106,11 +107,11 @@ public String foreignKeyToEntityName(String keyname, TableIdentifier fromTable, } public String columnToHibernateTypeName(TableIdentifier table, String columnName, int sqlType, int length, int precision, int scale, boolean nullable, boolean generatedIdentifier) { - String preferredHibernateType = JDBCToHibernateTypeHelper.getPreferredHibernateType(sqlType, length, precision, scale, nullable, generatedIdentifier); + String preferredHibernateType = JdbcToHibernateTypeHelper.getPreferredHibernateType(sqlType, length, precision, scale, nullable, generatedIdentifier); String location = ""; if(log.isDebugEnabled()) { - String info = " t:" + JDBCToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; + String info = " t:" + JdbcToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; if(table!=null) { location = TableNameQualifier.qualify(table.getCatalog(), table.getSchema(), table.getName() ) + "." + columnName + info; } else { diff --git a/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java b/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java deleted file mode 100644 index f921e1187f..0000000000 --- a/main/src/main/java/org/hibernate/cfg/reveng/JDBCToHibernateTypeHelper.java +++ /dev/null @@ -1,199 +0,0 @@ -package org.hibernate.cfg.reveng; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.sql.SQLException; -import java.sql.Types; -import java.util.HashMap; -import java.util.Map; - -import org.hibernate.MappingException; - - -/** - * Utility class for mapping between sqltypes and hibernate type names. - * - * @author max (based on parts from Sql2Java from Middlegen) - * - */ -public final class JDBCToHibernateTypeHelper { - - private JDBCToHibernateTypeHelper() { - - } - - /** The Map containing the preferred conversion type values. */ - private static final Map PREFERRED_HIBERNATETYPE_FOR_SQLTYPE = new HashMap(); - - static { - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.TINYINT), new String[] { "byte", Byte.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.SMALLINT), new String[] { "short", Short.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.INTEGER), new String[] { "int", Integer.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.BIGINT), new String[] { "long", Long.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.REAL), new String[] { "float", Float.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.FLOAT), new String[] { "double", Double.class.getName()} ); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.DOUBLE), new String[] { "double", Double.class.getName()}); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.DECIMAL), new String[] { "big_decimal", "big_decimal" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.NUMERIC), new String[] { "big_decimal", "big_decimal" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.BIT), new String[] { "boolean", Boolean.class.getName()}); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.BOOLEAN), new String[] { "boolean", Boolean.class.getName()}); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.CHAR), new String[] { "char", Character.class.getName()}); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.VARCHAR), new String[] { "string", "string" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.LONGVARCHAR), new String[] { "string", "string" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.BINARY), new String[] { "binary", "binary" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.VARBINARY), new String[] { "binary", "binary" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.LONGVARBINARY), new String[] { "binary", "binary" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.DATE), new String[] { "date", "date" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.TIME), new String[] { "time", "time" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.TIMESTAMP), new String[] { "timestamp", "timestamp" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.CLOB), new String[] { "clob", "clob" }); - PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.put(new Integer(Types.BLOB), new String[] { "blob", "blob" }); - - //Hibernate does not have any built-in Type for these: - //preferredJavaTypeForSqlType.put(new Integer(Types.ARRAY), "java.sql.Array"); - //preferredJavaTypeForSqlType.put(new Integer(Types.REF), "java.sql.Ref"); - //preferredJavaTypeForSqlType.put(new Integer(Types.STRUCT), "java.lang.Object"); - //preferredJavaTypeForSqlType.put(new Integer(Types.JAVA_OBJECT), "java.lang.Object"); - } - - /* (non-Javadoc) - * @see org.hibernate.cfg.JDBCTypeToHibernateTypesStrategy#getPreferredHibernateType(int, int, int, int) - */ - public static String getPreferredHibernateType(int sqlType, int size, int precision, int scale, boolean nullable, boolean generatedIdentifier) { - boolean returnNullable = nullable || generatedIdentifier; - if ( (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC) && scale <= 0) { // <= - if (precision == 1) { - // NUMERIC(1) is a often used idiom for storing boolean thus providing it out of the box. - return returnNullable?Boolean.class.getName():"boolean"; - } - else if (precision < 3) { - return returnNullable?Byte.class.getName():"byte"; - } - else if (precision < 5) { - return returnNullable?Short.class.getName():"short"; - } - else if (precision < 10) { - return returnNullable?Integer.class.getName():"int"; - } - else if (precision < 19) { - return returnNullable?Long.class.getName():"long"; - } - else { - return "big_integer"; - } - } - - if ( sqlType == Types.CHAR && size>1 ) { - return "string"; - } - - String[] result = (String[]) PREFERRED_HIBERNATETYPE_FOR_SQLTYPE.get(new Integer(sqlType) ); - - if(result==null) { - return null; - } else if(returnNullable) { - return result[1]; - } else { - return result[0]; - } - } - - static Map jdbcTypes; // Name to value - static Map jdbcTypeValues; // value to Name - - public static String[] getJDBCTypes() { - checkTypes(); - - return (String[]) jdbcTypes.keySet().toArray(new String[jdbcTypes.size()]); - } - - public static int getJDBCType(String value) { - checkTypes(); - - Integer number = (Integer) jdbcTypes.get(value); - - if(number==null) { - try { - return Integer.parseInt(value); - } - catch (NumberFormatException nfe) { - throw new MappingException("jdbc-type: " + value + " is not a known JDBC Type nor a valid number"); - } - } - else { - return number.intValue(); - } - } - - private static void checkTypes() { - if(jdbcTypes==null) { - jdbcTypes = new HashMap(); - Field[] fields = Types.class.getFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if(Modifier.isStatic(field.getModifiers() ) ) { - try { - jdbcTypes.put(field.getName(), (Integer)field.get(Types.class) ); - } - catch (IllegalArgumentException e) { - // ignore - } - catch (IllegalAccessException e) { - // ignore - } - } - } - } - } - - public static String getJDBCTypeName(int value) { - if(jdbcTypeValues==null) { - jdbcTypeValues = new HashMap(); - Field[] fields = Types.class.getFields(); - for (int i = 0; i < fields.length; i++) { - Field field = fields[i]; - if(Modifier.isStatic(field.getModifiers() ) ) { - try { - jdbcTypeValues.put((Integer)field.get(Types.class), field.getName() ); - } - catch (IllegalArgumentException e) { - // ignore - } - catch (IllegalAccessException e) { - // ignore - } - } - } - } - - String name = (String) jdbcTypeValues.get(new Integer(value) ); - - if(name!=null) { - return name; - } - else { - return ""+value; - } - } - - /** - * @param table - * @param schema - * @param catalog - * @throws SQLException - */ - - // scale and precision have numeric column - public static boolean typeHasScaleAndPrecision(int sqlType) { - return (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC - || sqlType == Types.REAL || sqlType == Types.FLOAT || sqlType == Types.DOUBLE); - } - - // length is for string column - public static boolean typeHasLength(int sqlType) { - return (sqlType == Types.CHAR || sqlType == Types.DATE - || sqlType == Types.LONGVARCHAR || sqlType == Types.TIME || sqlType == Types.TIMESTAMP - || sqlType == Types.VARCHAR ); - } -} - diff --git a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java index b729a6637e..0642536209 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/OverrideRepository.java @@ -20,6 +20,7 @@ import org.apache.commons.collections4.MapIterator; import org.apache.commons.collections4.MultiValuedMap; import org.hibernate.MappingException; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; import org.hibernate.cfg.reveng.utils.MetaAttributeHelper; import org.hibernate.cfg.reveng.utils.MetaAttributeHelper.SimpleMetaAttribute; import org.hibernate.internal.util.StringHelper; @@ -318,7 +319,7 @@ public List getSchemaSelections() { public String columnToHibernateTypeName(TableIdentifier table, String columnName, int sqlType, int length, int precision, int scale, boolean nullable, boolean generatedIdentifier) { String result = null; String location = ""; - String info = " t:" + JDBCToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; + String info = " t:" + JdbcToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; if(table!=null) { location = TableNameQualifier.qualify(table.getCatalog(), table.getSchema(), table.getName() ) + "." + columnName; } else { diff --git a/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java b/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java index cca86a6029..0d03569032 100644 --- a/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java +++ b/main/src/main/java/org/hibernate/cfg/reveng/utils/JdbcToHibernateTypeHelper.java @@ -183,17 +183,25 @@ public static String getJDBCTypeName(int value) { * @throws SQLException */ - // scale and precision have numeric column - public static boolean typeHasScaleAndPrecision(int sqlType) { - return (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC - || sqlType == Types.REAL || sqlType == Types.FLOAT || sqlType == Types.DOUBLE); - } - - // length is for string column - public static boolean typeHasLength(int sqlType) { - return (sqlType == Types.CHAR || sqlType == Types.DATE - || sqlType == Types.LONGVARCHAR || sqlType == Types.TIME || sqlType == Types.TIMESTAMP - || sqlType == Types.VARCHAR ); - } -} + // scale is for non floating point numeric columns + public static boolean typeHasScale(int sqlType) { + return (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC); + } + + // precision is for numeric columns + public static boolean typeHasPrecision(int sqlType) { + return (sqlType == Types.DECIMAL || sqlType == Types.NUMERIC + || sqlType == Types.REAL || sqlType == Types.FLOAT || sqlType == Types.DOUBLE); + } + public static boolean typeHasScaleAndPrecision(int sqlType) { + return typeHasScale(sqlType) && typeHasPrecision(sqlType); + } + + // length is for string columns + public static boolean typeHasLength(int sqlType) { + return (sqlType == Types.CHAR || sqlType == Types.DATE + || sqlType == Types.LONGVARCHAR || sqlType == Types.TIME || sqlType == Types.TIMESTAMP + || sqlType == Types.VARCHAR ); + } +} diff --git a/main/src/main/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java b/main/src/main/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java index d9074051ed..93da8cf239 100644 --- a/main/src/main/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java +++ b/main/src/main/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java @@ -18,8 +18,8 @@ import org.hibernate.cfg.reveng.DefaultDatabaseCollector; import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy; import org.hibernate.cfg.reveng.JDBCReader; -import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper; import org.hibernate.cfg.reveng.SchemaSelection; +import org.hibernate.cfg.reveng.utils.JdbcToHibernateTypeHelper; import org.hibernate.dialect.Dialect; import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.spi.Mapping; @@ -200,7 +200,7 @@ public void visit( pc.reportIssue( new Issue( "SCHEMA_COLUMN_TYPE_MISMATCH", Issue.NORMAL_PRIORITY, table(table) + " has a wrong column type for " + col.getName() + ", expected: " - + JDBCToHibernateTypeHelper.getJDBCTypeName(modelTypeCode) + " but was " + JDBCToHibernateTypeHelper.getJDBCTypeName(dbTypeCode) + " in db") ); + + JdbcToHibernateTypeHelper.getJDBCTypeName(modelTypeCode) + " but was " + JdbcToHibernateTypeHelper.getJDBCTypeName(dbTypeCode) + " in db") ); } } } From f2244cdacd6ebd969fa01bba93767a5b4becd4d2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 20 Feb 2024 16:26:32 +0100 Subject: [PATCH 433/454] HBX-2715: Update Hibernate ORM Dependency to Version 5.3.36.Final Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 042f8d9cdf..2da5ffa061 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 1.7 1.4.199 5.1.2.Final - 5.3.35.Final + 5.3.36.Final 2.5.2 8.0.1 1.2.0 From 0890b987e9737c25646aee4aeb613bbb2dea9f03 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 20 Feb 2024 16:50:53 +0100 Subject: [PATCH 434/454] HBX-2727: Update version identifier to 5.3.36.Final Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index f806d072ea..e39e272068 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index e59a41c77c..bbed898e79 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.36-SNAPSHOT"; + public static final String VERSION = "5.3.36.Final"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 7faaa259e1..3549f4f29e 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 2da5ffa061..d2b6efe926 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.36-SNAPSHOT + 5.3.36.Final pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 985a997e49..887f824232 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 7d8ee26775..e560fcf529 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index fb5f5b0d2b..a1959eeccb 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index c8d6a17342..77b9cfb502 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 486d74f4f9..b2ef648242 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index da0f60b40a..bae3655eba 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index ee44df5de0..afb11e51a7 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c5fa64601c..a058e29749 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 2ea2422d74..a812170c69 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index e08428c370..304850fa8b 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36-SNAPSHOT + 5.3.36.Final hibernate-tools-tests-utils From 00b7de42d7e0503fbf0d9e0fa9093d11d95a2afc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 21 Feb 2024 16:14:56 +0100 Subject: [PATCH 435/454] HBX-2728: Update version identifier to 5.3.37-SNAPSHOT Signed-off-by: Koen Aers --- main/pom.xml | 2 +- main/src/main/java/org/hibernate/tool/Version.java | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index e39e272068..a1c9428c00 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index bbed898e79..ca2404a781 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,7 +4,7 @@ final public class Version { - public static final String VERSION = "5.3.36.Final"; + public static final String VERSION = "5.3.37-SNAPSHOT"; private static final Version instance = new Version(); diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 3549f4f29e..f597a6e6a3 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index d2b6efe926..74913627bd 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.36.Final + 5.3.37-SNAPSHOT pom diff --git a/test/common/pom.xml b/test/common/pom.xml index 887f824232..63c8a79805 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index e560fcf529..1f1344e90a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index a1959eeccb..e5e23f84df 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index 77b9cfb502..de543cd698 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index b2ef648242..d5987b78d2 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index bae3655eba..52235576df 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index afb11e51a7..6e2e578254 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index a058e29749..36d42e7277 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index a812170c69..94eb820739 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 304850fa8b..2a3afbba69 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.36.Final + 5.3.37-SNAPSHOT hibernate-tools-tests-utils From a89a47d8d3909ea629a2d572f35d3e5ea16b7ea0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 24 Jul 2024 13:07:43 +0300 Subject: [PATCH 436/454] HBX-2869: Create a GenerateHBM Mojo in the Maven plugin - Add the Mojo Signed-off-by: Koen Aers --- .../org/hibernate/mvn/GenerateHbmMojo.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java new file mode 100644 index 0000000000..6a8581cac2 --- /dev/null +++ b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java @@ -0,0 +1,63 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2016-2020 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.hibernate.mvn; + +import static org.apache.maven.plugins.annotations.LifecyclePhase.GENERATE_SOURCES; + +import java.io.File; + +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.hibernate.tool.api.metadata.MetadataDescriptor; +import org.hibernate.tool.hbm2x.HibernateMappingExporter; + +/** + * Mojo to generate hbm.xml files from an existing database. + *

+ * See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 + */ +@Mojo(name = "generateHbm", defaultPhase = GENERATE_SOURCES) +public class GenerateHbmMojo extends AbstractHbm2xMojo { + + /** The directory into which the DAOs will be generated. */ + @Parameter(defaultValue = "${project.basedir}/src/main/resources") + private File outputDirectory; + + @Parameter + private String templatePath; + + protected void executeExporter(MetadataDescriptor metadataDescriptor) { + try { + HibernateMappingExporter hbmExporter = new HibernateMappingExporter(); + hbmExporter.setMetadataDescriptor(metadataDescriptor); + hbmExporter.setOutputDirectory(outputDirectory); + if (templatePath != null) { + getLog().info("Setting template path to: " + templatePath); + hbmExporter.setTemplatePath(new String[] {templatePath}); + } + getLog().info("Starting HBM export to directory: " + outputDirectory + "..."); + hbmExporter.start(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + +} From 099e7dbbd58472f2019ce1992baba92d3e55a6cc Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Wed, 24 Jul 2024 13:23:40 +0300 Subject: [PATCH 437/454] HBX-2869: Create a GenerateHBM Mojo in the Maven plugin - Test the Mojo Signed-off-by: Koen Aers --- .../src/it/generateHbm/invoker.properties | 2 + test/maven-plugin/src/it/generateHbm/pom.xml | 53 ++++++++++++++++++ .../src/main/resources/hibernate.properties | 7 +++ .../src/main/resources/hibernate.reveng.xml | 11 ++++ .../main/resources/templates/pojo/Pojo.ftl | 29 ++++++++++ .../resources/templates/pojo/PojoFields.ftl | 7 +++ .../src/it/generateHbm/test.mv.db | Bin 0 -> 28672 bytes .../src/it/generateHbm/verify.groovy | 6 ++ 8 files changed, 115 insertions(+) create mode 100644 test/maven-plugin/src/it/generateHbm/invoker.properties create mode 100644 test/maven-plugin/src/it/generateHbm/pom.xml create mode 100644 test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.properties create mode 100644 test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.reveng.xml create mode 100644 test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/Pojo.ftl create mode 100644 test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/PojoFields.ftl create mode 100644 test/maven-plugin/src/it/generateHbm/test.mv.db create mode 100644 test/maven-plugin/src/it/generateHbm/verify.groovy diff --git a/test/maven-plugin/src/it/generateHbm/invoker.properties b/test/maven-plugin/src/it/generateHbm/invoker.properties new file mode 100644 index 0000000000..13598db400 --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/invoker.properties @@ -0,0 +1,2 @@ +invoker.java.version = 1.8+ +invoker.goals = generate-resources \ No newline at end of file diff --git a/test/maven-plugin/src/it/generateHbm/pom.xml b/test/maven-plugin/src/it/generateHbm/pom.xml new file mode 100644 index 0000000000..944b92a6ca --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + org.hibernate.tool.test + hbm2ddl + 0.0.1-SNAPSHOT + + + UTF-8 + UTF-8 + + 1.8 + 1.4.195 + + + + + + org.hibernate + hibernate-tools-maven-plugin + @project.version@ + + + HBM generation + generate-resources + + generateHbm + + + ${project.build.directory}/generated-sources + ${project.basedir}/src/main/resources/templates/ + + + + + ${project.basedir}/src/main/resources/hibernate.reveng.xml + + + + + com.h2database + h2 + ${h2.version} + + + + + + + \ No newline at end of file diff --git a/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.properties b/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.properties new file mode 100644 index 0000000000..71496b3adc --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.properties @@ -0,0 +1,7 @@ +hibernate.dialect=org.hibernate.dialect.H2Dialect +hibernate.connection.driver_class=org.h2.Driver +hibernate.connection.url=jdbc:h2:./test;DB_CLOSE_ON_EXIT=FALSE +hibernate.connection.username=sa +hibernate.connection.password= +hibernate.connection.pool_size=1 +hibernate.show_sql=true \ No newline at end of file diff --git a/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.reveng.xml b/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.reveng.xml new file mode 100644 index 0000000000..7ac52fd2cf --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/src/main/resources/hibernate.reveng.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/Pojo.ftl b/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/Pojo.ftl new file mode 100644 index 0000000000..84ff76a5b2 --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/Pojo.ftl @@ -0,0 +1,29 @@ +${pojo.getPackageDeclaration()} +// Generated ${date} by Hibernate Tools ${version} + +<#assign classbody> +<#include "PojoTypeDeclaration.ftl"/> { + +<#if !pojo.isInterface()> +<#include "PojoFields.ftl"/> + +<#include "PojoConstructors.ftl"/> + +<#include "PojoPropertyAccessors.ftl"/> + +<#include "PojoToString.ftl"/> + +<#include "PojoEqualsHashcode.ftl"/> + +<#else> +<#include "PojoInterfacePropertyAccessors.ftl"/> + + +<#include "PojoExtraClassCode.ftl"/> + +} + + +${pojo.generateImports()} +${classbody} + diff --git a/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/PojoFields.ftl b/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/PojoFields.ftl new file mode 100644 index 0000000000..18cf396cc6 --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/src/main/resources/templates/pojo/PojoFields.ftl @@ -0,0 +1,7 @@ +<#-- // Fields --> +<#list pojo.getAllPropertiesIterator() as field><#if pojo.getMetaAttribAsBool(field, "gen-property", true)><#if pojo.hasMetaAttribute(field, "field-description")> /** + ${pojo.getFieldJavaDoc(field, 0)} + */ + ${pojo.getFieldModifiers(field)} ${pojo.getJavaTypeName(field, jdk5)} ${c2j.keyWordCheck(field.name)}<#if pojo.hasFieldInitializor(field, jdk5)> = ${pojo.getFieldInitialization(field, jdk5)}; + + diff --git a/test/maven-plugin/src/it/generateHbm/test.mv.db b/test/maven-plugin/src/it/generateHbm/test.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..72d79270f88b69518fe17598ef53debfe7371c91 GIT binary patch literal 28672 zcmeI4TWcFf6vuZJtBI93AWCQ-S{NtPPC+O$yV{#*OJr$-L?zisa!8)c>@6{IBxB1V z^r3{d^r_Hq(9hAAmVAOd=B*IOW4}Y`XlG}4t&1bas&UB?W-qg=oio4H#sB}Aqk35> zIC}&4iCA}czw^rkV_a|_AN8M<00AHX1b_e#00KY&2mk>f00e*l5V!yY>O%L6HR%5f za91D%AOHk_01yBIKmZ5;0U!VbfB+Bx0*fUOC;7!BfIYv@vieWyewni6^D=R8q3=H* zmes;OedHf9pWt9HV3~izWRnCiRt&5bhPzMMq=A4C*KwWHlmK*=$7uGzs`OTpWl8$v zg(Tf+v-Mp`dj0D1^(+gps7sPOkbjXbOIN~S6g5|Dc;N{oTq@yG4VR^GsXdE^?M8DS zv;rUY-tIHM#RjdYxG>t@ibkB^(EJF89^udgj*td+a2kiEQY*pXif+BATYaosVy3%I z--VL63r5tfD!MIAxeJ=+7)iI@jXq_!XRz=0dk3_CNZlcuuyJ@TY(46GgXZ87-x*S8 z&oAPu;gP+8)1v$FcE=AE`^tl>0RbQY1b_e#00KY&2mk>f00cfP0u%as+I;#zQ3F@? zoU^Fu>CeqY{RfdERU<_@Mevr!1+N<_&trmDF;pw1|AXnB&e_WJzx}sP`Y39DnFWo|`D_=!?wmPh}^ALS&Ka7LoO*^b< z$3&a$xSa>vsIg0|qc2t-F^CNAlmW5v*HCq{-R*TMqcKIJOQyt%Cmt2- z(Lo*p`y5!yyuF;2@|jhV&)ihM6SXP*8)p8r=2%`L^5XC0p+lF3tf{{OE~+kMJz*PV_e zjn=PUEyvm}^IN7WEuWuHm?|29U2mk>f z00e*l5C8&c0$g>b^taIetSSCIJy*x38Bl9dBcHWJ9U z`G0M!N=O%p=~P(^wo2GdI&~JR|9|{24HsU06y^W<4(R{%7cFc90U!VbfB+Bx0zlw` z5SYk13;nOTiT)3;>bt~q&m^a(K3VAh@qBZl|7Yg^jX5gMr}jB-BhUZ8;o9yl&;RrK z|6}?8?^F5zDcVkmJojXg7iYZBLFFYGZ*sg+--`49=OX)N#zA8m=b!^;M&SqzJZ?@2 zG5R0f@D2iz{!jFG VtpB}~{wErC70;hnInRGy?qAGfE9C$H literal 0 HcmV?d00001 diff --git a/test/maven-plugin/src/it/generateHbm/verify.groovy b/test/maven-plugin/src/it/generateHbm/verify.groovy new file mode 100644 index 0000000000..586fe51dc5 --- /dev/null +++ b/test/maven-plugin/src/it/generateHbm/verify.groovy @@ -0,0 +1,6 @@ +import java.io.*; + +File file = new File(basedir, "target/generated-sources/Person.hbm.xml"); +if (!file.isFile()) { + throw new FileNotFoundException("Could not find generated HBM file: " + file); +} From 13aed53ec21c5affe95b2b2d9e10a5208b2882c4 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 27 Feb 2025 16:40:57 +0100 Subject: [PATCH 438/454] HBX-2962: Inject the version string during the build Signed-off-by: Koen Aers --- main/pom.xml | 22 +++++++++++++++++++ .../main/java/org/hibernate/tool/Version.java | 9 ++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index a1c9428c00..463366de95 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -86,4 +86,26 @@ + + + + org.jboss.maven.plugins + maven-injection-plugin + + + + ${project.version} + + + org.hibernate.tool.Version + versionString + + + + + + + + + diff --git a/main/src/main/java/org/hibernate/tool/Version.java b/main/src/main/java/org/hibernate/tool/Version.java index ca2404a781..12a0deb8cf 100644 --- a/main/src/main/java/org/hibernate/tool/Version.java +++ b/main/src/main/java/org/hibernate/tool/Version.java @@ -4,10 +4,10 @@ final public class Version { - public static final String VERSION = "5.3.37-SNAPSHOT"; - private static final Version instance = new Version(); + public static final String VERSION = instance.versionString(); + private static Logger log = Logger.getLogger( Version.class.getName() ); static { @@ -22,6 +22,11 @@ public String getVersion() { return VERSION; } + public String versionString() { + // This implementation is replaced during the build with another one that returns the correct value. + return "UNKNOWN"; + } + public static Version getDefault() { return instance; } From f454a012e49652a7e5f04e11c0a8cec86cdc6cd2 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 4 Mar 2025 17:31:15 +0100 Subject: [PATCH 439/454] HBX-2964: Resolve the project class path and execute the exporters using that class path in the reverse engineering Maven mojos Signed-off-by: Koen Aers --- maven-plugin/pom.xml | 8 +++ .../org/hibernate/mvn/AbstractHbm2xMojo.java | 55 ++++++++++++++----- .../org/hibernate/mvn/GenerateDaoMojo.java | 6 +- .../org/hibernate/mvn/GenerateHbmMojo.java | 6 +- .../java/org/hibernate/mvn/Hbm2DdlMojo.java | 6 +- .../java/org/hibernate/mvn/Hbm2JavaMojo.java | 6 +- 6 files changed, 69 insertions(+), 18 deletions(-) diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index f597a6e6a3..415a13e940 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -57,6 +57,7 @@ 3.5 3.5.2 + 3.9.9 2.9 @@ -75,6 +76,13 @@ org.apache.maven maven-plugin-api ${maven-plugin-api.version} + provided + + + org.apache.maven + maven-core + ${maven-core.version} + provided org.apache.maven.plugin-tools diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java index f9b4c27b50..a1dd133fc4 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/AbstractHbm2xMojo.java @@ -1,7 +1,19 @@ package org.hibernate.mvn; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Properties; + +import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; import org.apache.tools.ant.BuildException; import org.hibernate.cfg.reveng.OverrideRepository; import org.hibernate.cfg.reveng.ReverseEngineeringSettings; @@ -9,12 +21,6 @@ import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.api.metadata.MetadataDescriptorFactory; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - public abstract class AbstractHbm2xMojo extends AbstractMojo { // For reveng strategy @@ -63,15 +69,24 @@ public abstract class AbstractHbm2xMojo extends AbstractMojo { // Not exposed for now private boolean preferBasicCompositeIds = true; + @Parameter(defaultValue = "${project}", readonly = true, required = true) + private MavenProject project; + public void execute() { - getLog().info("Starting " + this.getClass().getSimpleName() + "..."); - ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); - if (propertyFile.exists()) { - executeExporter(createJdbcDescriptor(strategy, loadPropertiesFile())); - } else { - getLog().info("Property file '" + propertyFile + "' cannot be found, aborting..."); - } - getLog().info("Finished " + this.getClass().getSimpleName() + "!"); + ClassLoader original = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(createExporterClassLoader(original)); + getLog().info("Starting " + this.getClass().getSimpleName() + "..."); + ReverseEngineeringStrategy strategy = setupReverseEngineeringStrategy(); + if (propertyFile.exists()) { + executeExporter(createJdbcDescriptor(strategy, loadPropertiesFile())); + } else { + getLog().info("Property file '" + propertyFile + "' cannot be found, aborting..."); + } + getLog().info("Finished " + this.getClass().getSimpleName() + "!"); + } finally { + Thread.currentThread().setContextClassLoader(original); + } } private ReverseEngineeringStrategy setupReverseEngineeringStrategy() { @@ -121,5 +136,17 @@ private MetadataDescriptor createJdbcDescriptor(ReverseEngineeringStrategy strat preferBasicCompositeIds); } + private ClassLoader createExporterClassLoader(ClassLoader parent) { + ArrayList urls = new ArrayList(); + try { + for (String cpe : project.getRuntimeClasspathElements()) { + urls.add(new File(cpe).toURI().toURL()); + } + } catch (DependencyResolutionRequiredException | MalformedURLException e) { + throw new RuntimeException("Problem while constructing project classloader", e); + } + return new URLClassLoader(urls.toArray(new URL[0]), parent); + } + protected abstract void executeExporter(MetadataDescriptor metadataDescriptor); } diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java index f4235153a5..c7cb63f599 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateDaoMojo.java @@ -25,6 +25,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.DAOExporter; @@ -33,7 +34,10 @@ *

* See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 */ -@Mojo(name = "hbm2dao", defaultPhase = GENERATE_SOURCES) +@Mojo( + name = "hbm2dao", + defaultPhase = GENERATE_SOURCES, + requiresDependencyResolution = ResolutionScope.RUNTIME) public class GenerateDaoMojo extends AbstractHbm2xMojo { /** The directory into which the DAOs will be generated. */ diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java index 6a8581cac2..2a2b368efd 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/GenerateHbmMojo.java @@ -25,6 +25,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.HibernateMappingExporter; @@ -33,7 +34,10 @@ *

* See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 */ -@Mojo(name = "generateHbm", defaultPhase = GENERATE_SOURCES) +@Mojo( + name = "generateHbm", + defaultPhase = GENERATE_SOURCES, + requiresDependencyResolution = ResolutionScope.RUNTIME) public class GenerateHbmMojo extends AbstractHbm2xMojo { /** The directory into which the DAOs will be generated. */ diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java index 0e2a973b95..1eec0618d0 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2DdlMojo.java @@ -2,6 +2,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.hibernate.boot.Metadata; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2ddl.SchemaExport; @@ -18,7 +19,10 @@ *

* See https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4651 */ -@Mojo(name = "hbm2ddl", defaultPhase = GENERATE_RESOURCES) +@Mojo( + name = "hbm2ddl", + defaultPhase = GENERATE_RESOURCES, + requiresDependencyResolution = ResolutionScope.RUNTIME) public class Hbm2DdlMojo extends AbstractHbm2xMojo { /** The directory into which the DDLs will be generated. */ diff --git a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java index 893ab33917..5037804569 100644 --- a/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java +++ b/maven-plugin/src/main/java/org/hibernate/mvn/Hbm2JavaMojo.java @@ -2,6 +2,7 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.hibernate.tool.api.metadata.MetadataDescriptor; import org.hibernate.tool.hbm2x.POJOExporter; @@ -14,7 +15,10 @@ *

* See: https://docs.jboss.org/tools/latest/en/hibernatetools/html_single/#d0e4821 */ -@Mojo(name = "hbm2java", defaultPhase = GENERATE_SOURCES) +@Mojo( + name = "hbm2java", + defaultPhase = GENERATE_SOURCES, + requiresDependencyResolution = ResolutionScope.RUNTIME) public class Hbm2JavaMojo extends AbstractHbm2xMojo { /** The directory into which the JPA entities will be generated. */ From 512ec9b7cf7eb4c79be8bc130872687302f690f6 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 7 Mar 2025 13:12:28 +0100 Subject: [PATCH 440/454] HBX-2943: Update dependency on Hibernate ORM to version 5.3.37.Final Signed-off-by: Koen Aers --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 74913627bd..f0e14d0b17 100644 --- a/pom.xml +++ b/pom.xml @@ -25,14 +25,14 @@ - 1.10.14 + 1.10.15 4.4 - 2.3.32 + 2.3.34 1.7 1.4.199 5.1.2.Final - 5.3.36.Final + 5.3.37.Final 2.5.2 8.0.1 1.2.0 From fcfd310b38e3913a7efc3fac754d03da995e6df3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Mon, 10 Mar 2025 15:26:08 +0100 Subject: [PATCH 441/454] HBX-2969: Backport release automation to branch 5.3 Signed-off-by: Koen Aers --- .mvn/wrapper/maven-wrapper.jar | Bin 0 -> 63028 bytes .mvn/wrapper/maven-wrapper.properties | 20 +++ ci/release/Jenkinsfile | 107 ++++++++++++ main/pom.xml | 5 + maven-plugin/pom.xml | 3 +- pom.xml | 234 ++++++++++++++++++++++---- reports/pom.xml | 80 +++++++++ 7 files changed, 419 insertions(+), 30 deletions(-) create mode 100644 .mvn/wrapper/maven-wrapper.jar create mode 100644 .mvn/wrapper/maven-wrapper.properties create mode 100644 ci/release/Jenkinsfile create mode 100644 reports/pom.xml diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..7967f30dd1d25fe1b79a4a6e50e2aaa0e425c02c GIT binary patch literal 63028 zcmb4q1CS^|ljgjcH@0otwr$(CZQHhO+qV72wmoxial8B9?fnG~W9XQvmB954jDBa!| zNc#NR*+3@;Ud413!#s1`?>g#(_$H7D)m#yN3CFB3#cg^11e^UTu%gCz#*^XWpvA=0 zhv_OXm@wi}1?A-`%mh)oO)C5c54*d;j;Hx>J~Q20-{8Of zMDuUGK=ZHCH2;5VS^fuF{#7USf7SV)p_nN;{LB8YF37*3i2Pr53JJ>z%Loa}2#O0U zR>$x|0MbJVzisl^jPb4zA&czN=0<(g&o&UyWr84T4=|4uM|{fs3Kg z(YLtUYN*=Zu+UU})fkom?q*7LHXqx<3P(R)F~8R@%1CQ0B5J=cpnI>- zsM-SXqJE1&kYtIO)rBAf?r(@tK;feXJAuGe-j3fgzuQ?C$0E>m0sm83y@Rx8@ZV zFxN0T>96)9qNSBOO>lCsvt=An4O`{vs^FtXOKFs!AkC(d1v@5jb!4on&Ia^xq`060 z#y~TtN_*GaLdK`M(OZWme70i1i_k4XejO-YxuDP5Czqy2&bDHCbgwO|Z{U2pijGT| zPwX~BD>7aSOO4n1t#Ozp7;r%Od3G;_5WfOjjGuZGg*taJEqd;}RC^~Wu}mF90d$2K zTt~=w08_tOQqY-sNSXJ((S4Rn2SZ<`=S6U`%RR}3G&?Xt>SDj^0eS<# zy0g!E4fS7fTw>c}(unuGgT;XJNI-Q-JV{1F!G1P+AZ}~}n3@ncD@H2pP->cE0{oh^ z`+zWcIL4cUGj(uz*aKOp`-zb~s&x;9M2d#bspAl;6X&3H`+*2%aIBm$09yxL(4S}B zL@oSsUWC{jwS`JmcCb-CVK^fcTM=8q?R7h64ypdX*ev}p0MgBu14&d3kOIxUa=?I5 zSXjIO;r~p#v$*T49VG>d;a^CuO)(`Q)k)bpgLY=Ue;dePH;m9E`HVDY9(RV$6|hl@-gwBC*_o58EB3i^UnOu{1&W_)5GHNJjjU z-|1VC_OoWS0pR3v`~8Q1UN|Gsg9q7+aNrJ61HMb@=z85E9uZl{cmwCayRa{fIc?wk z{@!?5XKFv)L+_{atG*JlH(V_IS48%A348-WFuBGvXXc_x)@%N-^|c{7%BjJkRssV#WFw&_#Wuos*-24Rw3iI<66*4S571V{UKp4L`&0Bb{&zN(l7cteHBnC~1IF`~k>~v`iM;t`VV&#?YuS~l?sHrVthO}#5{g+CNE|z-pr{ZRQYRa8fKws9RGxJ2pF{zIu}Vs zBI689x!s+(jO5dj*)nl}%44tX=iGAR^7PmJ)e}_0jXj>H;l>+xoP+7d;d(NEU%C`~ zJ=Gf}BC>`oI8PGtQyTf{l6oTnnRwQNi2+v`Ji{&jDcEr88Z)Bfp8?Y=iGC0U3}WmS z#kZtCwBqX!Ltrf4h)YTQqed4-`Ql3Lrp~WCpbz44NABF%eBj!oS^Wv^(#W?;J@v!o z$;P`L>q(O@Af{DHxW*9hV5b1<>UeW1w0Ci#rPRqb065Q`eC}ICNrPX zhyI#pY=?n31kAN#awX@lTLeQKQYH`eR$~7${rLeTU=8pnkeDNfVVK-ccrzSrnvw>7hv<-ktwaXHEg zVzNqb^a~XXKO_+vArshk*svPMtkROB>vOQQiA!QRabO+N&aLmy9()%w+%tqNOnwa# zq;;t5J;$%sPWeUdUqLUYM(>qCExJfvVW+?=Oh?PXWK|&P{?^AZqPfGQ@7(=Gu14P? zqfRSVpKATQP-~?C?PK)f@g%%WCf8PLY z7<%x6icBEZx+QnR$YedgF0pCJi~!_ueV!L>g(pDg;rxF4$PC`-gUN75TKgK{I9|=F zVFzwRUaFNzXS(arqpw(2-0R`d;q7e$=iV-z$jr`9jql@ZwJIMJU)`D-ziYFeUp_-; zWs;=xL6piYB+}?Yjtb~@=K#_)=@A$No)GnVQy)iP9~XdCJs#~^-JO~>-yUC!Pv<>w zyxKe6U+_&@pLJfnT|empr`z{F&fUkWpeQ;cSNkwn&wF3{GFv`vo!#oXj?G7#10c32 zd_OoW%T5=3tc+X8GK0WerqZ^|3yvIi(DT8ua-YOQ)5pbJ)=n^N@Hnh}%`QQgGf5mR z<51_{ImspUZ^9SmjFa^*sq9`bB*Vft&0D7-G_$E{?!a@oHhA1>AYRLJb%;(uGMt#r zL77xwdHA^KP8OSHdb-6ORQuMh^yo(;=N)?J6w}oY{K^=eH7k9_)Qj5H~B0o2Fu9cr9MZe!oLZ zJKXS3fuP%-Kt87;=edsS zkX?LwZMa>(Xz3G}%%D#mrb_0|X#h9p3@(Rlt&BOVEL2|9Qx?N6S zf-`Jn;dj+%iOv;(w{;J$3!F-=)!5}qqwVQk_{DD+cvrY?NIFz)#Duoah?q4aYTM)_ z?ShHG-r9?jk6-hH;m_1hb|xuBx?MmdB%4@31@$R~=1HQ>$YVI**pp~|Zk8#rJXdoI zp*OOeKHuI%jW3V4Iv+uvEo!-Fot}#YL?WmfGfe?2AGz3mcf30;!ZG)YI?f7X{F5hg zB#K2uo6WCQRaH%Owi`sWm)6F1FaC&kClAtG10c-fwwCs=_Il5@XoBYtasSR2Dh=7E zCDNj~K;AM)!-xPTPf)o?Jja_xWr+hI#BU*bNxUg>yx{n6BEwN^c@I#x9U~H?{(H4yNX+d8 zc*H8IOfy1c<9p#KXm0&qXO50u$Os+@!G3G?e7600IDeT4E;6vA zuLtv`2!g%Lc00V|w0&53e<3K95bF-iUP}{hp@e)6a<%2RS-z?V zZGJUvk-yJ*=y#zHxwmPta`Q6>*AwB*WfuF%6#Gs4)MfAY!=5Mr&X6d*Q=THfm@pc= zzx7EoFty_RRQr_CUYCy3Zvw&)bGBG8r;>NsQ8?k$fV2pkGC;u;?$r4TjruCn<7VLP zDXI;P=8DbqQL4#u_N*w&kaSn3&3SA8O%v$Gq{VX*;7daca-j08&SG=5boIglQyDWE z_cq?JGQG+^>}cTa@vMxAXq6@nYEyIKZIwD{K5N}e5v*3qQ~7!zPT+k^W{4o{izMs0 ztEARKN=_E6!E7w8KZ%P{F9maro-7uaj%IHfyuFBQGfpE)Z=L6pbwzT)5Sii|#rEb~NyY<}GkAj(kqSCOyd z4b_&!{?x-A)K8udIJw%;=XFXC?#M5OxL;LgGiAmc?+FKvW~vs7lm%{byFMkd9cIao z4Jx(8mB`-Vg7Wv&8ZO03lByZy3C|899iMR#w7UTQWpe42%6YBcrCo-Y$6L1`bfJY~ z5JOu+(y7(%+9hLQ5uyE;f6moHA(<-`TpvYjE~S7?@{`<^hV{8f;GC;QbS~&EG~fmg z+ywgJk!APGV9!M!fjh#tz&8zs*;0SQ{C2aq?9C`5i;?%{bP%4*iVk4k(59Q3`s7K) zv(A;H4@U%ys9xLz*2ZgQckx**OhW*hZp=f@GNP{yRP8tS-!u)-8#|DsD6wye?>^{I zY)Mm%1+n64#5cRT-gvhPmL^}E;~SRUGY8gHv4_!xZ*yc6VWA(?s-u}(54`eZ(a5r$ zB`NnMB#!{>rmd?bCv(qi2ADuU4j!*CR5O8UOjDFo(ck6zb@zb17x=bey@bPRRncrU z;;pNPm^E(QGHmy=PDas`FV7%o?T?Egmb+?Y9#}pgkQ_a`gsSNYZ>(+jha0`^p!B4l zL%0eA6RNAQAO_gK({_A1fZh$ttf(njb(@|dy`Cf+BGpd3Usc%)TKA=+B{sNRbHxJj zlKDE`Nkzg-aJbPeW{+OGp%*RlF0sT%ak%x69+gI=Dx+q1Q^%`o#)R4;I09!7*-Lcz z!OeeKjxzcF$s+kkVbOR?u^j;1g$a1)2_Wx>VFoe9ai}7*m^3A#1GAOJ3zt{!HX$PQ zE@Bl{>%>7tzLJhxP%$x)s@l!w3t{nw*?(TXQiq&adQx0P%;m92aV7DfA)mNgC!Nd1 zjlw)l+G2c{+zRR3;loJRwwe}u5cZA`m{;Wvq~Yh*{21_&9M z?SewgY6ltZ)O{_YfKK|`C%7qkOn{-A9`HVgF2}7R4dkFA3)(G>&xri)$t!R> z8P)rEX`G9@o*nSS5VTb~%=VD=Vz!{=8ckgk=Y3_HC%UJKoi0mL#J7+cdb$wVcOS#E z>EK;ppk-d8B^yy)#606&egEqnbCheJtZdMMZqfdylj*0D54veXypT}b9Q}5C>O(r? zs&;SD9_(EX@Z)?PQcEFjr`zVmu#OHoXnV@BH%TBCtuG_i?A|Y}!`30kwHpqPrah@e z`L}1uESK!wDBZnPCys&RZ=4;D@(1!ykY3?1jo1U%SMFaOVb-re-(oeq%=(s9U+I=N zi3kKo9L=|oMc})_BE$p9m7WI~7cZ}RC(=l&`MQIPfp?IVX}NeQsK5>RLT1pBfU9@v+`M&N#vV$KazbGg*VcO0?0o)fz2iR%1zVwy zwPJt(0D^xDI}HD9@)R;Q(Ra3T60&u*v9i@SGIk)M|M$65$yyeXAI=8_0(4a0GMS*q zU!flOurF1XdFWUJ(LfWk!Ws&9YJuh|{eos)2jA;~^bB;^Y#;Vk6y3B|Ob*Xq(#FNa zCdb{x)bwWc=7#qd*DxcbAe4IXCe6;#bc|i6m#mnp?!&fr{&qt>22kOYH+u}42vrnE z9oL~D>tEqzo7c5kWZWRkGvGcYdkE2>QM-?PmL>`6`;tH*xu~W%J0z zbU^fGo8ewfp!(F8B!WH~iNKL_+l=KjESf?3Wr`_b%ts061Jt6aoUQvhM_^{VlqEF5 zae0bfSgIE}#n*Mqob9U%UyhMDv%B2M2J3S?qe)Dh{t*JzSu@sEJ=H*rg>w6`_IYjz z7UR-b<7}`#kK@w#18i)<2J`Z&^xXn$aj{~O{~;OLII5c%19O-Fh&tYa6iY?cBRs@M8eRc0RpMlkw{XfY*)P6N?fY|9EyT&ZtncfPG-h7PUeRCPPYHP=&M$= zv_#}b;%1fZw9n+xVy^Ge*wjc=Ym8QrClC;a4^o0$4tQK-!cI&!Vx5wCe^rf`0|EB+ z$FxIrx!z)b$!c^p@%es#2I^zT*$~qk6JUtekAhnPRCX2CT*6qe4%a^G z^pt4YRA{ffFFa*>vZy;@1*#`p{v6>iGq%(Q?yBNOcWCmhTbPGFv#cd?$^#>$<=R=K z1s81pEQwBKI6)eL{6rc7JAkg<9Bz^K!j&*K z1WZJsDc#$J&}S$xgXq0}mO>D@P#9H#1%qrqCl6D}(WO0^Emdd}v6CtKMw7so^n=f4 zh+qYqeTUN#8yKP9YOy1YHlNCJ#`(3@4nqN*uabmt$(257t8BHB!_3JdI`%C8r{a(m zT?5>ONWb9x?OwXHnR=PCe)}*=5!#}lojl3(*q)&rQ%B5A^Q)FLPb!Te`=&E7s9kF- zq1Tp`G07n?jUst^mh?FlY`Fg%>{(<^p80Kp5qmsq5Gh(!;Jx`qQrWyg7hS_mh)hc> zlW&P2eF>^{DyK7XsAc3DJ)c8oqnKGEuskVGvzjocGw|k(Dok#GyoKdu?HFe00#>I zfbM@3p#MH>s)OqxuBLzIP+N`|2=D<~@k=1pye0(*(r|*Zu=NkAQX3lL&GBPw0=kQ! zM+3OFo{^X@uyCht>s+>MGMc|onV0FfXA;=$TM&IRSCSIa@e?< zwgRbcTI;+qrQxwr2W)dF!IHR;9c2u2;TXc_W*4u$P|tWQ6>C%{GN>WWt!1w_Q1{>! z)P^-*Co|!pIKfcL$OycN)?Cf_&<$+5LWk|!yVb@on7Fm3^hd2*R9H#xsp{ZxpIv;9 z?@yiJT2LlZm++v;mX>ksq1PY!hk8$^?*tJteXL!6tqWv64=HP0y8F``jhRUotyKpXu9jEF&EU&n#54ZVOKi}FbI zq^64=rgL4;t&D}>cF33GY1n~2ndVM7%mrsCLf0NB6V9$ebwx-dA~w1Og)X@`Tobc} z5F2d*&3%(IVH#Gb)=%7K>*d9S4!Z}2BX6fPNZ%#BdyKrtW;Q)F#)ZaKy?Kn_FPUyA za9n+Wp&+KXouCC&Vz^e4Q#?ya5Jz%ZZtNp>mxb!pFqSw&G9!ZYYf|em&2>@%&qc zV$32fQ2h$SMt6G1@S0pxT<;*^A<~jt;W#Tql>dn3^vo$YXSS$9ky=v0dOQ{WL2B2G zOsp?R(St>K455jE{beSuAYxHU(qZi^Mlfx36WJ>_9k=JHdbilTahdOZdH~ zIRw$7UAUi9T{MN}5t(7VsR}(dpI_t|5hEu_pIR~~3Q_&&a9#x3t47Z!dYMjWFW@u*n_ z_99Sf4KFFyMHI>G{o4Au)UKb9QY{nSsy)KjGCvCp(=2{T5Q@&wFMKboTsb?L!Ps5V z@OokQZf?skWs$Wg^CHQ+?jB>`=&rnd#i+tI#?(ZSx2BL;vAVLDqiRWAFPXuUJK%FY zOm|Ap2=o$T<4k4HIH4s+jGi!Bd65o>zA0oZ96G0sqH-f}oN_fiiSKaZVB^^2%ohb; zLLUg;>fK37-;9qn~e23?E!yzE8wT&jyd21d)o0 za!&Ego&a8j+fj_~-@X$rUgI61&M(e$H*1BHnLjOeDCNuCu zqd1w5a2aPCy>2NMLSXrP4eZJ??{B{90{@imalY2{Q5!3jm^f!T+t4$+8Dezo^}Pm; zu6@{GX|=5H9J*-Mno}_k3@Yq&5poVqQ&Zxab8nS~y;r5sX}MT-axqOjSe798`u zzGwws20x_lhrC=gptddhn}*kt!A6FWtc*_(V}>Yn$PI(Yw80e#m`9>mJa00}w6*Ff zTRk4I`dHZ5-;=0tQsT0%JC_+S0)+(L8%${~T`gG^t`W3Q7-W*PL}C}$Y*1g?V3RTc z84?m69DTSCE5uT0xWR7a$Xd;gYP6hqZvALd>VOl>mxR0YU+CFwG@LlKz{0jtl|H`5 zcNi!x6^6C-tt8WWBkN)TdZLvzA=T=Q*y&%l>BmaaiVqh-A$DZP8~QTrPMLtc#9Xw? zF_XE9dCvgO zrdH{nq1j_zJ9z#@lFn4SWd9(RzoaF5x*lK&VMtRN)}5T}T0{j+EUC=2Vv(}OAG?h#^~K%Lr0^tO(_Rb!~MokwJ^Ch>(Ur6K`r5o z#CU8Hu$E@>7CH5|dC4!0O_!r&aQ8_}U#tP@xNLv8>@q<$pDLhNtqUGZe#HZ9Eor-? zy%-Ok%nh1?p6V}PrWWTeKTLLrhnx44b|q4qgBy|GZ<%=On_>o};?D7hS8IOS2BfM6 zIOy}lHld%3hYiTrnMPWpKP&uC>oIn%TAHXfI(;LSYTn@Wj-Lf`&3DhD^QoHwUgDPrE{<_cpgqKvLHy6Vz9cnm3h)t$;9I zJ#ndBd67K9O++_=HR!fB<> z_xgpB48pde(kltwV=dh-0m8I4yJ`jXkPVn{fS?Uf{MluWS~xab^C#M%=Z}+z3ly9|6 zzYoJE^nz3JNAz^-?^y_y(5esVWbn>*UF^0ZmDIci!K6~vu% zB){g9=M~lk)JzwkNM5Kv$waCr@6^NyWh(7f&eF3XdENQfKHFH?14mG zr#;x@E;M;;Mx9xx{HXZEk+VU8leBk5G1c}J^XVFFUvnFC08V;ru9WUD(}H~0Dg3!7 zC;B=Y@hb9aizZWxbmuyVz2}>7;EP|PlU@P)qnVJn?Jv{sOmM3leqaWK3Z(dSg?h^? z>=nzY^Mx@o3+pQMyVZ;E?>?Q-!e8 z(*QewT&Tz&!-Gvv;!GcovU?!(WFfC9Mousf(j-BR#+JFx)RPb)rbA(9Ply7X=Q@R8 zPc%kgiM9xM0gA2oayk1!oRUv&=}+_yF@$F`*)|N=4vJ@Xqs&`VK^^5u7+`VC+rsvS zrJ+d=SHkc-y}v1O^I3T%KD?s#UhSQBwSZMzQi^xT|C}2Thq=%nr$9q*3O7V0E5q#w zhf>xCN&0iRJNQJ3D)Gp+cqdcq3RRg_;6{Xz@PrT&Oo+PT5wMJ#3JP@z^8~`%H+oT^ z4pGC~UtladbI-DplmcFjmxq`MI#8fNla!`SB`8{mI#@{8CGtuz#c9D+pG*$hM^3&g zE&0>C=XthU;%A%XJ?PJN_A65(#3 zTg%THo##PM1(9os)BN?1?RwB>ZgyT^{eVG!X#|Bklcoq12)$9EGHbDuLpXn0Q6_4J zF9V;#iKJ@q)c&LUl00l1 zMZf?6o_{xlGyOC7#q=G`_^nKB9n77~tW}I1%uUSycLgq6McWlo7|o~TEsaS#4@qKO zMUNZ_;XNKugP1=KFquyxeo3IbVACkUO5A18q_r5r$6@de)vb6G@}k&H-a}|N2GX|c z3Du2D)W^?*-`jLCDWwGKDa*yg<=DM9=Ox?y;b9RM7tjs8b^Y_53j#IUcWPx4w^EBF@k_a0p(b1ot}y@%Eao} zOui0S6TPKs1bSXhf6Xi+y-3{!n}O^RVQ?-1b+Qk#Ls3ksXr)oXFe2rQWZVah9Vs}kZ z@dBPjqplj=yMb)rR46sTdu_Ikf7WEtrriqBI)KVrSNyI)s34=IECA?~@v!jW57v9*Y$}YS!Gm0niR4l8)a3Szc?pM$9xE# zh<%2FEmVn`XO%vpJ}G%Vawzs^e{76QQ1bk(PzdY= zG7~8yPR1<0Mnb8>jsN}?Ww3or!}%w-n@NQIj|yFgBvdCAC+^~;M+u$*vA0HAJ-ViY zMPjy>&Kgp@{xMa^ipTF*`zXdHUe31Dj2L-@Qd^@S*J*(?y;mEt(#h0hd>Pu{T4+g4 zjg_*v5^+_5@E{!P6^APiQ({70J0gDcN~M-hhhn-8IQL($C%*k;v43a}^DhS3KBs8@IkHGr-Vyo(pu?5XCRb51peV;S< z!4(f0h9HY^^&UmaY<;sOOaDY``@jW>rxPxC=WWoyobaYX z(;DatV_Iq~MJ(KSS<7q_Fxph#;Dbfw*{^%>`~{^NboxW#9UazCZ-uyyQDuu`s2fGo zR7Pee4AL`75ynDxyIq_$?He{h!@13^aH?ntWB`AxX()FjFyR4c`*UoFEABIGfLPED zZ`eBhUzz*;(-=Mw!|fPKZ(JIqpaRgk`RdSRTdNouqN7{;Hx{?_&*lB@ml=aH;a*YI zlDQIGMGnb!p32{1&{Kp6uzy5n+c3P)$hHJ?g%F7z?egYX;cTE=S$qP&EXtU@-15Ya zs6oGA=jg62tu^}g9sy&f4ql5l^;ue9E6-D}vpx~Bd3UE%_VPk6q+>ri7Y}|d%kIVl zYh?}Ae6(@V;Hv^o#^Jboz}|3mNY=9+z{MywVi&M}a!vEZHu7(PdIQ&os(8+eWVbfQ?xLwsooc%7ue?-MV$Y{b8)V=K1+Q7|5-7r zRu)(MOT2$)5D}q=z{zjPFNFmS!@EKkgsFu@@P!{+nVJb4&?RQ1%ocmYSkqMv3KIBw?_PwP0DoWo3u ztv@|c96@Na&_D)+?!nU^E2bJ!2o>LBHO~iuZC@mP$wxXk6a8m`7B7~4FHDZ^@{H1o zDQ$00fJRfw0JUR(&DsF=nZe0cWd71sNX}UxWa#yAY5Q}j8yuqbR&!Ge>jRyGH4!6e zJ&>fsK5Pk@7OZ&@`V2A?<}FO$VN%YL0pX~WRK-djy!hm}LE1o0i<=~7mrT$>ojeIx z@Qf7+8XZD!KuI7PnW5Ur&8HuUbgl)bxn_vtDz2M*vmhiHCTuoX9O>&TLYN}FJ zHt_7RO#Fw!)x|&=1w+Um>pasC@|Z_!cp5iH#;p@cB}kq(kz=Cd#hU5_K8bn*MkniZ zyO8JgxJ_7_2MKPB!hEQGG@a_fXd9%5t{G3Mqomi+Z?a{m*7KJmyH+ddRFrb1?;1R` z>mP*kUTrT2l@x6p6>pBaV1dM152H#+G-4#fmCE;)GGwa?`(n~$_T`BnOHLiUZHFtD zgSG*?CU@bqwu%nnh80wsG6uSb8p==mP*8ucIl)}101rILQss+6<)}X_ScL8&Duqm~ zb5@VAT|gHAoN0~q|6|Udh-Ml z6^f4vqGgD(E8&O{Z8GYd(fP8s30^wYg%V6<2yEJ=61z}ej2bIw3x-Zjjz+ojzKLPa zMN!_vJ^e3ibtCmWh9x?+CRWrM$@N6R2_YWf?_e`O5bw9We2KRKF1=xr9z9W6EZF&) zy(PcWX27|5|Bnq=nza0YGk<@IY9a&x_?JJ+{-1lA{^R5Nw*_Uk2BeA} zS1X1}tBoe$b9k`{%4Iul#tbmG)GA^H%s9LbAiCJcowfoMU5Zf)rb_F3s1r;pGqq?fiQ(hb< zH}%a9k)7K$M9m1?`_d$c2t`HBQxVLLX>OB~V@Q#qj{)b>pR~C=8ON%nm~|PeIo1MQ zqTVUroBi!L@?qu8g=X-_tsdshrV4dR)&zI;Gcy_c(;v$CE255Hl#s^6h4Lc^-EsK{ zG0@oHlPJ~!s#jh#vBBf64bBQoB(e^C8iVD+%$|(od_1qE`n{W;5~)?1IX`HlBB;YE ziwYboLn+1CYcqnWmqDWB`Agb(4KCuFaPBYL`P$nh$gym(; zO-_Hgx)7A#0Xz+VktMT30iTJ~5{!CBJ?IO}{8X84dRK=Fc!`)TH5RzMs%n#2h=iyg zgpwgHOdhr%%)HKd$ewQ(S8~+?bI%VRI%)yYzlGVxx@Kptt@Q4`WTmAfMN&;UgV!R{ zFxdwih)rzvNdweuKc=cBO(MehcKR$p_UyGu;zD4NzB|?VSOa@?&tpU@j1kJ?-O${{ zmxv@C3%|s1s)lkP8Y0NHKyEQkq!3Ct_}u)S>})vWrlxVjD_^LJB1G}Pwk!$Hf-6s zB3FFSzzbSEO5=`7Q>Zgmf1s0n8sY(^1_IjFE5dvWzj27f6d&D$Iwi-hDvyWSXzCr9 zJ!?Gsqryy)eu8hZv!3Ux9vy;w)|Oio>4){?o|Dq(>aFv!ixxZ>MJbjIg=r5to1xOZ z^<5qIB{Sv+=d{rZSGcYDYfDV29hGttB7Z&wa^PmO^<)YQMwR;~!m_W3oiIw0u8WIR zIJav$Cx1r?{Q_{)K0jg_u|V=kK_E9T3DN z(rl!}j1IcC1Os4{>uJ7>KJR`rQZ=r2_mI}PE2g(VaL`0o&;qwwAH!;ECKF0{A@QJv zzSSqJlle1R?@v+C`75i_XSG0MfgV+NMb%SDOz)tq83`dAnkuB?pUv_acga!SvI_xz z)3Jzj44({zRebAxDv$o9M1ppfoi`V3eDvgGQj=P(p*yktF%4J`jPmrJdJznQe zlwL%oXy$Nz(k_`rje5Oaia+S~f=H(k8r|g~ZuZv-S8lD#P1y){p4dOpKlnX#IE{_n zdI(cujT7@8-?kG&S+*MqAuz1pvU2tP5ut!GIS*DLMil6u@$&~?Q(GDV8=e7eUxR>{^YWBXl@GZ(=qv8if6A;UC-gyUt%hK)dQDm|_(ifWb z$oehZI`HF*M7pS{NKxG?P(xOYtn))s^Ig|yw0Djvl`6JX{HqIFgYnDQQxh;OK2vZ;)RQY@L?B4)i1c`aq)Ul^qd z)=2K2bSO&6ES5<0wnjNL56X)ZnPC20LP|?Rvs$>!xRaXF_Y_4eR13!SRQUIsD*G-; zJ<|!T8RZWXfa(=a+9YYpJTB21_Rj4z$O__%nfjW0WqqtA{AN(2p3{fUbz&99!6eKb zS%r9cOq9sB>sE*?n(~eGM$ZYBQr4QqlkFASWC~XT4*ZA|nk@XCA`lF_$; ziXxKrHj`}9*waoa&2e{^-=iQ8KR&vIz08 z?-A6-l$c*M0IbzyrLm~k!EQCErpoA}KQc4vX!UltTgw93@@{6V*xFidEHs!}dT)xf zbgr{N8YK3KkEk}0dr@begVrB06)p?q!GuhwxZUV5Zj?|&or@!HwP4QYdC1Ci zC@JGB$pF8mnU=3bufr^PZ{3KhPaigW5}wg=y!~2!lfA(DD6Tm+%n^EG#2mSrhfCDE zEKWxpX{&V~h$zQI-?>pUL`bd2!o4;LCh^Iw_*&#mxN{2C-$47b1ggFqYVJRDmCOUl z=DL=CU|Sh9TTg=%Rfv*;Fjv(>vE#)iq~QH9{k({(m5D{9eY32tk|)BVx*jhQJ*G}TR)9c7&s*< zN^jfLs0hdw^T+HdLBw?gvr4DM!fCUkK57J)%RKNxOv!9msagsw|&pLd4FDp(f<9BiLF|$)BLl=PAcKn;azUIUTm;_?5ufo|Ujc?{8z=CEmtt$6@sH#D}bS4$fTDYt)=FnVH`3 z1Sz1yzzO~&o8#H^i`PcI=*Zqkkore3rd9d2`&A?*u1NK)sw(P7|fiWtfBa0S#xIbFL73MTZXpHi`~uG5c}@1a0to8;p(nmA2#Pt$O-qBXl>F zVn`n?$L-SSU8qpuTXM<1CB%y<;p&lNOtBR>sbbX^9^%zh_}r1wc0IqP_%D_kOI)#? zm_<(YS_kg_MNca496}xCb6OXC!TJQ>j2UiV;5k5-o|Zj^i804iDe8`ncV!>AqQl;5D z-qbPX-~pxL0&tEC&d!NDmOKi-EbTqloev(>%LPJ+yvlRe3$Z(&JS0mH`ch1ffhP}7 z$Kl&StMP@qlxP()03Lw(i{3D+IusongB><4SZw%_v}{nUs=pY=rr(vNFmZ;?S`a~- z(Qm>Yy=4zWi!q4JI~K+6uHxCrdDrIR&!t!EpM_{!9ZJ$wY7_6AaKFX7tL+%NwP@S5 zK)m+skH5cH$;IpR@kAx`1XT1wY54_pd_x1}igpIwc|)*HO?*8@0r5ec^QthV1-Zo1 zL~Q!O`OXOiJ9#V2dKa)XhqAD(W->4a;xY_Lu_x$?&|KJpKWT?&?(s`D*ZkP->gtvarqw252h4{;~nT2 zL*MGi+TwEc>`tBT0KxakV=l!MR5YOetu#fX(V^^AKMh$F)uG0_t^ zm?$4MMe2H>Pj76t+e0$`ytUn)(ng=5Agvebs}0KqB1&?ry7e$!?r1Gl_Nk zQF%$<&{yf!w40N);CZob*MbrUMc&CITn0M{Q@)5gZY7_yUl`AMkVg7KGNR~S%t_*^ z5Xj@q%d4P&*APoZQMQ(cjuaPFSc!|q$qfg4G6vH0ZR}oAU>(-Ccw2 z$^hJ_#D$~Qy6?f zOO8D}y%>DxPh;poVgxRQC1aM|p7IAck3IP$fn2h28cXhvsU%qL zV?? z+5gd%f|bwZ{;_K;p|$SRwS{i>BXDdMHTk`>jxpp%xP~^6!8VV>=cFQ~kzE$*w zVNf(IfZr9yoUw&gp}3vN;!J(%zRt>e`8Xb-2ZE1NM-)^Mlo5va!~}PH;bXVlY>s}c z)>VAO^t}HbQ)Vy=(yb}|Igp@KU?t6AlyjP3w|AFt0gEr)_R%0?*sz4K3yn5}m`U^F z!*?Cc{k?3+CnJ6Vg0RA~UwaLF>^_R*Pv4y z$K%UUSLHs`Jd_w~6d()GHbJbk1JPv@;yrw^drxV3Om+0)>a3;_ao9KU07RMAr z8S*Lhawz6d{oFw+-p3;RcitZbxOUSKYSZB$&14p;*ziTzON1(Z(n_NjHo*p3zwHeM zTG!Z&K19X1zHGN7M7wQ@!C9^D!h^L>ci+-}4W-n!0{ezc_#*j9kpU(xhC0IQk(O}h zt{O|!d7<)7D_olVW}`2y=YR#XWa^7XC`Jm`ZKE@&Rm7;8{nGD`P(uF9oyViHKf9a+ zd|MIR{)=Vx?~IDW%drX#mjLGm(RLJqJvv(JAhm1&kA`N)(1~29+%b{|xTaW(*)8`f zp)L`MP#U0%uoLxXZVp z7j#LUD7qYOQ;}zoxFL2xD}^k8ycCpv9rP8k=4@qJxV5MP@QeAO)Rf!ckGQ$qS`*S;WeN4u4(X085gh^<5)?sf*|-5Rj0jR9B^=V2Ik6a#m5+>mY*=cf zILGUX^GoyU<{28E7iO2JekL5}57nr0J;V#}(9dRvYPPaqajQ-^oW+k40bd^i90oV& zKPl=D+!D$c0_66xRC*eoSX7j&c2-i30C0bb%TNO({*pKJeeIlXIYsJMXph zH-Sxo-CQo;3ODLJe8)ny+ABdNrR1Se(B=D;`hrdFT9!z(T&_XS>Y5h9dpam)tyHHe z%1H&fZ0aJ^$;ef)uVZg)gNRxi%d}QP&IMg~C!{DUi(LsZ2(``inRB z;joa`t{#Ok=kI*eqR`ZvLj%O8z6V;QZlJ67x5a*PF+lKJS9J`LR_iwP5sCacWqM%G zVQwyx0b(;KY0l%l8jg06c$%kc-~>Ks+#eSp=bus4*=$)~AF^A92%Ba^2(Dv5LQq&L zY??z2%4VWVQN4f=d72L*xD}z78=;r(9zoOHorY(_D%63zb&^VT?O1?GAFm$>Tz_|A zn$7F3>so>-i*Ar!m}e690dre*5j`o)m%$F$4AY07L}@ADNaKCs@YUNZ;{< zWHpKF53^y8e)sf5bX<2zgNXke`sZLqD-I%$t0r$APR`2h{y$#tKTGaK0GXJ84a0(fVtRC=_DV*XV|S}O3F z37(-5+@#HMD(P9=&2e<6=Q!@TR^zIyKbud$f9lD{pb&F9z}TtWkfGWQYagjePk;kk zs>Fh__G}}C4WA6)9;XN$Cl=A!DLceI4DAQ4`S^nfR{m&1zgD=BL%r_r1WTE$v4OIz zPqSfMA20fX{A)^V>|$_kdgdDS65Rf5Zo>ti{ixR^-}k2K4TO)P(a6xbg~ft7&@mGx z{vk4S=Ak_~t@Ipv0|3KU{4RJ=CQR6cmx-|{_<2D`TKmE z@{y%-OiZ$cwWT)O4QyilrJ!oX3EtuZC9Z>BgSFb4f_*`~iv;kEmt19CaXyUW zgVkKIY(n~9X^1>c)L5Twq+D zoL#)UJU6HR99&)*7CVK>MyYACS^Qf2a2Xc< z`CwlAkjCRDGx(v!LNEepn8S%iuu0w6nta-`u{frkuX-lU%+~RdwNeG`BN<|W#g^a- zLKic2{zr=WE2CE#SFT6PYx<*vW>+ReTn3T*Xi&>>xZ7g272Uri`0diE9oS)~`12tX zWMlj5sYYcw>w@j+fel z7)X^h3&N$sp*as!2hCwerqJ!=j_|@9*ZN=X&g(Y$(YYq45Y_SL4nJ^4e?03@s)a8h z?0d&J-mr|waK6(aTbZ8r_uZ~1IS`IqCEbGI)JkL49=i*VyAzLODh+4u1;zE`Cn(8D z(TY#*YWztLYMU`E-(}t*N`Z#Yt(YR95=GqsE6`eui;NWg0hJermKiXw$2la^J2F2_ znbpc{heZueUO(S#34EM-c+2PyT~Y^t%E^u#NAoDL-vgzq$myT1puE^l*H5`l7rWnO z(E``4Ht|SY<&K7fI>``w+C}jsn`006x6qMXS4D2~R9lKv95my-tBX9l7&g2Rgv8nv zM3!HP!ZqKsrpB5JA$0EF<&LmDH?MAaEl|@Lb;CP`It3BRP=BL+AJ1pOC4C<+p0rYw zl0K3wH>_M0qh>RVY?H7y1N*(IML$T|bggFH2s`NINcRPlS(>lt@av5wP<#ChqPO;E%k>v3tvxL3 zUIi!yHm$!u*s1fO{+hZ#s?a`W4N`-d;y02vA-WQX&MHkjE6pYp<&jyaV4~njc}Al+ zqDv23>AK19!jj)EXL$gND}knvf}u%8klxIRynE=zKz8{6U#IupLVA1eIH1gN!o#V_ z8QwLW6TbdgKz^R&)gTRjI)JXBKh74KHmDh453ZHl&n&eVw9Bq*(F8`v6R0T`fo%m2 z*d!7e2yVwD42JM9{KF-JELx96HVzrh%aQPKj8xMjbFo(zgt$zAMd`sxWu0M8^c$j` z7YdJq_)Gg>(G!Yp$nj0a@Mm=qkV!QPo)P=^p)M_uM-Cnc&Se}Zj#n4C2VKTgs~EynKiCCS_{pP5SiZPcp z-IJ!3L8>P;#?lZlPtKTJ9@c18ee5sPn7iiM$zvxVJ%PAb_-y8k;Z>vms1 z<+@Q+zr0*gO+YFc`L-XpsuUL#fKZVK`e5VAEL&pjI&e|)NedRa8_1u>U*T?s6k+ou z=-rNQ_C1emr?+=}K4SM$U%1;VI4b^C6ilAwKu0GE6J>(h4n1ZXhg>2~E_+W?ux$Rx zN|S%oe_s!id&9L5CQKR@$IbX`fQb zLf9rO=Ou-_{HDgDXklMsXi*+2X1*l8Rkk`$Zz;8Ehq{CYxcrg7DI1!ga9t^qGfkGi zmD30<1tAcX82dknJDsqWZxQO^E#%pl0^mll-J9Yd zS2G)>j(=|2u}@W^McE8+wl|ndtkRIwZj#PGjl#85`9#_L#mlALgUreQ`!5D9oiqVU z;%_d_&OgS}|L^nvPalbzruv2$$|pEBNtDJuNlB4~bYc<)wta$WuyqhAhY2*eQbLK! zFfjFM0`ZtY$MsuA&1u5bB{gs9P(G*4&YSuxx~He7xKdP~tNi>=3$a44p0_QNtI6E2 z_g8MekLSKnD0fhIQk8;;{Jn%O0&%4VHgwEzeI-+xkcz^J60H$Tp1$QV%dj%E-9!bD z@O)ABBO*t!97(G9rmj5mcv0bLV-#X0D(x}b1(o^RBtwS9^{M?tQjE7Bbit|W$_)~WXJSES$}HONK-0Q(xy-d)__-IU+^Wo*)I_}mz5b`Xe9xe16g!p^Bd zKWF=QorFboFar*8Y1wd+W+N2p0d&0x5Gg8Eg4pX|&Jtk;@PR!VL4ph@%JQ@bZwhrN zVwz%aBs`gS!{kC>dQCzbHx_DR>Z zMlgE`#?o92W6btK{gQfBz;jq}Q$>Et=WON3zwkZh$n*63EnpPtBKKt0yFvSARll!J zTkd?bn>ar~NMQ`qI4E|Qz%&wHUQeNVZqdb1#Vk|?GQtpt5Lqj-f{fzH+Y$w%Q;_il zqj-Q7gH{2Is0>pb9Dc`bT@Ym!d2^DrmLhFFP4uK=Gtxz&&L<)y`YnZUb9!`UO}qeu z);QGD1tTOAJq+HN_GxZ>+^%Y$mni>`|FudtA2lFmA|mCAAWWg062?XTFRZ-$;OlV7 zPqC0!j&Ki1%A)c}s?E$X(&g5dODyP8ol{>CxP5v^=aeFpg^(cpQ zHk!}_ZdWBXmCs8$&*~znHK>&9-g8%8M01+0(9!spF9FJhkuSU2J^wV#Uo>J@vmD8K zJillnAc5UVfOFT${dfz>Bpa*Z_ie)Wlj}Dew_cT#mRYse5@*X_7%Y*S8Kra5@e`PB z^K9xMiA4(>-dOI29;z4%Z!X2!HIMCn{wy6vUSctnwdqx%5YLP#5D3kdc*5!xE`6+Y zhlQzKPzOtR_z>%B6@%9`Hm94%+VVU3AoCG5H)c@_aWvpxE3ljE9M{_nZ#|{u1a|*< zJwKYfSQ z%SK#&KAgXwAy<_0UKik=%NTDL1bF0D$OxmMZZ`?Z2LuTU6`XXd~KT2DZF?0x+Hwg&%I)6uS)t)r$PDVyHw{mMA8eqm-3=e zM$A*~!&K&7HqB-B0oy^*`W|`;xALPuQ4J+ZKfWdgd7okp&dwmDd}Q1&?apla?X7Ef zhYyu!wlO6SAb*mp->{7FT>i?@qjqNuP5m5w!^^t}po3aU`rwLE)E%sYMh2_$ysz@S zZN~k1#p_VMA@$W$|M7yhvxW#zi6-h6f9(0^Wd5LCzH}t%2;hncED^M5O(Zl9D@aXLLsGE*NP`6}t`aq45=_YC z$njTiwokGfmTr6<4_O3L!t-GA%b-^(BYE zlZv1d>XfGH=JzcsuDEN4+v)Qxkpm@_msrs)>qLaAqlz_#74&IZWBDjUuvl3q3s2h& zA%F);S_JAh;|z!2#erL$_MdQ46lUsp@b}{K$=d-HJcmNr5DoPtqkSYRcY@!DykV*k zQmovIl>`fBV=Ns>h6`;K1`i`&`4rJCU~XSTvBW6Ww#YuTm1Kya1vRyK<})GYWvMoC zvB*(5A52PcFOHhhwjdYIAJjg?jKaAp!v~weYMa!Buz3CI;UYq(#`C-7DD?I^ReR_j zw)D>It8QGA)xwe|#u~}$SaMb+8M|QK_yZ9Y|r?F=Cbk1hzWiAlNt~y1TwKu== zPgCatvti_vXPCS>T0ov6!PlpDX_0qq7|??2)WzuW2+(zyqstLWeYI1Z0Lk?6 z?@OzpKS?iA=VC)C!bNrFRb_1{N^BWe&`$r(EQ|>NfglAifin&&s8jV53?-?=<+4@t z@zbz`m;^BhiB@R-*)N;{p#ZR`lc(@zfK~hKQ>eOw8X>_=a0C>>U^^3^DJMvA4EsPH zqO5o)hDem}LCY4)Z-BS95P@k~|Tg61UMBt@0p$|&9{)JVjFLk`3+{dPFE zO(*BP#TiQ08r_?#X`!nX@BIvjLcc{K#9l_0v`X8_cbOOET`E>e>|$o{zy?qC}g zHl6NhHRo+*XyPVa=as56PLr*&yyKkvZ11%TGvnTWQE1uLF5!AXB0BvOv zrZ&s{?NVSAvrw1x@+_NsGI_n98#izEGV7&VC;_gWT>&6!-%$A+Rsrb^oHwcM!FEY1 z73nB~VEAEcTjIpnn=U64K)A*KtDDwQ{ho%c9_-fzu?=SG^j?sU}=j}?Px^o>~m}BittLH zPd~*}{Q4JTJQ_6i=KXhl0ela(!Jf4P%!ClqQ=B z6s24hQBbpz*m0qg0 zT7@q&B**WeoO0pPzb!}O70i{-%bYyd?vReRHNycLB)54T9V`U(i(cD^fsTX>-!b?ygj7>#0jbDR|4}f*=GQWp_DT4Z=1v;JK$j>bArd=`6{)n!Kx=2-#Z^eR@Mc^);Y#D3~ zp@^=XwEl6)<`?ik*JsdSb!@_K;k@@dqxo+kssAZa3ftM5T9~;w0{&|Qkesxk_B|7Z zd=dKfsRCs>L2@ccMJ?nZ$;m=C0cY+Hufp*uY?5680ViRFn~c?+Fh3StQc-LEJ^^{i z?`RN5ilH4w|6M2UWs2YZVm9;swzKmE^qoEjIPc0qWJ7h#PBGl1=-W4sPa(5<-Kg<9 zV|3_alHFjCe6 z83qPp)TB(QygIe$Qa7v3PkC+l^(jpq*N-L`P&Q%nIN$`yh{uO8A5$or@<=Hw3X^;fCo3DchsSB4y@*Xb3%@tpfBMzw`Dp`{8p$V zV}fJ%I+A~BEI#zk?jWC^w@EfG8MIH;N@BC%BGs!-)Cu%Yyzk;-uO`;IkjE~`DbK|{ zX$CF@K|Iq6?b6z36<+-`E_Je8g|U47r5md{KUUYAa%6w4l|E{-1zF=fJl+_z?1t>L z5cdJQGYqqpArk2hQopA5(p9HcDp9p0u7V9ybmwVJLDuf|$9f{Gm|Z48D~o?XBCx5r z)0X^cQ{0HjE}l>3bV9E*9>9*h9g*6re;ZW~q@+wAy=Ifz?@_78z1Rvf2Yt{`n1dYU zE<(E@7;Bfdo$SH`KEQ75l9zg6mw5sCIyZ6P%YP%@fp{g+x{Z69(S8tMNB{OW!%Cb2 z{rA~JZM=)l zk32Tep36QVI76^k5OZ*vyKdh6MuTK!ggO)?iG}fMzZ+kORH4Rs#8>dx4whu+*4RtQ zZjIOto09Jhmk0D^#{n|v8zSY!G@asPLndJG{*F0}K0lA*{Wpp+3&foc)SVI>6Beju zVcH`b!8b4(iyJ8}c?X0b1BE2;f;NtPMFTQ`gwnJUHtd8{kt0+cDeja&LJF!OvJ1wT z3!*`oF`bQo*>-^$MIp&=5=>A}Qc!9&(f|9e2oz;Y5F*<|iuXX3_!olFZWLqvno)0r zKdeJt79b6~)JiE-4H%$%N^$sy5j5a}&JmopAPpDPcZn+TO9WwrU>>yU#;g#IVvMHP zajg3B?6xw8Apd;h3@w?g&wWn=xZlnQx_@_5|L2V(>TY7>@_*rc$r?Wmun$o`eYK~@ z#!bdJ0vS*sL|QH|gd~3a3_#`{6v5MI2}JJwy=rzGMgw_jOfK-Vn6}W1omMv~1x*T* zwqXHcfs0+b~a(t#TH9-3VRf0gjU+ODcb?PKxhW_F{BVwlN;uwG;cV;XZ8aIKua7_ zXlJMy1IcM()VEeP7>ji>01ryRMX8HR$u%`5#9k3Gu?$$+12HswR*cj=axl7RJmFEg73VMB;dA+aPChS zVyT&r4=?Y>!>=aq@}*c-C|SKQ;l_CAaIAb*a+BpCu|%BtfH+FBs-@Yu)IIZs#y2IW zK{$c{GT14u<$_}4Em)EP#uOQOjF$etH#)3G;J)fjIwE}N5pH1iIC9B#HOghRNqjKg z7?G@5({()xA$F2v!&SG|>-Hd>c#&4=tY#-1$YzRPh-RApTs)e}et#Rfr(} z>!?YS`HCsA5mf4T00_glIx5vM-USPz2II(5r_2a~8}%r0lG(JU|C_t(tARpk(vF9I z+NQx&O2@2@%pWrGfUXXmoNvS~c64^#zcz0#I*LTX;u00U=gWOch1iRyfkn4ekABO! zOXxhAU>TukUTtt(gASQm;4CDLRNh|FAw^#aA%!&96yV#Q9D(>eh^=!M9b(7S)O59`M=ndiU}@AxxrL>%HmJ7Mj)3}m~3lSTE%@xmD7 z&*K%S6knCP2eRN{;#AeI9B0SzRoPuMzYh-Er1_D#=CV@c^Wnebh#_5=@vj zq{F0Fg?Out#3at4y^JWG2C*8&+D6biW==Us60EGHn%>(&9Xr4~-C&+v9{$2Sh>CW; zIeQC6p-yliB|1L)D2{+UBW++(FEGX*u;>#jJkdgeNm=0GlNq@9ZAJs-0{MVs6azomuU zS-wqEnYj(+T`U;8bx7pcZA3DX3?qJ@(taI zJU}iy>dvVjNXji7#1{?cAB!1xBz}&J>EVh$wBR>f^?lEt!=&ZJJ-7%%vbsQUTfN8; zR_YmU!<526M#>hymB;-;N_{Pfau$l>T#EhGcr>vpLBvZNx=xGr$zD2i0WdJro-}je z2|W&ng>R6Y%E}TX54Y$!fEL5vj5Vx`{ zu8C0`!7D%fqX|&H=N1z2(+JV7qx7w{@Ga90eMcQ0il=-*`19YA z?JVwGvjk^<7%yl$v1ttOqAxC)l<>0m?R=Vq>o?%PGK>Vs*-I{MU9!^9hF&9s~VsnYWwQmuP1;!}*o*fT4xQ$=rZgIO{+HB~0* zO=?jCR5`u?p!<5EYBh4f@%n?}818ELh8m#MM4kecEh=Y=X z+aEERk;5xQ6zWdCKM%(*yF7M|y?$6OX)X0C;?ZRH-GOL$K#ag{1uNVb z@9;vvtFjN9&T>R6UpbMaL{zwnfbAVPLHn%67`cD&BOarM^G-F3XVbmq%l-M*7<6CG z2o9ld6O-(*(rd}@VciZ)qGjC*n;9M1*+g}QT5x)e;!7~CZQg0rOXt#sQ|~dm1oSuu zOX`V3b+0x_uQn&(1AcO%j}kKl-r|sLK2B^tMhP>YPG7nm*Q5#GOSyei>@H3JU1=Y% zy6%7E>`GQt7}jupwqJwCl9#Gp2VDp26LxEczT-6;OU>9Dc}%c9^#uEkSal%0GUI*% zr6W7ez6f;NlWz&x{@TCCK-PxUzHYdk%yY{?3$ZmW~}*yQ6~Tk#7eH(^1IXfEmb+{O(HG!|8+#;)JQoSq%fJwCcRIiD+Wd>i}JukW{l3~p|Z zJoVvzjqc5Cu^*)IH1@>DUrgV>jSz0~{h^JBGj#)C$!{a3(}vqF-g1gr4Qqmz|VV~Cn-`LZw>;M9I` z(889mlL8Mq9mm;?9#J3NS6Xt5&saxOr;e`rBBXAQ*yH!UG;{C-)GloxkC^sy4U=;k z!E%U#(TT9rompRyxg+@G^{Lr?gxZ~zu`>x(E<}r_G^5pV1)4S3dcIo>*JIV@NxM>8 z7`~DRw!)1Se3GM;Rn=1FIzn0M9!8~~uu`L}wd<8*tfyoZ(N2b#$-_k!n6hpk-$Smr_85v_EsBbl6L73MenRiv$Yjc2r?4!pLzet!PrfhtC7T9A` zvFhDH+tpF%>B?vmS9kk+(+kOCM{vv5xKL-cpA`vRSlN@vsQM&jEYMMWT%eZNpFX!ws;YmA(Q?QCqm)e;#CTa)kgjO#bu{Qu}C*{T5f z1qBq|SQqCc!Y~NrA3sn#8Wa%}0ErR`ND1L2G}7;;>Sq*d>&52+pFurfJy9aa-z4*K zcYW=V)#255f$Q@vpW`gAZJ&pyT>KuODkE(nd?BKsZ-kT?2ItZ=OLLhf*rUa7n=@i#=T8cv%C+a{v z0TBrRK@m|{adUuSz*Iae+k41`Wy{8I{Tuu|-~by65NNHYH_bo8fU$BcVP`CN|HfzH z4^iMT1WoWv)RCLjaPN>~(dx4(-A?b~?K^;oM!3B&L^#MWgmuuT?``1{X*=wvA35FR z;fpeckH7?`ICR^o>P*c`zNL9fzp$t?4aA+N_n_9o28U^eEZJV#aR>lb_{g>fczhIS z4`InCE=@6}Ry))tEn>!Y0*iKY(ojQGj`6snWg-CYWOt%3_^%sZp|WO;m!B4Nd6=M6jy&BM*P25(INi)rtCh#<=H6uQ%39X(6xEgGM)v2+G3oGU*m^?V z^*XMy$9-f0Yq7ZtYt?GIm&+Vv18N|PMUVCqXx)A{p z4;FdHIKM9yjCm?`{C!GAA?_b8o)Qw>rDn?X{mk6u9QMRa|Mw?;>bQNF}vz{Su z7f`|ZD8jKwNb6MwBw&qFT>`xH)=-Gjh7nA83N(LN2@I+`P=Mn1F{H%h!EwBBi1t|4 z>m?Uem}o(xs8-Eaz|->pkp1g~BfN8qXee0+Ez>%zEnT-4b_=ClV3G1`=dM?5q<=Uu z?{ti`BHs8EQYb`$iQ!O4+KMD#$G7!ean}pz(j_1_lnUKGEvpU!lRux4>LF@_66cT; z%BNrJR9#8Z+zi(Kl6{=AWC!#Ag%EBSm;Q#Qv{4Vw)w`ip}p`C+#<$UGo3; zc($G6_^kye>v9knUhfNLnJJOj-^(fLD=aG?_q= zmJ+S#OIMV|Ene<>6K!Va5a>OLj&1h)Lkzgw zAO1lr#t)9`bZmK3Lg_oFcj8q5MmGGN^T1;Rp)lft1q=f8Hxl$cYi!>lbF3JP4GV8!?S{R}s z2f3}5>DYaFe}P~hN0<7xPSpU#4%V#58jK`lN8p#fd_wdbeFH*O4a=r;XzieN(GqI#DM=PLl!E+bdOOyH<^Y+9Slvn=26|7qM592? z<~JtPWK%pjsEzlNPH|H~##3@Kkz{}caVbh;MEPwqHOd8RG!l&mOH|^cA=9=@PWAUY zN|F`gF}G6-Jjn4hk24J$5}|TluPox5Ql!0@)p^t{AkSJpvt+*spQLO_-3_rsh@=t6 zu+L(Yo5wC2%C%CI#|5t`r2^JN`?=6s*neUa-RY6Imz_K1-P@PBjd$+haTf+wV``7t z%tETiCT&iav%V9##&mMv^mf0|u5-`aJn%2~LS}PVSvQ&mxydjWoX=HR)?#{a)h4M> z;YSpCG%#7Kcqf`U#&T1bL`9@4Uz_vP%_Szk60DHwfcNm<^_VjF1{NI~X$@Hv*}{GG zGS^*OIKn~kX5s+g)lMi^*a$*-2q4~tPNHzHRwu;Q3k{c4wMw@5u-*zka|!8Qz$;X` zq=8{=(y0O(>#6i|qUY|EP*c&Ls=*0o@1Z*Eldlwf9?snm9+sPy5I7ovmq*pm*H57G z=Pdl)T(R080a%>-z49m8o+0ermG@MRy_J5IPFrh@f=p+x#?j|5Q~8h@F^=!5L6z?J zoMIS9=52j9un8<4nR{S^konpWa_aFoPoeMfbBKi|XPn#jfLrZ{*>Utc^;_RoggfZi z%I8_1#~FCW7&-e{-GW$*6TW$ILCiq}u@gBa(HYXHJ;Y($#lj#91Vt3Z0!{pC7YsP7 z39kzpLP zQwzC%#dBHC8u-gRpC}u@8zydXytoop*svaf?oeSNi$sn1n_u_tskG)M-0@ddqys5twJlgu=>QOfV14t1LvL+x=Yv-lOr4cJ)pA0id;<7X8JfjKMZ(MsUB7ak zp1PUu|F;N-6iRAMU`DJj_5-bN4mp$QjQMnKM1_oKw{?at770-b_*_dO-Wk%ebh@=B zmxA#3^xAA58*Hh>tX82$I1Cw8R(<@8OL{bIK&665lIUc%JysoMs&k13ii4=G{;VDb zs7wql;Y;-0yx)YeNtHJ}j#EH{B!5v~Sf#%pvP$->$!8oT;N65FS4Ko;*5PxjUfAF# zPfU91Y9>IU<->g>|4VLVB6k(G$eA(uXhf19^E?bP8r!W3=1g zFOq4M4~{YMa>Lmx`9E*kt*w$lCBF}=^ShyB|DWpJe><#yX(E%Awxk9aQ25d}&W?88 zN7zs3SR$Z0V*F*m^7CdJ-m18lqu6LQ)qU9LzjH-WlS*j=U|XJvf4o0@T>>(~?(e~gTs$)UR{eLmN4`+Y(^%uSB?_~j_e z5jnD2GLS!Nnl~!zBWjrtB#jGIJ;w-@cz@HAyFAag@*X1l|S~J%y;%KuGB( z17kGdx~RTU8n_17`1<;ANiikjSj;JkLPY5V{(jQdAZa*BDmKwFsba_7IR5yG_b3&r zKaXX!(JdABbscYyUOR8w%Ln|QABXBd$2Tqryf>6Ll_#S312-jqHKegJG-c?H*gUoY zCz@EUB4N{&y}DW|7WF0 zJ=T7`fP=b1RJ0Gt^5$yzYN>q!YqLZN3Avv@UtOcX+^$A#KdIAq0<{J<_m?T$&PD8FXb`Pd10m*HYjh zI5IAQM1`~}S6#s6sD}i9M=6^6@Y19K7%6?xPC_`*5IRU&oe)d|0I{KK12#=l(awa- zo>oAlj=hk}RB1|&d$3+%+W4}CfS-{DH)3uK+EYV#wTg3o&m|ts!dSKfJ@JeHu+Hdu zo2INid*vQOl^kst2prB(-X)EJH39f_(rsCI!ygz_x78zeX})T+CUJ|terDul`v5Mq z4Jr;yo2KJ|!3?`k`u<+Cw)TKu3<;U5qBaP|> z<&D3RN-D2d1JC<*>%x&Y@}KN0(&Cp8#_iDG>OE!`GRmYUT^d>si`O2DM-2)Z`-}Gk zI)>9HGeKkqlS+r@RQw|R^4K*?k{mX4%9vf*3=f$N)$5(@llpihqw}^`XUt)S8LwIT zsiDrL%>JZp&H_m!XQsG<`{13My^7vzsHc&9HCK)Z)r@2gW`dfi&T~bO2JgC+S3pL= zK|e%#NuW*rUF0Mcf8>Kp|DBig7`bgHPN|wi_4CX3J38tO3t`yAcuX+`B^sOE3oYb? z-rHor)!}bR%ISJ1(1ITaFsHxT?6Tk<>w3A9dx!qcY97{^Wtu9CX()3}SD)ui#Wsn_ zfCsY)#IFkK*75`nqJlz|JDv4ne9lJb@@^ONdL(Xq25QYa6xJ3w|8erXCC^+wec<%E znfGA-LZJG>7(0`Eu*FCF2JhDlCDPHy?f)26Wt+Ic0yT5Y*kv6++2bW-dx8kVspxQf zUycFV9R_^!&hColiv?eGPOp8~J@@1Lsbl zmeVO=DcxuO{P(GS_C87P6cIp8n;0J)0v5O zqV)!{k~htwxCOut2=Orq^CFh>2em~dl#E`MhD9udJ!W!Aw`pu)I`P?kyV4A@MUAqo znN~1LjvR%Zk>V_Gz_(ttKO|u+eC({n@q~1fu}vn!bB^Rukpf6+CWR;U#(p0bce3zA5p+-#<{Oz{{Bg%|JMQ5e+koa`VNl&%i13Vol`+WbaQ7 znVUavrmWP7Q;3c86$>QnPVRt8a#cm1P9?;d!zV9b$}XXB1f6}C+(yk-MA<8m%BQ;x z#;ruU!lbr#{iJGPBK14omuDIQz7cY^8hTUE+J{OWY+&ycc4t!d9N6x?FnDk_*Y*P;k%T@cOO3b;pXfG8OU#rfv1|DLM= zs`*9(eptltPp8dMC&^k(+J!M)_=E5Z;QJ5uX;)U|6^DMQ+w~D>)s7lu<>#h$tKJ#o>E}FSKSsr9)0!KP z*QObn7#01eCoo2|COUxl=zQ(!#8JpQ`_Hr*CKyA1OM3hgCPLbqhusHxb|>2dw7BF|7&4bOS3i({a}YZsTiVolPCp$v!d}y}6!s6q!Bj-W5u% zUcSjFAX5_#4d=teKM797M?+mCjinrm082fcFH4?sxV zJ;L6SdxcBem`}Uc6t*B)r%O|y7|;1?k=)~DgJi=A$FT<^WKGxDLE9avk8thth%!HP z{#~)b?cd`AOm!IJ8G7ZoN%XUq*|lNwDa$%2LP_6;=ZBB4ovjX{=f1jJ{zl|0ySDLj zkx`vPO_)BFP3Hwt34o%Dw&gSP?=WNUqOBlly%r}<5O50#W z&N==FrtVb0+smGDT$0H(Ko^%0u}Vtk(^K1uYtQAUOV>#MO-TY{XF(}C^{(z79)pX$ z^N^Ip+4G=c6J4B*N4W<;!vNL!7FiB7 zRO$;3yw)mpMt6YD08)hZh{tmcqJ^)ze)@}m_BZ-m(Sb+|<$e$);5d-lS~>07-;+gT zj-|i4*6U=ul2fXuEWN6G%tiY4I^rZRXyUsZMQ(WH8&YX%^Ca{AR_^2#iZ*HYAg{<% z&2dM#{~hT&uF|31KgAv0j{wd8Z`2I`73u#lRL6f1UYKP0a|RYEc)Ol@vyQqU2X7A= z8CkDeuG97YGSR}S2%BQ?2#1;Efm$n*sAK1>Dn zQo)C8yZ2)D>J^ZkBo$>m*BnL4)PcyTEG)mtbG`4kMxXWr!~KY44F1xg$k60UDpAC+ zYKtZaSw{_fzYpj&2!+b5Bl~2=>C{_33irF?qgYyD-}MTcR46cN^M-1TStSX>>SEJS|JDELB*4 zD$_M@lSId{0}(nYzhqkxlBKi1jvx;81A?t}bRH!{krqwFeKoNgGEfB`D2_8^oTiyE zMFxj|=(}$Y=?`3;rGg1b4ic$m*6e`;f-b@#H-kOLq|pRsv0yrAvFv-L+gXgSjdsE` z-8lCpDRQOl#`akg2(HU9u2zfL+{*Qu`?wJHWkH_gu+E%NPt{a*vtygu!`yfvNPgh< zx#M~SXtGO&d0EvS_~*F(4xTe0Yxxs_V~CdQHN^O|vl#p4_i%1?1R1BGe_hPY*AEE8 zT-@}B9GA>9xwY8t8$!hELC|+Pt-z!^m$qIoQI*CF-ChG+Y*E9gQe0-7E&8oP^e!za zoMF{^W(g;#8UVtOS_TT8)~YUfP+4}CdD;<*qZ$1=!vSp=FIyJ|Q9i00>?Jw+J}7=4 z4t9^ExjBFBU(i8cDyqivqac_6D9953J~{-9O>7;E|GyHUDyA@!kByod7^F14o_sA* zE*}69LcCazV97%h|q{5r%$4+;ND7O;3MfW4tcL=XwjH}B$f<(Ag z*>MZ5iRslwtLv3xc4}+)_v3x_uc5!tgn<~?X?_|D@F-TK>2RKX8;N25Ze*1MeuPg? zKTPw!b)Z9=49wD$*mM+n7pZWboAi1$T5F75n6=6V5&Sdz?rfMaVh$!F&r*?&pl0U|!yLeCgfy861dF;kVl8S>L+|%4rp@Ev zF<}l4K%fJ`>YWpY8=STnK}^-$C=gg{$zkQb$v@()hTJt5faBXT=-EGpfKU&FB4$i6 z$)ALavbd>q9&|Y=%wjKH2=xGKkYnw2C1raR(Lnki9gwD(7e4$NS9^qt9yv>fDRzZ{ zj;7#ay| z6&BvYo69P#D0`2GVRN^{#l$B%;K@3VEN45^GD^NHufp8)7Uf=wXFIK_%iQP_bBYW^ zug~j01Uzvw%%_;Gv;`ET|$c=BbAf&x`YY@to5Rz*n94Te^bnC>YKx+7cBQ?sP zD%V%q_j;N~R6d=$Z^-v^!_D@8&)re3%q9*$x!d?hRZ{x*qm!V%qw&w#0Am|Rb0>2b zW5u6Ee;d;uwr;2YGwuJsj$>>7M>_v9S+8rbGNwjF7VgM-@VDZRq9-OQ3KNfa5SMVn zZ4yMcGEHBlepCH`?RfDIgB>#Uji=9AwF#A5V4|OV_%YAB&bZFVyyorp0=@y5cC7hZ z7whu37pPw*hZE=8@mtM}+lM0IS?AtI*KGP)q8jJHL#r`eA&k39FgN*}3kez-0(nd< zD_o_Z@JvoE+Y$#jP2WI~0^ORvAiOXDi$uDXD!{W(wsrZiZ2uA`3ygP6A0j%cBLFj{ z>j2k)Vd90pVg(ih8`(@>f^h;lT~*MsFqpsnG)FI|4%I#Qydr>of^j7*QU4Gl@SM(i z!z3jNJ3!2(b6dUWoIgFMXwt|9q*E~W`BgueD#&E#{_6Mg+y|fhZyO#9AxETY>=`CZ(09c6z)r=(}%oMmk=8qaS;Z^ zFQ|7!auk%4?G}Aw`(!6mv_GC|M57aw;&IHv#o{Ow<;Nq|)ILHcw-YB<=<15}3cW&V ziYYZ%2NhgcmK-9~u#AXG`J2NETBUzL3)B|^0z%w`*kVGkKmYV^uqyecb`*V4-W7@+ zjVIcsXcRg|r`C7>9U(o;ni&Me`Vfx$}CQa4%Y62ci;afVu?|WKlXz>Vef^3 zqE>6LJ|$YXn|ZAlU`e`#^A+;HzwsO2j^8&wmt|~`fBlmD_usgr&CjK^fB5M?j8)M| z-^utNrh2KS>4rIo{571^8O{JM5-n{dL7)+`awi={a>JQA>Ob zS*KebvRYryc>Liw?*-G6@Ssw9d?wq1qUHcuW{aZN5` zEE>Ci&UOA7U5MF#?OVrs4zaHd8RlLe4#GN3jtvb+IkL(hh71-Pk^#S2Wr=J?y~K|% zR-sUnCg_sbLoIo?>~CgG&LZZVZpI8zg;K(m7hPK0kWXr;om7Z(J!?%G2%*H##tcyS zxK&q9T-B?g@syG#W!c0hJYAT|RT?0=D4`Vr3nu2MBL{4wgF>oy%Mtb%`qy37o?hoU zwNHbG>=u6kydqNf%}ZE0h{!;hRm@7LlP~o$NblVtWl$U|(M%}5=S+WcHGfTe$<9NG z5sMWd1gQbc%Cj4#&e0V&!t!b_058ktNtB7yTx{Up&}bjT(~wBt!exLiGc+G(k)RA- z-W!-2VvTIhCMUj(9&4S|Nhku5cdb^qS0xN~e+YQH{x@y+dV`2EKzC&q>9^%DHuoz8 zCkBLQ&`e}{N+33Xa)g;VnjRXfq|+Xu5nU;I|5WICH2@YN`JCTB526uYBK@Z& zyrOG^AVcK#qDx$|T_$#Gb^pE)bO}{4mI&%edkg9Z8N~Pq@0Dw*sVXegj~kM15ZcpT z<&TNTtP~bfQCBfM1e6)KQ0bJ=iFSf}3HGuQcLmv^%BOIdOiM;lXJ9lVd+$8ppPE?l z?%Km>Tr9x=Z^O5c;9f*GWJ#H+fIa6kgkHxN!$g|F`*`#1@qherL0~bKbGFs7nkPTG zLw2bN7gxEJ+nN}^vRh5%|4`GjP9kc<7JrE*rC@HK!AW`{7bQMP*;;_Z>CK10iDw&> zuh2639Ed>bCWekaM-LlT@23d2^z|4qH3jSLL4?RkV2daQve9@u65?ly;+Y>gTK^LE zZjPLcQE1V{Wlr z+RfMl>anL=ONZJm5c?XgGl@=*xKJ8B_q(TV^S-ArKwEAyY_|_su0~A$!>l^(?swJE zTeSuZDW`dEeX%D>@x04erRR^ygSN&ga^C&7Yv*AGGmu1dqeFdII*Sd9`CQf!^C;;)Ra;%StBKIw37X$J^git@d#Hm)Y%-_!h;>>i$Q zg+zeTvqR)$^7K)Ov+PPxGK5?~WoGk87I~A3Ei@X4DSeN#X?5gQZcB?JmmFk&+ybxe zV1L%0!!>TvmLe2a@MQAkGkP7baH)(daHscydlJ!H!zk(R6jTi^eybWh7^e`lhLa#% zd}Q;1$jXo3$in|pSwx-8*~Qo53_0qxqq;$0fld<9<&*w~Vv#jmr;I|kn)c}`ykQ(w zj;ddg_YWvAgSDi|Z0;e=2_-!}@<~E@X0m~s&QatFvAOMN@3Da8xAF5%8G_nPCuaW> z_joSm1MlfQ5K<~T;|RFgK@*TA?m(xWJ$MNauf`k#7=RVz=LqRnVZs}Rt`wo()<4}E zTv$B9%5@%%41ZQ2Sz}unmBmGNqRE*Ksm=Zzaet2l>@Dnnt-a-CPg|MYe@FA~ihy~{ z|CqtvQo>k${EWV_tFG+XVV*#Z6hc^K$7V-y?ytl`_q6AiDy)&yY>qO#YK07*jmj4D z)HQSj)%Ee>`+Zvax(3`3TQIS6?%0wI_OW^M%)mCf#_*#5BAPV;C_c7BivBU-$?N@F zKhBG(nDOP6-KX>59UBiJTveW&CP$`2WTHz9$PLgnjFp~dt55uvg=7%-6zUFUDwKEE z`PQ^UaJoCRdk=Td_9gkH{oLf}O?>YOYc@dryXyKz#^9ayHcmE`natJ;))N`a8;vA4~ffRvJ<1Fx3(eFjbCg)7*jT z52}Qh#_S-3Zu|Pbh1+||%^F&E)E&Xwtqprw;2ko`M=~BdLe!Z7BsU^|zEjeB(jPv! zF)P64fL#D=bDw4edx?kI25Y(yofe3TXYZU3p9o8 zM&VAI6^~YnvwM|Fk^_^`grTw;?0y_?V~%KYN=oPDh6Ba+x+92XJRzLaIj3W=h*SkW z1HeT)t~DzcZa=g=c_O7)aRGX~I$)6$7_C_%RXEdB1&p6P+(~tvus~DOYw6ML{9IJ; zz?9R9mxC{<)65lk59N{YuA?=oTdOB)fKRm0y}V$_7AZG}rHjBoV)iN><^;y%Q4s4B zH%fY~Sv%xqFmlPeyi1(N`o*Gb7VNB$tk0HQeXxEV$B&qeD)c$xiYCPes!N2v`z4a` zrAmOLW=qWAPYo+2_rhkQL}6#`m7=@P!J2ksj=;hk_Vq2gsjRB7XUrk`M9x5M`BhnF z2{8?a)i_Z<^Xruu1nM#At@P0Z13Z2j5qIkx_-M@*Xt$(3gzu}I z=@1leGooZ(zBkGE;yC{&4YpVkQh%sAoDk4I)9$0MtpEiM+d0@f0zMbN0(50}c-&fY zMf4Dp@9f9U3@8U&VETDpYIXIr{91?3Npo>EEh1TSZ%v}yBVS9`!Y z0@1vm>@)~#{3HWpcdKC4<#1<%^+Iw!5eL<%v6~=RuE49QHaU;sNIEkWTZXUU16OHw zctG5Xkm(Rr0Gs}Re)yF9I$ik}1x%&D^Y`u#Oul|#@;~6;|A`M*eFx+Jjej>PTmO`n za6U~7I_yQ#aj@QZqCEK}vJYOaz<%GmzkbChMkC7QQabQEdr9 zxDIexFpn9O<8MF?w4a^W)Gff^)v!PM1;r7mWfPO?(Dp=VZ;{=KGDe5*C9dqmD)QcNZ(<1xmVP zS}@TdQ({)8*=5~p#4~*wukTD!xJr?`Cg`uKqTzrVJ2_=jFc2jLHQOwUk81kgNlzhC ze>IVq`R`w5&f{D$83~0%!!v`dYt&YDhLwwAH|F%>MAC@>?msfvx+>(TTtE-QNfsf+ zg{T}8@dP{#)CDS9I4mO%kh^Q;U!BJx$(2ulRw4)c<--sM&1m=R>Yx3QZ*vqt`-_b% zMs$!Un1&NrT0=U@AgrLSBlaL`MB3b2cY&F3vA|-G{n^NR>Z!7}N~V+~k`aY3+D5c$ z2JLk4+n0!5Af?FOb_6sYR?u%J6_!cVq?If#^CR35_jyxv1SaX!0dv(AvlmJ`EpkhJ z=%GN2lae39!e z%9A}L_68@D3LJ)KnH-H^%Q>ibOvx{G-bkcy{nTTmqkf93_tH=WPpMt}x6+V;8!$oN zf9a|216S&u{UFKz2T8*JekJ=4lKxem$yE9WLr-fSau7%m%5p-#3lA^XAPBIkRix9D z=t}WtZ6#L|2rsoAU4?yvc>`&EeiMf6*7J_Bd8+cSm1X=KIdU;^Jx(<>Iew3+-u^|k zCyWFkK+#7pWEY`7Uq^{ieSeobWAUMuvId&IeBQS-rYtzF*@(dk8y-x)Ww#Fhv|zKz zOcj6OY~#3Ghi+4eUbJgN7pQRBN!E67xe0Yk=rhqs!AiMy^%YCjF8_d6l*by(^T0^8 z!Bm4Ai?0D+Rm}+nSn4zjIb#=9rh-saW$kvs83w(4Mu3w=H?PjWi z#$0T#DV&o&QZGUO1;S#hOeGA8H$rYQXP`-8P{!vo?GcrwGxgbaK;i7U>h|(De~+hM zhVRDxD%AfJY@S|gU#)?WF*xvpJ5nDY9?D|%9z6I|sTSF9%SIg4=$kvP7?&}@R;Egq zocrXZxO}4AbA#oe%^a#d1O(Zd(@d~| z2R+lQo=YAi3>jz$i!6Xhz`nJ>p(x}~p3DKQ2; zSnCF~XGWWWg2WZGj&bW7oL`cA$zP$C-!G52Tt9h`Qc#6#6~u%e#2^$|N^#|t!WC<` zWCe`Q=fg8J>uEIkf{RCqtGEq>I7wUIs8j#azRj2z_*90)1h+ zfGj1q+euJAg_!%uwg>A-oZYMwjDT^ zz@Ow%+&)IzZwM9cQp2c&K-Cy$D}w}rO2deQCN7lgJpI;aE|Gt=F=6E|oUZ?w(D)B4 z6OsQZnEtnnRH!H|yUvG{k(@#VZ4TB@5actPBsd2MA_Qwq0TiXwr~o8Z>af#9Pgy^r zqj?T}$a`byQMT}dbl$QvO;Q8_JNsMXBksxce=4})lmWr)AK%6V-s2xpoLmh+2FI1$DOm#Xfi(46e z_kO3Vdxek*adKe=&|UvoT5RRgDdKI*se&{uillbIt0sSH=dD4|G6BZ(`N1}L&Ift* z5k}^jO?N!roJjlbnp4=->amSb;M5?#M%ycC88$u)`~dZkro>yaepdmHsmq*NnioNx zq@F?tjwSq(fNHC4kYWi8_nTL-?*qEIIdC!$+|BaC!@^EC2)!H6jzsGZuv;j}&MhS$<*+c-;R{%dqn68Ol46tT5iXh}qhs582RE|Rq~jBi z?0s#bR(H5*WH}k5Z*;N_b~TzVW0(D%%H_YX71{1_rjDN&i}vF{_dn=n{}W^X5yJno zo2_*I|DKJJp|#RPDM^gbQd0Wsl53@Tt06}?GyudOU~sctvzajH(!8oIhdW4mLrVk@ zM#A$4R+y`PlVIhm20uM>JoUBfKGV_U=y^0o_ZP|yQy5qtgaO6g34Q{0b6G?%U6XVt z&6AYo_d&Qwzms#m$?3REC(XrJxN&-Q(0S_Bf<}KcmglA`b-Togy+1jAeI4Obpbnyo zvMo)L;sseQK^W4tW`otZuT;utldVa!z1i|}d!SmBjASZ5!d)O0!p4N}U5^pn7@D;W}Q zwX^9m^91S-AF{*j?+AojNN%!j8)x2iFDllHrQ6O#C}JxY?nM;HT@TFZ0hKr$#_vN7 zt44@nxU=5jnPTbc#+$gaQtZOofHfOFSu}x-T{?o{2mS3t^Jnl^IDrT~5qY%F8GqJg zyfoTTE?}=%Tdp1vwy@j8FuT(}u%n**d$iNh9ei+?!5--lYmB|JOm%H$3uoV?Et)m; z22XR%^ov;z`HkQxU&z`4v@_C+DqN~h@r@<_9YipI)79Zni%a0em${R4(HEoCEr}vV zMu7pCj$t?bXvO3dwjetj?6CN+gIX>`%H?bx=$ z3M4tv8$2`IJ$booFkfRTeW;kiZKplh|6cE^eHQNa|3Ks8r&;trCi4I19#Nvw=6?|R z@5{%rUi+Z<82>?kTrg_k=sR>p0ivih5@0C{u?K7N^rxCm%d4uBZUEV?*S-kazh(vx zi`}DWrqzkRfTeMteu&5u>wWs_dUkiW7hsLQGd2VPh7zFs109!ZXZRpyhZeF*CNB7} z$Mvm=(+3&nx8T?}Z|@Jzivr%TN!oOt20 z)592+H`Eb6@19B&C$gpMw_E}s_9q?F02GwoO?Y>ZxES-UlD|c$(u`e*e(^ZQ{RS%V zFlw|d=u>QqP6Z5Nf7};XzeU*!u^S8NYicMaT0dKW3XC6czg3xArgYVO9L)&$0J9Wb zWZ;&G-g3owr_xW8Xcu~{f^+h%>qh7P6GJ^X+$MGTsl{~Md%XlidEL})l{z+^G?h@q z=45ot3;R&FCD}~DXYmmr+|c&hW(0#0xZ}enoptR|+g$P-;edns6hJ%J8eVA=uq~=K&`Zro?d<1#mN#+x-c1fUX}!HB@Ulkt?5Jye&O_Y#!`NOB_2~fT9QBAGlt{0A zU~;wnHfk5h*?@qnG2)Z8@A86gRYNdy@Ssh5pm1AQr=Hl%d`_GUEx_f~>=ePMn8@)| zt~ZG=e_Yobv@u$I0cPbdsa+m%lJDTBUEI*W*ehch{HnYHioE<$R#UoLm8GMGC;4aK zd1K~xLS@6DWyQMsUHZppV{#8CGemQ-1rLuJBc#5m58aPiU8 z$Gv`*9V;0(xIaZ@4K5Mp8s3n=X_Lv*ndfX~e;gj$yDyHuhBSYpI_0GZ27ka$gxt#3 zz)3_5fnn$eK2X6+$rVvC6Z$E;Ph5Qd%U14Z$y+@54^|j{u)_E6vy1-|udtoxgY%AO zbGB1V1H#CWBa_23H`9W{!b27a=MxBDli+8!TPG?XQ0|Ccvhn*K2!a&Ddini9Hc*kN z^4b=tQD2}xZ?yGU%RRS+X(s=S>Q`31KgENX`A~jW5gz5 zkiziELK)Pu#lny~gbPBkN2P#!k#waiR83NBg^bm-`8-h;s2u*G<*5zc+3n1=;ERky zP=}l)pbD)i=t+u8ry99EG@8p#0<8L_h=S)W`mOBS5P_~M?u43n*4^37A7sSw#jPr#5fMq zLMZ3PlMlYDbtq}_B68xtfh12h`iKL8&Gw`uTYcI(q#NyWs!@hMris?lWch&%woEoL zh`P1XQR``vG%_cnS|_7BJU9d9u!bKnIJKKXX`jPnnlKbrY1wkEMKt+3@yX9=1t0w9!1DBNbr@3lIY3#R(~s{yK9>T*t4Vf)^xq`S6LJM@9Q^A79O3Vlw>x9EDjbN^B91@+40 zN%IpDvONEzX$O{Y`k_bt4dL`2qH!NrQ;24^c=M$C->*|L`q78h;282g{}RY) zlXDx~;D7ykApiGvuKtPO|C9ig8lHLyi;3TvMkZaO2Y>>2BX|-A_~K$>LVRL)Z~$h3 zKo&?Ca%agC$wqn%h^8cbR2JTgrj<*1z_mOY1(i#01o%U$n<|wtkBgO>&1Y*amse}W z&duRmPp;Qo4DnC`cHgPj?^oQ%8;(=l$F5VIqY)uEz7RcDt+b%(BP=^~yMdB)j7T<= z%^a0UF6|xtYgVA+&4HCuGMrjl2sg>g!5kbFIkttoX4Or7@SId5&#RgG?StWOg1w9S zzI0_EkSaC}ESiU3a;-QTm`{!^64Zw*v4Ampk;q_yO&O>gNKn?`RcA^Y@O~AFOhsYv zXyj(p{10G6%~@#m$~O}3NY72gfF9|$Vh@_ z*d-yG7ZY-^Dbpv*Ie`p&%0-IfBsu7{ZqVP7j*CU_QnSZ?GDFIpv`u&PBft#IhFOg5LGtzSfoiEu; zk0=bcNZkpXklESFBv<3;_(*FTuz?P`Jp8gFT3cDf%6`^kKU=Ucg=|9g?s5$Yt-!dl zfl~Zhm^ZVeQOVol3kXwIlm3f#2Ir?aScD7>PdilT-c7@!lNjMRW45D(c&sliAb}Cq zW7bRn{j{X!Q=y2Z%Q7423?M288zVg;6J-K;Tuj;lf(Fa7LkU8|q@SxU$1c@x7&BCY zTRig8Dqx;B03Pe&=Xpzrra?FosCysF%j@+#ylJB5?tslpNt#|Wgu>}#{q~5 ztlYm)Rg}mRL6{Hf1Ell|e*YpLXy#j%uLXWjCo!>dyXM9peQY5@DljoV3WidGAD$V7 zc{XU$KSNB_kqG7$SlD?`aI?t8qCCt-Ya#;%cz$Cet9KF|i&u-%U{CQWMZ&6|7=(t| z9=(f1?L!zCLS#r<{im290B9vkql)qu3gY&h zcfS&)00Z`*&X|}I`aCj{$;7QQ2F37t^GZ;z~j;5@wH%*kH_h5O99KbNnyT&)#yr*%|@O)9Fn#3s*X@xEY#23p+Ew`e-ksv-+2Xt>#DdtMwKHSm6FX1tF z7x0PC2oZf%VH~aN+E3A8zd*k&cYeOHw-|h$S+=tMiqcaBP>FBv9()+G4Y7$oKGynl~al8b1|FBdDXMn2>hBP>Aaw;VX3h$v51{J@k zdgd8qb5FBY6sU+Hie)3DXdgr&Du2nkcU=i&Z;nCTPZE8NF&*A2 z0^f%mo;1KE36K*oiQmF|3^Q9~q8BBUiHsr2X9^ls@~&MarC#V*R_f6qQ5!`g2P-Tz zme|nI&mrW`Rs?B|Xs~r!y-6i2-itT1tFaTas z)9-$ZhULh+^eI!O-v~gE+}&~HuxGin^Rk+pnnBTE#Tk_)@c_x)m@`@shT45~{Hn#E zBeDoXdkejiWEz$1a(ge2Cg;z#Q7nvZ$B|G%YJ^6wfak@>6LG?D7qpkIqbAn3Dq>`$ zlsVR0#&*VKWM9u897w+a)-7N(UMUVyb2TNHV8DK79B2>UhDTbe3wwn#)pnie7=|~G z2ca3lXiwYMM=b?^i*xo~s*y!sD?ST8?Fd~I0i2MN;OyOm3JQA*GmD54nXA55dhUsx zqQh4-Ps$m^^qL+3(-$``oKa=&7vE>o`>Tw)cp$9f!M&)NR_kmm)l4Fx!*S0?tYq4x zq-pNQ*wgr$5odD=FQ9*h=NZGNk|_QtWtJA(Zc;-r?APiT9esel#6px(vKp`DeiLi28mAEk3mUVyNS|Cxa0qq+ArUr$OO=~ z(Y7gMEXxTALa@nkIk?qgP1kO20>`(2T(FDrWB)9iu!4c+J`mp(>bt6Q3pZ?rkY4}7 za!(S;2#fWg-G6PrH2@naByd=&KX}8jBjhcOT4hD%S>Xs=u#5M@^FY}=aZBoRfShYU z7G&qZ5lBS92&TKvh^AY#KYwd6`}<`=)z=2-Zm8Un+b3S-b2kFZ^v3dM`4&VZ@qw`W z6h88DFiyB$Yj(1#(ZS%&3zb-6Cc$(moJ^?;sg=nI@M=XzqI*Ox) zBbS1OIj9ky@|xQ*htkA_a}o6zCJ*|+)7~)E`LMbO7k`r%*EM<>)pSp(?m0Z|dSPDe zeIh*SUGb`Mzeon#O7&wlPMwcHJ!e`05yeiOnoC2+wn5*eirTa%hXUiO1|5Ws>1NRu*i9 zZTMIni)?-|sf#I{Dwud`d%wt_xaeiX9fntzH1^Z(*HJ=Cn-7rF(w+}vBRQFVxq8|) z6LhtMZmUjHC)!lEgYvHUc~x`j(+%5z#e6cWI zXwu>ENclx!H0)V5>}oai`{Sn9z;AwZLjB$dg|QNaYlrVMJQ*fc##t-++ zfefit7txEz_*3bC&{hbCDoNi&4?!C%qD66TpK3L5I2T5FfS^Ubyid^zt2z$&u@!NC z0KS1Yy({95%sL*@BK#G6c}H)PJdG9_VkfGC;&S@p`$udBI(cDC;b_oBD$ckr!?r!O z%VHwO#KbD8ZQw+$oL+q@p?)V84CS_^HN$;A)P(!|sEz%$*`Nc@G=3@vhF*u2`dv)L zZXyW7T}$O|vXp@$*3YXv$-`vR?KPiigyQHJ$z4}vJUJ!cn5aisk(q&a`fvo`0J{$g z&=J~-&Ti`W1bt1H-O~diOirjRsQj=l;5v+4{%6Tn4Apfp8?hy?mKXNO0~<%y@H2BA z3yhj$OP2s-{y=T=FScI<^b_srW83lm?ji{H4h#`=!J#YC@Xy8w__{xK9Pq2}C)9h< z9ZNCZ5G1&yGhE`oJlewCZs&DADsrj9guLB&AT8f-ApqYNB}CP6bqJy8*A3|clNZy2 zbC)T#>FI4L=)VQ%F&I-YyCuNf(*=C`vFHpG96H$T$t@Q&u_m}EHgTLbqDFOGi>xmC zIgy$`<3WlvgJp2Lrq8FoFL^$)%H@K-l?<{8-N;rs^$&bUeuuCQpP%+;*CBfgKWP>F zFLaZqC%Vu8i)*yUFKTLW=J%8`y!Lv(xK%k$@46z7f8|oe5{>g82Jv7mU3lDv6&eza z-x86q8as+$`48dHo5?GiZ{*O&Ng6_Aa5ET09t>VM6wx!W?+F-Igj7>r#(spvqdCya z99_$*#o+p*!sesJ=%L^YS`Y*VbqYcH!{Yw z|Ip%ci(a|yIG}$w*+-4MK`lg~701*`qIMIu87jX6&`D0d0lD3k#`a{bb=wXuoGYkH zqx_Ovf;WV!axc%IMWwUl?NM6oS;eYyj`I?puN>N+ID|}HuMa~oJ(IExAWmY6PrgkX zv2c%i-N>8YbH5Fn9C?9#7{Wv#+%9Hc4G~fI>$Egi2zo8*ap{CROjX+4uEh7Ug%6K}MjOaE1hJt5{zf zB!?!!hGf=bjZofP;iVc?`fIv>Z<-I}vx>VH7Zxb}+Ftbh)|^=|dw2Zcpr(&!Y=E zsZ%n6aD>F-{&l@Ts_bfy*Vn`6(q-T0iFa=bQI->L!F51V3B>Y!xvI_yBt3`R+S~Pw zwx+W>JJV;;QLY9|#lNEm9keeqGO%+Q zg&G^$<35l6pVH0)oXWS4<3^%vjvcc1CL}9+9DA10A$uH~V~^~SRme&Xk`c-bWk-Y* zGLkfi>=l*w@%PrL=U=M#eXh&p829gU@B4o4@%{1E8*OC1zCDnUTF@j;RW9d3v#Osb z!R5hB9*FTy7Bb6kRSNBPe{{;=i%~R3(UEGV9`AfQ%BQmiMG%T2lUwAhYgVh(c)j&u z_g?q*rrDT07pu8)JCRF>|B*mx@5Fsh1ZPH>P4M7HV@aKs*}#<554mYDb9E;skOyOU`I(8sqwMaX@&lTdShwUy}~ zn9?71Gda^#+zt0WyyM8nQ@OP(2#H)rODneAd)onQx!x-ZxFd#*(E_z+e7APaWB0EE)fkA4H7G)$aDcm4wWhJByy$v zR;t98jtkRPJ3gW%#o5~Ex3wjo)l(%K;Y4cEya`vyhlEAA;GWBKupJsqaKeyNV9PzF z+W9Fo!%X<9xwdLkWo*wf9qc=4FbW z;jq&bqiuMUP!NBKloC;g;mc-8sVEk~5I5^1odbz_(^q}k;}kO=*I-N$i?7m=F={hg zN~a6?O3?;q!UXWUJp9pS@RgJaTXk*`g%|Cf3axNuLo2q(3<0$?vx$rFGciQK`?0g}oa!ON)7Yqov~Vx|3ex z@}leRIciocud*pAv&!S*L(vSeE9;O93tq9$5}Ynx;F&aNM9wg6vp4xJAJ00r-ayvFK@eaP84??3)ogn&f~C7g zC>XoS$t~H%v4_@S0a)LKY@b`HB}35SRvbAu3b*;};(avS&un$YiWZAI*`K-LLEgzC zS*S6@r!j$NJy-O&eqnawX*g$BpO3xUqe~T~1(>{ZaP^XOfrd zTvuHb+Vp83kz{XnKJU05Z=%t7g6?!M@$;yKZrRIY1)w<$^ezrc+9ycO=la2b>7amWw zCpmMgPCRE1Z6qXMPjph+gHHw{R0v#GiRZ_!R zpmZnL&}UyqNz^Y&LEziS5}Kr}(0NhO=g{`m@0Gk?~~5fy#;7c~f1|j8hCd+Tn6!bMD*aXB#qhrrNfsg5rvTg6Rd9MAi$2 zJ?TGZ<4DVx$QcmL@2);cMPN@#O~7@c)0pWOk1aktI;&1F(HU+WEi%1rgd=Ld-I;p! z>P_e^<$H~o)!V1L6GUw_Uh=qg%YEdLV)EY{8uh1r=66f4U!6r|MQwyQe!|H3v-h?l zek1RdFWelvjMM2%S9lX2@^OqDE1YNxM#>qle>q3=d7C(JLPn{6jg+2mFipBiQa>FNjZq4pyi-9ybJU1V~4ey0!Y(HMJ7sgA|e+bxL%oK zS>@M6gtVBIV~tbZh}4y!)6OQ-$rF*AP~sa8g$G9D?rs;5ZT@$z~{o?_X2Cs(- zi@WeP8zV9l>Y&=`sjhog;ZFEl zd%-F3h|){#8FO{k@?NT)c+NVf_|ha!_|~3llOLUYKC8zrYQucBcPF53% zv}dl!Fd|+M%Ms$&t#4w%ePX6(@RH+ci|$fH!FEpg$QDdKeauqw?(0e9qW2f>^O?rzbk>+)kni+vg0vcar&hyF2(zEi%s4&|i#@|zEen$U{vAof7 zEFg+ooJ>m3msDG}<$jQkavCP9=HL-Y>RJ)pOOmaLhP}FH<)^DoW{Ar_i4@I-W)!d% z(Kgr7%&$c25?rRGS*Kc|%=N3Wa2BS%Ctp`-bJk zIldoTkq`26Ukq@tRRmDqQvPi#a)aAjS$h15WOYIEBMl4zz-ixc48|AB&L(j*n5_IX z-ex2nb&RT^uI3RlT7p8^siD(l9#*efv6u7Wc&-bGX_MX)EBd?}R8#~tpUN>uJ7K|g znF?8@Ou-+ECkN%6dLyuP`gMfAOp@PipA#u=O)_;hWjO{DL-;K5NURNeK|I9M^4KVQ zL2Ak*h}>Hv`Lnr#NYyvvC*1H#ljL&ph`64!Xd0>~xU=(TiK1 zHj+^m7^Tq>I@gl`zO#oKn0)alHumTP+ACfSMcVn$IxsLrRO{5gc!Rlk^vvpHp#kG+ zyytG_MyN0adNq|7>1OAW=&f{kPxI=m&M5AQPsO#jKA`y-@k@6k2&aGMV&%=a;vgu5 z*nD|xVNl(=!qLK-*%{W+-Z~o0XrQ!BJ3-{WNyeP>)y`2Xi@ua%U zyQ0C*M^ZB!j7Bykek^YX=O*Ccp?d4qi>fA@w1(r_(Emem~Rhji^Zt7Tp} zYZoFw6uB-~oib*^>WapiXCQH1kk#t_B$U3mh&kazE&G&xR-)G^_GsiamoY&oOQ_2B z^1{~EuH>H6$F1Dl`)K~{+GJP|F7{^?A%b$|oKw>RTZOML`D-M(m+Y5&ql_5Ej6B!k z+-+5A6)+ejRX@eIVO$KO+iOiyBiz}orNLc)NRpf zV`ed4jSJVtRy&7vtN4@*y)u0R`xgmXg~ufchr|i3pU&x5^tr5*8ha0Ju#^-uXA#Ls zrrhss1%$}_Pf!+!r_vEBnnZJ(N3%$hMI#EPOEjgdY`539ljl53!{aD7$FirrrQT^g zV48BRCP{*;66U57D7zC6T$&cM;af>H@+@s|D?GEqEx4DxS2_F$?|L}Tnn;y4#v`f7 zXwMXJYisKl+b)D&Hsn|f=|*NzO9T9sHQX|!_i+6Qce(2Bg~s;vTozg1roX#Q5s(?y zY^-#?epZ&Cp+2FxUpAv&(ZF*XbP=SNq}UP?69X(a8)t}Id zdzf6KVyP*zcPzH-adp4+kSsj?h!L7_LC_SIvTACnShhw$VtB{+WG&oVMS*_A3Z3t! zaM~+-5Av)8GzCr}-qn)9nNP!ep6ddeH_ZK~?#*x{xkwlfrh}SoJb9#h>dpaMyzCZA6qW`LO1TZ zVEK7A)k&8-jA$bR${ToUF>O_GzahyNOQg$ll9T#R5vEE#aVXB=o zm$I`Tbwm7n5}g1VWAAnBD_$5`4@M05#0WK}Y0(?Cy+wTYGTnKeAH5{3(j8bT0tWb z?rWg;o=ApTU^>3@n0hj?KQ&v*>mxa=Yg0Ct-F>K~&%_n2bwe@kU~iwvG}C;W@;p_e zmOm$Oty#Trge@3J$kO6j!0pZWu*@qRzp$X+xvQl{&M~^?V?pxXidnwG8XtN=@&9v|o_T0Vb193Dy5Qx8i zb8d}i?9|PAm%6o~p*zdBckf*~q4w52FP;`_^~on4iJ5G5+M=MOUTCn?QRDeiksSic z0R&`dK)#^2Vm3m|%Uiq7=1xAD{!?d|g{YNw`9)J`Rr;$ z7ewIkgcH20)y{W8vz2U!)bb}bIr2_>l%6N0qUco zFrMcvAFJ@d_^>!SitvlikJS;7DTwlylIt}umU$Vb_YBI=SV-(`9%~UM^0rL#mX^&- z_o^h9g%Cvh@Z33WN2$=G?Y-j&%^Y?aNG0Ra9V2odhze-&x-Rz-8(&O1amv)*_bALU z3%=WAMMn2zhpK<6`elR^m$MnPPs%uQT>{z98JN1Ur&yXgCnUNGRi*9JoU__2jGzy_ zBXm!HPrI|_IezeYC6*88k@S&^b@9D->L%69VIk_I(#BHbFCNEe3KD2M-Drn9SYvb~HrTK+ zi@$erC7H}1OLANQaJHSne#+8)C?z2A$@-#nog{fwu}6pbGU*jJ=#r+uAg?uJUjn$HtVay=Od5hcn+iPGR}4L#(qV=tvo$d)c2w z$p2s6jEfr_=zl!ytlZVOIlI->)OlCbEBm0_YJEdIe5%~+$~>=B`Fi+x&|=}230fOQD6Rbr*)2a~o2UTF;1b+MNL58papTG5|P+1KXMFm|wUZ~<>V4y4h z@3Rly13m*?Ffc9qbyNXW)bBzt0I}E)anNZW8W1>&_FcgJ=zkaRp!+|JOZ7E0+I~zC zKMVeKcsR@q?GI)u4l}baa(kF5!XHe{1E#*^{_m5+{zG6&;N1}v_?JWBVNu!_?LBz* zGs)~Pto{?@Zv*TB16AoVl{(N}0mHaJA^|a?Zx1r0>U)N~f|i1Yyn=?Dih?fK#NE5E zBAkFMGvh`BN)YuRLkxiF-?zl8tH>#6=qi9i*WdT94F&?00$-?nM?*t~tdM*cT0>J0 z2oDZiJ6y;vNttZ%W@l~p)x{V%;zou7MPxwjDZW$9HIJ%O44JI8;CmOMNrFp9?j> z;Q7mHp#}4>m34Qwa?s7WYzbIKbA#JvY82xXt0`KJ3b~c`XnxY;27v&3fj{cQ_3=whq zJ>W-I>EQAN`xZpm*6}^W_WqFndryO47}(bu3U)i-4`F|@j0MJm{S%?EtD(Qaez$n? z3vWeW7}&oK3YL56&tagI8ZZRxCI$tOjQDfN_si*E0@%X=itsx2&j|-tB$x$$-WtIU z1W=5*xW8t|{?eTQIB8%ta};(c@qfb}WaNLf&A~XZJTwZolJeKML&T!NT(IyfihDWz zuepCD0}GA;Se6qN1NY3oj=^CfonSCnwhIOB&HrogAtGL2E?5T%#a%1>Ywkg%lKrVF z5*Q4YjX{AWZ~c#8u!sy82^QBtA!Ew^N8~|o@tsH-m!u>99!B>k>;MwZG2LCo!!8c4%G)>@T{JtqThrw6xQ0U5ge~bS4 z7y~{Mh9da&{f6+b?dP8pz+2iV0`0TEB^)*)gE#$99Lv$)asGS@5L`mwttS*!ckDM* z@XY+Xxzul_H{i_=6jX8IyG4wH#Ur4C{>4@ZIDOy+P!y`{<^O|1Er)8UVF7P7`_2|c O(fWavBF*XjpZ){(@cW1W literal 0 HcmV?d00001 diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000000..f5b763a229 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=bin +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile new file mode 100644 index 0000000000..14651ba547 --- /dev/null +++ b/ci/release/Jenkinsfile @@ -0,0 +1,107 @@ +/* + * Hibernate Tools, Tooling for your Hibernate Projects + * + * Copyright 2016-2024 Red Hat, Inc. + * + * Licensed under the GNU Lesser General Public License (LGPL), + * version 2.1 or later (the "License"). + * You may not use this file except in compliance with the License. + * You may read the licence in the 'lgpl.txt' file in the root folder of + * project or obtain a copy at + * + * http://www.gnu.org/licenses/lgpl-2.1.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@Library('hibernate-jenkins-pipeline-helpers') _ + +import org.hibernate.jenkins.pipeline.helpers.version.Version + +pipeline { + agent { + label 'Release' + } + tools { + maven 'Apache Maven 3.9' + jdk 'OpenJDK 8 Latest' + } + options { + buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10') + disableConcurrentBuilds(abortPrevious: false) + } + parameters { + string( + name: 'RELEASE_VERSION', + defaultValue: '', + description: 'The version to be released, e.g. 5.3.37.Final.', + trim: true + ) + string( + name: 'DEVELOPMENT_VERSION', + defaultValue: '', + description: 'The next version to be used after the release, e.g. 5.3.38-SNAPSHOT.', + trim: true + ) + booleanParam( + name: 'RELEASE_DRY_RUN', + defaultValue: false, + description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.' + ) + } + stages { + stage('Release') { + when { + beforeAgent true + // Releases must be triggered explicitly + // This is just for safety; normally the Jenkins job for this pipeline + // should be configured to "Suppress automatic SCM triggering" + // See https://stackoverflow.com/questions/58259326/prevent-jenkins-multibranch-pipeline-from-triggering-builds-for-new-branches + triggeredBy cause: "UserIdCause" + } + steps { + script { + // Check that all the necessary parameters are set + if (!params.RELEASE_VERSION) { + throw new IllegalArgumentException("Missing value for parameter RELEASE_VERSION.") + } + if (!params.DEVELOPMENT_VERSION) { + throw new IllegalArgumentException("Missing value for parameter DEVELOPMENT_VERSION.") + } + + def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION) + def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION) + echo "Performing full release for version ${releaseVersion.toString()}" + + withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven', + mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') { + configFileProvider([configFile(fileId: 'release.config.ssh', targetLocation: env.HOME + '/.ssh/config'), + configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) { + // using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin) + withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'), + string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) { + sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) { + sh 'cat $HOME/.ssh/config' + sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git' + env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg' + sh """ + bash -xe hibernate-release-scripts/release.sh ${params.RELEASE_DRY_RUN ? '-d' : ''} \ + tools ${releaseVersion.toString()} ${developmentVersion.toString()} + """ + } + } + } + } + } + } + } + } + post { + always { + notifyBuildResult notifySuccessAfterSuccess: true, maintainers: 'koen@hibernate.org' + } + } +} diff --git a/main/pom.xml b/main/pom.xml index 463366de95..0d91685976 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -55,6 +55,11 @@ + + + false + + com.google.googlejavaformat diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 415a13e940..d1a4ee35b4 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -52,7 +52,8 @@ - false + + false false 3.5 diff --git a/pom.xml b/pom.xml index f0e14d0b17..fbc8833dce 100644 --- a/pom.xml +++ b/pom.xml @@ -39,10 +39,36 @@ 2.2 2.3.1 2.3.2 - 5.10.1 + 5.11.1 8.0.22 19.3.0.0 9.2.1.jre8 + + + 3.3.2 + 1.7.0 + 1.7.0 + + + true + true + + + ossrh + Sonatype OSSRH Releases + https://oss.sonatype.org/service/local/staging/deploy/maven2 + https://oss.sonatype.org + ossrh + Sonatype OSSRH Snapshots + https://oss.sonatype.org/content/repositories/snapshots + + 1.8 + 1.8 + 3.9.7 + @@ -148,36 +174,186 @@ - + - - false - - ossrh-releases-repository - Sonatype OSSRH Releases - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - true - - ossrh-snapshots-repository - Sonatype OSSRH Snapshots - https://oss.sonatype.org/content/repositories/snapshots/ + ${ossrh.releases.repo.id} + ${ossrh.releases.repo.name} + ${ossrh.releases.repo.url} - - - - - ossrh-releases-repository - Sonatype OSSRH Releases - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - ossrh-snapshots-repository - Sonatype OSSRH Snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - + + ${ossrh.snapshots.repo.id} + ${ossrh.snapshots.repo.name} + ${ossrh.snapshots.repo.url} + + + + + + org.apache.maven.plugins + maven-wrapper-plugin + ${maven-wrapper-plugin.version} + + ${maven.min.version} + bin + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + ${deploy.skip} + ${env.RELEASE_GPG_HOMEDIR} + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus-staging.plugin.version} + false + + ${deploy.skip} + ${ossrh.releases.repo.id} + + ${ossrh.releases.repo.baseUrl} + + 60 + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten-maven-plugin.version} + + ${project.build.directory} + + ossrh + + true + + + + flatten-pom + process-resources + + flatten + + + + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + ${maven-deploy-plugin.skip} + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + + + default-deploy + deploy + + + deploy + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-java-version + + enforce + + + + + + To build this project JDK ${jdk.min.version} (or greater) is required. Please install it. + ${jdk.min.version} + + + + + + + + + + + + release + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + + + + + + + build-reports-as-last-module + + + !some.property.that.will.never.exist + + + + reports + + + + + + diff --git a/reports/pom.xml b/reports/pom.xml new file mode 100644 index 0000000000..a9011e5d42 --- /dev/null +++ b/reports/pom.xml @@ -0,0 +1,80 @@ + + + + 4.0.0 + + org.hibernate + hibernate-tools-parent + 5.3.37-SNAPSHOT + + hibernate-tools-reports + + Hibernate Tools Reports + Hibernate Tools build reports + pom + + + + org.hibernate + hibernate-tools + ${project.version} + + + org.hibernate + hibernate-tools-maven-plugin + ${project.version} + + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + false + + + + + default-deploy + none + + + + deferred-deploy + deploy + + deploy-staged + + + + + + + From 21059eb0a0399ff03d2716a5ea9589782ed7e2ac Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 11 Mar 2025 17:58:25 +0100 Subject: [PATCH 442/454] HBX-2969: Update dependency on jboss-parent to version 48 Signed-off-by: Koen Aers --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fbc8833dce..264565bbaa 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.jboss jboss-parent - 39 + 48 org.hibernate From 9d654f4c5219f6dee9e43887512821f1adf7b2ab Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 14 Mar 2025 13:11:24 +0100 Subject: [PATCH 443/454] HBX-2969: Modify file 'test/maven-plugin/src/it/noPropertiesFile/verify.groovy' to make sure it works as well on the CI runs Signed-off-by: Koen Aers --- .../src/it/noPropertiesFile/verify.groovy | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/test/maven-plugin/src/it/noPropertiesFile/verify.groovy b/test/maven-plugin/src/it/noPropertiesFile/verify.groovy index c71714aff6..040800a6dd 100644 --- a/test/maven-plugin/src/it/noPropertiesFile/verify.groovy +++ b/test/maven-plugin/src/it/noPropertiesFile/verify.groovy @@ -2,24 +2,26 @@ import java.io.*; println "start verify.groovy" -File entity = new File(basedir, "build.log") +File buildLog = new File(basedir, "build.log") + +if (!buildLog.isFile()) { + + println "'" + buildLog.absolutePath + "' is not a file." + + throw new FileNotFoundException("Could not find build log file: '" + buildLog + "'") -if (!entity.isFile()) { - - throw new FileNotFoundException("Could not find generated JPA Entity: " + entity) - } else { - + + println "inspecting build log lines" + boolean found = false - String searchString = - "[INFO] Property file '" + - basedir.absolutePath + - "/src/main/resources/hibernate.properties' cannot be found, aborting..." - entity.eachLine { - line -> if (line.startsWith(searchString)) found = true + String startString = "[INFO] Property file '" + String endString = "src/main/resources/hibernate.properties' cannot be found, aborting..." + buildLog.eachLine { + line -> if (line.startsWith(startString) && line.endsWith(endString)) found = true } return found - + } From d17309af1f54427be805be62604d97f1137023e0 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 14 Mar 2025 13:36:18 +0100 Subject: [PATCH 444/454] HBX-2969: Disable test 'org.hibernate.tool.stat.Statistics.TestCase.testBrowser()' to make build stable for CI runs Signed-off-by: Koen Aers --- .../java/org/hibernate/tool/stat/Statistics/TestCase.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java index a86b718270..d94e938345 100644 --- a/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java +++ b/test/common/src/main/java/org/hibernate/tool/stat/Statistics/TestCase.java @@ -28,6 +28,7 @@ import org.hibernate.tools.test.util.JdbcUtil; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; public class TestCase { @@ -42,6 +43,9 @@ public void tearDown() { JdbcUtil.dropDatabase(this); } + // HBX-1554: Ignore the test for now + // TODO: re-enable the test + @Disabled @Test public void testBrowser() throws Exception { MetadataSources mds = new MetadataSources(); From 866a22a9434eb81c7965993cc3fc2f2b2038ac08 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Fri, 14 Mar 2025 13:23:24 +0000 Subject: [PATCH 445/454] [Jenkins release job] Preparing release 5.3.37.Final --- main/pom.xml | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- reports/pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 0d91685976..b0c7ee4c4d 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index d1a4ee35b4..59bd222d54 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 264565bbaa..97bd2683ff 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.37-SNAPSHOT + 5.3.37.Final pom diff --git a/reports/pom.xml b/reports/pom.xml index a9011e5d42..0479bc158d 100644 --- a/reports/pom.xml +++ b/reports/pom.xml @@ -20,7 +20,7 @@ org.hibernate hibernate-tools-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-reports diff --git a/test/common/pom.xml b/test/common/pom.xml index 63c8a79805..dc5cb5289d 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 1f1344e90a..5dbe76798a 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index e5e23f84df..40925772fc 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index de543cd698..f68730ec86 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index d5987b78d2..9910204df3 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 52235576df..3da58ccad7 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 6e2e578254..05a0ae5418 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index 36d42e7277..c1ded1abb8 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 94eb820739..468d9ed025 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index 2a3afbba69..cd45b83d2d 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37-SNAPSHOT + 5.3.37.Final hibernate-tools-tests-utils From 70dfc271f49aac4dc72c1d37776ff3ee3241e121 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Fri, 14 Mar 2025 13:24:50 +0000 Subject: [PATCH 446/454] [Jenkins release job] Preparing next development iteration --- main/pom.xml | 2 +- maven-plugin/pom.xml | 2 +- pom.xml | 2 +- reports/pom.xml | 2 +- test/common/pom.xml | 2 +- test/h2/pom.xml | 2 +- test/hsql/pom.xml | 2 +- test/maven-plugin/pom.xml | 2 +- test/mssql/pom.xml | 2 +- test/mysql/pom.xml | 2 +- test/nodb/pom.xml | 2 +- test/oracle/pom.xml | 2 +- test/pom.xml | 2 +- test/utils/pom.xml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index b0c7ee4c4d..5e69514ff0 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -6,7 +6,7 @@ org.hibernate hibernate-tools-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools diff --git a/maven-plugin/pom.xml b/maven-plugin/pom.xml index 59bd222d54..7c351ba2d8 100644 --- a/maven-plugin/pom.xml +++ b/maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.hibernate hibernate-tools-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-maven-plugin diff --git a/pom.xml b/pom.xml index 97bd2683ff..a1c5d5f0a4 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.hibernate hibernate-tools-parent - 5.3.37.Final + 5.3.38-SNAPSHOT pom diff --git a/reports/pom.xml b/reports/pom.xml index 0479bc158d..267d50dd18 100644 --- a/reports/pom.xml +++ b/reports/pom.xml @@ -20,7 +20,7 @@ org.hibernate hibernate-tools-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-reports diff --git a/test/common/pom.xml b/test/common/pom.xml index dc5cb5289d..7014e4f9ed 100644 --- a/test/common/pom.xml +++ b/test/common/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-common diff --git a/test/h2/pom.xml b/test/h2/pom.xml index 5dbe76798a..1bfe16d7dd 100644 --- a/test/h2/pom.xml +++ b/test/h2/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-h2 diff --git a/test/hsql/pom.xml b/test/hsql/pom.xml index 40925772fc..dac8e3ec98 100644 --- a/test/hsql/pom.xml +++ b/test/hsql/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-hsql diff --git a/test/maven-plugin/pom.xml b/test/maven-plugin/pom.xml index f68730ec86..0130f6ea9c 100644 --- a/test/maven-plugin/pom.xml +++ b/test/maven-plugin/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-maven-plugin diff --git a/test/mssql/pom.xml b/test/mssql/pom.xml index 9910204df3..78e6574e93 100644 --- a/test/mssql/pom.xml +++ b/test/mssql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-mssql diff --git a/test/mysql/pom.xml b/test/mysql/pom.xml index 3da58ccad7..2b7aba5715 100644 --- a/test/mysql/pom.xml +++ b/test/mysql/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-mysql diff --git a/test/nodb/pom.xml b/test/nodb/pom.xml index 05a0ae5418..5ab18cf53b 100644 --- a/test/nodb/pom.xml +++ b/test/nodb/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-nodb diff --git a/test/oracle/pom.xml b/test/oracle/pom.xml index c1ded1abb8..e841cd0aa1 100644 --- a/test/oracle/pom.xml +++ b/test/oracle/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-oracle diff --git a/test/pom.xml b/test/pom.xml index 468d9ed025..d068a38940 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -8,7 +8,7 @@ org.hibernate hibernate-tools-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-parent diff --git a/test/utils/pom.xml b/test/utils/pom.xml index cd45b83d2d..58dba9b1c7 100644 --- a/test/utils/pom.xml +++ b/test/utils/pom.xml @@ -7,7 +7,7 @@ org.hibernate hibernate-tools-tests-parent - 5.3.37.Final + 5.3.38-SNAPSHOT hibernate-tools-tests-utils From 5e80622411ca5476982efeb0387f48489aafe55d Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Wed, 5 Feb 2025 09:32:43 +0100 Subject: [PATCH 447/454] HBX-2956 Use SHA in the github actions workflow --- .github/workflows/build_test.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index e851ba9994..3076dfeeab 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -9,20 +9,18 @@ jobs: steps: - name: Checkout PR Branch - uses: actions/checkout@v2 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.event.pull_request.head.sha }} fetch-depth: 0 - name: Setup Java 8 - uses: actions/setup-java@v1 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: java-version: 8 - java-package: jdk - architecture: x64 + distribution: temurin - name: Build and Test - uses: GabrielBB/xvfb-action@v1 - with: - run: mvn clean install - + uses: GabrielBB/xvfb-action@b706e4e27b14669b486812790492dc50ca16b465 # v1.7 + with: + run: mvn clean install From fccba372fe0a66c0309f7e83cacf304320446eec Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Wed, 5 Feb 2025 09:35:47 +0100 Subject: [PATCH 448/454] HBX-2956 Add dependabot config to update GH actions --- .github/dependabot.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..2bd7143061 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + groups: + workflow-actions: + patterns: + - "*" + allow: + - dependency-name: "actions/*" From 647bfd2e913fad2ebd0a5320c9a4b18a7ea830e7 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Tue, 13 May 2025 15:23:09 +0200 Subject: [PATCH 449/454] HBX-2985 Use JReleaser to publish artifacts --- .release/.gitignore | 3 + ci/release/Jenkinsfile | 16 ++++-- pom.xml | 127 ++++++----------------------------------- reports/pom.xml | 80 -------------------------- 4 files changed, 31 insertions(+), 195 deletions(-) create mode 100644 .release/.gitignore delete mode 100644 reports/pom.xml diff --git a/.release/.gitignore b/.release/.gitignore new file mode 100644 index 0000000000..cdd9a17d6b --- /dev/null +++ b/.release/.gitignore @@ -0,0 +1,3 @@ +# The folder into which we checkout our release scripts into +* +!.gitignore \ No newline at end of file diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index 14651ba547..f8e9a6d2e1 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -74,6 +74,7 @@ pipeline { def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION) def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION) + env.JRELEASER_DRY_RUN = params.RELEASE_DRY_RUN echo "Performing full release for version ${releaseVersion.toString()}" withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven', @@ -82,13 +83,20 @@ pipeline { configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) { // using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin) withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'), - string(credentialsId: 'release.gpg.passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) { + string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'), + // TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials + // to use the following env variable names to set the user/password: + // JRELEASER_MAVENCENTRAL_USERNAME + // JRELEASER_MAVENCENTRAL_TOKEN + usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'), + string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')]) { sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) { sh 'cat $HOME/.ssh/config' - sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git' - env.RELEASE_GPG_HOMEDIR = env.WORKSPACE_TMP + '/.gpg' + dir('.release/scripts') { + sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git .' + } sh """ - bash -xe hibernate-release-scripts/release.sh ${params.RELEASE_DRY_RUN ? '-d' : ''} \ + bash -xe .release/scripts/release.sh -j ${params.RELEASE_DRY_RUN ? '-d' : ''} \ tools ${releaseVersion.toString()} ${developmentVersion.toString()} """ } diff --git a/pom.xml b/pom.xml index a1c5d5f0a4..68e26ffa9f 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,6 @@ 3.3.2 - 1.7.0 1.7.0 true - true - ossrh - Sonatype OSSRH Releases - https://oss.sonatype.org/service/local/staging/deploy/maven2 - https://oss.sonatype.org + + + staging-deploy + Local Staging Directory Releases Repository + file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven ossrh Sonatype OSSRH Snapshots https://oss.sonatype.org/content/repositories/snapshots @@ -175,16 +174,16 @@ - - ${ossrh.releases.repo.id} - ${ossrh.releases.repo.name} - ${ossrh.releases.repo.url} - - - ${ossrh.snapshots.repo.id} - ${ossrh.snapshots.repo.name} - ${ossrh.snapshots.repo.url} - + + ${local.staging.releases.repo.id} + ${local.staging.releases.repo.name} + ${local.staging.releases.repo.url} + + + ${ossrh.snapshots.repo.id} + ${ossrh.snapshots.repo.name} + ${ossrh.snapshots.repo.url} + @@ -199,39 +198,6 @@ bin - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - ${deploy.skip} - ${env.RELEASE_GPG_HOMEDIR} - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus-staging.plugin.version} - false - - ${deploy.skip} - ${ossrh.releases.repo.id} - - ${ossrh.releases.repo.baseUrl} - - 60 - - org.codehaus.mojo flatten-maven-plugin @@ -262,30 +228,9 @@ org.apache.maven.plugins maven-deploy-plugin - ${maven-deploy-plugin.skip} + ${deploy.skip} - - - org.sonatype.plugins - nexus-staging-maven-plugin - - - default-deploy - deploy - - - deploy - - - - org.codehaus.mojo flatten-maven-plugin @@ -316,44 +261,4 @@ - - - release - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - - - - - - build-reports-as-last-module - - - !some.property.that.will.never.exist - - - - reports - - - - - - diff --git a/reports/pom.xml b/reports/pom.xml deleted file mode 100644 index 267d50dd18..0000000000 --- a/reports/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - 4.0.0 - - org.hibernate - hibernate-tools-parent - 5.3.38-SNAPSHOT - - hibernate-tools-reports - - Hibernate Tools Reports - Hibernate Tools build reports - pom - - - - org.hibernate - hibernate-tools - ${project.version} - - - org.hibernate - hibernate-tools-maven-plugin - ${project.version} - - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - false - - - - - default-deploy - none - - - - deferred-deploy - deploy - - deploy-staged - - - - - - - From cf4d9d463e547573aa56eebc42e22c8f2267ce77 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 20 May 2025 11:42:19 +0200 Subject: [PATCH 450/454] HBX-2985: Amend version identifiers in Jenkinsfile Signed-off-by: Koen Aers --- ci/release/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index f8e9a6d2e1..c3434b9920 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -37,13 +37,13 @@ pipeline { string( name: 'RELEASE_VERSION', defaultValue: '', - description: 'The version to be released, e.g. 5.3.37.Final.', + description: 'The version to be released, e.g. 5.3.38.Final.', trim: true ) string( name: 'DEVELOPMENT_VERSION', defaultValue: '', - description: 'The next version to be used after the release, e.g. 5.3.38-SNAPSHOT.', + description: 'The next version to be used after the release, e.g. 5.3.39-SNAPSHOT.', trim: true ) booleanParam( From 50f983a27c89d9da70a8569ee27be57fa8fea252 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Mon, 16 Jun 2025 22:50:36 +0200 Subject: [PATCH 451/454] HBX-3011 Switch to Maven Central publishing --- ci/release/Jenkinsfile | 20 ++++++++------ pom.xml | 62 ++++++++++++++++++++++++++++++------------ 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index c3434b9920..46fe3ad3a1 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -1,12 +1,12 @@ /* * Hibernate Tools, Tooling for your Hibernate Projects - * + * * Copyright 2016-2024 Red Hat, Inc. * - * Licensed under the GNU Lesser General Public License (LGPL), + * Licensed under the GNU Lesser General Public License (LGPL), * version 2.1 or later (the "License"). * You may not use this file except in compliance with the License. - * You may read the licence in the 'lgpl.txt' file in the root folder of + * You may read the licence in the 'lgpl.txt' file in the root folder of * project or obtain a copy at * * http://www.gnu.org/licenses/lgpl-2.1.html @@ -51,6 +51,11 @@ pipeline { defaultValue: false, description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.' ) + booleanParam( + name: 'RELEASE_PUBLISH_AUTOMATICALLY', + defaultValue: true, + description: 'If true, staging repository will get closed and published automatically, otherwise the artifacts will only be uploaded and the publishing (releasing the staging repository) has to be performed manually at Maven Central portal.' + ) } stages { stage('Release') { @@ -75,6 +80,9 @@ pipeline { def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION) def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION) env.JRELEASER_DRY_RUN = params.RELEASE_DRY_RUN + if (!params.RELEASE_PUBLISH_AUTOMATICALLY) { + env.JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_STAGE='UPLOAD' + } echo "Performing full release for version ${releaseVersion.toString()}" withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven', @@ -84,11 +92,7 @@ pipeline { // using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin) withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'), string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'), - // TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials - // to use the following env variable names to set the user/password: - // JRELEASER_MAVENCENTRAL_USERNAME - // JRELEASER_MAVENCENTRAL_TOKEN - usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'), + usernamePassword(credentialsId: 'central.sonatype.com', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'), string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')]) { sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) { sh 'cat $HOME/.ssh/config' diff --git a/pom.xml b/pom.xml index 68e26ffa9f..76980ff553 100644 --- a/pom.xml +++ b/pom.xml @@ -9,13 +9,13 @@ jboss-parent 48 - + org.hibernate hibernate-tools-parent 5.3.38-SNAPSHOT pom - + Hibernate Tools Parent Project @@ -60,16 +60,20 @@ staging-deploy Local Staging Directory Releases Repository file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven - ossrh - Sonatype OSSRH Snapshots - https://oss.sonatype.org/content/repositories/snapshots + central-releases + Maven Central Releases Repository + https://central.sonatype.com/api/v1/publisher/ + central-snapshots + Maven Central Snapshots Repository + https://central.sonatype.com/repository/maven-snapshots/ + 1.8 1.8 3.9.7 - + @@ -145,7 +149,7 @@ org.hibernate - hibernate-tools-tests-common + hibernate-tools-tests-common ${project.version} @@ -174,16 +178,16 @@ - - ${local.staging.releases.repo.id} - ${local.staging.releases.repo.name} - ${local.staging.releases.repo.url} - - - ${ossrh.snapshots.repo.id} - ${ossrh.snapshots.repo.name} - ${ossrh.snapshots.repo.url} - + + ${central.releases.repo.id} + ${central.releases.repo.name} + ${central.releases.repo.url} + + + ${central.snapshots.repo.id} + ${central.snapshots.repo.name} + ${central.snapshots.repo.url} + @@ -261,4 +265,28 @@ + + + release + + + performRelease + true + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + ${local.staging.releases.repo.id}::${local.staging.releases.repo.url} + + + + + + + From 7865dbf77d8e73235c1e2176969c4d45c59ba9ae Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Fri, 11 Jul 2025 11:52:40 +0300 Subject: [PATCH 452/454] HBX-3039: Update default values in Jenkinsfile Signed-off-by: Koen Aers --- ci/release/Jenkinsfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index 46fe3ad3a1..48ddecadfc 100644 --- a/ci/release/Jenkinsfile +++ b/ci/release/Jenkinsfile @@ -36,24 +36,24 @@ pipeline { parameters { string( name: 'RELEASE_VERSION', - defaultValue: '', + defaultValue: '5.3.38.Final', description: 'The version to be released, e.g. 5.3.38.Final.', trim: true ) string( name: 'DEVELOPMENT_VERSION', - defaultValue: '', + defaultValue: '5.3.39-SNAPSHOT', description: 'The next version to be used after the release, e.g. 5.3.39-SNAPSHOT.', trim: true ) booleanParam( name: 'RELEASE_DRY_RUN', - defaultValue: false, + defaultValue: true, description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.' ) booleanParam( name: 'RELEASE_PUBLISH_AUTOMATICALLY', - defaultValue: true, + defaultValue: false, description: 'If true, staging repository will get closed and published automatically, otherwise the artifacts will only be uploaded and the publishing (releasing the staging repository) has to be performed manually at Maven Central portal.' ) } From 40372ac86c6cc822e12bdda096155d6c84cb32b2 Mon Sep 17 00:00:00 2001 From: Jan Schatteman Date: Mon, 4 Aug 2025 17:27:27 +0200 Subject: [PATCH 453/454] HBX-1020 - Correction in javaDoc generation for getXXX() accessors Signed-off-by: Jan Schatteman --- main/src/main/resources/pojo/PojoPropertyAccessors.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/src/main/resources/pojo/PojoPropertyAccessors.ftl b/main/src/main/resources/pojo/PojoPropertyAccessors.ftl index 74f66a35f7..167e8515fb 100644 --- a/main/src/main/resources/pojo/PojoPropertyAccessors.ftl +++ b/main/src/main/resources/pojo/PojoPropertyAccessors.ftl @@ -3,7 +3,7 @@ <#if pojo.getMetaAttribAsBool(property, "gen-property", true)> <#if pojo.hasFieldJavaDoc(property)> /** - * ${pojo.getFieldJavaDoc(property, 4)} + ${pojo.getFieldJavaDoc(property, 4)} */ <#include "GetPropertyAnnotation.ftl"/> From 13d60eb36274b5e187745dd299ef179b7bf92e41 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Tue, 1 Jul 2025 13:54:18 +0200 Subject: [PATCH 454/454] HBX-3083: Change the protocol of references to the hibernate mapping DTD to 'https' from 'http' Signed-off-by: Koen Aers --- .../src/main/resources/hbm/generalhbm.hbm.ftl | 2 +- .../resources/hbm/hibernate-mapping.hbm.ftl | 2 +- .../tool/ant/AntHibernateTool/TopDown.hbm.xml | 2 +- .../tool/ant/GenericExport/TopDown.hbm.xml | 2 +- .../Hbm2JavaConfiguration/SomeClass.hbm.xml | 2 +- .../SomeClass.hbm.xml | 2 +- .../hibernate/tool/ant/HbmLint/Column.hbm.xml | 2 +- .../tool/ant/HbmLint/SchemaIssues.hbm.xml | 2 +- .../tool/ant/Properties/SomeClass.hbm.xml | 2 +- .../hibernate/tool/ant/Query/query.hbm.xml | 2 +- .../ant/SchemaExportWarning/TopDown.hbm.xml | 2 +- .../ant/SchemaUpdateWarning/TopDown.hbm.xml | 2 +- .../query/QueryExporterTest/UserGroup.hbm.xml | 2 +- .../hbmlint/HbmLintTest/BrokenLazy.hbm.xml | 2 +- .../HbmLintTest/CachingSettings.hbm.xml | 2 +- .../HbmLintTest/IdentifierIssues.hbm.xml | 2 +- .../SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../tool/stat/Statistics/UserGroup.hbm.xml | 2 +- .../SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../tool/ant/Exception/TopDown.hbm.xml | 2 +- .../tool/ant/NoConnInfoExport/TopDown.hbm.xml | 2 +- .../hbm2x/DocExporterTest/Customer.hbm.xml | 2 +- .../DocExporterTest/DependentValue.hbm.xml | 2 +- .../hbm2x/DocExporterTest/HelloWorld.hbm.xml | 2 +- .../hbm2x/DocExporterTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/DocExporterTest/Order.hbm.xml | 2 +- .../hbm2x/DocExporterTest/Product.hbm.xml | 2 +- .../DocExporterTest/UnionSubclass.hbm.xml | 2 +- .../hbm2x/GenericExporterTest/Article.hbm.xml | 2 +- .../hbm2x/GenericExporterTest/Author.hbm.xml | 2 +- .../GenericExporterTest/HelloWorld.hbm.xml | 2 +- .../HashcodeEqualsTest/HashEquals.hbm.xml | 2 +- .../tool/hbm2x/Hbm2CfgTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/Hbm2DaoTest/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2DaoTest/Author.hbm.xml | 2 +- .../tool/hbm2x/Hbm2EJBDaoTest/Article.hbm.xml | 2 +- .../tool/hbm2x/Hbm2EJBDaoTest/Author.hbm.xml | 2 +- .../Hbm2HibernateDAOTest/Article.hbm.xml | 2 +- .../hbm2x/Hbm2HibernateDAOTest/Author.hbm.xml | 2 +- .../Constructors.hbm.xml | 2 +- .../GenericModel.hbm.xml | 2 +- .../hbm2x/Hbm2JavaEjb3Test/Article.hbm.xml | 2 +- .../hbm2x/Hbm2JavaEjb3Test/Author.hbm.xml | 2 +- .../hbm2x/Hbm2JavaEjb3Test/Passenger.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaEjb3Test/Train.hbm.xml | 2 +- .../Article.hbm.xml | 2 +- .../Hbm2JavaInitializationTest/Author.hbm.xml | 2 +- .../Passenger.hbm.xml | 2 +- .../Hbm2JavaInitializationTest/Train.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Customer.hbm.xml | 2 +- .../hbm2x/Hbm2JavaTest/HelloWorld.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Order.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Passenger.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Product.hbm.xml | 2 +- .../tool/hbm2x/Hbm2JavaTest/Train.hbm.xml | 2 +- .../hbm2x/OtherCfg2HbmTest/Customer.hbm.xml | 2 +- .../hbm2x/OtherCfg2HbmTest/HelloWorld.hbm.xml | 2 +- .../hbm2x/OtherCfg2HbmTest/LineItem.hbm.xml | 2 +- .../tool/hbm2x/OtherCfg2HbmTest/Order.hbm.xml | 2 +- .../hbm2x/OtherCfg2HbmTest/Product.hbm.xml | 2 +- .../hbm2x/PropertiesTest/Properties.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/AbstractTest/Car.hbm.xml | 2 +- .../hbm2x/hbm2hbmxml/BackrefTest/Car.hbm.xml | 2 +- .../CompositeElementTest/Glarch.hbm.xml | 2 +- .../DynamicComponentTest/Glarch.hbm.xml | 2 +- .../hbm2hbmxml/Hbm2HbmXmlTest/Basic.hbm.xml | 22 +++++++++---------- .../Hbm2HbmXmlTest/BasicCompositeId.hbm.xml | 2 +- .../Hbm2HbmXmlTest/BasicGlobals.hbm.xml | 2 +- .../Hbm2HbmXmlTest/ClassFullAttribute.hbm.xml | 2 +- .../hbm2hbmxml/IdBagTest/UserGroup.hbm.xml | 2 +- .../hbm2hbmxml/InheritanceTest/Aliens.hbm.xml | 2 +- .../hbm2hbmxml/ListArrayTest/Glarch.hbm.xml | 2 +- .../ManyToManyTest/UserGroup.hbm.xml | 2 +- .../hbm2hbmxml/MapAndAnyTest/Person.hbm.xml | 2 +- .../MapAndAnyTest/Properties.hbm.xml | 2 +- .../PersonAddressOneToOnePrimaryKey.hbm.xml | 2 +- .../hbm2hbmxml/SetElementTest/Search.hbm.xml | 2 +- .../hbm2hbmxml/TypeParamsTest/Order.hbm.xml | 2 +- .../completion/ModelCompletion/City.hbm.xml | 2 +- .../ModelCompletion/Product.hbm.xml | 2 +- .../ProductOwnerAddress.hbm.xml | 2 +- .../completion/ModelCompletion/Store.hbm.xml | 2 +- .../ModelCompletion/StoreCity.hbm.xml | 2 +- .../SchemaAnalyzer/SchemaIssues.hbm.xml | 2 +- .../tools/test/util/HelloWorld.hbm.xml | 2 +- 86 files changed, 96 insertions(+), 96 deletions(-) diff --git a/main/src/main/resources/hbm/generalhbm.hbm.ftl b/main/src/main/resources/hbm/generalhbm.hbm.ftl index bf73afd337..5d9d8e982c 100644 --- a/main/src/main/resources/hbm/generalhbm.hbm.ftl +++ b/main/src/main/resources/hbm/generalhbm.hbm.ftl @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <#if hmgs?exists && hmgs.hasNonDefaultSettings()> diff --git a/test/common/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/TopDown.hbm.xml b/test/common/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/TopDown.hbm.xml index 7423324ed5..767bd5de29 100644 --- a/test/common/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/TopDown.hbm.xml +++ b/test/common/src/main/resources/org/hibernate/tool/ant/AntHibernateTool/TopDown.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/common/src/main/resources/org/hibernate/tool/ant/GenericExport/TopDown.hbm.xml b/test/common/src/main/resources/org/hibernate/tool/ant/GenericExport/TopDown.hbm.xml index 7423324ed5..767bd5de29 100644 --- a/test/common/src/main/resources/org/hibernate/tool/ant/GenericExport/TopDown.hbm.xml +++ b/test/common/src/main/resources/org/hibernate/tool/ant/GenericExport/TopDown.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaConfiguration/SomeClass.hbm.xml b/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaConfiguration/SomeClass.hbm.xml index 6f660da374..a18a73271f 100644 --- a/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaConfiguration/SomeClass.hbm.xml +++ b/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaConfiguration/SomeClass.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/SomeClass.hbm.xml b/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/SomeClass.hbm.xml index 6f660da374..a18a73271f 100644 --- a/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/SomeClass.hbm.xml +++ b/test/common/src/main/resources/org/hibernate/tool/ant/Hbm2JavaEJB3Configuration/SomeClass.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/common/src/main/resources/org/hibernate/tool/ant/HbmLint/Column.hbm.xml b/test/common/src/main/resources/org/hibernate/tool/ant/HbmLint/Column.hbm.xml index 658bef462f..54b5df61c2 100644 --- a/test/common/src/main/resources/org/hibernate/tool/ant/HbmLint/Column.hbm.xml +++ b/test/common/src/main/resources/org/hibernate/tool/ant/HbmLint/Column.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/DocExporterTest/HelloWorld.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/DocExporterTest/HelloWorld.hbm.xml index 8c4356fb7e..1154536904 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/DocExporterTest/HelloWorld.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/DocExporterTest/HelloWorld.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> @@ -24,24 +24,24 @@ next_hi_value - - description - + - + - + - anotherone + anotherone - + diff --git a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicCompositeId.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicCompositeId.hbm.xml index a84fb49183..61302ff3d6 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicCompositeId.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/Hbm2HbmXmlTest/BasicCompositeId.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/City.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/City.hbm.xml index a685453b2b..156ecb7007 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/City.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/City.hbm.xml @@ -1,6 +1,6 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Product.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Product.hbm.xml index 1b83e2f516..8ceb587ace 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Product.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Product.hbm.xml @@ -1,6 +1,6 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/ProductOwnerAddress.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/ProductOwnerAddress.hbm.xml index 2acf2e0514..c52c608321 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/ProductOwnerAddress.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/ProductOwnerAddress.hbm.xml @@ -1,6 +1,6 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Store.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Store.hbm.xml index 9e32e387e9..ae2dc5e0d1 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Store.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/Store.hbm.xml @@ -1,6 +1,6 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/StoreCity.hbm.xml b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/StoreCity.hbm.xml index db806a886f..92c597c355 100644 --- a/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/StoreCity.hbm.xml +++ b/test/nodb/src/test/resources/org/hibernate/tool/ide/completion/ModelCompletion/StoreCity.hbm.xml @@ -1,6 +1,6 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml b/test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml index bc82183d72..cf708c66bc 100644 --- a/test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml +++ b/test/oracle/src/test/resources/org/hibernate/tool/hbmlint/SchemaAnalyzer/SchemaIssues.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> diff --git a/test/utils/src/test/resources/org/hibernate/tools/test/util/HelloWorld.hbm.xml b/test/utils/src/test/resources/org/hibernate/tools/test/util/HelloWorld.hbm.xml index 82989a5032..9588363b32 100644 --- a/test/utils/src/test/resources/org/hibernate/tools/test/util/HelloWorld.hbm.xml +++ b/test/utils/src/test/resources/org/hibernate/tools/test/util/HelloWorld.hbm.xml @@ -1,7 +1,7 @@ + "https://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">