Skip to content

Commit 526f163

Browse files
committed
HBX-2062: Investigate failing setup of org.hibernate.tool.hbm2x.hbm2hbmxml.TypeParamsTest.Order.TestCase
- Cherry-pick the fix of the 6.x branches - Disable the tests again because of HBX-1884 Signed-off-by: Koen Aers <[email protected]>
1 parent 2137de9 commit 526f163

File tree

2 files changed

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

2 files changed

+9
-8
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
* @author Dmitry Geraskov
5757
* @author koen
5858
*/
59+
//TODO Reenable this test and make it pass (See HBX-2884)
60+
@Disabled
5961
public class TestCase {
6062

6163
private static final String[] HBM_XML_FILES = new String[] {
@@ -82,8 +84,6 @@ public void setUp() throws Exception {
8284
hbmexporter.start();
8385
}
8486

85-
// TODO HBX-2062: Investigate and reenable
86-
@Disabled
8787
@Test
8888
public void testAllFilesExistence() {
8989
JUnitUtil.assertIsNonEmptyFile(
@@ -92,8 +92,6 @@ public void testAllFilesExistence() {
9292
"org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml"));
9393
}
9494

95-
// TODO HBX-2062: Investigate and reenable
96-
@Disabled
9795
@Test
9896
public void testReadable() {
9997
File orderHbmXml =
@@ -102,14 +100,13 @@ public void testReadable() {
102100
"org/hibernate/tool/hbm2x/hbm2hbmxml/TypeParamsTest/Order.hbm.xml");
103101
Properties properties = new Properties();
104102
properties.setProperty(AvailableSettings.DIALECT, HibernateUtil.Dialect.class.getName());
103+
properties.setProperty(AvailableSettings.CONNECTION_PROVIDER, HibernateUtil.ConnectionProvider.class.getName());
105104
File[] files = new File[] { orderHbmXml };
106105
MetadataDescriptor metadataDescriptor = MetadataDescriptorFactory
107106
.createNativeDescriptor(null, files, properties);
108107
assertNotNull(metadataDescriptor.createMetadata());
109108
}
110109

111-
// TODO HBX-2062: Investigate and reenable
112-
@Disabled
113110
@Test
114111
public void testTypeParamsElements() throws Exception {
115112
File outputXml = new File(
@@ -163,10 +160,14 @@ public void testTypeParamsElements() throws Exception {
163160
set.contains("enumClass"),
164161
"Can't find 'enumClass' param");
165162
assertEquals(
166-
"org.hibernate.tool.hbm2x.hbm2hbmxml.Order$Status",
163+
Status.class.getName(),
167164
params.get("enumClass"));
168165
assertTrue(nameElement.getElementsByTagName("type").getLength() == 0, "property name should not have any type element");
169166
assertEquals(nameElement.getAttribute("type"), "string");
170167
}
168+
169+
enum Status {
170+
ON, OFF
171+
}
171172

172173
}

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)