Skip to content

Commit

Permalink
HBX-2910: Make sure that the Exporter classes needed by plugin 'org.h…
Browse files Browse the repository at this point in the history
…ibernate.eclipse.console' are visible and available

Signed-off-by: Koen Aers <[email protected]>
  • Loading branch information
koentsje committed Aug 29, 2024
1 parent 3241327 commit c273c2f
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jbt/src/main/java/org/hibernate/tool/hbm2x/DAOExporter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.hibernate.tool.hbm2x;

import org.hibernate.tool.internal.export.dao.DaoExporter;

public class DAOExporter extends DaoExporter {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package org.hibernate.tool.hbm2x;

public class GenericExporter extends org.hibernate.tool.internal.export.common.GenericExporter {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.hibernate.tool.hbm2x;

import org.hibernate.tool.internal.export.ddl.DdlExporter;

public class Hbm2DDLExporter extends DdlExporter {}
3 changes: 3 additions & 0 deletions jbt/src/main/java/org/hibernate/tool/hbm2x/QueryExporter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package org.hibernate.tool.hbm2x;

public class QueryExporter extends org.hibernate.tool.internal.export.query.QueryExporter {}
Original file line number Diff line number Diff line change
@@ -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);
}
}

}

0 comments on commit c273c2f

Please sign in to comment.