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
24 changes: 17 additions & 7 deletions ant/src/it/java/org/hibernate/tool/ant/ExamplesTestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,23 @@ public void testNative() throws Exception {

@Test
public void testProperties() throws Exception {
File buildFile = new File(baseFolder, "properties/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());
PrintStream savedOut = System.out;
try {
File buildFile = new File(baseFolder, "properties/build.xml");
Project project = createProject(buildFile);
assertNotNull(project);
ByteArrayOutputStream out = new ByteArrayOutputStream();
System.setOut(new PrintStream(out));
assertFalse(out.toString().contains("Hello, World!"));
assertFalse(out.toString().contains("Hello, Foo!"));
assertFalse(out.toString().contains("Hello, Bar!"));
project.executeTarget("reveng");
assertTrue(out.toString().contains("Hello, World!"));
assertTrue(out.toString().contains("Hello, Foo!"));
assertTrue(out.toString().contains("Hello, Bar!"));
} finally {
System.setOut(savedOut);
}
}

private Project createProject(File buildXmlFile) throws Exception {
Expand Down