Skip to content

Commit 1d816d1

Browse files
committed
HBX-3110: Add a functional test to guard the sanity of the Ant examples
- Add a test verifying the 'native' example Signed-off-by: Koen Aers <[email protected]>
1 parent 0bdc7f9 commit 1d816d1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public class ExamplesTestIT {
2828

2929
@BeforeAll
3030
public static void beforeAll() throws Exception {
31+
// The needed resource for this test are put in place
32+
// in the 'baseFolder' (normally 'target/test-classes')
33+
// by the 'build-helper-maven-plugin' execution.
34+
// See the 'pom.xml'
3135
baseFolder = determineBaseFolder();
3236
editIncludedXml();
3337
overwriteHibernateProperties();
@@ -84,6 +88,17 @@ public void testJpa() throws Exception {
8488
assertTrue(barSqlFile.exists());
8589
}
8690

91+
@Test
92+
public void testNative() throws Exception {
93+
File buildFile = new File(baseFolder, "native/build.xml");
94+
Project project = createProject(buildFile);
95+
assertNotNull(project);
96+
File fooSqlFile = new File(baseFolder, "native/generated/foo.sql");
97+
assertFalse(fooSqlFile.exists());
98+
project.executeTarget("reveng");
99+
assertTrue(fooSqlFile.exists());
100+
}
101+
87102
private Project createProject(File buildXmlFile) throws Exception {
88103
Project result = new Project();
89104
ProjectHelper projectHelper = ProjectHelper.getProjectHelper();

0 commit comments

Comments
 (0)