File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
ant/src/it/java/org/hibernate/tool/ant Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 99import org .junit .jupiter .api .Test ;
1010import org .junit .jupiter .api .io .TempDir ;
1111
12+ import java .io .ByteArrayOutputStream ;
1213import java .io .File ;
14+ import java .io .PrintStream ;
1315import java .net .URISyntaxException ;
1416import java .net .URL ;
1517import java .nio .file .Files ;
@@ -43,6 +45,23 @@ public void test5MinuteTutorial() throws Exception {
4345 assertTrue (personFile .exists ());
4446 }
4547
48+ @ Test
49+ public void testClasspath () throws Exception {
50+ PrintStream savedOut = System .out ;
51+ try {
52+ File buildFile = new File (baseFolder , "classpath/build.xml" );
53+ Project project = createProject (buildFile );
54+ assertNotNull (project );
55+ ByteArrayOutputStream out = new ByteArrayOutputStream ();
56+ assertFalse (out .toString ().contains ("Hello from Exporter!" ));
57+ System .setOut (new PrintStream (out ));
58+ project .executeTarget ("reveng" );
59+ assertTrue (out .toString ().contains ("Hello from Exporter!" ));
60+ } finally {
61+ System .setOut (savedOut );
62+ }
63+ }
64+
4665 private Project createProject (File buildXmlFile ) throws Exception {
4766 Project result = new Project ();
4867 ProjectHelper projectHelper = ProjectHelper .getProjectHelper ();
You can’t perform that action at this time.
0 commit comments