Search in sources :

Example 1 with JspFactoryImpl

use of org.apache.jasper.runtime.JspFactoryImpl in project jetty.project by eclipse.

the class TestJettyJspServlet method setUp.

@Before
public void setUp() throws Exception {
    JspFactory.setDefaultFactory(new JspFactoryImpl());
    _dir = MavenTestingUtils.getTestResourceDir("base");
    _tester = new ServletTester("/context");
    _tester.getContext().setClassLoader(new URLClassLoader(new URL[0], Thread.currentThread().getContextClassLoader()));
    ServletHolder jspHolder = _tester.getContext().addServlet(JettyJspServlet.class, "/*");
    jspHolder.setInitParameter("scratchdir", MavenTestingUtils.getTargetTestingDir().getAbsolutePath());
    _tester.getContext().setResourceBase(_dir.getAbsolutePath());
    _tester.getContext().setAttribute(InstanceManager.class.getName(), new SimpleInstanceManager());
    ServletHolder dfltHolder = new ServletHolder();
    dfltHolder.setName("default");
    dfltHolder.setHeldClass(DfltServlet.class);
    _tester.getContext().addServlet(dfltHolder, "/");
    _tester.start();
}
Also used : ServletTester(org.eclipse.jetty.servlet.ServletTester) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) InstanceManager(org.apache.tomcat.InstanceManager) SimpleInstanceManager(org.apache.tomcat.SimpleInstanceManager) JspFactoryImpl(org.apache.jasper.runtime.JspFactoryImpl) URLClassLoader(java.net.URLClassLoader) SimpleInstanceManager(org.apache.tomcat.SimpleInstanceManager) URL(java.net.URL) Before(org.junit.Before)

Aggregations

URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 JspFactoryImpl (org.apache.jasper.runtime.JspFactoryImpl)1 InstanceManager (org.apache.tomcat.InstanceManager)1 SimpleInstanceManager (org.apache.tomcat.SimpleInstanceManager)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1 ServletTester (org.eclipse.jetty.servlet.ServletTester)1 Before (org.junit.Before)1