On 29/07/2013 02:01, jboy...@apache.org wrote: > Author: jboynes > Date: Mon Jul 29 00:01:15 2013 > New Revision: 1507874 > > URL: http://svn.apache.org/r1507874 > Log: > Test case should assert SCI is actually loaded
<snip/> > + public void testServiceLoader() throws Exception { > + Tomcat tomcat = getTomcatInstance(); > + File appDir = new File("test/webapp"); > + // app dir is relative to server home > + StandardContext standardContext = (StandardContext) > tomcat.addWebapp(null, "/test", appDir.getAbsolutePath()); > + tomcat.start(); > + > + ServletContext context = standardContext.getServletContext(); > + WebappServiceLoader<ServletContainerInitializer> loader = new > WebappServiceLoader<>(context); > + Collection<ServletContainerInitializer> initializers = > loader.load(ServletContainerInitializer.class); Looking forward to the point where we use an SCI for JSPs, we don't want to / shouldn't have to do this for every test that uses JSPs. addWebapp() is the interface that provides the settings from the default web.xml and should be just like deploying a webapp in Tomcat. This should enable container SCIs (JSP & WebSocket). addContext() is the 100% programmatic interface that requires the user to explicitly enable everything. Currently, scanning for SCI @HandlesTypes matches isn't supported with addContext(). I think that is the way to go and we should just document it. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org