diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/pom.xml b/liberty-maven-plugin/src/it/binary-scanner-it/pom.xml index a9c5c160c..ebe44005a 100755 --- a/liberty-maven-plugin/src/it/binary-scanner-it/pom.xml +++ b/liberty-maven-plugin/src/it/binary-scanner-it/pom.xml @@ -3,13 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - io.openliberty.tools.it - tests - 1.0-SNAPSHOT - - binary-scanner-it + io.openliberty.tools.it + 1.0 jar @@ -67,7 +63,7 @@ @pom.version@ ${runtimeVersion} - 23.0.0.1-SNAPSHOT + 23.0.0.3-SNAPSHOT false diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml new file mode 100755 index 000000000..fc755016e --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/pom.xml @@ -0,0 +1,220 @@ + + + + 4.0.0 + + binary-scanner-it-tests + dev-sample-proj + 1.0-SNAPSHOT + war + + + UTF-8 + UTF-8 + 1.7 + 1.7 + LibertyProject + + 9080 + 9443 + + usr + + + + + oss-sonatype + oss-sonatype + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + + + + + io.openliberty.features + features-bom + RUNTIME_VERSION + pom + import + + + + + + + + jakarta.platform + jakarta.jakartaee-api + 10.0.0 + provided + + + org.eclipse.microprofile + microprofile + 6.0 + pom + provided + + + + junit + junit + 4.13.1 + test + + + org.apache.cxf + cxf-rt-rs-client + 3.2.6 + test + + + org.apache.cxf + cxf-rt-rs-extension-providers + 3.2.6 + test + + + org.glassfish + javax.json + 1.0.4 + test + + + + org.apache.commons + commons-lang3 + 3.0 + + + + javax.xml.bind + jaxb-api + 2.3.1 + provided + + + com.sun.xml.bind + jaxb-core + 2.3.0.1 + provided + + + javax.activation + activation + 1.1.1 + provided + + + javax.batch + javax.batch-api + 1.0.1 + provided + + + + org.slf4j + slf4j-api + 1.7.25 + + + ch.qos.logback + logback-classic + 1.2.3 + runtime + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 3.3.2 + + false + pom.xml + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M1 + + + test + default-test + + + **/it/** + + ${project.build.directory}/test-reports/unit + + + + + + + io.openliberty.tools + liberty-maven-plugin + SUB_VERSION + + + io.openliberty + openliberty-kernel + RUNTIME_VERSION + zip + + ${app.name} + ${packaging.type} + + ${testServerHttpPort} + ${testServerHttpsPort} + json + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.0.0-M1 + + + integration-test + integration-test + + integration-test + + + + **/it/**/*.java + + + + ${testServerHttpPort} + + + + + + verify-results + + verify + + + + + ${project.build.directory}/test-reports/it/failsafe-summary.xml + ${project.build.directory}/test-reports/it + + + + + diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java new file mode 100755 index 000000000..caea6b44b --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloLogger.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2020. + * + * 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 com.demo; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; + +import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN; + +@Path("/show-log") +public class HelloLogger { + private static final Logger log = LoggerFactory.getLogger(HelloLogger.class); + + @GET + @Produces(TEXT_PLAIN) + public String showLog() { + log.info("Here is the Log"); + return "Log has been shown"; + } +} diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java new file mode 100644 index 000000000..a5811dedc --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloServlet.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2019. + * + * 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 com.demo; + +import java.io.IOException; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import jakarta.servlet.ServletException; +import jakarta.servlet.annotation.WebServlet; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; + +@WebServlet(urlPatterns="/servlet") +public class HelloServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + private static final Logger log = LoggerFactory.getLogger(HelloLogger.class); + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + log.info("SLF4J Logger is ready for messages."); + response.getWriter().append("hello world"); + } +} \ No newline at end of file diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java new file mode 100755 index 000000000..ec88aeba2 --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/java/com/demo/HelloWorld.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * (c) Copyright IBM Corporation 2022. + * + * 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 com.demo; + +import org.eclipse.microprofile.health.Liveness; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; + +@Liveness +public class HelloWorld implements HealthCheck { + @Override + public HealthCheckResponse call() { + return HealthCheckResponse + .named("liveness check") + .build(); + } + + public String helloWorld() { + return "helloWorld"; + } +} diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml new file mode 100755 index 000000000..7256d051f --- /dev/null +++ b/liberty-maven-plugin/src/it/binary-scanner-it/resources/basic-dev-project10/src/main/liberty/config/server.xml @@ -0,0 +1,5 @@ + + + + diff --git a/liberty-maven-plugin/src/it/binary-scanner-it/run-binary-scanner-it b/liberty-maven-plugin/src/it/binary-scanner-it/run-binary-scanner-it index 7496004a7..5c54b7d0b 100755 --- a/liberty-maven-plugin/src/it/binary-scanner-it/run-binary-scanner-it +++ b/liberty-maven-plugin/src/it/binary-scanner-it/run-binary-scanner-it @@ -10,14 +10,18 @@ # five minutes for each test. cd liberty-maven-plugin/ cp src/it/binary-scanner-it/pom.xml /tmp -for i in 3.7 3.7.1 +for i in 3.8 3.8.1 3.8.2 do -sed "s/@pom.version@/$i/g" src/it/binary-scanner-it/pom.xml -mvn install verify -Ponline-its -Dinvoker.streamLogs=true -Druntime=ol -DruntimeVersion=23.0.0.1 -Dinvoker.test=binary-scanner-it echo !! +echo !! About to test using Liberty Maven Plugin version $i. +echo !! Each test runs for 5-10 minutes and then pauses here +echo !! so you can check the results. +echo !! You should already have followed the instructions in +echo !! the comments at the top of this script. echo !! PRESS ENTER TO CONTINUE echo !! -# Allow time to inspect the pass/fail status before continuing. read j +sed "s/@pom.version@/$i/g" src/it/binary-scanner-it/pom.xml +mvn install verify -Ponline-its -Dinvoker.streamLogs=true -Druntime=ol -DruntimeVersion=23.0.0.1 -Dinvoker.test=binary-scanner-it done cp /tmp/pom.xml src/it/binary-scanner-it/pom.xml