Merge branch 'jetty-9.3.x'

This commit is contained in:
Joakim Erdfelt 2015-12-02 12:20:06 -07:00
commit 97722aeea8
3 changed files with 5 additions and 2 deletions

View File

@ -387,7 +387,7 @@ public class ServletContextHandlerTest
String expected = String.format("Attribute[%s] = %s", DecoratedObjectFactory.ATTR, DecoratedObjectFactory.class.getName());
assertThat("Has context attribute", response, containsString(expected));
assertThat("Decorators size", response, containsString("Decorators.size = [1]"));
assertThat("Decorators size", response, containsString("Decorators.size = [2]"));
expected = String.format("decorator[] = %s", DummyLegacyDecorator.class.getName());
assertThat("Specific Legacy Decorator", response, containsString(expected));
@ -414,7 +414,7 @@ public class ServletContextHandlerTest
String expected = String.format("Attribute[%s] = %s", DecoratedObjectFactory.ATTR, DecoratedObjectFactory.class.getName());
assertThat("Has context attribute", response, containsString(expected));
assertThat("Decorators size", response, containsString("Decorators.size = [1]"));
assertThat("Decorators size", response, containsString("Decorators.size = [2]"));
expected = String.format("decorator[] = %s", DummyUtilDecorator.class.getName());
assertThat("Specific Legacy Decorator", response, containsString(expected));

View File

@ -109,6 +109,7 @@ public class DecoratorsLegacyTest
}
}
@SuppressWarnings("deprecation")
private static class DummyLegacyDecorator implements org.eclipse.jetty.servlet.ServletContextHandler.Decorator
{
@Override
@ -136,6 +137,7 @@ public class DecoratorsLegacyTest
@Override
protected void configureServletContextHandler(ServletContextHandler context)
{
context.getObjectFactory().clear();
// Add decorator in the legacy way
context.addDecorator(new DummyLegacyDecorator());
}

View File

@ -136,6 +136,7 @@ public class DecoratorsTest
protected void configureServletContextHandler(ServletContextHandler context)
{
// Add decorator in the new util way
context.getObjectFactory().clear();
context.getObjectFactory().addDecorator(new DummyUtilDecorator());
}
};