File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed
main/java/org/hibernate/tool/internal/export/mapping
test/java/org/hibernate/tool/internal/export/mapping Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ package org .hibernate .tool .internal .export .mapping ;
2+
3+ import org .hibernate .boot .jaxb .Origin ;
4+ import org .hibernate .boot .jaxb .SourceType ;
5+
6+ import java .io .File ;
7+ import java .io .Serial ;
8+
9+ public class HbmXmlOrigin extends Origin {
10+
11+ @ Serial
12+ private static final long serialVersionUID = 1L ;
13+
14+ private final File hbmXmlFile ;
15+
16+ public HbmXmlOrigin (File hbmXmlFile ) {
17+ super ( SourceType .FILE , hbmXmlFile .getAbsolutePath () );
18+ this .hbmXmlFile = hbmXmlFile ;
19+ }
20+
21+ public File getHbmXmlFile () {
22+ return hbmXmlFile ;
23+ }
24+
25+ }
Original file line number Diff line number Diff line change 1+ package org .hibernate .tool .internal .export .mapping ;
2+
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
5+
6+ import java .io .File ;
7+ import java .nio .file .Path ;
8+
9+ import org .hibernate .boot .jaxb .SourceType ;
10+ import org .junit .jupiter .api .Test ;
11+ import org .junit .jupiter .api .io .TempDir ;
12+
13+ public class HbmXmlOriginTest {
14+
15+ @ TempDir
16+ private Path tempDir ;
17+
18+ @ Test
19+ public void testHbmXmlOrigin () throws Exception {
20+ File hbmXmlFile = new File (tempDir .toFile (), "foo.hbm.xml" );
21+ HbmXmlOrigin hxo = new HbmXmlOrigin (hbmXmlFile );
22+ assertNotNull (hxo );
23+ assertEquals (hbmXmlFile , hxo .getHbmXmlFile ());
24+ assertEquals (hbmXmlFile .getAbsolutePath (), hxo .getName ());
25+ assertEquals (SourceType .FILE , hxo .getType ());
26+ }
27+
28+ }
You can’t perform that action at this time.
0 commit comments