public StandardContext configure(Tomcat tomcat, Props props) { addStaticDir(tomcat, getContextPath(props) + "/deploy", new File(props.nonNullValueAsFile(PATH_DATA.getKey()), WEB_DEPLOY_PATH_RELATIVE_TO_DATA_DIR)); StandardContext webapp = addContext(tomcat, getContextPath(props), webappDir(props)); for (Map.Entry<Object, Object> entry : props.rawProperties().entrySet()) { String key = entry.getKey().toString(); webapp.addParameter(key, entry.getValue().toString()); } return webapp; }
@Test public void configure_root_webapp() throws Exception { props.setProperty("foo", "bar"); StandardContext context = mock(StandardContext.class); when(tomcat.addWebapp(anyString(), anyString())).thenReturn(context); underTest.configure(tomcat, new Props(props)); // configure webapp with properties verify(context).addParameter("foo", "bar"); }
public StandardContext configure(Tomcat tomcat, Props props) { addStaticDir(tomcat, getContextPath(props) + "/deploy", new File(props.nonNullValueAsFile(PATH_DATA.getKey()), WEB_DEPLOY_PATH_RELATIVE_TO_DATA_DIR)); StandardContext webapp = addContext(tomcat, getContextPath(props), webappDir(props)); for (Map.Entry<Object, Object> entry : props.rawProperties().entrySet()) { String key = entry.getKey().toString(); webapp.addParameter(key, entry.getValue().toString()); } return webapp; }
} else if (Lifecycle.START_EVENT.equals(type)) { if (TomcatHelper.isTomcat7()) { standardContext.addParameter("openejb.start.late", "true");
} else if (state == 1) { standardContext.addParameter("openejb.start.late", "true"); ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(standardContext.getLoader().getClassLoader());
} else if (state == 1) { standardContext.addParameter("openejb.start.late", "true"); final ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(standardContext.getLoader().getClassLoader());
} else if (state == 1) { standardContext.addParameter("openejb.start.late", "true"); ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(standardContext.getLoader().getClassLoader());
serverContext.addParameter(cp.getKey(), cp.getValue());
serverContext.addParameter(cp.getKey(), cp.getValue());
break; case Lifecycle.START_EVENT: standardContext.addParameter("openejb.start.late", "true"); contextListener.start(standardContext); break;
initParameters.entrySet().forEach(entry -> context.addParameter(entry.getKey(), entry.getValue()));