Search in sources :

Example 6 with JarScanFilter

use of org.apache.tomcat.JarScanFilter in project spring-boot by spring-projects.

the class TomcatServletWebServerFactoryTests method tldScanPatternsShouldBeAppliedToContextJarScanner.

@Test
void tldScanPatternsShouldBeAppliedToContextJarScanner() {
    TomcatServletWebServerFactory factory = getFactory();
    this.webServer = factory.getWebServer();
    this.webServer.start();
    Tomcat tomcat = ((TomcatWebServer) this.webServer).getTomcat();
    Context context = (Context) tomcat.getHost().findChildren()[0];
    JarScanFilter jarScanFilter = context.getJarScanner().getJarScanFilter();
    String tldScan = ((StandardJarScanFilter) jarScanFilter).getTldScan();
    assertThat(tldScan).isEqualTo("log4j-taglib*.jar,log4j-web*.jar,log4javascript*.jar,slf4j-taglib*.jar");
}
Also used : InitialContext(javax.naming.InitialContext) ServletContext(jakarta.servlet.ServletContext) StandardContext(org.apache.catalina.core.StandardContext) Context(org.apache.catalina.Context) Tomcat(org.apache.catalina.startup.Tomcat) JarScanFilter(org.apache.tomcat.JarScanFilter) StandardJarScanFilter(org.apache.tomcat.util.scan.StandardJarScanFilter) StandardJarScanFilter(org.apache.tomcat.util.scan.StandardJarScanFilter) Test(org.junit.jupiter.api.Test)

Aggregations

JarScanFilter (org.apache.tomcat.JarScanFilter)6 StandardJarScanFilter (org.apache.tomcat.util.scan.StandardJarScanFilter)3 ServletContext (jakarta.servlet.ServletContext)2 InitialContext (javax.naming.InitialContext)2 Context (org.apache.catalina.Context)2 StandardContext (org.apache.catalina.core.StandardContext)2 Tomcat (org.apache.catalina.startup.Tomcat)2 JarScanner (org.apache.tomcat.JarScanner)2 Test (org.junit.jupiter.api.Test)2 File (java.io.File)1 IOException (java.io.IOException)1 Properties (java.util.Properties)1 JarFile (java.util.jar.JarFile)1 NameNotFoundException (javax.naming.NameNotFoundException)1 NamingException (javax.naming.NamingException)1 TransactionManager (javax.transaction.TransactionManager)1 LifecycleException (org.apache.catalina.LifecycleException)1 LifecycleListener (org.apache.catalina.LifecycleListener)1 Manager (org.apache.catalina.Manager)1 NamingContextListener (org.apache.catalina.core.NamingContextListener)1