diff --git a/spring-boot-deployment-tests/pom.xml b/spring-boot-deployment-tests/pom.xml index 5d07158672c..29268fa3d58 100644 --- a/spring-boot-deployment-tests/pom.xml +++ b/spring-boot-deployment-tests/pom.xml @@ -27,6 +27,7 @@ spring-boot-deployment-test-tomee spring-boot-deployment-test-tomcat spring-boot-deployment-test-wildfly + spring-boot-deployment-test-wlp diff --git a/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml new file mode 100644 index 00000000000..7a11bf33e5d --- /dev/null +++ b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/pom.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-deployment-tests + 1.5.0.BUILD-SNAPSHOT + + spring-boot-deployment-test-wlp + war + Spring Boot WebSphere Liberty Profile Deployment Test + Spring Boot WebSphere Liberty Profile Deployment Test + http://projects.spring.io/spring-boot/ + + Pivotal Software, Inc. + http://www.spring.io + + + ${basedir}/../.. + 16.0.0.4 + liberty + http://central.maven.org/maven2/com/ibm/websphere/appserver/runtime/wlp-webProfile7/${wlp.version}/wlp-webProfile7-${wlp.version}.zip + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + javax.servlet + javax.servlet-api + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + reserve-network-port + + reserve-network-port + + process-resources + + + appserver.port + + + + + + + org.codehaus.cargo + cargo-maven2-plugin + + + + ${appserver.port} + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + ${appserver.port} + + + + + + diff --git a/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java new file mode 100644 index 00000000000..ff93453d68c --- /dev/null +++ b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleController.java @@ -0,0 +1,30 @@ +/* + * Copyright 2012-2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class SampleController { + + @GetMapping("/") + public String hello() { + return "Hello World"; + } + +} diff --git a/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java new file mode 100644 index 00000000000..7de84261c90 --- /dev/null +++ b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/main/java/sample/SampleWlpDeployApplication.java @@ -0,0 +1,25 @@ +/* + * Copyright 2012-2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.support.SpringBootServletInitializer; + +@SpringBootApplication +public class SampleWlpDeployApplication extends SpringBootServletInitializer { + +} diff --git a/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java new file mode 100644 index 00000000000..91ad8553f2f --- /dev/null +++ b/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java @@ -0,0 +1,43 @@ +/* + * Copyright 2012-2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package sample; + +import org.junit.Test; + +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Integration Tests for {@link SampleWlpDeployApplication}. + */ +public class SampleWlpDeployApplicationIT { + + private int port = Integer.valueOf(System.getProperty("port")); + + @Test + public void testHome() throws Exception { + String url = "http://localhost:" + this.port + "/bootapp/"; + ResponseEntity entity = new TestRestTemplate().getForEntity(url, + String.class); + assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); + assertThat(entity.getBody()).isEqualTo("Hello World"); + } + +} diff --git a/spring-boot-parent/pom.xml b/spring-boot-parent/pom.xml index 1e9b245c242..ba7b10ae377 100644 --- a/spring-boot-parent/pom.xml +++ b/spring-boot-parent/pom.xml @@ -340,7 +340,7 @@ org.codehaus.cargo cargo-maven2-plugin - 1.4.15 + 1.6.2 org.codehaus.gmavenplus