commit
d1a0d9f11b
|
|
@ -11,7 +11,7 @@
|
||||||
actual jars). Run with '$ java -jar target/*.jar'.
|
actual jars). Run with '$ java -jar target/*.jar'.
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<property name="lib.dir" location="${basedir}/target/lib" />
|
<property name="lib.dir" location="${basedir}/build/ant/lib" />
|
||||||
<property name="start-class" value="smoketest.ant.SampleAntApplication" />
|
<property name="start-class" value="smoketest.ant.SampleAntApplication" />
|
||||||
|
|
||||||
<target name="resolve" description="--> retrieve dependencies with ivy">
|
<target name="resolve" description="--> retrieve dependencies with ivy">
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="build" depends="compile">
|
<target name="build" depends="compile">
|
||||||
<spring-boot:exejar destfile="build/ant/libs/${ant.project.name}-${ant-spring-boot.version}.jar" classes="build/ant/classes">
|
<spring-boot:exejar destfile="build/ant/libs/${ant.project.name}.jar" classes="build/ant/classes">
|
||||||
<spring-boot:lib>
|
<spring-boot:lib>
|
||||||
<fileset dir="${lib.dir}/runtime" />
|
<fileset dir="${lib.dir}/runtime" />
|
||||||
</spring-boot:lib>
|
</spring-boot:lib>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
package smoketest.ant;
|
package smoketest.ant;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileFilter;
|
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
|
@ -38,17 +37,9 @@ public class SampleAntApplicationIT {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void runJar() throws Exception {
|
void runJar() throws Exception {
|
||||||
File target = new File("build/ant/libs");
|
File libs = new File("build/ant/libs");
|
||||||
File[] jarFiles = target.listFiles(new FileFilter() {
|
Process process = new JavaExecutable().processBuilder("-jar", "spring-boot-smoke-test-ant.jar").directory(libs)
|
||||||
|
.start();
|
||||||
@Override
|
|
||||||
public boolean accept(File file) {
|
|
||||||
return file.getName().endsWith(".jar");
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
assertThat(jarFiles).hasSize(1);
|
|
||||||
Process process = new JavaExecutable().processBuilder("-jar", jarFiles[0].getName()).directory(target).start();
|
|
||||||
process.waitFor(5, TimeUnit.MINUTES);
|
process.waitFor(5, TimeUnit.MINUTES);
|
||||||
assertThat(process.exitValue()).isEqualTo(0);
|
assertThat(process.exitValue()).isEqualTo(0);
|
||||||
String output = FileCopyUtils.copyToString(new InputStreamReader(process.getInputStream()));
|
String output = FileCopyUtils.copyToString(new InputStreamReader(process.getInputStream()));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue