From 4ba530b5ad64bcf239195b3f4fcf597901ba8c38 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 17 Jun 2014 10:41:32 -0700 Subject: [PATCH] 437395 - Start / Properties in template sections should be default applied for enabled modules + Adding test cases for jsp-impl usecase that triggered this bug. --- .../java/org/eclipse/jetty/start/Modules.java | 2 +- .../org/eclipse/jetty/start/ModulesTest.java | 1 - .../org/eclipse/jetty/start/TestUseCases.java | 30 +++++++++++++++---- .../resources/usecases/assert-jsp-apache.txt | 26 ++++++++++++++++ .../usecases/assert-jsp-glassfish.txt | 28 +++++++++++++++++ .../usecases/base.with.jsp.apache/start.ini | 7 +++++ .../usecases/base.with.jsp.bad/start.ini | 7 +++++ .../usecases/base.with.jsp.default/start.ini | 6 ++++ .../base.with.jsp.glassfish/start.ini | 7 +++++ ...ervlet.jsp.javax.servlet.jsp-api-TEST.jar} | 0 .../org.eclipse.jetty.apache-jsp-TEST.jar} | 0 ...jetty.orbit.org.eclipse.jdt.core-TEST.jar} | 0 .../org.mortbay.jasper.apache-el-TEST.jar} | 0 .../org.mortbay.jasper.apache-jsp-TEST.jar} | 0 ...he.taglibs.taglibs-standard-impl-TEST.jar} | 0 ...che.taglibs.taglibs-standard-spec-TEST.jar | 0 .../usecases/home/lib/jsp/javax.el-TEST.jar | 0 .../home/lib/jsp/javax.servlet.jsp-TEST.jar | 0 .../lib/jsp/javax.servlet.jsp-api-TEST.jar | 0 .../lib/jsp/javax.servlet.jsp.jstl-TEST.jar | 0 .../home/lib/jsp/jetty-jsp-jdt-TEST.jar | 0 .../lib/jsp/org.eclipse.jdt.core-TEST.jar | 0 ...etty.orbit.javax.servlet.jsp.jstl-TEST.jar | 0 23 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 jetty-start/src/test/resources/usecases/assert-jsp-apache.txt create mode 100644 jetty-start/src/test/resources/usecases/assert-jsp-glassfish.txt create mode 100644 jetty-start/src/test/resources/usecases/base.with.jsp.apache/start.ini create mode 100644 jetty-start/src/test/resources/usecases/base.with.jsp.bad/start.ini create mode 100644 jetty-start/src/test/resources/usecases/base.with.jsp.default/start.ini create mode 100644 jetty-start/src/test/resources/usecases/base.with.jsp.glassfish/start.ini rename jetty-start/src/test/resources/usecases/home/lib/{jsp/javax.el-3.0.0.jar => apache-jsp/javax.servlet.jsp.javax.servlet.jsp-api-TEST.jar} (100%) rename jetty-start/src/test/resources/usecases/home/lib/{jsp/javax.servlet.jsp-2.3.2.jar => apache-jsp/org.eclipse.jetty.apache-jsp-TEST.jar} (100%) rename jetty-start/src/test/resources/usecases/home/lib/{jsp/javax.servlet.jsp-api-2.3.1.jar => apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-TEST.jar} (100%) rename jetty-start/src/test/resources/usecases/home/lib/{jsp/javax.servlet.jsp.jstl-1.2.0.jar => apache-jsp/org.mortbay.jasper.apache-el-TEST.jar} (100%) rename jetty-start/src/test/resources/usecases/home/lib/{jsp/org.apache.taglibs.standard.glassfish-1.2.0.jar => apache-jsp/org.mortbay.jasper.apache-jsp-TEST.jar} (100%) rename jetty-start/src/test/resources/usecases/home/lib/{jsp/org.eclipse.jdt.core-3.8.2.jar => apache-jstl/org.apache.taglibs.taglibs-standard-impl-TEST.jar} (100%) create mode 100644 jetty-start/src/test/resources/usecases/home/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/javax.el-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-api-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp.jstl-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/jetty-jsp-jdt-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jdt.core-TEST.jar create mode 100644 jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jetty.orbit.javax.servlet.jsp.jstl-TEST.jar diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index d6d5de592a5..40406894c58 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -535,7 +535,7 @@ public class Modules implements Iterable StartLog.warn("** Unable to continue, required dependency missing. [%s]",missing); StartLog.warn("** As configured, Jetty is unable to start due to a missing enabled module dependency."); StartLog.warn("** This may be due to a transitive dependency akin to spdy on npn, which resolves based on the JDK in use."); - return Collections.emptyList(); + throw new UsageException(UsageException.ERR_BAD_ARG, "Missing referenced dependency: " + missing); } } } diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java index 37532672640..b7c0468442c 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ModulesTest.java @@ -19,7 +19,6 @@ package org.eclipse.jetty.start; import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.is; import java.io.File; import java.io.IOException; diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java index aef3da70691..3cfa5445ac6 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/TestUseCases.java @@ -73,6 +73,30 @@ public class TestUseCases assertUseCase("home","base.with.include.jetty.dirs","assert-include-jetty-dir-logging.txt"); } + @Test + public void testWithJspDefault() throws Exception + { + assertUseCase("home","base.with.jsp.default","assert-jsp-apache.txt"); + } + + @Test + public void testWithJspApache() throws Exception + { + assertUseCase("home","base.with.jsp.apache","assert-jsp-apache.txt"); + } + + @Test + public void testWithJspGlassfish() throws Exception + { + assertUseCase("home","base.with.jsp.glassfish","assert-jsp-glassfish.txt"); + } + + @Test + public void testWithJspGlassfishCmdLine() throws Exception + { + assertUseCase("home","base.with.jsp.default","assert-jsp-glassfish.txt","jsp-impl=glassfish"); + } + @Test public void testWithMissingNpnVersion() throws Exception { @@ -85,12 +109,6 @@ public class TestUseCases assertUseCase("home","base.enable.spdy","assert-enable-spdy.txt","java.version=1.7.0_21"); } - @Test - public void testWithSpdyBadNpnVersion() throws Exception - { - assertUseCase("home","base.enable.spdy.bad.npn.version","assert-enable-spdy-bad-npn-version.txt","java.version=1.7.0_01"); - } - @Test public void testWithDatabase() throws Exception { diff --git a/jetty-start/src/test/resources/usecases/assert-jsp-apache.txt b/jetty-start/src/test/resources/usecases/assert-jsp-apache.txt new file mode 100644 index 00000000000..fe3d51ce8aa --- /dev/null +++ b/jetty-start/src/test/resources/usecases/assert-jsp-apache.txt @@ -0,0 +1,26 @@ +# The XMLs we expect (order is important) +XML|${jetty.home}/etc/jetty.xml +XML|${jetty.home}/etc/jetty-http.xml + +# The LIBs we expect (order is irrelevant) +LIB|${jetty.home}/lib/jetty-continuation-TEST.jar +LIB|${jetty.home}/lib/jetty-http-TEST.jar +LIB|${jetty.home}/lib/jetty-io-TEST.jar +LIB|${jetty.home}/lib/jetty-schemas-3.1.jar +LIB|${jetty.home}/lib/jetty-server-TEST.jar +LIB|${jetty.home}/lib/jetty-servlet-TEST.jar +LIB|${jetty.home}/lib/jetty-util-TEST.jar +LIB|${jetty.home}/lib/jetty-xml-TEST.jar +LIB|${jetty.home}/lib/servlet-api-3.1.jar +LIB|${jetty.home}/lib/apache-jsp/javax.servlet.jsp.javax.servlet.jsp-api-TEST.jar +LIB|${jetty.home}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-TEST.jar +LIB|${jetty.home}/lib/apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-TEST.jar +LIB|${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-el-TEST.jar +LIB|${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-TEST.jar + +# The Properties we expect (order is irrelevant) +PROP|jetty.port=9090 +PROP|jsp-impl=apache + +# Files / Directories to create +# FILE|lib/ diff --git a/jetty-start/src/test/resources/usecases/assert-jsp-glassfish.txt b/jetty-start/src/test/resources/usecases/assert-jsp-glassfish.txt new file mode 100644 index 00000000000..9c17c56fb27 --- /dev/null +++ b/jetty-start/src/test/resources/usecases/assert-jsp-glassfish.txt @@ -0,0 +1,28 @@ +# The XMLs we expect (order is important) +XML|${jetty.home}/etc/jetty.xml +XML|${jetty.home}/etc/jetty-http.xml + +# The LIBs we expect (order is irrelevant) +LIB|${jetty.home}/lib/jetty-continuation-TEST.jar +LIB|${jetty.home}/lib/jetty-http-TEST.jar +LIB|${jetty.home}/lib/jetty-io-TEST.jar +LIB|${jetty.home}/lib/jetty-schemas-3.1.jar +LIB|${jetty.home}/lib/jetty-server-TEST.jar +LIB|${jetty.home}/lib/jetty-servlet-TEST.jar +LIB|${jetty.home}/lib/jetty-util-TEST.jar +LIB|${jetty.home}/lib/jetty-xml-TEST.jar +LIB|${jetty.home}/lib/servlet-api-3.1.jar +LIB|${jetty.home}/lib/jsp/javax.el-TEST.jar +LIB|${jetty.home}/lib/jsp/javax.servlet.jsp.jstl-TEST.jar +LIB|${jetty.home}/lib/jsp/javax.servlet.jsp-api-TEST.jar +LIB|${jetty.home}/lib/jsp/javax.servlet.jsp-TEST.jar +LIB|${jetty.home}/lib/jsp/jetty-jsp-jdt-TEST.jar +LIB|${jetty.home}/lib/jsp/org.eclipse.jdt.core-TEST.jar +LIB|${jetty.home}/lib/jsp/org.eclipse.jetty.orbit.javax.servlet.jsp.jstl-TEST.jar + +# The Properties we expect (order is irrelevant) +PROP|jetty.port=9090 +PROP|jsp-impl=glassfish + +# Files / Directories to create +# FILE|lib/ diff --git a/jetty-start/src/test/resources/usecases/base.with.jsp.apache/start.ini b/jetty-start/src/test/resources/usecases/base.with.jsp.apache/start.ini new file mode 100644 index 00000000000..fcdea021bd8 --- /dev/null +++ b/jetty-start/src/test/resources/usecases/base.with.jsp.apache/start.ini @@ -0,0 +1,7 @@ + +--module=server +--module=http +--module=jsp +jsp-impl=apache + +jetty.port=9090 diff --git a/jetty-start/src/test/resources/usecases/base.with.jsp.bad/start.ini b/jetty-start/src/test/resources/usecases/base.with.jsp.bad/start.ini new file mode 100644 index 00000000000..96e495acaff --- /dev/null +++ b/jetty-start/src/test/resources/usecases/base.with.jsp.bad/start.ini @@ -0,0 +1,7 @@ + +--module=server +--module=http +--module=jsp +jsp-impl=bogus + +jetty.port=9090 diff --git a/jetty-start/src/test/resources/usecases/base.with.jsp.default/start.ini b/jetty-start/src/test/resources/usecases/base.with.jsp.default/start.ini new file mode 100644 index 00000000000..bf58fa82d77 --- /dev/null +++ b/jetty-start/src/test/resources/usecases/base.with.jsp.default/start.ini @@ -0,0 +1,6 @@ + +--module=server +--module=http +--module=jsp + +jetty.port=9090 diff --git a/jetty-start/src/test/resources/usecases/base.with.jsp.glassfish/start.ini b/jetty-start/src/test/resources/usecases/base.with.jsp.glassfish/start.ini new file mode 100644 index 00000000000..7107adec968 --- /dev/null +++ b/jetty-start/src/test/resources/usecases/base.with.jsp.glassfish/start.ini @@ -0,0 +1,7 @@ + +--module=server +--module=http +--module=jsp +jsp-impl=glassfish + +jetty.port=9090 diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.el-3.0.0.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jsp/javax.servlet.jsp.javax.servlet.jsp-api-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/javax.el-3.0.0.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jsp/javax.servlet.jsp.javax.servlet.jsp-api-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-2.3.2.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.eclipse.jetty.apache-jsp-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-2.3.2.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.eclipse.jetty.apache-jsp-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-api-2.3.1.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-api-2.3.1.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp.jstl-1.2.0.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.mortbay.jasper.apache-el-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp.jstl-1.2.0.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.mortbay.jasper.apache-el-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.mortbay.jasper.apache-jsp-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jsp/org.mortbay.jasper.apache-jsp-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jdt.core-3.8.2.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-TEST.jar similarity index 100% rename from jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jdt.core-3.8.2.jar rename to jetty-start/src/test/resources/usecases/home/lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-TEST.jar diff --git a/jetty-start/src/test/resources/usecases/home/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.el-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.el-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-api-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp-api-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp.jstl-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/javax.servlet.jsp.jstl-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/jetty-jsp-jdt-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/jetty-jsp-jdt-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jdt.core-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jdt.core-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jetty.orbit.javax.servlet.jsp.jstl-TEST.jar b/jetty-start/src/test/resources/usecases/home/lib/jsp/org.eclipse.jetty.orbit.javax.servlet.jsp.jstl-TEST.jar new file mode 100644 index 00000000000..e69de29bb2d