Search in sources :

Example 1 with DefaultCallbackResource

use of com.eclipsesource.restfuse.DefaultCallbackResource in project restfuse by eclipsesource.

the class HttpTestStatement_Test method setUp.

@BeforeClass
public static void setUp() throws Exception {
    server = new Server(10042);
    ServletContextHandler context = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS);
    CallbackStatement statement = mock(CallbackStatement.class);
    CallbackSerlvet servlet = new CallbackSerlvet(new DefaultCallbackResource(), statement);
    context.addServlet(new ServletHolder(servlet), "/");
    server.start();
    int timer = 0;
    while (!server.isRunning() && timer < TIMEOUT) {
        Thread.sleep(1000);
        timer++;
    }
}
Also used : Server(org.eclipse.jetty.server.Server) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) CallbackStatement(com.eclipsesource.restfuse.internal.callback.CallbackStatement) DefaultCallbackResource(com.eclipsesource.restfuse.DefaultCallbackResource) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler) CallbackSerlvet(com.eclipsesource.restfuse.internal.callback.CallbackSerlvet) BeforeClass(org.junit.BeforeClass)

Example 2 with DefaultCallbackResource

use of com.eclipsesource.restfuse.DefaultCallbackResource in project restfuse by eclipsesource.

the class HttpTestStatementOrder_Test method setUp.

@BeforeClass
public static void setUp() throws Exception {
    server = new Server(10042);
    ServletContextHandler context = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS);
    CallbackStatement statement = mock(CallbackStatement.class);
    CallbackSerlvet servlet = new CallbackSerlvet(new DefaultCallbackResource(), statement);
    context.addServlet(new ServletHolder(servlet), "/");
    server.start();
    int timer = 0;
    while (!server.isRunning() && timer < TIMEOUT) {
        Thread.sleep(1000);
        timer++;
    }
}
Also used : Server(org.eclipse.jetty.server.Server) ServletHolder(org.eclipse.jetty.servlet.ServletHolder) CallbackStatement(com.eclipsesource.restfuse.internal.callback.CallbackStatement) DefaultCallbackResource(com.eclipsesource.restfuse.DefaultCallbackResource) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler) CallbackSerlvet(com.eclipsesource.restfuse.internal.callback.CallbackSerlvet) BeforeClass(org.junit.BeforeClass)

Aggregations

DefaultCallbackResource (com.eclipsesource.restfuse.DefaultCallbackResource)2 CallbackSerlvet (com.eclipsesource.restfuse.internal.callback.CallbackSerlvet)2 CallbackStatement (com.eclipsesource.restfuse.internal.callback.CallbackStatement)2 Server (org.eclipse.jetty.server.Server)2 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)2 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)2 BeforeClass (org.junit.BeforeClass)2