Search in sources :

Example 1 with ServletTester

use of org.eclipse.jetty.testing.ServletTester in project pentaho-kettle by pentaho.

the class CarteIT method before.

@Before
public void before() {
    carte.setJobMap(new JobMap());
    carte.setTransformationMap(new TransformationMap());
    carte.setSocketRepository(new SocketRepository(new LogChannel("Carte")));
    tester = new ServletTester();
    tester.addServlet(GetRootServlet.class, "/*");
    tester.addServlet(GetStatusServlet.class, GetStatusServlet.CONTEXT_PATH);
    tester.addServlet(AddTransServlet.class, RegisterTransServlet.CONTEXT_PATH);
    tester.addServlet(StartTransServlet.class, StartTransServlet.CONTEXT_PATH);
    tester.addServlet(PauseTransServlet.class, PauseTransServlet.CONTEXT_PATH);
    try {
        tester.start();
        System.out.println("Started");
    } catch (Exception ex) {
        ex.printStackTrace();
        Assert.fail(ex.getMessage());
    }
}
Also used : ServletTester(org.eclipse.jetty.testing.ServletTester) LogChannel(org.pentaho.di.core.logging.LogChannel) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException) Before(org.junit.Before)

Example 2 with ServletTester

use of org.eclipse.jetty.testing.ServletTester in project pentaho-kettle by pentaho.

the class RestInputIT method setUp.

@BeforeClass
public static void setUp() throws Exception {
    KettleEnvironment.init();
    tester = new ServletTester();
    tester.setContextPath("/context");
    tester.setResourceBase(RestInputIT.class.getResource("/").getFile());
    final ServletHolder servletHolder = tester.addServlet(ServletContainer.class, "/*");
    servletHolder.setInitParameter("com.sun.jersey.config.property.classpath", "/");
    servletHolder.setInitParameter("jersey.config.server.provider.classnames", SimpleRestService.class.getName());
    tester.start();
}
Also used : ServletTester(org.eclipse.jetty.testing.ServletTester) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) BeforeClass(org.junit.BeforeClass)

Aggregations

ServletTester (org.eclipse.jetty.testing.ServletTester)2 IOException (java.io.IOException)1 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1 LogChannel (org.pentaho.di.core.logging.LogChannel)1 SAXException (org.xml.sax.SAXException)1