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
19 changes: 19 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 @@ -9,7 +9,9 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
Expand Down Expand Up @@ -43,6 +45,23 @@ public void test5MinuteTutorial() throws Exception {
assertTrue(personFile.exists());
}

@Test
public void testClasspath() throws Exception {
PrintStream savedOut = System.out;
try {
File buildFile = new File(baseFolder, "classpath/build.xml");
Project project = createProject(buildFile);
assertNotNull(project);
ByteArrayOutputStream out = new ByteArrayOutputStream();
assertFalse(out.toString().contains("Hello from Exporter!"));
System.setOut(new PrintStream(out));
project.executeTarget("reveng");
assertTrue(out.toString().contains("Hello from Exporter!"));
} finally {
System.setOut(savedOut);
}
}

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