Search in sources :

Example 11 with Invocation

use of org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation in project spring-boot by spring-projects.

the class WarCommandIT method warCreation.

@Test
public void warCreation() throws Exception {
    int port = SocketUtils.findAvailableTcpPort();
    File war = new File("target/test-app.war");
    Invocation invocation = this.cli.invoke("war", war.getAbsolutePath(), "war.groovy");
    invocation.await();
    assertThat(war.exists()).isTrue();
    Process process = new JavaExecutable().processBuilder("-jar", war.getAbsolutePath(), "--server.port=" + port).start();
    invocation = new Invocation(process);
    invocation.await();
    assertThat(invocation.getOutput()).contains("onStart error");
    assertThat(invocation.getOutput()).contains("Tomcat started");
    assertThat(invocation.getOutput()).contains("/WEB-INF/lib-provided/tomcat-embed-core");
    assertThat(invocation.getOutput()).contains("WEB-INF/classes!/root.properties");
    process.destroy();
}
Also used : Invocation(org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation) File(java.io.File) JavaExecutable(org.springframework.boot.loader.tools.JavaExecutable) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 Invocation (org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation)11 File (java.io.File)4 JavaExecutable (org.springframework.boot.loader.tools.JavaExecutable)4