diff --git a/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java b/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java index a85ef80d34..74c21aa81e 100644 --- a/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java +++ b/ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java @@ -28,6 +28,10 @@ public class ExamplesTestIT { @BeforeAll public static void beforeAll() throws Exception { + // The needed resource for this test are put in place + // in the 'baseFolder' (normally 'target/test-classes') + // by the 'build-helper-maven-plugin' execution. + // See the 'pom.xml' baseFolder = determineBaseFolder(); editIncludedXml(); overwriteHibernateProperties(); @@ -84,6 +88,17 @@ public void testJpa() throws Exception { assertTrue(barSqlFile.exists()); } + @Test + public void testNative() throws Exception { + File buildFile = new File(baseFolder, "native/build.xml"); + Project project = createProject(buildFile); + assertNotNull(project); + File fooSqlFile = new File(baseFolder, "native/generated/foo.sql"); + assertFalse(fooSqlFile.exists()); + project.executeTarget("reveng"); + assertTrue(fooSqlFile.exists()); + } + private Project createProject(File buildXmlFile) throws Exception { Project result = new Project(); ProjectHelper projectHelper = ProjectHelper.getProjectHelper();