* Issue #5394 Fix injection for quickstart Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
parent
9c0f61d31b
commit
6ddbec3c62
|
@ -26,6 +26,7 @@ import org.eclipse.jetty.plus.webapp.PlusConfiguration;
|
|||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.util.resource.JarResource;
|
||||
import org.eclipse.jetty.util.resource.Resource;
|
||||
import org.eclipse.jetty.webapp.MetaInfConfiguration;
|
||||
import org.eclipse.jetty.webapp.WebAppContext;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -109,7 +110,7 @@ public class PreconfigureQuickStartWar
|
|||
new AnnotationConfiguration());
|
||||
webapp.setAttribute(QuickStartConfiguration.MODE, QuickStartConfiguration.Mode.GENERATE);
|
||||
webapp.setAttribute(QuickStartConfiguration.ORIGIN_ATTRIBUTE, "");
|
||||
|
||||
webapp.setAttribute(MetaInfConfiguration.CONTAINER_JAR_PATTERN, ".*/jetty-servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\\.jar$");
|
||||
if (xml != null)
|
||||
{
|
||||
if (xml.isDirectory() || !xml.toString().toLowerCase(Locale.ENGLISH).endsWith(".xml"))
|
||||
|
|
|
@ -157,7 +157,7 @@ public class QuickStartGeneratorConfiguration extends AbstractConfiguration
|
|||
webappAttr.put("xmlns", "http://xmlns.jcp.org/xml/ns/javaee");
|
||||
webappAttr.put("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
|
||||
webappAttr.put("xsi:schemaLocation", "http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_" + (major + "_" + minor) + ".xsd");
|
||||
webappAttr.put("metadata-complete", "true");
|
||||
webappAttr.put("metadata-complete", Boolean.toString(context.getMetaData().isMetaDataComplete()));
|
||||
webappAttr.put("version", major + "." + minor);
|
||||
|
||||
XmlAppendable out = new XmlAppendable(stream, "UTF-8");
|
||||
|
|
|
@ -139,14 +139,16 @@ public class QuickStartTest
|
|||
}
|
||||
|
||||
server.setHandler(webapp);
|
||||
|
||||
server.start();
|
||||
|
||||
URL url = new URL("http://127.0.0.1:" + server.getBean(NetworkConnector.class).getLocalPort() + "/");
|
||||
URL url = new URL("http://127.0.0.1:" + server.getBean(NetworkConnector.class).getLocalPort() + "/test/");
|
||||
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
|
||||
assertEquals(200, connection.getResponseCode());
|
||||
assertThat(IO.toString((InputStream)connection.getContent()), Matchers.containsString("Test Specification WebApp"));
|
||||
connection.setRequestMethod("POST");
|
||||
|
||||
assertEquals(200, connection.getResponseCode());
|
||||
String content = IO.toString((InputStream)connection.getContent());
|
||||
assertThat(content, Matchers.containsString("Results"));
|
||||
assertThat(content, Matchers.not(Matchers.containsString("FAIL")));
|
||||
server.stop();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue