diff --git a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/pom.xml b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/pom.xml deleted file mode 100755 index 4654d6c19..000000000 --- a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/pom.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - 4.0.0 - - dev-it-tests - exploded-war-proj - 1.0-SNAPSHOT - war - - - UTF-8 - UTF-8 - 1.7 - 1.7 - LibertyProject - - 9080 - 9443 - - usr - - - - - - io.openliberty.features - features-bom - RUNTIME_VERSION - pom - import - - - - - - - - io.openliberty.features - jaxrs-2.1 - esa - provided - - - io.openliberty.features - jsonp-1.1 - esa - provided - - - io.openliberty.features - cdi-2.0 - esa - provided - - - io.openliberty.features - mpConfig-1.3 - esa - provided - - - io.openliberty.features - mpRestClient-1.2 - esa - 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 - - - com.sun.xml.bind - jaxb-core - 2.3.0.1 - - - com.sun.xml.bind - jaxb-impl - 2.3.2 - - - javax.activation - activation - 1.1.1 - - - - org.slf4j - slf4j-api - 1.7.25 - - - ch.qos.logback - logback-classic - 1.2.3 - runtime - - - - - - - - - - org.apache.maven.plugins - maven-war-plugin - 3.4.0 - - false - pom.xml - - - - - false - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.1.2 - - - 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.1.2 - - - 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/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloLogger.java b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloLogger.java deleted file mode 100755 index d717d81a5..000000000 --- a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloLogger.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * (c) Copyright IBM Corporation 2021. - * - * 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 javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; - -import static javax.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/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloServlet.java b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloServlet.java deleted file mode 100644 index 01cc44f09..000000000 --- a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloServlet.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * (c) Copyright IBM Corporation 2021. - * - * 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 javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.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/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloWorld.java b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloWorld.java deleted file mode 100755 index 937240b5c..000000000 --- a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/java/com/demo/HelloWorld.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * (c) Copyright IBM Corporation 2021. - * - * 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; - -public class HelloWorld { - - public String helloWorld() { - return "helloWorld"; - } -} diff --git a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/liberty/config/server.xml b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/liberty/config/server.xml deleted file mode 100755 index fdad620d8..000000000 --- a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/liberty/config/server.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - jaxrs-2.1 - - - - diff --git a/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/resources/placeHolder.txt b/liberty-maven-plugin/src/it/dev-it/resources/exploded-war-project/src/main/resources/placeHolder.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/ExplodedLooseWarAppTest.java b/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/ExplodedLooseWarAppTest.java deleted file mode 100644 index dbe139af8..000000000 --- a/liberty-maven-plugin/src/it/dev-it/src/test/java/net/wasdev/wlp/test/dev/it/ExplodedLooseWarAppTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/******************************************************************************* - * (c) Copyright IBM Corporation 2021. - * - * 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 net.wasdev.wlp.test.dev.it; - -import static org.junit.Assert.*; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.nio.file.Files; -import java.util.Scanner; - -import org.apache.commons.io.FileUtils; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -public class ExplodedLooseWarAppTest extends BaseDevTest { - private final String projectArtifact = "exploded-war-proj-1.0-SNAPSHOT"; - private final String appsDir = "target/liberty/wlp/usr/servers/defaultServer/dropins/"; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - setUpBeforeClass(null, "../resources/exploded-war-project"); - } - - @AfterClass - public static void cleanUpAfterClass() throws Exception { - BaseDevTest.cleanUpAfterClass(); - } - - @Ignore // TODO enable this test - @Test - public void configureWebXmlFiltering() throws Exception { - int appDeployedCount = countOccurrences("Running liberty:deploy", logFile); - // Add deployment descriptor filtering config to pom war plugin - replaceString("false", - "true", pom); - - // Verify exploded goal running and redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 4000, logFile, ++appDeployedCount)); - assertTrue(getLogTail(), verifyLogMessageExists("Running maven-war-plugin:exploded", 2000)); - - // Verify loose app xml is correct - verifyExplodedLooseApp(); - - // Remove filtering config - replaceString("true", - "false", pom); - - // Verify redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 2000)); - - // Verify loose app xml is back to how it was - verifyNonExplodedLooseApp(); - } - - @Ignore // TODO enable this test - @Test - public void configureFilteredResource() throws Exception { - // Add filtering config to pom war plugin (directory) - replaceString("", pom); - - replaceString("Filtered directory end -->", - "", pom); - - // Verify exploded goal running and redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 2000)); - assertTrue(getLogTail(), verifyLogMessageExists("Running maven-war-plugin:exploded", 2000)); - - // Verify loose app xml is correct - verifyExplodedLooseApp(); - - // Remove filtering config - replaceString("", - "", - "Filtered directory end -->", pom); - - // Verify redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 2000)); - - // Verify loose app xml is back to how it was - verifyNonExplodedLooseApp(); - } - - @Ignore // TODO enable this test - @Test - public void configureWarOverlay() throws Exception { - // Add filtering config to pom war plugin (directory) - replaceString("", pom); - - replaceString("Overlay configuration end -->", - "", pom); - - // Verify exploded goal running and redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 2000)); - assertTrue(getLogTail(), verifyLogMessageExists("Running maven-war-plugin:exploded", 2000)); - - // Verify loose app xml is correct - verifyExplodedLooseApp(); - - // Remove filtering config - replaceString("", - "", - "Overlay configuration end -->", pom); - - // Verify redeploy - assertTrue(getLogTail(), verifyLogMessageExists("Running liberty:deploy", 2000)); - - // Verify loose app xml is back to how it was - verifyNonExplodedLooseApp(); - } - - private void verifyExplodedLooseApp() throws Exception { - String looseAppXml = tempProj.getAbsolutePath() + "/" + appsDir + projectArtifact + ".war.xml"; - - // Verify the target/ entry - String explodedWar = basicDevProj.getAbsolutePath() + "/target/" + projectArtifact; - assertTrue(getLogTail(), verifyFileExists(new File(looseAppXml), 3000)); - assertTrue(getLogTail(), verifyLogMessageExists("", 3000, new File(looseAppXml))); - } - - private void verifyNonExplodedLooseApp() throws Exception { - String looseAppXml = tempProj.getAbsolutePath() + "/" + appsDir + projectArtifact + ".war.xml"; - - // Verify the src/main/webapp entry - String srcMain = basicDevProj.getAbsolutePath() + "/src/main/webapp"; - assertTrue(getLogTail(), verifyLogMessageExists("", 3000, new File(looseAppXml))); - - // Verify the target/classes entry - String targetClasses = basicDevProj.getAbsolutePath() + "/target/classes"; - assertTrue(getLogTail(), verifyLogMessageExists("", 3000, new File(looseAppXml))); - } -}