From 9f296e16664582dc790e0637f018a1ba6d39349c Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 18 Sep 2019 18:29:14 +1000 Subject: [PATCH] Issue #1743 WIP tests Signed-off-by: Jan Bartel --- .../jetty-run-war-mojo-it/invoker.properties | 2 -- .../invoker.properties | 2 ++ .../jetty-simple-base/pom.xml | 2 +- .../its/jetty_run_mojo_it/HelloServlet.java | 0 .../its/jetty_run_mojo_it/PingServlet.java | 0 .../main/resources/META-INF/web-fragment.xml | 0 .../jetty-simple-webapp/pom.xml | 20 ++++++++++--------- .../jetty-simple-webapp/src/config/jetty.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../pom.xml | 4 ++-- .../postbuild.groovy | 2 +- .../jetty/maven/plugin/JettyDistroForker.java | 4 +++- 12 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 jetty-maven-plugin/src/it/jetty-run-war-mojo-it/invoker.properties create mode 100644 jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/invoker.properties rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-base/pom.xml (94%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/HelloServlet.java (100%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/PingServlet.java (100%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml (100%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-webapp/pom.xml (85%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-webapp/src/config/jetty.xml (100%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/jetty-simple-webapp/src/main/webapp/WEB-INF/web.xml (100%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/pom.xml (88%) rename jetty-maven-plugin/src/it/{jetty-run-war-mojo-it => jetty-start-war-distro-mojo-it}/postbuild.groovy (92%) diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/invoker.properties b/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/invoker.properties deleted file mode 100644 index b8a016f5093..00000000000 --- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals = verify -V -#test-compile failsafe:integration-test \ No newline at end of file diff --git a/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/invoker.properties b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/invoker.properties new file mode 100644 index 00000000000..d2583001859 --- /dev/null +++ b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/invoker.properties @@ -0,0 +1,2 @@ +invoker.goals = verify -V -X +#test-compile failsafe:integration-test diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/pom.xml similarity index 94% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/pom.xml index a241cfa2f58..c8a7dd2e001 100644 --- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/pom.xml +++ b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/pom.xml @@ -3,7 +3,7 @@ 4.0.0 - org.eclipse.jetty.its.jetty-run-war-mojo-it + org.eclipse.jetty.its.jetty-start-war-distro-mojo-it jetty-simple-project 0.0.1-SNAPSHOT diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/HelloServlet.java b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/HelloServlet.java similarity index 100% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/HelloServlet.java rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/HelloServlet.java diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/PingServlet.java b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/PingServlet.java similarity index 100% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/PingServlet.java rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/java/org/eclipse/jetty/its/jetty_run_mojo_it/PingServlet.java diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml similarity index 100% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-base/src/main/resources/META-INF/web-fragment.xml diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/pom.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/pom.xml similarity index 85% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/pom.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/pom.xml index aac9ad698ec..b1131db4df0 100644 --- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/pom.xml +++ b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/pom.xml @@ -3,7 +3,7 @@ 4.0.0 - org.eclipse.jetty.its.jetty-run-war-mojo-it + org.eclipse.jetty.its.jetty-start-war-distro-mojo-it jetty-simple-project 0.0.1-SNAPSHOT @@ -14,12 +14,12 @@ Jetty :: Simple :: Webapp - ${project.build.directory}/jetty-run-war-port.txt - EMBED + ${project.build.directory}/jetty-start-war-distro-port.txt + DISTRO - org.eclipse.jetty.its.jetty-run-war-mojo-it + org.eclipse.jetty.its.jetty-start-war-distro-mojo-it jetty-simple-base @@ -100,15 +100,17 @@ start-jetty - test-compile + pre-integration-test - newrun-war + newstart-war - true - + + ${project.build.directory}/${project.artifactId}-${project.version} + + ${jetty.port.file} - + ${basedir}/src/config/jetty.xml diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/src/config/jetty.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/config/jetty.xml similarity index 100% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/src/config/jetty.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/config/jetty.xml diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/src/main/webapp/WEB-INF/web.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/jetty-simple-webapp/src/main/webapp/WEB-INF/web.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/main/webapp/WEB-INF/web.xml diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/pom.xml b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/pom.xml similarity index 88% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/pom.xml rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/pom.xml index 3ae620b58ad..04d866e7d3d 100644 --- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/pom.xml +++ b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/pom.xml @@ -8,7 +8,7 @@ 0.0.1-SNAPSHOT - org.eclipse.jetty.its.jetty-run-war-mojo-it + org.eclipse.jetty.its.jetty-start-war-distro-mojo-it jetty-simple-project 0.0.1-SNAPSHOT pom @@ -30,7 +30,7 @@ - org.eclipse.jetty.its.jetty-run-war-mojo-it + org.eclipse.jetty.its.jetty-start-war-distro-mojo-it jetty-simple-base ${project.version} diff --git a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/postbuild.groovy b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/postbuild.groovy similarity index 92% rename from jetty-maven-plugin/src/it/jetty-run-war-mojo-it/postbuild.groovy rename to jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/postbuild.groovy index d0cf33391a6..1d5fd2314aa 100644 --- a/jetty-maven-plugin/src/it/jetty-run-war-mojo-it/postbuild.groovy +++ b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/postbuild.groovy @@ -17,7 +17,7 @@ * under the License. */ File buildLog = new File( basedir, 'build.log' ) -assert buildLog.text.contains( 'Started Server' ) +assert buildLog.text.contains( 'Distro process starting' ) assert buildLog.text.contains( 'Running org.eclipse.jetty.maven.plugin.it.TestGetContent') assert buildLog.text.contains( 'pingServlet ok') assert buildLog.text.contains( 'helloServlet') diff --git a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyDistroForker.java b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyDistroForker.java index c0cdac8c302..dcdbad6bac2 100644 --- a/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyDistroForker.java +++ b/jetty-maven-plugin/src/main/java/org/eclipse/jetty/maven/plugin/JettyDistroForker.java @@ -228,7 +228,9 @@ public class JettyDistroForker extends AbstractForker ProcessBuilder builder = new ProcessBuilder(cmd); builder.directory(workDir); - + + PluginLog.getLog().info("Distro process starting"); + //set up extra environment vars if there are any if (!env.isEmpty()) builder.environment().putAll(env);