Skip to content

Commit fc3ece6

Browse files
committed
HBX-2062: Investigate failing setup of org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest.Order.TestCase
Signed-off-by: Koen Aers <[email protected]>
1 parent 2b79417 commit fc3ece6

File tree

2 files changed

+7
-9
lines changed
  • test/nodb/src/test
    • java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest
    • resources/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest

2 files changed

+7
-9
lines changed

test/nodb/src/test/java/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/TestCase.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.hibernate.tools.test.util.HibernateUtil;
4646
import org.hibernate.tools.test.util.JUnitUtil;
4747
import org.junit.jupiter.api.BeforeEach;
48-
import org.junit.jupiter.api.Disabled;
4948
import org.junit.jupiter.api.Test;
5049
import org.junit.jupiter.api.io.TempDir;
5150
import org.w3c.dom.Document;
@@ -82,8 +81,6 @@ public void setUp() throws Exception {
8281
hbmexporter.start();
8382
}
8483

85-
// TODO HBX-2062: Investigate and reenable
86-
@Disabled
8784
@Test
8885
public void testAllFilesExistence() {
8986
JUnitUtil.assertIsNonEmptyFile(
@@ -92,8 +89,6 @@ public void testAllFilesExistence() {
9289
"org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml"));
9390
}
9491

95-
// TODO HBX-2062: Investigate and reenable
96-
@Disabled
9792
@Test
9893
public void testReadable() {
9994
File orderHbmXml =
@@ -102,14 +97,13 @@ public void testReadable() {
10297
"org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml");
10398
Properties properties = new Properties();
10499
properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName());
100+
properties.setProperty(AvailableSettings.CONNECTION_PROVIDER, HibernateUtil.ConnectionProvider.class.getName());
105101
File[] files = new File[] { orderHbmXml };
106102
MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory
107103
.createNativeDescriptor(null, files, properties);
108104
assertNotNull(metadataDescriptor.createMetadata());
109105
}
110106

111-
// TODO HBX-2062: Investigate and reenable
112-
@Disabled
113107
@Test
114108
public void testTypeParamsElements() throws Exception {
115109
File outputXml = new File(
@@ -163,10 +157,14 @@ public void testTypeParamsElements() throws Exception {
163157
set.contains("enumClass"),
164158
"Can't find 'enumClass' param");
165159
assertEquals(
166-
"org.hibernate.tool.hbm2x.hbm2hbmxml.Order$Status",
160+
Status.class.getName(),
167161
params.get("enumClass"));
168162
assertTrue(nameElement.getElementsByTagName("type").getLength() == 0, "property name should not have any type element");
169163
assertEquals(nameElement.getAttribute("type"), "string");
170164
}
165+
166+
enum Status {
167+
ON, OFF
168+
}
171169

172170
}

test/nodb/src/test/resources/org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<param name="column">STATUS</param>
3535
<param name="table">ORDERS</param>
3636
<param name="schema"/>
37-
<param name="enumClass">org.hibernate.tool.hbm2x.hbm2hbmxml.Order$Status</param>
37+
<param name="enumClass">org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest.TestCase$Status</param>
3838
</type>
3939
</property>
4040
<property name="name" type="string"/>

0 commit comments

Comments
 (0)