work in progress
This commit is contained in:
parent
4e286266c0
commit
a50e8825a3
|
@ -358,7 +358,7 @@ public class JettyWebAppContext extends WebAppContext
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//inject configurations with config from maven plugin
|
//inject configurations with config from maven plugin
|
||||||
for (Configuration c:getConfigurations())
|
for (Configuration c:getWebAppConfigurations())
|
||||||
{
|
{
|
||||||
if (c instanceof EnvConfiguration && getJettyEnvXml() != null)
|
if (c instanceof EnvConfiguration && getJettyEnvXml() != null)
|
||||||
((EnvConfiguration)c).setJettyEnvXml(Resource.toURL(new File(getJettyEnvXml())));
|
((EnvConfiguration)c).setJettyEnvXml(Resource.toURL(new File(getJettyEnvXml())));
|
||||||
|
|
|
@ -128,7 +128,7 @@ public class QuickStartConfiguration extends AbstractConfiguration implements Co
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
_quickStart=true;
|
_quickStart=true;
|
||||||
context.setConfigurations(Arrays.stream(context.getConfigurations())
|
context.setConfigurations(context.getWebAppConfigurations().stream()
|
||||||
.filter(c->!__replacedConfigurations.contains(c.replaces())&&!__replacedConfigurations.contains(c.getClass()))
|
.filter(c->!__replacedConfigurations.contains(c.replaces())&&!__replacedConfigurations.contains(c.getClass()))
|
||||||
.collect(Collectors.toList()).toArray(new Configuration[]{}));
|
.collect(Collectors.toList()).toArray(new Configuration[]{}));
|
||||||
context.getMetaData().setWebXml(quickStartWebXml);
|
context.getMetaData().setWebXml(quickStartWebXml);
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class WebAppContextTest
|
||||||
|
|
||||||
//test if no classnames set, its the defaults
|
//test if no classnames set, its the defaults
|
||||||
WebAppContext wac = new WebAppContext();
|
WebAppContext wac = new WebAppContext();
|
||||||
assertThat(Arrays.asList(wac.getConfigurations()).stream().map(c->{return c.getClass().getName();}).collect(Collectors.toList()),Matchers.containsInAnyOrder(known_and_enabled));
|
assertThat(wac.getWebAppConfigurations().stream().map(c->{return c.getClass().getName();}).collect(Collectors.toList()),Matchers.containsInAnyOrder(known_and_enabled));
|
||||||
String[] classNames = wac.getConfigurationClasses();
|
String[] classNames = wac.getConfigurationClasses();
|
||||||
assertNotNull(classNames);
|
assertNotNull(classNames);
|
||||||
|
|
||||||
|
@ -79,8 +79,7 @@ public class WebAppContextTest
|
||||||
{
|
{
|
||||||
WebAppContext wac = new WebAppContext();
|
WebAppContext wac = new WebAppContext();
|
||||||
wac.setServer(new Server());
|
wac.setServer(new Server());
|
||||||
System.err.println(Arrays.asList(wac.getConfigurations()));
|
Assert.assertThat(wac.getWebAppConfigurations().stream().map(c->c.getClass().getName()).collect(Collectors.toList()),
|
||||||
Assert.assertThat(Arrays.asList(wac.getConfigurations()).stream().map(c->c.getClass().getName()).collect(Collectors.toList()),
|
|
||||||
Matchers.contains(
|
Matchers.contains(
|
||||||
"org.eclipse.jetty.webapp.JmxConfiguration",
|
"org.eclipse.jetty.webapp.JmxConfiguration",
|
||||||
"org.eclipse.jetty.webapp.WebInfConfiguration",
|
"org.eclipse.jetty.webapp.WebInfConfiguration",
|
||||||
|
@ -97,14 +96,14 @@ public class WebAppContextTest
|
||||||
Configuration[] configs = {new WebInfConfiguration()};
|
Configuration[] configs = {new WebInfConfiguration()};
|
||||||
WebAppContext wac = new WebAppContext();
|
WebAppContext wac = new WebAppContext();
|
||||||
wac.setConfigurations(configs);
|
wac.setConfigurations(configs);
|
||||||
assertTrue(Arrays.equals(configs, wac.getConfigurations()));
|
Assert.assertThat(wac.getWebAppConfigurations(),Matchers.contains(configs));
|
||||||
|
|
||||||
//test that explicit config instances override any from server
|
//test that explicit config instances override any from server
|
||||||
String[] classNames = {"x.y.z"};
|
String[] classNames = {"x.y.z"};
|
||||||
Server server = new Server();
|
Server server = new Server();
|
||||||
server.setAttribute(Configuration.ATTR, classNames);
|
server.setAttribute(Configuration.ATTR, classNames);
|
||||||
wac.setServer(server);
|
wac.setServer(server);
|
||||||
assertTrue(Arrays.equals(configs,wac.getConfigurations()));
|
Assert.assertThat(wac.getWebAppConfigurations(),Matchers.contains(configs));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue