From 263d736b731fe6d082cd22a4a3b2dbbc621fb1b3 Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 29 Aug 2024 14:22:41 +0300 Subject: [PATCH] HBX-2910: Make sure that the Exporter classes needed by plugin 'org.hibernate.eclipse.console' are visible and available Signed-off-by: Koen Aers --- .../org/hibernate/tool/hbm2x/DAOExporter.java | 5 ++ .../hibernate/tool/hbm2x/GenericExporter.java | 3 + .../hibernate/tool/hbm2x/Hbm2DDLExporter.java | 5 ++ .../hibernate/tool/hbm2x/QueryExporter.java | 3 + .../tool/hbm2x/ExportersPresenceTest.java | 87 +++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 jbt/src/main/java/org/hibernate/tool/hbm2x/DAOExporter.java create mode 100644 jbt/src/main/java/org/hibernate/tool/hbm2x/GenericExporter.java create mode 100644 jbt/src/main/java/org/hibernate/tool/hbm2x/Hbm2DDLExporter.java create mode 100644 jbt/src/main/java/org/hibernate/tool/hbm2x/QueryExporter.java create mode 100644 jbt/src/test/java/org/hibernate/tool/hbm2x/ExportersPresenceTest.java diff --git a/jbt/src/main/java/org/hibernate/tool/hbm2x/DAOExporter.java b/jbt/src/main/java/org/hibernate/tool/hbm2x/DAOExporter.java new file mode 100644 index 0000000000..263e564e9a --- /dev/null +++ b/jbt/src/main/java/org/hibernate/tool/hbm2x/DAOExporter.java @@ -0,0 +1,5 @@ +package org.hibernate.tool.hbm2x; + +import org.hibernate.tool.internal.export.dao.DaoExporter; + +public class DAOExporter extends DaoExporter {} diff --git a/jbt/src/main/java/org/hibernate/tool/hbm2x/GenericExporter.java b/jbt/src/main/java/org/hibernate/tool/hbm2x/GenericExporter.java new file mode 100644 index 0000000000..3ae36af92d --- /dev/null +++ b/jbt/src/main/java/org/hibernate/tool/hbm2x/GenericExporter.java @@ -0,0 +1,3 @@ +package org.hibernate.tool.hbm2x; + +public class GenericExporter extends org.hibernate.tool.internal.export.common.GenericExporter {} diff --git a/jbt/src/main/java/org/hibernate/tool/hbm2x/Hbm2DDLExporter.java b/jbt/src/main/java/org/hibernate/tool/hbm2x/Hbm2DDLExporter.java new file mode 100644 index 0000000000..ce5334e854 --- /dev/null +++ b/jbt/src/main/java/org/hibernate/tool/hbm2x/Hbm2DDLExporter.java @@ -0,0 +1,5 @@ +package org.hibernate.tool.hbm2x; + +import org.hibernate.tool.internal.export.ddl.DdlExporter; + +public class Hbm2DDLExporter extends DdlExporter {} diff --git a/jbt/src/main/java/org/hibernate/tool/hbm2x/QueryExporter.java b/jbt/src/main/java/org/hibernate/tool/hbm2x/QueryExporter.java new file mode 100644 index 0000000000..cb199780c0 --- /dev/null +++ b/jbt/src/main/java/org/hibernate/tool/hbm2x/QueryExporter.java @@ -0,0 +1,3 @@ +package org.hibernate.tool.hbm2x; + +public class QueryExporter extends org.hibernate.tool.internal.export.query.QueryExporter {} diff --git a/jbt/src/test/java/org/hibernate/tool/hbm2x/ExportersPresenceTest.java b/jbt/src/test/java/org/hibernate/tool/hbm2x/ExportersPresenceTest.java new file mode 100644 index 0000000000..f2b9b0b82c --- /dev/null +++ b/jbt/src/test/java/org/hibernate/tool/hbm2x/ExportersPresenceTest.java @@ -0,0 +1,87 @@ +package org.hibernate.tool.hbm2x; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; + +import org.junit.jupiter.api.Test; + +public class ExportersPresenceTest { + + @Test + public void testHbm2DDLExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class ddlExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.Hbm2DDLExporter"); + assertNotNull(ddlExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testPOJOExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class pojoExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.POJOExporter"); + assertNotNull(pojoExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testHibernateMappingExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class hibernateMappingExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.HibernateMappingExporter"); + assertNotNull(hibernateMappingExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testDAOExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class daoExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.DAOExporter"); + assertNotNull(daoExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testGenericExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class genericExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.GenericExporter"); + assertNotNull(genericExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testHibernateConfigurationExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class hibernateConfigurationExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.HibernateConfigurationExporter"); + assertNotNull(hibernateConfigurationExporterClass); + } catch (Throwable t) { + fail(t); + } + } + + @Test + public void testQueryExporter() { + try { + ClassLoader cl = getClass().getClassLoader(); + Class hibernateConfigurationExporterClass = cl.loadClass("org.hibernate.tool.hbm2x.QueryExporter"); + assertNotNull(hibernateConfigurationExporterClass); + } catch (Throwable t) { + fail(t); + } + } + +}