Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ public void testProperties() throws Exception {
}
}

@Test
public void testTemplatePath() throws Exception {
File buildFile = new File(baseFolder, "templatepath/build.xml");
Project project = createProject(buildFile);
assertNotNull(project);
File personFile = new File(baseFolder, "templatepath/generated/Person.java");
assertFalse(personFile.exists());
project.executeTarget("reveng");
assertTrue(personFile.exists());
String personFileContents = new String(Files.readAllBytes(personFile.toPath()));
assertTrue(personFileContents.contains("// This is just an example of a custom template"));
}

private Project createProject(File buildXmlFile) throws Exception {
Project result = new Project();
ProjectHelper projectHelper = ProjectHelper.getProjectHelper();
Expand Down