@Test public void testConfigureRootHandler() throws Exception { final ServletContextHandler handler = EasyMock.createNiceMock(ServletContextHandler.class); final FilterHolder filter = EasyMock.createNiceMock(FilterHolder.class); handler.setMaxFormContentSize(-1); EasyMock.expectLastCall().once(); EasyMock.expect(handler.addFilter(GzipFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST))).andReturn(filter).once(); EasyMock.expect(handler.getMimeTypes()).andReturn(new MimeTypes()).anyTimes(); replay(handler, filter); injector.getInstance(AmbariServer.class).configureRootHandler(handler); EasyMock.verify(handler); }
protected void configureRootHandler(ServletContextHandler root) { configureHandlerCompression(root); configureAdditionalContentTypes(root); root.setContextPath(CONTEXT_PATH); root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class)); root.setMaxFormContentSize(-1); root.setResourceBase(configs.getWebAppDir()); }
AmbariServer { protected void configureRootHandler(ServletContextHandler root) { configureHandlerCompression(root); configureAdditionalContentTypes(root); root.setContextPath(CONTEXT_PATH); root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class)); root.setMaxFormContentSize(-1); root.setResourceBase(configs.getWebAppDir()); } }
AmbariServer { protected void configureRootHandler(ServletContextHandler root) { configureHandlerCompression(root); configureAdditionalContentTypes(root); root.setContextPath(CONTEXT_PATH); root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class)); root.setMaxFormContentSize(-1); root.setResourceBase(configs.getWebAppDir()); }  }
AmbariServer { protected void configureRootHandler(ServletContextHandler root) { configureHandlerCompression(root); configureAdditionalContentTypes(root); root.setContextPath(CONTEXT_PATH); root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class)); root.setMaxFormContentSize(-1); root.setResourceBase(configs.getWebAppDir()); }  String getServerOsType(); static AmbariManagementController getController(); @SuppressWarnings("deprecation") void run(); void stop(); @Deprecated void performStaticInjection(); void initViewRegistry(); static void setupProxyAuth(); static void enableLog4jMonitor(Map<String, String> configsMap); static void main(String[] args); }
AmbariServer { protected void configureRootHandler(ServletContextHandler root) { configureHandlerCompression(root); configureAdditionalContentTypes(root); root.setContextPath(CONTEXT_PATH); root.setErrorHandler(injector.getInstance(AmbariErrorHandler.class)); root.setMaxFormContentSize(-1); root.setResourceBase(configs.getWebAppDir()); }  String getServerOsType(); static AmbariManagementController getController(); @SuppressWarnings("deprecation") void run(); void stop(); @Deprecated void performStaticInjection(); void initViewRegistry(); static void setupProxyAuth(); static void enableLog4jMonitor(Map<String, String> configsMap); static void main(String[] args); static final String VIEWS_URL_PATTERN; static final EnumSet<DispatcherType> DISPATCHER_TYPES; volatile boolean running; }