From 4ffafeaecb54c31766f9c7a35dd66baae50a5e44 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Mon, 18 Nov 2024 11:19:27 +0530 Subject: [PATCH] adding more tests based on review comments Signed-off-by: Arun Venmany --- .../invoker.properties | 1 + .../pom.xml | 128 ++++++++++++++++++ .../src/test/resources/server.xml | 7 + .../application/InstallSpringBoot30AppIT.java | 3 + .../pom.xml | 14 ++ .../checkErrorVersionlessFeature.bsh | 3 + 6 files changed, 156 insertions(+) create mode 100644 liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/invoker.properties create mode 100644 liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/pom.xml create mode 100644 liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/src/test/resources/server.xml diff --git a/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/invoker.properties b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/invoker.properties new file mode 100644 index 000000000..62359c56d --- /dev/null +++ b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/invoker.properties @@ -0,0 +1 @@ +invoker.buildResult = failure \ No newline at end of file diff --git a/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/pom.xml b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/pom.xml new file mode 100644 index 000000000..79ed0f87a --- /dev/null +++ b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/pom.xml @@ -0,0 +1,128 @@ + + + + 4.0.0 + + + io.openliberty.tools.it + tests + 1.0-SNAPSHOT + + + springboot-3-deploy-multiple-springboot-application-nodes-fail-it + jar + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + + junit + junit + 4.13.1 + test + + + + commons-io + commons-io + 2.14.0 + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + exec + + + + io.openliberty.tools + liberty-maven-plugin + @pom.version@ + + + ${runtimeGroupId} + ${runtimeKernelId} + ${runtimeVersion} + zip + + test + src/test/resources/server.xml + + + + install-liberty-server + compile + + install-server + + + + create-server + pre-integration-test + + create + + + + install-feature + pre-integration-test + + install-feature + + + + true + + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 3.1.2 + + ${project.build.directory} + -enableassertions + + + + integration-test + + integration-test + + + + verify + verify + + verify + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.2 + + true + + + + + + diff --git a/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/src/test/resources/server.xml b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/src/test/resources/server.xml new file mode 100644 index 000000000..5976a6b36 --- /dev/null +++ b/liberty-maven-plugin/src/it/springboot-3-deploy-multiple-springboot-application-nodes-fail-it/src/test/resources/server.xml @@ -0,0 +1,7 @@ + + + appSecurityClient-1.0 + jaxws + badname + + diff --git a/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-apps-it/src/test/java/application/InstallSpringBoot30AppIT.java b/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-apps-it/src/test/java/application/InstallSpringBoot30AppIT.java index 2525e2121..a8717c8e5 100644 --- a/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-apps-it/src/test/java/application/InstallSpringBoot30AppIT.java +++ b/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-apps-it/src/test/java/application/InstallSpringBoot30AppIT.java @@ -27,6 +27,9 @@ public void testThinApplicationExistsInAppsDirectory() throws Exception { File f = new File("target/liberty/wlp/usr/servers/test/apps/thin-springboot-3-appsdirectory-apps-it-1.0.0.Final-exec.jar"); assertTrue(f.getCanonicalFile() + " doesn't exist. Plugin failed to place the file at right destination.", f.exists()); + File f2 = new File("target/liberty/wlp/usr/servers/test/configDropins/defaults"); + assertTrue(f2.getCanonicalFile() + " folder doesn't exist. Plugin failed to create the config dropins folder ", f2.exists()); + assertTrue(f2.getCanonicalFile() + " folder doesn't contain any files. Plugin failed to place config xml at right destination.", f2.list().length == 1); } @Test diff --git a/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-server-xml-springboot-node-it/pom.xml b/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-server-xml-springboot-node-it/pom.xml index ae8ae17f0..382f864b0 100644 --- a/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-server-xml-springboot-node-it/pom.xml +++ b/liberty-maven-plugin/src/it/springboot-3-tests/springboot-3-appsdirectory-server-xml-springboot-node-it/pom.xml @@ -134,6 +134,20 @@ 3.1.2 alphabetical + true + 1 + true + 2400 + -enableassertions + ${project.build.directory} + + **/*IT.java + + + @pom.version@ + ${runtimeVersion} + + false diff --git a/liberty-maven-plugin/src/test/resources/checkErrorVersionlessFeature.bsh b/liberty-maven-plugin/src/test/resources/checkErrorVersionlessFeature.bsh index b4f56ecd0..d2ab7ce69 100644 --- a/liberty-maven-plugin/src/test/resources/checkErrorVersionlessFeature.bsh +++ b/liberty-maven-plugin/src/test/resources/checkErrorVersionlessFeature.bsh @@ -9,6 +9,9 @@ switch (testname) { case "kernel-install-versionless-feature-fail-no-platform-it": expectedMessage = "CWWKF1516E: The platform could not be determined. The following versionless features cannot be installed: [servlet]"; break; + case "springboot-3-deploy-multiple-springboot-application-nodes-fail-it": + expectedMessage = "Found multiple springBootApplication elements specified in the server configuration. Only one springBootApplication can be configured per Liberty server."; + break; default: return false; }